wave-code 0.0.10 → 0.0.12
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/README.md +5 -5
- package/dist/components/BashHistorySelector.d.ts.map +1 -1
- package/dist/components/BashHistorySelector.js +3 -17
- package/dist/components/Confirmation.js +2 -2
- package/dist/managers/InputManager.js +1 -1
- package/package.json +2 -2
- package/src/components/BashHistorySelector.tsx +3 -26
- package/src/components/Confirmation.tsx +2 -2
- package/src/managers/InputManager.ts +1 -1
package/README.md
CHANGED
|
@@ -27,20 +27,20 @@ Before use, you need to configure the following environment variables for AI mod
|
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# AI Gateway access token (required)
|
|
30
|
-
export
|
|
30
|
+
export WAVE_API_KEY="your_token_here"
|
|
31
31
|
|
|
32
32
|
# AI Gateway API URL (required)
|
|
33
|
-
export
|
|
33
|
+
export WAVE_BASE_URL="https://your-api-gateway-url.com"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### Optional Environment Variables
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Specify AI model (optional, defaults to system configured model)
|
|
40
|
-
export
|
|
40
|
+
export WAVE_MODEL="gemini-2.5-flash"
|
|
41
41
|
|
|
42
42
|
# Specify fast AI model (optional, for quick response scenarios)
|
|
43
|
-
export
|
|
43
|
+
export WAVE_FAST_MODEL="gemini-1.5-flash"
|
|
44
44
|
|
|
45
45
|
# Log level (optional, defaults to info)
|
|
46
46
|
export LOG_LEVEL="debug"
|
|
@@ -52,7 +52,7 @@ export LOG_FILE="/path/to/your/logfile.log"
|
|
|
52
52
|
export LOG_MAX_FILE_SIZE="10485760"
|
|
53
53
|
|
|
54
54
|
# Token limit (optional, defaults to 96000)
|
|
55
|
-
export
|
|
55
|
+
export WAVE_MAX_INPUT_TOKENS="96000"
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BashHistorySelector.d.ts","sourceRoot":"","sources":["../../src/components/BashHistorySelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BashHistorySelector.d.ts","sourceRoot":"","sources":["../../src/components/BashHistorySelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAqJlE,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { searchBashHistory
|
|
4
|
+
import { searchBashHistory } from "wave-agent-sdk";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
export const BashHistorySelector = ({ searchQuery, workdir, onSelect, onExecute, onCancel, }) => {
|
|
7
7
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
8
8
|
const [commands, setCommands] = useState([]);
|
|
9
|
-
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
10
9
|
// Search bash history
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
const results = searchBashHistory(searchQuery, 10, workdir);
|
|
@@ -16,9 +15,8 @@ export const BashHistorySelector = ({ searchQuery, workdir, onSelect, onExecute,
|
|
|
16
15
|
searchQuery,
|
|
17
16
|
workdir,
|
|
18
17
|
resultCount: results.length,
|
|
19
|
-
refreshCounter,
|
|
20
18
|
});
|
|
21
|
-
}, [searchQuery, workdir
|
|
19
|
+
}, [searchQuery, workdir]);
|
|
22
20
|
useInput((input, key) => {
|
|
23
21
|
logger.debug("BashHistorySelector useInput:", {
|
|
24
22
|
input,
|
|
@@ -60,18 +58,6 @@ export const BashHistorySelector = ({ searchQuery, workdir, onSelect, onExecute,
|
|
|
60
58
|
setSelectedIndex(Math.min(commands.length - 1, selectedIndex + 1));
|
|
61
59
|
return;
|
|
62
60
|
}
|
|
63
|
-
if (key.delete) {
|
|
64
|
-
if (commands.length > 0 && selectedIndex < commands.length) {
|
|
65
|
-
const selectedCommand = commands[selectedIndex];
|
|
66
|
-
deleteBashCommandFromHistory(selectedCommand.command, selectedCommand.workdir);
|
|
67
|
-
setRefreshCounter((prev) => prev + 1);
|
|
68
|
-
// Adjust selectedIndex if we deleted the last item
|
|
69
|
-
if (selectedIndex >= commands.length - 1 && selectedIndex > 0) {
|
|
70
|
-
setSelectedIndex(selectedIndex - 1);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
61
|
});
|
|
76
62
|
if (commands.length === 0) {
|
|
77
63
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "yellow", padding: 1, marginBottom: 1, children: [_jsxs(Text, { color: "yellow", children: ["No bash history found ", searchQuery && `for "${searchQuery}"`] }), searchQuery.trim() && (_jsxs(Text, { color: "green", children: ["Press Enter to execute: ", searchQuery] })), searchQuery.trim() && (_jsxs(Text, { color: "blue", children: ["Press Tab to insert: ", searchQuery] })), _jsx(Text, { dimColor: true, children: "Press Escape to cancel" })] }));
|
|
@@ -93,5 +79,5 @@ export const BashHistorySelector = ({ searchQuery, workdir, onSelect, onExecute,
|
|
|
93
79
|
return diffMinutes > 0 ? `${diffMinutes}m ago` : "just now";
|
|
94
80
|
}
|
|
95
81
|
};
|
|
96
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "blue", padding: 1, gap: 1, marginBottom: 1, children: [_jsx(Box, { children: _jsxs(Text, { color: "blue", bold: true, children: ["Bash History ", searchQuery && `(filtering: "${searchQuery}")`] }) }), commands.map((cmd, index) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: index === selectedIndex ? "black" : "white", backgroundColor: index === selectedIndex ? "blue" : undefined, children: cmd.command }), index === selectedIndex && (_jsx(Box, { marginLeft: 4, flexDirection: "column", children: _jsxs(Text, { color: "gray", dimColor: true, children: [formatTimestamp(cmd.timestamp), cmd.workdir !== workdir && ` • in ${cmd.workdir}`] }) }))] }, index))), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "Use \u2191\u2193 to navigate, Enter to execute, Tab to insert,
|
|
82
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "blue", padding: 1, gap: 1, marginBottom: 1, children: [_jsx(Box, { children: _jsxs(Text, { color: "blue", bold: true, children: ["Bash History ", searchQuery && `(filtering: "${searchQuery}")`] }) }), commands.map((cmd, index) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: index === selectedIndex ? "black" : "white", backgroundColor: index === selectedIndex ? "blue" : undefined, children: cmd.command }), index === selectedIndex && (_jsx(Box, { marginLeft: 4, flexDirection: "column", children: _jsxs(Text, { color: "gray", dimColor: true, children: [formatTimestamp(cmd.timestamp), cmd.workdir !== workdir && ` • in ${cmd.workdir}`] }) }))] }, index))), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "Use \u2191\u2193 to navigate, Enter to execute, Tab to insert, Escape to cancel" }) })] }));
|
|
97
83
|
};
|
|
@@ -24,8 +24,8 @@ const getActionDescription = (toolName, toolInput) => {
|
|
|
24
24
|
export const Confirmation = ({ toolName, toolInput, suggestedPrefix, hidePersistentOption, onDecision, onCancel, onAbort, }) => {
|
|
25
25
|
const [state, setState] = useState({
|
|
26
26
|
selectedOption: "allow",
|
|
27
|
-
alternativeText:
|
|
28
|
-
hasUserInput:
|
|
27
|
+
alternativeText: "",
|
|
28
|
+
hasUserInput: false,
|
|
29
29
|
});
|
|
30
30
|
const getAutoOptionText = () => {
|
|
31
31
|
if (toolName === "Bash") {
|
|
@@ -680,7 +680,7 @@ export class InputManager {
|
|
|
680
680
|
}
|
|
681
681
|
// Handle selector input (when any selector is active)
|
|
682
682
|
handleSelectorInput(input, key) {
|
|
683
|
-
if (key.backspace ||
|
|
683
|
+
if (key.backspace || key.delete) {
|
|
684
684
|
if (this.cursorPosition > 0) {
|
|
685
685
|
this.deleteCharAtCursor((newInput, newCursorPosition) => {
|
|
686
686
|
// Check for special character deletion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"marked": "^11.2.0",
|
|
32
32
|
"react": "^19.1.0",
|
|
33
33
|
"yargs": "^17.7.2",
|
|
34
|
-
"wave-agent-sdk": "0.0.
|
|
34
|
+
"wave-agent-sdk": "0.0.13"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "^19.1.8",
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Box, Text, useInput } from "ink";
|
|
3
|
-
import {
|
|
4
|
-
searchBashHistory,
|
|
5
|
-
deleteBashCommandFromHistory,
|
|
6
|
-
type BashHistoryEntry,
|
|
7
|
-
} from "wave-agent-sdk";
|
|
3
|
+
import { searchBashHistory, type BashHistoryEntry } from "wave-agent-sdk";
|
|
8
4
|
import { logger } from "../utils/logger.js";
|
|
9
5
|
|
|
10
6
|
export interface BashHistorySelectorProps {
|
|
@@ -24,7 +20,6 @@ export const BashHistorySelector: React.FC<BashHistorySelectorProps> = ({
|
|
|
24
20
|
}) => {
|
|
25
21
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
26
22
|
const [commands, setCommands] = useState<BashHistoryEntry[]>([]);
|
|
27
|
-
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
28
23
|
|
|
29
24
|
// Search bash history
|
|
30
25
|
useEffect(() => {
|
|
@@ -35,9 +30,8 @@ export const BashHistorySelector: React.FC<BashHistorySelectorProps> = ({
|
|
|
35
30
|
searchQuery,
|
|
36
31
|
workdir,
|
|
37
32
|
resultCount: results.length,
|
|
38
|
-
refreshCounter,
|
|
39
33
|
});
|
|
40
|
-
}, [searchQuery, workdir
|
|
34
|
+
}, [searchQuery, workdir]);
|
|
41
35
|
|
|
42
36
|
useInput((input, key) => {
|
|
43
37
|
logger.debug("BashHistorySelector useInput:", {
|
|
@@ -83,22 +77,6 @@ export const BashHistorySelector: React.FC<BashHistorySelectorProps> = ({
|
|
|
83
77
|
setSelectedIndex(Math.min(commands.length - 1, selectedIndex + 1));
|
|
84
78
|
return;
|
|
85
79
|
}
|
|
86
|
-
|
|
87
|
-
if (key.delete) {
|
|
88
|
-
if (commands.length > 0 && selectedIndex < commands.length) {
|
|
89
|
-
const selectedCommand = commands[selectedIndex];
|
|
90
|
-
deleteBashCommandFromHistory(
|
|
91
|
-
selectedCommand.command,
|
|
92
|
-
selectedCommand.workdir,
|
|
93
|
-
);
|
|
94
|
-
setRefreshCounter((prev) => prev + 1);
|
|
95
|
-
// Adjust selectedIndex if we deleted the last item
|
|
96
|
-
if (selectedIndex >= commands.length - 1 && selectedIndex > 0) {
|
|
97
|
-
setSelectedIndex(selectedIndex - 1);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
80
|
});
|
|
103
81
|
|
|
104
82
|
if (commands.length === 0) {
|
|
@@ -177,8 +155,7 @@ export const BashHistorySelector: React.FC<BashHistorySelectorProps> = ({
|
|
|
177
155
|
|
|
178
156
|
<Box>
|
|
179
157
|
<Text dimColor>
|
|
180
|
-
Use ↑↓ to navigate, Enter to execute, Tab to insert,
|
|
181
|
-
Escape to cancel
|
|
158
|
+
Use ↑↓ to navigate, Enter to execute, Tab to insert, Escape to cancel
|
|
182
159
|
</Text>
|
|
183
160
|
</Box>
|
|
184
161
|
</Box>
|
|
@@ -54,8 +54,8 @@ export const Confirmation: React.FC<ConfirmationProps> = ({
|
|
|
54
54
|
}) => {
|
|
55
55
|
const [state, setState] = useState<ConfirmationState>({
|
|
56
56
|
selectedOption: "allow",
|
|
57
|
-
alternativeText:
|
|
58
|
-
hasUserInput:
|
|
57
|
+
alternativeText: "",
|
|
58
|
+
hasUserInput: false,
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const getAutoOptionText = () => {
|
|
@@ -944,7 +944,7 @@ export class InputManager {
|
|
|
944
944
|
|
|
945
945
|
// Handle selector input (when any selector is active)
|
|
946
946
|
handleSelectorInput(input: string, key: Key): boolean {
|
|
947
|
-
if (key.backspace ||
|
|
947
|
+
if (key.backspace || key.delete) {
|
|
948
948
|
if (this.cursorPosition > 0) {
|
|
949
949
|
this.deleteCharAtCursor((newInput, newCursorPosition) => {
|
|
950
950
|
// Check for special character deletion
|