wave-code 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +2 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +24 -52
- package/dist/components/App.d.ts +3 -4
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +49 -6
- package/dist/components/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/components/BackgroundTaskManager.js +12 -20
- package/dist/components/BangDisplay.d.ts +9 -0
- package/dist/components/BangDisplay.d.ts.map +1 -0
- package/dist/components/{CommandOutputDisplay.js → BangDisplay.js} +1 -1
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +3 -2
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +18 -2
- package/dist/components/ConfirmationSelector.d.ts.map +1 -1
- package/dist/components/ConfirmationSelector.js +105 -8
- package/dist/components/HelpView.d.ts.map +1 -1
- package/dist/components/HelpView.js +2 -0
- package/dist/components/HistorySearch.d.ts.map +1 -1
- package/dist/components/HistorySearch.js +19 -25
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +9 -3
- package/dist/components/MarketplaceAddForm.d.ts.map +1 -1
- package/dist/components/MarketplaceAddForm.js +13 -6
- package/dist/components/MarketplaceDetail.d.ts.map +1 -1
- package/dist/components/MarketplaceDetail.js +8 -3
- package/dist/components/MessageBlockItem.js +2 -2
- package/dist/components/MessageList.d.ts +4 -1
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +15 -8
- package/dist/components/PluginDetail.d.ts.map +1 -1
- package/dist/components/PluginDetail.js +14 -3
- package/dist/components/PluginManagerShell.d.ts.map +1 -1
- package/dist/components/PluginManagerShell.js +3 -3
- package/dist/components/PluginManagerTypes.d.ts +2 -0
- package/dist/components/PluginManagerTypes.d.ts.map +1 -1
- package/dist/components/SessionSelector.d.ts.map +1 -1
- package/dist/components/SessionSelector.js +10 -13
- package/dist/components/StatusCommand.d.ts +6 -0
- package/dist/components/StatusCommand.d.ts.map +1 -0
- package/dist/components/StatusCommand.js +28 -0
- package/dist/components/WorktreeExitPrompt.d.ts +13 -0
- package/dist/components/WorktreeExitPrompt.d.ts.map +1 -0
- package/dist/components/WorktreeExitPrompt.js +26 -0
- package/dist/contexts/useChat.d.ts +9 -5
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +38 -8
- package/dist/contracts/status.d.ts +8 -0
- package/dist/contracts/status.d.ts.map +1 -0
- package/dist/contracts/status.js +1 -0
- package/dist/hooks/useInputManager.d.ts +2 -0
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +12 -0
- package/dist/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/hooks/usePluginManager.js +41 -13
- package/dist/hooks/useTasks.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -4
- package/dist/managers/InputManager.d.ts +6 -0
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +32 -13
- package/dist/print-cli.d.ts +2 -4
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +31 -2
- package/dist/session-selector-cli.d.ts +3 -1
- package/dist/session-selector-cli.d.ts.map +1 -1
- package/dist/session-selector-cli.js +2 -2
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/utils/worktree.d.ts +23 -0
- package/dist/utils/worktree.d.ts.map +1 -0
- package/dist/utils/worktree.js +135 -0
- package/package.json +2 -2
- package/src/cli.tsx +36 -59
- package/src/components/App.tsx +99 -11
- package/src/components/BackgroundTaskManager.tsx +12 -20
- package/src/components/{CommandOutputDisplay.tsx → BangDisplay.tsx} +4 -4
- package/src/components/ChatInterface.tsx +8 -0
- package/src/components/CommandSelector.tsx +18 -1
- package/src/components/ConfirmationSelector.tsx +118 -9
- package/src/components/HelpView.tsx +2 -0
- package/src/components/HistorySearch.tsx +25 -30
- package/src/components/InputBox.tsx +11 -1
- package/src/components/MarketplaceAddForm.tsx +21 -8
- package/src/components/MarketplaceDetail.tsx +19 -4
- package/src/components/MessageBlockItem.tsx +3 -3
- package/src/components/MessageList.tsx +47 -23
- package/src/components/PluginDetail.tsx +30 -6
- package/src/components/PluginManagerShell.tsx +24 -6
- package/src/components/PluginManagerTypes.ts +2 -0
- package/src/components/SessionSelector.tsx +38 -24
- package/src/components/StatusCommand.tsx +94 -0
- package/src/components/WorktreeExitPrompt.tsx +86 -0
- package/src/contexts/useChat.tsx +57 -13
- package/src/contracts/status.ts +7 -0
- package/src/hooks/useInputManager.ts +12 -0
- package/src/hooks/usePluginManager.ts +47 -13
- package/src/hooks/useTasks.ts +2 -2
- package/src/index.ts +71 -12
- package/src/managers/InputManager.ts +37 -15
- package/src/print-cli.ts +48 -5
- package/src/session-selector-cli.tsx +6 -2
- package/src/types.ts +11 -0
- package/src/utils/worktree.ts +164 -0
- package/dist/components/CommandOutputDisplay.d.ts +0 -9
- package/dist/components/CommandOutputDisplay.d.ts.map +0 -1
|
@@ -9,12 +9,13 @@ import { BackgroundTaskManager } from "./BackgroundTaskManager.js";
|
|
|
9
9
|
import { McpManager } from "./McpManager.js";
|
|
10
10
|
import { RewindCommand } from "./RewindCommand.js";
|
|
11
11
|
import { HelpView } from "./HelpView.js";
|
|
12
|
+
import { StatusCommand } from "./StatusCommand.js";
|
|
12
13
|
import { useInputManager } from "../hooks/useInputManager.js";
|
|
13
14
|
import { useChat } from "../contexts/useChat.js";
|
|
14
15
|
export const INPUT_PLACEHOLDER_TEXT = "Type your message (use /help for more info)...";
|
|
15
16
|
export const INPUT_PLACEHOLDER_TEXT_PREFIX = INPUT_PLACEHOLDER_TEXT.substring(0, 10);
|
|
16
17
|
export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMessage = () => { }, abortMessage = () => { }, mcpServers = [], connectMcpServer = async () => false, disconnectMcpServer = async () => false, slashCommands = [], hasSlashCommand = () => false, }) => {
|
|
17
|
-
const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, handleRewindSelect, backgroundCurrentTask, messages, getFullMessageThread, } = useChat();
|
|
18
|
+
const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, handleRewindSelect, backgroundCurrentTask, messages, getFullMessageThread, clearMessages, } = useChat();
|
|
18
19
|
// Input manager with all input state and functionality (including images)
|
|
19
20
|
const { inputText, cursorPosition,
|
|
20
21
|
// Image management
|
|
@@ -26,7 +27,7 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMess
|
|
|
26
27
|
// History search
|
|
27
28
|
showHistorySearch, historySearchQuery,
|
|
28
29
|
// Task/MCP Manager
|
|
29
|
-
showBackgroundTaskManager, showMcpManager, showRewindManager, showHelp, setShowBackgroundTaskManager, setShowMcpManager, setShowRewindManager, setShowHelp,
|
|
30
|
+
showBackgroundTaskManager, showMcpManager, showRewindManager, showHelp, showStatusCommand, setShowBackgroundTaskManager, setShowMcpManager, setShowRewindManager, setShowHelp, setShowStatusCommand,
|
|
30
31
|
// Permission mode
|
|
31
32
|
permissionMode, setPermissionMode,
|
|
32
33
|
// Main handler
|
|
@@ -38,6 +39,7 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMess
|
|
|
38
39
|
onAbortMessage: abortMessage,
|
|
39
40
|
onBackgroundCurrentTask: backgroundCurrentTask,
|
|
40
41
|
onPermissionModeChange: setChatPermissionMode,
|
|
42
|
+
onClearMessages: clearMessages,
|
|
41
43
|
});
|
|
42
44
|
// Sync permission mode from useChat to InputManager
|
|
43
45
|
useEffect(() => {
|
|
@@ -78,8 +80,12 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, sendMess
|
|
|
78
80
|
if (showHelp) {
|
|
79
81
|
return _jsx(HelpView, { onCancel: () => setShowHelp(false) });
|
|
80
82
|
}
|
|
83
|
+
if (showStatusCommand) {
|
|
84
|
+
return _jsx(StatusCommand, { onCancel: () => setShowStatusCommand(false) });
|
|
85
|
+
}
|
|
81
86
|
return (_jsxs(Box, { flexDirection: "column", children: [showFileSelector && (_jsx(FileSelector, { files: filteredFiles, searchQuery: searchQuery, onSelect: handleFileSelect, onCancel: handleCancelFileSelect })), showCommandSelector && (_jsx(CommandSelector, { searchQuery: commandSearchQuery, onSelect: handleCommandSelect, onInsert: handleCommandInsert, onCancel: handleCancelCommandSelect, commands: slashCommands })), showHistorySearch && (_jsx(HistorySearch, { searchQuery: historySearchQuery, onSelect: handleHistorySearchSelect, onCancel: handleCancelHistorySearch })), showBackgroundTaskManager && (_jsx(BackgroundTaskManager, { onCancel: () => setShowBackgroundTaskManager(false) })), showMcpManager && (_jsx(McpManager, { onCancel: () => setShowMcpManager(false), servers: mcpServers, onConnectServer: connectMcpServer, onDisconnectServer: disconnectMcpServer })), showBackgroundTaskManager ||
|
|
82
87
|
showMcpManager ||
|
|
83
88
|
showRewindManager ||
|
|
84
|
-
showHelp ||
|
|
89
|
+
showHelp ||
|
|
90
|
+
showStatusCommand || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: "gray", borderLeft: false, borderRight: false, children: _jsx(Text, { color: isPlaceholder ? "gray" : "white", children: shouldShowCursor ? (_jsxs(_Fragment, { children: [beforeCursor, _jsx(Text, { backgroundColor: "white", color: "black", children: atCursor }), afterCursor] })) : (displayText) }) }), _jsx(Box, { paddingRight: 1, justifyContent: "space-between", width: "100%", children: _jsxs(Text, { color: "gray", children: ["Mode:", " ", _jsx(Text, { color: permissionMode === "plan" ? "yellow" : "cyan", children: permissionMode }), " ", "(Shift+Tab to cycle)"] }) })] }))] }));
|
|
85
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketplaceAddForm.d.ts","sourceRoot":"","sources":["../../src/components/MarketplaceAddForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"MarketplaceAddForm.d.ts","sourceRoot":"","sources":["../../src/components/MarketplaceAddForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EA+CtC,CAAC"}
|
|
@@ -3,17 +3,22 @@ import { useState } from "react";
|
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
4
|
import { usePluginManagerContext } from "../contexts/PluginManagerContext.js";
|
|
5
5
|
export const MarketplaceAddForm = () => {
|
|
6
|
-
const { actions } = usePluginManagerContext();
|
|
6
|
+
const { state, actions } = usePluginManagerContext();
|
|
7
7
|
const [source, setSource] = useState("");
|
|
8
8
|
useInput((input, key) => {
|
|
9
9
|
if (key.escape) {
|
|
10
10
|
actions.setView("MARKETPLACES");
|
|
11
11
|
}
|
|
12
|
+
else if (state.isLoading) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
12
15
|
else if (key.return) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
setSource((prev) => {
|
|
17
|
+
if (prev.trim()) {
|
|
18
|
+
actions.addMarketplace(prev.trim());
|
|
19
|
+
}
|
|
20
|
+
return prev;
|
|
21
|
+
});
|
|
17
22
|
}
|
|
18
23
|
else if (key.backspace || key.delete) {
|
|
19
24
|
setSource((prev) => prev.slice(0, -1));
|
|
@@ -22,5 +27,7 @@ export const MarketplaceAddForm = () => {
|
|
|
22
27
|
setSource((prev) => prev + input);
|
|
23
28
|
}
|
|
24
29
|
});
|
|
25
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "Add Marketplace" }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { children: "Source (URL or Path): " }), _jsx(Text, { color: "yellow", children: source }), _jsx(Text, { color: "yellow", children: "_" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, {
|
|
30
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "Add Marketplace" }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { children: "Source (URL or Path): " }), _jsx(Text, { color: state.isLoading ? "gray" : "yellow", children: source }), !state.isLoading && _jsx(Text, { color: "yellow", children: "_" })] }), state.isLoading && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellow", children: "\u231B Adding marketplace..." }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: state.isLoading
|
|
31
|
+
? "Please wait..."
|
|
32
|
+
: "Press Enter to add, Esc to cancel" }) })] }));
|
|
26
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketplaceDetail.d.ts","sourceRoot":"","sources":["../../src/components/MarketplaceDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"MarketplaceDetail.d.ts","sourceRoot":"","sources":["../../src/components/MarketplaceDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAyFrC,CAAC"}
|
|
@@ -20,7 +20,7 @@ export const MarketplaceDetail = () => {
|
|
|
20
20
|
else if (key.downArrow) {
|
|
21
21
|
setSelectedActionIndex((prev) => prev < ACTIONS.length - 1 ? prev + 1 : 0);
|
|
22
22
|
}
|
|
23
|
-
else if (key.return && marketplace) {
|
|
23
|
+
else if (key.return && marketplace && !state.isLoading) {
|
|
24
24
|
const action = ACTIONS[selectedActionIndex].id;
|
|
25
25
|
if (action === "update") {
|
|
26
26
|
actions.updateMarketplace(marketplace.name);
|
|
@@ -28,11 +28,16 @@ export const MarketplaceDetail = () => {
|
|
|
28
28
|
else {
|
|
29
29
|
actions.removeMarketplace(marketplace.name);
|
|
30
30
|
}
|
|
31
|
-
actions.setView("MARKETPLACES");
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
33
|
if (!marketplace) {
|
|
35
34
|
return (_jsx(Box, { children: _jsx(Text, { color: "red", children: "Marketplace not found." }) }));
|
|
36
35
|
}
|
|
37
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: marketplace.name }), marketplace.isBuiltin && _jsx(Text, { dimColor: true, children: " (Built-in)" })] }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Source: ", JSON.stringify(marketplace.source)] }) }),
|
|
36
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: marketplace.name }), marketplace.isBuiltin && _jsx(Text, { dimColor: true, children: " (Built-in)" })] }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Source: ", JSON.stringify(marketplace.source)] }) }), state.isLoading && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u231B Processing operation..." }) })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Marketplace Actions:" }), ACTIONS.map((action, index) => (_jsxs(Text, { color: index === selectedActionIndex
|
|
37
|
+
? state.isLoading
|
|
38
|
+
? "gray"
|
|
39
|
+
: "yellow"
|
|
40
|
+
: undefined, children: [index === selectedActionIndex ? "> " : " ", action.label] }, action.id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: state.isLoading
|
|
41
|
+
? "Please wait..."
|
|
42
|
+
: "Use ↑/↓ to select, Enter to confirm" }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press Esc to go back" }) })] })] }));
|
|
38
43
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
+
import { BangDisplay } from "./BangDisplay.js";
|
|
5
5
|
import { ToolDisplay } from "./ToolDisplay.js";
|
|
6
6
|
import { CompressDisplay } from "./CompressDisplay.js";
|
|
7
7
|
import { ReasoningDisplay } from "./ReasoningDisplay.js";
|
|
8
8
|
import { Markdown } from "./Markdown.js";
|
|
9
9
|
export const MessageBlockItem = ({ block, message, isExpanded, paddingTop = 0, }) => {
|
|
10
|
-
return (_jsxs(Box, { flexDirection: "column", paddingTop: paddingTop, children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsxs(Text, { color: "cyan", bold: true, children: ["$", " "] })), block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["~", " "] })), message.role === "user" ? (_jsx(Text, { backgroundColor: "gray", 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 === "
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", paddingTop: paddingTop, children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsxs(Text, { color: "cyan", bold: true, children: ["$", " "] })), block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["~", " "] })), message.role === "user" ? (_jsx(Text, { backgroundColor: "gray", 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 })] }));
|
|
11
11
|
};
|
|
@@ -4,6 +4,9 @@ export interface MessageListProps {
|
|
|
4
4
|
messages: Message[];
|
|
5
5
|
isExpanded?: boolean;
|
|
6
6
|
hideDynamicBlocks?: boolean;
|
|
7
|
+
version?: string;
|
|
8
|
+
workdir?: string;
|
|
9
|
+
model?: string;
|
|
7
10
|
}
|
|
8
|
-
export declare const MessageList: React.MemoExoticComponent<({ messages, isExpanded, hideDynamicBlocks, }: MessageListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export declare const MessageList: React.MemoExoticComponent<({ messages, isExpanded, hideDynamicBlocks, version, workdir, model, }: MessageListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
12
|
//# sourceMappingURL=MessageList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
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,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,oGAQnB,gBAAgB,6CAoGpB,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import os from "os";
|
|
3
4
|
import { Box, Text, Static } from "ink";
|
|
4
5
|
import { MessageBlockItem } from "./MessageBlockItem.js";
|
|
5
|
-
export const MessageList = React.memo(({ messages, isExpanded = false, hideDynamicBlocks = false, }) => {
|
|
6
|
-
|
|
7
|
-
if (messages.length === 0) {
|
|
8
|
-
return (_jsx(Box, { flexDirection: "column", gap: 1, children: _jsx(Box, { flexDirection: "column", paddingY: 1, children: _jsx(Text, { color: "gray", children: "Welcome to WAVE Code Assistant!" }) }) }));
|
|
9
|
-
}
|
|
6
|
+
export const MessageList = React.memo(({ messages, isExpanded = false, hideDynamicBlocks = false, version, workdir, model, }) => {
|
|
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(), "~") }))] }));
|
|
10
8
|
// Limit messages when expanded to prevent long rendering times
|
|
11
9
|
const maxExpandedMessages = 20;
|
|
12
10
|
const shouldLimitMessages = isExpanded && messages.length > maxExpandedMessages;
|
|
@@ -31,14 +29,23 @@ export const MessageList = React.memo(({ messages, isExpanded = false, hideDynam
|
|
|
31
29
|
const { block, isLastMessage } = item;
|
|
32
30
|
const isDynamic = isLastMessage &&
|
|
33
31
|
((block.type === "tool" && block.stage !== "end") ||
|
|
34
|
-
(block.type === "
|
|
32
|
+
(block.type === "bang" && block.isRunning));
|
|
35
33
|
return { ...item, isDynamic };
|
|
36
34
|
});
|
|
37
35
|
const staticBlocks = blocksWithStatus.filter((b) => !b.isDynamic);
|
|
38
36
|
const dynamicBlocks = hideDynamicBlocks
|
|
39
37
|
? []
|
|
40
38
|
: blocksWithStatus.filter((b) => b.isDynamic);
|
|
41
|
-
|
|
39
|
+
const staticItems = [
|
|
40
|
+
{ isWelcome: true, key: "welcome", block: undefined, message: undefined },
|
|
41
|
+
...staticBlocks.map((b) => ({ ...b, isWelcome: false })),
|
|
42
|
+
];
|
|
43
|
+
return (_jsxs(Box, { flexDirection: "column", paddingBottom: 1, children: [staticItems.length > 0 && (_jsx(Static, { items: staticItems, children: (item) => {
|
|
44
|
+
if (item.isWelcome) {
|
|
45
|
+
return (_jsx(React.Fragment, { children: welcomeMessage }, item.key));
|
|
46
|
+
}
|
|
47
|
+
return (_jsx(MessageBlockItem, { block: item.block, message: item.message, isExpanded: isExpanded, paddingTop: 1 }, item.key));
|
|
48
|
+
} })), dynamicBlocks.length > 0 && (_jsx(Box, { flexDirection: "column", children: dynamicBlocks.map((item) => (_jsx(MessageBlockItem, { block: item.block, message: item.message, isExpanded: isExpanded, paddingTop: 1 }, item.key))) }))] }));
|
|
42
49
|
});
|
|
43
50
|
// Add display name for debugging
|
|
44
51
|
MessageList.displayName = "MessageList";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../src/components/PluginDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../src/components/PluginDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EA+JhC,CAAC"}
|
|
@@ -31,7 +31,7 @@ export const PluginDetail = () => {
|
|
|
31
31
|
setSelectedActionIndex((prev) => prev < INSTALLED_ACTIONS.length - 1 ? prev + 1 : 0);
|
|
32
32
|
setSelectedScopeIndex((prev) => prev < SCOPES.length - 1 ? prev + 1 : 0);
|
|
33
33
|
}
|
|
34
|
-
else if (key.return && plugin) {
|
|
34
|
+
else if (key.return && plugin && !state.isLoading) {
|
|
35
35
|
if (isInstalledAndEnabled) {
|
|
36
36
|
setSelectedActionIndex((prev) => {
|
|
37
37
|
const action = INSTALLED_ACTIONS[prev].id;
|
|
@@ -50,11 +50,22 @@ export const PluginDetail = () => {
|
|
|
50
50
|
return prev;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
actions.setView("INSTALLED");
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
if (!plugin) {
|
|
57
56
|
return (_jsx(Box, { children: _jsx(Text, { color: "red", children: "Plugin not found." }) }));
|
|
58
57
|
}
|
|
59
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: plugin.name }), _jsxs(Text, { dimColor: true, children: [" @", plugin.marketplace] })] }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "description" in plugin ? plugin.description : "" }) }), plugin.version && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Version: ", _jsx(Text, { color: "blue", children: plugin.version })] }) })),
|
|
58
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: plugin.name }), _jsxs(Text, { dimColor: true, children: [" @", plugin.marketplace] })] }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "description" in plugin ? plugin.description : "" }) }), plugin.version && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: ["Version: ", _jsx(Text, { color: "blue", children: plugin.version })] }) })), state.isLoading && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u231B Processing operation..." }) })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [isInstalledAndEnabled ? (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Plugin Actions:" }), INSTALLED_ACTIONS.map((action, index) => (_jsxs(Text, { color: index === selectedActionIndex
|
|
59
|
+
? state.isLoading
|
|
60
|
+
? "gray"
|
|
61
|
+
: "yellow"
|
|
62
|
+
: undefined, children: [index === selectedActionIndex ? "> " : " ", action.label] }, action.id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: state.isLoading
|
|
63
|
+
? "Please wait..."
|
|
64
|
+
: "Use ↑/↓ to select, Enter to confirm" }) })] })) : (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Select Installation Scope:" }), SCOPES.map((scope, index) => (_jsxs(Text, { color: index === selectedScopeIndex
|
|
65
|
+
? state.isLoading
|
|
66
|
+
? "gray"
|
|
67
|
+
: "green"
|
|
68
|
+
: undefined, children: [index === selectedScopeIndex ? "> " : " ", scope.label] }, scope.id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: state.isLoading
|
|
69
|
+
? "Please wait..."
|
|
70
|
+
: "Use ↑/↓ to select, Enter to install" }) })] })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press Esc to go back" }) })] })] }));
|
|
60
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginManagerShell.d.ts","sourceRoot":"","sources":["../../src/components/PluginManagerShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"PluginManagerShell.d.ts","sourceRoot":"","sources":["../../src/components/PluginManagerShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAkMvE,CAAC"}
|
|
@@ -83,7 +83,7 @@ export const PluginManagerShell = ({ children, }) => {
|
|
|
83
83
|
state.currentView === "MARKETPLACE_DETAIL" ||
|
|
84
84
|
state.currentView === "ADD_MARKETPLACE"
|
|
85
85
|
? "yellow"
|
|
86
|
-
: undefined, children: [" ", "Marketplaces", " "] })] })] }), _jsxs(Box, { flexGrow: 1, flexDirection: "column", padding: 1, children: [renderView(), children] }), _jsxs(Box, { paddingX: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, children: [_jsx(Text, { dimColor: true, children: state.isLoading
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
: undefined, children: [" ", "Marketplaces", " "] })] })] }), _jsxs(Box, { flexGrow: 1, flexDirection: "column", padding: 1, children: [renderView(), children] }), _jsxs(Box, { paddingX: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, children: [_jsx(Box, { flexGrow: 1, children: _jsx(Text, { dimColor: true, children: state.isLoading
|
|
87
|
+
? "Loading..."
|
|
88
|
+
: "Use Tab to switch views, arrows to navigate, Enter to select, Esc to go back" }) }), state.isLoading && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "yellow", bold: true, children: "\u231B Processing..." }) })), state.successMessage && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "green", bold: true, children: ["\u2713 ", state.successMessage] }) })), state.error && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "red", bold: true, children: ["\u2717 Error: ", state.error] }) }))] })] }) }));
|
|
89
89
|
};
|
|
@@ -5,6 +5,7 @@ export interface PluginManagerState {
|
|
|
5
5
|
selectedId: string | null;
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
error: string | null;
|
|
8
|
+
successMessage: string | null;
|
|
8
9
|
searchQuery: string;
|
|
9
10
|
}
|
|
10
11
|
export interface PluginManagerContextType {
|
|
@@ -28,6 +29,7 @@ export interface PluginManagerContextType {
|
|
|
28
29
|
uninstallPlugin: (name: string, marketplace: string) => Promise<void>;
|
|
29
30
|
updatePlugin: (name: string, marketplace: string) => Promise<void>;
|
|
30
31
|
refresh: () => Promise<void>;
|
|
32
|
+
clearPluginFeedback: () => void;
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
//# sourceMappingURL=PluginManagerTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginManagerTypes.d.ts","sourceRoot":"","sources":["../../src/components/PluginManagerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,WAAW,GACX,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,gBAAgB,EAAE,CAAC,eAAe,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAC;IAC7D,mBAAmB,EAAE,CAAC,sBAAsB,GAAG;QAC7C,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,EAAE,CAAC;IACL,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;QAClC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CA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","sourceRoot":"","sources":["../../src/components/SessionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,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,
|
|
1
|
+
{"version":3,"file":"SessionSelector.d.ts","sourceRoot":"","sources":["../../src/components/SessionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,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,CAqI1D,CAAC"}
|
|
@@ -5,12 +5,9 @@ export const SessionSelector = ({ sessions, onSelect, onCancel, }) => {
|
|
|
5
5
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
6
6
|
useInput((input, key) => {
|
|
7
7
|
if (key.return) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return prev;
|
|
13
|
-
});
|
|
8
|
+
if (sessions.length > 0 && selectedIndex < sessions.length) {
|
|
9
|
+
onSelect(sessions[selectedIndex].id);
|
|
10
|
+
}
|
|
14
11
|
return;
|
|
15
12
|
}
|
|
16
13
|
if (key.escape) {
|
|
@@ -18,24 +15,24 @@ export const SessionSelector = ({ sessions, onSelect, onCancel, }) => {
|
|
|
18
15
|
return;
|
|
19
16
|
}
|
|
20
17
|
if (key.upArrow) {
|
|
21
|
-
setSelectedIndex(
|
|
18
|
+
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
22
19
|
return;
|
|
23
20
|
}
|
|
24
21
|
if (key.downArrow) {
|
|
25
|
-
setSelectedIndex(
|
|
22
|
+
setSelectedIndex(Math.min(sessions.length - 1, selectedIndex + 1));
|
|
26
23
|
return;
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
26
|
if (sessions.length === 0) {
|
|
30
27
|
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" })] }));
|
|
31
28
|
}
|
|
32
|
-
const
|
|
33
|
-
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(
|
|
34
|
-
const displaySessions = sessions.slice(startIndex, startIndex +
|
|
29
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
30
|
+
const startIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_ITEMS / 2), Math.max(0, sessions.length - MAX_VISIBLE_ITEMS)));
|
|
31
|
+
const displaySessions = sessions.slice(startIndex, startIndex + MAX_VISIBLE_ITEMS);
|
|
35
32
|
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, gap: 1, borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, width: "100%", children: [_jsx(Box, { children: _jsx(Text, { color: "cyan", bold: true, children: "Select a session to resume" }) }), _jsx(Box, { flexDirection: "column", children: displaySessions.map((session, index) => {
|
|
36
33
|
const actualIndex = startIndex + index;
|
|
37
34
|
const isSelected = actualIndex === selectedIndex;
|
|
38
35
|
const lastActiveAt = new Date(session.lastActiveAt).toLocaleString();
|
|
39
|
-
return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [
|
|
40
|
-
}) }), sessions.length >
|
|
36
|
+
return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsxs(Box, { width: "100%", children: [_jsx(Box, { backgroundColor: isSelected ? "cyan" : undefined, flexShrink: 0, children: _jsx(Text, { color: isSelected ? "black" : "white", children: isSelected ? "▶ " : " " }) }), _jsx(Box, { backgroundColor: isSelected ? "cyan" : undefined, flexGrow: 1, children: _jsxs(Text, { color: isSelected ? "black" : "white", wrap: "truncate-end", children: [session.id, " | ", lastActiveAt, " | ", session.latestTotalTokens, " ", "tokens"] }) })] }), isSelected && session.firstMessage && (_jsx(Box, { marginLeft: 2, width: "100%", children: _jsx(Text, { dimColor: true, italic: true, wrap: "truncate-end", children: session.firstMessage.replace(/\n/g, "\\n") }) }))] }, session.id));
|
|
37
|
+
}) }), sessions.length > MAX_VISIBLE_ITEMS && (_jsx(Box, { children: _jsxs(Text, { dimColor: true, children: ["... showing ", displaySessions.length, " of ", sessions.length, " sessions"] }) })), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "\u2191\u2193 navigate \u2022 Enter to select \u2022 Esc to cancel" }) })] }));
|
|
41
38
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusCommand.d.ts","sourceRoot":"","sources":["../../src/components/StatusCommand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+EtD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
import { useChat } from "../contexts/useChat.js";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
export const StatusCommand = ({ onCancel }) => {
|
|
10
|
+
const { sessionId, workingDirectory, getGatewayConfig, getModelConfig } = useChat();
|
|
11
|
+
useInput((_, key) => {
|
|
12
|
+
if (key.escape) {
|
|
13
|
+
onCancel();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const gatewayConfig = getGatewayConfig();
|
|
17
|
+
const modelConfig = getModelConfig();
|
|
18
|
+
let version = "unknown";
|
|
19
|
+
try {
|
|
20
|
+
const pkgPath = path.resolve(__dirname, "../../package.json");
|
|
21
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
22
|
+
version = pkg.version;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// Fallback if package.json cannot be read
|
|
26
|
+
}
|
|
27
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", borderLeft: false, borderRight: false, paddingX: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, underline: true, children: "Agent Status" }) }), _jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: "Version:" }) }), _jsx(Text, { color: "white", children: version })] }), _jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: "Session ID:" }) }), _jsx(Text, { color: "white", children: sessionId })] }), _jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: "cwd:" }) }), _jsx(Text, { color: "white", wrap: "wrap", children: workingDirectory })] }), _jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: "Wave base URL:" }) }), _jsx(Text, { color: "white", children: gatewayConfig.baseURL })] }), _jsxs(Box, { children: [_jsx(Box, { width: 20, children: _jsx(Text, { color: "yellow", children: "Model:" }) }), _jsx(Text, { color: "white", children: modelConfig.model })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Esc to cancel" }) })] }));
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface WorktreeExitPromptProps {
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
hasUncommittedChanges: boolean;
|
|
6
|
+
hasNewCommits: boolean;
|
|
7
|
+
onKeep: () => void;
|
|
8
|
+
onRemove: () => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const WorktreeExitPrompt: React.FC<WorktreeExitPromptProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=WorktreeExitPrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorktreeExitPrompt.d.ts","sourceRoot":"","sources":["../../src/components/WorktreeExitPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,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,CAwEhE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Box, Text, useInput } from "ink";
|
|
4
|
+
export const WorktreeExitPrompt = ({ name, path: worktreePath, hasUncommittedChanges, hasNewCommits, onKeep, onRemove, onCancel, }) => {
|
|
5
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
6
|
+
useInput((input, key) => {
|
|
7
|
+
if (key.upArrow) {
|
|
8
|
+
setSelectedIndex((prev) => (prev === 0 ? 1 : 0));
|
|
9
|
+
}
|
|
10
|
+
if (key.downArrow) {
|
|
11
|
+
setSelectedIndex((prev) => (prev === 1 ? 0 : 1));
|
|
12
|
+
}
|
|
13
|
+
if (key.return) {
|
|
14
|
+
if (selectedIndex === 0) {
|
|
15
|
+
onKeep();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
onRemove();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (key.escape) {
|
|
22
|
+
onCancel();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
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
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Message, McpServerStatus, BackgroundTask, Task, SlashCommand, PermissionDecision, PermissionMode } from "wave-agent-sdk";
|
|
3
|
+
import { BaseAppProps } from "../types.js";
|
|
3
4
|
export interface ChatContextType {
|
|
4
5
|
messages: Message[];
|
|
5
6
|
isLoading: boolean;
|
|
@@ -15,11 +16,12 @@ export interface ChatContextType {
|
|
|
15
16
|
}>) => Promise<void>;
|
|
16
17
|
abortMessage: () => void;
|
|
17
18
|
latestTotalTokens: number;
|
|
19
|
+
clearMessages: () => void;
|
|
18
20
|
mcpServers: McpServerStatus[];
|
|
19
21
|
connectMcpServer: (serverName: string) => Promise<boolean>;
|
|
20
22
|
disconnectMcpServer: (serverName: string) => Promise<boolean>;
|
|
21
23
|
backgroundTasks: BackgroundTask[];
|
|
22
|
-
|
|
24
|
+
tasks: Task[];
|
|
23
25
|
getBackgroundTaskOutput: (taskId: string) => {
|
|
24
26
|
stdout: string;
|
|
25
27
|
stderr: string;
|
|
@@ -52,13 +54,15 @@ export interface ChatContextType {
|
|
|
52
54
|
}>;
|
|
53
55
|
wasLastDetailsTooTall: number;
|
|
54
56
|
setWasLastDetailsTooTall: React.Dispatch<React.SetStateAction<number>>;
|
|
57
|
+
getGatewayConfig: () => import("wave-agent-sdk").GatewayConfig;
|
|
58
|
+
getModelConfig: () => import("wave-agent-sdk").ModelConfig;
|
|
59
|
+
workingDirectory: string;
|
|
60
|
+
version?: string;
|
|
61
|
+
workdir?: string;
|
|
55
62
|
}
|
|
56
63
|
export declare const useChat: () => ChatContextType;
|
|
57
|
-
export interface ChatProviderProps {
|
|
64
|
+
export interface ChatProviderProps extends BaseAppProps {
|
|
58
65
|
children: React.ReactNode;
|
|
59
|
-
bypassPermissions?: boolean;
|
|
60
|
-
pluginDirs?: string[];
|
|
61
|
-
tools?: string[];
|
|
62
66
|
}
|
|
63
67
|
export declare const ChatProvider: React.FC<ChatProviderProps>;
|
|
64
68
|
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -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;
|
|
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;AASxB,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,IAAI,CAAC;IAEjD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC/C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,UAAU,EAAE,eAAe,E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