wave-code 0.4.0 → 0.6.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/commands/plugin/uninstall.js +1 -1
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +38 -2
- package/dist/components/BackgroundTaskManager.d.ts +6 -0
- package/dist/components/BackgroundTaskManager.d.ts.map +1 -0
- package/dist/components/BackgroundTaskManager.js +114 -0
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +39 -5
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +13 -5
- package/dist/components/CompressDisplay.d.ts.map +1 -1
- package/dist/components/CompressDisplay.js +6 -10
- package/dist/components/ConfirmationDetails.d.ts +9 -0
- package/dist/components/ConfirmationDetails.d.ts.map +1 -0
- package/dist/components/ConfirmationDetails.js +53 -0
- package/dist/components/{Confirmation.d.ts → ConfirmationSelector.d.ts} +3 -3
- package/dist/components/ConfirmationSelector.d.ts.map +1 -0
- package/dist/components/{Confirmation.js → ConfirmationSelector.js} +92 -101
- package/dist/components/DiffDisplay.d.ts +0 -1
- package/dist/components/DiffDisplay.d.ts.map +1 -1
- package/dist/components/DiffDisplay.js +82 -60
- package/dist/components/FileSelector.d.ts.map +1 -1
- package/dist/components/FileSelector.js +2 -2
- package/dist/components/HistorySearch.d.ts.map +1 -1
- package/dist/components/HistorySearch.js +12 -4
- package/dist/components/InputBox.d.ts +1 -3
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +9 -18
- package/dist/components/LoadingIndicator.d.ts +11 -0
- package/dist/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/components/LoadingIndicator.js +6 -0
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown.js +114 -120
- package/dist/components/MessageItem.d.ts.map +1 -1
- package/dist/components/MessageItem.js +1 -2
- package/dist/components/MessageList.d.ts +2 -3
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +7 -7
- package/dist/components/PlanDisplay.d.ts.map +1 -1
- package/dist/components/PlanDisplay.js +4 -12
- package/dist/components/PluginDetail.js +1 -1
- package/dist/components/RewindCommand.d.ts +4 -0
- package/dist/components/RewindCommand.d.ts.map +1 -1
- package/dist/components/RewindCommand.js +19 -2
- package/dist/components/SubagentBlock.d.ts.map +1 -1
- package/dist/components/SubagentBlock.js +12 -5
- package/dist/components/TaskList.d.ts +3 -0
- package/dist/components/TaskList.d.ts.map +1 -0
- package/dist/components/TaskList.js +49 -0
- package/dist/components/ToolResultDisplay.d.ts.map +1 -1
- package/dist/components/ToolResultDisplay.js +2 -1
- package/dist/contexts/useChat.d.ts +15 -6
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +52 -43
- package/dist/hooks/useInputManager.d.ts +2 -13
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +8 -57
- package/dist/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/hooks/usePluginManager.js +8 -4
- package/dist/hooks/useTasks.d.ts +2 -0
- package/dist/hooks/useTasks.d.ts.map +1 -0
- package/dist/hooks/useTasks.js +5 -0
- package/dist/managers/InputManager.d.ts +5 -28
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +26 -127
- package/package.json +9 -10
- package/src/commands/plugin/uninstall.ts +1 -1
- package/src/components/App.tsx +50 -3
- package/src/components/{BashShellManager.tsx → BackgroundTaskManager.tsx} +79 -73
- package/src/components/ChatInterface.tsx +79 -23
- package/src/components/CommandSelector.tsx +38 -20
- package/src/components/CompressDisplay.tsx +5 -22
- package/src/components/ConfirmationDetails.tsx +108 -0
- package/src/components/{Confirmation.tsx → ConfirmationSelector.tsx} +162 -187
- package/src/components/DiffDisplay.tsx +122 -107
- package/src/components/FileSelector.tsx +0 -2
- package/src/components/HistorySearch.tsx +45 -21
- package/src/components/InputBox.tsx +14 -34
- package/src/components/LoadingIndicator.tsx +56 -0
- package/src/components/Markdown.tsx +126 -318
- package/src/components/MessageItem.tsx +1 -3
- package/src/components/MessageList.tsx +10 -67
- package/src/components/PlanDisplay.tsx +5 -33
- package/src/components/PluginDetail.tsx +1 -1
- package/src/components/RewindCommand.tsx +38 -1
- package/src/components/SubagentBlock.tsx +28 -14
- package/src/components/TaskList.tsx +70 -0
- package/src/components/ToolResultDisplay.tsx +6 -2
- package/src/contexts/useChat.tsx +82 -60
- package/src/hooks/useInputManager.ts +9 -73
- package/src/hooks/usePluginManager.ts +10 -4
- package/src/hooks/useTasks.ts +6 -0
- package/src/managers/InputManager.ts +30 -157
- package/dist/components/BashShellManager.d.ts +0 -6
- package/dist/components/BashShellManager.d.ts.map +0 -1
- package/dist/components/BashShellManager.js +0 -116
- package/dist/components/Confirmation.d.ts.map +0 -1
- package/dist/components/MemoryDisplay.d.ts +0 -8
- package/dist/components/MemoryDisplay.d.ts.map +0 -1
- package/dist/components/MemoryDisplay.js +0 -25
- package/dist/components/MemoryTypeSelector.d.ts +0 -8
- package/dist/components/MemoryTypeSelector.d.ts.map +0 -1
- package/dist/components/MemoryTypeSelector.js +0 -38
- package/src/components/MemoryDisplay.tsx +0 -62
- package/src/components/MemoryTypeSelector.tsx +0 -98
|
@@ -12,11 +12,7 @@ export interface InputManagerCallbacks {
|
|
|
12
12
|
onFileSelectorStateChange?: (show: boolean, files: FileItem[], query: string, position: number) => void;
|
|
13
13
|
onCommandSelectorStateChange?: (show: boolean, query: string, position: number) => void;
|
|
14
14
|
onHistorySearchStateChange?: (show: boolean, query: string) => void;
|
|
15
|
-
|
|
16
|
-
onShowBashManager?: () => void;
|
|
17
|
-
onShowMcpManager?: () => void;
|
|
18
|
-
onShowRewindManager?: () => void;
|
|
19
|
-
onBashManagerStateChange?: (show: boolean) => void;
|
|
15
|
+
onBackgroundTaskManagerStateChange?: (show: boolean) => void;
|
|
20
16
|
onMcpManagerStateChange?: (show: boolean) => void;
|
|
21
17
|
onRewindManagerStateChange?: (show: boolean) => void;
|
|
22
18
|
onImagesStateChange?: (images: AttachedImage[]) => void;
|
|
@@ -25,8 +21,8 @@ export interface InputManagerCallbacks {
|
|
|
25
21
|
mimeType: string;
|
|
26
22
|
}>) => void | Promise<void>;
|
|
27
23
|
onHasSlashCommand?: (commandId: string) => boolean;
|
|
28
|
-
onSaveMemory?: (message: string, type: "project" | "user") => Promise<void>;
|
|
29
24
|
onAbortMessage?: () => void;
|
|
25
|
+
onBackgroundCurrentTask?: () => void;
|
|
30
26
|
onResetHistoryNavigation?: () => void;
|
|
31
27
|
onPermissionModeChange?: (mode: PermissionMode) => void;
|
|
32
28
|
logger?: Logger;
|
|
@@ -44,11 +40,6 @@ export declare class InputManager {
|
|
|
44
40
|
private commandSearchQuery;
|
|
45
41
|
private showHistorySearch;
|
|
46
42
|
private historySearchQuery;
|
|
47
|
-
private showMemoryTypeSelector;
|
|
48
|
-
private memoryMessage;
|
|
49
|
-
private userInputHistory;
|
|
50
|
-
private historyIndex;
|
|
51
|
-
private historyBuffer;
|
|
52
43
|
private pasteDebounceTimer;
|
|
53
44
|
private pasteBuffer;
|
|
54
45
|
private initialPasteCursorPosition;
|
|
@@ -57,7 +48,7 @@ export declare class InputManager {
|
|
|
57
48
|
private longTextMap;
|
|
58
49
|
private attachedImages;
|
|
59
50
|
private imageIdCounter;
|
|
60
|
-
private
|
|
51
|
+
private showBackgroundTaskManager;
|
|
61
52
|
private showMcpManager;
|
|
62
53
|
private showRewindManager;
|
|
63
54
|
private permissionMode;
|
|
@@ -99,18 +90,8 @@ export declare class InputManager {
|
|
|
99
90
|
};
|
|
100
91
|
handleCancelCommandSelect(): void;
|
|
101
92
|
checkForSlashDeletion(cursorPosition: number): boolean;
|
|
102
|
-
activateMemoryTypeSelector(message: string): void;
|
|
103
|
-
handleMemoryTypeSelect(type: "project" | "user"): Promise<void>;
|
|
104
|
-
handleCancelMemoryTypeSelect(): void;
|
|
105
|
-
setUserInputHistory(history: string[]): void;
|
|
106
|
-
navigateHistory(direction: "up" | "down", currentInput: string): {
|
|
107
|
-
newInput: string;
|
|
108
|
-
newCursorPosition: number;
|
|
109
|
-
};
|
|
110
|
-
resetHistoryNavigation(): void;
|
|
111
93
|
isFileSelectorActive(): boolean;
|
|
112
94
|
isCommandSelectorActive(): boolean;
|
|
113
|
-
isMemoryTypeSelectorActive(): boolean;
|
|
114
95
|
getFileSelectorState(): {
|
|
115
96
|
show: boolean;
|
|
116
97
|
files: FileItem[];
|
|
@@ -122,10 +103,6 @@ export declare class InputManager {
|
|
|
122
103
|
query: string;
|
|
123
104
|
position: number;
|
|
124
105
|
};
|
|
125
|
-
getMemoryTypeSelectorState(): {
|
|
126
|
-
show: boolean;
|
|
127
|
-
message: string;
|
|
128
|
-
};
|
|
129
106
|
private updateSearchQueriesForActiveSelectors;
|
|
130
107
|
handleSpecialCharInput(char: string): void;
|
|
131
108
|
generateCompressedText(originalText: string): string;
|
|
@@ -137,8 +114,8 @@ export declare class InputManager {
|
|
|
137
114
|
clearImages(): void;
|
|
138
115
|
getAttachedImages(): AttachedImage[];
|
|
139
116
|
handlePasteImage(): Promise<boolean>;
|
|
140
|
-
|
|
141
|
-
|
|
117
|
+
getShowBackgroundTaskManager(): boolean;
|
|
118
|
+
setShowBackgroundTaskManager(show: boolean): void;
|
|
142
119
|
getShowMcpManager(): boolean;
|
|
143
120
|
setShowMcpManager(show: boolean): void;
|
|
144
121
|
getShowRewindManager(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputManager.d.ts","sourceRoot":"","sources":["../../src/managers/InputManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAEL,cAAc,EACd,MAAM,EAEP,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;I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ACrE,SAAS,GAAE,OAAe,EAC1B,gBAAgB,GAAE,OAAe,EACjC,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,OAAO,CAAC;IA4Fb,WAAW,CACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,EACrE,SAAS,GAAE,OAAe,EAC1B,gBAAgB,GAAE,OAAe,EACjC,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,OAAO,CAAC;IA6EnB,OAAO,IAAI,IAAI;CAUhB"}
|
|
@@ -18,13 +18,6 @@ export class InputManager {
|
|
|
18
18
|
// History search state
|
|
19
19
|
this.showHistorySearch = false;
|
|
20
20
|
this.historySearchQuery = "";
|
|
21
|
-
// Memory type selector state
|
|
22
|
-
this.showMemoryTypeSelector = false;
|
|
23
|
-
this.memoryMessage = "";
|
|
24
|
-
// Input history state
|
|
25
|
-
this.userInputHistory = [];
|
|
26
|
-
this.historyIndex = -1;
|
|
27
|
-
this.historyBuffer = "";
|
|
28
21
|
// Paste debounce state
|
|
29
22
|
this.pasteDebounceTimer = null;
|
|
30
23
|
this.pasteBuffer = "";
|
|
@@ -37,7 +30,7 @@ export class InputManager {
|
|
|
37
30
|
this.attachedImages = [];
|
|
38
31
|
this.imageIdCounter = 1;
|
|
39
32
|
// Additional UI state
|
|
40
|
-
this.
|
|
33
|
+
this.showBackgroundTaskManager = false;
|
|
41
34
|
this.showMcpManager = false;
|
|
42
35
|
this.showRewindManager = false;
|
|
43
36
|
// Permission mode state
|
|
@@ -220,17 +213,16 @@ export class InputManager {
|
|
|
220
213
|
}
|
|
221
214
|
// If not an agent command or execution failed, check local commands
|
|
222
215
|
if (!commandExecuted) {
|
|
223
|
-
if (command === "
|
|
224
|
-
this.
|
|
216
|
+
if (command === "tasks") {
|
|
217
|
+
this.setShowBackgroundTaskManager(true);
|
|
225
218
|
commandExecuted = true;
|
|
226
219
|
}
|
|
227
|
-
else if (command === "mcp"
|
|
228
|
-
this.
|
|
220
|
+
else if (command === "mcp") {
|
|
221
|
+
this.setShowMcpManager(true);
|
|
229
222
|
commandExecuted = true;
|
|
230
223
|
}
|
|
231
|
-
else if (command === "rewind"
|
|
232
|
-
this.
|
|
233
|
-
this.callbacks.onShowRewindManager();
|
|
224
|
+
else if (command === "rewind") {
|
|
225
|
+
this.setShowRewindManager(true);
|
|
234
226
|
commandExecuted = true;
|
|
235
227
|
}
|
|
236
228
|
}
|
|
@@ -280,79 +272,6 @@ export class InputManager {
|
|
|
280
272
|
}
|
|
281
273
|
return false;
|
|
282
274
|
}
|
|
283
|
-
// Memory type selector methods
|
|
284
|
-
activateMemoryTypeSelector(message) {
|
|
285
|
-
this.showMemoryTypeSelector = true;
|
|
286
|
-
this.memoryMessage = message;
|
|
287
|
-
this.callbacks.onMemoryTypeSelectorStateChange?.(true, message);
|
|
288
|
-
}
|
|
289
|
-
async handleMemoryTypeSelect(type) {
|
|
290
|
-
const currentMessage = this.inputText.trim();
|
|
291
|
-
if (currentMessage.startsWith("#")) {
|
|
292
|
-
await this.callbacks.onSaveMemory?.(currentMessage, type);
|
|
293
|
-
}
|
|
294
|
-
// Close the selector
|
|
295
|
-
this.showMemoryTypeSelector = false;
|
|
296
|
-
this.memoryMessage = "";
|
|
297
|
-
this.callbacks.onMemoryTypeSelectorStateChange?.(false, "");
|
|
298
|
-
// Clear input box
|
|
299
|
-
this.clearInput();
|
|
300
|
-
}
|
|
301
|
-
handleCancelMemoryTypeSelect() {
|
|
302
|
-
this.showMemoryTypeSelector = false;
|
|
303
|
-
this.memoryMessage = "";
|
|
304
|
-
this.callbacks.onMemoryTypeSelectorStateChange?.(false, "");
|
|
305
|
-
}
|
|
306
|
-
// Input history methods
|
|
307
|
-
setUserInputHistory(history) {
|
|
308
|
-
this.userInputHistory = history;
|
|
309
|
-
}
|
|
310
|
-
navigateHistory(direction, currentInput) {
|
|
311
|
-
if (this.historyIndex === -1) {
|
|
312
|
-
this.historyBuffer = currentInput;
|
|
313
|
-
}
|
|
314
|
-
if (direction === "up") {
|
|
315
|
-
if (this.historyIndex < this.userInputHistory.length - 1) {
|
|
316
|
-
this.historyIndex++;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
// Down direction
|
|
321
|
-
if (this.historyIndex > 0) {
|
|
322
|
-
this.historyIndex--;
|
|
323
|
-
}
|
|
324
|
-
else if (this.historyIndex === 0) {
|
|
325
|
-
// Go from first history item to draft
|
|
326
|
-
this.historyIndex = -1;
|
|
327
|
-
}
|
|
328
|
-
else if (this.historyIndex === -1) {
|
|
329
|
-
// Go from draft to empty (beyond history bottom)
|
|
330
|
-
this.historyIndex = -2;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
let newInput;
|
|
334
|
-
if (this.historyIndex === -1) {
|
|
335
|
-
newInput = this.historyBuffer;
|
|
336
|
-
}
|
|
337
|
-
else if (this.historyIndex === -2) {
|
|
338
|
-
// Beyond history bottom, clear input
|
|
339
|
-
newInput = "";
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
const historyItem = this.userInputHistory[this.userInputHistory.length - 1 - this.historyIndex];
|
|
343
|
-
newInput = historyItem || "";
|
|
344
|
-
}
|
|
345
|
-
const newCursorPosition = newInput.length;
|
|
346
|
-
this.inputText = newInput;
|
|
347
|
-
this.cursorPosition = newCursorPosition;
|
|
348
|
-
this.callbacks.onInputTextChange?.(newInput);
|
|
349
|
-
this.callbacks.onCursorPositionChange?.(newCursorPosition);
|
|
350
|
-
return { newInput, newCursorPosition };
|
|
351
|
-
}
|
|
352
|
-
resetHistoryNavigation() {
|
|
353
|
-
this.historyIndex = -1;
|
|
354
|
-
this.historyBuffer = "";
|
|
355
|
-
}
|
|
356
275
|
// Getter methods for state
|
|
357
276
|
isFileSelectorActive() {
|
|
358
277
|
return this.showFileSelector;
|
|
@@ -360,9 +279,6 @@ export class InputManager {
|
|
|
360
279
|
isCommandSelectorActive() {
|
|
361
280
|
return this.showCommandSelector;
|
|
362
281
|
}
|
|
363
|
-
isMemoryTypeSelectorActive() {
|
|
364
|
-
return this.showMemoryTypeSelector;
|
|
365
|
-
}
|
|
366
282
|
getFileSelectorState() {
|
|
367
283
|
return {
|
|
368
284
|
show: this.showFileSelector,
|
|
@@ -378,12 +294,6 @@ export class InputManager {
|
|
|
378
294
|
position: this.slashPosition,
|
|
379
295
|
};
|
|
380
296
|
}
|
|
381
|
-
getMemoryTypeSelectorState() {
|
|
382
|
-
return {
|
|
383
|
-
show: this.showMemoryTypeSelector,
|
|
384
|
-
message: this.memoryMessage,
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
297
|
// Update search queries for active selectors
|
|
388
298
|
updateSearchQueriesForActiveSelectors(inputText, cursorPosition) {
|
|
389
299
|
if (this.showFileSelector && this.atPosition >= 0) {
|
|
@@ -411,9 +321,6 @@ export class InputManager {
|
|
|
411
321
|
// Only activate command selector if '/' is at the start of input
|
|
412
322
|
this.activateCommandSelector(this.cursorPosition - 1);
|
|
413
323
|
}
|
|
414
|
-
else if (char === "#" && this.cursorPosition === 1) {
|
|
415
|
-
// Memory message detection will be handled in submit
|
|
416
|
-
}
|
|
417
324
|
else {
|
|
418
325
|
// Update search queries for active selectors
|
|
419
326
|
this.updateSearchQueriesForActiveSelectors(this.inputText, this.cursorPosition);
|
|
@@ -538,13 +445,13 @@ export class InputManager {
|
|
|
538
445
|
return false;
|
|
539
446
|
}
|
|
540
447
|
}
|
|
541
|
-
//
|
|
542
|
-
|
|
543
|
-
return this.
|
|
448
|
+
// Task manager state methods
|
|
449
|
+
getShowBackgroundTaskManager() {
|
|
450
|
+
return this.showBackgroundTaskManager;
|
|
544
451
|
}
|
|
545
|
-
|
|
546
|
-
this.
|
|
547
|
-
this.callbacks.
|
|
452
|
+
setShowBackgroundTaskManager(show) {
|
|
453
|
+
this.showBackgroundTaskManager = show;
|
|
454
|
+
this.callbacks.onBackgroundTaskManagerStateChange?.(show);
|
|
548
455
|
}
|
|
549
456
|
getShowMcpManager() {
|
|
550
457
|
return this.showMcpManager;
|
|
@@ -586,13 +493,6 @@ export class InputManager {
|
|
|
586
493
|
return;
|
|
587
494
|
}
|
|
588
495
|
if (this.inputText.trim()) {
|
|
589
|
-
const trimmedInput = this.inputText.trim();
|
|
590
|
-
// Check if it's a memory message (starts with # and only one line)
|
|
591
|
-
if (trimmedInput.startsWith("#") && !trimmedInput.includes("\n")) {
|
|
592
|
-
// Activate memory type selector
|
|
593
|
-
this.activateMemoryTypeSelector(trimmedInput);
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
496
|
// Extract image information
|
|
597
497
|
const imageRegex = /\[Image #(\d+)\]/g;
|
|
598
498
|
const matches = [...this.inputText.matchAll(imageRegex)];
|
|
@@ -734,13 +634,9 @@ export class InputManager {
|
|
|
734
634
|
this.activateHistorySearch();
|
|
735
635
|
return true;
|
|
736
636
|
}
|
|
737
|
-
// Handle
|
|
738
|
-
if (key.
|
|
739
|
-
this.
|
|
740
|
-
return true;
|
|
741
|
-
}
|
|
742
|
-
if (key.downArrow && !this.showFileSelector && !this.showCommandSelector) {
|
|
743
|
-
this.navigateHistory("down", this.inputText);
|
|
637
|
+
// Handle Ctrl+B for backgrounding current task
|
|
638
|
+
if (key.ctrl && input === "b") {
|
|
639
|
+
this.callbacks.onBackgroundCurrentTask?.();
|
|
744
640
|
return true;
|
|
745
641
|
}
|
|
746
642
|
// Handle typing input
|
|
@@ -768,7 +664,11 @@ export class InputManager {
|
|
|
768
664
|
return true;
|
|
769
665
|
}
|
|
770
666
|
// Handle interrupt request - use Esc key to interrupt AI request or command
|
|
771
|
-
if (key.escape &&
|
|
667
|
+
if (key.escape &&
|
|
668
|
+
(isLoading || isCommandRunning) &&
|
|
669
|
+
!this.showBackgroundTaskManager &&
|
|
670
|
+
!this.showMcpManager &&
|
|
671
|
+
!this.showRewindManager) {
|
|
772
672
|
// Unified interrupt for AI message generation and command execution
|
|
773
673
|
this.callbacks.onAbortMessage?.();
|
|
774
674
|
return true;
|
|
@@ -783,16 +683,15 @@ export class InputManager {
|
|
|
783
683
|
if (this.showFileSelector ||
|
|
784
684
|
this.showCommandSelector ||
|
|
785
685
|
this.showHistorySearch ||
|
|
786
|
-
this.
|
|
787
|
-
this.showBashManager ||
|
|
686
|
+
this.showBackgroundTaskManager ||
|
|
788
687
|
this.showMcpManager ||
|
|
789
688
|
this.showRewindManager) {
|
|
790
|
-
if (this.
|
|
791
|
-
this.showBashManager ||
|
|
689
|
+
if (this.showBackgroundTaskManager ||
|
|
792
690
|
this.showMcpManager ||
|
|
793
691
|
this.showRewindManager) {
|
|
794
|
-
//
|
|
795
|
-
|
|
692
|
+
// Task manager, MCP manager and Rewind don't need to handle input, handled by component itself
|
|
693
|
+
// Return true to indicate we've "handled" it (by ignoring it) so it doesn't leak to normal input
|
|
694
|
+
return true;
|
|
796
695
|
}
|
|
797
696
|
if (this.showHistorySearch) {
|
|
798
697
|
if (key.escape) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,27 +30,26 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
|
-
"cli-highlight": "^2.1.11",
|
|
34
33
|
"diff": "^8.0.2",
|
|
35
34
|
"glob": "^13.0.0",
|
|
36
|
-
"ink": "^6.
|
|
37
|
-
"marked": "^
|
|
35
|
+
"ink": "^6.7.0",
|
|
36
|
+
"marked": "^17.0.2",
|
|
38
37
|
"react": "^19.2.4",
|
|
39
38
|
"react-dom": "19.2.4",
|
|
40
39
|
"yargs": "^17.7.2",
|
|
41
|
-
"wave-agent-sdk": "0.
|
|
40
|
+
"wave-agent-sdk": "0.6.1"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@types/react": "^19.1.8",
|
|
45
44
|
"@types/yargs": "^17.0.0",
|
|
46
|
-
"@vitest/coverage-v8": "^
|
|
45
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
47
46
|
"eslint-plugin-react": "^7.37.5",
|
|
48
47
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
49
48
|
"ink-testing-library": "^4.0.0",
|
|
50
49
|
"rimraf": "^6.1.2",
|
|
51
50
|
"tsc-alias": "^1.8.16",
|
|
52
51
|
"tsx": "^4.20.4",
|
|
53
|
-
"vitest": "^
|
|
52
|
+
"vitest": "^4.0.18"
|
|
54
53
|
},
|
|
55
54
|
"peerDependencies": {
|
|
56
55
|
"react": ">=18.0.0"
|
|
@@ -60,12 +59,12 @@
|
|
|
60
59
|
},
|
|
61
60
|
"license": "MIT",
|
|
62
61
|
"scripts": {
|
|
63
|
-
"wave": "tsx src/index.ts",
|
|
62
|
+
"wave": "tsx --tsconfig tsconfig.dev.json src/index.ts",
|
|
64
63
|
"build": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
65
64
|
"type-check": "tsc --noEmit --incremental",
|
|
66
65
|
"watch": "tsc -p tsconfig.build.json --watch & tsc-alias -p tsconfig.build.json --watch",
|
|
67
|
-
"test": "vitest run",
|
|
68
|
-
"test:coverage": "vitest run --coverage",
|
|
66
|
+
"test": "vitest run --reporter=dot",
|
|
67
|
+
"test:coverage": "vitest run --coverage --reporter=dot",
|
|
69
68
|
"lint": "eslint --cache",
|
|
70
69
|
"format": "prettier --write .",
|
|
71
70
|
"version:patch": "node ../../scripts/version.js patch",
|
|
@@ -10,7 +10,7 @@ export async function uninstallPluginCommand(argv: { plugin: string }) {
|
|
|
10
10
|
const workdir = process.cwd();
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
|
-
await marketplaceService.uninstallPlugin(argv.plugin);
|
|
13
|
+
await marketplaceService.uninstallPlugin(argv.plugin, workdir);
|
|
14
14
|
console.log(`Successfully uninstalled plugin: ${argv.plugin}`);
|
|
15
15
|
|
|
16
16
|
const configurationService = new ConfigurationService();
|
package/src/components/App.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import { useStdout } from "ink";
|
|
2
3
|
import { ChatInterface } from "./ChatInterface.js";
|
|
3
|
-
import { ChatProvider } from "../contexts/useChat.js";
|
|
4
|
+
import { ChatProvider, useChat } from "../contexts/useChat.js";
|
|
4
5
|
import { AppProvider } from "../contexts/useAppConfig.js";
|
|
5
6
|
|
|
6
7
|
interface AppProps {
|
|
@@ -16,11 +17,57 @@ const AppWithProviders: React.FC<{
|
|
|
16
17
|
}> = ({ bypassPermissions, pluginDirs }) => {
|
|
17
18
|
return (
|
|
18
19
|
<ChatProvider bypassPermissions={bypassPermissions} pluginDirs={pluginDirs}>
|
|
19
|
-
<
|
|
20
|
+
<ChatInterfaceWithRemount />
|
|
20
21
|
</ChatProvider>
|
|
21
22
|
);
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const ChatInterfaceWithRemount: React.FC = () => {
|
|
26
|
+
const { stdout } = useStdout();
|
|
27
|
+
const { isExpanded, rewindId, wasLastDetailsTooTall, sessionId } = useChat();
|
|
28
|
+
|
|
29
|
+
const [remountKey, setRemountKey] = useState(
|
|
30
|
+
String(isExpanded) + rewindId + wasLastDetailsTooTall,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const prevSessionId = useRef(sessionId);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
let newKey = String(isExpanded) + rewindId + wasLastDetailsTooTall;
|
|
37
|
+
|
|
38
|
+
const isSessionChanged =
|
|
39
|
+
prevSessionId.current && sessionId && prevSessionId.current !== sessionId;
|
|
40
|
+
|
|
41
|
+
if (isSessionChanged) {
|
|
42
|
+
newKey += sessionId;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (newKey !== remountKey) {
|
|
46
|
+
stdout?.write("\u001b[2J\u001b[0;0H", (err?: Error | null) => {
|
|
47
|
+
if (err) {
|
|
48
|
+
console.error("Failed to clear terminal:", err);
|
|
49
|
+
}
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setRemountKey(newKey);
|
|
52
|
+
}, 100);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (sessionId) {
|
|
57
|
+
prevSessionId.current = sessionId;
|
|
58
|
+
}
|
|
59
|
+
}, [
|
|
60
|
+
isExpanded,
|
|
61
|
+
rewindId,
|
|
62
|
+
wasLastDetailsTooTall,
|
|
63
|
+
sessionId,
|
|
64
|
+
remountKey,
|
|
65
|
+
stdout,
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
return <ChatInterface key={remountKey} />;
|
|
69
|
+
};
|
|
70
|
+
|
|
24
71
|
export const App: React.FC<AppProps> = ({
|
|
25
72
|
restoreSessionId,
|
|
26
73
|
continueLastSession,
|