wave-code 0.2.1 → 0.5.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/commands/plugin/disable.d.ts +2 -1
- package/dist/commands/plugin/disable.d.ts.map +1 -1
- package/dist/commands/plugin/disable.js +3 -2
- package/dist/commands/plugin/enable.d.ts +2 -1
- package/dist/commands/plugin/enable.d.ts.map +1 -1
- package/dist/commands/plugin/enable.js +3 -2
- package/dist/commands/plugin/install.d.ts +2 -1
- package/dist/commands/plugin/install.d.ts.map +1 -1
- package/dist/commands/plugin/list.d.ts.map +1 -1
- package/dist/commands/plugin/list.js +15 -3
- package/dist/commands/plugin/marketplace.d.ts +3 -0
- package/dist/commands/plugin/marketplace.d.ts.map +1 -1
- package/dist/commands/plugin/marketplace.js +15 -1
- package/dist/commands/plugin/uninstall.d.ts +4 -0
- package/dist/commands/plugin/uninstall.d.ts.map +1 -0
- package/dist/commands/plugin/uninstall.js +29 -0
- package/dist/commands/plugin/update.d.ts +4 -0
- package/dist/commands/plugin/update.d.ts.map +1 -0
- package/dist/commands/plugin/update.js +15 -0
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +2 -2
- package/dist/components/CommandSelector.d.ts.map +1 -1
- package/dist/components/CommandSelector.js +9 -3
- package/dist/components/Confirmation.d.ts.map +1 -1
- package/dist/components/Confirmation.js +73 -20
- package/dist/components/DiffDisplay.d.ts +0 -1
- package/dist/components/DiffDisplay.d.ts.map +1 -1
- package/dist/components/DiffDisplay.js +38 -59
- package/dist/components/DiscoverView.d.ts +3 -0
- package/dist/components/DiscoverView.d.ts.map +1 -0
- package/dist/components/DiscoverView.js +25 -0
- package/dist/components/FileSelector.js +1 -1
- package/dist/components/HistorySearch.d.ts +8 -0
- package/dist/components/HistorySearch.d.ts.map +1 -0
- package/dist/components/HistorySearch.js +67 -0
- package/dist/components/InputBox.d.ts +1 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +29 -19
- package/dist/components/InstalledView.d.ts +3 -0
- package/dist/components/InstalledView.d.ts.map +1 -0
- package/dist/components/InstalledView.js +30 -0
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown.js +24 -10
- package/dist/components/MarketplaceAddForm.d.ts +3 -0
- package/dist/components/MarketplaceAddForm.d.ts.map +1 -0
- package/dist/components/MarketplaceAddForm.js +26 -0
- package/dist/components/MarketplaceDetail.d.ts +3 -0
- package/dist/components/MarketplaceDetail.d.ts.map +1 -0
- package/dist/components/MarketplaceDetail.js +38 -0
- package/dist/components/MarketplaceList.d.ts +9 -0
- package/dist/components/MarketplaceList.d.ts.map +1 -0
- package/dist/components/MarketplaceList.js +16 -0
- package/dist/components/MarketplaceView.d.ts +3 -0
- package/dist/components/MarketplaceView.d.ts.map +1 -0
- package/dist/components/MarketplaceView.js +28 -0
- package/dist/components/PlanDisplay.d.ts.map +1 -1
- package/dist/components/PlanDisplay.js +2 -2
- package/dist/components/PluginDetail.d.ts +3 -0
- package/dist/components/PluginDetail.d.ts.map +1 -0
- package/dist/components/PluginDetail.js +63 -0
- package/dist/components/PluginList.d.ts +14 -0
- package/dist/components/PluginList.d.ts.map +1 -0
- package/dist/components/PluginList.js +12 -0
- package/dist/components/PluginManagerShell.d.ts +5 -0
- package/dist/components/PluginManagerShell.d.ts.map +1 -0
- package/dist/components/PluginManagerShell.js +89 -0
- package/dist/components/PluginManagerTypes.d.ts +33 -0
- package/dist/components/PluginManagerTypes.d.ts.map +1 -0
- package/dist/components/PluginManagerTypes.js +1 -0
- package/dist/components/RewindCommand.d.ts +9 -0
- package/dist/components/RewindCommand.d.ts.map +1 -0
- package/dist/components/RewindCommand.js +42 -0
- package/dist/components/SessionSelector.d.ts +11 -0
- package/dist/components/SessionSelector.d.ts.map +1 -0
- package/dist/components/SessionSelector.js +38 -0
- package/dist/components/SubagentBlock.d.ts.map +1 -1
- package/dist/components/SubagentBlock.js +24 -1
- package/dist/components/TaskManager.d.ts +6 -0
- package/dist/components/TaskManager.d.ts.map +1 -0
- package/dist/components/TaskManager.js +114 -0
- package/dist/components/ToolResultDisplay.d.ts.map +1 -1
- package/dist/components/ToolResultDisplay.js +2 -1
- package/dist/contexts/PluginManagerContext.d.ts +4 -0
- package/dist/contexts/PluginManagerContext.d.ts.map +1 -0
- package/dist/contexts/PluginManagerContext.js +9 -0
- package/dist/contexts/useChat.d.ts +7 -4
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +37 -12
- package/dist/hooks/useInputManager.d.ts +8 -16
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +39 -55
- package/dist/hooks/usePluginManager.d.ts +3 -0
- package/dist/hooks/usePluginManager.d.ts.map +1 -0
- package/dist/hooks/usePluginManager.js +227 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +150 -177
- package/dist/managers/InputManager.d.ts +18 -26
- package/dist/managers/InputManager.d.ts.map +1 -1
- package/dist/managers/InputManager.js +93 -119
- package/dist/plugin-manager-cli.d.ts +6 -0
- package/dist/plugin-manager-cli.d.ts.map +1 -0
- package/dist/plugin-manager-cli.js +12 -0
- package/dist/session-selector-cli.d.ts +2 -0
- package/dist/session-selector-cli.d.ts.map +1 -0
- package/dist/session-selector-cli.js +25 -0
- package/package.json +9 -5
- package/src/commands/plugin/disable.ts +7 -3
- package/src/commands/plugin/enable.ts +7 -3
- package/src/commands/plugin/install.ts +2 -1
- package/src/commands/plugin/list.ts +21 -3
- package/src/commands/plugin/marketplace.ts +17 -1
- package/src/commands/plugin/uninstall.ts +39 -0
- package/src/commands/plugin/update.ts +19 -0
- package/src/components/ChatInterface.tsx +2 -1
- package/src/components/CommandSelector.tsx +10 -3
- package/src/components/Confirmation.tsx +115 -25
- package/src/components/DiffDisplay.tsx +60 -106
- package/src/components/DiscoverView.tsx +31 -0
- package/src/components/FileSelector.tsx +1 -1
- package/src/components/HistorySearch.tsx +148 -0
- package/src/components/InputBox.tsx +51 -34
- package/src/components/InstalledView.tsx +61 -0
- package/src/components/Markdown.tsx +44 -28
- package/src/components/MarketplaceAddForm.tsx +39 -0
- package/src/components/MarketplaceDetail.tsx +79 -0
- package/src/components/MarketplaceList.tsx +52 -0
- package/src/components/MarketplaceView.tsx +43 -0
- package/src/components/PlanDisplay.tsx +14 -19
- package/src/components/PluginDetail.tsx +147 -0
- package/src/components/PluginList.tsx +51 -0
- package/src/components/PluginManagerShell.tsx +189 -0
- package/src/components/PluginManagerTypes.ts +47 -0
- package/src/components/RewindCommand.tsx +114 -0
- package/src/components/SessionSelector.tsx +127 -0
- package/src/components/SubagentBlock.tsx +34 -1
- package/src/components/{BashShellManager.tsx → TaskManager.tsx} +79 -75
- package/src/components/ToolResultDisplay.tsx +6 -2
- package/src/contexts/PluginManagerContext.ts +15 -0
- package/src/contexts/useChat.tsx +51 -20
- package/src/hooks/useInputManager.ts +39 -71
- package/src/hooks/usePluginManager.ts +302 -0
- package/src/index.ts +241 -280
- package/src/managers/InputManager.ts +113 -162
- package/src/plugin-manager-cli.tsx +13 -0
- package/src/session-selector-cli.tsx +37 -0
- package/dist/components/BashHistorySelector.d.ts +0 -11
- package/dist/components/BashHistorySelector.d.ts.map +0 -1
- package/dist/components/BashHistorySelector.js +0 -93
- 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/hooks/usePagination.d.ts +0 -20
- package/dist/hooks/usePagination.d.ts.map +0 -1
- package/dist/hooks/usePagination.js +0 -168
- package/src/components/BashHistorySelector.tsx +0 -181
- package/src/hooks/usePagination.ts +0 -203
|
@@ -11,12 +11,14 @@ export interface InputManagerCallbacks {
|
|
|
11
11
|
onCursorPositionChange?: (position: number) => void;
|
|
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
15
|
onMemoryTypeSelectorStateChange?: (show: boolean, message: string) => void;
|
|
16
|
-
|
|
16
|
+
onShowTaskManager?: () => void;
|
|
17
|
+
onTaskManagerStateChange?: (show: boolean) => void;
|
|
17
18
|
onShowMcpManager?: () => void;
|
|
18
|
-
onBashManagerStateChange?: (show: boolean) => void;
|
|
19
19
|
onMcpManagerStateChange?: (show: boolean) => void;
|
|
20
|
+
onShowRewindManager?: () => void;
|
|
21
|
+
onRewindManagerStateChange?: (show: boolean) => void;
|
|
20
22
|
onImagesStateChange?: (images: AttachedImage[]) => void;
|
|
21
23
|
onSendMessage?: (content: string, images?: Array<{
|
|
22
24
|
path: string;
|
|
@@ -25,6 +27,7 @@ export interface InputManagerCallbacks {
|
|
|
25
27
|
onHasSlashCommand?: (commandId: string) => boolean;
|
|
26
28
|
onSaveMemory?: (message: string, type: "project" | "user") => Promise<void>;
|
|
27
29
|
onAbortMessage?: () => void;
|
|
30
|
+
onBackgroundCurrentTask?: () => void;
|
|
28
31
|
onResetHistoryNavigation?: () => void;
|
|
29
32
|
onPermissionModeChange?: (mode: PermissionMode) => void;
|
|
30
33
|
logger?: Logger;
|
|
@@ -40,9 +43,8 @@ export declare class InputManager {
|
|
|
40
43
|
private showCommandSelector;
|
|
41
44
|
private slashPosition;
|
|
42
45
|
private commandSearchQuery;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private bashHistorySearchQuery;
|
|
46
|
+
private showHistorySearch;
|
|
47
|
+
private historySearchQuery;
|
|
46
48
|
private showMemoryTypeSelector;
|
|
47
49
|
private memoryMessage;
|
|
48
50
|
private userInputHistory;
|
|
@@ -56,8 +58,9 @@ export declare class InputManager {
|
|
|
56
58
|
private longTextMap;
|
|
57
59
|
private attachedImages;
|
|
58
60
|
private imageIdCounter;
|
|
59
|
-
private
|
|
61
|
+
private showTaskManager;
|
|
60
62
|
private showMcpManager;
|
|
63
|
+
private showRewindManager;
|
|
61
64
|
private permissionMode;
|
|
62
65
|
private selectorJustUsed;
|
|
63
66
|
private callbacks;
|
|
@@ -97,17 +100,6 @@ export declare class InputManager {
|
|
|
97
100
|
};
|
|
98
101
|
handleCancelCommandSelect(): void;
|
|
99
102
|
checkForSlashDeletion(cursorPosition: number): boolean;
|
|
100
|
-
activateBashHistorySelector(position: number): void;
|
|
101
|
-
updateBashHistorySearchQuery(query: string): void;
|
|
102
|
-
handleBashHistorySelect(command: string): {
|
|
103
|
-
newInput: string;
|
|
104
|
-
newCursorPosition: number;
|
|
105
|
-
};
|
|
106
|
-
handleCancelBashHistorySelect(): void;
|
|
107
|
-
handleBashHistoryExecute(command: string): string;
|
|
108
|
-
handleBashHistoryExecuteAndSend(command: string): void;
|
|
109
|
-
handleBashHistoryDelete(command: string, workdir?: string): void;
|
|
110
|
-
checkForExclamationDeletion(cursorPosition: number): boolean;
|
|
111
103
|
activateMemoryTypeSelector(message: string): void;
|
|
112
104
|
handleMemoryTypeSelect(type: "project" | "user"): Promise<void>;
|
|
113
105
|
handleCancelMemoryTypeSelect(): void;
|
|
@@ -119,7 +111,6 @@ export declare class InputManager {
|
|
|
119
111
|
resetHistoryNavigation(): void;
|
|
120
112
|
isFileSelectorActive(): boolean;
|
|
121
113
|
isCommandSelectorActive(): boolean;
|
|
122
|
-
isBashHistorySelectorActive(): boolean;
|
|
123
114
|
isMemoryTypeSelectorActive(): boolean;
|
|
124
115
|
getFileSelectorState(): {
|
|
125
116
|
show: boolean;
|
|
@@ -132,11 +123,6 @@ export declare class InputManager {
|
|
|
132
123
|
query: string;
|
|
133
124
|
position: number;
|
|
134
125
|
};
|
|
135
|
-
getBashHistorySelectorState(): {
|
|
136
|
-
show: boolean;
|
|
137
|
-
query: string;
|
|
138
|
-
position: number;
|
|
139
|
-
};
|
|
140
126
|
getMemoryTypeSelectorState(): {
|
|
141
127
|
show: boolean;
|
|
142
128
|
message: string;
|
|
@@ -152,10 +138,12 @@ export declare class InputManager {
|
|
|
152
138
|
clearImages(): void;
|
|
153
139
|
getAttachedImages(): AttachedImage[];
|
|
154
140
|
handlePasteImage(): Promise<boolean>;
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
getShowTaskManager(): boolean;
|
|
142
|
+
setShowTaskManager(show: boolean): void;
|
|
157
143
|
getShowMcpManager(): boolean;
|
|
158
144
|
setShowMcpManager(show: boolean): void;
|
|
145
|
+
getShowRewindManager(): boolean;
|
|
146
|
+
setShowRewindManager(show: boolean): void;
|
|
159
147
|
getPermissionMode(): PermissionMode;
|
|
160
148
|
setPermissionMode(mode: PermissionMode): void;
|
|
161
149
|
cyclePermissionMode(): void;
|
|
@@ -165,6 +153,10 @@ export declare class InputManager {
|
|
|
165
153
|
mimeType: string;
|
|
166
154
|
}>, isLoading?: boolean, isCommandRunning?: boolean): Promise<void>;
|
|
167
155
|
handleSelectorInput(input: string, key: Key): boolean;
|
|
156
|
+
activateHistorySearch(): void;
|
|
157
|
+
updateHistorySearchQuery(query: string): void;
|
|
158
|
+
handleHistorySearchSelect(prompt: string): void;
|
|
159
|
+
handleCancelHistorySearch(): void;
|
|
168
160
|
handleNormalInput(input: string, key: Key, attachedImages: Array<{
|
|
169
161
|
id: number;
|
|
170
162
|
path: string;
|
|
@@ -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,
|
|
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,EA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AAC;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;IAuGb,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;IAwEnB,OAAO,IAAI,IAAI;CAUhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { searchFiles as searchFilesUtil,
|
|
1
|
+
import { searchFiles as searchFilesUtil, PromptHistoryManager, } from "wave-agent-sdk";
|
|
2
2
|
import { readClipboardImage } from "../utils/clipboard.js";
|
|
3
3
|
export class InputManager {
|
|
4
4
|
constructor(callbacks = {}) {
|
|
@@ -15,10 +15,9 @@ export class InputManager {
|
|
|
15
15
|
this.showCommandSelector = false;
|
|
16
16
|
this.slashPosition = -1;
|
|
17
17
|
this.commandSearchQuery = "";
|
|
18
|
-
//
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.bashHistorySearchQuery = "";
|
|
18
|
+
// History search state
|
|
19
|
+
this.showHistorySearch = false;
|
|
20
|
+
this.historySearchQuery = "";
|
|
22
21
|
// Memory type selector state
|
|
23
22
|
this.showMemoryTypeSelector = false;
|
|
24
23
|
this.memoryMessage = "";
|
|
@@ -38,8 +37,9 @@ export class InputManager {
|
|
|
38
37
|
this.attachedImages = [];
|
|
39
38
|
this.imageIdCounter = 1;
|
|
40
39
|
// Additional UI state
|
|
41
|
-
this.
|
|
40
|
+
this.showTaskManager = false;
|
|
42
41
|
this.showMcpManager = false;
|
|
42
|
+
this.showRewindManager = false;
|
|
43
43
|
// Permission mode state
|
|
44
44
|
this.permissionMode = "default";
|
|
45
45
|
// Flag to prevent handleInput conflicts when selector selection occurs
|
|
@@ -220,14 +220,19 @@ export class InputManager {
|
|
|
220
220
|
}
|
|
221
221
|
// If not an agent command or execution failed, check local commands
|
|
222
222
|
if (!commandExecuted) {
|
|
223
|
-
if (command === "
|
|
224
|
-
this.callbacks.
|
|
223
|
+
if (command === "tasks" && this.callbacks.onShowTaskManager) {
|
|
224
|
+
this.callbacks.onShowTaskManager();
|
|
225
225
|
commandExecuted = true;
|
|
226
226
|
}
|
|
227
227
|
else if (command === "mcp" && this.callbacks.onShowMcpManager) {
|
|
228
228
|
this.callbacks.onShowMcpManager();
|
|
229
229
|
commandExecuted = true;
|
|
230
230
|
}
|
|
231
|
+
else if (command === "rewind" &&
|
|
232
|
+
this.callbacks.onShowRewindManager) {
|
|
233
|
+
this.callbacks.onShowRewindManager();
|
|
234
|
+
commandExecuted = true;
|
|
235
|
+
}
|
|
231
236
|
}
|
|
232
237
|
})();
|
|
233
238
|
this.handleCancelCommandSelect();
|
|
@@ -275,72 +280,6 @@ export class InputManager {
|
|
|
275
280
|
}
|
|
276
281
|
return false;
|
|
277
282
|
}
|
|
278
|
-
// Bash history selector methods
|
|
279
|
-
activateBashHistorySelector(position) {
|
|
280
|
-
this.showBashHistorySelector = true;
|
|
281
|
-
this.exclamationPosition = position;
|
|
282
|
-
this.bashHistorySearchQuery = "";
|
|
283
|
-
this.callbacks.onBashHistorySelectorStateChange?.(true, "", position);
|
|
284
|
-
}
|
|
285
|
-
updateBashHistorySearchQuery(query) {
|
|
286
|
-
this.bashHistorySearchQuery = query;
|
|
287
|
-
this.callbacks.onBashHistorySelectorStateChange?.(this.showBashHistorySelector, query, this.exclamationPosition);
|
|
288
|
-
}
|
|
289
|
-
handleBashHistorySelect(command) {
|
|
290
|
-
if (this.exclamationPosition >= 0) {
|
|
291
|
-
const beforeExclamation = this.inputText.substring(0, this.exclamationPosition);
|
|
292
|
-
const afterQuery = this.inputText.substring(this.cursorPosition);
|
|
293
|
-
const newInput = beforeExclamation + `!${command}` + afterQuery;
|
|
294
|
-
const newCursorPosition = beforeExclamation.length + command.length + 1;
|
|
295
|
-
this.inputText = newInput;
|
|
296
|
-
this.cursorPosition = newCursorPosition;
|
|
297
|
-
this.handleCancelBashHistorySelect();
|
|
298
|
-
// Set flag to prevent handleInput from processing the same Enter key
|
|
299
|
-
this.selectorJustUsed = true;
|
|
300
|
-
setTimeout(() => {
|
|
301
|
-
this.selectorJustUsed = false;
|
|
302
|
-
}, 0);
|
|
303
|
-
this.callbacks.onInputTextChange?.(newInput);
|
|
304
|
-
this.callbacks.onCursorPositionChange?.(newCursorPosition);
|
|
305
|
-
return { newInput, newCursorPosition };
|
|
306
|
-
}
|
|
307
|
-
return { newInput: this.inputText, newCursorPosition: this.cursorPosition };
|
|
308
|
-
}
|
|
309
|
-
handleCancelBashHistorySelect() {
|
|
310
|
-
this.showBashHistorySelector = false;
|
|
311
|
-
this.exclamationPosition = -1;
|
|
312
|
-
this.bashHistorySearchQuery = "";
|
|
313
|
-
this.callbacks.onBashHistorySelectorStateChange?.(false, "", -1);
|
|
314
|
-
}
|
|
315
|
-
handleBashHistoryExecute(command) {
|
|
316
|
-
this.showBashHistorySelector = false;
|
|
317
|
-
this.exclamationPosition = -1;
|
|
318
|
-
this.bashHistorySearchQuery = "";
|
|
319
|
-
this.callbacks.onBashHistorySelectorStateChange?.(false, "", -1);
|
|
320
|
-
return command; // Return command to execute
|
|
321
|
-
}
|
|
322
|
-
handleBashHistoryExecuteAndSend(command) {
|
|
323
|
-
const commandToExecute = this.handleBashHistoryExecute(command);
|
|
324
|
-
// Clear input box and execute command, ensure command starts with !
|
|
325
|
-
const bashCommand = commandToExecute.startsWith("!")
|
|
326
|
-
? commandToExecute
|
|
327
|
-
: `!${commandToExecute}`;
|
|
328
|
-
this.clearInput();
|
|
329
|
-
this.callbacks.onSendMessage?.(bashCommand);
|
|
330
|
-
}
|
|
331
|
-
handleBashHistoryDelete(command, workdir) {
|
|
332
|
-
deleteBashCommandFromHistory(command, workdir);
|
|
333
|
-
// Trigger a refresh of the selector state to force re-render of BashHistorySelector
|
|
334
|
-
this.callbacks.onBashHistorySelectorStateChange?.(this.showBashHistorySelector, this.bashHistorySearchQuery, this.exclamationPosition);
|
|
335
|
-
}
|
|
336
|
-
checkForExclamationDeletion(cursorPosition) {
|
|
337
|
-
if (this.showBashHistorySelector &&
|
|
338
|
-
cursorPosition <= this.exclamationPosition) {
|
|
339
|
-
this.handleCancelBashHistorySelect();
|
|
340
|
-
return true;
|
|
341
|
-
}
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
283
|
// Memory type selector methods
|
|
345
284
|
activateMemoryTypeSelector(message) {
|
|
346
285
|
this.showMemoryTypeSelector = true;
|
|
@@ -421,9 +360,6 @@ export class InputManager {
|
|
|
421
360
|
isCommandSelectorActive() {
|
|
422
361
|
return this.showCommandSelector;
|
|
423
362
|
}
|
|
424
|
-
isBashHistorySelectorActive() {
|
|
425
|
-
return this.showBashHistorySelector;
|
|
426
|
-
}
|
|
427
363
|
isMemoryTypeSelectorActive() {
|
|
428
364
|
return this.showMemoryTypeSelector;
|
|
429
365
|
}
|
|
@@ -442,13 +378,6 @@ export class InputManager {
|
|
|
442
378
|
position: this.slashPosition,
|
|
443
379
|
};
|
|
444
380
|
}
|
|
445
|
-
getBashHistorySelectorState() {
|
|
446
|
-
return {
|
|
447
|
-
show: this.showBashHistorySelector,
|
|
448
|
-
query: this.bashHistorySearchQuery,
|
|
449
|
-
position: this.exclamationPosition,
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
381
|
getMemoryTypeSelectorState() {
|
|
453
382
|
return {
|
|
454
383
|
show: this.showMemoryTypeSelector,
|
|
@@ -469,25 +398,19 @@ export class InputManager {
|
|
|
469
398
|
const newQuery = inputText.substring(queryStart, queryEnd);
|
|
470
399
|
this.updateCommandSearchQuery(newQuery);
|
|
471
400
|
}
|
|
472
|
-
else if (this.showBashHistorySelector && this.exclamationPosition >= 0) {
|
|
473
|
-
const queryStart = this.exclamationPosition + 1;
|
|
474
|
-
const queryEnd = cursorPosition;
|
|
475
|
-
const newQuery = inputText.substring(queryStart, queryEnd);
|
|
476
|
-
this.updateBashHistorySearchQuery(newQuery);
|
|
477
|
-
}
|
|
478
401
|
}
|
|
479
402
|
// Handle special character input that might trigger selectors
|
|
480
403
|
handleSpecialCharInput(char) {
|
|
481
404
|
if (char === "@") {
|
|
482
405
|
this.activateFileSelector(this.cursorPosition - 1);
|
|
483
406
|
}
|
|
484
|
-
else if (char === "/" &&
|
|
407
|
+
else if (char === "/" &&
|
|
408
|
+
!this.showFileSelector &&
|
|
409
|
+
this.cursorPosition === 1) {
|
|
485
410
|
// Don't activate command selector when file selector is active
|
|
411
|
+
// Only activate command selector if '/' is at the start of input
|
|
486
412
|
this.activateCommandSelector(this.cursorPosition - 1);
|
|
487
413
|
}
|
|
488
|
-
else if (char === "!" && this.cursorPosition === 1) {
|
|
489
|
-
this.activateBashHistorySelector(0);
|
|
490
|
-
}
|
|
491
414
|
else if (char === "#" && this.cursorPosition === 1) {
|
|
492
415
|
// Memory message detection will be handled in submit
|
|
493
416
|
}
|
|
@@ -615,13 +538,13 @@ export class InputManager {
|
|
|
615
538
|
return false;
|
|
616
539
|
}
|
|
617
540
|
}
|
|
618
|
-
//
|
|
619
|
-
|
|
620
|
-
return this.
|
|
541
|
+
// Task manager state methods
|
|
542
|
+
getShowTaskManager() {
|
|
543
|
+
return this.showTaskManager;
|
|
621
544
|
}
|
|
622
|
-
|
|
623
|
-
this.
|
|
624
|
-
this.callbacks.
|
|
545
|
+
setShowTaskManager(show) {
|
|
546
|
+
this.showTaskManager = show;
|
|
547
|
+
this.callbacks.onTaskManagerStateChange?.(show);
|
|
625
548
|
}
|
|
626
549
|
getShowMcpManager() {
|
|
627
550
|
return this.showMcpManager;
|
|
@@ -630,6 +553,13 @@ export class InputManager {
|
|
|
630
553
|
this.showMcpManager = show;
|
|
631
554
|
this.callbacks.onMcpManagerStateChange?.(show);
|
|
632
555
|
}
|
|
556
|
+
getShowRewindManager() {
|
|
557
|
+
return this.showRewindManager;
|
|
558
|
+
}
|
|
559
|
+
setShowRewindManager(show) {
|
|
560
|
+
this.showRewindManager = show;
|
|
561
|
+
this.callbacks.onRewindManagerStateChange?.(show);
|
|
562
|
+
}
|
|
633
563
|
// Permission mode methods
|
|
634
564
|
getPermissionMode() {
|
|
635
565
|
return this.permissionMode;
|
|
@@ -676,6 +606,10 @@ export class InputManager {
|
|
|
676
606
|
// Remove image placeholders, expand long text placeholders, send message
|
|
677
607
|
let cleanContent = this.inputText.replace(imageRegex, "").trim();
|
|
678
608
|
cleanContent = this.expandLongTextPlaceholders(cleanContent);
|
|
609
|
+
// Save to prompt history
|
|
610
|
+
PromptHistoryManager.addEntry(cleanContent).catch((err) => {
|
|
611
|
+
this.logger?.error("Failed to save prompt history", err);
|
|
612
|
+
});
|
|
679
613
|
this.callbacks.onSendMessage?.(cleanContent, referencedImages.length > 0 ? referencedImages : undefined);
|
|
680
614
|
this.clearInput();
|
|
681
615
|
this.callbacks.onResetHistoryNavigation?.();
|
|
@@ -691,7 +625,6 @@ export class InputManager {
|
|
|
691
625
|
// Check for special character deletion
|
|
692
626
|
this.checkForAtDeletion(newCursorPosition);
|
|
693
627
|
this.checkForSlashDeletion(newCursorPosition);
|
|
694
|
-
this.checkForExclamationDeletion(newCursorPosition);
|
|
695
628
|
// Update search queries using the same logic as character input
|
|
696
629
|
this.updateSearchQueriesForActiveSelectors(newInput, newCursorPosition);
|
|
697
630
|
});
|
|
@@ -724,6 +657,28 @@ export class InputManager {
|
|
|
724
657
|
}
|
|
725
658
|
return false;
|
|
726
659
|
}
|
|
660
|
+
// History search methods
|
|
661
|
+
activateHistorySearch() {
|
|
662
|
+
this.showHistorySearch = true;
|
|
663
|
+
this.historySearchQuery = "";
|
|
664
|
+
this.callbacks.onHistorySearchStateChange?.(true, "");
|
|
665
|
+
}
|
|
666
|
+
updateHistorySearchQuery(query) {
|
|
667
|
+
this.historySearchQuery = query;
|
|
668
|
+
this.callbacks.onHistorySearchStateChange?.(true, query);
|
|
669
|
+
}
|
|
670
|
+
handleHistorySearchSelect(prompt) {
|
|
671
|
+
this.inputText = prompt;
|
|
672
|
+
this.cursorPosition = prompt.length;
|
|
673
|
+
this.callbacks.onInputTextChange?.(prompt);
|
|
674
|
+
this.callbacks.onCursorPositionChange?.(prompt.length);
|
|
675
|
+
this.handleCancelHistorySearch();
|
|
676
|
+
}
|
|
677
|
+
handleCancelHistorySearch() {
|
|
678
|
+
this.showHistorySearch = false;
|
|
679
|
+
this.historySearchQuery = "";
|
|
680
|
+
this.callbacks.onHistorySearchStateChange?.(false, "");
|
|
681
|
+
}
|
|
727
682
|
// Handle normal input (when no selector is active)
|
|
728
683
|
async handleNormalInput(input, key, attachedImages, isLoading = false, isCommandRunning = false, clearImages) {
|
|
729
684
|
if (key.return) {
|
|
@@ -738,9 +693,6 @@ export class InputManager {
|
|
|
738
693
|
else if (this.showCommandSelector) {
|
|
739
694
|
this.handleCancelCommandSelect();
|
|
740
695
|
}
|
|
741
|
-
else if (this.showBashHistorySelector) {
|
|
742
|
-
this.handleCancelBashHistorySelect();
|
|
743
|
-
}
|
|
744
696
|
return true;
|
|
745
697
|
}
|
|
746
698
|
if (key.backspace || key.delete) {
|
|
@@ -751,7 +703,6 @@ export class InputManager {
|
|
|
751
703
|
const newCursorPosition = this.cursorPosition - 1;
|
|
752
704
|
this.checkForAtDeletion(newCursorPosition);
|
|
753
705
|
this.checkForSlashDeletion(newCursorPosition);
|
|
754
|
-
this.checkForExclamationDeletion(newCursorPosition);
|
|
755
706
|
}
|
|
756
707
|
return true;
|
|
757
708
|
}
|
|
@@ -778,18 +729,22 @@ export class InputManager {
|
|
|
778
729
|
});
|
|
779
730
|
return true;
|
|
780
731
|
}
|
|
732
|
+
// Handle Ctrl+R for history search
|
|
733
|
+
if (key.ctrl && input === "r") {
|
|
734
|
+
this.activateHistorySearch();
|
|
735
|
+
return true;
|
|
736
|
+
}
|
|
737
|
+
// Handle Ctrl+B for backgrounding current task
|
|
738
|
+
if (key.ctrl && input === "b") {
|
|
739
|
+
this.callbacks.onBackgroundCurrentTask?.();
|
|
740
|
+
return true;
|
|
741
|
+
}
|
|
781
742
|
// Handle up/down keys for history navigation (only when no selector is active)
|
|
782
|
-
if (key.upArrow &&
|
|
783
|
-
!this.showFileSelector &&
|
|
784
|
-
!this.showCommandSelector &&
|
|
785
|
-
!this.showBashHistorySelector) {
|
|
743
|
+
if (key.upArrow && !this.showFileSelector && !this.showCommandSelector) {
|
|
786
744
|
this.navigateHistory("up", this.inputText);
|
|
787
745
|
return true;
|
|
788
746
|
}
|
|
789
|
-
if (key.downArrow &&
|
|
790
|
-
!this.showFileSelector &&
|
|
791
|
-
!this.showCommandSelector &&
|
|
792
|
-
!this.showBashHistorySelector) {
|
|
747
|
+
if (key.downArrow && !this.showFileSelector && !this.showCommandSelector) {
|
|
793
748
|
this.navigateHistory("down", this.inputText);
|
|
794
749
|
return true;
|
|
795
750
|
}
|
|
@@ -832,16 +787,35 @@ export class InputManager {
|
|
|
832
787
|
// Check if any selector is active
|
|
833
788
|
if (this.showFileSelector ||
|
|
834
789
|
this.showCommandSelector ||
|
|
835
|
-
this.
|
|
790
|
+
this.showHistorySearch ||
|
|
836
791
|
this.showMemoryTypeSelector ||
|
|
837
|
-
this.
|
|
838
|
-
this.showMcpManager
|
|
792
|
+
this.showTaskManager ||
|
|
793
|
+
this.showMcpManager ||
|
|
794
|
+
this.showRewindManager) {
|
|
839
795
|
if (this.showMemoryTypeSelector ||
|
|
840
|
-
this.
|
|
841
|
-
this.showMcpManager
|
|
842
|
-
|
|
796
|
+
this.showTaskManager ||
|
|
797
|
+
this.showMcpManager ||
|
|
798
|
+
this.showRewindManager) {
|
|
799
|
+
// Memory type selector, task manager, MCP manager and Rewind don't need to handle input, handled by component itself
|
|
843
800
|
return false;
|
|
844
801
|
}
|
|
802
|
+
if (this.showHistorySearch) {
|
|
803
|
+
if (key.escape) {
|
|
804
|
+
this.handleCancelHistorySearch();
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
if (key.backspace || key.delete) {
|
|
808
|
+
if (this.historySearchQuery.length > 0) {
|
|
809
|
+
this.updateHistorySearchQuery(this.historySearchQuery.slice(0, -1));
|
|
810
|
+
}
|
|
811
|
+
return true;
|
|
812
|
+
}
|
|
813
|
+
if (input && !key.ctrl && !key.meta && !key.return && !key.tab) {
|
|
814
|
+
this.updateHistorySearchQuery(this.historySearchQuery + input);
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
return true; // Let HistorySearch component handle arrows and Enter
|
|
818
|
+
}
|
|
845
819
|
return this.handleSelectorInput(input, key);
|
|
846
820
|
}
|
|
847
821
|
else {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manager-cli.d.ts","sourceRoot":"","sources":["../src/plugin-manager-cli.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAI9D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from "ink";
|
|
3
|
+
import { PluginManagerShell } from "./components/PluginManagerShell.js";
|
|
4
|
+
/**
|
|
5
|
+
* Entry point for the Plugin Manager CLI.
|
|
6
|
+
* Renders the Ink component and handles the lifecycle.
|
|
7
|
+
*/
|
|
8
|
+
export async function startPluginManagerCli() {
|
|
9
|
+
const { waitUntilExit } = render(_jsx(PluginManagerShell, {}));
|
|
10
|
+
await waitUntilExit();
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-selector-cli.d.ts","sourceRoot":"","sources":["../src/session-selector-cli.tsx"],"names":[],"mappings":"AAKA,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA+BtE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, Box } from "ink";
|
|
3
|
+
import { listSessions, truncateContent } from "wave-agent-sdk";
|
|
4
|
+
import { SessionSelector } from "./components/SessionSelector.js";
|
|
5
|
+
export async function startSessionSelectorCli() {
|
|
6
|
+
const currentWorkdir = process.cwd();
|
|
7
|
+
const sessions = await listSessions(currentWorkdir);
|
|
8
|
+
if (sessions.length === 0) {
|
|
9
|
+
console.log(`No sessions found for workdir: ${currentWorkdir}`);
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const sessionsWithContent = sessions.map((s) => ({
|
|
13
|
+
...s,
|
|
14
|
+
firstMessage: truncateContent(s.firstMessage || "No content", 80),
|
|
15
|
+
}));
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
const { unmount } = render(_jsx(Box, { padding: 1, children: _jsx(SessionSelector, { sessions: sessionsWithContent, onSelect: (sessionId) => {
|
|
18
|
+
unmount();
|
|
19
|
+
resolve(sessionId);
|
|
20
|
+
}, onCancel: () => {
|
|
21
|
+
unmount();
|
|
22
|
+
resolve(null);
|
|
23
|
+
} }) }));
|
|
24
|
+
});
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,24 +30,27 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
|
+
"cli-highlight": "^2.1.11",
|
|
33
34
|
"diff": "^8.0.2",
|
|
34
35
|
"glob": "^13.0.0",
|
|
35
36
|
"ink": "^6.5.1",
|
|
36
37
|
"marked": "^11.2.0",
|
|
37
|
-
"react": "^19.
|
|
38
|
+
"react": "^19.2.4",
|
|
39
|
+
"react-dom": "19.2.4",
|
|
38
40
|
"yargs": "^17.7.2",
|
|
39
|
-
"wave-agent-sdk": "0.
|
|
41
|
+
"wave-agent-sdk": "0.5.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@types/react": "^19.1.8",
|
|
43
45
|
"@types/yargs": "^17.0.0",
|
|
46
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
44
47
|
"eslint-plugin-react": "^7.37.5",
|
|
45
48
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
49
|
"ink-testing-library": "^4.0.0",
|
|
47
50
|
"rimraf": "^6.1.2",
|
|
48
51
|
"tsc-alias": "^1.8.16",
|
|
49
52
|
"tsx": "^4.20.4",
|
|
50
|
-
"vitest": "^
|
|
53
|
+
"vitest": "^4.0.18"
|
|
51
54
|
},
|
|
52
55
|
"peerDependencies": {
|
|
53
56
|
"react": ">=18.0.0"
|
|
@@ -61,7 +64,8 @@
|
|
|
61
64
|
"build": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
62
65
|
"type-check": "tsc --noEmit --incremental",
|
|
63
66
|
"watch": "tsc -p tsconfig.build.json --watch & tsc-alias -p tsconfig.build.json --watch",
|
|
64
|
-
"test": "vitest run",
|
|
67
|
+
"test": "vitest run --reporter=dot",
|
|
68
|
+
"test:coverage": "vitest run --coverage --reporter=dot",
|
|
65
69
|
"lint": "eslint --cache",
|
|
66
70
|
"format": "prettier --write .",
|
|
67
71
|
"version:patch": "node ../../scripts/version.js patch",
|
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
ConfigurationService,
|
|
3
3
|
PluginManager,
|
|
4
4
|
PluginScopeManager,
|
|
5
|
+
Scope,
|
|
5
6
|
} from "wave-agent-sdk";
|
|
6
7
|
|
|
7
8
|
export async function disablePluginCommand(argv: {
|
|
8
9
|
plugin: string;
|
|
9
|
-
scope
|
|
10
|
+
scope?: Scope;
|
|
10
11
|
}) {
|
|
11
12
|
const workdir = process.cwd();
|
|
12
13
|
const configurationService = new ConfigurationService();
|
|
@@ -17,10 +18,13 @@ export async function disablePluginCommand(argv: {
|
|
|
17
18
|
pluginManager,
|
|
18
19
|
});
|
|
19
20
|
|
|
21
|
+
const scope =
|
|
22
|
+
argv.scope || scopeManager.findPluginScope(argv.plugin) || "user";
|
|
23
|
+
|
|
20
24
|
try {
|
|
21
|
-
await scopeManager.disablePlugin(
|
|
25
|
+
await scopeManager.disablePlugin(scope, argv.plugin);
|
|
22
26
|
console.log(
|
|
23
|
-
`Successfully disabled plugin: ${argv.plugin} in ${
|
|
27
|
+
`Successfully disabled plugin: ${argv.plugin} in ${scope} scope`,
|
|
24
28
|
);
|
|
25
29
|
process.exit(0);
|
|
26
30
|
} catch (error) {
|
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
ConfigurationService,
|
|
3
3
|
PluginManager,
|
|
4
4
|
PluginScopeManager,
|
|
5
|
+
Scope,
|
|
5
6
|
} from "wave-agent-sdk";
|
|
6
7
|
|
|
7
8
|
export async function enablePluginCommand(argv: {
|
|
8
9
|
plugin: string;
|
|
9
|
-
scope
|
|
10
|
+
scope?: Scope;
|
|
10
11
|
}) {
|
|
11
12
|
const workdir = process.cwd();
|
|
12
13
|
const configurationService = new ConfigurationService();
|
|
@@ -17,10 +18,13 @@ export async function enablePluginCommand(argv: {
|
|
|
17
18
|
pluginManager,
|
|
18
19
|
});
|
|
19
20
|
|
|
21
|
+
const scope =
|
|
22
|
+
argv.scope || scopeManager.findPluginScope(argv.plugin) || "user";
|
|
23
|
+
|
|
20
24
|
try {
|
|
21
|
-
await scopeManager.enablePlugin(
|
|
25
|
+
await scopeManager.enablePlugin(scope, argv.plugin);
|
|
22
26
|
console.log(
|
|
23
|
-
`Successfully enabled plugin: ${argv.plugin} in ${
|
|
27
|
+
`Successfully enabled plugin: ${argv.plugin} in ${scope} scope`,
|
|
24
28
|
);
|
|
25
29
|
process.exit(0);
|
|
26
30
|
} catch (error) {
|