@namzu/cli 28.1.1 → 29.0.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/CHANGELOG.md +79 -0
- package/dist/integrations/subagents/runtime.d.ts +16 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +34 -4
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +28 -4
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.js +177 -35
- package/dist/tui/AgentExplorer.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +231 -21
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +10 -4
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/ComposerFrame.d.ts +10 -1
- package/dist/tui/ComposerFrame.d.ts.map +1 -1
- package/dist/tui/ComposerFrame.js +27 -4
- package/dist/tui/ComposerFrame.js.map +1 -1
- package/dist/tui/EffortSlider.d.ts +54 -0
- package/dist/tui/EffortSlider.d.ts.map +1 -0
- package/dist/tui/EffortSlider.js +131 -0
- package/dist/tui/EffortSlider.js.map +1 -0
- package/dist/tui/LiveActivity.d.ts +23 -3
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/LiveActivity.js +23 -17
- package/dist/tui/LiveActivity.js.map +1 -1
- package/dist/tui/Markdown.d.ts +29 -2
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Markdown.js +74 -36
- package/dist/tui/Markdown.js.map +1 -1
- package/dist/tui/StatusBar.js +1 -1
- package/dist/tui/StatusBar.js.map +1 -1
- package/dist/tui/Transcript.d.ts +24 -1
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/Transcript.js +35 -8
- package/dist/tui/Transcript.js.map +1 -1
- package/dist/tui/ViewportBound.d.ts +48 -0
- package/dist/tui/ViewportBound.d.ts.map +1 -0
- package/dist/tui/ViewportBound.js +55 -0
- package/dist/tui/ViewportBound.js.map +1 -0
- package/dist/tui/agent-transcript-rows.d.ts +59 -0
- package/dist/tui/agent-transcript-rows.d.ts.map +1 -0
- package/dist/tui/agent-transcript-rows.js +115 -0
- package/dist/tui/agent-transcript-rows.js.map +1 -0
- package/dist/tui/agent.d.ts +25 -0
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +49 -3
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/live-window.d.ts +16 -0
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/live-window.js +50 -3
- package/dist/tui/live-window.js.map +1 -1
- package/dist/tui/markdown-block-cache.d.ts +9 -7
- package/dist/tui/markdown-block-cache.d.ts.map +1 -1
- package/dist/tui/markdown-block-cache.js +9 -7
- package/dist/tui/markdown-block-cache.js.map +1 -1
- package/dist/tui/markdown-table.d.ts +55 -0
- package/dist/tui/markdown-table.d.ts.map +1 -0
- package/dist/tui/markdown-table.js +175 -0
- package/dist/tui/markdown-table.js.map +1 -0
- package/dist/tui/markdown-wrap.d.ts +53 -0
- package/dist/tui/markdown-wrap.d.ts.map +1 -0
- package/dist/tui/markdown-wrap.js +189 -0
- package/dist/tui/markdown-wrap.js.map +1 -0
- package/dist/tui/markdownParser.d.ts +6 -0
- package/dist/tui/markdownParser.d.ts.map +1 -1
- package/dist/tui/markdownParser.js +49 -10
- package/dist/tui/markdownParser.js.map +1 -1
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +3 -0
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/stream-blocks.d.ts.map +1 -1
- package/dist/tui/stream-blocks.js +32 -3
- package/dist/tui/stream-blocks.js.map +1 -1
- package/dist/tui/theme.d.ts +13 -0
- package/dist/tui/theme.d.ts.map +1 -1
- package/dist/tui/theme.js +16 -0
- package/dist/tui/theme.js.map +1 -1
- package/dist/tui/types.d.ts +7 -2
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/units.d.ts +6 -0
- package/dist/tui/units.d.ts.map +1 -0
- package/dist/tui/units.js +20 -0
- package/dist/tui/units.js.map +1 -0
- package/dist/tui/web-activity.d.ts +58 -0
- package/dist/tui/web-activity.d.ts.map +1 -0
- package/dist/tui/web-activity.js +105 -0
- package/dist/tui/web-activity.js.map +1 -0
- package/package.json +7 -7
package/dist/tui/LiveActivity.js
CHANGED
|
@@ -7,10 +7,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
*/
|
|
8
8
|
import { Box, Text, useAnimation, useIsScreenReaderEnabled, useStdout } from 'ink';
|
|
9
9
|
import { useRef } from 'react';
|
|
10
|
+
import { formatCompactCount, formatElapsed } from './units.js';
|
|
10
11
|
import { terminalDisplayText } from './terminal-display.js';
|
|
11
12
|
import { theme } from './theme.js';
|
|
12
13
|
const MAX_VISIBLE_TOOLS = 3;
|
|
13
|
-
export function LiveActivity({ compact = false, activeTools, working, agentCount = 0, interruptible = false, animate = true, thinking = null, }) {
|
|
14
|
+
export function LiveActivity({ compact = false, activeTools, working, agentCount = 0, interruptible = false, animate = true, thinking = null, tokens, }) {
|
|
14
15
|
const { stdout } = useStdout();
|
|
15
16
|
const screenReader = useIsScreenReaderEnabled();
|
|
16
17
|
const motion = animate &&
|
|
@@ -39,29 +40,34 @@ export function LiveActivity({ compact = false, activeTools, working, agentCount
|
|
|
39
40
|
: theme.text.muted, children: char }, column))) }));
|
|
40
41
|
const now = Date.now();
|
|
41
42
|
const elapsed = formatElapsed(now - (startedAtRef.current ?? now));
|
|
42
|
-
const
|
|
43
|
-
const
|
|
43
|
+
const spent = tokens !== undefined && tokens > 0 ? ` · ↓ ${formatCompactCount(tokens)} tokens` : '';
|
|
44
|
+
const waiting = waitingLine(activeTools);
|
|
45
|
+
const visibleTools = waiting ? [] : activeTools.slice(0, MAX_VISIBLE_TOOLS);
|
|
46
|
+
const hiddenTools = waiting ? 0 : activeTools.length - visibleTools.length;
|
|
47
|
+
const waitingRow = waiting ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.secondary, wrap: "truncate-end", children: ["\u273B ", terminalDisplayText(waiting)] }) })) : null;
|
|
44
48
|
if (compact) {
|
|
45
49
|
const current = activeTools[0];
|
|
46
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [mark, _jsxs(Text, { color: theme.text.muted, children: [' · ', elapsed, activeTools.length > 0
|
|
50
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [mark, _jsxs(Text, { color: theme.text.muted, children: [' · ', elapsed, spent, activeTools.length > 0
|
|
47
51
|
? ` · ${activeTools.length} tool${activeTools.length === 1 ? '' : 's'}`
|
|
48
|
-
: ''] })] }), current ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.secondary, wrap: "truncate-end", children: [terminalDisplayText(current.label), current.progress ? (_jsxs(Text, { color: theme.text.muted, children: [" \u00B7 ", terminalDisplayText(current.progress)] })) : null] }) })) : thinking !== null ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: ["thinking", thinking ? ` · ${terminalDisplayText(thinking)}` : '…'] }) })) : null] }));
|
|
52
|
+
: ''] })] }), waitingRow ? (waitingRow) : current ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.secondary, wrap: "truncate-end", children: [terminalDisplayText(current.label), current.progress ? (_jsxs(Text, { color: theme.text.muted, children: [" \u00B7 ", terminalDisplayText(current.progress)] })) : null] }) })) : thinking !== null ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: ["thinking", thinking ? ` · ${terminalDisplayText(thinking)}` : '…'] }) })) : null] }));
|
|
49
53
|
}
|
|
50
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [mark, _jsxs(Text, { color: theme.text.muted, children: [' (', elapsed, agentCount > 0
|
|
54
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { flexShrink: 0, children: mark }), _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: [' (', elapsed, spent, agentCount > 0
|
|
51
55
|
? ` · ${agentCount} agent${agentCount === 1 ? '' : 's'} · ctrl+t to view`
|
|
52
|
-
: '', interruptible ? ' · esc to interrupt' : '', ")"] })] }), visibleTools.map((t, index) => {
|
|
56
|
+
: '', interruptible ? ' · esc to interrupt' : '', ")"] })] }), waitingRow, visibleTools.map((t, index) => {
|
|
53
57
|
const percent = t.fraction === undefined ? '' : `${Math.round(t.fraction * 100)}% · `;
|
|
54
|
-
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: 2, flexShrink: 0, children: _jsx(Text, { color: theme.text.muted, children: index === visibleTools.length - 1 && hiddenTools === 0 ? '└' : '├' }) }), _jsxs(Text, { color: theme.text.secondary, wrap: "truncate-end", children: [terminalDisplayText(t.label), _jsxs(Text, { color: theme.text.muted, children: [" \u00B7 ", formatElapsed(now - t.startedAt)] })] })] }), t.progress !== undefined ? (_jsx(Box, { flexDirection: "row", paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: [percent, terminalDisplayText(t.progress)] }) })) : null] }, t.id));
|
|
58
|
+
return (_jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: 2, flexShrink: 0, children: _jsx(Text, { color: theme.text.muted, children: index === visibleTools.length - 1 && hiddenTools === 0 ? '└' : '├' }) }), _jsxs(Text, { color: theme.text.secondary, wrap: "truncate-end", children: [terminalDisplayText(t.label), _jsxs(Text, { color: theme.text.muted, children: [" \u00B7 ", formatElapsed(now - t.startedAt)] })] })] }), t.progress !== undefined ? (_jsx(Box, { flexDirection: "row", paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: [t.web ? '⎿ ' : '', percent, terminalDisplayText(t.progress)] }) })) : null] }, t.id));
|
|
55
59
|
}), hiddenTools > 0 ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, children: ["\u2514 +", hiddenTools, " more tools"] }) })) : null, thinking !== null && activeTools.length === 0 ? (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: theme.text.muted, wrap: "truncate-end", children: ["\u2514 thinking", thinking.length > 0 ? ` · ${terminalDisplayText(thinking)}` : '…'] }) })) : null] }));
|
|
56
60
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
/**
|
|
62
|
+
* One line for a turn that is only waiting on its delegated agents, or
|
|
63
|
+
* `undefined` when any running call is something else — a wait mixed with
|
|
64
|
+
* real work keeps every row, so the work is never hidden behind the wait.
|
|
65
|
+
*/
|
|
66
|
+
export function waitingLine(tools) {
|
|
67
|
+
if (tools.length === 0 || !tools.every((tool) => tool.waitingOn !== undefined))
|
|
68
|
+
return undefined;
|
|
69
|
+
const names = [...new Set(tools.map((tool) => tool.waitingOn))];
|
|
70
|
+
return names.length === 1 ? `Waiting for ${names[0]}` : `Waiting for ${names.length} agents to finish`;
|
|
66
71
|
}
|
|
72
|
+
export { formatElapsed } from './units.js';
|
|
67
73
|
//# sourceMappingURL=LiveActivity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveActivity.js","sourceRoot":"","sources":["../../src/tui/LiveActivity.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,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AA"}
|
package/dist/tui/Markdown.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Renders parsed markdown blocks into Ink elements — the way assistant
|
|
3
3
|
* replies are shown (code blocks, inline code, bold/italic, headings,
|
|
4
|
-
* lists). Only the constructs a terminal can render faithfully
|
|
5
|
-
*
|
|
4
|
+
* lists, tables). Only the constructs a terminal can render faithfully.
|
|
5
|
+
*
|
|
6
|
+
* Prose is wrapped here, to the width {@link ContentWidth} says the row has,
|
|
7
|
+
* rather than left to Ink: Ink's wrap starts a row with the space it broke at
|
|
8
|
+
* (see `markdown-wrap.ts`). Tables are laid out to the same width by
|
|
9
|
+
* `markdown-table.ts`: a box when it fits, stacked records when it does not.
|
|
6
10
|
*
|
|
7
11
|
* Stylistic choices:
|
|
8
12
|
* - code blocks: a dim left rule + code-colored lines (no syntax
|
|
@@ -11,6 +15,19 @@
|
|
|
11
15
|
* - headings: bold; H1/H2 take the accent color for hierarchy.
|
|
12
16
|
* - bullets: a fixed-width marker gutter so wrapped lines hang-indent.
|
|
13
17
|
*/
|
|
18
|
+
import { type DisplaySpan } from './markdown-wrap.js';
|
|
19
|
+
/**
|
|
20
|
+
* How many terminal cells the text beside a transcript gutter has.
|
|
21
|
+
*
|
|
22
|
+
* Provided by the transcript, which knows its padding and gutter and is the
|
|
23
|
+
* one component that listens for resizes. Every row reads it from here rather
|
|
24
|
+
* than subscribing itself: a listener per row put Node's "possible memory
|
|
25
|
+
* leak" warning on the operator's screen past ten rows. Outside a transcript
|
|
26
|
+
* it is an 80-column terminal less a transcript's margins.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ContentWidth: import("react").Context<number>;
|
|
29
|
+
/** The width text drawn here has, from the nearest {@link ContentWidth}. */
|
|
30
|
+
export declare function useContentWidth(): number;
|
|
14
31
|
export interface MarkdownProps {
|
|
15
32
|
readonly text: string;
|
|
16
33
|
readonly color?: string;
|
|
@@ -32,4 +49,14 @@ export interface MarkdownProps {
|
|
|
32
49
|
* the tail of the document is never stored.
|
|
33
50
|
*/
|
|
34
51
|
export declare function Markdown({ text, color, hyperlinks }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Spans wrapped to `width` cells, as text with the row breaks in it: Ink
|
|
54
|
+
* finds every row already fits and leaves it alone. Goes inside a `<Text>`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function WrappedSpans({ spans, width, color, hyperlinks, }: {
|
|
57
|
+
readonly spans: readonly DisplaySpan[];
|
|
58
|
+
readonly width: number;
|
|
59
|
+
readonly color: string;
|
|
60
|
+
readonly hyperlinks?: boolean;
|
|
61
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
62
|
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/tui/Markdown.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/tui/Markdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,EAAoB,KAAK,WAAW,EAAiC,MAAM,oBAAoB,CAAA;AAMtG;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,iCAA4B,CAAA;AAErD,4EAA4E;AAC5E,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAID,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAA0B,EAAE,UAAkB,EAAE,EAAE,aAAa,2CAmB/F;AA0JD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAkB,GAClB,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC7B,2CAqBA"}
|
package/dist/tui/Markdown.js
CHANGED
|
@@ -2,8 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
/**
|
|
3
3
|
* Renders parsed markdown blocks into Ink elements — the way assistant
|
|
4
4
|
* replies are shown (code blocks, inline code, bold/italic, headings,
|
|
5
|
-
* lists). Only the constructs a terminal can render faithfully
|
|
6
|
-
*
|
|
5
|
+
* lists, tables). Only the constructs a terminal can render faithfully.
|
|
6
|
+
*
|
|
7
|
+
* Prose is wrapped here, to the width {@link ContentWidth} says the row has,
|
|
8
|
+
* rather than left to Ink: Ink's wrap starts a row with the space it broke at
|
|
9
|
+
* (see `markdown-wrap.ts`). Tables are laid out to the same width by
|
|
10
|
+
* `markdown-table.ts`: a box when it fits, stacked records when it does not.
|
|
7
11
|
*
|
|
8
12
|
* Stylistic choices:
|
|
9
13
|
* - code blocks: a dim left rule + code-colored lines (no syntax
|
|
@@ -13,12 +17,27 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
17
|
* - bullets: a fixed-width marker gutter so wrapped lines hang-indent.
|
|
14
18
|
*/
|
|
15
19
|
import { Box, Text } from 'ink';
|
|
16
|
-
import { memo, useRef } from 'react';
|
|
20
|
+
import { Fragment, createContext, memo, useContext, useRef } from 'react';
|
|
17
21
|
import { createBlockCache } from './markdown-block-cache.js';
|
|
18
|
-
import {
|
|
22
|
+
import { layoutTable } from './markdown-table.js';
|
|
23
|
+
import { inlineDisplaySpans, wrapSpans } from './markdown-wrap.js';
|
|
19
24
|
import { terminalDisplayText } from './terminal-display.js';
|
|
20
25
|
import { terminalWebHyperlink } from './terminal-hyperlinks.js';
|
|
21
26
|
import { theme } from './theme.js';
|
|
27
|
+
/**
|
|
28
|
+
* How many terminal cells the text beside a transcript gutter has.
|
|
29
|
+
*
|
|
30
|
+
* Provided by the transcript, which knows its padding and gutter and is the
|
|
31
|
+
* one component that listens for resizes. Every row reads it from here rather
|
|
32
|
+
* than subscribing itself: a listener per row put Node's "possible memory
|
|
33
|
+
* leak" warning on the operator's screen past ten rows. Outside a transcript
|
|
34
|
+
* it is an 80-column terminal less a transcript's margins.
|
|
35
|
+
*/
|
|
36
|
+
export const ContentWidth = createContext(76);
|
|
37
|
+
/** The width text drawn here has, from the nearest {@link ContentWidth}. */
|
|
38
|
+
export function useContentWidth() {
|
|
39
|
+
return Math.max(10, useContext(ContentWidth));
|
|
40
|
+
}
|
|
22
41
|
const CODE_COLOR = theme.status.ok;
|
|
23
42
|
/**
|
|
24
43
|
* A message's markdown, parsed incrementally.
|
|
@@ -38,7 +57,8 @@ export function Markdown({ text, color = theme.text.primary, hyperlinks = false
|
|
|
38
57
|
const cache = useRef(undefined);
|
|
39
58
|
cache.current ??= createBlockCache();
|
|
40
59
|
const blocks = cache.current.parse(terminalDisplayText(text));
|
|
41
|
-
|
|
60
|
+
const width = useContentWidth();
|
|
61
|
+
return (_jsx(Box, { flexDirection: "column", children: blocks.map((block, i) => (_jsx(BlockView, { block: block, prev: blocks[i - 1], color: color, hyperlinks: hyperlinks, width: width }, `b-${i}`))) }));
|
|
42
62
|
}
|
|
43
63
|
/**
|
|
44
64
|
* One block.
|
|
@@ -49,51 +69,69 @@ export function Markdown({ text, color = theme.text.primary, hyperlinks = false
|
|
|
49
69
|
* then throw the saving away — `parseInline` runs here, per span, on every
|
|
50
70
|
* render, and it is the more expensive half.
|
|
51
71
|
*/
|
|
52
|
-
const BlockView = memo(function BlockView({ block, prev, color, hyperlinks, }) {
|
|
72
|
+
const BlockView = memo(function BlockView({ block, prev, color, hyperlinks, width, }) {
|
|
53
73
|
// One blank line between blocks, except: nothing before the first block,
|
|
54
74
|
// and consecutive list items stay tight (no gap between bullets).
|
|
55
75
|
const gap = !prev || (block.type === 'bullet' && prev.type === 'bullet') ? 0 : 1;
|
|
56
76
|
switch (block.type) {
|
|
57
77
|
case 'heading':
|
|
58
|
-
return (_jsx(Box, { marginTop: gap, children: _jsx(Text, { bold: true, color: block.level <= 2 ? theme.accent.user : color, children: _jsx(
|
|
78
|
+
return (_jsx(Box, { marginTop: gap, children: _jsx(Text, { bold: true, color: block.level <= 2 ? theme.accent.user : color, children: _jsx(WrappedInline, { source: block.text, width: width, color: color, hyperlinks: hyperlinks }) }) }));
|
|
59
79
|
case 'bullet': {
|
|
60
80
|
const marker = block.ordered ? `${block.marker}.` : block.marker;
|
|
61
|
-
return (_jsxs(Box, { marginTop: gap, flexDirection: "row", children: [_jsx(Box, { width: marker.length + 1, flexShrink: 0, children: _jsxs(Text, { color: theme.text.muted, children: [marker, " "] }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: color, wrap: "wrap", children: _jsx(
|
|
81
|
+
return (_jsxs(Box, { marginTop: gap, flexDirection: "row", children: [_jsx(Box, { width: marker.length + 1, flexShrink: 0, children: _jsxs(Text, { color: theme.text.muted, children: [marker, " "] }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: color, wrap: "wrap", children: _jsx(WrappedInline, { source: block.text, width: width - marker.length - 1, color: color, hyperlinks: hyperlinks }) }) })] }));
|
|
62
82
|
}
|
|
63
83
|
case 'table':
|
|
64
|
-
return (_jsx(Box, { marginTop: gap, children: _jsx(TableView, {
|
|
84
|
+
return (_jsx(Box, { marginTop: gap, children: _jsx(TableView, { table: block, width: width, color: color, hyperlinks: hyperlinks }) }));
|
|
65
85
|
case 'code':
|
|
66
86
|
return (_jsxs(Box, { marginTop: gap, flexDirection: "column", borderStyle: "round", borderTop: false, borderRight: false, borderBottom: false, borderLeft: true, borderColor: theme.border.default, paddingLeft: 1, children: [block.lang ? _jsx(Text, { color: theme.text.muted, children: block.lang }) : null, (block.lines.length > 0 ? block.lines : ['']).map((line, i) => (_jsx(Text, { color: CODE_COLOR, children: line.length > 0 ? line : ' ' }, `c-${i}`)))] }));
|
|
67
87
|
default:
|
|
68
|
-
return (_jsx(Box, { marginTop: gap, children: _jsx(Text, { color: color, wrap: "wrap", children: _jsx(
|
|
88
|
+
return (_jsx(Box, { marginTop: gap, children: _jsx(Text, { color: color, wrap: "wrap", children: _jsx(WrappedInline, { source: block.text, width: width, color: color, hyperlinks: hyperlinks }) }) }));
|
|
69
89
|
}
|
|
70
90
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
/**
|
|
92
|
+
* A markdown table: a box when it fits the width, stacked `Header: value`
|
|
93
|
+
* records when it does not. The layout is `markdown-table.ts`; this draws it,
|
|
94
|
+
* one Ink row per line, so nothing here is wrapped a second time.
|
|
95
|
+
*/
|
|
96
|
+
function TableView({ table, width, color, hyperlinks, }) {
|
|
97
|
+
const layout = layoutTable(table, width, { hyperlinks });
|
|
98
|
+
return (_jsx(Box, { flexDirection: "column", children: layout.lines.map((line, i) => (
|
|
99
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: a table's lines have no identity beyond their position.
|
|
100
|
+
_jsx(Text, { color: color, wrap: "truncate-end", children: line.map((span, j) => (_jsx(SpanView
|
|
101
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: spans are positional.
|
|
102
|
+
, { span: span, color: color, hyperlinks: hyperlinks }, `s-${j}`))) }, `t-${i}`))) }));
|
|
103
|
+
}
|
|
104
|
+
/** Inline markdown wrapped to `width` cells. See {@link WrappedSpans}. */
|
|
105
|
+
function WrappedInline({ source, width, color, hyperlinks, }) {
|
|
106
|
+
return (_jsx(WrappedSpans, { spans: inlineDisplaySpans(source, hyperlinks), width: width, color: color, hyperlinks: hyperlinks }));
|
|
84
107
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Spans wrapped to `width` cells, as text with the row breaks in it: Ink
|
|
110
|
+
* finds every row already fits and leaves it alone. Goes inside a `<Text>`.
|
|
111
|
+
*/
|
|
112
|
+
export function WrappedSpans({ spans, width, color, hyperlinks = false, }) {
|
|
113
|
+
const lines = wrapSpans(spans, width);
|
|
114
|
+
return (_jsx(_Fragment, { children: lines.map((line, i) => (
|
|
115
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: rows are positional.
|
|
116
|
+
_jsxs(Fragment, { children: [line.map((span, j) => (_jsx(SpanView
|
|
117
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: spans are positional.
|
|
118
|
+
, { span: span, color: color, hyperlinks: hyperlinks }, `s-${j}`))), i < lines.length - 1 ? '\n' : null] }, `l-${i}`))) }));
|
|
119
|
+
}
|
|
120
|
+
/** One drawn span: code, a link, dim text, a rule, or styled prose. */
|
|
121
|
+
function SpanView({ span, color, hyperlinks, }) {
|
|
122
|
+
if (span.border)
|
|
123
|
+
return _jsx(Text, { color: theme.border.default, children: span.text });
|
|
124
|
+
if (span.muted)
|
|
125
|
+
return _jsx(Text, { color: theme.text.muted, children: span.text });
|
|
126
|
+
if (span.code) {
|
|
127
|
+
return (_jsx(Text, { color: CODE_COLOR, bold: span.bold, italic: span.italic, children: span.text }));
|
|
128
|
+
}
|
|
129
|
+
if (span.link) {
|
|
130
|
+
// A wrapped label is drawn a row at a time, each piece its own link to
|
|
131
|
+
// the same address: one OSC 8 sequence cannot span a row break.
|
|
132
|
+
const linked = hyperlinks ? terminalWebHyperlink(span.text, span.link) : null;
|
|
133
|
+
return (_jsx(Text, { color: theme.accent.user, underline: true, bold: span.bold, children: linked ?? span.text }));
|
|
134
|
+
}
|
|
135
|
+
return (_jsx(Text, { color: color, bold: span.bold, italic: span.italic, children: span.text }));
|
|
98
136
|
}
|
|
99
137
|
//# sourceMappingURL=Markdown.js.map
|
package/dist/tui/Markdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../src/tui/Markdown.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../src/tui/Markdown.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAmB,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAoC,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACnF,OAAO,EAAsC,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAS,EAAE,CAAC,CAAA;AAErD,4EAA4E;AAC5E,MAAM,UAAU,eAAe;IAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE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I,YACvD,MAAM,IAAI,IAAI,CAAC,IAAI,GACd,CACP,CAAA;IACF,CAAC;IACD,OAAO,CACN,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,YACtD,IAAI,CAAC,IAAI,GACJ,CACP,CAAA;AACF,CAAC"}
|
package/dist/tui/StatusBar.js
CHANGED
|
@@ -48,7 +48,7 @@ export function StatusBar({ cwd, provider, model, effort, orchestrate, goal, sta
|
|
|
48
48
|
modeLabel: activeMode ? `${activeMode.icon} ${activeMode.label}` : QUIET_MODE_HINT,
|
|
49
49
|
cycleSuffix: activeMode && canCycleMode ? CYCLE_SUFFIX : null,
|
|
50
50
|
});
|
|
51
|
-
return (_jsxs(Text, { wrap: "truncate-end", children: [layout.mode ? (_jsx(Text, { color: activeMode ? activeMode.color : theme.text.muted, children: layout.mode })) : null, layout.cycleSuffix ? _jsx(Text, { color: theme.text.muted, children: layout.cycleSuffix }) : null, layout.effort ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.text.muted, children: " \u00B7 " }), _jsx(Text, { color: theme.text.secondary, children: layout.effort })] })) : null, layout.orchestrate ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.text.muted, children: " \u00B7 " }), _jsx(Text, { color: theme.
|
|
51
|
+
return (_jsxs(Text, { wrap: "truncate-end", children: [layout.mode ? (_jsx(Text, { color: activeMode ? activeMode.color : theme.text.muted, children: layout.mode })) : null, layout.cycleSuffix ? _jsx(Text, { color: theme.text.muted, children: layout.cycleSuffix }) : null, layout.effort ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.text.muted, children: " \u00B7 " }), _jsx(Text, { color: theme.text.secondary, children: layout.effort })] })) : null, layout.orchestrate ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.text.muted, children: " \u00B7 " }), _jsx(Text, { color: theme.accent.orchestrate, children: layout.orchestrate })] })) : null, layout.cwd ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.text.muted, children: " \u00B7 " }), _jsx(Text, { color: theme.text.secondary, children: layout.cwd })] })) : null, _jsx(Text, { children: layout.gap }), layout.right.kind === 'text' ? (_jsx(Text, { color: layout.right.isGoal ? theme.accent.system : colorForState(state), children: layout.right.text })) : layout.right.model ? (_jsx(Text, { color: theme.text.primary, bold: true, children: layout.right.model })) : null] }));
|
|
52
52
|
}
|
|
53
53
|
function colorForState(state) {
|
|
54
54
|
switch (state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../src/tui/StatusBar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,EAAuB,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAoBlC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAW,CAAA;AAE7D,yEAAyE;AACzE,SAAS,SAAS,CACjB,IAAoB;IAEpB,OAAO;QACN,IAAI,EAAE,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI;QACpF,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;QAChE,KAAK,EAAE,mBAAmB,CAAC,IAAI,CAAC;KAChC,CAAA;AACF,CAAC;AAED,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAE5C,MAAM,UAAU,SAAS,CAAC,EACzB,GAA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
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
|
+
/**
|
|
16
|
+
* How many of `messages` came before `pending` in the conversation.
|
|
17
|
+
*
|
|
18
|
+
* A row written while a reply streams — a delegated agent's launch receipt
|
|
19
|
+
* or completion, a notice — belongs after that reply. Drawing the reply
|
|
20
|
+
* after every finalized row instead put such a row above the text that
|
|
21
|
+
* came before it, and the two swapped when the reply finished. The reply is
|
|
22
|
+
* drawn at this position, so no row moves once it is on screen. The caller
|
|
23
|
+
* keeps every row from here on out of `<Static>` (`settledBeforeStreaming`),
|
|
24
|
+
* which is what makes the position reachable. Omitted, the reply is last.
|
|
25
|
+
*/
|
|
26
|
+
readonly pendingAt?: number;
|
|
15
27
|
readonly state: 'idle' | 'thinking' | 'tool' | 'awaiting-permission';
|
|
16
28
|
/**
|
|
17
29
|
* How many of `messages` have been handed to scrollback.
|
|
@@ -50,8 +62,19 @@ export interface TranscriptProps {
|
|
|
50
62
|
* the transcript grows. As the first static row it pins to the top.
|
|
51
63
|
*/
|
|
52
64
|
readonly header?: ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Columns of padding the caller's own box puts left of this transcript.
|
|
67
|
+
*
|
|
68
|
+
* Ink lays `<Static>` out as an absolutely positioned node as wide as
|
|
69
|
+
* the terminal and prints it from that node, so an ancestor's padding
|
|
70
|
+
* never reaches it: a row drawn live at column 1 moved to column 0 the
|
|
71
|
+
* moment it settled, and wrapped two columns wider than it had live. The
|
|
72
|
+
* settled rows are drawn with this padding on both sides themselves,
|
|
73
|
+
* which puts them in the column, and at the width, they had live.
|
|
74
|
+
*/
|
|
75
|
+
readonly staticIndent?: number;
|
|
53
76
|
}
|
|
54
|
-
export declare function Transcript({ messages, pending, settled, resetKey, raw, hyperlinks, showLive, header, }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
export declare function Transcript({ messages, pending, pendingAt, settled, resetKey, raw, hyperlinks, showLive, header, staticIndent, }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
55
78
|
/** Whether the preview hides text and App should mark the body as expandable. */
|
|
56
79
|
export declare function willCollapse(detail: readonly string[] | undefined): boolean;
|
|
57
80
|
/**
|
|
@@ -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;AAQtC,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,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;
|
|
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;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"}
|
package/dist/tui/Transcript.js
CHANGED
|
@@ -6,16 +6,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
* color alone (no separate label line). Role marks stay still while output
|
|
7
7
|
* streams; the Working row owns the active turn's animation.
|
|
8
8
|
*/
|
|
9
|
-
import { Box, Static, Text } from 'ink';
|
|
9
|
+
import { Box, Static, Text, useWindowSize } from 'ink';
|
|
10
10
|
import { memo } from 'react';
|
|
11
11
|
import { Checklist, checklistLine } from './Checklist.js';
|
|
12
|
-
import { Markdown } from './Markdown.js';
|
|
12
|
+
import { ContentWidth, Markdown, WrappedSpans, useContentWidth } from './Markdown.js';
|
|
13
13
|
import { StatusPanel } from './StatusPanel.js';
|
|
14
14
|
import { terminalDisplayText } from './terminal-display.js';
|
|
15
15
|
import { theme } from './theme.js';
|
|
16
16
|
const COLLAPSE_LINES = 6;
|
|
17
17
|
const PREVIEW_LINE_CHARS = 240;
|
|
18
|
-
export function Transcript({ messages, pending, settled, resetKey, raw = false, hyperlinks = false, showLive = true, header, }) {
|
|
18
|
+
export function Transcript({ messages, pending, pendingAt, settled, resetKey, raw = false, hyperlinks = false, showLive = true, header, staticIndent = 0, }) {
|
|
19
19
|
const inScrollback = Math.min(Math.max(settled, 0), messages.length);
|
|
20
20
|
// The banner is row 0 so it prints to the very top of scrollback; messages
|
|
21
21
|
// follow it. <Static> renders each row exactly once and never re-renders it,
|
|
@@ -33,9 +33,22 @@ export function Transcript({ messages, pending, settled, resetKey, raw = false,
|
|
|
33
33
|
// The live window is memoised per row so streamed output does not reparse
|
|
34
34
|
// Markdown in unchanged history. The row that changed is the one that renders.
|
|
35
35
|
const live = messages.slice(inScrollback);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
// The streaming reply is drawn where it stands in the conversation (see
|
|
37
|
+
// `pendingAt`), not after every finalized row. It is never behind the
|
|
38
|
+
// floor, because the caller holds the floor below it.
|
|
39
|
+
const at = Math.min(Math.max((pendingAt ?? messages.length) - inScrollback, 0), live.length);
|
|
40
|
+
const drawn = pending
|
|
41
|
+
? [...live.slice(0, at), pending, ...live.slice(at)]
|
|
42
|
+
: live;
|
|
43
|
+
// The text beside the two-column glyph gutter: the terminal less the
|
|
44
|
+
// caller's padding on both sides, which settled rows draw themselves.
|
|
45
|
+
const { columns } = useWindowSize();
|
|
46
|
+
return (_jsx(ContentWidth.Provider, { value: Math.max(10, columns - 2 * staticIndent - 2), children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: rows, children: (row) => (_jsx(Box, { flexDirection: "column", paddingLeft: staticIndent, paddingRight: staticIndent, children: row.kind === 'header' ? (_jsx(Box, { children: header })) : raw ? (_jsx(RawMessageRow, { message: row.message, prev: row.prev })) : (_jsx(MessageRow, { message: row.message, prev: row.prev, hyperlinks: hyperlinks })) }, row.kind === 'header' ? 'header' : row.message.id)) }, resetKey), showLive
|
|
47
|
+
? drawn.map((message, i) => {
|
|
48
|
+
const prev = i > 0 ? drawn[i - 1] : messages[inScrollback - 1];
|
|
49
|
+
return raw ? (_jsx(RawMessageRow, { message: message, prev: prev }, message.id)) : (_jsx(LiveRow, { message: message, prev: prev, hyperlinks: hyperlinks }, message.id));
|
|
50
|
+
})
|
|
51
|
+
: null] }) }));
|
|
39
52
|
}
|
|
40
53
|
/**
|
|
41
54
|
* A row in the live window.
|
|
@@ -83,6 +96,7 @@ function MessageRow({ message, prev, hyperlinks, }) {
|
|
|
83
96
|
// Assistant content is projected inside <Markdown>, its actual renderer.
|
|
84
97
|
// The other roles flow straight into Ink here and need the projection now.
|
|
85
98
|
const content = message.role === 'assistant' ? message.content : terminalDisplayText(message.content);
|
|
99
|
+
const width = useContentWidth();
|
|
86
100
|
const glyph = message.glyph ?? glyphForRole(message.role);
|
|
87
101
|
// The `⎿` tool-result gutter is rendered dim so the call line leads.
|
|
88
102
|
const glyphColor = message.glyphColor ?? (glyph === '⎿' ? theme.text.muted : glyphColorForRole(message.role));
|
|
@@ -91,8 +105,21 @@ function MessageRow({ message, prev, hyperlinks, }) {
|
|
|
91
105
|
// belonging to the call that produced it rather than as free-standing.
|
|
92
106
|
const exploration = message.activity === 'exploration';
|
|
93
107
|
const startsExploration = exploration && prev?.activity !== 'exploration';
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
// Consecutive web searches and fetches read as one burst of work, the way
|
|
109
|
+
// consecutive exploration steps do: no blank line between one call's `⎿`
|
|
110
|
+
// line and the next call.
|
|
111
|
+
const web = message.activity === 'web';
|
|
112
|
+
const continuesWeb = web && prev?.activity === 'web';
|
|
113
|
+
const gap = !prev || message.glyph === '⎿' || (exploration && !startsExploration) || continuesWeb ? 0 : 1;
|
|
114
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: gap, children: [startsExploration ? _jsx(Text, { bold: true, color: theme.text.secondary, children: "Explored" }) : null, _jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: 2, flexShrink: 0, children: _jsx(Text, { color: glyphColor, bold: true, children: glyph }) }), _jsx(Box, { flexGrow: 1, children: message.role === 'assistant' && content.length > 0 ? (_jsx(Markdown, { text: message.content, color: contentColorForRole(message.role), hyperlinks: hyperlinks })) : !web && content.length > 0 ? (
|
|
115
|
+
// Every other row wraps the way a reply does, each row in the
|
|
116
|
+
// same column (see `markdown-wrap.ts`); a web row is cut instead.
|
|
117
|
+
_jsx(Text, { color: contentColorForRole(message.role), wrap: "wrap", children: _jsx(WrappedSpans, { spans: [
|
|
118
|
+
{ text: content },
|
|
119
|
+
...(message.meta
|
|
120
|
+
? [{ text: ` · ${terminalDisplayText(message.meta)}`, muted: true }]
|
|
121
|
+
: []),
|
|
122
|
+
], width: width, color: contentColorForRole(message.role) }) })) : (_jsxs(Text, { color: contentColorForRole(message.role), wrap: web ? 'truncate-end' : 'wrap', children: [content, message.meta ? (_jsxs(Text, { color: theme.text.muted, children: [" \u00B7 ", terminalDisplayText(message.meta)] })) : null, message.pending && content.length === 0 ? (_jsx(Text, { color: theme.text.muted, children: "\u2026" })) : null] })) })] }), message.checklist && message.checklist.length > 0 ? (_jsx(Box, { paddingLeft: 2, children: _jsx(Checklist, { items: message.checklist }) })) : null, message.detail && message.detail.length > 0 && (!message.activity || message.detailExpanded) ? (_jsx(DetailBlock, { lines: message.detail, expanded: message.detailExpanded === true, detailRef: message.detailRef })) : null] }));
|
|
96
123
|
}
|
|
97
124
|
/**
|
|
98
125
|
* Collapsible tool diff / output, aligned under the content gutter.
|