@namzu/cli 8.3.0 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/login.d.ts +44 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +185 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/discover.js +24 -0
- package/dist/integrations/providers/discover.js.map +1 -1
- package/dist/integrations/providers/oauth.d.ts +14 -3
- package/dist/integrations/providers/oauth.d.ts.map +1 -1
- package/dist/integrations/providers/oauth.js +14 -3
- package/dist/integrations/providers/oauth.js.map +1 -1
- package/dist/tui/App.d.ts +1 -17
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +133 -48
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Markdown.d.ts +14 -0
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Markdown.js +31 -4
- package/dist/tui/Markdown.js.map +1 -1
- package/dist/tui/Picker.d.ts +14 -1
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +12 -3
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/Transcript.d.ts +18 -2
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/Transcript.js +48 -13
- package/dist/tui/Transcript.js.map +1 -1
- package/dist/tui/bottom-spacer.d.ts +22 -8
- package/dist/tui/bottom-spacer.d.ts.map +1 -1
- package/dist/tui/bottom-spacer.js.map +1 -1
- package/dist/tui/live-window.d.ts +97 -0
- package/dist/tui/live-window.d.ts.map +1 -0
- package/dist/tui/live-window.js +140 -0
- package/dist/tui/live-window.js.map +1 -0
- package/dist/tui/login-prompt.d.ts +26 -2
- package/dist/tui/login-prompt.d.ts.map +1 -1
- package/dist/tui/login-prompt.js +16 -7
- package/dist/tui/login-prompt.js.map +1 -1
- package/dist/tui/markdown-block-cache.d.ts +57 -0
- package/dist/tui/markdown-block-cache.d.ts.map +1 -0
- package/dist/tui/markdown-block-cache.js +74 -0
- package/dist/tui/markdown-block-cache.js.map +1 -0
- package/dist/tui/markdownParser.d.ts +33 -0
- package/dist/tui/markdownParser.d.ts.map +1 -1
- package/dist/tui/markdownParser.js +124 -54
- package/dist/tui/markdownParser.js.map +1 -1
- package/package.json +3 -3
package/dist/tui/Picker.js
CHANGED
|
@@ -33,7 +33,7 @@ function keyEntryTarget(keyEntryFor) {
|
|
|
33
33
|
}
|
|
34
34
|
return keyCapableProviders()[0] ?? null;
|
|
35
35
|
}
|
|
36
|
-
export function Picker({ detected, currentProvider, currentModel, onSubmit, onCancel, describeModels = describeProviderModels, onCredential, verify = verifyCredential, keyEntryFor, notice, }) {
|
|
36
|
+
export function Picker({ detected, currentProvider, currentModel, onSubmit, onCancel, describeModels = describeProviderModels, onCredential, onLogin, verify = verifyCredential, keyEntryFor, notice, }) {
|
|
37
37
|
const initialIndex = (currentProvider !== null && currentProvider !== undefined
|
|
38
38
|
? detected.findIndex((d) => d.entry.id === currentProvider)
|
|
39
39
|
: 0) || 0;
|
|
@@ -115,6 +115,15 @@ export function Picker({ detected, currentProvider, currentModel, onSubmit, onCa
|
|
|
115
115
|
// at a list that named every provider except a way to fix the one they
|
|
116
116
|
// chose. The letter does not collide with anything: navigation is arrows
|
|
117
117
|
// and digits.
|
|
118
|
+
// `l` starts a subscription sign-in, on exactly the screens `k` is live
|
|
119
|
+
// on and for the same reason: these are the two states an operator
|
|
120
|
+
// reaches with nothing usable. Checked BEFORE `k` only in the sense of
|
|
121
|
+
// sitting beside it — the letters do not collide, and navigation is
|
|
122
|
+
// arrows and digits.
|
|
123
|
+
if ((detected.length === 0 || keyEntryFor) && onLogin && (input === 'l' || input === 'L')) {
|
|
124
|
+
onLogin();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
118
127
|
if ((detected.length === 0 || keyEntryFor) &&
|
|
119
128
|
onCredential &&
|
|
120
129
|
(input === 'k' || input === 'K')) {
|
|
@@ -224,9 +233,9 @@ export function Picker({ detected, currentProvider, currentModel, onSubmit, onCa
|
|
|
224
233
|
// keyboard cannot drift apart.
|
|
225
234
|
const entryTarget = keyEntryFor && onCredential ? keyEntryTarget(keyEntryFor) : null;
|
|
226
235
|
if (detected.length === 0) {
|
|
227
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.status.warn, paddingX: 1, children: [noticeBox, _jsx(Text, { color: theme.status.warn, bold: true, children: "No providers detected" }), _jsxs(Box, { paddingTop: 1, flexDirection: "column", children: [_jsx(Text, { color: theme.text.primary, children: "namzu scans these sources, in order, for an LLM credential:" }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, \u2026)"] }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 macOS Keychain (an existing OAuth sign-in; macOS only)"] }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 local servers (Ollama localhost:11434, LM Studio localhost:1234)"] })] }), _jsx(Box, { paddingTop: 1, children:
|
|
236
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.status.warn, paddingX: 1, children: [noticeBox, _jsx(Text, { color: theme.status.warn, bold: true, children: "No providers detected" }), _jsxs(Box, { paddingTop: 1, flexDirection: "column", children: [_jsx(Text, { color: theme.text.primary, children: "namzu scans these sources, in order, for an LLM credential:" }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, \u2026)"] }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 a subscription signed in to from namzu (~/.namzu/credentials.json)"] }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 macOS Keychain (an existing OAuth sign-in; macOS only)"] }), _jsxs(Text, { color: theme.text.muted, children: [' ', "\u00B7 local servers (Ollama localhost:11434, LM Studio localhost:1234)"] })] }), onLogin ? (_jsx(Box, { paddingTop: 1, children: _jsxs(Text, { color: theme.text.primary, children: ["Press ", _jsx(Text, { color: theme.accent.system, children: "l" }), " to sign in with a subscription \u2014 no API key, and namzu keeps it for next time."] }) })) : null, _jsx(Box, { paddingTop: 1, children: _jsxs(Text, { color: theme.text.primary, children: ["Or press ", _jsx(Text, { color: theme.accent.system, children: "k" }), " to paste a credential now and use it for this session."] }) }), _jsx(Box, { paddingTop: 1, children: _jsx(Text, { color: theme.text.secondary, children: "You can also set one of the env vars above (or start a local server) and restart." }) }), _jsx(Box, { paddingTop: 1, children: _jsxs(Text, { color: theme.text.muted, children: [onLogin ? 'l: sign in · ' : '', "k: enter a credential \u00B7 esc: exit picker"] }) })] }));
|
|
228
237
|
}
|
|
229
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.focus, paddingX: 1, children: [noticeBox, _jsxs(Box, { flexDirection: "column", paddingBottom: 1, children: [_jsx(Text, { color: theme.accent.system, bold: true, children: "Choose a provider" }), _jsxs(Text, { color: theme.text.muted, children: [detected.length, " detected \u00B7 credentials resolved from env / keychain / local probes"] })] }), _jsx(Box, { flexDirection: "column", children: detected.map((d, i) => (_jsx(ProviderRow, { detected: d, index: i, selected: i === cursor, isCurrent: d.entry.id === currentProvider }, d.entry.id))) }), _jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [_jsxs(Text, { color: theme.text.muted, children: ["\u2191\u2193 or 1-9 navigate \u00B7 enter accept", entryTarget ? ` · k enter a credential for ${entryTarget.label}` : '', " \u00B7 esc cancel"] }), errorHint ? _jsx(Text, { color: theme.status.warn, children: errorHint }) : null] })] }));
|
|
238
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.focus, paddingX: 1, children: [noticeBox, _jsxs(Box, { flexDirection: "column", paddingBottom: 1, children: [_jsx(Text, { color: theme.accent.system, bold: true, children: "Choose a provider" }), _jsxs(Text, { color: theme.text.muted, children: [detected.length, " detected \u00B7 credentials resolved from env / keychain / local probes"] })] }), _jsx(Box, { flexDirection: "column", children: detected.map((d, i) => (_jsx(ProviderRow, { detected: d, index: i, selected: i === cursor, isCurrent: d.entry.id === currentProvider }, d.entry.id))) }), _jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [_jsxs(Text, { color: theme.text.muted, children: ["\u2191\u2193 or 1-9 navigate \u00B7 enter accept", entryTarget ? ` · k enter a credential for ${entryTarget.label}` : '', keyEntryFor && onLogin ? ' · l sign in with a subscription' : '', " \u00B7 esc cancel"] }), errorHint ? _jsx(Text, { color: theme.status.warn, children: errorHint }) : null] })] }));
|
|
230
239
|
}
|
|
231
240
|
function ModelStepView({ providerLabel, step, cursor, errorHint, }) {
|
|
232
241
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.focus, paddingX: 1, children: [_jsxs(Box, { flexDirection: "column", paddingBottom: 1, children: [_jsx(Text, { color: theme.accent.system, bold: true, children: "Choose a model" }), _jsx(Text, { color: theme.text.muted, children: providerLabel })] }), step === undefined ? (_jsxs(Text, { color: theme.text.muted, children: ["Asking ", providerLabel, " what it has\u2026"] })) : (_jsxs(_Fragment, { children: [step.notice ? (_jsx(Box, { paddingBottom: 1, children: _jsx(Text, { color: theme.status.warn, children: step.notice }) })) : null, _jsx(Box, { flexDirection: "column", children: step.choices.map((c, i) => (_jsxs(Text, { color: i === cursor ? theme.accent.system : theme.text.primary, children: [i === cursor ? '❯ ' : ' ', i + 1, ". ", c.label, c.note ? ` ${c.note}` : ''] }, c.id))) })] })), _jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [_jsx(Text, { color: theme.text.muted, children: "\u2191\u2193 or 1-9 navigate \u00B7 enter accept \u00B7 esc back" }), errorHint ? _jsx(Text, { color: theme.status.warn, children: errorHint }) : null] })] }));
|
package/dist/tui/Picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|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A2D;YAC3D,OAAO,0BAA0B,CAAA;QAClC,KAAK,SAAS;YACb,kEAAkE;YAClE,qEAAqE;YACrE,2DAA2D;YAC3D,OAAO,2BAA2B,CAAA;IACpC,CAAC;AACF,CAAC"}
|
package/dist/tui/Transcript.d.ts
CHANGED
|
@@ -8,11 +8,27 @@
|
|
|
8
8
|
import type { ReactNode } from 'react';
|
|
9
9
|
import type { TranscriptMessage } from './types.js';
|
|
10
10
|
export interface TranscriptProps {
|
|
11
|
-
/** Finalized messages
|
|
11
|
+
/** Finalized messages, oldest first. */
|
|
12
12
|
readonly messages: readonly TranscriptMessage[];
|
|
13
13
|
/** The in-progress streaming message, re-rendered live below the static log. */
|
|
14
14
|
readonly pending: TranscriptMessage | null;
|
|
15
15
|
readonly state: 'idle' | 'thinking' | 'tool' | 'awaiting-permission';
|
|
16
|
+
/**
|
|
17
|
+
* How many of `messages` have been handed to scrollback.
|
|
18
|
+
*
|
|
19
|
+
* `messages[0, settled)` go through `<Static>`, which prints a row once and
|
|
20
|
+
* never redraws it; the rest are drawn live and can still change — which is
|
|
21
|
+
* what makes expanding a body already on screen possible at all. The caller
|
|
22
|
+
* decides how many that is, because the answer depends on the terminal's
|
|
23
|
+
* height and on the spacer's arithmetic; see `live-window.ts`. Passing
|
|
24
|
+
* `messages.length` is the everything-is-static behaviour.
|
|
25
|
+
*
|
|
26
|
+
* It must never decrease for a given `resetKey`. `<Static>` counts what it
|
|
27
|
+
* has emitted and renders only past that count, so a shrinking prefix leaves
|
|
28
|
+
* rows unprinted, and a row already drawn live would be printed a second
|
|
29
|
+
* time on its way back out.
|
|
30
|
+
*/
|
|
31
|
+
readonly settled: number;
|
|
16
32
|
/** Bump to reset the static log (e.g. /clear, /resume). */
|
|
17
33
|
readonly resetKey: number;
|
|
18
34
|
/**
|
|
@@ -23,7 +39,7 @@ export interface TranscriptProps {
|
|
|
23
39
|
*/
|
|
24
40
|
readonly header?: ReactNode;
|
|
25
41
|
}
|
|
26
|
-
export declare function Transcript({ messages, pending, state, resetKey, header }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function Transcript({ messages, pending, state, settled, resetKey, header, }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
27
43
|
/**
|
|
28
44
|
* Whether a body will be truncated, and so will print a hint naming itself.
|
|
29
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/tui/Transcript.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC/B
|
|
1
|
+
{"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/tui/Transcript.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,qBAAqB,CAAA;IACpE;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAC3B;AAcD,wBAAgB,UAAU,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,GACN,EAAE,eAAe,2CA2DjB;AA0ID;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAE3E;AAWD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,MAAM,EAAE,CAqBjF"}
|
package/dist/tui/Transcript.js
CHANGED
|
@@ -7,28 +7,52 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* a braille spinner in the gutter while the agent works.
|
|
8
8
|
*/
|
|
9
9
|
import { Box, Static, Text } from 'ink';
|
|
10
|
-
import { useEffect, useState } from 'react';
|
|
10
|
+
import { memo, useEffect, useState } from 'react';
|
|
11
11
|
import { Markdown } from './Markdown.js';
|
|
12
12
|
import { theme } from './theme.js';
|
|
13
13
|
const COLLAPSE_LINES = 6;
|
|
14
14
|
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
15
|
-
export function Transcript({ messages, pending, state, resetKey, header }) {
|
|
15
|
+
export function Transcript({ messages, pending, state, settled, resetKey, header, }) {
|
|
16
16
|
const spinner = useSpinner(state !== 'idle');
|
|
17
|
+
const inScrollback = Math.min(Math.max(settled, 0), messages.length);
|
|
17
18
|
// The banner is row 0 so it prints to the very top of scrollback; messages
|
|
18
19
|
// follow it. <Static> renders each row exactly once and never re-renders it,
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
20
|
+
// so everything behind the live window costs nothing per frame — the whole
|
|
21
|
+
// transcript was once re-rendered on every spinner tick, which exhausted
|
|
22
|
+
// memory on long sessions.
|
|
22
23
|
const rows = [
|
|
23
24
|
...(header ? [{ kind: 'header' }] : []),
|
|
24
|
-
...messages.map((message, i) => ({
|
|
25
|
+
...messages.slice(0, inScrollback).map((message, i) => ({
|
|
25
26
|
kind: 'message',
|
|
26
27
|
message,
|
|
27
28
|
prev: messages[i - 1],
|
|
28
29
|
})),
|
|
29
30
|
];
|
|
30
|
-
|
|
31
|
+
// The live window. Memoised per row, and that is what keeps this affordable:
|
|
32
|
+
// the spinner ticks about twelve times a second and every tick re-renders
|
|
33
|
+
// this component, so an unmemoised window would re-render its rows — parse
|
|
34
|
+
// their markdown, rebuild their elements — on each one. The rows themselves
|
|
35
|
+
// are unchanged objects between ticks, so the memo holds; the row that just
|
|
36
|
+
// changed is the only one that renders.
|
|
37
|
+
const live = messages.slice(inScrollback);
|
|
38
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: rows, children: (row) => row.kind === 'header' ? (_jsx(Box, { children: header }, "header")) : (_jsx(MessageRow, { message: row.message, prev: row.prev, spinner: "" }, row.message.id)) }, resetKey), live.map((message, i) => (_jsx(LiveRow, { message: message, prev: messages[inScrollback + i - 1], spinner: "" }, message.id))), pending ? (_jsx(MessageRow, { message: pending, prev: messages[messages.length - 1], spinner: spinner })) : null, messages.length === 0 && !pending ? (_jsx(Box, { paddingY: 1, children: _jsxs(Text, { color: theme.text.muted, children: ["Type a message to begin \u00B7 ", _jsx(Text, { color: theme.text.secondary, children: "/help" }), " for commands"] }) })) : null] }));
|
|
31
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A row in the live window.
|
|
42
|
+
*
|
|
43
|
+
* Memoised on the whole props object rather than on a hand-picked key. React's
|
|
44
|
+
* default shallow compare over `{message, prev, spinner}` is already exactly
|
|
45
|
+
* "has anything about this row changed": the transcript is held as immutable
|
|
46
|
+
* rows, so an update rebuilds only the rows it touches and leaves every other
|
|
47
|
+
* object identical. A `(id, detailExpanded)` key would be the same answer for
|
|
48
|
+
* two fields and silently the wrong one for every other field a row has.
|
|
49
|
+
*
|
|
50
|
+
* Terminal width is deliberately NOT part of it. Nothing in a row's element
|
|
51
|
+
* tree depends on the width — wrapping is done by the layout engine from the
|
|
52
|
+
* same tree, and a resize re-lays-out without re-rendering — so a width key
|
|
53
|
+
* would be a prop that drives nothing.
|
|
54
|
+
*/
|
|
55
|
+
const LiveRow = memo(MessageRow);
|
|
32
56
|
function MessageRow({ message, prev, spinner, }) {
|
|
33
57
|
const glyph = message.pending ? spinner : (message.glyph ?? glyphForRole(message.role));
|
|
34
58
|
// The `⎿` tool-result gutter is rendered dim so the call line leads.
|
|
@@ -42,12 +66,23 @@ function MessageRow({ message, prev, spinner, }) {
|
|
|
42
66
|
/**
|
|
43
67
|
* Collapsible tool diff / output, aligned under the content gutter.
|
|
44
68
|
*
|
|
45
|
-
* `expanded` comes from the ROW,
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
69
|
+
* `expanded` comes from the ROW, and that is now load-bearing in the opposite
|
|
70
|
+
* direction from the reason it was written.
|
|
71
|
+
*
|
|
72
|
+
* It used to say that a view-wide setting could not work, because every
|
|
73
|
+
* finalized row went through `<Static>`: that renders each item once and calls
|
|
74
|
+
* the CURRENT render function only for items it has not emitted yet, so a flag
|
|
75
|
+
* flipped now would apply to rows that have not happened and to none of the
|
|
76
|
+
* rows on screen. True of a row in scrollback, and it is why `/expand` pushes a
|
|
77
|
+
* new row carrying the same lines rather than reopening the old one.
|
|
78
|
+
*
|
|
79
|
+
* It is not true of the live window. Those rows are re-rendered from state on
|
|
80
|
+
* every frame, so flipping this flag on one of them redraws that row in place —
|
|
81
|
+
* which is what the expand key now does, for the rows an operator is actually
|
|
82
|
+
* looking at. The flag stays on the row rather than becoming view-wide because
|
|
83
|
+
* the two mechanisms have to coexist: `/expand` still appends for anything that
|
|
84
|
+
* has settled into scrollback, and a view-wide flag would mean something
|
|
85
|
+
* different to each half.
|
|
51
86
|
*/
|
|
52
87
|
function DetailBlock({ lines, expanded, detailRef, }) {
|
|
53
88
|
const { shown, hidden } = splitDetail(lines, expanded);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../src/tui/Transcript.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../src/tui/Transcript.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAoClC,MAAM,cAAc,GAAG,CAAC,CAAA;AAExB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAA;AAUlF,MAAM,UAAU,UAAU,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,GACW;IACjB,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,KAAK,MAAM,CAAC,CAAA;IAE5C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACpE,2EAA2E;IAC3E,6EAA6E;IAC7E,2EAA2E;IAC3E,yEAAyE;IACzE,2BAA2B;IAC3B,MAAM,IAAI,GAAgB;QACzB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,CAAC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C,MAAM,CAAC,SAAS,CAAA;QAC9B,KAAK,QAAQ;YACZ,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;QACxB,KAAK,MAAM;YACV,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA;IAC1B,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,IAA+B;IAC3D,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,MAAM;YACV,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAA;QAC1B,KAAK,WAAW;YACf,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAA;QAC1B,KAAK,QAAQ;YACZ,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAA;QAC5B,KAAK,MAAM;YACV,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAA;IAC7B,CAAC;AACF,CAAC"}
|
|
@@ -49,17 +49,31 @@ export interface SpacerInput {
|
|
|
49
49
|
/** Terminal width, for wrapping. `undefined` falls back to 80. */
|
|
50
50
|
readonly columns: number | undefined;
|
|
51
51
|
/**
|
|
52
|
-
* The
|
|
52
|
+
* The lines of the transcript that have been printed to scrollback, as
|
|
53
|
+
* emitted — before ink renders them.
|
|
53
54
|
*
|
|
54
|
-
* Every line a row will print, including the collapsed body under a
|
|
55
|
-
* call. The caller used to pass each row's `content` alone, which
|
|
56
|
-
* eight-row tool result as one row: the estimate then ran low by
|
|
57
|
-
* the asymmetry above says exactly what running low costs.
|
|
58
|
-
* row whose whole substance is its body, so a caller that
|
|
59
|
-
* alone would hand a two-hundred-line row over as a single
|
|
55
|
+
* Every line such a row will print, including the collapsed body under a
|
|
56
|
+
* tool call. The caller used to pass each row's `content` alone, which
|
|
57
|
+
* counted an eight-row tool result as one row: the estimate then ran low by
|
|
58
|
+
* seven, and the asymmetry above says exactly what running low costs.
|
|
59
|
+
* `/expand` makes a row whose whole substance is its body, so a caller that
|
|
60
|
+
* passed content alone would hand a two-hundred-line row over as a single
|
|
61
|
+
* line.
|
|
62
|
+
*
|
|
63
|
+
* Rows still in the live window belong in {@link liveRows}, not here. They
|
|
64
|
+
* are two different quantities — content above the live region, and the live
|
|
65
|
+
* region's own height — and this one is only the first.
|
|
60
66
|
*/
|
|
61
67
|
readonly transcript: readonly string[];
|
|
62
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Rows the live region occupies: the window of transcript rows that are
|
|
70
|
+
* still redrawable, then the activity line, composer frame and status bar.
|
|
71
|
+
*
|
|
72
|
+
* A constant until the live window existed. It is now a function of what is
|
|
73
|
+
* in that window, because an expanded body in it is thirty rows of live
|
|
74
|
+
* region rather than eight, and a spacer that kept assuming the old constant
|
|
75
|
+
* would pad the composer straight off the bottom. See `live-window.ts`.
|
|
76
|
+
*/
|
|
63
77
|
readonly liveRows: number;
|
|
64
78
|
}
|
|
65
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-spacer.d.ts","sourceRoot":"","sources":["../../src/tui/bottom-spacer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,IAAI,CAAA;AAE5B,MAAM,WAAW,WAAW;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC
|
|
1
|
+
{"version":3,"file":"bottom-spacer.d.ts","sourceRoot":"","sources":["../../src/tui/bottom-spacer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,IAAI,CAAA;AAE5B,MAAM,WAAW,WAAW;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAc3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-spacer.js","sourceRoot":"","sources":["../../src/tui/bottom-spacer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"bottom-spacer.js","sourceRoot":"","sources":["../../src/tui/bottom-spacer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAA;AAoC5B;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACpC,UAA6B,EAC7B,OAA2B;IAE3B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,CAAA;IACzC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAChC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;QACrD,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IAClD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAErD,uEAAuE;IACvE,oBAAoB;IACpB,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE;QAAE,OAAO,CAAC,CAAA;IAEvE,MAAM,IAAI,GAAG,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,QAAQ,GAAG,WAAW,CAAA;IAEhF,2EAA2E;IAC3E,6EAA6E;IAC7E,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,CAAC,CAAA;IAE1B,OAAO,IAAI,GAAG,IAAI,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much of the transcript is still ALIVE — redrawable — and how much has
|
|
3
|
+
* already been handed to the terminal's own scrollback.
|
|
4
|
+
*
|
|
5
|
+
* ## Why there is a window at all
|
|
6
|
+
*
|
|
7
|
+
* Every finalized row used to go straight into `<Static>`, which prints a row
|
|
8
|
+
* once and never redraws it. That kept per-frame work bounded, and it also made
|
|
9
|
+
* changing a row that is already on screen impossible by construction: an
|
|
10
|
+
* expand key could not reopen a collapsed body, so expansion had to become a
|
|
11
|
+
* command that appends a second copy of the output further down.
|
|
12
|
+
*
|
|
13
|
+
* A small window of the most recent rows is kept live instead. Inside it a row
|
|
14
|
+
* can be redrawn in place, so expansion works where an operator actually looks;
|
|
15
|
+
* `/expand <n>` remains the way to reach anything older, and the hint under a
|
|
16
|
+
* collapsed body already degrades correctly when a row has no number.
|
|
17
|
+
*
|
|
18
|
+
* ## Why the window is bounded by HEIGHT, not by a count of rows
|
|
19
|
+
*
|
|
20
|
+
* This is the constraint the whole design turns on, and it is a property of the
|
|
21
|
+
* renderer rather than a preference. When the live region's height reaches the
|
|
22
|
+
* viewport's, ink stops doing an incremental repaint and instead writes
|
|
23
|
+
* `clearTerminal` followed by **the entire static output it has accumulated
|
|
24
|
+
* this session** plus the frame. On a long session that is the whole transcript,
|
|
25
|
+
* re-serialized on every spinner tick — which is the allocation churn that
|
|
26
|
+
* pushed `<Static>` to swallow everything in the first place.
|
|
27
|
+
*
|
|
28
|
+
* So the window takes rows from the end only while their estimated height fits
|
|
29
|
+
* a budget the live furniture and a safety margin are already subtracted from.
|
|
30
|
+
* A single row taller than the budget leaves the window empty, and an empty
|
|
31
|
+
* window is exactly the previous behaviour — the failure direction is "no
|
|
32
|
+
* retroactive expansion", never "repaint the session".
|
|
33
|
+
*
|
|
34
|
+
* ## Why it only ever moves one way
|
|
35
|
+
*
|
|
36
|
+
* `settled` is a floor the caller carries between renders. `<Static>` keeps an
|
|
37
|
+
* index of how many items it has emitted and renders only what is past it, so a
|
|
38
|
+
* shrinking item list would leave rows unprinted; and a row that has already
|
|
39
|
+
* been drawn live must not be handed back to a mechanism that would print it
|
|
40
|
+
* again. Rows therefore leave the window in one direction, oldest first, and a
|
|
41
|
+
* row that has settled never comes back.
|
|
42
|
+
*/
|
|
43
|
+
import type { TranscriptMessage } from './types.js';
|
|
44
|
+
/**
|
|
45
|
+
* The most rows the window will ever hold, whatever the terminal's height.
|
|
46
|
+
*
|
|
47
|
+
* A cap on top of the height budget, because the budget alone would put thirty
|
|
48
|
+
* short rows in the live region on a tall terminal — thirty rows re-laid-out
|
|
49
|
+
* per spinner tick to make retroactive expansion available on output nobody is
|
|
50
|
+
* still looking at. Six covers what an operator is working with: a tool call,
|
|
51
|
+
* its result, and the exchange around them.
|
|
52
|
+
*/
|
|
53
|
+
export declare const MAX_LIVE_ROWS = 6;
|
|
54
|
+
export interface LiveWindowInput {
|
|
55
|
+
/** Finalized rows, oldest first. The pending row is not one of these. */
|
|
56
|
+
readonly messages: readonly TranscriptMessage[];
|
|
57
|
+
/** Terminal height. `undefined` when not a TTY. */
|
|
58
|
+
readonly rows: number | undefined;
|
|
59
|
+
/** Terminal width, for wrapping. `undefined` falls back to 80. */
|
|
60
|
+
readonly columns: number | undefined;
|
|
61
|
+
/** Rows the live region occupies apart from the window: activity, composer, status bar. */
|
|
62
|
+
readonly furnitureRows: number;
|
|
63
|
+
/** How many rows have already settled into scrollback. The window never reaches back past this. */
|
|
64
|
+
readonly settled: number;
|
|
65
|
+
}
|
|
66
|
+
export interface LiveWindow {
|
|
67
|
+
/** `messages[0, settled)` are in scrollback; the rest are drawn live. */
|
|
68
|
+
readonly settled: number;
|
|
69
|
+
/** The live rows' estimated height, for the bottom spacer to account for. */
|
|
70
|
+
readonly rows: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Every line the finalized transcript will print, for a height estimate.
|
|
74
|
+
*
|
|
75
|
+
* Exported so the wiring is testable rather than only typecheckable. The
|
|
76
|
+
* spacer's own docblock states the asymmetry it depends on: over-count the
|
|
77
|
+
* content and the composer merely floats, under-count it and the composer is
|
|
78
|
+
* pushed off the bottom. The caller used to pass each row's `content` alone,
|
|
79
|
+
* which counted a six-line collapsed tool body as nothing at all — the estimate
|
|
80
|
+
* ran low by six per tool call, in the direction that costs the usability
|
|
81
|
+
* rather than the feature. `/expand` makes it acute: a row whose entire
|
|
82
|
+
* substance is a two-hundred-line body would have been handed over as one line.
|
|
83
|
+
*
|
|
84
|
+
* A pending row is excluded because it is not in the static log yet; the
|
|
85
|
+
* spacer's `liveRows` covers the live region.
|
|
86
|
+
*/
|
|
87
|
+
export declare function transcriptLines(messages: readonly TranscriptMessage[]): readonly string[];
|
|
88
|
+
/**
|
|
89
|
+
* How much of the transcript stays live, given the room there is for it.
|
|
90
|
+
*
|
|
91
|
+
* Returns `settled === messages.length` — everything in scrollback, nothing
|
|
92
|
+
* redrawable — whenever the answer is not knowable: no TTY, an implausible
|
|
93
|
+
* height, or a most-recent row too tall to hold. That is the previous
|
|
94
|
+
* behaviour, and it is the safe direction.
|
|
95
|
+
*/
|
|
96
|
+
export declare function liveWindow(input: LiveWindowInput): LiveWindow;
|
|
97
|
+
//# sourceMappingURL=live-window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-window.d.ts","sourceRoot":"","sources":["../../src/tui/live-window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,MAAM,WAAW,eAAe;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,2FAA2F;IAC3F,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAmBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,MAAM,EAAE,CAGzF;AA4BD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,CAmB7D"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much of the transcript is still ALIVE — redrawable — and how much has
|
|
3
|
+
* already been handed to the terminal's own scrollback.
|
|
4
|
+
*
|
|
5
|
+
* ## Why there is a window at all
|
|
6
|
+
*
|
|
7
|
+
* Every finalized row used to go straight into `<Static>`, which prints a row
|
|
8
|
+
* once and never redraws it. That kept per-frame work bounded, and it also made
|
|
9
|
+
* changing a row that is already on screen impossible by construction: an
|
|
10
|
+
* expand key could not reopen a collapsed body, so expansion had to become a
|
|
11
|
+
* command that appends a second copy of the output further down.
|
|
12
|
+
*
|
|
13
|
+
* A small window of the most recent rows is kept live instead. Inside it a row
|
|
14
|
+
* can be redrawn in place, so expansion works where an operator actually looks;
|
|
15
|
+
* `/expand <n>` remains the way to reach anything older, and the hint under a
|
|
16
|
+
* collapsed body already degrades correctly when a row has no number.
|
|
17
|
+
*
|
|
18
|
+
* ## Why the window is bounded by HEIGHT, not by a count of rows
|
|
19
|
+
*
|
|
20
|
+
* This is the constraint the whole design turns on, and it is a property of the
|
|
21
|
+
* renderer rather than a preference. When the live region's height reaches the
|
|
22
|
+
* viewport's, ink stops doing an incremental repaint and instead writes
|
|
23
|
+
* `clearTerminal` followed by **the entire static output it has accumulated
|
|
24
|
+
* this session** plus the frame. On a long session that is the whole transcript,
|
|
25
|
+
* re-serialized on every spinner tick — which is the allocation churn that
|
|
26
|
+
* pushed `<Static>` to swallow everything in the first place.
|
|
27
|
+
*
|
|
28
|
+
* So the window takes rows from the end only while their estimated height fits
|
|
29
|
+
* a budget the live furniture and a safety margin are already subtracted from.
|
|
30
|
+
* A single row taller than the budget leaves the window empty, and an empty
|
|
31
|
+
* window is exactly the previous behaviour — the failure direction is "no
|
|
32
|
+
* retroactive expansion", never "repaint the session".
|
|
33
|
+
*
|
|
34
|
+
* ## Why it only ever moves one way
|
|
35
|
+
*
|
|
36
|
+
* `settled` is a floor the caller carries between renders. `<Static>` keeps an
|
|
37
|
+
* index of how many items it has emitted and renders only what is past it, so a
|
|
38
|
+
* shrinking item list would leave rows unprinted; and a row that has already
|
|
39
|
+
* been drawn live must not be handed back to a mechanism that would print it
|
|
40
|
+
* again. Rows therefore leave the window in one direction, oldest first, and a
|
|
41
|
+
* row that has settled never comes back.
|
|
42
|
+
*/
|
|
43
|
+
import { renderedDetailLines } from './Transcript.js';
|
|
44
|
+
import { SAFETY_ROWS, estimateRenderedLines } from './bottom-spacer.js';
|
|
45
|
+
/**
|
|
46
|
+
* The most rows the window will ever hold, whatever the terminal's height.
|
|
47
|
+
*
|
|
48
|
+
* A cap on top of the height budget, because the budget alone would put thirty
|
|
49
|
+
* short rows in the live region on a tall terminal — thirty rows re-laid-out
|
|
50
|
+
* per spinner tick to make retroactive expansion available on output nobody is
|
|
51
|
+
* still looking at. Six covers what an operator is working with: a tool call,
|
|
52
|
+
* its result, and the exchange around them.
|
|
53
|
+
*/
|
|
54
|
+
export const MAX_LIVE_ROWS = 6;
|
|
55
|
+
/**
|
|
56
|
+
* Every line one row will print, including the body under a tool call.
|
|
57
|
+
*
|
|
58
|
+
* The blank row `MessageRow` puts above every entry but the first and the `⎿`
|
|
59
|
+
* result rows is counted, because one row per entry is not negligible: forty
|
|
60
|
+
* entries is forty rows, which on most terminals is the whole viewport. The
|
|
61
|
+
* content is indented by the two-column glyph gutter it renders beside, so a
|
|
62
|
+
* long line is measured against the width it actually has.
|
|
63
|
+
*/
|
|
64
|
+
function messageLines(message, hasPrev) {
|
|
65
|
+
return [
|
|
66
|
+
...(hasPrev && message.glyph !== '⎿' ? [''] : []),
|
|
67
|
+
` ${message.content}`,
|
|
68
|
+
...renderedDetailLines(message),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Every line the finalized transcript will print, for a height estimate.
|
|
73
|
+
*
|
|
74
|
+
* Exported so the wiring is testable rather than only typecheckable. The
|
|
75
|
+
* spacer's own docblock states the asymmetry it depends on: over-count the
|
|
76
|
+
* content and the composer merely floats, under-count it and the composer is
|
|
77
|
+
* pushed off the bottom. The caller used to pass each row's `content` alone,
|
|
78
|
+
* which counted a six-line collapsed tool body as nothing at all — the estimate
|
|
79
|
+
* ran low by six per tool call, in the direction that costs the usability
|
|
80
|
+
* rather than the feature. `/expand` makes it acute: a row whose entire
|
|
81
|
+
* substance is a two-hundred-line body would have been handed over as one line.
|
|
82
|
+
*
|
|
83
|
+
* A pending row is excluded because it is not in the static log yet; the
|
|
84
|
+
* spacer's `liveRows` covers the live region.
|
|
85
|
+
*/
|
|
86
|
+
export function transcriptLines(messages) {
|
|
87
|
+
const finalized = messages.filter((m) => !m.pending);
|
|
88
|
+
return finalized.flatMap((message, i) => messageLines(message, i > 0));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Rows added to each windowed row's estimate.
|
|
92
|
+
*
|
|
93
|
+
* `estimateRenderedLines` is deliberately an UNDER-count, because for the
|
|
94
|
+
* bottom spacer counting low leaves more apparent room and the safety margin
|
|
95
|
+
* absorbs the difference. Here the asymmetry runs the other way: under-count a
|
|
96
|
+
* live row and the window takes more of the viewport than it was budgeted, and
|
|
97
|
+
* the price of exceeding the viewport is the whole-session repaint this window
|
|
98
|
+
* exists to stay clear of. Over-count and the window merely holds one row
|
|
99
|
+
* fewer.
|
|
100
|
+
*
|
|
101
|
+
* Two per row covers what the line estimate cannot see — the rule a code block
|
|
102
|
+
* draws around itself, the blank line markdown puts between blocks — without
|
|
103
|
+
* needing to model any of it.
|
|
104
|
+
*/
|
|
105
|
+
const ROW_HEIGHT_ALLOWANCE = 2;
|
|
106
|
+
/** How tall one row is expected to render, rounded UP. */
|
|
107
|
+
function messageHeight(message, hasPrev, columns) {
|
|
108
|
+
return estimateRenderedLines(messageLines(message, hasPrev), columns) + ROW_HEIGHT_ALLOWANCE;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* How much of the transcript stays live, given the room there is for it.
|
|
112
|
+
*
|
|
113
|
+
* Returns `settled === messages.length` — everything in scrollback, nothing
|
|
114
|
+
* redrawable — whenever the answer is not knowable: no TTY, an implausible
|
|
115
|
+
* height, or a most-recent row too tall to hold. That is the previous
|
|
116
|
+
* behaviour, and it is the safe direction.
|
|
117
|
+
*/
|
|
118
|
+
export function liveWindow(input) {
|
|
119
|
+
const { messages, rows, columns, furnitureRows, settled } = input;
|
|
120
|
+
const floor = Math.min(Math.max(settled, 0), messages.length);
|
|
121
|
+
if (rows === undefined || !Number.isFinite(rows))
|
|
122
|
+
return { settled: messages.length, rows: 0 };
|
|
123
|
+
const budget = rows - furnitureRows - SAFETY_ROWS;
|
|
124
|
+
if (budget < 1)
|
|
125
|
+
return { settled: messages.length, rows: 0 };
|
|
126
|
+
let height = 0;
|
|
127
|
+
let held = 0;
|
|
128
|
+
for (let i = messages.length - 1; i >= floor && held < MAX_LIVE_ROWS; i--) {
|
|
129
|
+
const message = messages[i];
|
|
130
|
+
if (!message)
|
|
131
|
+
break;
|
|
132
|
+
const next = height + messageHeight(message, i > 0, columns);
|
|
133
|
+
if (next > budget)
|
|
134
|
+
break;
|
|
135
|
+
height = next;
|
|
136
|
+
held += 1;
|
|
137
|
+
}
|
|
138
|
+
return { settled: messages.length - held, rows: height };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=live-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-window.js","sourceRoot":"","sources":["../../src/tui/live-window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAGvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAsB9B;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,OAA0B,EAAE,OAAgB;IACjE,OAAO;QACN,GAAG,CAAC,OAAO,I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