wave-code 0.12.9 → 0.12.10
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/components/MessageBlockItem.d.ts.map +1 -1
- package/dist/components/MessageBlockItem.js +1 -2
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +3 -9
- package/package.json +2 -2
- package/src/components/MessageBlockItem.tsx +0 -5
- package/src/components/MessageList.tsx +3 -13
- package/dist/components/SlashDisplay.d.ts +0 -9
- package/dist/components/SlashDisplay.d.ts.map +0 -1
- package/dist/components/SlashDisplay.js +0 -20
- package/src/components/SlashDisplay.tsx +0 -70
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBlockItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageBlockItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageBlockItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageBlockItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ5D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,GAAI,6CAK9B,qBAAqB,4CA4DvB,CAAC"}
|
|
@@ -2,11 +2,10 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import { MessageSource } from "wave-agent-sdk";
|
|
4
4
|
import { BangDisplay } from "./BangDisplay.js";
|
|
5
|
-
import { SlashDisplay } from "./SlashDisplay.js";
|
|
6
5
|
import { ToolDisplay } from "./ToolDisplay.js";
|
|
7
6
|
import { CompressDisplay } from "./CompressDisplay.js";
|
|
8
7
|
import { ReasoningDisplay } from "./ReasoningDisplay.js";
|
|
9
8
|
import { Markdown } from "./Markdown.js";
|
|
10
9
|
export const MessageBlockItem = ({ block, message, isExpanded, paddingTop = 0, }) => {
|
|
11
|
-
return (_jsxs(Box, { flexDirection: "column", paddingTop: paddingTop, children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["~", " "] })), message.role === "user" || isExpanded ? (_jsx(Text, { backgroundColor: message.role === "user" ? "gray" : undefined, color: "white", children: block.content })) : (_jsx(Markdown, { children: block.content }))] })), block.type === "
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", paddingTop: paddingTop, children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["~", " "] })), message.role === "user" || isExpanded ? (_jsx(Text, { backgroundColor: message.role === "user" ? "gray" : undefined, color: "white", children: block.content })) : (_jsx(Markdown, { children: block.content }))] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", block.content] }) })), block.type === "bang" && (_jsx(BangDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "# Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "reasoning" && (_jsx(ReasoningDisplay, { block: block, isExpanded: isExpanded }))] }));
|
|
12
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,uFAOnB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,uFAOnB,gBAAgB,6CAwGpB,CAAC"}
|
|
@@ -10,12 +10,7 @@ export const MessageList = React.memo(({ messages, isExpanded = false, forceStat
|
|
|
10
10
|
// Filter out meta messages
|
|
11
11
|
const visibleMessages = messages.filter((m) => !m.isMeta);
|
|
12
12
|
const isRunning = (b) => (b.type === "tool" && b.stage === "running") ||
|
|
13
|
-
(b.type === "bang" && b.isRunning)
|
|
14
|
-
(b.type === "slash" && b.stage === "running");
|
|
15
|
-
const messagesWithRunningBlocks = new Set(visibleMessages
|
|
16
|
-
.map((m, i) => ({ m, i }))
|
|
17
|
-
.filter(({ m }) => m.blocks.some(isRunning))
|
|
18
|
-
.map(({ i }) => i));
|
|
13
|
+
(b.type === "bang" && b.isRunning);
|
|
19
14
|
// Flatten messages into blocks with metadata
|
|
20
15
|
const allBlocks = visibleMessages.flatMap((message, messageIndex) => {
|
|
21
16
|
return message.blocks.map((block, blockIndex) => ({
|
|
@@ -27,11 +22,10 @@ export const MessageList = React.memo(({ messages, isExpanded = false, forceStat
|
|
|
27
22
|
}));
|
|
28
23
|
});
|
|
29
24
|
// Determine which blocks are static vs dynamic
|
|
25
|
+
// Only mark individual running blocks as dynamic, not entire messages
|
|
30
26
|
const blocksWithStatus = allBlocks.map((item) => {
|
|
31
27
|
const { block } = item;
|
|
32
|
-
const isDynamic = !forceStatic &&
|
|
33
|
-
!isExpanded &&
|
|
34
|
-
(messagesWithRunningBlocks.has(item.messageIndex) || isRunning(block));
|
|
28
|
+
const isDynamic = !forceStatic && !isExpanded && isRunning(block);
|
|
35
29
|
return { ...item, isDynamic };
|
|
36
30
|
});
|
|
37
31
|
const staticBlocks = blocksWithStatus.filter((b) => !b.isDynamic);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.10",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"semver": "^7.7.4",
|
|
43
43
|
"yargs": "^17.7.2",
|
|
44
44
|
"zod": "^3.23.8",
|
|
45
|
-
"wave-agent-sdk": "0.12.
|
|
45
|
+
"wave-agent-sdk": "0.12.10"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react": "^19.1.8",
|
|
@@ -3,7 +3,6 @@ import { Box, Text } from "ink";
|
|
|
3
3
|
import type { Message, MessageBlock } from "wave-agent-sdk";
|
|
4
4
|
import { MessageSource } from "wave-agent-sdk";
|
|
5
5
|
import { BangDisplay } from "./BangDisplay.js";
|
|
6
|
-
import { SlashDisplay } from "./SlashDisplay.js";
|
|
7
6
|
import { ToolDisplay } from "./ToolDisplay.js";
|
|
8
7
|
import { CompressDisplay } from "./CompressDisplay.js";
|
|
9
8
|
import { ReasoningDisplay } from "./ReasoningDisplay.js";
|
|
@@ -44,10 +43,6 @@ export const MessageBlockItem = ({
|
|
|
44
43
|
</Box>
|
|
45
44
|
)}
|
|
46
45
|
|
|
47
|
-
{block.type === "slash" && (
|
|
48
|
-
<SlashDisplay block={block} isExpanded={isExpanded} />
|
|
49
|
-
)}
|
|
50
|
-
|
|
51
46
|
{block.type === "error" && (
|
|
52
47
|
<Box>
|
|
53
48
|
<Text color="red">Error: {block.content}</Text>
|
|
@@ -39,15 +39,7 @@ export const MessageList = React.memo(
|
|
|
39
39
|
|
|
40
40
|
const isRunning = (b: MessageBlock) =>
|
|
41
41
|
(b.type === "tool" && b.stage === "running") ||
|
|
42
|
-
(b.type === "bang" && b.isRunning)
|
|
43
|
-
(b.type === "slash" && b.stage === "running");
|
|
44
|
-
|
|
45
|
-
const messagesWithRunningBlocks = new Set(
|
|
46
|
-
visibleMessages
|
|
47
|
-
.map((m, i) => ({ m, i }))
|
|
48
|
-
.filter(({ m }) => m.blocks.some(isRunning))
|
|
49
|
-
.map(({ i }) => i),
|
|
50
|
-
);
|
|
42
|
+
(b.type === "bang" && b.isRunning);
|
|
51
43
|
|
|
52
44
|
// Flatten messages into blocks with metadata
|
|
53
45
|
const allBlocks = visibleMessages.flatMap((message, messageIndex) => {
|
|
@@ -61,12 +53,10 @@ export const MessageList = React.memo(
|
|
|
61
53
|
});
|
|
62
54
|
|
|
63
55
|
// Determine which blocks are static vs dynamic
|
|
56
|
+
// Only mark individual running blocks as dynamic, not entire messages
|
|
64
57
|
const blocksWithStatus = allBlocks.map((item) => {
|
|
65
58
|
const { block } = item;
|
|
66
|
-
const isDynamic =
|
|
67
|
-
!forceStatic &&
|
|
68
|
-
!isExpanded &&
|
|
69
|
-
(messagesWithRunningBlocks.has(item.messageIndex) || isRunning(block));
|
|
59
|
+
const isDynamic = !forceStatic && !isExpanded && isRunning(block);
|
|
70
60
|
return { ...item, isDynamic };
|
|
71
61
|
});
|
|
72
62
|
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SlashBlock } from "wave-agent-sdk";
|
|
3
|
-
interface SlashDisplayProps {
|
|
4
|
-
block: SlashBlock;
|
|
5
|
-
isExpanded?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const SlashDisplay: React.FC<SlashDisplayProps>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=SlashDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlashDisplay.d.ts","sourceRoot":"","sources":["../../src/components/SlashDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,UAAU,iBAAiB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4DpD,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
export const SlashDisplay = ({ block, isExpanded = false, }) => {
|
|
4
|
-
const { command, args, stage, shortResult, error, result } = block;
|
|
5
|
-
const getStatusColor = () => {
|
|
6
|
-
switch (stage) {
|
|
7
|
-
case "running":
|
|
8
|
-
return "yellow";
|
|
9
|
-
case "success":
|
|
10
|
-
return "green";
|
|
11
|
-
case "error":
|
|
12
|
-
return "red";
|
|
13
|
-
case "aborted":
|
|
14
|
-
return "gray";
|
|
15
|
-
default:
|
|
16
|
-
return "white";
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: getStatusColor(), children: "/ " }), _jsx(Text, { color: "white", children: command }), args && _jsxs(Text, { color: "gray", children: [" ", args] })] }), !isExpanded && shortResult && !error && (_jsx(Box, { paddingLeft: 2, flexDirection: "column", children: shortResult.split("\n").map((line, index) => (_jsx(Text, { color: "gray", children: line }, index))) })), isExpanded && result && (_jsxs(Box, { paddingLeft: 2, flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Result:" }), _jsx(Text, { color: "white", children: result })] })), error && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { color: "red", children: ["Error: ", typeof error === "string" ? error : String(error)] }) }))] }));
|
|
20
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import type { SlashBlock } from "wave-agent-sdk";
|
|
4
|
-
|
|
5
|
-
interface SlashDisplayProps {
|
|
6
|
-
block: SlashBlock;
|
|
7
|
-
isExpanded?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const SlashDisplay: React.FC<SlashDisplayProps> = ({
|
|
11
|
-
block,
|
|
12
|
-
isExpanded = false,
|
|
13
|
-
}) => {
|
|
14
|
-
const { command, args, stage, shortResult, error, result } = block;
|
|
15
|
-
|
|
16
|
-
const getStatusColor = () => {
|
|
17
|
-
switch (stage) {
|
|
18
|
-
case "running":
|
|
19
|
-
return "yellow";
|
|
20
|
-
case "success":
|
|
21
|
-
return "green";
|
|
22
|
-
case "error":
|
|
23
|
-
return "red";
|
|
24
|
-
case "aborted":
|
|
25
|
-
return "gray";
|
|
26
|
-
default:
|
|
27
|
-
return "white";
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Box flexDirection="column">
|
|
33
|
-
<Box>
|
|
34
|
-
<Text color={getStatusColor()}>/ </Text>
|
|
35
|
-
<Text color="white">{command}</Text>
|
|
36
|
-
{args && <Text color="gray"> {args}</Text>}
|
|
37
|
-
</Box>
|
|
38
|
-
|
|
39
|
-
{/* Display shortResult in collapsed state */}
|
|
40
|
-
{!isExpanded && shortResult && !error && (
|
|
41
|
-
<Box paddingLeft={2} flexDirection="column">
|
|
42
|
-
{shortResult.split("\n").map((line, index) => (
|
|
43
|
-
<Text key={index} color="gray">
|
|
44
|
-
{line}
|
|
45
|
-
</Text>
|
|
46
|
-
))}
|
|
47
|
-
</Box>
|
|
48
|
-
)}
|
|
49
|
-
|
|
50
|
-
{/* Display complete result in expanded state */}
|
|
51
|
-
{isExpanded && result && (
|
|
52
|
-
<Box paddingLeft={2} flexDirection="column">
|
|
53
|
-
<Text color="cyan" bold>
|
|
54
|
-
Result:
|
|
55
|
-
</Text>
|
|
56
|
-
<Text color="white">{result}</Text>
|
|
57
|
-
</Box>
|
|
58
|
-
)}
|
|
59
|
-
|
|
60
|
-
{/* Error information always displayed */}
|
|
61
|
-
{error && (
|
|
62
|
-
<Box paddingLeft={2}>
|
|
63
|
-
<Text color="red">
|
|
64
|
-
Error: {typeof error === "string" ? error : String(error)}
|
|
65
|
-
</Text>
|
|
66
|
-
</Box>
|
|
67
|
-
)}
|
|
68
|
-
</Box>
|
|
69
|
-
);
|
|
70
|
-
};
|