@dirgha/code 1.14.0 → 1.15.1
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/interactive.d.ts +5 -5
- package/dist/cli/interactive.js +206 -93
- package/dist/cli/interactive.js.map +1 -1
- package/dist/cli/main.js +9 -40
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/subcommands/ask.d.ts +1 -1
- package/dist/cli/subcommands/ask.js +53 -28
- package/dist/cli/subcommands/ask.js.map +1 -1
- package/dist/cli/subcommands/verify.d.ts +1 -1
- package/dist/cli/subcommands/verify.js +90 -37
- package/dist/cli/subcommands/verify.js.map +1 -1
- package/dist/kernel/agent-loop.d.ts +3 -3
- package/dist/kernel/agent-loop.js +72 -32
- package/dist/kernel/agent-loop.js.map +1 -1
- package/dist/tui/ink/App.js +29 -10
- package/dist/tui/ink/App.js.map +1 -1
- package/dist/tui/ink/components/DenseToolMessage.d.ts +3 -2
- package/dist/tui/ink/components/DenseToolMessage.js +50 -30
- package/dist/tui/ink/components/DenseToolMessage.js.map +1 -1
- package/dist/tui/ink/components/ThinkingBlock.d.ts +4 -5
- package/dist/tui/ink/components/ThinkingBlock.js +17 -3
- package/dist/tui/ink/components/ThinkingBlock.js.map +1 -1
- package/dist/tui/ink/components/ToolBox.d.ts +2 -2
- package/dist/tui/ink/components/ToolBox.js +49 -26
- package/dist/tui/ink/components/ToolBox.js.map +1 -1
- package/dist/tui/ink/components/ToolGroup.d.ts +2 -2
- package/dist/tui/ink/components/ToolGroup.js +44 -36
- package/dist/tui/ink/components/ToolGroup.js.map +1 -1
- package/dist/tui/ink/use-event-projection.d.ts +9 -9
- package/dist/tui/ink/use-event-projection.js +101 -37
- package/dist/tui/ink/use-event-projection.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DenseToolMessage.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/DenseToolMessage.tsx"],"names":[],"mappings":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AO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
* Thinking block: dim italic render of reasoning tokens.
|
|
3
3
|
*
|
|
4
4
|
* Collapsed by default to a char-count summary (`thinking… (N chars)`)
|
|
5
|
-
* to stop reasoning-heavy models from flooding the screen.
|
|
6
|
-
*
|
|
5
|
+
* to stop reasoning-heavy models from flooding the screen. Press Enter
|
|
6
|
+
* (Return) on a collapsed block to expand it, Enter again to collapse.
|
|
7
7
|
*/
|
|
8
|
-
import * as React from
|
|
8
|
+
import * as React from "react";
|
|
9
9
|
export interface ThinkingBlockProps {
|
|
10
10
|
content: string;
|
|
11
|
-
expanded?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export declare function ThinkingBlock({ content,
|
|
12
|
+
export declare function ThinkingBlock({ content, }: ThinkingBlockProps): React.JSX.Element | null;
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Thinking block: dim italic render of reasoning tokens.
|
|
4
|
+
*
|
|
5
|
+
* Collapsed by default to a char-count summary (`thinking… (N chars)`)
|
|
6
|
+
* to stop reasoning-heavy models from flooding the screen. Press Enter
|
|
7
|
+
* (Return) on a collapsed block to expand it, Enter again to collapse.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { Box, Text, useInput, useStdout } from "ink";
|
|
11
|
+
export function ThinkingBlock({ content, }) {
|
|
4
12
|
const { stdout } = useStdout();
|
|
5
13
|
const width = Math.max(20, (stdout?.columns ?? 80) - 6);
|
|
14
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
15
|
+
useInput((_, key) => {
|
|
16
|
+
if (key.return) {
|
|
17
|
+
setExpanded((prev) => !prev);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
6
20
|
if (content.length === 0)
|
|
7
21
|
return null;
|
|
8
22
|
if (!expanded) {
|
|
9
|
-
return (_jsxs(Box, { gap: 1, marginBottom: 1, children: [_jsx(Text, { color: "gray", dimColor: true, children: "\u280B" }), _jsxs(Text, { color: "gray", dimColor: true, italic: true, children: ["thinking\u2026 (", content.length, " chars)"] })] }));
|
|
23
|
+
return (_jsxs(Box, { gap: 1, marginBottom: 1, children: [_jsx(Text, { color: "gray", dimColor: true, children: "\u280B" }), _jsxs(Text, { color: "gray", dimColor: true, italic: true, children: ["thinking\u2026 (", content.length, " chars \u2014 Enter to expand)"] })] }));
|
|
10
24
|
}
|
|
11
25
|
return (_jsxs(Box, { gap: 2, width: width, marginBottom: 1, children: [_jsx(Text, { color: "gray", dimColor: true, children: "\u280B" }), _jsx(Text, { color: "gray", dimColor: true, italic: true, wrap: "wrap", children: content })] }));
|
|
12
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThinkingBlock.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/ThinkingBlock.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ThinkingBlock.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/ThinkingBlock.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAMrD,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO,GACY;IACnB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QAClB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CACL,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,aAC1B,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,6BAEpB,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,QAAC,MAAM,uCACpB,OAAO,CAAC,MAAM,sCACrB,IACH,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,aACxC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,6BAEpB,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,QAAC,MAAM,QAAC,IAAI,EAAC,MAAM,YAC3C,OAAO,GACH,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* output preview. No state is owned here — App is the source of truth
|
|
8
8
|
* so history stays immutable after scroll-off.
|
|
9
9
|
*/
|
|
10
|
-
import * as React from
|
|
11
|
-
export type ToolStatus =
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
export type ToolStatus = "pending" | "running" | "done" | "error";
|
|
12
12
|
export interface ToolBoxProps {
|
|
13
13
|
name: string;
|
|
14
14
|
status: ToolStatus;
|
|
@@ -8,24 +8,35 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* output preview. No state is owned here — App is the source of truth
|
|
9
9
|
* so history stays immutable after scroll-off.
|
|
10
10
|
*/
|
|
11
|
-
import * as React from
|
|
12
|
-
import { Box, Text } from
|
|
13
|
-
import { iconFor } from
|
|
14
|
-
import { useTheme } from
|
|
15
|
-
const SPINNER_FRAMES = [
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { Box, Text } from "ink";
|
|
13
|
+
import { iconFor } from "../icons.js";
|
|
14
|
+
import { useTheme } from "../theme-context.js";
|
|
15
|
+
const SPINNER_FRAMES = [
|
|
16
|
+
"⠋",
|
|
17
|
+
"⠙",
|
|
18
|
+
"⠹",
|
|
19
|
+
"⠸",
|
|
20
|
+
"⠼",
|
|
21
|
+
"⠴",
|
|
22
|
+
"⠦",
|
|
23
|
+
"⠧",
|
|
24
|
+
"⠇",
|
|
25
|
+
"⠏",
|
|
26
|
+
];
|
|
16
27
|
const TOOL_LABEL = {
|
|
17
|
-
fs_read:
|
|
18
|
-
fs_write:
|
|
19
|
-
fs_edit:
|
|
20
|
-
fs_ls:
|
|
21
|
-
search_grep:
|
|
22
|
-
search_glob:
|
|
23
|
-
shell:
|
|
24
|
-
git:
|
|
25
|
-
task:
|
|
28
|
+
fs_read: "Read",
|
|
29
|
+
fs_write: "Write",
|
|
30
|
+
fs_edit: "Edit",
|
|
31
|
+
fs_ls: "List",
|
|
32
|
+
search_grep: "Grep",
|
|
33
|
+
search_glob: "Glob",
|
|
34
|
+
shell: "Shell",
|
|
35
|
+
git: "Git",
|
|
36
|
+
task: "Task",
|
|
26
37
|
};
|
|
27
38
|
function prettyName(name) {
|
|
28
|
-
return TOOL_LABEL[name] ?? name.replace(/_/g,
|
|
39
|
+
return TOOL_LABEL[name] ?? name.replace(/_/g, " ");
|
|
29
40
|
}
|
|
30
41
|
function formatElapsed(ms) {
|
|
31
42
|
if (ms < 1000)
|
|
@@ -40,27 +51,39 @@ export function ToolBox(props) {
|
|
|
40
51
|
const [frame, setFrame] = React.useState(0);
|
|
41
52
|
const [tick, setTick] = React.useState(0);
|
|
42
53
|
React.useEffect(() => {
|
|
43
|
-
if (props.status !==
|
|
54
|
+
if (props.status !== "running")
|
|
44
55
|
return;
|
|
45
56
|
const t = setInterval(() => {
|
|
46
|
-
setFrame(f => (f + 1) % SPINNER_FRAMES.length);
|
|
47
|
-
setTick(n => n + 1);
|
|
57
|
+
setFrame((f) => (f + 1) % SPINNER_FRAMES.length);
|
|
58
|
+
setTick((n) => n + 1);
|
|
48
59
|
}, 80);
|
|
49
60
|
return () => clearInterval(t);
|
|
50
61
|
}, [props.status]);
|
|
51
|
-
const icon = props.status ===
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
const icon = props.status === "error"
|
|
63
|
+
? "✗"
|
|
64
|
+
: props.status === "done"
|
|
65
|
+
? "✓"
|
|
66
|
+
: SPINNER_FRAMES[frame];
|
|
67
|
+
const iconColour = props.status === "error"
|
|
68
|
+
? palette.error
|
|
69
|
+
: props.status === "done"
|
|
70
|
+
? palette.brand
|
|
71
|
+
: palette.brand;
|
|
72
|
+
const borderColour = props.status === "error"
|
|
73
|
+
? palette.error
|
|
74
|
+
: props.status === "done"
|
|
75
|
+
? palette.borderIdle
|
|
76
|
+
: palette.brand;
|
|
77
|
+
const elapsedLabel = props.status === "running"
|
|
55
78
|
? formatElapsed(Date.now() - props.startedAt)
|
|
56
79
|
: props.durationMs !== undefined
|
|
57
80
|
? formatElapsed(props.durationMs)
|
|
58
|
-
:
|
|
81
|
+
: "";
|
|
59
82
|
// tick is read so React treats it as a live dep; silences unused var lints.
|
|
60
83
|
void tick;
|
|
61
84
|
const preview = props.outputPreview
|
|
62
|
-
? props.outputPreview.replace(/\s+/g,
|
|
63
|
-
:
|
|
64
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: borderColour, paddingX: 1, marginBottom: 1, children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: iconColour, children: icon }), _jsx(Text, { color: palette.accent, bold: true, children: iconFor(props.name) }), _jsx(Text, { color: props.status ===
|
|
85
|
+
? props.outputPreview.replace(/\s+/g, " ").slice(0, 80)
|
|
86
|
+
: "";
|
|
87
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: borderColour, paddingX: 1, marginBottom: 1, children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: iconColour, children: icon }), _jsx(Text, { color: palette.accent, bold: true, children: iconFor(props.name) }), _jsx(Text, { color: props.status === "done" ? palette.textMuted : palette.textPrimary, bold: true, children: prettyName(props.name) }), props.argSummary !== undefined && props.argSummary.length > 0 && (_jsxs(Text, { color: palette.textMuted, dimColor: true, children: ["(", props.argSummary, ")"] })), elapsedLabel !== "" && (_jsx(Text, { color: palette.textMuted, dimColor: true, children: elapsedLabel }))] }), preview !== "" && (_jsx(Box, { children: _jsx(Text, { color: palette.textMuted, dimColor: true, children: preview }) }))] }));
|
|
65
88
|
}
|
|
66
89
|
//# sourceMappingURL=ToolBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolBox.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/ToolBox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAa/C,MAAM,cAAc,GAAsB,
|
|
1
|
+
{"version":3,"file":"ToolBox.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/ToolBox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,OAAO,EAA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AE,QAAQ,kBACrC,YAAY,GACR,CACR,IACG,EACL,OAAO,KAAK,EAAE,IAAI,CACjB,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,kBACrC,OAAO,GACH,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* with name + arg summary at the top, output preview below, all
|
|
13
13
|
* inside the connected region.
|
|
14
14
|
*/
|
|
15
|
-
import * as React from
|
|
16
|
-
import type { ToolStatus } from
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import type { ToolStatus } from "./ToolBox.js";
|
|
17
17
|
export interface ToolItem {
|
|
18
18
|
id: string;
|
|
19
19
|
name: string;
|
|
@@ -13,22 +13,22 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
13
13
|
* with name + arg summary at the top, output preview below, all
|
|
14
14
|
* inside the connected region.
|
|
15
15
|
*/
|
|
16
|
-
import * as React from
|
|
17
|
-
import { Box, Text } from
|
|
18
|
-
import { useTheme } from
|
|
19
|
-
import { iconFor, TOOL_STATUS } from
|
|
20
|
-
import { DenseToolMessage, isDenseTool } from
|
|
21
|
-
const SPINNER = [
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { Box, Text } from "ink";
|
|
18
|
+
import { useTheme } from "../theme-context.js";
|
|
19
|
+
import { iconFor, TOOL_STATUS } from "../icons.js";
|
|
20
|
+
import { DenseToolMessage, isDenseTool } from "./DenseToolMessage.js";
|
|
21
|
+
const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
22
22
|
const TOOL_LABEL = {
|
|
23
|
-
fs_read:
|
|
24
|
-
fs_write:
|
|
25
|
-
fs_edit:
|
|
26
|
-
fs_ls:
|
|
27
|
-
search_grep:
|
|
28
|
-
search_glob:
|
|
29
|
-
shell:
|
|
30
|
-
git:
|
|
31
|
-
task:
|
|
23
|
+
fs_read: "Read",
|
|
24
|
+
fs_write: "Write",
|
|
25
|
+
fs_edit: "Edit",
|
|
26
|
+
fs_ls: "List",
|
|
27
|
+
search_grep: "Grep",
|
|
28
|
+
search_glob: "Glob",
|
|
29
|
+
shell: "Shell",
|
|
30
|
+
git: "Git",
|
|
31
|
+
task: "Task",
|
|
32
32
|
};
|
|
33
33
|
export function ToolGroup(props) {
|
|
34
34
|
const palette = useTheme();
|
|
@@ -36,45 +36,53 @@ export function ToolGroup(props) {
|
|
|
36
36
|
return null;
|
|
37
37
|
// Border colour follows the most-severe state: error > running > done.
|
|
38
38
|
const groupColour = pickGroupColour(props.tools, palette);
|
|
39
|
-
const isDimmed = props.tools.every(t => t.status ===
|
|
39
|
+
const isDimmed = props.tools.every((t) => t.status === "done");
|
|
40
40
|
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: _jsx(Box, { borderStyle: "round", borderColor: groupColour, borderDimColor: isDimmed, paddingX: 1, flexDirection: "column", children: props.tools.map((tool, idx) => {
|
|
41
41
|
const isLast = idx === props.tools.length - 1;
|
|
42
42
|
if (isDenseTool(tool.name)) {
|
|
43
|
-
return (_jsx(Box, { marginBottom: isLast ? 0 : 0, children: _jsx(DenseToolMessage, { name: tool.name, status: tool.status, argSummary: tool.argSummary, outputPreview: tool.outputPreview, durationMs: tool.durationMs }) }, tool.id));
|
|
43
|
+
return (_jsx(Box, { marginBottom: isLast ? 0 : 0, children: _jsx(DenseToolMessage, { name: tool.name, status: tool.status, argSummary: tool.argSummary, outputPreview: tool.outputPreview, durationMs: tool.durationMs, startedAt: tool.startedAt }) }, tool.id));
|
|
44
44
|
}
|
|
45
|
-
return _jsx(FullToolRow, { tool: tool, divider: !isLast, palette: palette }, tool.id);
|
|
45
|
+
return (_jsx(FullToolRow, { tool: tool, divider: !isLast, palette: palette }, tool.id));
|
|
46
46
|
}) }) }));
|
|
47
47
|
}
|
|
48
|
-
function FullToolRow({ tool, divider, palette }) {
|
|
48
|
+
function FullToolRow({ tool, divider, palette, }) {
|
|
49
49
|
const [frame, setFrame] = React.useState(0);
|
|
50
50
|
React.useEffect(() => {
|
|
51
|
-
if (tool.status !==
|
|
51
|
+
if (tool.status !== "running")
|
|
52
52
|
return;
|
|
53
|
-
const t = setInterval(() => setFrame(f => (f + 1) % SPINNER.length), 80);
|
|
53
|
+
const t = setInterval(() => setFrame((f) => (f + 1) % SPINNER.length), 80);
|
|
54
54
|
return () => clearInterval(t);
|
|
55
55
|
}, [tool.status]);
|
|
56
|
-
const glyph = tool.status ===
|
|
57
|
-
|
|
56
|
+
const glyph = tool.status === "error"
|
|
57
|
+
? TOOL_STATUS.ERROR
|
|
58
|
+
: tool.status === "done"
|
|
59
|
+
? TOOL_STATUS.SUCCESS
|
|
58
60
|
: SPINNER[frame];
|
|
59
|
-
const glyphColour = tool.status ===
|
|
60
|
-
|
|
61
|
+
const glyphColour = tool.status === "error"
|
|
62
|
+
? palette.status.error
|
|
63
|
+
: tool.status === "done"
|
|
64
|
+
? palette.status.success
|
|
61
65
|
: palette.status.warning;
|
|
62
|
-
const nameColour = tool.status ===
|
|
63
|
-
|
|
66
|
+
const nameColour = tool.status === "done"
|
|
67
|
+
? palette.text.secondary
|
|
68
|
+
: tool.status === "error"
|
|
69
|
+
? palette.status.error
|
|
64
70
|
: palette.text.primary;
|
|
65
|
-
const elapsed = tool.durationMs !== undefined
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
const elapsed = tool.durationMs !== undefined
|
|
72
|
+
? formatElapsed(tool.durationMs)
|
|
73
|
+
: tool.status === "running"
|
|
74
|
+
? formatElapsed(Date.now() - tool.startedAt)
|
|
75
|
+
: "";
|
|
76
|
+
const label = TOOL_LABEL[tool.name] ?? tool.name.replace(/_/g, " ");
|
|
69
77
|
const preview = tool.outputPreview
|
|
70
|
-
? tool.outputPreview.replace(/\s+/g,
|
|
71
|
-
:
|
|
72
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: glyphColour, bold: tool.status !==
|
|
78
|
+
? tool.outputPreview.replace(/\s+/g, " ").slice(0, 200)
|
|
79
|
+
: "";
|
|
80
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { minWidth: 2, children: _jsx(Text, { color: glyphColour, bold: tool.status !== "running", children: glyph }) }), _jsx(Text, { color: palette.text.accent, children: iconFor(tool.name) }), _jsx(Text, { children: " " }), _jsx(Text, { bold: true, color: nameColour, children: label }), tool.argSummary && tool.argSummary.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: palette.text.secondary, children: tool.argSummary })] })), elapsed && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: palette.text.secondary, dimColor: true, children: elapsed })] }))] }), preview && (_jsx(Box, { paddingLeft: 4, children: _jsxs(Text, { color: palette.text.secondary, dimColor: true, children: ["\u23BF ", preview] }) })), divider && (_jsx(Box, { children: _jsx(Text, { color: palette.border.default, dimColor: true, children: " " }) }))] }));
|
|
73
81
|
}
|
|
74
82
|
function pickGroupColour(tools, palette) {
|
|
75
|
-
if (tools.some(t => t.status ===
|
|
83
|
+
if (tools.some((t) => t.status === "error"))
|
|
76
84
|
return palette.status.error;
|
|
77
|
-
if (tools.some(t => t.status ===
|
|
85
|
+
if (tools.some((t) => t.status === "running"))
|
|
78
86
|
return palette.ui.focus;
|
|
79
87
|
return palette.border.default;
|
|
80
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolGroup.js","sourceRoot":"","sources":["../../../../src/tui/ink/components/ToolGroup.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AA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AI,IAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,kBACI,GAAG,GAC7C,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACtB,KAAiB,EACjB,OAAoC;IAEpC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACzE,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;QAAE,OAAO,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC;IACvE,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;AAChC,CAAC;AAED,SAAS,aAAa,CAAC,EAAU;IAC/B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,GAAG,EAAE,IAAI,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC;IAC3B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC;AAC7C,CAAC"}
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
* ThinkingSpan; each tool invocation produces a ToolRecord that
|
|
9
9
|
* starts in 'running' and flips to 'done' or 'error' on exec_end.
|
|
10
10
|
*/
|
|
11
|
-
import type { UsageTotal } from
|
|
12
|
-
import type { EventStream } from
|
|
13
|
-
import type { ToolStatus } from
|
|
11
|
+
import type { UsageTotal } from "../../kernel/types.js";
|
|
12
|
+
import type { EventStream } from "../../kernel/event-stream.js";
|
|
13
|
+
import type { ToolStatus } from "./components/ToolBox.js";
|
|
14
14
|
export type TranscriptItem = {
|
|
15
|
-
kind:
|
|
15
|
+
kind: "user";
|
|
16
16
|
id: string;
|
|
17
17
|
text: string;
|
|
18
18
|
} | {
|
|
19
|
-
kind:
|
|
19
|
+
kind: "text";
|
|
20
20
|
id: string;
|
|
21
21
|
content: string;
|
|
22
22
|
} | {
|
|
23
|
-
kind:
|
|
23
|
+
kind: "thinking";
|
|
24
24
|
id: string;
|
|
25
25
|
content: string;
|
|
26
26
|
} | {
|
|
27
|
-
kind:
|
|
27
|
+
kind: "tool";
|
|
28
28
|
id: string;
|
|
29
29
|
name: string;
|
|
30
30
|
status: ToolStatus;
|
|
@@ -33,12 +33,12 @@ export type TranscriptItem = {
|
|
|
33
33
|
startedAt: number;
|
|
34
34
|
durationMs?: number;
|
|
35
35
|
} | {
|
|
36
|
-
kind:
|
|
36
|
+
kind: "error";
|
|
37
37
|
id: string;
|
|
38
38
|
message: string;
|
|
39
39
|
failoverModel?: string;
|
|
40
40
|
} | {
|
|
41
|
-
kind:
|
|
41
|
+
kind: "notice";
|
|
42
42
|
id: string;
|
|
43
43
|
text: string;
|
|
44
44
|
};
|