wave-code 0.9.2 → 0.9.4
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/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +10 -3
- package/dist/components/MarketplaceDetail.d.ts.map +1 -1
- package/dist/components/MarketplaceDetail.js +9 -2
- package/dist/components/PluginManagerShell.d.ts +1 -0
- package/dist/components/PluginManagerShell.d.ts.map +1 -1
- package/dist/components/PluginManagerShell.js +4 -1
- package/dist/components/PluginManagerTypes.d.ts +1 -0
- package/dist/components/PluginManagerTypes.d.ts.map +1 -1
- package/dist/constants/commands.d.ts.map +1 -1
- package/dist/constants/commands.js +6 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +3 -2
- package/dist/hooks/useInputManager.d.ts +2 -0
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +8 -0
- package/dist/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/hooks/usePluginManager.js +21 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -16
- package/dist/managers/inputHandlers.d.ts.map +1 -1
- package/dist/managers/inputHandlers.js +33 -9
- package/dist/managers/inputReducer.d.ts +11 -1
- package/dist/managers/inputReducer.d.ts.map +1 -1
- package/dist/managers/inputReducer.js +12 -2
- package/package.json +2 -2
- package/src/components/InputBox.tsx +12 -1
- package/src/components/MarketplaceDetail.tsx +16 -1
- package/src/components/PluginManagerShell.tsx +6 -3
- package/src/components/PluginManagerTypes.ts +1 -0
- package/src/constants/commands.ts +6 -0
- package/src/contexts/useChat.tsx +3 -1
- package/src/hooks/useInputManager.ts +10 -0
- package/src/hooks/usePluginManager.ts +26 -1
- package/src/index.ts +125 -155
- package/src/managers/inputHandlers.ts +35 -10
- package/src/managers/inputReducer.ts +27 -3
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
FileItem,
|
|
3
|
+
PermissionMode,
|
|
4
|
+
Logger,
|
|
5
|
+
PromptEntry,
|
|
6
|
+
Message,
|
|
7
|
+
} from "wave-agent-sdk";
|
|
2
8
|
|
|
3
9
|
export interface AttachedImage {
|
|
4
10
|
id: number;
|
|
@@ -26,6 +32,7 @@ export interface InputManagerCallbacks {
|
|
|
26
32
|
onRewindManagerStateChange?: (show: boolean) => void;
|
|
27
33
|
onHelpStateChange?: (show: boolean) => void;
|
|
28
34
|
onStatusCommandStateChange?: (show: boolean) => void;
|
|
35
|
+
onPluginManagerStateChange?: (show: boolean) => void;
|
|
29
36
|
onImagesStateChange?: (images: AttachedImage[]) => void;
|
|
30
37
|
onSendMessage?: (
|
|
31
38
|
content: string,
|
|
@@ -37,6 +44,11 @@ export interface InputManagerCallbacks {
|
|
|
37
44
|
onBackgroundCurrentTask?: () => void;
|
|
38
45
|
onPermissionModeChange?: (mode: PermissionMode) => void;
|
|
39
46
|
sessionId?: string;
|
|
47
|
+
workdir?: string;
|
|
48
|
+
getFullMessageThread?: () => Promise<{
|
|
49
|
+
messages: Message[];
|
|
50
|
+
sessionIds: string[];
|
|
51
|
+
}>;
|
|
40
52
|
logger?: Logger;
|
|
41
53
|
}
|
|
42
54
|
|
|
@@ -61,6 +73,7 @@ export interface InputState {
|
|
|
61
73
|
showRewindManager: boolean;
|
|
62
74
|
showHelp: boolean;
|
|
63
75
|
showStatusCommand: boolean;
|
|
76
|
+
showPluginManager: boolean;
|
|
64
77
|
permissionMode: PermissionMode;
|
|
65
78
|
selectorJustUsed: boolean;
|
|
66
79
|
isPasting: boolean;
|
|
@@ -94,6 +107,7 @@ export const initialState: InputState = {
|
|
|
94
107
|
showRewindManager: false,
|
|
95
108
|
showHelp: false,
|
|
96
109
|
showStatusCommand: false,
|
|
110
|
+
showPluginManager: false,
|
|
97
111
|
permissionMode: "default",
|
|
98
112
|
selectorJustUsed: false,
|
|
99
113
|
isPasting: false,
|
|
@@ -130,6 +144,7 @@ export type InputAction =
|
|
|
130
144
|
| { type: "SET_SHOW_REWIND_MANAGER"; payload: boolean }
|
|
131
145
|
| { type: "SET_SHOW_HELP"; payload: boolean }
|
|
132
146
|
| { type: "SET_SHOW_STATUS_COMMAND"; payload: boolean }
|
|
147
|
+
| { type: "SET_SHOW_PLUGIN_MANAGER"; payload: boolean }
|
|
133
148
|
| { type: "SET_PERMISSION_MODE"; payload: PermissionMode }
|
|
134
149
|
| { type: "SET_SELECTOR_JUST_USED"; payload: boolean }
|
|
135
150
|
| { type: "COMPRESS_AND_INSERT_TEXT"; payload: string }
|
|
@@ -317,6 +332,12 @@ export function inputReducer(
|
|
|
317
332
|
showStatusCommand: action.payload,
|
|
318
333
|
selectorJustUsed: !action.payload ? true : state.selectorJustUsed,
|
|
319
334
|
};
|
|
335
|
+
case "SET_SHOW_PLUGIN_MANAGER":
|
|
336
|
+
return {
|
|
337
|
+
...state,
|
|
338
|
+
showPluginManager: action.payload,
|
|
339
|
+
selectorJustUsed: !action.payload ? true : state.selectorJustUsed,
|
|
340
|
+
};
|
|
320
341
|
case "SET_PERMISSION_MODE":
|
|
321
342
|
return { ...state, permissionMode: action.payload };
|
|
322
343
|
case "SET_SELECTOR_JUST_USED":
|
|
@@ -409,6 +430,9 @@ export function inputReducer(
|
|
|
409
430
|
}
|
|
410
431
|
newIndex = Math.min(state.history.length - 1, newIndex + 1);
|
|
411
432
|
} else {
|
|
433
|
+
if (newIndex === -1) {
|
|
434
|
+
return state;
|
|
435
|
+
}
|
|
412
436
|
newIndex = Math.max(-1, newIndex - 1);
|
|
413
437
|
}
|
|
414
438
|
|
|
@@ -419,8 +443,8 @@ export function inputReducer(
|
|
|
419
443
|
inputText: newOriginalInputText,
|
|
420
444
|
longTextMap: newOriginalLongTextMap,
|
|
421
445
|
cursorPosition: newOriginalInputText.length,
|
|
422
|
-
originalInputText:
|
|
423
|
-
originalLongTextMap:
|
|
446
|
+
originalInputText: "",
|
|
447
|
+
originalLongTextMap: {},
|
|
424
448
|
};
|
|
425
449
|
} else {
|
|
426
450
|
const entry = state.history[newIndex];
|