@pentoshi/clai 3.7.6 → 3.7.8
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/agent/events.d.ts +7 -0
- package/dist/agent/runner.js +7 -0
- package/dist/agent/runner.js.map +1 -1
- package/dist/app/adapters/agent-event-adapter.js +9 -0
- package/dist/app/adapters/agent-event-adapter.js.map +1 -1
- package/dist/app/adapters/current-store-adapter.js +3 -2
- package/dist/app/adapters/current-store-adapter.js.map +1 -1
- package/dist/app/controllers/session-controller.d.ts +32 -1
- package/dist/app/controllers/session-controller.js +69 -1
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/events/app-event.d.ts +7 -0
- package/dist/app/events/app-event.js.map +1 -1
- package/dist/app/ports/persistence-port.d.ts +3 -0
- package/dist/commands/update.js +1 -1
- package/dist/llm/agentrouter.js +3 -15
- package/dist/llm/agentrouter.js.map +1 -1
- package/dist/llm/anthropic.js +26 -2
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/aws-mantle.js +3 -15
- package/dist/llm/aws-mantle.js.map +1 -1
- package/dist/llm/bynara.js +3 -15
- package/dist/llm/bynara.js.map +1 -1
- package/dist/llm/gemini.js +8 -0
- package/dist/llm/gemini.js.map +1 -1
- package/dist/llm/groq.js +3 -15
- package/dist/llm/groq.js.map +1 -1
- package/dist/llm/http.d.ts +4 -1
- package/dist/llm/http.js +29 -1
- package/dist/llm/http.js.map +1 -1
- package/dist/llm/kimchi.js +3 -15
- package/dist/llm/kimchi.js.map +1 -1
- package/dist/llm/nvidia.js +3 -15
- package/dist/llm/nvidia.js.map +1 -1
- package/dist/llm/ollama.js +14 -0
- package/dist/llm/ollama.js.map +1 -1
- package/dist/llm/openai.js +3 -15
- package/dist/llm/openai.js.map +1 -1
- package/dist/llm/openrouter.js +3 -15
- package/dist/llm/openrouter.js.map +1 -1
- package/dist/llm/qwen-cloud.js +3 -15
- package/dist/llm/qwen-cloud.js.map +1 -1
- package/dist/llm/token-usage.d.ts +70 -0
- package/dist/llm/token-usage.js +209 -0
- package/dist/llm/token-usage.js.map +1 -0
- package/dist/safety/engagement-policy.d.ts +6 -0
- package/dist/safety/engagement-policy.js +53 -2
- package/dist/safety/engagement-policy.js.map +1 -1
- package/dist/store/history.d.ts +16 -2
- package/dist/store/history.js +19 -4
- package/dist/store/history.js.map +1 -1
- package/dist/store/scope.d.ts +2 -0
- package/dist/store/scope.js +54 -8
- package/dist/store/scope.js.map +1 -1
- package/dist/tools/file-diff.js +12 -3
- package/dist/tools/file-diff.js.map +1 -1
- package/dist/tools/fs.js +3 -1
- package/dist/tools/fs.js.map +1 -1
- package/dist/tui/state.d.ts +6 -0
- package/dist/tui/state.js +2 -1
- package/dist/tui/state.js.map +1 -1
- package/dist/tui-v2/actions/keymap.js +16 -8
- package/dist/tui-v2/actions/keymap.js.map +1 -1
- package/dist/tui-v2/app/App.js +22 -4
- package/dist/tui-v2/app/App.js.map +1 -1
- package/dist/tui-v2/app/commands/picker-commands.js +9 -2
- package/dist/tui-v2/app/commands/picker-commands.js.map +1 -1
- package/dist/tui-v2/app/commands/session-commands.js +13 -7
- package/dist/tui-v2/app/commands/session-commands.js.map +1 -1
- package/dist/tui-v2/bootstrap/composition-root.js +10 -2
- package/dist/tui-v2/bootstrap/composition-root.js.map +1 -1
- package/dist/tui-v2/components/pager/pager.js +25 -7
- package/dist/tui-v2/components/pager/pager.js.map +1 -1
- package/dist/tui-v2/components/plan/plan-view.d.ts +4 -5
- package/dist/tui-v2/components/plan/plan-view.js +138 -31
- package/dist/tui-v2/components/plan/plan-view.js.map +1 -1
- package/dist/tui-v2/components/status/status-line.d.ts +4 -4
- package/dist/tui-v2/components/status/status-line.js +25 -7
- package/dist/tui-v2/components/status/status-line.js.map +1 -1
- package/dist/tui-v2/components/transcript/file-diff-card.d.ts +25 -0
- package/dist/tui-v2/components/transcript/file-diff-card.js +116 -0
- package/dist/tui-v2/components/transcript/file-diff-card.js.map +1 -0
- package/dist/tui-v2/components/transcript/tool-card.js +69 -108
- package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-row.js +9 -1
- package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +7 -0
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js +25 -0
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-view.js +20 -3
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
- package/dist/tui-v2/components/transcript/user-message.js +1 -0
- package/dist/tui-v2/components/transcript/user-message.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.js +3 -1
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/tui-v2/rendering/file-diff-view.d.ts +4 -1
- package/dist/tui-v2/rendering/file-diff-view.js +13 -6
- package/dist/tui-v2/rendering/file-diff-view.js.map +1 -1
- package/dist/tui-v2/rendering/open-tool-output.d.ts +12 -0
- package/dist/tui-v2/rendering/open-tool-output.js +140 -17
- package/dist/tui-v2/rendering/open-tool-output.js.map +1 -1
- package/dist/tui-v2/rendering/plan-view.d.ts +22 -1
- package/dist/tui-v2/rendering/plan-view.js +56 -2
- package/dist/tui-v2/rendering/plan-view.js.map +1 -1
- package/dist/tui-v2/rendering/theme.d.ts +19 -5
- package/dist/tui-v2/rendering/theme.js +23 -7
- package/dist/tui-v2/rendering/theme.js.map +1 -1
- package/dist/tui-v2/rendering/tool-presenter.d.ts +5 -0
- package/dist/tui-v2/rendering/tool-presenter.js +57 -22
- package/dist/tui-v2/rendering/tool-presenter.js.map +1 -1
- package/dist/tui-v2/rendering/transcript-semantic.js +6 -1
- package/dist/tui-v2/rendering/transcript-semantic.js.map +1 -1
- package/dist/tui-v2/state/transcript-hydrate.d.ts +16 -0
- package/dist/tui-v2/state/transcript-hydrate.js +189 -29
- package/dist/tui-v2/state/transcript-hydrate.js.map +1 -1
- package/dist/tui-v2/state/transcript-reducer.js +2 -0
- package/dist/tui-v2/state/transcript-reducer.js.map +1 -1
- package/dist/tui-v2/state/transcript-types.d.ts +7 -0
- package/dist/tui-v2/state/transcript-types.js +17 -0
- package/dist/tui-v2/state/transcript-types.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/ui/intro-header.js +7 -3
- package/dist/ui/intro-header.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@opentui/reac
|
|
|
3
3
|
/**
|
|
4
4
|
* Chrome under the composer.
|
|
5
5
|
*
|
|
6
|
-
* Idle: centered clickable chips (`/:commands`,
|
|
6
|
+
* Idle: centered clickable chips (`/:commands`, ^T/^O/^H, ^U/^D) with hover.
|
|
7
7
|
* Running: spinner + activity · Esc:cancel.
|
|
8
8
|
* Scroll remainder badges (`▲ N` / `▼ N`) sit on the far right.
|
|
9
9
|
*/
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
11
|
import { TextAttributes } from "@opentui/core";
|
|
12
|
+
import { formatContextChip, } from "../../../llm/token-usage.js";
|
|
12
13
|
import { useSessionState } from "../../state/use-session-state.js";
|
|
13
14
|
import { EMPTY_SCROLL_METRICS, transcriptScrollPort, } from "../transcript/transcript-scroll-port.js";
|
|
14
15
|
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
@@ -18,7 +19,7 @@ export function modeIndicatorPresentation(mode) {
|
|
|
18
19
|
export function tasksToggleLabel(visible, compact = false) {
|
|
19
20
|
if (compact)
|
|
20
21
|
return visible ? "HIDE TASKS" : "SHOW TASKS";
|
|
21
|
-
return visible ? "
|
|
22
|
+
return visible ? "^H · HIDE TASKS" : "^H · SHOW TASKS";
|
|
22
23
|
}
|
|
23
24
|
function clip(value, max) {
|
|
24
25
|
if (max <= 1)
|
|
@@ -45,6 +46,19 @@ function formatActivity(activity, elapsedSec) {
|
|
|
45
46
|
}
|
|
46
47
|
return `${base} · ${elapsedSec}s`;
|
|
47
48
|
}
|
|
49
|
+
/** Pick full or compact context chip for terminal width. */
|
|
50
|
+
function contextChipForWidth(usage, width) {
|
|
51
|
+
if (!usage)
|
|
52
|
+
return undefined;
|
|
53
|
+
return formatContextChip(usage, { compact: width < 56 });
|
|
54
|
+
}
|
|
55
|
+
function ContextChip(props) {
|
|
56
|
+
const { chip, theme, exact } = props;
|
|
57
|
+
return (_jsx("text", { selectable: false, content: chip, style: {
|
|
58
|
+
fg: exact ? theme.cyan : theme.muted,
|
|
59
|
+
attributes: exact ? TextAttributes.BOLD : TextAttributes.DIM,
|
|
60
|
+
} }));
|
|
61
|
+
}
|
|
48
62
|
function sep(theme) {
|
|
49
63
|
return _jsx("text", { selectable: false, content: " \u2502 ", style: { fg: theme.muted } });
|
|
50
64
|
}
|
|
@@ -142,7 +156,10 @@ export function StatusLine(props) {
|
|
|
142
156
|
const activityText = state.compacting
|
|
143
157
|
? `compacting conversation · ${elapsed}s`
|
|
144
158
|
: formatActivity(activity, elapsed);
|
|
145
|
-
const
|
|
159
|
+
const ctxChip = contextChipForWidth(state.contextUsage, width);
|
|
160
|
+
// Reserve room for mode badge + spinner + ctx chip + Esc:cancel.
|
|
161
|
+
const ctxReserve = ctxChip ? ctxChip.length + 4 : 0;
|
|
162
|
+
const activityMax = Math.max(12, width - (compact ? 28 : 40) - ctxReserve);
|
|
146
163
|
return (_jsxs("box", { style: {
|
|
147
164
|
flexDirection: "row",
|
|
148
165
|
width: "100%",
|
|
@@ -152,10 +169,11 @@ export function StatusLine(props) {
|
|
|
152
169
|
backgroundColor: theme.background,
|
|
153
170
|
paddingLeft: 1,
|
|
154
171
|
paddingRight: 1,
|
|
155
|
-
}, children: [_jsxs("box", { style: { flexDirection: "row", alignItems: "center", flexShrink: 1 }, children: [_jsx(ModeBadge, { mode: mode, theme: theme }), _jsx("text", { selectable: false, content: " " }), _jsx("text", { selectable: false, content: `${SPINNER_FRAMES[frame]} `, style: { fg: theme.spinner } }), _jsx("text", { selectable: false, content: clip(activityText, activityMax), style: { fg: theme.activity } })] }), _jsxs("box", { style: { flexDirection: "row", alignItems: "center", flexShrink: 0 }, children: [hasActivePlan || planVisible ? (_jsxs(_Fragment, { children: [_jsx(ClickableHint, { label: tasksToggleLabel(planVisible, compact), active: planVisible, theme: theme, onClick: onTogglePlan }), _jsx("text", { selectable: false, content: " " })] })) : null, queued > 0 ? (_jsx("text", { selectable: false, content: `${queued} queued `, style: { fg: theme.mode } })) : null, state.compacting ? (_jsx("text", { selectable: false, content: "COMPACTING", style: { fg: theme.mode } })) : (_jsx("text", { selectable: false, content: "Esc:cancel", style: { fg: theme.muted } })), (scrollMetrics.linesAbove > 0 || scrollMetrics.linesBelow > 0) ? (_jsx("text", { selectable: false, content: " " })) : null, _jsx(ScrollRemainderBadges, { theme: theme, metrics: scrollMetrics })] })] }));
|
|
172
|
+
}, children: [_jsxs("box", { style: { flexDirection: "row", alignItems: "center", flexShrink: 1 }, children: [_jsx(ModeBadge, { mode: mode, theme: theme }), _jsx("text", { selectable: false, content: " " }), _jsx("text", { selectable: false, content: `${SPINNER_FRAMES[frame]} `, style: { fg: theme.spinner } }), _jsx("text", { selectable: false, content: clip(activityText, activityMax), style: { fg: theme.activity } }), ctxChip ? (_jsxs(_Fragment, { children: [_jsx("text", { selectable: false, content: " \u00B7 ", style: { fg: theme.muted } }), _jsx(ContextChip, { chip: ctxChip, theme: theme, exact: state.contextUsage?.exact === true })] })) : null] }), _jsxs("box", { style: { flexDirection: "row", alignItems: "center", flexShrink: 0 }, children: [hasActivePlan || planVisible ? (_jsxs(_Fragment, { children: [_jsx(ClickableHint, { label: tasksToggleLabel(planVisible, compact), active: planVisible, theme: theme, onClick: onTogglePlan }), _jsx("text", { selectable: false, content: " " })] })) : null, queued > 0 ? (_jsx("text", { selectable: false, content: `${queued} queued `, style: { fg: theme.mode } })) : null, state.compacting ? (_jsx("text", { selectable: false, content: "COMPACTING", style: { fg: theme.mode } })) : (_jsx("text", { selectable: false, content: "Esc:cancel", style: { fg: theme.muted } })), (scrollMetrics.linesAbove > 0 || scrollMetrics.linesBelow > 0) ? (_jsx("text", { selectable: false, content: " " })) : null, _jsx(ScrollRemainderBadges, { theme: theme, metrics: scrollMetrics })] })] }));
|
|
156
173
|
}
|
|
157
|
-
// Idle: centered chips; scroll
|
|
174
|
+
// Idle: centered chips; context tokens left of scroll badges on the right.
|
|
158
175
|
// Three columns (flexGrow left + center + flexGrow right) keep the middle true-center.
|
|
176
|
+
const idleCtx = contextChipForWidth(state.contextUsage, width);
|
|
159
177
|
return (_jsxs("box", { style: {
|
|
160
178
|
flexDirection: "row",
|
|
161
179
|
width: "100%",
|
|
@@ -169,13 +187,13 @@ export function StatusLine(props) {
|
|
|
169
187
|
alignItems: "center",
|
|
170
188
|
flexShrink: 0,
|
|
171
189
|
justifyContent: "center",
|
|
172
|
-
}, children: [_jsx(ModeBadge, { mode: mode, theme: theme }), width >= 42 ? (_jsxs(_Fragment, { children: [sep(theme), _jsx("text", { selectable: false, content: "/:commands", style: { fg: theme.muted } })] })) : null, !compact ? (_jsxs(_Fragment, { children: [sep(theme), _jsx(ClickableHint, { label: thinkingExpanded ? "
|
|
190
|
+
}, children: [_jsx(ModeBadge, { mode: mode, theme: theme }), width >= 42 ? (_jsxs(_Fragment, { children: [sep(theme), _jsx("text", { selectable: false, content: "/:commands", style: { fg: theme.muted } })] })) : null, !compact ? (_jsxs(_Fragment, { children: [sep(theme), _jsx(ClickableHint, { label: thinkingExpanded ? "^T thinking on" : "^T thinking", active: thinkingExpanded, theme: theme, onClick: onToggleThinking }), sep(theme), _jsx(ClickableHint, { label: outputExpanded ? "^O output on" : "^O output", active: outputExpanded, theme: theme, onClick: onToggleOutput }), sep(theme), _jsx("text", { selectable: false, content: "^U top \u00B7 ^D end \u00B7 ^X clear", style: { fg: theme.muted } })] })) : null, hasActivePlan || planVisible ? (_jsxs(_Fragment, { children: [sep(theme), _jsx(ClickableHint, { label: tasksToggleLabel(planVisible, width < 72), active: planVisible, theme: theme, onClick: onTogglePlan })] })) : null, queued > 0 ? (_jsxs(_Fragment, { children: [sep(theme), _jsx("text", { selectable: false, content: `${queued} queued`, style: { fg: theme.mode } })] })) : null] }), _jsxs("box", { style: {
|
|
173
191
|
flexGrow: 1,
|
|
174
192
|
flexShrink: 1,
|
|
175
193
|
minWidth: 0,
|
|
176
194
|
flexDirection: "row",
|
|
177
195
|
justifyContent: "flex-end",
|
|
178
196
|
alignItems: "center",
|
|
179
|
-
}, children: _jsx(ScrollRemainderBadges, { theme: theme, metrics: scrollMetrics }) })] }));
|
|
197
|
+
}, children: [idleCtx ? (_jsxs(_Fragment, { children: [_jsx(ContextChip, { chip: idleCtx, theme: theme, exact: state.contextUsage?.exact === true }), (scrollMetrics.linesAbove > 0 || scrollMetrics.linesBelow > 0) ? (_jsx("text", { selectable: false, content: " " })) : null] })) : null, _jsx(ScrollRemainderBadges, { theme: theme, metrics: scrollMetrics })] })] }));
|
|
180
198
|
}
|
|
181
199
|
//# sourceMappingURL=status-line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-line.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/status/status-line.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,yCAAyC,CAAC;AAoBjD,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAOnF,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ACZ,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,KAAK,IAAI,GACzC,EACD,CAAC,aAAa,CAAC,UAAU,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAChE,eAAM,UAAU,EAAE,KAAK,EAAE,OAAO,EAAC,IAAI,GAAG,CACzC,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,qBAAqB,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,GAAI,IAC3D,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* File-diff UI for tool cards: collapse chips, code rows, single-file and
|
|
4
|
+
* writeMany previews. Kept separate so tool-card.tsx stays under the line budget.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode } from "react";
|
|
7
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
8
|
+
import type { FileChange } from "../../../tools/file-diff.js";
|
|
9
|
+
/**
|
|
10
|
+
* Hover chip for collapse / collapse-all. Stops propagation so parent
|
|
11
|
+
* header click does NOT open the file modal.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DiffActionButton(props: {
|
|
14
|
+
label: string;
|
|
15
|
+
theme: Theme;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
}): ReactNode;
|
|
18
|
+
export declare function FileDiffBody(props: {
|
|
19
|
+
changes: readonly FileChange[];
|
|
20
|
+
theme: Theme;
|
|
21
|
+
diffExpanded: boolean;
|
|
22
|
+
onOpen: (change: FileChange) => void;
|
|
23
|
+
/** writeMany: multi-file path headers + compact per-file hunks when expanded. */
|
|
24
|
+
multiFilePreview?: boolean;
|
|
25
|
+
}): ReactNode;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @opentui/react */
|
|
3
|
+
/**
|
|
4
|
+
* File-diff UI for tool cards: collapse chips, code rows, single-file and
|
|
5
|
+
* writeMany previews. Kept separate so tool-card.tsx stays under the line budget.
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { TextAttributes } from "@opentui/core";
|
|
9
|
+
import { collapsedFileChangesLabel, presentFileChangePreview, relativeDisplayPath, rowBackground, syntaxColor, } from "../../rendering/file-diff-view.js";
|
|
10
|
+
import { useClickWithoutDrag } from "./use-click-without-drag.js";
|
|
11
|
+
/** Default preview rows for a single-file edit card. */
|
|
12
|
+
const SINGLE_FILE_PREVIEW_ROWS = 40;
|
|
13
|
+
/** Cap per file in writeMany so multi-file scaffolds stay scannable. */
|
|
14
|
+
const WRITE_MANY_PREVIEW_ROWS = 8;
|
|
15
|
+
/**
|
|
16
|
+
* Hover chip for collapse / collapse-all. Stops propagation so parent
|
|
17
|
+
* header click does NOT open the file modal.
|
|
18
|
+
*/
|
|
19
|
+
export function DiffActionButton(props) {
|
|
20
|
+
const { label, theme, onClick } = props;
|
|
21
|
+
const [hovered, setHovered] = useState(false);
|
|
22
|
+
const fg = hovered ? theme.white : theme.muted;
|
|
23
|
+
const bg = hovered ? theme.selection : theme.statusBackground;
|
|
24
|
+
return (_jsx("box", { onMouseDown: (event) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
onClick();
|
|
28
|
+
}, onMouseUp: (event) => {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
}, onMouseOver: () => setHovered(true), onMouseOut: () => setHovered(false), style: {
|
|
32
|
+
flexDirection: "row",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
height: 1,
|
|
36
|
+
backgroundColor: bg,
|
|
37
|
+
marginLeft: 1,
|
|
38
|
+
}, children: _jsx("text", { selectable: false, content: hovered ? ` ${label} ` : ` ${label} `, style: {
|
|
39
|
+
fg,
|
|
40
|
+
bg,
|
|
41
|
+
attributes: hovered ? TextAttributes.BOLD : TextAttributes.NONE,
|
|
42
|
+
} }) }));
|
|
43
|
+
}
|
|
44
|
+
/** One compact row: solid gutter · full-width code tint · height 1. */
|
|
45
|
+
function DiffCodeRow(props) {
|
|
46
|
+
const { gutter, spans, displayText, tone, theme } = props;
|
|
47
|
+
const bg = rowBackground(tone, theme);
|
|
48
|
+
const isGap = tone === "gap" || tone === "header";
|
|
49
|
+
const gutterFg = theme.diffGutter;
|
|
50
|
+
return (_jsxs("box", { style: {
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
width: "100%",
|
|
53
|
+
height: 1,
|
|
54
|
+
flexShrink: 0,
|
|
55
|
+
}, children: [_jsxs("text", { selectable: false, style: { height: 1 }, children: [_jsx("span", { style: { fg: gutterFg }, children: gutter }), _jsx("span", { style: { fg: gutterFg }, children: " │ " })] }), _jsx("box", { style: {
|
|
56
|
+
flexGrow: 1,
|
|
57
|
+
flexShrink: 1,
|
|
58
|
+
minWidth: 0,
|
|
59
|
+
height: 1,
|
|
60
|
+
...(bg ? { backgroundColor: bg } : {}),
|
|
61
|
+
}, children: _jsx("text", { selectable: !isGap, style: {
|
|
62
|
+
height: 1,
|
|
63
|
+
attributes: isGap ? TextAttributes.DIM : TextAttributes.NONE,
|
|
64
|
+
}, children: isGap ? (_jsx("span", { style: { fg: theme.muted }, children: displayText })) : spans.length > 0 ? (spans.map((sp, si) => (_jsx("span", { style: { fg: syntaxColor(sp.kind, theme) }, children: sp.text }, si)))) : (_jsx("span", { style: { fg: theme.foreground }, children: displayText || " " })) }) })] }));
|
|
65
|
+
}
|
|
66
|
+
function FileDiffHunks(props) {
|
|
67
|
+
const { change, showPath, theme, onOpen, maxRows = SINGLE_FILE_PREVIEW_ROWS, } = props;
|
|
68
|
+
const rows = presentFileChangePreview(change, { maxRows });
|
|
69
|
+
const open = useClickWithoutDrag(() => onOpen(change));
|
|
70
|
+
const mark = change.kind === "create" ? "+" : change.kind === "overwrite" ? "~" : "·";
|
|
71
|
+
const markFg = change.kind === "create"
|
|
72
|
+
? theme.success
|
|
73
|
+
: change.kind === "overwrite"
|
|
74
|
+
? theme.activity
|
|
75
|
+
: theme.toolOutput;
|
|
76
|
+
return (_jsxs("box", { style: { flexDirection: "column", width: "100%" }, onMouseDown: open.onMouseDown, onMouseUp: open.onMouseUp, children: [showPath ? (_jsxs("text", { selectable: true, style: { height: 1 }, children: [_jsx("span", { style: { fg: markFg }, children: ` ${mark} ` }), _jsx("span", { style: { fg: theme.inputBorder }, children: relativeDisplayPath(change.path) })] })) : null, rows.map((row, ri) => (_jsx(DiffCodeRow, { gutter: row.gutter, spans: row.spans, displayText: row.displayText, tone: row.tone, theme: theme }, ri)))] }));
|
|
77
|
+
}
|
|
78
|
+
/** Collapsed writeMany path row (one file). */
|
|
79
|
+
function WriteManyCollapsedRow(props) {
|
|
80
|
+
const { change, theme, onOpen } = props;
|
|
81
|
+
const open = useClickWithoutDrag(() => onOpen(change));
|
|
82
|
+
const mark = change.kind === "create" ? "+" : change.kind === "overwrite" ? "~" : "·";
|
|
83
|
+
const markFg = change.kind === "create"
|
|
84
|
+
? theme.success
|
|
85
|
+
: change.kind === "overwrite"
|
|
86
|
+
? theme.activity
|
|
87
|
+
: theme.toolOutput;
|
|
88
|
+
return (_jsxs("text", { selectable: true, style: { height: 1 }, onMouseDown: open.onMouseDown, onMouseUp: open.onMouseUp, children: [_jsx("span", { style: { fg: markFg }, children: ` ${mark} ` }), _jsx("span", { style: { fg: theme.inputBorder }, children: relativeDisplayPath(change.path) })] }));
|
|
89
|
+
}
|
|
90
|
+
export function FileDiffBody(props) {
|
|
91
|
+
const { changes, theme, diffExpanded, onOpen, multiFilePreview = false, } = props;
|
|
92
|
+
const label = collapsedFileChangesLabel(changes);
|
|
93
|
+
const openPrimary = useClickWithoutDrag(() => {
|
|
94
|
+
if (changes[0])
|
|
95
|
+
onOpen(changes[0]);
|
|
96
|
+
});
|
|
97
|
+
const showHunks = diffExpanded;
|
|
98
|
+
const maxRows = multiFilePreview
|
|
99
|
+
? WRITE_MANY_PREVIEW_ROWS
|
|
100
|
+
: SINGLE_FILE_PREVIEW_ROWS;
|
|
101
|
+
return (_jsxs("box", { style: { flexDirection: "column", width: "100%", marginTop: 0 }, children: [!multiFilePreview ? (_jsx("box", { style: {
|
|
102
|
+
flexDirection: "row",
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: 1,
|
|
105
|
+
flexShrink: 0,
|
|
106
|
+
}, onMouseDown: openPrimary.onMouseDown, onMouseUp: openPrimary.onMouseUp, children: _jsx("text", { selectable: true, style: {
|
|
107
|
+
height: 1,
|
|
108
|
+
fg: theme.foreground,
|
|
109
|
+
attributes: TextAttributes.BOLD,
|
|
110
|
+
}, children: label }) })) : null, showHunks
|
|
111
|
+
? changes.map((change, ci) => (_jsx(FileDiffHunks, { change: change, showPath: multiFilePreview || changes.length > 1, theme: theme, onOpen: onOpen, maxRows: maxRows }, `${change.path}-${ci}`)))
|
|
112
|
+
: multiFilePreview
|
|
113
|
+
? changes.map((change, ci) => (_jsx(WriteManyCollapsedRow, { change: change, theme: theme, onOpen: onOpen }, `wm-c-${ci}`)))
|
|
114
|
+
: null] }));
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=file-diff-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-diff-card.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/file-diff-card.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,WAAW,GACZ,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,mBAA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opentui/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @opentui/react */
|
|
3
|
-
/**
|
|
4
|
-
* Tool card: flat single-border pane (classic parity — no 3D depth / outer plate).
|
|
5
|
-
*
|
|
6
|
-
* Click (body or footer) opens the full-output pager modal — unless the card is
|
|
7
|
-
* already expanded in place via Ctrl+O. Ctrl+O expands every card to show the
|
|
8
|
-
* full cleaned body; click does not toggle expand (classic: keyboard expands,
|
|
9
|
-
* click opens the unbounded viewer).
|
|
10
|
-
*
|
|
11
|
-
* tool.batch: parent card nests one mini-card per sub-tool. Click the parent
|
|
12
|
-
* (header/footer) for the full batch; click a sub-card for that call only.
|
|
13
|
-
* Ctrl+O expands sub-bodies in place the same as a normal tool.
|
|
14
|
-
*
|
|
15
|
-
* File diffs: compact single-height rows; chevron collapses hunks to a one-line
|
|
16
|
-
* title (verb + relative path). Collapse-all applies to every file-diff card.
|
|
17
|
-
*/
|
|
18
|
-
import { useState } from "react";
|
|
19
2
|
import { TextAttributes } from "@opentui/core";
|
|
20
3
|
import { batchSummaryLine, formatBatchSectionForPager, isBatchToolName, parseBatchLiveProgress, parseBatchSections, presentBatchSection, } from "../../rendering/batch-sections.js";
|
|
21
4
|
import { presentOutput, presentTool } from "../../rendering/tool-presenter.js";
|
|
22
5
|
import { openToolOutputPager } from "../../rendering/open-tool-output.js";
|
|
23
|
-
import {
|
|
6
|
+
import { isFileMutationTool, } from "../../../tools/file-diff.js";
|
|
24
7
|
import { LinkableText } from "./linkable-text.js";
|
|
25
8
|
import { useClickWithoutDrag } from "./use-click-without-drag.js";
|
|
9
|
+
import { DiffActionButton, FileDiffBody } from "./file-diff-card.js";
|
|
10
|
+
/** Border / status accent: green ok · yellow running · red failed. */
|
|
26
11
|
const STATUS_COLOR = {
|
|
27
12
|
queued: "muted",
|
|
28
13
|
running: "activity",
|
|
29
|
-
ok: "
|
|
30
|
-
failed: "
|
|
31
|
-
blocked: "
|
|
14
|
+
ok: "success",
|
|
15
|
+
failed: "diffDel",
|
|
16
|
+
blocked: "diffDel",
|
|
32
17
|
};
|
|
33
18
|
function OutputLines(props) {
|
|
34
19
|
const { lines, theme, gutterFg } = props;
|
|
35
|
-
//
|
|
36
|
-
const bodyFg = theme.
|
|
20
|
+
// Sky cyan body — readable on dark tool cards (theme.toolOutput).
|
|
21
|
+
const bodyFg = theme.toolOutput;
|
|
37
22
|
return (_jsx(_Fragment, { children: lines.map((line, i) => {
|
|
38
23
|
const isGap = line.startsWith("···");
|
|
39
|
-
return (_jsxs("text", { selectable: true, children: [_jsx("span", { style: { fg: isGap ? theme.muted : gutterFg }, children: "│ " }), _jsx("span", { style: {
|
|
24
|
+
return (_jsxs("text", { selectable: true, style: { height: 1 }, children: [_jsx("span", { style: { fg: isGap ? theme.muted : gutterFg }, children: "│ " }), _jsx("span", { style: {
|
|
40
25
|
fg: isGap ? theme.muted : bodyFg,
|
|
41
26
|
attributes: isGap ? TextAttributes.DIM : TextAttributes.NONE,
|
|
42
27
|
}, children: line })] }, i));
|
|
43
28
|
}) }));
|
|
44
29
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Hover chip for collapse / collapse-all. Stops propagation so parent
|
|
47
|
-
* header click does NOT open the file modal.
|
|
48
|
-
*/
|
|
49
|
-
function DiffActionButton(props) {
|
|
50
|
-
const { label, theme, onClick } = props;
|
|
51
|
-
const [hovered, setHovered] = useState(false);
|
|
52
|
-
const fg = hovered ? theme.white : theme.muted;
|
|
53
|
-
const bg = hovered ? theme.selection : theme.statusBackground;
|
|
54
|
-
return (_jsx("box", { onMouseDown: (event) => {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
event.stopPropagation();
|
|
57
|
-
onClick();
|
|
58
|
-
}, onMouseUp: (event) => {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
event.stopPropagation();
|
|
61
|
-
}, onMouseOver: () => setHovered(true), onMouseOut: () => setHovered(false), style: {
|
|
62
|
-
flexDirection: "row",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
flexShrink: 0,
|
|
65
|
-
height: 1,
|
|
66
|
-
backgroundColor: bg,
|
|
67
|
-
marginLeft: 1,
|
|
68
|
-
}, children: _jsx("text", { selectable: false, content: hovered ? ` ${label} ` : ` ${label} `, style: { fg, bg, attributes: hovered ? TextAttributes.BOLD : TextAttributes.NONE } }) }));
|
|
69
|
-
}
|
|
70
|
-
/** One compact row: solid gutter · full-width code tint · height 1. */
|
|
71
|
-
function DiffCodeRow(props) {
|
|
72
|
-
const { gutter, spans, displayText, tone, theme } = props;
|
|
73
|
-
const bg = rowBackground(tone, theme);
|
|
74
|
-
const isGap = tone === "gap" || tone === "header";
|
|
75
|
-
const gutterFg = theme.diffGutter;
|
|
76
|
-
// Single-height row: solid "│" (not a box border — avoids dashed gaps).
|
|
77
|
-
return (_jsxs("box", { style: {
|
|
78
|
-
flexDirection: "row",
|
|
79
|
-
width: "100%",
|
|
80
|
-
height: 1,
|
|
81
|
-
flexShrink: 0,
|
|
82
|
-
}, children: [_jsxs("text", { selectable: false, style: { height: 1 }, children: [_jsx("span", { style: { fg: gutterFg }, children: gutter }), _jsx("span", { style: { fg: gutterFg }, children: " │ " })] }), _jsx("box", { style: {
|
|
83
|
-
flexGrow: 1,
|
|
84
|
-
flexShrink: 1,
|
|
85
|
-
minWidth: 0,
|
|
86
|
-
height: 1,
|
|
87
|
-
...(bg ? { backgroundColor: bg } : {}),
|
|
88
|
-
}, children: _jsx("text", { selectable: !isGap, style: {
|
|
89
|
-
height: 1,
|
|
90
|
-
attributes: isGap ? TextAttributes.DIM : TextAttributes.NONE,
|
|
91
|
-
}, children: isGap ? (_jsx("span", { style: { fg: theme.muted }, children: displayText })) : spans.length > 0 ? (spans.map((sp, si) => (_jsx("span", { style: { fg: syntaxColor(sp.kind, theme) }, children: sp.text }, si)))) : (_jsx("span", { style: { fg: theme.foreground }, children: displayText || " " })) }) })] }));
|
|
92
|
-
}
|
|
93
|
-
function FileDiffHunks(props) {
|
|
94
|
-
const { change, showPath, theme, onOpen } = props;
|
|
95
|
-
const rows = presentFileChangePreview(change);
|
|
96
|
-
const open = useClickWithoutDrag(() => onOpen(change));
|
|
97
|
-
return (_jsxs("box", { style: { flexDirection: "column", width: "100%" }, onMouseDown: open.onMouseDown, onMouseUp: open.onMouseUp, children: [showPath ? (_jsx("text", { selectable: false, style: { height: 1, fg: theme.muted, attributes: TextAttributes.DIM }, children: relativeDisplayPath(change.path) })) : null, rows.map((row, ri) => (_jsx(DiffCodeRow, { gutter: row.gutter, spans: row.spans, displayText: row.displayText, tone: row.tone, theme: theme }, ri)))] }));
|
|
98
|
-
}
|
|
99
|
-
function FileDiffBody(props) {
|
|
100
|
-
const { changes, theme, diffExpanded, onOpen } = props;
|
|
101
|
-
const label = collapsedFileChangesLabel(changes);
|
|
102
|
-
const openPrimary = useClickWithoutDrag(() => {
|
|
103
|
-
if (changes[0])
|
|
104
|
-
onOpen(changes[0]);
|
|
105
|
-
});
|
|
106
|
-
// Title row only — collapse buttons live beside the status "done" pill.
|
|
107
|
-
return (_jsxs("box", { style: { flexDirection: "column", width: "100%", marginTop: 0 }, children: [_jsx("box", { style: { flexDirection: "row", width: "100%", height: 1, flexShrink: 0 }, onMouseDown: openPrimary.onMouseDown, onMouseUp: openPrimary.onMouseUp, children: _jsx("text", { selectable: true, style: { height: 1, fg: theme.foreground, attributes: TextAttributes.BOLD }, children: label }) }), diffExpanded
|
|
108
|
-
? changes.map((change, ci) => (_jsx(FileDiffHunks, { change: change, showPath: changes.length > 1, theme: theme, onOpen: onOpen }, `${change.path}-${ci}`)))
|
|
109
|
-
: null] }));
|
|
110
|
-
}
|
|
111
30
|
function BatchSubCard(props) {
|
|
112
31
|
const { section, theme, expanded, parentExpanded, onOpen } = props;
|
|
113
32
|
const presented = presentBatchSection(section, expanded);
|
|
114
|
-
const borderFg = section.ok ? theme.
|
|
33
|
+
const borderFg = section.ok ? theme.success : theme.diffDel;
|
|
115
34
|
const statusFg = borderFg;
|
|
116
35
|
// Click (no drag) opens pager; drag-select copies output lines.
|
|
117
36
|
const click = useClickWithoutDrag(() => {
|
|
@@ -148,7 +67,7 @@ function BatchSubCard(props) {
|
|
|
148
67
|
width: "100%",
|
|
149
68
|
marginTop: 0,
|
|
150
69
|
flexShrink: 1,
|
|
151
|
-
}, children: _jsx(OutputLines, { lines: presented.lines, theme: theme, gutterFg:
|
|
70
|
+
}, children: _jsx(OutputLines, { lines: presented.lines, theme: theme, gutterFg: theme.toolOutput }) })) : null, footerHint ? (_jsxs("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: [_jsx("text", { selectable: false, style: { fg: theme.cyan }, children: "› " }), _jsx("text", { selectable: false, style: { fg: theme.cyan, attributes: TextAttributes.DIM }, children: footerHint })] })) : null] }));
|
|
152
71
|
}
|
|
153
72
|
export function ToolCard(props) {
|
|
154
73
|
const { item, theme, spool, expanded, services, fileDiffExpanded = true, onToggleFileDiff, onCollapseAllFileDiffs, onExpandAllFileDiffs, } = props;
|
|
@@ -156,6 +75,10 @@ export function ToolCard(props) {
|
|
|
156
75
|
const tail = spool.tail(item.toolCallId);
|
|
157
76
|
const spoolState = spool.state(item.toolCallId);
|
|
158
77
|
const fileChanges = item.fileChanges;
|
|
78
|
+
const isWriteMany = item.name === "fs.writeMany";
|
|
79
|
+
// File mutations never show the spool receipt ("Tool fs.write result…") —
|
|
80
|
+
// that is what made history cards look broken when fileChanges was missing.
|
|
81
|
+
const isMutation = isFileMutationTool(item.name);
|
|
159
82
|
const isBatchName = isBatchToolName(item.name);
|
|
160
83
|
const batchSections = isBatchName && item.status !== "running" && tail
|
|
161
84
|
? parseBatchSections(tail)
|
|
@@ -165,7 +88,8 @@ export function ToolCard(props) {
|
|
|
165
88
|
? parseBatchLiveProgress(tail)
|
|
166
89
|
: { lines: [], summary: "" };
|
|
167
90
|
const isBatchLive = isBatchName && item.status === "running";
|
|
168
|
-
|
|
91
|
+
// write/edit/writeMany: structured body only — never receipt dumps.
|
|
92
|
+
const { lines, hiddenAboveCount, truncatedNotice } = isBatch || isBatchLive || isFileDiff || isWriteMany || isMutation
|
|
169
93
|
? {
|
|
170
94
|
lines: [],
|
|
171
95
|
hiddenAboveCount: 0,
|
|
@@ -173,16 +97,18 @@ export function ToolCard(props) {
|
|
|
173
97
|
}
|
|
174
98
|
: presentOutput(tail, spoolState, expanded, item.name);
|
|
175
99
|
const statusFg = theme[STATUS_COLOR[item.status]];
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
100
|
+
// Card boundary: green success · yellow running · red failure · muted queued.
|
|
101
|
+
const highlight = statusFg;
|
|
102
|
+
// Status chips: dark solid plates (bright colors stay on title/border only).
|
|
103
|
+
const statusBadgeBg = item.status === "ok"
|
|
104
|
+
? theme.successBg
|
|
105
|
+
: item.status === "failed" || item.status === "blocked"
|
|
106
|
+
? theme.failedBg
|
|
107
|
+
: statusFg;
|
|
183
108
|
const hasBody = isBatch ||
|
|
184
109
|
isBatchLive ||
|
|
185
110
|
isFileDiff ||
|
|
111
|
+
isWriteMany ||
|
|
186
112
|
lines.length > 0 ||
|
|
187
113
|
item.outputBytes > 0 ||
|
|
188
114
|
Boolean(item.artifactPath);
|
|
@@ -216,7 +142,12 @@ export function ToolCard(props) {
|
|
|
216
142
|
};
|
|
217
143
|
// Footer: shorter for file diffs (title already carries the path).
|
|
218
144
|
let footerHint;
|
|
219
|
-
if (
|
|
145
|
+
if (isWriteMany && item.status !== "running") {
|
|
146
|
+
footerHint = fileDiffExpanded
|
|
147
|
+
? `${fileChanges?.length ?? 0} file${fileChanges?.length === 1 ? "" : "s"} · click hunk · open file`
|
|
148
|
+
: `${fileChanges?.length ?? 0} file${fileChanges?.length === 1 ? "" : "s"} · expand for diffs · click for full`;
|
|
149
|
+
}
|
|
150
|
+
else if (isFileDiff && !isWriteMany && item.status !== "running") {
|
|
220
151
|
footerHint = fileDiffExpanded
|
|
221
152
|
? "click hunk · open file"
|
|
222
153
|
: "click title · open file";
|
|
@@ -264,28 +195,53 @@ export function ToolCard(props) {
|
|
|
264
195
|
}, children: [_jsxs("box", { style: {
|
|
265
196
|
flexDirection: "row",
|
|
266
197
|
width: "100%",
|
|
198
|
+
height: 1,
|
|
199
|
+
flexShrink: 0,
|
|
267
200
|
paddingTop: 0,
|
|
268
201
|
paddingBottom: 0,
|
|
202
|
+
marginTop: 0,
|
|
203
|
+
marginBottom: 0,
|
|
269
204
|
alignItems: "center",
|
|
270
|
-
}, children: [
|
|
205
|
+
}, children: [_jsx("box", { style: {
|
|
206
|
+
flexDirection: "row",
|
|
207
|
+
flexGrow: 1,
|
|
208
|
+
flexShrink: 1,
|
|
209
|
+
minWidth: 0,
|
|
210
|
+
}, onMouseDown: openFullClick.onMouseDown, onMouseUp: openFullClick.onMouseUp, children: _jsx("text", { selectable: true, content: `${glyph} ${name}`, style: {
|
|
211
|
+
fg: statusFg,
|
|
212
|
+
attributes: TextAttributes.BOLD,
|
|
213
|
+
flexShrink: 1,
|
|
214
|
+
} }) }), _jsx("text", { content: " ", selectable: false, style: { flexShrink: 0 } }), _jsx("text", { selectable: false, content: ` ${statusLabel} `, style: {
|
|
215
|
+
fg: theme.white,
|
|
216
|
+
bg: statusBadgeBg,
|
|
217
|
+
attributes: TextAttributes.BOLD,
|
|
218
|
+
flexShrink: 0,
|
|
219
|
+
} }), isFileDiff ? (_jsxs(_Fragment, { children: [_jsx(DiffActionButton, { label: fileDiffExpanded ? "collapse" : "expand", theme: theme, onClick: () => onToggleFileDiff?.() }), _jsx(DiffActionButton, { label: fileDiffExpanded ? "collapse all" : "expand all", theme: theme, onClick: () => fileDiffExpanded
|
|
271
220
|
? onCollapseAllFileDiffs?.()
|
|
272
|
-
: onExpandAllFileDiffs?.() })] })) : null, isBatch || isBatchLive ? (_jsxs(_Fragment, { children: [_jsx("text", { content: " ", selectable: false }), _jsx("text", { selectable: false, style: { fg: theme.muted, attributes: TextAttributes.DIM }, children: "batch" })] })) : null] }), argsDisplay && argsLabel ? (_jsxs("box", { style: {
|
|
221
|
+
: onExpandAllFileDiffs?.() })] })) : null, isBatch || isBatchLive ? (_jsxs(_Fragment, { children: [_jsx("text", { content: " ", selectable: false }), _jsx("text", { selectable: false, style: { fg: theme.muted, attributes: TextAttributes.DIM }, children: "batch" })] })) : null] }), argsDisplay && argsLabel ? (_jsxs("box", { style: {
|
|
222
|
+
flexDirection: "row",
|
|
223
|
+
width: "100%",
|
|
224
|
+
marginTop: 0,
|
|
225
|
+
marginBottom: 0,
|
|
226
|
+
paddingTop: 0,
|
|
227
|
+
flexShrink: 0,
|
|
228
|
+
}, children: [_jsxs("text", { selectable: true, style: { fg: theme.muted }, children: [argsLabel, ":", " "] }), _jsx("text", { selectable: true, style: { fg: theme.inputBorder }, children: argsDisplay })] })) : null, pathLine && !isFileDiff ? (_jsx("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: _jsx(LinkableText, { text: pathLine, theme: theme, fg: theme.muted, selectable: true }) })) : null, detail ? _jsx(LinkableText, { text: detail, theme: theme, fg: theme.mode, selectable: true }) : null, summary ? (_jsx("text", { selectable: true, style: { fg: summaryFg, attributes: TextAttributes.DIM }, children: summary })) : null, isBatchLive && liveBatch.lines.length > 0 ? (_jsx("box", { style: { flexDirection: "column", width: "100%", marginTop: 0 }, children: liveBatch.lines.map((line, i) => {
|
|
273
229
|
const fg = line.tone === "ok"
|
|
274
|
-
? theme.
|
|
230
|
+
? theme.success
|
|
275
231
|
: line.tone === "fail"
|
|
276
|
-
? theme.
|
|
232
|
+
? theme.diffDel
|
|
277
233
|
: line.tone === "running"
|
|
278
234
|
? theme.activity
|
|
279
235
|
: theme.muted;
|
|
280
236
|
return (_jsx("text", { selectable: true, style: { fg }, children: ` ${line.tone === "ok" ? "✓" : line.tone === "fail" ? "✗" : line.tone === "running" ? "●" : "·"} ${line.text}` }, `live-${i}`));
|
|
281
237
|
}) })) : null, isBatch
|
|
282
238
|
? batchSections.map((section) => (_jsx(BatchSubCard, { section: section, theme: theme, expanded: expanded, parentExpanded: expanded, onOpen: openSection }, `${item.id}-sub-${section.index}`)))
|
|
283
|
-
: null, !isBatch && !isBatchLive && isFileDiff && fileChanges ? (
|
|
239
|
+
: null, !isBatch && !isBatchLive && isFileDiff && fileChanges ? (_jsxs("box", { style: {
|
|
284
240
|
flexDirection: "column",
|
|
285
241
|
width: "100%",
|
|
286
242
|
marginTop: 0,
|
|
287
243
|
flexShrink: 1,
|
|
288
|
-
}, children: _jsx(FileDiffBody, { changes: fileChanges, theme: theme, diffExpanded: fileDiffExpanded, onOpen: openFileChange }) })) : null, !isBatch && !isBatchLive && !isFileDiff && lines.length > 0 ? (_jsxs("box", { style: {
|
|
244
|
+
}, children: [_jsx(FileDiffBody, { changes: isWriteMany ? fileChanges.slice(0, 12) : fileChanges, theme: theme, diffExpanded: fileDiffExpanded, multiFilePreview: isWriteMany, onOpen: openFileChange }), isWriteMany && fileChanges.length > 12 ? (_jsx("text", { selectable: true, content: ` ··· +${fileChanges.length - 12} more files · click for full ···`, style: { fg: theme.muted, height: 1 } })) : null] })) : null, !isBatch && !isBatchLive && !isFileDiff && lines.length > 0 ? (_jsxs("box", { style: {
|
|
289
245
|
flexDirection: "column",
|
|
290
246
|
width: "100%",
|
|
291
247
|
paddingLeft: 0,
|
|
@@ -294,7 +250,12 @@ export function ToolCard(props) {
|
|
|
294
250
|
paddingBottom: 0,
|
|
295
251
|
marginTop: 0,
|
|
296
252
|
flexShrink: 1,
|
|
297
|
-
}, onMouseDown: openFullClick.onMouseDown, onMouseUp: openFullClick.onMouseUp, children: [_jsx("text", { selectable: true, style: {
|
|
253
|
+
}, onMouseDown: openFullClick.onMouseDown, onMouseUp: openFullClick.onMouseUp, children: [_jsx("text", { selectable: true, style: {
|
|
254
|
+
fg: theme.white,
|
|
255
|
+
bg: theme.chipTeal,
|
|
256
|
+
attributes: TextAttributes.BOLD,
|
|
257
|
+
height: 1,
|
|
258
|
+
}, children: " OUTPUT " }), _jsx(OutputLines, { lines: lines, theme: theme, gutterFg: theme.toolOutput })] })) : null, item.artifactPath && !isFileDiff && !isMutation ? (_jsxs("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: [_jsx("text", { selectable: true, style: { fg: theme.white, bg: theme.chipTeal, attributes: TextAttributes.BOLD }, children: " SAVED " }), _jsx("text", { content: " ", selectable: true }), _jsx(LinkableText, { text: item.artifactPath, theme: theme, fg: theme.cyan, selectable: true })] })) : null, truncatedNotice ? (_jsx("text", { selectable: true, style: { fg: theme.muted, attributes: TextAttributes.ITALIC }, children: truncatedNotice })) : null, footerHint ? (_jsxs("box", { style: {
|
|
298
259
|
flexDirection: "row",
|
|
299
260
|
width: "100%",
|
|
300
261
|
marginTop: 0,
|