wave-code 0.14.0 → 0.14.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/components/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/components/BackgroundTaskManager.js +36 -25
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +2 -2
- package/dist/components/MarketplaceAddForm.d.ts.map +1 -1
- package/dist/components/MarketplaceAddForm.js +48 -17
- package/dist/components/MarketplaceDetail.d.ts.map +1 -1
- package/dist/components/MarketplaceDetail.js +2 -1
- package/dist/components/MarketplaceList.d.ts.map +1 -1
- package/dist/components/MarketplaceList.js +2 -1
- package/dist/components/McpManager.d.ts.map +1 -1
- package/dist/components/McpManager.js +22 -27
- package/dist/components/PluginDetail.d.ts.map +1 -1
- package/dist/components/PluginDetail.js +22 -22
- package/dist/components/PluginManagerShell.d.ts +1 -0
- package/dist/components/PluginManagerShell.d.ts.map +1 -1
- package/dist/components/PluginManagerShell.js +2 -2
- package/dist/components/PluginManagerTypes.d.ts +2 -2
- package/dist/components/PluginManagerTypes.d.ts.map +1 -1
- package/dist/contexts/useChat.d.ts +1 -0
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +125 -98
- package/dist/hooks/usePluginManager.d.ts +3 -1
- package/dist/hooks/usePluginManager.d.ts.map +1 -1
- package/dist/hooks/usePluginManager.js +16 -7
- package/dist/reducers/backgroundTaskManagerReducer.d.ts +43 -0
- package/dist/reducers/backgroundTaskManagerReducer.d.ts.map +1 -0
- package/dist/reducers/backgroundTaskManagerReducer.js +23 -0
- package/dist/reducers/marketplaceAddFormReducer.d.ts +24 -0
- package/dist/reducers/marketplaceAddFormReducer.d.ts.map +1 -0
- package/dist/reducers/marketplaceAddFormReducer.js +18 -0
- package/dist/reducers/mcpManagerReducer.d.ts +16 -0
- package/dist/reducers/mcpManagerReducer.d.ts.map +1 -0
- package/dist/reducers/mcpManagerReducer.js +15 -0
- package/dist/reducers/pluginDetailReducer.d.ts +25 -0
- package/dist/reducers/pluginDetailReducer.d.ts.map +1 -0
- package/dist/reducers/pluginDetailReducer.js +38 -0
- package/package.json +2 -2
- package/src/components/BackgroundTaskManager.tsx +32 -34
- package/src/components/InputBox.tsx +7 -1
- package/src/components/MarketplaceAddForm.tsx +76 -22
- package/src/components/MarketplaceDetail.tsx +4 -0
- package/src/components/MarketplaceList.tsx +4 -0
- package/src/components/McpManager.tsx +30 -34
- package/src/components/PluginDetail.tsx +25 -33
- package/src/components/PluginManagerShell.tsx +3 -2
- package/src/components/PluginManagerTypes.ts +8 -2
- package/src/contexts/useChat.tsx +54 -20
- package/src/hooks/usePluginManager.ts +18 -7
- package/src/reducers/backgroundTaskManagerReducer.ts +60 -0
- package/src/reducers/marketplaceAddFormReducer.ts +35 -0
- package/src/reducers/mcpManagerReducer.ts +31 -0
- package/src/reducers/pluginDetailReducer.ts +58 -0
package/dist/contexts/useChat.js
CHANGED
|
@@ -114,105 +114,103 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
114
114
|
});
|
|
115
115
|
}, []);
|
|
116
116
|
// Initialize AI manager
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
160
|
-
try {
|
|
161
|
-
// Create the permission callback inside the try block to access showConfirmation
|
|
162
|
-
const permissionCallback = async (context) => {
|
|
163
|
-
try {
|
|
164
|
-
return await showConfirmation(context.toolName, context.toolInput, context.suggestedPrefix, context.hidePersistentOption, context.planContent);
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
// If confirmation was cancelled or failed, deny the operation
|
|
168
|
-
return {
|
|
169
|
-
behavior: "deny",
|
|
170
|
-
message: OPERATION_CANCELLED_BY_USER,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const agent = await Agent.create({
|
|
175
|
-
callbacks,
|
|
176
|
-
restoreSessionId,
|
|
177
|
-
continueLastSession,
|
|
178
|
-
logger,
|
|
179
|
-
permissionMode: initialPermissionMode ||
|
|
180
|
-
(bypassPermissions ? "bypassPermissions" : undefined),
|
|
181
|
-
canUseTool: permissionCallback,
|
|
182
|
-
stream: true,
|
|
183
|
-
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
184
|
-
tools,
|
|
185
|
-
allowedTools,
|
|
186
|
-
disallowedTools,
|
|
187
|
-
workdir,
|
|
188
|
-
worktreeName: worktreeSession?.name,
|
|
189
|
-
isNewWorktree: worktreeSession?.isNew,
|
|
190
|
-
model,
|
|
191
|
-
});
|
|
192
|
-
agentRef.current = agent;
|
|
193
|
-
// Get initial state
|
|
194
|
-
setSessionId(agent.sessionId);
|
|
195
|
-
setMessages(agent.messages);
|
|
196
|
-
setIsLoading(agent.isLoading);
|
|
197
|
-
setlatestTotalTokens(agent.latestTotalTokens);
|
|
198
|
-
setIsCommandRunning(agent.isCommandRunning);
|
|
199
|
-
setIsCompressing(agent.isCompressing);
|
|
200
|
-
setPermissionModeState(agent.getPermissionMode());
|
|
201
|
-
setWorkingDirectory(agent.workingDirectory);
|
|
202
|
-
setCurrentModelState(agent.getModelConfig().model);
|
|
203
|
-
setConfiguredModels(agent.getConfiguredModels());
|
|
204
|
-
// Get initial MCP servers state
|
|
205
|
-
const mcpServers = agent.getMcpServers?.() || [];
|
|
206
|
-
setMcpServers(mcpServers);
|
|
207
|
-
// Get initial commands
|
|
208
|
-
const agentSlashCommands = agent.getSlashCommands?.() || [];
|
|
209
|
-
setSlashCommands(agentSlashCommands);
|
|
210
|
-
}
|
|
211
|
-
catch (error) {
|
|
212
|
-
console.error("Failed to initialize AI manager:", error);
|
|
213
|
-
}
|
|
117
|
+
const initializeAgent = useCallback(async (restoreSessionIdOverride) => {
|
|
118
|
+
const effectiveRestoreSessionId = restoreSessionIdOverride ?? restoreSessionId;
|
|
119
|
+
const callbacks = {
|
|
120
|
+
onMessagesChange: () => {
|
|
121
|
+
throttledSetMessages();
|
|
122
|
+
},
|
|
123
|
+
onServersChange: (servers) => {
|
|
124
|
+
setMcpServers([...servers]);
|
|
125
|
+
},
|
|
126
|
+
onSessionIdChange: (sessionId) => {
|
|
127
|
+
setSessionId(sessionId);
|
|
128
|
+
},
|
|
129
|
+
onLatestTotalTokensChange: (tokens) => {
|
|
130
|
+
throttledSetTokens(tokens);
|
|
131
|
+
},
|
|
132
|
+
onCompressionStateChange: (isCompressingState) => {
|
|
133
|
+
setIsCompressing(isCompressingState);
|
|
134
|
+
},
|
|
135
|
+
onBackgroundTasksChange: (tasks) => {
|
|
136
|
+
setBackgroundTasks([...tasks]);
|
|
137
|
+
},
|
|
138
|
+
onTasksChange: (tasks) => {
|
|
139
|
+
setTasks([...tasks]);
|
|
140
|
+
},
|
|
141
|
+
onPermissionModeChange: (mode) => {
|
|
142
|
+
setPermissionModeState(mode);
|
|
143
|
+
},
|
|
144
|
+
onModelChange: (model) => {
|
|
145
|
+
setCurrentModelState(model);
|
|
146
|
+
},
|
|
147
|
+
onConfiguredModelsChange: (models) => {
|
|
148
|
+
setConfiguredModels(models);
|
|
149
|
+
},
|
|
150
|
+
onLoadingChange: (loading) => {
|
|
151
|
+
setIsLoading(loading);
|
|
152
|
+
},
|
|
153
|
+
onCommandRunningChange: (running) => {
|
|
154
|
+
setIsCommandRunning(running);
|
|
155
|
+
},
|
|
156
|
+
onQueuedMessagesChange: (messages) => {
|
|
157
|
+
setQueuedMessages([...messages]);
|
|
158
|
+
},
|
|
214
159
|
};
|
|
215
|
-
|
|
160
|
+
try {
|
|
161
|
+
// Create the permission callback inside the try block to access showConfirmation
|
|
162
|
+
const permissionCallback = async (context) => {
|
|
163
|
+
try {
|
|
164
|
+
return await showConfirmation(context.toolName, context.toolInput, context.suggestedPrefix, context.hidePersistentOption, context.planContent);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// If confirmation was cancelled or failed, deny the operation
|
|
168
|
+
return {
|
|
169
|
+
behavior: "deny",
|
|
170
|
+
message: OPERATION_CANCELLED_BY_USER,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const agent = await Agent.create({
|
|
175
|
+
callbacks,
|
|
176
|
+
restoreSessionId: effectiveRestoreSessionId,
|
|
177
|
+
continueLastSession,
|
|
178
|
+
logger,
|
|
179
|
+
permissionMode: initialPermissionMode ||
|
|
180
|
+
(bypassPermissions ? "bypassPermissions" : undefined),
|
|
181
|
+
canUseTool: permissionCallback,
|
|
182
|
+
stream: true,
|
|
183
|
+
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
184
|
+
tools,
|
|
185
|
+
allowedTools,
|
|
186
|
+
disallowedTools,
|
|
187
|
+
workdir,
|
|
188
|
+
worktreeName: worktreeSession?.name,
|
|
189
|
+
isNewWorktree: worktreeSession?.isNew,
|
|
190
|
+
model,
|
|
191
|
+
});
|
|
192
|
+
agentRef.current = agent;
|
|
193
|
+
// Get initial state
|
|
194
|
+
setSessionId(agent.sessionId);
|
|
195
|
+
setMessages(agent.messages);
|
|
196
|
+
setIsLoading(agent.isLoading);
|
|
197
|
+
setlatestTotalTokens(agent.latestTotalTokens);
|
|
198
|
+
setIsCommandRunning(agent.isCommandRunning);
|
|
199
|
+
setIsCompressing(agent.isCompressing);
|
|
200
|
+
setPermissionModeState(agent.getPermissionMode());
|
|
201
|
+
setWorkingDirectory(agent.workingDirectory);
|
|
202
|
+
setCurrentModelState(agent.getModelConfig().model);
|
|
203
|
+
setConfiguredModels(agent.getConfiguredModels());
|
|
204
|
+
// Get initial MCP servers state
|
|
205
|
+
const mcpServers = agent.getMcpServers?.() || [];
|
|
206
|
+
setMcpServers(mcpServers);
|
|
207
|
+
// Get initial commands
|
|
208
|
+
const agentSlashCommands = agent.getSlashCommands?.() || [];
|
|
209
|
+
setSlashCommands(agentSlashCommands);
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
console.error("Failed to initialize AI manager:", error);
|
|
213
|
+
}
|
|
216
214
|
}, [
|
|
217
215
|
restoreSessionId,
|
|
218
216
|
continueLastSession,
|
|
@@ -229,6 +227,34 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
229
227
|
throttledSetMessages,
|
|
230
228
|
throttledSetTokens,
|
|
231
229
|
]);
|
|
230
|
+
// Recreate agent (e.g. after plugin install) — destroys current agent and reinitializes
|
|
231
|
+
const recreateAgent = useCallback(() => {
|
|
232
|
+
const currentSessionId = agentRef.current?.sessionId;
|
|
233
|
+
if (agentRef.current) {
|
|
234
|
+
try {
|
|
235
|
+
agentRef.current.destroy();
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
// Ignore destroy errors
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
agentRef.current = null;
|
|
242
|
+
setMessages([]);
|
|
243
|
+
setMcpServers([]);
|
|
244
|
+
setSlashCommands([]);
|
|
245
|
+
setSessionId("");
|
|
246
|
+
setIsLoading(false);
|
|
247
|
+
setlatestTotalTokens(0);
|
|
248
|
+
setIsCommandRunning(false);
|
|
249
|
+
setIsCompressing(false);
|
|
250
|
+
if (currentSessionId) {
|
|
251
|
+
initializeAgent(currentSessionId);
|
|
252
|
+
}
|
|
253
|
+
}, [initializeAgent]);
|
|
254
|
+
// Run initial agent creation
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
initializeAgent();
|
|
257
|
+
}, [initializeAgent]);
|
|
232
258
|
// Cleanup on unmount
|
|
233
259
|
useEffect(() => {
|
|
234
260
|
return () => {
|
|
@@ -481,6 +507,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
481
507
|
workingDirectory,
|
|
482
508
|
version,
|
|
483
509
|
workdir,
|
|
510
|
+
recreateAgent,
|
|
484
511
|
};
|
|
485
512
|
return (_jsx(ChatContext.Provider, { value: contextValue, children: children }));
|
|
486
513
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { PluginManagerContextType } from "../components/PluginManagerTypes.js";
|
|
2
|
-
export declare function usePluginManager(
|
|
2
|
+
export declare function usePluginManager(options?: {
|
|
3
|
+
onPluginInstalled?: () => void;
|
|
4
|
+
}): PluginManagerContextType;
|
|
3
5
|
//# sourceMappingURL=usePluginManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePluginManager.d.ts","sourceRoot":"","sources":["../../src/hooks/usePluginManager.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAE7C,wBAAgB,gBAAgB,IAAI,wBAAwB,
|
|
1
|
+
{"version":3,"file":"usePluginManager.d.ts","sourceRoot":"","sources":["../../src/hooks/usePluginManager.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,GAAG,wBAAwB,CAgU3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
2
2
|
import { PluginCore, } from "wave-agent-sdk";
|
|
3
|
-
export function usePluginManager() {
|
|
3
|
+
export function usePluginManager(options) {
|
|
4
4
|
const [state, setState] = useState({
|
|
5
5
|
currentView: "DISCOVER",
|
|
6
6
|
selectedId: null,
|
|
@@ -98,16 +98,20 @@ export function usePluginManager() {
|
|
|
98
98
|
const setSelectedId = useCallback((id) => {
|
|
99
99
|
setState((prev) => ({ ...prev, selectedId: id }));
|
|
100
100
|
}, []);
|
|
101
|
-
const addMarketplace = useCallback(async (source) => {
|
|
101
|
+
const addMarketplace = useCallback(async (source, scope = "user") => {
|
|
102
102
|
clearPluginFeedback();
|
|
103
103
|
setState((prev) => ({
|
|
104
104
|
...prev,
|
|
105
105
|
isLoading: true,
|
|
106
106
|
}));
|
|
107
107
|
try {
|
|
108
|
-
await pluginCore.addMarketplace(source);
|
|
108
|
+
await pluginCore.addMarketplace(source, scope);
|
|
109
109
|
await refresh();
|
|
110
|
-
setSuccessMessage(`Marketplace added successfully`);
|
|
110
|
+
setSuccessMessage(`Marketplace added successfully (${scope} scope)`);
|
|
111
|
+
setState((prev) => ({
|
|
112
|
+
...prev,
|
|
113
|
+
currentView: "MARKETPLACES",
|
|
114
|
+
}));
|
|
111
115
|
}
|
|
112
116
|
catch (error) {
|
|
113
117
|
setState((prev) => ({
|
|
@@ -117,16 +121,20 @@ export function usePluginManager() {
|
|
|
117
121
|
}));
|
|
118
122
|
}
|
|
119
123
|
}, [pluginCore, refresh, clearPluginFeedback, setSuccessMessage]);
|
|
120
|
-
const removeMarketplace = useCallback(async (name) => {
|
|
124
|
+
const removeMarketplace = useCallback(async (name, scope) => {
|
|
121
125
|
clearPluginFeedback();
|
|
122
126
|
setState((prev) => ({
|
|
123
127
|
...prev,
|
|
124
128
|
isLoading: true,
|
|
125
129
|
}));
|
|
126
130
|
try {
|
|
127
|
-
await pluginCore.removeMarketplace(name);
|
|
131
|
+
await pluginCore.removeMarketplace(name, scope);
|
|
128
132
|
await refresh();
|
|
129
133
|
setSuccessMessage(`Marketplace '${name}' removed successfully`);
|
|
134
|
+
setState((prev) => ({
|
|
135
|
+
...prev,
|
|
136
|
+
currentView: "MARKETPLACES",
|
|
137
|
+
}));
|
|
130
138
|
}
|
|
131
139
|
catch (error) {
|
|
132
140
|
setState((prev) => ({
|
|
@@ -166,6 +174,7 @@ export function usePluginManager() {
|
|
|
166
174
|
await pluginCore.installPlugin(pluginId, scope);
|
|
167
175
|
await refresh();
|
|
168
176
|
setSuccessMessage(`Plugin '${name}' installed successfully`);
|
|
177
|
+
options?.onPluginInstalled?.();
|
|
169
178
|
}
|
|
170
179
|
catch (error) {
|
|
171
180
|
setState((prev) => ({
|
|
@@ -174,7 +183,7 @@ export function usePluginManager() {
|
|
|
174
183
|
error: error instanceof Error ? error.message : String(error),
|
|
175
184
|
}));
|
|
176
185
|
}
|
|
177
|
-
}, [pluginCore, refresh, clearPluginFeedback, setSuccessMessage]);
|
|
186
|
+
}, [pluginCore, refresh, clearPluginFeedback, setSuccessMessage, options]);
|
|
178
187
|
const uninstallPlugin = useCallback(async (name, marketplace) => {
|
|
179
188
|
clearPluginFeedback();
|
|
180
189
|
setState((prev) => ({
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface Task {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
status: "running" | "completed" | "failed" | "killed";
|
|
6
|
+
startTime: number;
|
|
7
|
+
exitCode?: number;
|
|
8
|
+
runtime?: number;
|
|
9
|
+
outputPath?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DetailOutput {
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
status: string;
|
|
15
|
+
outputPath?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BackgroundTaskManagerState {
|
|
18
|
+
tasks: Task[];
|
|
19
|
+
selectedIndex: number;
|
|
20
|
+
viewMode: "list" | "detail";
|
|
21
|
+
detailTaskId: string | null;
|
|
22
|
+
detailOutput: DetailOutput | null;
|
|
23
|
+
}
|
|
24
|
+
export type BackgroundTaskManagerAction = {
|
|
25
|
+
type: "SET_TASKS";
|
|
26
|
+
tasks: Task[];
|
|
27
|
+
} | {
|
|
28
|
+
type: "SELECT_INDEX";
|
|
29
|
+
index: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "SET_VIEW_MODE";
|
|
32
|
+
mode: "list" | "detail";
|
|
33
|
+
} | {
|
|
34
|
+
type: "SET_DETAIL_TASK_ID";
|
|
35
|
+
id: string | null;
|
|
36
|
+
} | {
|
|
37
|
+
type: "SET_DETAIL_OUTPUT";
|
|
38
|
+
output: DetailOutput | null;
|
|
39
|
+
} | {
|
|
40
|
+
type: "RESET_DETAIL";
|
|
41
|
+
};
|
|
42
|
+
export declare function backgroundTaskManagerReducer(state: BackgroundTaskManagerState, action: BackgroundTaskManagerAction): BackgroundTaskManagerState;
|
|
43
|
+
//# sourceMappingURL=backgroundTaskManagerReducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundTaskManagerReducer.d.ts","sourceRoot":"","sources":["../../src/reducers/backgroundTaskManagerReducer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,0BAA0B,EACjC,MAAM,EAAE,2BAA2B,GAClC,0BAA0B,CAsB5B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function backgroundTaskManagerReducer(state, action) {
|
|
2
|
+
switch (action.type) {
|
|
3
|
+
case "SET_TASKS":
|
|
4
|
+
return { ...state, tasks: action.tasks };
|
|
5
|
+
case "SELECT_INDEX":
|
|
6
|
+
return { ...state, selectedIndex: action.index };
|
|
7
|
+
case "SET_VIEW_MODE":
|
|
8
|
+
return { ...state, viewMode: action.mode };
|
|
9
|
+
case "SET_DETAIL_TASK_ID":
|
|
10
|
+
return { ...state, detailTaskId: action.id };
|
|
11
|
+
case "SET_DETAIL_OUTPUT":
|
|
12
|
+
return { ...state, detailOutput: action.output };
|
|
13
|
+
case "RESET_DETAIL":
|
|
14
|
+
return {
|
|
15
|
+
...state,
|
|
16
|
+
viewMode: "list",
|
|
17
|
+
detailTaskId: null,
|
|
18
|
+
detailOutput: null,
|
|
19
|
+
};
|
|
20
|
+
default:
|
|
21
|
+
return state;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface MarketplaceAddFormState {
|
|
2
|
+
source: string;
|
|
3
|
+
scopeIndex: number;
|
|
4
|
+
step: "source" | "scope";
|
|
5
|
+
}
|
|
6
|
+
export type MarketplaceAddFormAction = {
|
|
7
|
+
type: "SET_SOURCE";
|
|
8
|
+
source: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "SET_SCOPE_INDEX";
|
|
11
|
+
index: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: "SET_STEP";
|
|
14
|
+
step: "source" | "scope";
|
|
15
|
+
} | {
|
|
16
|
+
type: "INSERT_CHAR";
|
|
17
|
+
text: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: "DELETE_CHAR";
|
|
20
|
+
} | {
|
|
21
|
+
type: "BACK_TO_SOURCE";
|
|
22
|
+
};
|
|
23
|
+
export declare function marketplaceAddFormReducer(state: MarketplaceAddFormState, action: MarketplaceAddFormAction): MarketplaceAddFormState;
|
|
24
|
+
//# sourceMappingURL=marketplaceAddFormReducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaceAddFormReducer.d.ts","sourceRoot":"","sources":["../../src/reducers/marketplaceAddFormReducer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAE/B,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,wBAAwB,GAC/B,uBAAuB,CAiBzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function marketplaceAddFormReducer(state, action) {
|
|
2
|
+
switch (action.type) {
|
|
3
|
+
case "SET_SOURCE":
|
|
4
|
+
return { ...state, source: action.source };
|
|
5
|
+
case "SET_SCOPE_INDEX":
|
|
6
|
+
return { ...state, scopeIndex: action.index };
|
|
7
|
+
case "SET_STEP":
|
|
8
|
+
return { ...state, step: action.step };
|
|
9
|
+
case "INSERT_CHAR":
|
|
10
|
+
return { ...state, source: state.source + action.text };
|
|
11
|
+
case "DELETE_CHAR":
|
|
12
|
+
return { ...state, source: state.source.slice(0, -1) };
|
|
13
|
+
case "BACK_TO_SOURCE":
|
|
14
|
+
return { ...state, step: "source" };
|
|
15
|
+
default:
|
|
16
|
+
return state;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface McpManagerState {
|
|
2
|
+
selectedIndex: number;
|
|
3
|
+
viewMode: "list" | "detail";
|
|
4
|
+
}
|
|
5
|
+
export type McpManagerAction = {
|
|
6
|
+
type: "MOVE_UP";
|
|
7
|
+
serverCount: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: "MOVE_DOWN";
|
|
10
|
+
serverCount: number;
|
|
11
|
+
} | {
|
|
12
|
+
type: "SET_VIEW_MODE";
|
|
13
|
+
viewMode: "list" | "detail";
|
|
14
|
+
};
|
|
15
|
+
export declare function mcpManagerReducer(state: McpManagerState, action: McpManagerAction): McpManagerState;
|
|
16
|
+
//# sourceMappingURL=mcpManagerReducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpManagerReducer.d.ts","sourceRoot":"","sources":["../../src/reducers/mcpManagerReducer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAE3D,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,gBAAgB,GACvB,eAAe,CAiBjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function mcpManagerReducer(state, action) {
|
|
2
|
+
switch (action.type) {
|
|
3
|
+
case "MOVE_UP":
|
|
4
|
+
return { ...state, selectedIndex: Math.max(0, state.selectedIndex - 1) };
|
|
5
|
+
case "MOVE_DOWN":
|
|
6
|
+
return {
|
|
7
|
+
...state,
|
|
8
|
+
selectedIndex: Math.min(action.serverCount - 1, state.selectedIndex + 1),
|
|
9
|
+
};
|
|
10
|
+
case "SET_VIEW_MODE":
|
|
11
|
+
return { ...state, viewMode: action.viewMode };
|
|
12
|
+
default:
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface PluginDetailState {
|
|
2
|
+
selectedScopeIndex: number;
|
|
3
|
+
selectedActionIndex: number;
|
|
4
|
+
}
|
|
5
|
+
export type PluginDetailAction = {
|
|
6
|
+
type: "SELECT_SCOPE_INDEX";
|
|
7
|
+
index: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: "SELECT_ACTION_INDEX";
|
|
10
|
+
index: number;
|
|
11
|
+
} | {
|
|
12
|
+
type: "MOVE_SCOPE_UP";
|
|
13
|
+
maxIndex: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: "MOVE_SCOPE_DOWN";
|
|
16
|
+
maxIndex: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: "MOVE_ACTION_UP";
|
|
19
|
+
maxIndex: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: "MOVE_ACTION_DOWN";
|
|
22
|
+
maxIndex: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function pluginDetailReducer(state: PluginDetailState, action: PluginDetailAction): PluginDetailState;
|
|
25
|
+
//# sourceMappingURL=pluginDetailReducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginDetailReducer.d.ts","sourceRoot":"","sources":["../../src/reducers/pluginDetailReducer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,kBAAkB,GACzB,iBAAiB,CAyCnB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function pluginDetailReducer(state, action) {
|
|
2
|
+
switch (action.type) {
|
|
3
|
+
case "SELECT_SCOPE_INDEX":
|
|
4
|
+
return { ...state, selectedScopeIndex: action.index };
|
|
5
|
+
case "SELECT_ACTION_INDEX":
|
|
6
|
+
return { ...state, selectedActionIndex: action.index };
|
|
7
|
+
case "MOVE_SCOPE_UP":
|
|
8
|
+
return {
|
|
9
|
+
...state,
|
|
10
|
+
selectedScopeIndex: state.selectedScopeIndex > 0
|
|
11
|
+
? state.selectedScopeIndex - 1
|
|
12
|
+
: action.maxIndex,
|
|
13
|
+
};
|
|
14
|
+
case "MOVE_SCOPE_DOWN":
|
|
15
|
+
return {
|
|
16
|
+
...state,
|
|
17
|
+
selectedScopeIndex: state.selectedScopeIndex < action.maxIndex
|
|
18
|
+
? state.selectedScopeIndex + 1
|
|
19
|
+
: 0,
|
|
20
|
+
};
|
|
21
|
+
case "MOVE_ACTION_UP":
|
|
22
|
+
return {
|
|
23
|
+
...state,
|
|
24
|
+
selectedActionIndex: state.selectedActionIndex > 0
|
|
25
|
+
? state.selectedActionIndex - 1
|
|
26
|
+
: action.maxIndex,
|
|
27
|
+
};
|
|
28
|
+
case "MOVE_ACTION_DOWN":
|
|
29
|
+
return {
|
|
30
|
+
...state,
|
|
31
|
+
selectedActionIndex: state.selectedActionIndex < action.maxIndex
|
|
32
|
+
? state.selectedActionIndex + 1
|
|
33
|
+
: 0,
|
|
34
|
+
};
|
|
35
|
+
default:
|
|
36
|
+
return state;
|
|
37
|
+
}
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"semver": "^7.7.4",
|
|
43
43
|
"yargs": "^17.7.2",
|
|
44
44
|
"zod": "^3.23.8",
|
|
45
|
-
"wave-agent-sdk": "0.14.
|
|
45
|
+
"wave-agent-sdk": "0.14.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react": "^19.1.8",
|