wave-code 0.0.5 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/components/App.d.ts +1 -0
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +4 -4
- package/dist/components/BashHistorySelector.d.ts.map +1 -1
- package/dist/components/BashHistorySelector.js +17 -3
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +6 -24
- package/dist/components/CommandSelector.js +4 -4
- package/dist/components/Confirmation.d.ts +11 -0
- package/dist/components/Confirmation.d.ts.map +1 -0
- package/dist/components/Confirmation.js +148 -0
- package/dist/components/DiffDisplay.d.ts +8 -0
- package/dist/components/DiffDisplay.d.ts.map +1 -0
- package/dist/components/DiffDisplay.js +168 -0
- package/dist/components/FileSelector.d.ts +2 -4
- package/dist/components/FileSelector.d.ts.map +1 -1
- package/dist/components/FileSelector.js +2 -2
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +30 -50
- package/dist/components/Markdown.d.ts +6 -0
- package/dist/components/Markdown.d.ts.map +1 -0
- package/dist/components/Markdown.js +22 -0
- package/dist/components/MemoryDisplay.js +1 -1
- package/dist/components/MessageItem.d.ts +8 -0
- package/dist/components/MessageItem.d.ts.map +1 -0
- package/dist/components/MessageItem.js +15 -0
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +33 -33
- package/dist/components/ReasoningDisplay.d.ts +8 -0
- package/dist/components/ReasoningDisplay.d.ts.map +1 -0
- package/dist/components/ReasoningDisplay.js +10 -0
- package/dist/components/SubagentBlock.d.ts +0 -1
- package/dist/components/SubagentBlock.d.ts.map +1 -1
- package/dist/components/SubagentBlock.js +29 -30
- package/dist/components/ToolResultDisplay.d.ts.map +1 -1
- package/dist/components/ToolResultDisplay.js +6 -5
- package/dist/contexts/useChat.d.ts +14 -2
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +128 -17
- package/dist/hooks/useInputManager.d.ts +6 -1
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +32 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -5
- package/dist/managers/InputManager.d.ts +11 -1
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +77 -26
- package/dist/print-cli.d.ts +2 -0
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +121 -23
- package/dist/utils/toolParameterTransforms.d.ts +23 -0
- package/dist/utils/toolParameterTransforms.d.ts.map +1 -0
- package/dist/utils/toolParameterTransforms.js +77 -0
- package/dist/utils/usageSummary.d.ts +6 -0
- package/dist/utils/usageSummary.d.ts.map +1 -1
- package/dist/utils/usageSummary.js +72 -0
- package/package.json +13 -8
- package/src/cli.tsx +3 -1
- package/src/components/App.tsx +7 -3
- package/src/components/BashHistorySelector.tsx +26 -3
- package/src/components/ChatInterface.tsx +38 -54
- package/src/components/CommandSelector.tsx +5 -5
- package/src/components/Confirmation.tsx +253 -0
- package/src/components/DiffDisplay.tsx +300 -0
- package/src/components/FileSelector.tsx +4 -6
- package/src/components/InputBox.tsx +58 -87
- package/src/components/Markdown.tsx +29 -0
- package/src/components/MemoryDisplay.tsx +1 -1
- package/src/components/MessageItem.tsx +96 -0
- package/src/components/MessageList.tsx +140 -202
- package/src/components/ReasoningDisplay.tsx +33 -0
- package/src/components/SubagentBlock.tsx +56 -84
- package/src/components/ToolResultDisplay.tsx +9 -5
- package/src/contexts/useChat.tsx +194 -21
- package/src/hooks/useInputManager.ts +40 -3
- package/src/index.ts +45 -5
- package/src/managers/InputManager.ts +101 -27
- package/src/print-cli.ts +143 -21
- package/src/utils/toolParameterTransforms.ts +104 -0
- package/src/utils/usageSummary.ts +109 -0
- package/dist/components/DiffViewer.d.ts +0 -9
- package/dist/components/DiffViewer.d.ts.map +0 -1
- package/dist/components/DiffViewer.js +0 -221
- package/dist/utils/fileSearch.d.ts +0 -20
- package/dist/utils/fileSearch.d.ts.map +0 -1
- package/dist/utils/fileSearch.js +0 -102
- package/src/components/DiffViewer.tsx +0 -321
- package/src/utils/fileSearch.ts +0 -133
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
4
|
import { useInput } from "ink";
|
|
5
5
|
import { FileSelector } from "./FileSelector.js";
|
|
@@ -9,41 +9,47 @@ import { MemoryTypeSelector } from "./MemoryTypeSelector.js";
|
|
|
9
9
|
import { BashShellManager } from "./BashShellManager.js";
|
|
10
10
|
import { McpManager } from "./McpManager.js";
|
|
11
11
|
import { useInputManager } from "../hooks/useInputManager.js";
|
|
12
|
+
import { useChat } from "../contexts/useChat.js";
|
|
12
13
|
export const INPUT_PLACEHOLDER_TEXT = "Type your message (use @ to reference files, / for commands, ! for bash history, # to add memory)...";
|
|
13
14
|
export const INPUT_PLACEHOLDER_TEXT_PREFIX = INPUT_PLACEHOLDER_TEXT.substring(0, 10);
|
|
14
15
|
export const InputBox = ({ isLoading = false, isCommandRunning = false, workdir, userInputHistory = [], sendMessage = () => { }, abortMessage = () => { }, saveMemory = async () => { }, mcpServers = [], connectMcpServer = async () => false, disconnectMcpServer = async () => false, slashCommands = [], hasSlashCommand = () => false, }) => {
|
|
15
|
-
// Get current working directory
|
|
16
|
-
const currentWorkdir = workdir || process.cwd();
|
|
17
|
-
|
|
18
|
-
const resetHistoryNavigation = useCallback(() => {
|
|
19
|
-
// This will be handled by InputManager through callbacks
|
|
20
|
-
}, []);
|
|
16
|
+
// Get current working directory - memoized to avoid repeated process.cwd() calls
|
|
17
|
+
const currentWorkdir = useMemo(() => workdir || process.cwd(), [workdir]);
|
|
18
|
+
const { permissionMode: chatPermissionMode, setPermissionMode: setChatPermissionMode, } = useChat();
|
|
21
19
|
// Input manager with all input state and functionality (including images)
|
|
22
|
-
const { inputText, cursorPosition,
|
|
20
|
+
const { inputText, cursorPosition,
|
|
23
21
|
// Image management
|
|
24
22
|
attachedImages, clearImages,
|
|
25
23
|
// File selector
|
|
26
|
-
showFileSelector, filteredFiles, fileSearchQuery: searchQuery, handleFileSelect
|
|
24
|
+
showFileSelector, filteredFiles, fileSearchQuery: searchQuery, handleFileSelect, handleCancelFileSelect,
|
|
27
25
|
// Command selector
|
|
28
|
-
showCommandSelector, commandSearchQuery, handleCommandSelect
|
|
26
|
+
showCommandSelector, commandSearchQuery, handleCommandSelect, handleCommandInsert, handleCancelCommandSelect,
|
|
29
27
|
// Bash history selector
|
|
30
|
-
showBashHistorySelector, bashHistorySearchQuery, handleBashHistorySelect
|
|
28
|
+
showBashHistorySelector, bashHistorySearchQuery, handleBashHistorySelect, handleCancelBashHistorySelect,
|
|
31
29
|
// Memory type selector
|
|
32
|
-
showMemoryTypeSelector, memoryMessage, handleMemoryTypeSelect
|
|
30
|
+
showMemoryTypeSelector, memoryMessage, handleMemoryTypeSelect, handleCancelMemoryTypeSelect,
|
|
33
31
|
// Bash/MCP Manager
|
|
34
32
|
showBashManager, showMcpManager, setShowBashManager, setShowMcpManager,
|
|
33
|
+
// Permission mode
|
|
34
|
+
permissionMode, setPermissionMode,
|
|
35
35
|
// Input history
|
|
36
36
|
setUserInputHistory,
|
|
37
|
+
// Complex handlers combining multiple operations
|
|
38
|
+
handleBashHistoryExecuteAndSend,
|
|
37
39
|
// Main handler
|
|
38
|
-
handleInput,
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
handleInput,
|
|
41
|
+
// Manager ready state
|
|
42
|
+
isManagerReady, } = useInputManager({
|
|
41
43
|
onSendMessage: sendMessage,
|
|
42
44
|
onHasSlashCommand: hasSlashCommand,
|
|
43
45
|
onSaveMemory: saveMemory,
|
|
44
46
|
onAbortMessage: abortMessage,
|
|
45
|
-
|
|
47
|
+
onPermissionModeChange: setChatPermissionMode,
|
|
46
48
|
});
|
|
49
|
+
// Sync permission mode from useChat to InputManager
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
setPermissionMode(chatPermissionMode);
|
|
52
|
+
}, [chatPermissionMode, setPermissionMode]);
|
|
47
53
|
// Set user input history when it changes
|
|
48
54
|
useEffect(() => {
|
|
49
55
|
setUserInputHistory(userInputHistory);
|
|
@@ -52,41 +58,11 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, workdir,
|
|
|
52
58
|
useInput(async (input, key) => {
|
|
53
59
|
await handleInput(input, key, attachedImages, isLoading, isCommandRunning, clearImages);
|
|
54
60
|
});
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
handleFileSelectorSelect(filePath);
|
|
58
|
-
}, [handleFileSelectorSelect]);
|
|
59
|
-
const handleCommandSelect = useCallback((command) => {
|
|
60
|
-
handleCommandSelectorSelect(command);
|
|
61
|
-
}, [handleCommandSelectorSelect]);
|
|
62
|
-
const handleBashHistorySelect = useCallback((command) => {
|
|
63
|
-
handleBashHistorySelectorSelect(command);
|
|
64
|
-
}, [handleBashHistorySelectorSelect]);
|
|
65
|
-
const keyboardHandleBashHistoryExecute = useCallback((command) => {
|
|
66
|
-
const commandToExecute = handleBashHistoryExecute(command);
|
|
67
|
-
// Clear input box and execute command, ensure command starts with !
|
|
68
|
-
const bashCommand = commandToExecute.startsWith("!")
|
|
69
|
-
? commandToExecute
|
|
70
|
-
: `!${commandToExecute}`;
|
|
71
|
-
clearInput();
|
|
72
|
-
sendMessage(bashCommand);
|
|
73
|
-
}, [handleBashHistoryExecute, clearInput, sendMessage]);
|
|
74
|
-
const handleMemoryTypeSelect = useCallback(async (type) => {
|
|
75
|
-
const currentMessage = inputText.trim();
|
|
76
|
-
if (currentMessage.startsWith("#")) {
|
|
77
|
-
await saveMemory(currentMessage, type);
|
|
78
|
-
}
|
|
79
|
-
// Call the handler function to close the selector
|
|
80
|
-
handleMemoryTypeSelectorSelect(type);
|
|
81
|
-
// Clear input box
|
|
82
|
-
clearInput();
|
|
83
|
-
}, [inputText, saveMemory, handleMemoryTypeSelectorSelect, clearInput]);
|
|
61
|
+
// These methods are already memoized in useInputManager, no need to wrap again
|
|
62
|
+
// These methods are already memoized in useInputManager and combine multiple operations
|
|
84
63
|
const isPlaceholder = !inputText;
|
|
85
64
|
const placeholderText = INPUT_PLACEHOLDER_TEXT;
|
|
86
|
-
//
|
|
87
|
-
const handleCommandInsert = useCallback((command) => {
|
|
88
|
-
handleCommandSelectorInsert(command);
|
|
89
|
-
}, [handleCommandSelectorInsert]);
|
|
65
|
+
// handleCommandSelectorInsert is already memoized in useInputManager, no need to wrap again
|
|
90
66
|
// Split text into three parts: before cursor, cursor position, after cursor
|
|
91
67
|
const displayText = isPlaceholder ? placeholderText : inputText;
|
|
92
68
|
const beforeCursor = displayText.substring(0, cursorPosition);
|
|
@@ -94,5 +70,9 @@ export const InputBox = ({ isLoading = false, isCommandRunning = false, workdir,
|
|
|
94
70
|
const afterCursor = displayText.substring(cursorPosition + 1);
|
|
95
71
|
// Always show cursor, allow user to continue input during loading
|
|
96
72
|
const shouldShowCursor = true;
|
|
97
|
-
|
|
73
|
+
// Only show the Box after InputManager is created on first mount
|
|
74
|
+
if (!isManagerReady) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
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 })), showBashHistorySelector && (_jsx(BashHistorySelector, { searchQuery: bashHistorySearchQuery, workdir: currentWorkdir, onSelect: handleBashHistorySelect, onExecute: handleBashHistoryExecuteAndSend, onCancel: handleCancelBashHistorySelect })), showMemoryTypeSelector && (_jsx(MemoryTypeSelector, { message: memoryMessage, onSelect: handleMemoryTypeSelect, onCancel: handleCancelMemoryTypeSelect })), showBashManager && (_jsx(BashShellManager, { onCancel: () => setShowBashManager(false) })), showMcpManager && (_jsx(McpManager, { onCancel: () => setShowMcpManager(false), servers: mcpServers, onConnectServer: connectMcpServer, onDisconnectServer: disconnectMcpServer })), showBashManager || showMcpManager || (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, 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, { paddingX: 1, children: _jsxs(Text, { color: "gray", children: ["Mode: ", _jsx(Text, { color: "cyan", children: permissionMode }), " (Shift+Tab to cycle)"] }) })] }))] }));
|
|
98
78
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,eAAO,MAAM,QAAQ,2CAA6B,aAAa,6CAe7D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { Text } from "ink";
|
|
4
|
+
import { marked } from "marked";
|
|
5
|
+
import TerminalRenderer from "marked-terminal";
|
|
6
|
+
// Markdown component using marked-terminal with proper unescape option
|
|
7
|
+
export const Markdown = React.memo(({ children }) => {
|
|
8
|
+
const result = useMemo(() => {
|
|
9
|
+
// Configure marked with TerminalRenderer using default options
|
|
10
|
+
marked.setOptions({
|
|
11
|
+
renderer: new TerminalRenderer({
|
|
12
|
+
// Use official unescape option to handle HTML entities
|
|
13
|
+
unescape: true,
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
const output = marked(children);
|
|
17
|
+
return typeof output === "string" ? output.trim() : "";
|
|
18
|
+
}, [children]);
|
|
19
|
+
return _jsx(Text, { children: result });
|
|
20
|
+
});
|
|
21
|
+
// Add display name for debugging
|
|
22
|
+
Markdown.displayName = "Markdown";
|
|
@@ -15,7 +15,7 @@ export const MemoryDisplay = ({ block }) => {
|
|
|
15
15
|
if (!isSuccess)
|
|
16
16
|
return null;
|
|
17
17
|
if (memoryType === "user") {
|
|
18
|
-
return `Memory saved to ${storagePath || "
|
|
18
|
+
return `Memory saved to ${storagePath || "AGENTS.md"}`;
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
21
|
return `Memory saved to ${storagePath || "AGENTS.md"}`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Message } from "wave-agent-sdk";
|
|
2
|
+
export interface MessageItemProps {
|
|
3
|
+
message: Message;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
shouldShowHeader: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const MessageItem: ({ message, isExpanded, shouldShowHeader, }: MessageItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=MessageItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageItem.d.ts","sourceRoot":"","sources":["../../src/components/MessageItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAU9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,WAAW,GAAI,4CAIzB,gBAAgB,mDAyElB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { MessageSource } from "wave-agent-sdk";
|
|
4
|
+
import { CommandOutputDisplay } from "./CommandOutputDisplay.js";
|
|
5
|
+
import { ToolResultDisplay } from "./ToolResultDisplay.js";
|
|
6
|
+
import { MemoryDisplay } from "./MemoryDisplay.js";
|
|
7
|
+
import { CompressDisplay } from "./CompressDisplay.js";
|
|
8
|
+
import { SubagentBlock } from "./SubagentBlock.js";
|
|
9
|
+
import { ReasoningDisplay } from "./ReasoningDisplay.js";
|
|
10
|
+
import { Markdown } from "./Markdown.js";
|
|
11
|
+
export const MessageItem = ({ message, isExpanded, shouldShowHeader, }) => {
|
|
12
|
+
if (message.blocks.length === 0)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, marginTop: 1, children: [shouldShowHeader && (_jsx(Box, { children: _jsx(Text, { color: message.role === "user" ? "cyan" : "green", bold: true, children: message.role === "user" ? "👤 You" : "🤖 Assistant" }) })), _jsx(Box, { flexDirection: "column", gap: 1, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsxs(Box, { children: [block.customCommandContent && (_jsxs(Text, { color: "cyan", bold: true, children: ["\u26A1", " "] })), block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["\uD83D\uDD17", " "] })), _jsx(Markdown, { children: block.content })] })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["\u274C Error: ", block.content] }) })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolResultDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "\uD83D\uDCF7 Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "memory" && _jsx(MemoryDisplay, { block: block }), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "subagent" && _jsx(SubagentBlock, { block: block }), block.type === "reasoning" && _jsx(ReasoningDisplay, { block: block })] }, blockIndex))) })] }));
|
|
15
|
+
};
|
|
@@ -8,5 +8,5 @@ export interface MessageListProps {
|
|
|
8
8
|
latestTotalTokens?: number;
|
|
9
9
|
isExpanded?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const MessageList: React.
|
|
11
|
+
export declare const MessageList: React.MemoExoticComponent<({ messages, isLoading, isCommandRunning, isCompressing, latestTotalTokens, isExpanded, }: MessageListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
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,
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,uHAQnB,gBAAgB,6CAwIpB,CAAC"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
2
|
-
import
|
|
3
|
-
import { Box, Text } from "ink";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { CommandOutputDisplay } from "./CommandOutputDisplay.js";
|
|
7
|
-
import { ToolResultDisplay } from "./ToolResultDisplay.js";
|
|
8
|
-
import { MemoryDisplay } from "./MemoryDisplay.js";
|
|
9
|
-
import { CompressDisplay } from "./CompressDisplay.js";
|
|
10
|
-
import { SubagentBlock } from "./SubagentBlock.js";
|
|
11
|
-
import { usePagination } from "../hooks/usePagination.js";
|
|
12
|
-
// Function to render a single message
|
|
13
|
-
const renderMessageItem = (message, originalIndex, isExpanded, previousMessage) => {
|
|
14
|
-
const shouldShowHeader = previousMessage?.role !== message.role;
|
|
15
|
-
return (_jsxs(Box, { flexDirection: "column", children: [shouldShowHeader && (_jsx(Box, { children: _jsxs(Text, { color: message.role === "user" ? "cyan" : "green", bold: true, children: [message.role === "user" ? "👤 You" : "🤖 Assistant", _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "#", originalIndex + 1] })] }) })), _jsx(Box, { marginLeft: 2, flexDirection: "column", gap: 1, marginTop: shouldShowHeader ? 1 : 0, children: message.blocks.map((block, blockIndex) => (_jsxs(Box, { children: [block.type === "text" && block.content.trim() && (_jsx(Box, { children: _jsxs(Text, { children: [block.customCommandContent && (_jsxs(Text, { color: "cyan", bold: true, children: ["\u26A1", " "] })), block.source === MessageSource.HOOK && (_jsxs(Text, { color: "magenta", bold: true, children: ["\uD83D\uDD17", " "] })), block.content] }) })), block.type === "error" && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["\u274C Error: ", block.content] }) })), block.type === "diff" && (_jsx(DiffViewer, { block: block, isExpanded: isExpanded })), block.type === "command_output" && (_jsx(CommandOutputDisplay, { block: block, isExpanded: isExpanded })), block.type === "tool" && (_jsx(ToolResultDisplay, { block: block, isExpanded: isExpanded })), block.type === "image" && (_jsxs(Box, { children: [_jsx(Text, { color: "magenta", bold: true, children: "\uD83D\uDCF7 Image" }), block.imageUrls && block.imageUrls.length > 0 && (_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", block.imageUrls.length, ")"] }))] })), block.type === "memory" && _jsx(MemoryDisplay, { block: block }), block.type === "compress" && (_jsx(CompressDisplay, { block: block, isExpanded: isExpanded })), block.type === "subagent" && (_jsx(SubagentBlock, { block: block, isExpanded: isExpanded }))] }, blockIndex))) })] }, `message-${originalIndex}`));
|
|
16
|
-
};
|
|
17
|
-
export const MessageList = ({ messages, isLoading = false, isCommandRunning = false, isCompressing = false, latestTotalTokens = 0, isExpanded = false, }) => {
|
|
18
|
-
// Use original messages for pagination calculation
|
|
19
|
-
const { displayInfo } = usePagination(messages);
|
|
20
|
-
// Get current page messages while preserving original index information
|
|
21
|
-
const currentMessagesWithIndex = useMemo(() => {
|
|
22
|
-
return messages
|
|
23
|
-
.slice(displayInfo.startIndex, displayInfo.endIndex)
|
|
24
|
-
.map((message, index) => ({
|
|
25
|
-
message,
|
|
26
|
-
originalIndex: displayInfo.startIndex + index,
|
|
27
|
-
}));
|
|
28
|
-
}, [messages, displayInfo.startIndex, displayInfo.endIndex]);
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Box, Text, Static } from "ink";
|
|
4
|
+
import { MessageItem } from "./MessageItem.js";
|
|
5
|
+
export const MessageList = React.memo(({ messages, isLoading = false, isCommandRunning = false, isCompressing = false, latestTotalTokens = 0, isExpanded = false, }) => {
|
|
29
6
|
// Empty message state
|
|
30
7
|
if (messages.length === 0) {
|
|
31
8
|
return (_jsx(Box, { flexDirection: "column", paddingY: 1, children: _jsx(Text, { color: "gray", children: "Welcome to WAVE Code Assistant!" }) }));
|
|
32
9
|
}
|
|
33
|
-
|
|
10
|
+
// Limit messages when expanded to prevent long rendering times
|
|
11
|
+
const maxExpandedMessages = 20;
|
|
12
|
+
const shouldLimitMessages = isExpanded && messages.length > maxExpandedMessages;
|
|
13
|
+
const displayMessages = shouldLimitMessages
|
|
14
|
+
? messages.slice(-maxExpandedMessages)
|
|
15
|
+
: messages;
|
|
16
|
+
const omittedCount = shouldLimitMessages
|
|
17
|
+
? messages.length - maxExpandedMessages
|
|
18
|
+
: 0;
|
|
19
|
+
// Compute which messages to render statically vs dynamically
|
|
20
|
+
const shouldRenderLastDynamic = isLoading || isCommandRunning;
|
|
21
|
+
const staticMessages = shouldRenderLastDynamic
|
|
22
|
+
? displayMessages.slice(0, -1)
|
|
23
|
+
: displayMessages;
|
|
24
|
+
const dynamicMessages = shouldRenderLastDynamic && displayMessages.length > 0
|
|
25
|
+
? [displayMessages[displayMessages.length - 1]]
|
|
26
|
+
: [];
|
|
27
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, gap: 1, children: [omittedCount > 0 && (_jsx(Box, { children: _jsxs(Text, { color: "gray", dimColor: true, children: ["... ", omittedCount, " earlier message", omittedCount !== 1 ? "s" : "", " ", "omitted (showing latest ", maxExpandedMessages, ")"] }) })), _jsx(Static, { items: staticMessages, children: (message, key) => {
|
|
34
28
|
// Get previous message
|
|
35
|
-
const previousMessage =
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
29
|
+
const previousMessage = key > 0 ? staticMessages[key - 1] : undefined;
|
|
30
|
+
return (_jsx(MessageItem, { message: message, shouldShowHeader: previousMessage?.role !== message.role, isExpanded: isExpanded }, key));
|
|
31
|
+
} }), dynamicMessages.map((message, index) => {
|
|
32
|
+
const messageIndex = staticMessages.length + index;
|
|
33
|
+
const previousMessage = messageIndex > 0 ? displayMessages[messageIndex - 1] : undefined;
|
|
34
|
+
return (_jsx(Box, { marginTop: -1, children: _jsx(MessageItem, { message: message, shouldShowHeader: previousMessage?.role !== message.role, isExpanded: isExpanded }) }, `dynamic-${index}`));
|
|
35
|
+
}), (isLoading || isCommandRunning || isCompressing) && (_jsxs(Box, { flexDirection: "column", gap: 1, children: [isLoading && (_jsxs(Box, { children: [_jsx(Text, { color: "yellow", children: "\uD83D\uDCAD AI is thinking... " }), _jsxs(Text, { color: "gray", dimColor: true, children: ["|", " "] }), _jsx(Text, { color: "red", bold: true, children: "Esc" }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "to abort"] })] })), isCommandRunning && (_jsx(Text, { color: "blue", children: "\uD83D\uDE80 Command is running..." })), isCompressing && (_jsx(Text, { color: "magenta", children: "\uD83D\uDDDC\uFE0F Compressing message history..." }))] })), messages.length > 0 && (_jsx(Box, { children: _jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsx(Box, { children: _jsxs(Text, { color: "gray", children: ["Messages ", messages.length, latestTotalTokens > 0 && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "gray", dimColor: true, children: [" ", "|", " "] }), _jsx(Text, { color: "blue", bold: true, children: latestTotalTokens.toLocaleString() }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "tokens"] })] }))] }) }), _jsxs(Text, { color: "gray", dimColor: true, children: [_jsx(Text, { color: "cyan", children: "Ctrl+O" }), " Toggle", " ", isExpanded ? "Collapse" : "Expand"] })] }) }))] }));
|
|
36
|
+
});
|
|
37
|
+
// Add display name for debugging
|
|
38
|
+
MessageList.displayName = "MessageList";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ReasoningBlock } from "wave-agent-sdk";
|
|
3
|
+
interface ReasoningDisplayProps {
|
|
4
|
+
block: ReasoningBlock;
|
|
5
|
+
}
|
|
6
|
+
export declare const ReasoningDisplay: React.FC<ReasoningDisplayProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ReasoningDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReasoningDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ReasoningDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,UAAU,qBAAqB;IAC7B,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAuB5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "ink";
|
|
3
|
+
import { Markdown } from "./Markdown.js";
|
|
4
|
+
export const ReasoningDisplay = ({ block, }) => {
|
|
5
|
+
const { content } = block;
|
|
6
|
+
if (!content || !content.trim()) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return (_jsx(Box, { borderRight: false, borderTop: false, borderBottom: false, borderStyle: "classic", borderColor: "blue", paddingLeft: 1, children: _jsx(Box, { flexDirection: "column", children: _jsx(Markdown, { children: content }) }) }));
|
|
10
|
+
};
|
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import type { SubagentBlock as SubagentBlockType } from "wave-agent-sdk";
|
|
3
3
|
interface SubagentBlockProps {
|
|
4
4
|
block: SubagentBlockType;
|
|
5
|
-
isExpanded?: boolean;
|
|
6
5
|
}
|
|
7
6
|
export declare const SubagentBlock: React.FC<SubagentBlockProps>;
|
|
8
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubagentBlock.d.ts","sourceRoot":"","sources":["../../src/components/SubagentBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SubagentBlock.d.ts","sourceRoot":"","sources":["../../src/components/SubagentBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGzE,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoGtD,CAAC"}
|
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return text;
|
|
9
|
-
}
|
|
10
|
-
return lines.slice(0, maxLines).join("\n") + "\n...";
|
|
11
|
-
};
|
|
12
|
-
switch (block.type) {
|
|
13
|
-
case "text": {
|
|
14
|
-
const maxLines = isExpanded ? 50 : 10;
|
|
15
|
-
const truncatedContent = truncateText(block.content, maxLines);
|
|
16
|
-
return _jsx(Text, { children: truncatedContent });
|
|
17
|
-
}
|
|
18
|
-
case "error":
|
|
19
|
-
return _jsxs(Text, { color: "red", children: ["\u274C Error: ", block.content] });
|
|
20
|
-
case "tool":
|
|
21
|
-
return _jsx(ToolResultDisplay, { block: block, isExpanded: isExpanded });
|
|
22
|
-
default:
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export const SubagentBlock = ({ block, isExpanded = false, }) => {
|
|
3
|
+
import { useChat } from "../contexts/useChat.js";
|
|
4
|
+
export const SubagentBlock = ({ block }) => {
|
|
5
|
+
const { subagentMessages } = useChat();
|
|
6
|
+
// Get messages for this subagent from context
|
|
7
|
+
const messages = subagentMessages[block.subagentId] || [];
|
|
27
8
|
// Status indicator mapping
|
|
28
9
|
const getStatusIndicator = (status) => {
|
|
29
10
|
switch (status) {
|
|
@@ -40,9 +21,27 @@ export const SubagentBlock = ({ block, isExpanded = false, }) => {
|
|
|
40
21
|
}
|
|
41
22
|
};
|
|
42
23
|
const statusInfo = getStatusIndicator(block.status);
|
|
43
|
-
//
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
// Find the last 2 tool names and their compact params, and count total tools
|
|
25
|
+
const getLastTwoTools = () => {
|
|
26
|
+
const tools = [];
|
|
27
|
+
let totalToolCount = 0;
|
|
28
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
29
|
+
const message = messages[i];
|
|
30
|
+
for (let j = message.blocks.length - 1; j >= 0; j--) {
|
|
31
|
+
const messageBlock = message.blocks[j];
|
|
32
|
+
if (messageBlock.type === "tool" && messageBlock.name) {
|
|
33
|
+
totalToolCount++;
|
|
34
|
+
if (tools.length < 2) {
|
|
35
|
+
tools.push({
|
|
36
|
+
name: messageBlock.name,
|
|
37
|
+
compactParams: messageBlock.compactParams,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return { tools: tools.reverse(), totalToolCount }; // Reverse to show oldest first, newest last
|
|
44
|
+
};
|
|
45
|
+
const { tools: lastTwoTools, totalToolCount } = getLastTwoTools();
|
|
46
|
+
return (_jsxs(Box, { borderRight: false, borderTop: false, borderBottom: false, borderStyle: "classic", borderColor: "magenta", paddingX: 1, paddingY: 0, flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { flexDirection: "row", gap: 1, children: _jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsxs(Text, { color: "cyan", children: ["\uD83E\uDD16 ", block.subagentName] }), _jsxs(Text, { color: statusInfo.color, dimColor: false, children: [" ", statusInfo.icon] }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", "(", messages.length, " messages)"] })] }) }), lastTwoTools.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, gap: 1, children: [totalToolCount > 2 && (_jsx(Text, { color: "gray", dimColor: true, children: "..." })), lastTwoTools.map((tool, index) => (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: "magenta", children: "\uD83D\uDD27 " }), _jsx(Text, { color: "white", children: tool.name }), tool.compactParams && (_jsxs(Text, { color: "gray", children: [" ", tool.compactParams] }))] }, index)))] }))] }));
|
|
48
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolResultDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ToolResultDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolResultDisplay.d.ts","sourceRoot":"","sources":["../../src/components/ToolResultDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmI9D,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
|
+
import { DiffDisplay } from "./DiffDisplay.js";
|
|
3
4
|
export const ToolResultDisplay = ({ block, isExpanded = false, }) => {
|
|
4
|
-
const { parameters, result, compactParams,
|
|
5
|
+
const { parameters, result, compactParams, stage, success, error, name } = block;
|
|
5
6
|
// Directly use compactParams
|
|
6
7
|
// (no change needed as we destructured it above)
|
|
7
8
|
const getStatusColor = () => {
|
|
8
|
-
if (
|
|
9
|
+
if (stage === "running")
|
|
9
10
|
return "yellow";
|
|
10
11
|
if (success)
|
|
11
12
|
return "green";
|
|
@@ -14,12 +15,12 @@ export const ToolResultDisplay = ({ block, isExpanded = false, }) => {
|
|
|
14
15
|
return "gray"; // Unknown state or no state information
|
|
15
16
|
};
|
|
16
17
|
const getStatusText = () => {
|
|
17
|
-
if (
|
|
18
|
+
if (stage === "running")
|
|
18
19
|
return "🔄";
|
|
19
20
|
if (success)
|
|
20
21
|
return "";
|
|
21
22
|
if (error || success === false)
|
|
22
|
-
return "❌
|
|
23
|
+
return "❌";
|
|
23
24
|
return ""; // Don't display text for unknown state
|
|
24
25
|
};
|
|
25
26
|
const hasImages = () => {
|
|
@@ -48,5 +49,5 @@ export const ToolResultDisplay = ({ block, isExpanded = false, }) => {
|
|
|
48
49
|
return null;
|
|
49
50
|
};
|
|
50
51
|
const shortResult = getShortResult();
|
|
51
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "magenta", children: "\uD83D\uDD27 " }), _jsx(Text, { color: "white", children: toolName }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: ["
|
|
52
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "magenta", children: "\uD83D\uDD27 " }), _jsx(Text, { color: "white", children: toolName }), !isExpanded && compactParams && (_jsxs(Text, { color: "gray", children: [" ", compactParams] })), _jsxs(Text, { color: getStatusColor(), children: [" ", getStatusText()] }), hasImages() && _jsxs(Text, { color: "blue", children: [" ", getImageIndicator()] })] }), !isExpanded && shortResult && !error && (_jsx(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: shortResult.split("\n").map((line, index) => (_jsx(Text, { color: "white", children: line }, index))) })), isExpanded && parameters && (_jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "gray", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Parameters:" }), _jsx(Text, { color: "gray", children: parameters })] })), isExpanded && result && (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { paddingLeft: 2, borderLeft: true, borderColor: "green", flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Result:" }), _jsx(Text, { color: "white", children: result })] }) })), error && (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", typeof error === "string" ? error : String(error)] }) })), _jsx(DiffDisplay, { toolBlock: block })] }));
|
|
52
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { Message, McpServerStatus, BackgroundShell, SlashCommand,
|
|
2
|
+
import type { Message, McpServerStatus, BackgroundShell, SlashCommand, PermissionDecision, PermissionMode } from "wave-agent-sdk";
|
|
3
3
|
export interface ChatContextType {
|
|
4
4
|
messages: Message[];
|
|
5
5
|
isLoading: boolean;
|
|
@@ -27,11 +27,23 @@ export interface ChatContextType {
|
|
|
27
27
|
killBackgroundShell: (shellId: string) => boolean;
|
|
28
28
|
slashCommands: SlashCommand[];
|
|
29
29
|
hasSlashCommand: (commandId: string) => boolean;
|
|
30
|
-
|
|
30
|
+
subagentMessages: Record<string, Message[]>;
|
|
31
|
+
permissionMode: PermissionMode;
|
|
32
|
+
setPermissionMode: (mode: PermissionMode) => void;
|
|
33
|
+
isConfirmationVisible: boolean;
|
|
34
|
+
confirmingTool?: {
|
|
35
|
+
name: string;
|
|
36
|
+
input?: Record<string, unknown>;
|
|
37
|
+
};
|
|
38
|
+
showConfirmation: (toolName: string, toolInput?: Record<string, unknown>) => Promise<PermissionDecision>;
|
|
39
|
+
hideConfirmation: () => void;
|
|
40
|
+
handleConfirmationDecision: (decision: PermissionDecision) => void;
|
|
41
|
+
handleConfirmationCancel: () => void;
|
|
31
42
|
}
|
|
32
43
|
export declare const useChat: () => ChatContextType;
|
|
33
44
|
export interface ChatProviderProps {
|
|
34
45
|
children: React.ReactNode;
|
|
46
|
+
bypassPermissions?: boolean;
|
|
35
47
|
}
|
|
36
48
|
export declare const ChatProvider: React.FC<ChatProviderProps>;
|
|
37
49
|
//# 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,eAAe,EACf,YAAY,EACZ,
|
|
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,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAUxB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,UAAU,EAAE,OAAO,CAAC;IAEpB,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;IAE1B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,mBAAmB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9D,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,wBAAwB,EAAE,CACxB,OAAO,EAAE,MAAM,KACZ;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAElD,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAEhD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAE5C,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAElD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACnE,gBAAgB,EAAE,CAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,0BAA0B,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACnE,wBAAwB,EAAE,MAAM,IAAI,CAAC;CACtC;AAID,eAAO,MAAM,OAAO,uBAMnB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqZpD,CAAC"}
|