wave-code 0.11.5 → 0.11.7
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/acp/agent.d.ts.map +1 -1
- package/dist/acp/agent.js +9 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +97 -0
- package/dist/components/App.js +1 -1
- package/dist/components/BtwDisplay.d.ts +8 -0
- package/dist/components/BtwDisplay.d.ts.map +1 -0
- package/dist/components/BtwDisplay.js +9 -0
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +3 -4
- package/dist/components/ConfirmationDetails.d.ts.map +1 -1
- package/dist/components/ConfirmationDetails.js +7 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +13 -3
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +5 -3
- package/dist/components/RewindCommand.js +2 -2
- package/dist/components/StatusLine.d.ts +8 -0
- package/dist/components/StatusLine.d.ts.map +1 -0
- package/dist/components/StatusLine.js +5 -0
- package/dist/constants/commands.d.ts.map +1 -1
- package/dist/constants/commands.js +6 -0
- package/dist/contexts/useChat.d.ts +4 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +35 -1
- package/dist/hooks/useInputManager.d.ts +3 -0
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +50 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/managers/inputHandlers.d.ts +1 -1
- package/dist/managers/inputHandlers.d.ts.map +1 -1
- package/dist/managers/inputHandlers.js +68 -5
- package/dist/managers/inputReducer.d.ts +17 -0
- package/dist/managers/inputReducer.d.ts.map +1 -1
- package/dist/managers/inputReducer.js +16 -0
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +4 -0
- package/package.json +4 -2
- package/src/acp/agent.ts +10 -0
- package/src/commands/update.ts +116 -0
- package/src/components/App.tsx +1 -1
- package/src/components/BtwDisplay.tsx +33 -0
- package/src/components/ChatInterface.tsx +25 -25
- package/src/components/ConfirmationDetails.tsx +14 -0
- package/src/components/InputBox.tsx +30 -17
- package/src/components/MessageList.tsx +6 -3
- package/src/components/RewindCommand.tsx +2 -2
- package/src/components/StatusLine.tsx +36 -0
- package/src/constants/commands.ts +6 -0
- package/src/contexts/useChat.tsx +49 -1
- package/src/hooks/useInputManager.ts +59 -0
- package/src/index.ts +9 -0
- package/src/managers/inputHandlers.ts +87 -4
- package/src/managers/inputReducer.ts +31 -1
- package/src/utils/version.ts +8 -0
package/dist/acp/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/acp/agent.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,KAAK,IAAI,QAAQ,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAUzB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EAMpC,MAAM,0BAA0B,CAAC;AAElC,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,UAAU,CAAsB;gBAE5B,UAAU,EAAE,mBAAmB;IAI3C,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,uBAAuB;YAmBjB,gBAAgB;IASxB,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAwBzC,YAAY,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CA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uBAAuB;IA8KrC,OAAO,CAAC,cAAc;IAwGtB,OAAO,CAAC,gBAAgB;IAmCxB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,eAAe;CAmMxB"}
|
package/dist/acp/agent.js
CHANGED
|
@@ -508,6 +508,15 @@ export class WaveAcpAgent {
|
|
|
508
508
|
},
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
+
if (contents.length === 0) {
|
|
512
|
+
contents.push({
|
|
513
|
+
type: "content",
|
|
514
|
+
content: {
|
|
515
|
+
type: "text",
|
|
516
|
+
text: "```json\n" + JSON.stringify(parameters, null, 2) + "\n```",
|
|
517
|
+
},
|
|
518
|
+
});
|
|
519
|
+
}
|
|
511
520
|
}
|
|
512
521
|
if (shortResult) {
|
|
513
522
|
contents.push({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAuDA,wBAAsB,aAAa,kBA4DlC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import https from "https";
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
import { isUpdateAvailable } from "../utils/version.js";
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const packageJsonPath = path.resolve(__dirname, "../../package.json");
|
|
10
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
11
|
+
const currentVersion = packageJson.version;
|
|
12
|
+
async function getLatestVersion() {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
https
|
|
15
|
+
.get("https://registry.npmjs.org/wave-code/latest", (res) => {
|
|
16
|
+
let data = "";
|
|
17
|
+
res.on("data", (chunk) => {
|
|
18
|
+
data += chunk;
|
|
19
|
+
});
|
|
20
|
+
res.on("end", () => {
|
|
21
|
+
try {
|
|
22
|
+
const json = JSON.parse(data);
|
|
23
|
+
resolve(json.version);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
reject(new Error("Failed to parse npm registry response"));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
})
|
|
30
|
+
.on("error", (err) => {
|
|
31
|
+
reject(err);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function detectPackageManager() {
|
|
36
|
+
// Check if wave-code is installed globally with pnpm
|
|
37
|
+
const pnpmList = spawnSync("pnpm", ["list", "-g", "wave-code"], {
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
});
|
|
40
|
+
if (pnpmList.status === 0 && pnpmList.stdout?.includes("wave-code")) {
|
|
41
|
+
return "pnpm";
|
|
42
|
+
}
|
|
43
|
+
// Check if wave-code is installed globally with yarn
|
|
44
|
+
const yarnList = spawnSync("yarn", ["global", "list"], { encoding: "utf-8" });
|
|
45
|
+
if (yarnList.status === 0 && yarnList.stdout?.includes("wave-code")) {
|
|
46
|
+
return "yarn";
|
|
47
|
+
}
|
|
48
|
+
// Default to npm
|
|
49
|
+
return "npm";
|
|
50
|
+
}
|
|
51
|
+
export async function updateCommand() {
|
|
52
|
+
console.log(chalk.blue(`Checking for updates...`));
|
|
53
|
+
console.log(chalk.dim(`Current version: ${currentVersion}`));
|
|
54
|
+
try {
|
|
55
|
+
const latestVersion = await getLatestVersion();
|
|
56
|
+
console.log(chalk.dim(`Latest version: ${latestVersion}`));
|
|
57
|
+
if (!isUpdateAvailable(currentVersion, latestVersion)) {
|
|
58
|
+
console.log(chalk.green("WAVE Code is already up to date!"));
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
console.log(chalk.yellow(`A new version of WAVE Code is available: ${latestVersion}`));
|
|
62
|
+
const packageManager = detectPackageManager();
|
|
63
|
+
let updateCmd;
|
|
64
|
+
let args;
|
|
65
|
+
if (packageManager === "pnpm") {
|
|
66
|
+
updateCmd = "pnpm";
|
|
67
|
+
args = ["add", "-g", "wave-code@latest"];
|
|
68
|
+
}
|
|
69
|
+
else if (packageManager === "yarn") {
|
|
70
|
+
updateCmd = "yarn";
|
|
71
|
+
args = ["global", "add", "wave-code@latest"];
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
updateCmd = "npm";
|
|
75
|
+
args = ["install", "-g", "wave-code@latest"];
|
|
76
|
+
}
|
|
77
|
+
console.log(chalk.blue(`Updating WAVE Code using ${packageManager}...`));
|
|
78
|
+
console.log(chalk.dim(`Running: ${updateCmd} ${args.join(" ")}`));
|
|
79
|
+
const result = spawnSync(updateCmd, args, { stdio: "inherit" });
|
|
80
|
+
if (result.status === 0) {
|
|
81
|
+
console.log(chalk.green("WAVE Code updated successfully!"));
|
|
82
|
+
process.exit(0);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.log(chalk.red("Failed to update WAVE Code."));
|
|
86
|
+
console.log(chalk.yellow(`Please try running the update command manually: ${updateCmd} ${args.join(" ")}`));
|
|
87
|
+
if (process.platform !== "win32") {
|
|
88
|
+
console.log(chalk.yellow("You might need to run it with sudo if you encounter permission issues."));
|
|
89
|
+
}
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error(chalk.red("Error checking for updates:"), error);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
package/dist/components/App.js
CHANGED
|
@@ -64,7 +64,7 @@ const ChatInterfaceWithRemount = () => {
|
|
|
64
64
|
: "");
|
|
65
65
|
if (newKey !== remountKey) {
|
|
66
66
|
const timeout = setTimeout(() => {
|
|
67
|
-
stdout?.write("\u001b[2J\u001b[0;0H", (err) => {
|
|
67
|
+
stdout?.write("\u001b[2J\u001b[3J\u001b[0;0H", (err) => {
|
|
68
68
|
if (err) {
|
|
69
69
|
console.error("Failed to clear terminal:", err);
|
|
70
70
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BtwDisplay.d.ts","sourceRoot":"","sources":["../../src/components/BtwDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,UAAU,eAAe;IACvB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuBhD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { Markdown } from "./Markdown.js";
|
|
4
|
+
export const BtwDisplay = ({ btwState }) => {
|
|
5
|
+
if (!btwState.isActive) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 0, marginBottom: 1, children: [btwState.question && (_jsxs(Box, { children: [_jsx(Text, { color: btwState.isLoading ? "yellow" : "green", children: "\u25CF " }), _jsxs(Text, { italic: true, color: "gray", children: ["/btw ", btwState.question] })] })), btwState.answer && (_jsx(Box, { flexDirection: "column", children: _jsx(Markdown, { children: btwState.answer }) }))] }));
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInterface.d.ts","sourceRoot":"","sources":["../../src/components/ChatInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatInterface.d.ts","sourceRoot":"","sources":["../../src/components/ChatInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AActE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAyKjC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useState, useCallback, useLayoutEffect } from "react";
|
|
3
3
|
import { Box, useStdout } from "ink";
|
|
4
4
|
import { MessageList } from "./MessageList.js";
|
|
5
|
+
import { BtwDisplay } from "./BtwDisplay.js";
|
|
5
6
|
import { InputBox } from "./InputBox.js";
|
|
6
7
|
import { LoadingIndicator } from "./LoadingIndicator.js";
|
|
7
8
|
import { TaskList } from "./TaskList.js";
|
|
@@ -15,7 +16,7 @@ export const ChatInterface = () => {
|
|
|
15
16
|
const [selectorHeight, setSelectorHeight] = useState(0);
|
|
16
17
|
const [dynamicBlocksHeight, setDynamicBlocksHeight] = useState(0);
|
|
17
18
|
const [isConfirmationTooTall, setIsConfirmationTooTall] = useState(false);
|
|
18
|
-
const { messages, isLoading, isCommandRunning, isCompressing, sendMessage, abortMessage, mcpServers, connectMcpServer, disconnectMcpServer, isExpanded, sessionId, latestTotalTokens, slashCommands, hasSlashCommand, isConfirmationVisible, confirmingTool, handleConfirmationDecision, handleConfirmationCancel: originalHandleConfirmationCancel, setWasLastDetailsTooTall, version, workdir, getModelConfig, } = useChat();
|
|
19
|
+
const { messages, isLoading, isCommandRunning, isCompressing, sendMessage, abortMessage, mcpServers, connectMcpServer, disconnectMcpServer, isExpanded, sessionId, latestTotalTokens, slashCommands, hasSlashCommand, isConfirmationVisible, confirmingTool, handleConfirmationDecision, handleConfirmationCancel: originalHandleConfirmationCancel, setWasLastDetailsTooTall, version, workdir, getModelConfig, btwState, } = useChat();
|
|
19
20
|
const model = getModelConfig().model;
|
|
20
21
|
const displayMessages = messages;
|
|
21
22
|
const handleDetailsHeightMeasured = useCallback((height) => {
|
|
@@ -75,7 +76,5 @@ export const ChatInterface = () => {
|
|
|
75
76
|
]);
|
|
76
77
|
if (!sessionId)
|
|
77
78
|
return null;
|
|
78
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { messages: displayMessages, isExpanded: isExpanded, forceStatic: isConfirmationVisible && isConfirmationTooTall, version: version, workdir: workdir, model: model, onDynamicBlocksHeightMeasured: handleDynamicBlocksHeightMeasured }), (isLoading || isCommandRunning || isCompressing) &&
|
|
79
|
-
!isConfirmationVisible &&
|
|
80
|
-
!isExpanded && (_jsx(LoadingIndicator, { isLoading: isLoading, isCommandRunning: isCommandRunning, isCompressing: isCompressing, latestTotalTokens: latestTotalTokens })), !isConfirmationVisible && !isExpanded && _jsx(TaskList, {}), isConfirmationVisible && (_jsxs(_Fragment, { children: [_jsx(ConfirmationDetails, { toolName: confirmingTool.name, toolInput: confirmingTool.input, planContent: confirmingTool.planContent, isExpanded: isExpanded, onHeightMeasured: handleDetailsHeightMeasured, isStatic: isConfirmationTooTall }), _jsx(ConfirmationSelector, { toolName: confirmingTool.name, toolInput: confirmingTool.input, suggestedPrefix: confirmingTool.suggestedPrefix, hidePersistentOption: confirmingTool.hidePersistentOption, isExpanded: isExpanded, onDecision: wrappedHandleConfirmationDecision, onCancel: handleConfirmationCancel, onAbort: abortMessage, onHeightMeasured: handleSelectorHeightMeasured })] })), !isConfirmationVisible && !isExpanded && (_jsxs(_Fragment, { children: [_jsx(QueuedMessageList, {}), _jsx(InputBox, { isLoading: isLoading, isCommandRunning: isCommandRunning, sendMessage: sendMessage, abortMessage: abortMessage, mcpServers: mcpServers, connectMcpServer: connectMcpServer, disconnectMcpServer: disconnectMcpServer, slashCommands: slashCommands, hasSlashCommand: hasSlashCommand })] }))] }));
|
|
79
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MessageList, { messages: displayMessages, isExpanded: isExpanded, forceStatic: isConfirmationVisible && isConfirmationTooTall, version: version, workdir: workdir, model: model, onDynamicBlocksHeightMeasured: handleDynamicBlocksHeightMeasured }), !isConfirmationVisible && !isExpanded && (_jsxs(_Fragment, { children: [_jsx(BtwDisplay, { btwState: btwState }), (isLoading || isCommandRunning || isCompressing) && (_jsx(LoadingIndicator, { isLoading: isLoading, isCommandRunning: isCommandRunning, isCompressing: isCompressing, latestTotalTokens: latestTotalTokens })), _jsx(TaskList, {}), _jsx(QueuedMessageList, {}), _jsx(InputBox, { isLoading: isLoading, isCommandRunning: isCommandRunning, sendMessage: sendMessage, abortMessage: abortMessage, mcpServers: mcpServers, connectMcpServer: connectMcpServer, disconnectMcpServer: disconnectMcpServer, slashCommands: slashCommands, hasSlashCommand: hasSlashCommand })] })), isConfirmationVisible && (_jsxs(_Fragment, { children: [_jsx(ConfirmationDetails, { toolName: confirmingTool.name, toolInput: confirmingTool.input, planContent: confirmingTool.planContent, isExpanded: isExpanded, onHeightMeasured: handleDetailsHeightMeasured, isStatic: isConfirmationTooTall }), _jsx(ConfirmationSelector, { toolName: confirmingTool.name, toolInput: confirmingTool.input, suggestedPrefix: confirmingTool.suggestedPrefix, hidePersistentOption: confirmingTool.hidePersistentOption, isExpanded: isExpanded, onDecision: wrappedHandleConfirmationDecision, onCancel: handleConfirmationCancel, onAbort: abortMessage, onHeightMeasured: handleSelectorHeightMeasured })] }))] }));
|
|
81
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationDetails.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmationDetails.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmationDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAsCvD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyElE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { Box, Text, useStdout, measureElement, Static } from "ink";
|
|
|
4
4
|
import { BASH_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, ASK_USER_QUESTION_TOOL_NAME, } from "wave-agent-sdk";
|
|
5
5
|
import { DiffDisplay } from "./DiffDisplay.js";
|
|
6
6
|
import { PlanDisplay } from "./PlanDisplay.js";
|
|
7
|
+
import { highlightToAnsi } from "../utils/highlightUtils.js";
|
|
7
8
|
// Helper function to generate descriptive action text
|
|
8
9
|
const getActionDescription = (toolName, toolInput) => {
|
|
9
10
|
if (!toolInput) {
|
|
@@ -35,7 +36,12 @@ export const ConfirmationDetails = ({ toolName, toolInput, planContent, isExpand
|
|
|
35
36
|
onHeightMeasured?.(height);
|
|
36
37
|
}
|
|
37
38
|
}, [stdout?.rows, onHeightMeasured, toolInput, isExpanded]);
|
|
38
|
-
const content = (_jsxs(Box, { ref: boxRef, flexDirection: "column", borderStyle: "single", borderColor: "yellow", borderBottom: false, borderLeft: false, borderRight: false, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["Tool: ", toolName] }), _jsx(Text, { color: "yellow", children: getActionDescription(toolName, toolInput) }), _jsx(DiffDisplay, { toolName: toolName, parameters: JSON.stringify(toolInput), startLineNumber: startLineNumber }), toolName !==
|
|
39
|
+
const content = (_jsxs(Box, { ref: boxRef, flexDirection: "column", borderStyle: "single", borderColor: "yellow", borderBottom: false, borderLeft: false, borderRight: false, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["Tool: ", toolName] }), _jsx(Text, { color: "yellow", children: getActionDescription(toolName, toolInput) }), _jsx(DiffDisplay, { toolName: toolName, parameters: JSON.stringify(toolInput), startLineNumber: startLineNumber }), toolName !== WRITE_TOOL_NAME &&
|
|
40
|
+
toolName !== EDIT_TOOL_NAME &&
|
|
41
|
+
toolName !== EXIT_PLAN_MODE_TOOL_NAME &&
|
|
42
|
+
toolName !== ASK_USER_QUESTION_TOOL_NAME &&
|
|
43
|
+
toolName !== BASH_TOOL_NAME &&
|
|
44
|
+
!!toolInput && (_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "cyan", children: _jsx(Text, { children: highlightToAnsi(JSON.stringify(toolInput, null, 2), "json") }) })), toolName !== ASK_USER_QUESTION_TOOL_NAME &&
|
|
39
45
|
toolName === EXIT_PLAN_MODE_TOOL_NAME &&
|
|
40
46
|
!!planContent && (_jsx(PlanDisplay, { plan: planContent, isExpanded: isExpanded }))] }));
|
|
41
47
|
if (isStatic) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../src/components/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../src/components/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAgBzC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpE,eAAO,MAAM,sBAAsB,mDACe,CAAC;AAEnD,eAAO,MAAM,6BAA6B,QAGzC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CACZ,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,EAClD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACjC,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/D,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0P5C,CAAC"}
|
|
@@ -11,12 +11,13 @@ import { RewindCommand } from "./RewindCommand.js";
|
|
|
11
11
|
import { HelpView } from "./HelpView.js";
|
|
12
12
|
import { StatusCommand } from "./StatusCommand.js";
|
|
13
13
|
import { PluginManagerShell } from "./PluginManagerShell.js";
|
|
14
|
+
import { StatusLine } from "./StatusLine.js";
|
|
14
15
|
import { useInputManager } from "../hooks/useInputManager.js";
|
|
15
16
|
import { useChat } from "../contexts/useChat.js";
|
|
16
17
|
export const INPUT_PLACEHOLDER_TEXT = "Type your message (use /help for more info)...";
|
|
17
18
|
export const INPUT_PLACEHOLDER_TEXT_PREFIX = INPUT_PLACEHOLDER_TEXT.substring(0, 10);
|
|
18
19
|
export const InputBox = ({ sendMessage = () => { }, abortMessage = () => { }, mcpServers = [], connectMcpServer = async () => false, disconnectMcpServer = async () => false, slashCommands = [], hasSlashCommand = () => false, }) => {
|
|
19
|
-
const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, handleRewindSelect, backgroundCurrentTask, messages, getFullMessageThread, sessionId, workingDirectory, } = useChat();
|
|
20
|
+
const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, allowBypassInCycle: chatAllowBypassInCycle, handleRewindSelect, backgroundCurrentTask, messages, getFullMessageThread, sessionId, workingDirectory, askBtw, btwState: chatBtwState, setBtwState: setChatBtwState, } = useChat();
|
|
20
21
|
// Input manager with all input state and functionality (including images)
|
|
21
22
|
const { inputText, cursorPosition,
|
|
22
23
|
// Image management
|
|
@@ -30,12 +31,17 @@ export const InputBox = ({ sendMessage = () => { }, abortMessage = () => { }, mc
|
|
|
30
31
|
// Task/MCP Manager
|
|
31
32
|
showBackgroundTaskManager, showMcpManager, showRewindManager, showHelp, showStatusCommand, showPluginManager, setShowBackgroundTaskManager, setShowMcpManager, setShowRewindManager, setShowHelp, setShowStatusCommand, setShowPluginManager,
|
|
32
33
|
// Permission mode
|
|
33
|
-
permissionMode, setPermissionMode,
|
|
34
|
+
permissionMode, setPermissionMode, setAllowBypassInCycle,
|
|
35
|
+
// BTW state
|
|
36
|
+
btwState,
|
|
34
37
|
// Main handler
|
|
35
38
|
handleInput,
|
|
36
39
|
// Manager ready state
|
|
37
40
|
isManagerReady, } = useInputManager({
|
|
38
41
|
onSendMessage: sendMessage,
|
|
42
|
+
onAskBtw: askBtw,
|
|
43
|
+
btwState: chatBtwState,
|
|
44
|
+
onBtwStateChange: setChatBtwState,
|
|
39
45
|
onHasSlashCommand: hasSlashCommand,
|
|
40
46
|
onAbortMessage: abortMessage,
|
|
41
47
|
onBackgroundCurrentTask: backgroundCurrentTask,
|
|
@@ -48,6 +54,10 @@ export const InputBox = ({ sendMessage = () => { }, abortMessage = () => { }, mc
|
|
|
48
54
|
useEffect(() => {
|
|
49
55
|
setPermissionMode(chatPermissionMode);
|
|
50
56
|
}, [chatPermissionMode, setPermissionMode]);
|
|
57
|
+
// Sync allowBypassInCycle from useChat to InputManager
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setAllowBypassInCycle(chatAllowBypassInCycle);
|
|
60
|
+
}, [chatAllowBypassInCycle, setAllowBypassInCycle]);
|
|
51
61
|
// Use the InputManager's unified input handler
|
|
52
62
|
useInput(async (input, key) => {
|
|
53
63
|
await handleInput(input, key, attachedImages, clearImages);
|
|
@@ -95,5 +105,5 @@ export const InputBox = ({ sendMessage = () => { }, abortMessage = () => { }, mc
|
|
|
95
105
|
showRewindManager ||
|
|
96
106
|
showHelp ||
|
|
97
107
|
showStatusCommand ||
|
|
98
|
-
showPluginManager || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: "gray", borderLeft: false, borderRight: false, children: _jsx(Text, { color: isPlaceholder ? "gray" : "white", children:
|
|
108
|
+
showPluginManager || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: btwState.isActive ? "cyan" : "gray", borderLeft: false, borderRight: false, children: _jsx(Text, { color: isPlaceholder ? "gray" : "white", children: btwState.isActive && isPlaceholder ? (_jsxs(_Fragment, { children: [_jsx(Text, { backgroundColor: "white", color: "black", children: " " }), _jsx(Text, { color: "cyan", children: "Type your side question..." })] })) : shouldShowCursor ? (_jsxs(_Fragment, { children: [beforeCursor, _jsx(Text, { backgroundColor: "white", color: "black", children: atCursor }), afterCursor] })) : (displayText) }) }), _jsx(StatusLine, { permissionMode: permissionMode, isShellCommand: isShellCommand, isBtwActive: btwState.isActive })] }))] }));
|
|
99
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,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;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,WAAW,6HASnB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,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;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,WAAW,6HASnB,gBAAgB,6CAoHpB,CAAC"}
|
|
@@ -7,8 +7,10 @@ export const MessageList = React.memo(({ messages, isExpanded = false, forceStat
|
|
|
7
7
|
const welcomeMessage = (_jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [_jsxs(Text, { color: "gray", children: ["WAVE", version ? ` v${version}` : "", model ? ` • ${model}` : ""] }), workdir && (_jsx(Text, { color: "gray", wrap: "truncate-middle", children: workdir.replace(os.homedir(), "~") }))] }));
|
|
8
8
|
// Limit messages to prevent long rendering times
|
|
9
9
|
const maxMessages = 10;
|
|
10
|
+
// Filter out meta messages
|
|
11
|
+
const visibleMessages = messages.filter((m) => !m.isMeta);
|
|
10
12
|
// Flatten messages into blocks with metadata
|
|
11
|
-
const allBlocks =
|
|
13
|
+
const allBlocks = visibleMessages.flatMap((message, messageIndex) => {
|
|
12
14
|
return message.blocks.map((block, blockIndex) => ({
|
|
13
15
|
block,
|
|
14
16
|
message,
|
|
@@ -51,8 +53,8 @@ export const MessageList = React.memo(({ messages, isExpanded = false, forceStat
|
|
|
51
53
|
if (item.isWelcome) {
|
|
52
54
|
return (_jsx(React.Fragment, { children: welcomeMessage }, item.key));
|
|
53
55
|
}
|
|
54
|
-
if (
|
|
55
|
-
item.messageIndex <
|
|
56
|
+
if (visibleMessages.length > maxMessages &&
|
|
57
|
+
item.messageIndex < visibleMessages.length - maxMessages) {
|
|
56
58
|
return null;
|
|
57
59
|
}
|
|
58
60
|
return (_jsx(MessageBlockItem, { block: item.block, message: item.message, isExpanded: isExpanded, paddingTop: 1 }, item.key));
|
|
@@ -12,10 +12,10 @@ export const RewindCommand = ({ messages: initialMessages, onSelect, onCancel, g
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
}, [getFullMessageThread]);
|
|
15
|
-
// Filter user messages as checkpoints
|
|
15
|
+
// Filter user messages as checkpoints, excluding meta messages
|
|
16
16
|
const checkpoints = messages
|
|
17
17
|
.map((msg, index) => ({ msg, index }))
|
|
18
|
-
.filter(({ msg }) => msg.role === "user");
|
|
18
|
+
.filter(({ msg }) => msg.role === "user" && !msg.isMeta);
|
|
19
19
|
const MAX_VISIBLE_ITEMS = 3;
|
|
20
20
|
const [selectedIndex, setSelectedIndex] = useState(checkpoints.length - 1);
|
|
21
21
|
// Update selectedIndex when checkpoints change (after loading full thread)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusLine.d.ts","sourceRoot":"","sources":["../../src/components/StatusLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0BhD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export const StatusLine = ({ permissionMode, isShellCommand, isBtwActive, }) => {
|
|
4
|
+
return (_jsx(Box, { paddingRight: 1, justifyContent: "space-between", width: "100%", children: isBtwActive ? (_jsxs(Text, { color: "gray", children: ["Mode: ", _jsx(Text, { color: "cyan", children: "BTW" }), " (ESC to dismiss)"] })) : isShellCommand ? (_jsxs(Text, { color: "gray", children: ["Shell: ", _jsx(Text, { color: "yellow", children: "Run shell command" })] })) : (_jsxs(Text, { color: "gray", children: ["Mode:", " ", _jsx(Text, { color: permissionMode === "plan" ? "yellow" : "cyan", children: permissionMode }), " ", "(Shift+Tab to cycle)"] })) }));
|
|
5
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/constants/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/constants/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,EAAE,YAAY,EA4C5C,CAAC"}
|
|
@@ -35,4 +35,10 @@ export const AVAILABLE_COMMANDS = [
|
|
|
35
35
|
description: "View and manage plugins",
|
|
36
36
|
handler: () => { }, // Handler here won't be used, actual processing is in the hook
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
id: "btw",
|
|
40
|
+
name: "btw",
|
|
41
|
+
description: "Ask a side question without tool use",
|
|
42
|
+
handler: () => { }, // Handler here won't be used, actual processing is in the hook
|
|
43
|
+
},
|
|
38
44
|
];
|
|
@@ -22,6 +22,7 @@ export interface ChatContextType {
|
|
|
22
22
|
path: string;
|
|
23
23
|
mimeType: string;
|
|
24
24
|
}>, longTextMap?: Record<string, string>) => Promise<void>;
|
|
25
|
+
askBtw: (question: string) => Promise<string>;
|
|
25
26
|
abortMessage: () => void;
|
|
26
27
|
latestTotalTokens: number;
|
|
27
28
|
mcpServers: McpServerStatus[];
|
|
@@ -42,6 +43,7 @@ export interface ChatContextType {
|
|
|
42
43
|
subagentLatestTokens: Record<string, number>;
|
|
43
44
|
permissionMode: PermissionMode;
|
|
44
45
|
setPermissionMode: (mode: PermissionMode) => void;
|
|
46
|
+
allowBypassInCycle: boolean;
|
|
45
47
|
isConfirmationVisible: boolean;
|
|
46
48
|
confirmingTool?: {
|
|
47
49
|
name: string;
|
|
@@ -68,6 +70,8 @@ export interface ChatContextType {
|
|
|
68
70
|
workingDirectory: string;
|
|
69
71
|
version?: string;
|
|
70
72
|
workdir?: string;
|
|
73
|
+
btwState: import("../managers/inputReducer.js").BtwState;
|
|
74
|
+
setBtwState: (payload: Partial<import("../managers/inputReducer.js").BtwState>) => void;
|
|
71
75
|
}
|
|
72
76
|
export declare const useChat: () => ChatContextType;
|
|
73
77
|
export interface ChatProviderProps extends BaseAppProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAWxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IAEvB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK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,QAAQ,EAAE,OAAO,6BAA6B,EAAE,QAAQ,CAAC;IACzD,WAAW,EAAE,CACX,OAAO,EAAE,OAAO,CAAC,OAAO,6BAA6B,EAAE,QAAQ,CAAC,KAC7D,IAAI,CAAC;CACX;AAID,eAAO,MAAM,OAAO,uBAMnB,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAynBpD,CAAC"}
|
package/dist/contexts/useChat.js
CHANGED
|
@@ -54,8 +54,24 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
54
54
|
const [rewindId, setRewindId] = useState(0);
|
|
55
55
|
// Status metadata state
|
|
56
56
|
const [workingDirectory, setWorkingDirectory] = useState("");
|
|
57
|
+
// /btw state
|
|
58
|
+
const [btwState, setBtwStateInternal] = useState({
|
|
59
|
+
isActive: false,
|
|
60
|
+
question: "",
|
|
61
|
+
isLoading: false,
|
|
62
|
+
});
|
|
63
|
+
const setBtwState = useCallback((payload) => {
|
|
64
|
+
setBtwStateInternal((prev) => {
|
|
65
|
+
const newState = { ...prev, ...payload };
|
|
66
|
+
if (process.env.NODE_ENV === "test") {
|
|
67
|
+
// console.log("setBtwState", newState);
|
|
68
|
+
}
|
|
69
|
+
return newState;
|
|
70
|
+
});
|
|
71
|
+
}, []);
|
|
57
72
|
// Confirmation too tall state
|
|
58
73
|
const [wasLastDetailsTooTall, setWasLastDetailsTooTall] = useState(0);
|
|
74
|
+
const allowBypassInCycle = !!bypassPermissions || initialPermissionMode === "bypassPermissions";
|
|
59
75
|
const agentRef = useRef(null);
|
|
60
76
|
const taskUpdateTimerRef = useRef(null);
|
|
61
77
|
const debouncedSetTasks = useCallback((newTasks) => {
|
|
@@ -267,6 +283,12 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
267
283
|
// Loading state will be automatically updated by the useEffect that watches messages
|
|
268
284
|
}
|
|
269
285
|
}, [isLoading, isCommandRunning]);
|
|
286
|
+
const askBtw = useCallback(async (question) => {
|
|
287
|
+
if (!agentRef.current) {
|
|
288
|
+
throw new Error("Agent not initialized");
|
|
289
|
+
}
|
|
290
|
+
return await agentRef.current.askBtw(question);
|
|
291
|
+
}, []);
|
|
270
292
|
// Process queued messages when idle
|
|
271
293
|
useEffect(() => {
|
|
272
294
|
if (!isLoading && !isCommandRunning && queuedMessages.length > 0) {
|
|
@@ -413,11 +435,19 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
413
435
|
if (key.ctrl && input === "t") {
|
|
414
436
|
setIsTaskListVisible((prev) => !prev);
|
|
415
437
|
}
|
|
416
|
-
// Handle ESC key to cancel confirmation
|
|
438
|
+
// Handle ESC key to cancel confirmation or dismiss BTW
|
|
417
439
|
if (key.escape) {
|
|
418
440
|
if (isConfirmationVisible) {
|
|
419
441
|
handleConfirmationCancel();
|
|
420
442
|
}
|
|
443
|
+
else if (btwState.isActive) {
|
|
444
|
+
setBtwState({
|
|
445
|
+
isActive: false,
|
|
446
|
+
question: "",
|
|
447
|
+
answer: undefined,
|
|
448
|
+
isLoading: false,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
421
451
|
}
|
|
422
452
|
});
|
|
423
453
|
const contextValue = {
|
|
@@ -430,6 +460,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
430
460
|
queuedMessages,
|
|
431
461
|
sessionId,
|
|
432
462
|
sendMessage,
|
|
463
|
+
askBtw,
|
|
433
464
|
abortMessage,
|
|
434
465
|
latestTotalTokens,
|
|
435
466
|
isCompressing,
|
|
@@ -446,6 +477,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
446
477
|
subagentLatestTokens,
|
|
447
478
|
permissionMode,
|
|
448
479
|
setPermissionMode,
|
|
480
|
+
allowBypassInCycle,
|
|
449
481
|
isConfirmationVisible,
|
|
450
482
|
confirmingTool,
|
|
451
483
|
showConfirmation,
|
|
@@ -463,6 +495,8 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
463
495
|
workingDirectory,
|
|
464
496
|
version,
|
|
465
497
|
workdir,
|
|
498
|
+
btwState,
|
|
499
|
+
setBtwState,
|
|
466
500
|
};
|
|
467
501
|
return (_jsx(ChatContext.Provider, { value: contextValue, children: children }));
|
|
468
502
|
};
|
|
@@ -22,6 +22,7 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
|
|
|
22
22
|
showPluginManager: boolean;
|
|
23
23
|
permissionMode: PermissionMode;
|
|
24
24
|
attachedImages: import("../managers/inputReducer.js").AttachedImage[];
|
|
25
|
+
btwState: import("../managers/inputReducer.js").BtwState;
|
|
25
26
|
isManagerReady: boolean;
|
|
26
27
|
insertTextAtCursor: (text: string) => void;
|
|
27
28
|
deleteCharAtCursor: () => void;
|
|
@@ -58,6 +59,8 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
|
|
|
58
59
|
setShowStatusCommand: (show: boolean) => void;
|
|
59
60
|
setShowPluginManager: (show: boolean) => void;
|
|
60
61
|
setPermissionMode: (mode: PermissionMode) => void;
|
|
62
|
+
setAllowBypassInCycle: (allow: boolean) => void;
|
|
63
|
+
setBtwState: (payload: Partial<import("../managers/inputReducer.js").BtwState>) => void;
|
|
61
64
|
addImage: (imagePath: string, mimeType: string) => void;
|
|
62
65
|
removeImage: (imageId: number) => void;
|
|
63
66
|
clearImages: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAGL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM
|
|
1
|
+
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAGL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;;;;+BAsLA,MAAM;;;;;qCAoBA,MAAM;iCAIV,MAAM;;;;;mCAaJ,MAAM;oCAIL,MAAM;wCAIF,MAAM;mCAIX,MAAM;;;;mCASN,MAAM;;;;;sCAkCH,MAAM;uCAIL,MAAM;uCAQN,WAAW;;iCAQjB,MAAM;yCAYE,OAAO;8BAIlB,OAAO;iCAIJ,OAAO;wBAIhB,OAAO;iCAIE,OAAO;iCAIP,OAAO;8BAIV,cAAc;mCAKT,OAAO;2BAK7C,OAAO,CAAC,OAAO,6BAA6B,EAAE,QAAQ,CAAC;0BAU1B,MAAM,YAAY,MAAM;2BAIvB,MAAM;;;8BAYH,MAAM;mCAW/B,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;uCAYnB,MAAM;;yBAajD,MAAM,OACR,GAAG,kBACQ,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,gBACvD,MAAM,IAAI;yBA3GY,MAAM;kCAIG,MAAM;;CA4MxD,CAAC"}
|
|
@@ -103,6 +103,42 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
103
103
|
useEffect(() => {
|
|
104
104
|
callbacksRef.current.onImagesStateChange?.(state.attachedImages);
|
|
105
105
|
}, [state.attachedImages]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (callbacksRef.current.onBtwStateChange) {
|
|
108
|
+
callbacksRef.current.onBtwStateChange(state.btwState);
|
|
109
|
+
}
|
|
110
|
+
}, [state.btwState]);
|
|
111
|
+
// Handle /btw side question
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (state.btwState.isActive &&
|
|
114
|
+
state.btwState.isLoading &&
|
|
115
|
+
state.btwState.question) {
|
|
116
|
+
const askBtw = async () => {
|
|
117
|
+
try {
|
|
118
|
+
const answer = await callbacksRef.current.onAskBtw?.(state.btwState.question);
|
|
119
|
+
dispatch({
|
|
120
|
+
type: "SET_BTW_STATE",
|
|
121
|
+
payload: { answer, isLoading: false },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
console.error("Failed to ask side question:", error);
|
|
126
|
+
dispatch({
|
|
127
|
+
type: "SET_BTW_STATE",
|
|
128
|
+
payload: {
|
|
129
|
+
answer: "Error: Failed to get an answer for your side question.",
|
|
130
|
+
isLoading: false,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
askBtw();
|
|
136
|
+
}
|
|
137
|
+
}, [
|
|
138
|
+
state.btwState.isActive,
|
|
139
|
+
state.btwState.isLoading,
|
|
140
|
+
state.btwState.question,
|
|
141
|
+
]);
|
|
106
142
|
// Methods
|
|
107
143
|
const insertTextAtCursor = useCallback((text) => {
|
|
108
144
|
dispatch({ type: "INSERT_TEXT", payload: text });
|
|
@@ -206,6 +242,17 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
206
242
|
dispatch({ type: "SET_PERMISSION_MODE", payload: mode });
|
|
207
243
|
callbacksRef.current.onPermissionModeChange?.(mode);
|
|
208
244
|
}, []);
|
|
245
|
+
const setAllowBypassInCycle = useCallback((allow) => {
|
|
246
|
+
dispatch({ type: "SET_ALLOW_BYPASS_IN_CYCLE", payload: allow });
|
|
247
|
+
}, []);
|
|
248
|
+
const setBtwState = useCallback((payload) => {
|
|
249
|
+
if (callbacksRef.current.onBtwStateChange) {
|
|
250
|
+
callbacksRef.current.onBtwStateChange(payload);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
dispatch({ type: "SET_BTW_STATE", payload });
|
|
254
|
+
}
|
|
255
|
+
}, []);
|
|
209
256
|
const addImage = useCallback((imagePath, mimeType) => {
|
|
210
257
|
dispatch({ type: "ADD_IMAGE", payload: { path: imagePath, mimeType } });
|
|
211
258
|
}, []);
|
|
@@ -255,6 +302,7 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
255
302
|
showPluginManager: state.showPluginManager,
|
|
256
303
|
permissionMode: state.permissionMode,
|
|
257
304
|
attachedImages: state.attachedImages,
|
|
305
|
+
btwState: state.btwState,
|
|
258
306
|
isManagerReady: true,
|
|
259
307
|
// Methods
|
|
260
308
|
insertTextAtCursor,
|
|
@@ -288,6 +336,8 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
288
336
|
setShowStatusCommand,
|
|
289
337
|
setShowPluginManager,
|
|
290
338
|
setPermissionMode,
|
|
339
|
+
setAllowBypassInCycle,
|
|
340
|
+
setBtwState,
|
|
291
341
|
// Image management
|
|
292
342
|
addImage,
|
|
293
343
|
removeImage,
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,kBAoXzB;AAGD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -161,6 +161,10 @@ export async function main() {
|
|
|
161
161
|
const { updatePluginCommand } = await import("./commands/plugin/update.js");
|
|
162
162
|
await updatePluginCommand(argv);
|
|
163
163
|
});
|
|
164
|
+
})
|
|
165
|
+
.command("update", "Update WAVE Code to the latest version", {}, async () => {
|
|
166
|
+
const { updateCommand } = await import("./commands/update.js");
|
|
167
|
+
await updateCommand();
|
|
164
168
|
})
|
|
165
169
|
.version()
|
|
166
170
|
.alias("v", "version")
|