wave-code 0.14.4 → 0.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/acp/agent.d.ts.map +1 -1
- package/dist/acp/agent.js +10 -0
- package/dist/components/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/components/BackgroundTaskManager.js +17 -53
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +38 -28
- package/dist/components/ConfirmationSelector.d.ts.map +1 -1
- package/dist/components/ConfirmationSelector.js +18 -196
- package/dist/components/DiscoverView.d.ts.map +1 -1
- package/dist/components/DiscoverView.js +19 -11
- package/dist/components/FileSelector.d.ts.map +1 -1
- package/dist/components/FileSelector.js +29 -25
- package/dist/components/HelpView.d.ts.map +1 -1
- package/dist/components/HelpView.js +24 -28
- package/dist/components/HistorySearch.d.ts.map +1 -1
- package/dist/components/HistorySearch.js +26 -28
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +14 -6
- package/dist/components/InstalledView.d.ts.map +1 -1
- package/dist/components/InstalledView.js +19 -11
- package/dist/components/MarketplaceDetail.d.ts.map +1 -1
- package/dist/components/MarketplaceDetail.js +35 -16
- package/dist/components/MarketplaceView.d.ts.map +1 -1
- package/dist/components/MarketplaceView.js +21 -12
- package/dist/components/McpManager.d.ts.map +1 -1
- package/dist/components/McpManager.js +27 -46
- package/dist/components/ModelSelector.d.ts.map +1 -1
- package/dist/components/ModelSelector.js +27 -17
- package/dist/components/PluginDetail.d.ts.map +1 -1
- package/dist/components/PluginDetail.js +39 -26
- package/dist/components/RewindCommand.d.ts.map +1 -1
- package/dist/components/RewindCommand.js +27 -21
- package/dist/components/SessionSelector.d.ts.map +1 -1
- package/dist/components/SessionSelector.js +21 -16
- package/dist/components/StatusLine.d.ts.map +1 -1
- package/dist/components/StatusLine.js +5 -1
- package/dist/components/WorktreeExitPrompt.d.ts.map +1 -1
- package/dist/components/WorktreeExitPrompt.js +21 -12
- package/dist/contexts/useChat.d.ts +0 -1
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +13 -20
- package/dist/hooks/useInputManager.d.ts +5 -19
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +222 -79
- package/dist/managers/inputHandlers.d.ts +1 -1
- package/dist/managers/inputHandlers.d.ts.map +1 -1
- package/dist/managers/inputHandlers.js +3 -6
- package/dist/managers/inputReducer.d.ts +46 -4
- package/dist/managers/inputReducer.d.ts.map +1 -1
- package/dist/managers/inputReducer.js +519 -4
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +21 -9
- package/dist/reducers/backgroundTaskManagerReducer.d.ts +20 -0
- package/dist/reducers/backgroundTaskManagerReducer.d.ts.map +1 -1
- package/dist/reducers/backgroundTaskManagerReducer.js +83 -0
- package/dist/reducers/confirmationReducer.d.ts +11 -0
- package/dist/reducers/confirmationReducer.d.ts.map +1 -1
- package/dist/reducers/confirmationReducer.js +146 -0
- package/dist/reducers/helpSelectorReducer.d.ts +26 -0
- package/dist/reducers/helpSelectorReducer.d.ts.map +1 -0
- package/dist/reducers/helpSelectorReducer.js +52 -0
- package/dist/reducers/mcpManagerReducer.d.ts +22 -0
- package/dist/reducers/mcpManagerReducer.d.ts.map +1 -1
- package/dist/reducers/mcpManagerReducer.js +57 -0
- package/dist/reducers/pluginDetailReducer.d.ts +8 -0
- package/dist/reducers/pluginDetailReducer.d.ts.map +1 -1
- package/dist/reducers/pluginDetailReducer.js +32 -0
- package/dist/reducers/questionReducer.d.ts +21 -0
- package/dist/reducers/questionReducer.d.ts.map +1 -1
- package/dist/reducers/questionReducer.js +177 -0
- package/dist/reducers/rewindSelectorReducer.d.ts +22 -0
- package/dist/reducers/rewindSelectorReducer.d.ts.map +1 -0
- package/dist/reducers/rewindSelectorReducer.js +37 -0
- package/dist/reducers/selectorReducer.d.ts +22 -0
- package/dist/reducers/selectorReducer.d.ts.map +1 -0
- package/dist/reducers/selectorReducer.js +40 -0
- package/dist/utils/inputUtils.d.ts +18 -0
- package/dist/utils/inputUtils.d.ts.map +1 -0
- package/dist/utils/inputUtils.js +67 -0
- package/dist/utils/worktree.d.ts.map +1 -1
- package/dist/utils/worktree.js +1 -2
- package/package.json +2 -2
- package/src/acp/agent.ts +10 -0
- package/src/components/BackgroundTaskManager.tsx +19 -58
- package/src/components/CommandSelector.tsx +53 -44
- package/src/components/ConfirmationSelector.tsx +18 -202
- package/src/components/DiscoverView.tsx +21 -11
- package/src/components/FileSelector.tsx +40 -35
- package/src/components/HelpView.tsx +37 -43
- package/src/components/HistorySearch.tsx +29 -36
- package/src/components/InputBox.tsx +14 -7
- package/src/components/InstalledView.tsx +21 -11
- package/src/components/MarketplaceDetail.tsx +48 -24
- package/src/components/MarketplaceView.tsx +25 -10
- package/src/components/McpManager.tsx +29 -54
- package/src/components/ModelSelector.tsx +30 -23
- package/src/components/PluginDetail.tsx +50 -27
- package/src/components/RewindCommand.tsx +38 -32
- package/src/components/SessionSelector.tsx +23 -20
- package/src/components/StatusLine.tsx +10 -1
- package/src/components/WorktreeExitPrompt.tsx +23 -13
- package/src/contexts/useChat.tsx +13 -31
- package/src/hooks/useInputManager.ts +273 -141
- package/src/managers/inputHandlers.ts +1 -6
- package/src/managers/inputReducer.ts +675 -7
- package/src/print-cli.ts +20 -11
- package/src/reducers/backgroundTaskManagerReducer.ts +110 -1
- package/src/reducers/confirmationReducer.ts +173 -1
- package/src/reducers/helpSelectorReducer.ts +77 -0
- package/src/reducers/mcpManagerReducer.ts +82 -1
- package/src/reducers/pluginDetailReducer.ts +42 -1
- package/src/reducers/questionReducer.ts +204 -0
- package/src/reducers/rewindSelectorReducer.ts +54 -0
- package/src/reducers/selectorReducer.ts +57 -0
- package/src/utils/inputUtils.ts +94 -0
- package/src/utils/worktree.ts +1 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useReducer } from "react";
|
|
2
|
+
import { useReducer, useEffect, useMemo } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import { usePluginManagerContext } from "../contexts/PluginManagerContext.js";
|
|
5
5
|
import { pluginDetailReducer, } from "../reducers/pluginDetailReducer.js";
|
|
@@ -13,36 +13,33 @@ export const PluginDetail = () => {
|
|
|
13
13
|
const [detailState, dispatch] = useReducer(pluginDetailReducer, {
|
|
14
14
|
selectedScopeIndex: 0,
|
|
15
15
|
selectedActionIndex: 0,
|
|
16
|
+
pendingDecision: null,
|
|
16
17
|
});
|
|
18
|
+
const { selectedScopeIndex, selectedActionIndex, pendingDecision } = detailState;
|
|
17
19
|
const plugin = discoverablePlugins.find((p) => `${p.name}@${p.marketplace}` === state.selectedId) ||
|
|
18
20
|
installedPlugins.find((p) => `${p.name}@${p.marketplace}` === state.selectedId);
|
|
19
|
-
const INSTALLED_ACTIONS = [
|
|
21
|
+
const INSTALLED_ACTIONS = useMemo(() => [
|
|
20
22
|
{ id: "update", label: "Update plugin (reinstall)" },
|
|
21
23
|
{ id: "uninstall", label: "Uninstall plugin" },
|
|
22
|
-
];
|
|
24
|
+
], []);
|
|
23
25
|
const isInstalledAndEnabled = plugin && "enabled" in plugin && plugin.enabled;
|
|
24
|
-
useInput((
|
|
25
|
-
if (key.escape)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
maxIndex: INSTALLED_ACTIONS.length - 1,
|
|
40
|
-
});
|
|
41
|
-
dispatch({ type: "MOVE_SCOPE_DOWN", maxIndex: SCOPES.length - 1 });
|
|
42
|
-
}
|
|
43
|
-
else if (key.return && plugin && !state.isLoading) {
|
|
26
|
+
useInput((_input, key) => {
|
|
27
|
+
if (state.isLoading && !key.escape)
|
|
28
|
+
return;
|
|
29
|
+
dispatch({
|
|
30
|
+
type: "HANDLE_KEY",
|
|
31
|
+
key,
|
|
32
|
+
maxIndex: isInstalledAndEnabled
|
|
33
|
+
? INSTALLED_ACTIONS.length - 1
|
|
34
|
+
: SCOPES.length - 1,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!pendingDecision)
|
|
39
|
+
return;
|
|
40
|
+
if (pendingDecision === "select" && plugin && !state.isLoading) {
|
|
44
41
|
if (isInstalledAndEnabled) {
|
|
45
|
-
const action = INSTALLED_ACTIONS[
|
|
42
|
+
const action = INSTALLED_ACTIONS[selectedActionIndex].id;
|
|
46
43
|
if (action === "uninstall") {
|
|
47
44
|
actions.uninstallPlugin(plugin.name, plugin.marketplace);
|
|
48
45
|
}
|
|
@@ -51,10 +48,26 @@ export const PluginDetail = () => {
|
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
else {
|
|
54
|
-
actions.installPlugin(plugin.name, plugin.marketplace, SCOPES[
|
|
51
|
+
actions.installPlugin(plugin.name, plugin.marketplace, SCOPES[selectedScopeIndex].id);
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
else if (pendingDecision === "cancel") {
|
|
55
|
+
const isFromDiscover = discoverablePlugins.find((p) => `${p.name}@${p.marketplace}` === state.selectedId);
|
|
56
|
+
actions.setView(isFromDiscover ? "DISCOVER" : "INSTALLED");
|
|
57
|
+
}
|
|
58
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
59
|
+
}, [
|
|
60
|
+
pendingDecision,
|
|
61
|
+
selectedActionIndex,
|
|
62
|
+
selectedScopeIndex,
|
|
63
|
+
plugin,
|
|
64
|
+
isInstalledAndEnabled,
|
|
65
|
+
state.isLoading,
|
|
66
|
+
discoverablePlugins,
|
|
67
|
+
state.selectedId,
|
|
68
|
+
actions,
|
|
69
|
+
INSTALLED_ACTIONS,
|
|
70
|
+
]);
|
|
58
71
|
if (!plugin) {
|
|
59
72
|
return (_jsx(Box, { children: _jsx(Text, { color: "red", children: "Plugin not found." }) }));
|
|
60
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RewindCommand.d.ts","sourceRoot":"","sources":["../../src/components/RewindCommand.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RewindCommand.d.ts","sourceRoot":"","sources":["../../src/components/RewindCommand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC;QACnC,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC,CAAC;CACJ;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0JtD,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useState, useReducer, useEffect } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import { getMessageContent } from "wave-agent-sdk";
|
|
5
|
+
import { rewindSelectorReducer } from "../reducers/rewindSelectorReducer.js";
|
|
5
6
|
export const RewindCommand = ({ messages: initialMessages, onSelect, onCancel, getFullMessageThread, }) => {
|
|
6
7
|
const [messages, setMessages] = useState(initialMessages);
|
|
7
8
|
const [isLoading, setIsLoading] = useState(!!getFullMessageThread);
|
|
8
|
-
|
|
9
|
+
useEffect(() => {
|
|
9
10
|
if (getFullMessageThread) {
|
|
10
11
|
getFullMessageThread().then(({ messages: fullMessages }) => {
|
|
11
12
|
setMessages(fullMessages);
|
|
@@ -18,33 +19,35 @@ export const RewindCommand = ({ messages: initialMessages, onSelect, onCancel, g
|
|
|
18
19
|
.map((msg, index) => ({ msg, index }))
|
|
19
20
|
.filter(({ msg }) => msg.role === "user" && !msg.isMeta);
|
|
20
21
|
const MAX_VISIBLE_ITEMS = 3;
|
|
21
|
-
const [
|
|
22
|
+
const [state, dispatch] = useReducer(rewindSelectorReducer, {
|
|
23
|
+
selectedIndex: checkpoints.length - 1,
|
|
24
|
+
pendingDecision: null,
|
|
25
|
+
});
|
|
26
|
+
const { selectedIndex, pendingDecision } = state;
|
|
22
27
|
// Update selectedIndex when checkpoints change (after loading full thread)
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
dispatch({ type: "RESET_INDEX", index: checkpoints.length - 1 });
|
|
25
30
|
}, [checkpoints.length]);
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
+
// Handle decisions from reducer
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!pendingDecision)
|
|
34
|
+
return;
|
|
35
|
+
if (pendingDecision === "select") {
|
|
31
36
|
if (checkpoints.length > 0 && selectedIndex >= 0) {
|
|
32
37
|
onSelect(checkpoints[selectedIndex].index);
|
|
33
38
|
}
|
|
34
|
-
return;
|
|
35
39
|
}
|
|
36
|
-
if (
|
|
40
|
+
else if (pendingDecision === "cancel") {
|
|
37
41
|
onCancel();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (key.upArrow) {
|
|
41
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (key.downArrow) {
|
|
45
|
-
setSelectedIndex(Math.min(checkpoints.length - 1, selectedIndex + 1));
|
|
46
|
-
return;
|
|
47
42
|
}
|
|
43
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
44
|
+
}, [pendingDecision, selectedIndex, checkpoints, onSelect, onCancel]);
|
|
45
|
+
useInput((input, key) => {
|
|
46
|
+
dispatch({
|
|
47
|
+
type: "HANDLE_KEY",
|
|
48
|
+
key,
|
|
49
|
+
maxIndex: checkpoints.length - 1,
|
|
50
|
+
});
|
|
48
51
|
});
|
|
49
52
|
if (isLoading) {
|
|
50
53
|
return (_jsx(Box, { flexDirection: "column", paddingX: 1, borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, children: _jsx(Text, { color: "cyan", children: "Loading full message thread..." }) }));
|
|
@@ -52,6 +55,9 @@ export const RewindCommand = ({ messages: initialMessages, onSelect, onCancel, g
|
|
|
52
55
|
if (checkpoints.length === 0) {
|
|
53
56
|
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, borderStyle: "single", borderColor: "yellow", borderLeft: false, borderRight: false, children: [_jsx(Text, { color: "yellow", children: "No user messages found to rewind to." }), _jsx(Text, { dimColor: true, children: "Press Escape to cancel" })] }));
|
|
54
57
|
}
|
|
58
|
+
// Calculate visible window
|
|
59
|
+
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, checkpoints.length - MAX_VISIBLE_ITEMS)));
|
|
60
|
+
const visibleCheckpoints = checkpoints.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
|
|
55
61
|
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, gap: 1, borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, children: [_jsx(Box, { children: _jsx(Text, { color: "cyan", bold: true, children: "Rewind: Select a message to revert to" }) }), _jsx(Box, { flexDirection: "column", children: visibleCheckpoints.map((checkpoint, index) => {
|
|
56
62
|
const actualIndex = startIndex + index;
|
|
57
63
|
const isSelected = actualIndex === selectedIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionSelector.d.ts","sourceRoot":"","sources":["../../src/components/SessionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionSelector.d.ts","sourceRoot":"","sources":["../../src/components/SessionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,CAAC,eAAe,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC1D,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuI1D,CAAC"}
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useReducer, useEffect } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
|
+
import { selectorReducer } from "../reducers/selectorReducer.js";
|
|
4
5
|
export const SessionSelector = ({ sessions, onSelect, onCancel, }) => {
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const [state, dispatch] = useReducer(selectorReducer, {
|
|
7
|
+
selectedIndex: 0,
|
|
8
|
+
pendingDecision: null,
|
|
9
|
+
});
|
|
10
|
+
const { selectedIndex, pendingDecision } = state;
|
|
11
|
+
useInput((_input, key) => {
|
|
12
|
+
dispatch({
|
|
13
|
+
type: "HANDLE_KEY",
|
|
14
|
+
key,
|
|
15
|
+
maxIndex: sessions.length - 1,
|
|
16
|
+
hasInsert: false,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (pendingDecision === "select") {
|
|
8
21
|
if (sessions.length > 0 && selectedIndex < sessions.length) {
|
|
9
22
|
onSelect(sessions[selectedIndex].id);
|
|
10
23
|
}
|
|
11
|
-
|
|
24
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
12
25
|
}
|
|
13
|
-
if (
|
|
26
|
+
else if (pendingDecision === "cancel") {
|
|
14
27
|
onCancel();
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
if (key.upArrow) {
|
|
18
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
19
|
-
return;
|
|
28
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
20
29
|
}
|
|
21
|
-
|
|
22
|
-
setSelectedIndex(Math.min(sessions.length - 1, selectedIndex + 1));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
30
|
+
}, [pendingDecision, selectedIndex, sessions, onSelect, onCancel]);
|
|
26
31
|
if (sessions.length === 0) {
|
|
27
32
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "yellow", borderLeft: false, borderRight: false, paddingX: 1, width: "100%", children: [_jsx(Text, { color: "yellow", children: "No sessions found." }), _jsx(Text, { dimColor: true, children: "Press Escape to cancel" })] }));
|
|
28
33
|
}
|
|
@@ -1 +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,
|
|
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,CAmChD,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
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"
|
|
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"
|
|
5
|
+
? "yellow"
|
|
6
|
+
: permissionMode === "bypassPermissions"
|
|
7
|
+
? "red"
|
|
8
|
+
: "cyan", bold: permissionMode === "bypassPermissions", children: permissionMode }), " ", "(Shift+Tab to cycle)"] })) }));
|
|
5
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorktreeExitPrompt.d.ts","sourceRoot":"","sources":["../../src/components/WorktreeExitPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WorktreeExitPrompt.d.ts","sourceRoot":"","sources":["../../src/components/WorktreeExitPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAIrD,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAiFhE,CAAC"}
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useReducer, useEffect } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
|
+
import { selectorReducer } from "../reducers/selectorReducer.js";
|
|
4
5
|
export const WorktreeExitPrompt = ({ name, path: worktreePath, hasUncommittedChanges, hasNewCommits, onKeep, onRemove, onCancel, }) => {
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const [state, dispatch] = useReducer(selectorReducer, {
|
|
7
|
+
selectedIndex: 0,
|
|
8
|
+
pendingDecision: null,
|
|
9
|
+
});
|
|
10
|
+
const { selectedIndex, pendingDecision } = state;
|
|
11
|
+
useInput((_input, key) => {
|
|
12
|
+
dispatch({
|
|
13
|
+
type: "HANDLE_KEY",
|
|
14
|
+
key,
|
|
15
|
+
maxIndex: 1,
|
|
16
|
+
hasInsert: false,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (pendingDecision === "select") {
|
|
14
21
|
if (selectedIndex === 0) {
|
|
15
22
|
onKeep();
|
|
16
23
|
}
|
|
17
24
|
else {
|
|
18
25
|
onRemove();
|
|
19
26
|
}
|
|
27
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
20
28
|
}
|
|
21
|
-
if (
|
|
29
|
+
else if (pendingDecision === "cancel") {
|
|
22
30
|
onCancel();
|
|
31
|
+
dispatch({ type: "CLEAR_DECISION" });
|
|
23
32
|
}
|
|
24
|
-
});
|
|
33
|
+
}, [pendingDecision, selectedIndex, onKeep, onRemove, onCancel]);
|
|
25
34
|
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Exiting worktree session" }) }), _jsx(Box, { marginBottom: 1, children: hasUncommittedChanges && hasNewCommits ? (_jsx(Text, { children: "You have uncommitted changes and new commits. These will be lost if you remove the worktree." })) : hasUncommittedChanges ? (_jsx(Text, { children: "You have uncommitted changes. These will be lost if you remove the worktree." })) : (_jsxs(Text, { children: ["You have new commits on worktree-", name, ". The branch will be deleted if you remove the worktree."] })) }), _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { color: selectedIndex === 0 ? "cyan" : undefined, children: [selectedIndex === 0 ? "❯ " : " ", "Keep worktree Stays at", " ", worktreePath] }) }), _jsx(Box, { children: _jsxs(Text, { color: selectedIndex === 1 ? "cyan" : undefined, children: [selectedIndex === 1 ? "❯ " : " ", "Remove worktree All changes and commits will be lost."] }) })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Esc to cancel" }) })] }));
|
|
26
35
|
};
|
|
@@ -38,7 +38,6 @@ export interface ChatContextType {
|
|
|
38
38
|
hasSlashCommand: (commandId: string) => boolean;
|
|
39
39
|
permissionMode: PermissionMode;
|
|
40
40
|
setPermissionMode: (mode: PermissionMode) => void;
|
|
41
|
-
allowBypassInCycle: boolean;
|
|
42
41
|
isConfirmationVisible: boolean;
|
|
43
42
|
hasPendingConfirmations: boolean;
|
|
44
43
|
confirmingTool?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/contexts/useChat.tsx"],"names":[],"mappings":"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"}
|
package/dist/contexts/useChat.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, useContext, useCallback, useRef, useEffect, useState, useMemo, } from "react";
|
|
3
3
|
import { useInput, useStdout } from "ink";
|
|
4
4
|
import { useAppConfig } from "./useAppConfig.js";
|
|
5
|
-
import { Agent, OPERATION_CANCELLED_BY_USER, } from "wave-agent-sdk";
|
|
5
|
+
import { Agent, OPERATION_CANCELLED_BY_USER, extractLatestTotalTokens, } from "wave-agent-sdk";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { throttle } from "../utils/throttle.js";
|
|
8
8
|
import { displayUsageSummary } from "../utils/usageSummary.js";
|
|
@@ -23,29 +23,26 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
23
23
|
const isExpandedRef = useRef(isExpanded);
|
|
24
24
|
const [isTaskListVisible, setIsTaskListVisible] = useState(true);
|
|
25
25
|
const [messages, setMessages] = useState([]);
|
|
26
|
+
const [latestTotalTokens, setLatestTotalTokens] = useState(0);
|
|
26
27
|
const throttledSetMessages = useMemo(() => throttle(() => {
|
|
27
28
|
if (!isExpandedRef.current && agentRef.current) {
|
|
28
|
-
|
|
29
|
+
const msgs = [...agentRef.current.messages];
|
|
30
|
+
setMessages(msgs);
|
|
31
|
+
setLatestTotalTokens(extractLatestTotalTokens(msgs));
|
|
29
32
|
}
|
|
30
|
-
},
|
|
31
|
-
const throttledSetTokens = useMemo(() => throttle(((tokens) => {
|
|
32
|
-
setlatestTotalTokens(tokens);
|
|
33
|
-
}), 300, { leading: true, trailing: true }), []);
|
|
33
|
+
}, 500, { leading: true, trailing: true }), []);
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
isExpandedRef.current = isExpanded;
|
|
36
36
|
if (isExpanded) {
|
|
37
37
|
throttledSetMessages.cancel();
|
|
38
|
-
throttledSetTokens.cancel();
|
|
39
38
|
}
|
|
40
|
-
}, [isExpanded, throttledSetMessages
|
|
39
|
+
}, [isExpanded, throttledSetMessages]);
|
|
41
40
|
useEffect(() => {
|
|
42
41
|
return () => {
|
|
43
42
|
throttledSetMessages.cancel();
|
|
44
|
-
throttledSetTokens.cancel();
|
|
45
43
|
};
|
|
46
|
-
}, [throttledSetMessages
|
|
44
|
+
}, [throttledSetMessages]);
|
|
47
45
|
const [isLoading, setIsLoading] = useState(false);
|
|
48
|
-
const [latestTotalTokens, setlatestTotalTokens] = useState(0);
|
|
49
46
|
const [sessionId, setSessionId] = useState("");
|
|
50
47
|
const [isCommandRunning, setIsCommandRunning] = useState(false);
|
|
51
48
|
const [isCompacting, setIsCompacting] = useState(false);
|
|
@@ -95,7 +92,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
95
92
|
}, [sessionId, requestRemount]);
|
|
96
93
|
// Status metadata state
|
|
97
94
|
const [workingDirectory, setWorkingDirectory] = useState("");
|
|
98
|
-
const allowBypassInCycle = !!bypassPermissions || initialPermissionMode === "bypassPermissions";
|
|
99
95
|
const agentRef = useRef(null);
|
|
100
96
|
// Permission confirmation methods with queue support
|
|
101
97
|
const showConfirmation = useCallback(async (toolName, toolInput, suggestedPrefix, hidePersistentOption, planContent) => {
|
|
@@ -126,9 +122,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
126
122
|
onSessionIdChange: (sessionId) => {
|
|
127
123
|
setSessionId(sessionId);
|
|
128
124
|
},
|
|
129
|
-
onLatestTotalTokensChange: (tokens) => {
|
|
130
|
-
throttledSetTokens(tokens);
|
|
131
|
-
},
|
|
132
125
|
onCompactionStateChange: (isCompactingState) => {
|
|
133
126
|
setIsCompacting(isCompactingState);
|
|
134
127
|
},
|
|
@@ -194,7 +187,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
194
187
|
setSessionId(agent.sessionId);
|
|
195
188
|
setMessages(agent.messages);
|
|
196
189
|
setIsLoading(agent.isLoading);
|
|
197
|
-
|
|
190
|
+
setLatestTotalTokens(extractLatestTotalTokens(agent.messages));
|
|
198
191
|
setIsCommandRunning(agent.isCommandRunning);
|
|
199
192
|
setIsCompacting(agent.isCompacting);
|
|
200
193
|
setPermissionModeState(agent.getPermissionMode());
|
|
@@ -225,7 +218,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
225
218
|
model,
|
|
226
219
|
initialPermissionMode,
|
|
227
220
|
throttledSetMessages,
|
|
228
|
-
throttledSetTokens,
|
|
229
221
|
]);
|
|
230
222
|
// Recreate agent (e.g. after plugin install) — destroys current agent and reinitializes
|
|
231
223
|
const recreateAgent = useCallback(() => {
|
|
@@ -244,7 +236,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
244
236
|
setSlashCommands([]);
|
|
245
237
|
setSessionId("");
|
|
246
238
|
setIsLoading(false);
|
|
247
|
-
|
|
239
|
+
setLatestTotalTokens(0);
|
|
248
240
|
setIsCommandRunning(false);
|
|
249
241
|
setIsCompacting(false);
|
|
250
242
|
if (currentSessionId) {
|
|
@@ -446,7 +438,9 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
446
438
|
else {
|
|
447
439
|
// Transitioning to COLLAPSED: Restore from agent's actual state
|
|
448
440
|
if (agentRef.current) {
|
|
449
|
-
|
|
441
|
+
const msgs = [...agentRef.current.messages];
|
|
442
|
+
setMessages(msgs);
|
|
443
|
+
setLatestTotalTokens(extractLatestTotalTokens(msgs));
|
|
450
444
|
}
|
|
451
445
|
}
|
|
452
446
|
// Force remount to re-render Static items with new isExpanded state
|
|
@@ -489,7 +483,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
489
483
|
hasSlashCommand,
|
|
490
484
|
permissionMode,
|
|
491
485
|
setPermissionMode,
|
|
492
|
-
allowBypassInCycle,
|
|
493
486
|
isConfirmationVisible,
|
|
494
487
|
hasPendingConfirmations: confirmationQueue.length > 0,
|
|
495
488
|
confirmingTool,
|
|
@@ -31,22 +31,13 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
|
|
|
31
31
|
moveCursorLeft: () => void;
|
|
32
32
|
moveCursorRight: () => void;
|
|
33
33
|
activateFileSelector: (position: number) => void;
|
|
34
|
-
handleFileSelect: (filePath: string) =>
|
|
35
|
-
newInput: string;
|
|
36
|
-
newCursorPosition: number;
|
|
37
|
-
};
|
|
34
|
+
handleFileSelect: (filePath: string) => void;
|
|
38
35
|
handleCancelFileSelect: () => void;
|
|
39
36
|
updateFileSearchQuery: (query: string) => void;
|
|
40
37
|
checkForAtDeletion: (cursorPos: number) => boolean;
|
|
41
38
|
activateCommandSelector: (position: number) => void;
|
|
42
|
-
handleCommandSelect: (command: string) =>
|
|
43
|
-
|
|
44
|
-
newCursorPosition: number;
|
|
45
|
-
};
|
|
46
|
-
handleCommandInsert: (command: string) => {
|
|
47
|
-
newInput: string;
|
|
48
|
-
newCursorPosition: number;
|
|
49
|
-
};
|
|
39
|
+
handleCommandSelect: (command: string) => void;
|
|
40
|
+
handleCommandInsert: (command: string) => void;
|
|
50
41
|
handleCancelCommandSelect: () => void;
|
|
51
42
|
updateCommandSearchQuery: (query: string) => void;
|
|
52
43
|
checkForSlashDeletion: (cursorPos: number) => boolean;
|
|
@@ -61,21 +52,16 @@ export declare const useInputManager: (callbacks?: Partial<InputManagerCallbacks
|
|
|
61
52
|
setShowPluginManager: (show: boolean) => void;
|
|
62
53
|
setShowModelSelector: (show: boolean) => void;
|
|
63
54
|
setPermissionMode: (mode: PermissionMode) => void;
|
|
64
|
-
setAllowBypassInCycle: (allow: boolean) => void;
|
|
65
55
|
setBtwState: (payload: Partial<import("../managers/inputReducer.js").BtwState>) => void;
|
|
66
56
|
addImage: (imagePath: string, mimeType: string) => void;
|
|
67
57
|
removeImage: (imageId: number) => void;
|
|
68
58
|
clearImages: () => void;
|
|
69
59
|
handlePasteImage: () => Promise<boolean>;
|
|
70
60
|
handlePasteInput: (input: string) => void;
|
|
71
|
-
handleSubmit: (
|
|
72
|
-
id: number;
|
|
73
|
-
path: string;
|
|
74
|
-
mimeType: string;
|
|
75
|
-
}>) => Promise<void>;
|
|
61
|
+
handleSubmit: () => Promise<void>;
|
|
76
62
|
expandLongTextPlaceholders: (text: string) => string;
|
|
77
63
|
clearLongTextMap: () => void;
|
|
78
|
-
handleInput: (input: string, key: Key,
|
|
64
|
+
handleInput: (input: string, key: Key, _attachedImages: Array<{
|
|
79
65
|
id: number;
|
|
80
66
|
path: string;
|
|
81
67
|
mimeType: string;
|
|
@@ -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,
|
|
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,EAEZ,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;;;;;+BA8UA,MAAM;;;;;qCAoBA,MAAM;iCAIV,MAAM;;mCAQJ,MAAM;oCAK1C,MAAM;wCAQmC,MAAM;mCAIX,MAAM;mCAIN,MAAM;;sCAQH,MAAM;uCAK7C,MAAM;uCAMkC,WAAW;;iCASxD,MAAM;yCAcyC,OAAO;8BAIlB,OAAO;iCAIJ,OAAO;wBAIhB,OAAO;iCAIE,OAAO;iCAIP,OAAO;iCAIP,OAAO;8BAK9C,cAAc;2BAQX,OAAO,CAAC,OAAO,6BAA6B,EAAE,QAAQ,CAAC;0BAM1B,MAAM,YAAY,MAAM;2BAIvB,MAAM;;;8BAatC,MAAM;;uCAyBP,MAAM;;yBAYJ,MAAM,OACR,GAAG,mBACS,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,gBACxD,MAAM,IAAI;yBA5GY,MAAM;kCAIG,MAAM;;CAoNxD,CAAC"}
|