wave-code 0.10.3 → 0.11.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/acp/agent.d.ts +1 -0
- package/dist/acp/agent.d.ts.map +1 -1
- package/dist/acp/agent.js +122 -18
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +4 -4
- package/dist/components/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/components/BackgroundTaskManager.js +3 -2
- package/dist/components/ChatInterface.d.ts.map +1 -1
- package/dist/components/ChatInterface.js +2 -1
- package/dist/components/ConfirmationDetails.d.ts.map +1 -1
- package/dist/components/ConfirmationDetails.js +2 -2
- package/dist/components/ConfirmationSelector.d.ts.map +1 -1
- package/dist/components/ConfirmationSelector.js +20 -4
- package/dist/components/InputBox.d.ts +1 -1
- package/dist/components/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox.js +1 -2
- package/dist/components/MessageList.d.ts.map +1 -1
- package/dist/components/MessageList.js +17 -16
- package/dist/constants/commands.d.ts.map +1 -1
- package/dist/constants/commands.js +0 -6
- package/dist/contexts/useChat.d.ts +3 -2
- package/dist/contexts/useChat.d.ts.map +1 -1
- package/dist/contexts/useChat.js +26 -28
- package/dist/hooks/useInputManager.d.ts.map +1 -1
- package/dist/hooks/useInputManager.js +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -1
- package/dist/managers/inputHandlers.d.ts.map +1 -1
- package/dist/managers/inputHandlers.js +7 -8
- package/dist/managers/inputReducer.d.ts +2 -3
- package/dist/managers/inputReducer.d.ts.map +1 -1
- package/dist/managers/inputReducer.js +4 -4
- package/dist/print-cli.d.ts.map +1 -1
- package/dist/print-cli.js +5 -3
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/acp/agent.ts +147 -21
- package/src/cli.tsx +4 -0
- package/src/components/App.tsx +8 -0
- package/src/components/BackgroundTaskManager.tsx +17 -1
- package/src/components/ChatInterface.tsx +3 -1
- package/src/components/ConfirmationDetails.tsx +5 -1
- package/src/components/ConfirmationSelector.tsx +18 -4
- package/src/components/InputBox.tsx +1 -2
- package/src/components/MessageList.tsx +19 -18
- package/src/constants/commands.ts +0 -6
- package/src/contexts/useChat.tsx +43 -34
- package/src/hooks/useInputManager.ts +4 -1
- package/src/index.ts +43 -1
- package/src/managers/inputHandlers.ts +8 -10
- package/src/managers/inputReducer.ts +6 -6
- package/src/print-cli.ts +6 -2
- package/src/types.ts +2 -0
package/dist/contexts/useChat.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useAppConfig } from "./useAppConfig.js";
|
|
|
5
5
|
import { Agent, OPERATION_CANCELLED_BY_USER, } from "wave-agent-sdk";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { displayUsageSummary } from "../utils/usageSummary.js";
|
|
8
|
+
import { expandLongTextPlaceholders } from "../managers/inputHandlers.js";
|
|
8
9
|
const ChatContext = createContext(null);
|
|
9
10
|
export const useChat = () => {
|
|
10
11
|
const context = useContext(ChatContext);
|
|
@@ -13,7 +14,7 @@ export const useChat = () => {
|
|
|
13
14
|
}
|
|
14
15
|
return context;
|
|
15
16
|
};
|
|
16
|
-
export const ChatProvider = ({ children, bypassPermissions, permissionMode: initialPermissionMode, pluginDirs, tools, workdir, worktreeSession, version, model, }) => {
|
|
17
|
+
export const ChatProvider = ({ children, bypassPermissions, permissionMode: initialPermissionMode, pluginDirs, tools, allowedTools, disallowedTools, workdir, worktreeSession, version, model, }) => {
|
|
17
18
|
const { restoreSessionId, continueLastSession } = useAppConfig();
|
|
18
19
|
// Message Display State
|
|
19
20
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -152,6 +153,8 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
152
153
|
stream: false, // 关闭流式模式
|
|
153
154
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
154
155
|
tools,
|
|
156
|
+
allowedTools,
|
|
157
|
+
disallowedTools,
|
|
155
158
|
workdir,
|
|
156
159
|
worktreeName: worktreeSession?.name,
|
|
157
160
|
isNewWorktree: worktreeSession?.isNew,
|
|
@@ -186,6 +189,8 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
186
189
|
showConfirmation,
|
|
187
190
|
pluginDirs,
|
|
188
191
|
tools,
|
|
192
|
+
allowedTools,
|
|
193
|
+
disallowedTools,
|
|
189
194
|
workdir,
|
|
190
195
|
worktreeSession,
|
|
191
196
|
model,
|
|
@@ -213,41 +218,37 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
213
218
|
};
|
|
214
219
|
}, []);
|
|
215
220
|
// Send message function (including judgment logic)
|
|
216
|
-
const sendMessage = useCallback(async (content, images) => {
|
|
221
|
+
const sendMessage = useCallback(async (content, images, longTextMap) => {
|
|
217
222
|
// Check if there's content to send (text content or image attachments)
|
|
218
223
|
const hasTextContent = content.trim();
|
|
219
224
|
const hasImageAttachments = images && images.length > 0;
|
|
220
225
|
if (!hasTextContent && !hasImageAttachments)
|
|
221
226
|
return;
|
|
222
227
|
if (isLoading || isCommandRunning) {
|
|
223
|
-
setQueuedMessages((prev) => [
|
|
228
|
+
setQueuedMessages((prev) => [
|
|
229
|
+
...prev,
|
|
230
|
+
{ content, images, longTextMap },
|
|
231
|
+
]);
|
|
224
232
|
return;
|
|
225
233
|
}
|
|
226
234
|
try {
|
|
235
|
+
const expandedContent = longTextMap
|
|
236
|
+
? expandLongTextPlaceholders(content, longTextMap)
|
|
237
|
+
: content;
|
|
227
238
|
// Handle bash mode - check if it's a bash command (starts with ! and only one line)
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
// Executing bash command will automatically add assistant message
|
|
234
|
-
// Set command running state
|
|
235
|
-
setIsCommandRunning(true);
|
|
236
|
-
try {
|
|
239
|
+
if (expandedContent.startsWith("!") &&
|
|
240
|
+
!expandedContent.includes("\n") &&
|
|
241
|
+
!hasImageAttachments) {
|
|
242
|
+
const command = expandedContent.substring(1).trim();
|
|
243
|
+
if (command) {
|
|
237
244
|
await agentRef.current?.executeBashCommand(command);
|
|
245
|
+
return;
|
|
238
246
|
}
|
|
239
|
-
finally {
|
|
240
|
-
// Clear command running state
|
|
241
|
-
setIsCommandRunning(false);
|
|
242
|
-
}
|
|
243
|
-
return;
|
|
244
247
|
}
|
|
245
|
-
// Handle normal AI message and slash commands
|
|
246
|
-
// Slash commands are now handled internally in agent.sendMessage
|
|
247
248
|
// Set loading state
|
|
248
249
|
setIsLoading(true);
|
|
249
250
|
try {
|
|
250
|
-
await agentRef.current?.sendMessage(
|
|
251
|
+
await agentRef.current?.sendMessage(expandedContent, images);
|
|
251
252
|
}
|
|
252
253
|
finally {
|
|
253
254
|
// Clear loading state
|
|
@@ -264,7 +265,7 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
264
265
|
if (!isLoading && !isCommandRunning && queuedMessages.length > 0) {
|
|
265
266
|
const nextMessage = queuedMessages[0];
|
|
266
267
|
setQueuedMessages((prev) => prev.slice(1));
|
|
267
|
-
sendMessage(nextMessage.content, nextMessage.images);
|
|
268
|
+
sendMessage(nextMessage.content, nextMessage.images, nextMessage.longTextMap);
|
|
268
269
|
}
|
|
269
270
|
}, [isLoading, isCommandRunning, queuedMessages, sendMessage]);
|
|
270
271
|
// Unified interrupt method, interrupt both AI messages and command execution
|
|
@@ -272,10 +273,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
272
273
|
setQueuedMessages([]);
|
|
273
274
|
agentRef.current?.abortMessage();
|
|
274
275
|
}, []);
|
|
275
|
-
const clearMessages = useCallback(() => {
|
|
276
|
-
setQueuedMessages([]);
|
|
277
|
-
agentRef.current?.clearMessages();
|
|
278
|
-
}, []);
|
|
279
276
|
// Permission management methods
|
|
280
277
|
const setPermissionMode = useCallback((mode) => {
|
|
281
278
|
setPermissionModeState((prev) => {
|
|
@@ -409,8 +406,10 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
409
406
|
setIsTaskListVisible((prev) => !prev);
|
|
410
407
|
}
|
|
411
408
|
// Handle ESC key to cancel confirmation
|
|
412
|
-
if (key.escape
|
|
413
|
-
|
|
409
|
+
if (key.escape) {
|
|
410
|
+
if (isConfirmationVisible) {
|
|
411
|
+
handleConfirmationCancel();
|
|
412
|
+
}
|
|
414
413
|
}
|
|
415
414
|
});
|
|
416
415
|
const contextValue = {
|
|
@@ -424,7 +423,6 @@ export const ChatProvider = ({ children, bypassPermissions, permissionMode: init
|
|
|
424
423
|
sessionId,
|
|
425
424
|
sendMessage,
|
|
426
425
|
abortMessage,
|
|
427
|
-
clearMessages,
|
|
428
426
|
latestTotalTokens,
|
|
429
427
|
isCompressing,
|
|
430
428
|
mcpServers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAGL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;;;+
|
|
1
|
+
{"version":3,"file":"useInputManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAGL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,eAAe,GAC1B,YAAW,OAAO,CAAC,qBAAqB,CAAM;;;;;;;;;;;;;;;;;;;;;;+BA6IA,MAAM;;;;;qCAoBA,MAAM;iCAIV,MAAM;;;;;mCAaJ,MAAM;oCAIL,MAAM;wCAIF,MAAM;mCAIX,MAAM;;;;mCASN,MAAM;;;;;sCAkCH,MAAM;uCAIL,MAAM;uCAQN,WAAW;;iCAQjB,MAAM;yCAYE,OAAO;8BAIlB,OAAO;iCAIJ,OAAO;wBAIhB,OAAO;iCAIE,OAAO;iCAIP,OAAO;8BAIV,cAAc;0BAKlB,MAAM,YAAY,MAAM;2BAIvB,MAAM;;;8BAYH,MAAM;mCAW/B,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;uCAYnB,MAAM;;yBAajD,MAAM,OACR,GAAG,kBACQ,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,gBACvD,MAAM,IAAI;yBA5FY,MAAM;kCAIG,MAAM;;CA0LxD,CAAC"}
|
|
@@ -47,7 +47,10 @@ export const useInputManager = (callbacks = {}) => {
|
|
|
47
47
|
const pasteDebounceDelay = parseInt(process.env.PASTE_DEBOUNCE_MS || "30", 10);
|
|
48
48
|
const timer = setTimeout(() => {
|
|
49
49
|
const processedInput = stateRef.current.pasteBuffer.replace(/\r/g, "\n");
|
|
50
|
-
dispatch({
|
|
50
|
+
dispatch({
|
|
51
|
+
type: "INSERT_TEXT_WITH_PLACEHOLDER",
|
|
52
|
+
payload: processedInput,
|
|
53
|
+
});
|
|
51
54
|
dispatch({ type: "END_PASTE" });
|
|
52
55
|
dispatch({ type: "RESET_HISTORY_NAVIGATION" });
|
|
53
56
|
}, pasteDebounceDelay);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,wBAAsB,IAAI,kBA2WzB;AAGD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,16 @@ export async function main() {
|
|
|
72
72
|
description: 'Specify a comma-separated list of tools to enable (e.g., \'Bash,Read,Write\'). Use "" to disable all, "default" for all.',
|
|
73
73
|
type: "string",
|
|
74
74
|
global: false,
|
|
75
|
+
})
|
|
76
|
+
.option("allowed-tools", {
|
|
77
|
+
description: "Specify a comma-separated list of tools to always allow (e.g., 'Bash(ls),Read')",
|
|
78
|
+
type: "string",
|
|
79
|
+
global: false,
|
|
80
|
+
})
|
|
81
|
+
.option("disallowed-tools", {
|
|
82
|
+
description: "Specify a comma-separated list of tools to always disallow (e.g., 'Bash(rm *),Write')",
|
|
83
|
+
type: "string",
|
|
84
|
+
global: false,
|
|
75
85
|
})
|
|
76
86
|
.option("model", {
|
|
77
87
|
description: "Specify the AI model to use",
|
|
@@ -168,9 +178,32 @@ export async function main() {
|
|
|
168
178
|
return undefined;
|
|
169
179
|
if (tools === "")
|
|
170
180
|
return [];
|
|
171
|
-
|
|
181
|
+
// Improved parsing to handle commas inside parentheses
|
|
182
|
+
const result = [];
|
|
183
|
+
let current = "";
|
|
184
|
+
let depth = 0;
|
|
185
|
+
for (let i = 0; i < tools.length; i++) {
|
|
186
|
+
const char = tools[i];
|
|
187
|
+
if (char === "(")
|
|
188
|
+
depth++;
|
|
189
|
+
else if (char === ")")
|
|
190
|
+
depth--;
|
|
191
|
+
if (char === "," && depth === 0) {
|
|
192
|
+
result.push(current.trim());
|
|
193
|
+
current = "";
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
current += char;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (current.trim()) {
|
|
200
|
+
result.push(current.trim());
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
172
203
|
};
|
|
173
204
|
const tools = parseTools(argv.tools);
|
|
205
|
+
const allowedTools = parseTools(argv.allowedTools);
|
|
206
|
+
const disallowedTools = parseTools(argv.disallowedTools);
|
|
174
207
|
// Resolve plugin directories to absolute paths before any worktree logic
|
|
175
208
|
const pluginDirs = argv.pluginDir?.map((dir) => path.resolve(originalCwd, dir));
|
|
176
209
|
let worktreeSession;
|
|
@@ -209,6 +242,8 @@ export async function main() {
|
|
|
209
242
|
permissionMode: argv.permissionMode,
|
|
210
243
|
pluginDirs,
|
|
211
244
|
tools,
|
|
245
|
+
allowedTools,
|
|
246
|
+
disallowedTools,
|
|
212
247
|
worktreeSession,
|
|
213
248
|
workdir,
|
|
214
249
|
version,
|
|
@@ -227,6 +262,8 @@ export async function main() {
|
|
|
227
262
|
permissionMode: argv.permissionMode,
|
|
228
263
|
pluginDirs,
|
|
229
264
|
tools,
|
|
265
|
+
allowedTools,
|
|
266
|
+
disallowedTools,
|
|
230
267
|
worktreeSession,
|
|
231
268
|
workdir,
|
|
232
269
|
version,
|
|
@@ -240,6 +277,8 @@ export async function main() {
|
|
|
240
277
|
permissionMode: argv.permissionMode,
|
|
241
278
|
pluginDirs,
|
|
242
279
|
tools,
|
|
280
|
+
allowedTools,
|
|
281
|
+
disallowedTools,
|
|
243
282
|
worktreeSession,
|
|
244
283
|
workdir,
|
|
245
284
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputHandlers.d.ts","sourceRoot":"","sources":["../../src/managers/inputHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,K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AAC,EACzC,UAAU,MAAM;;;CAmBjB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,UAAU,EACjB,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EACrC,gBAAgB,MAAM,KACrB,OAMF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,UAAU,EACjB,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EACrC,gBAAgB,MAAM,KACrB,OAMF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,UAAU,EACjB,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EACrC,WAAW,OAAO,CAAC,qBAAqB,CAAC,EACzC,OAAO,MAAM,EACb,KAAK,GAAG,KACP,OA4EF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,UAAU,EACjB,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EACrC,WAAW,OAAO,CAAC,qBAAqB,CAAC,EACzC,OAAO,MAAM,EACb,KAAK,GAAG,EACR,cAAc,MAAM,IAAI,KACvB,OAAO,CAAC,OAAO,CA8JjB,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,OAAO,UAAU,EACjB,UAAU,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,EACrC,WAAW,OAAO,CAAC,qBAAqB,CAAC,EACzC,OAAO,MAAM,EACb,KAAK,GAAG,EACR,cAAc,MAAM,IAAI,KACvB,OAAO,CAAC,OAAO,CAsFjB,CAAC"}
|
|
@@ -28,11 +28,10 @@ export const handleSubmit = async (state, dispatch, callbacks, attachedImagesOve
|
|
|
28
28
|
const contentWithPlaceholders = state.inputText
|
|
29
29
|
.replace(imageRegex, "")
|
|
30
30
|
.trim();
|
|
31
|
-
const cleanContent = expandLongTextPlaceholders(contentWithPlaceholders, state.longTextMap);
|
|
32
31
|
PromptHistoryManager.addEntry(contentWithPlaceholders, callbacks.sessionId, state.longTextMap, callbacks.workdir).catch((err) => {
|
|
33
32
|
callbacks.logger?.error("Failed to save prompt history", err);
|
|
34
33
|
});
|
|
35
|
-
callbacks.onSendMessage?.(
|
|
34
|
+
callbacks.onSendMessage?.(contentWithPlaceholders, referencedImages.length > 0 ? referencedImages : undefined, state.longTextMap);
|
|
36
35
|
dispatch({ type: "CLEAR_INPUT" });
|
|
37
36
|
dispatch({ type: "RESET_HISTORY_NAVIGATION" });
|
|
38
37
|
dispatch({ type: "CLEAR_LONG_TEXT_MAP" });
|
|
@@ -218,7 +217,7 @@ export const handleCommandSelect = (state, dispatch, callbacks, command) => {
|
|
|
218
217
|
if (callbacks.onSendMessage && callbacks.onHasSlashCommand?.(command)) {
|
|
219
218
|
const fullCommand = `/${command}`;
|
|
220
219
|
try {
|
|
221
|
-
await callbacks.onSendMessage(fullCommand);
|
|
220
|
+
await callbacks.onSendMessage(fullCommand, undefined, {});
|
|
222
221
|
commandExecuted = true;
|
|
223
222
|
}
|
|
224
223
|
catch (error) {
|
|
@@ -226,11 +225,11 @@ export const handleCommandSelect = (state, dispatch, callbacks, command) => {
|
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
227
|
if (!commandExecuted) {
|
|
229
|
-
if (command === "
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
if (command === "tasks") {
|
|
229
|
+
dispatch({
|
|
230
|
+
type: "SET_SHOW_BACKGROUND_TASK_MANAGER",
|
|
231
|
+
payload: true,
|
|
232
|
+
});
|
|
234
233
|
}
|
|
235
234
|
else if (command === "mcp") {
|
|
236
235
|
dispatch({ type: "SET_SHOW_MCP_MANAGER", payload: true });
|
|
@@ -20,10 +20,9 @@ export interface InputManagerCallbacks {
|
|
|
20
20
|
onSendMessage?: (content: string, images?: Array<{
|
|
21
21
|
path: string;
|
|
22
22
|
mimeType: string;
|
|
23
|
-
}>) => void | Promise<void>;
|
|
23
|
+
}>, longTextMap?: Record<string, string>) => void | Promise<void>;
|
|
24
24
|
onHasSlashCommand?: (commandId: string) => boolean;
|
|
25
25
|
onAbortMessage?: () => void;
|
|
26
|
-
onClearMessages?: () => void;
|
|
27
26
|
onBackgroundCurrentTask?: () => void;
|
|
28
27
|
onPermissionModeChange?: (mode: PermissionMode) => void;
|
|
29
28
|
sessionId?: string;
|
|
@@ -144,7 +143,7 @@ export type InputAction = {
|
|
|
144
143
|
type: "SET_SELECTOR_JUST_USED";
|
|
145
144
|
payload: boolean;
|
|
146
145
|
} | {
|
|
147
|
-
type: "
|
|
146
|
+
type: "INSERT_TEXT_WITH_PLACEHOLDER";
|
|
148
147
|
payload: string;
|
|
149
148
|
} | {
|
|
150
149
|
type: "CLEAR_LONG_TEXT_MAP";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputReducer.d.ts","sourceRoot":"","sources":["../../src/managers/inputReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,MAAM,EACN,WAAW,EACX,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,yBAAyB,CAAC,EAAE,CAC1B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,4BAA4B,CAAC,EAAE,CAC7B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,0BAA0B,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KA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E;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,GACD;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,0BAA0B,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE3D,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,GAClB,UAAU,CAiUZ"}
|
|
@@ -197,15 +197,15 @@ export function inputReducer(state, action) {
|
|
|
197
197
|
return { ...state, permissionMode: action.payload };
|
|
198
198
|
case "SET_SELECTOR_JUST_USED":
|
|
199
199
|
return { ...state, selectorJustUsed: action.payload };
|
|
200
|
-
case "
|
|
200
|
+
case "INSERT_TEXT_WITH_PLACEHOLDER": {
|
|
201
201
|
let textToInsert = action.payload;
|
|
202
202
|
let newLongTextCounter = state.longTextCounter;
|
|
203
203
|
const newLongTextMap = { ...state.longTextMap };
|
|
204
204
|
if (textToInsert.length > 200) {
|
|
205
205
|
newLongTextCounter += 1;
|
|
206
|
-
const
|
|
207
|
-
newLongTextMap[
|
|
208
|
-
textToInsert =
|
|
206
|
+
const placeholderLabel = `[LongText#${newLongTextCounter}]`;
|
|
207
|
+
newLongTextMap[placeholderLabel] = textToInsert;
|
|
208
|
+
textToInsert = placeholderLabel;
|
|
209
209
|
}
|
|
210
210
|
const beforeCursor = state.inputText.substring(0, state.cursorPosition);
|
|
211
211
|
const afterCursor = state.inputText.substring(state.cursorPosition);
|
package/dist/print-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-cli.d.ts","sourceRoot":"","sources":["../src/print-cli.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAgBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"print-cli.d.ts","sourceRoot":"","sources":["../src/print-cli.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAgBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA4M3E"}
|
package/dist/print-cli.js
CHANGED
|
@@ -14,8 +14,8 @@ function displayTimingInfo(startTime, showStats) {
|
|
|
14
14
|
}
|
|
15
15
|
export async function startPrintCli(options) {
|
|
16
16
|
const startTime = new Date();
|
|
17
|
-
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, permissionMode, pluginDirs, tools, worktreeSession, workdir, model, } = options;
|
|
18
|
-
if ((
|
|
17
|
+
const { restoreSessionId, continueLastSession, message, showStats = false, bypassPermissions, permissionMode, pluginDirs, tools, allowedTools, disallowedTools, worktreeSession, workdir, model, } = options;
|
|
18
|
+
if ((typeof message !== "string" || message.trim() === "") &&
|
|
19
19
|
!continueLastSession &&
|
|
20
20
|
!restoreSessionId) {
|
|
21
21
|
console.error("Print mode requires a message: use --print 'your message' or -p 'your message'");
|
|
@@ -99,12 +99,14 @@ export async function startPrintCli(options) {
|
|
|
99
99
|
permissionMode: permissionMode || (bypassPermissions ? "bypassPermissions" : undefined),
|
|
100
100
|
plugins: pluginDirs?.map((path) => ({ type: "local", path })),
|
|
101
101
|
tools,
|
|
102
|
+
allowedTools,
|
|
103
|
+
disallowedTools,
|
|
102
104
|
workdir,
|
|
103
105
|
model,
|
|
104
106
|
// 保持流式模式以获得更好的命令行用户体验
|
|
105
107
|
});
|
|
106
108
|
// Send message if provided and not empty
|
|
107
|
-
if (message && message.trim() !== "") {
|
|
109
|
+
if (typeof message === "string" && message.trim() !== "") {
|
|
108
110
|
await agent.sendMessage(message);
|
|
109
111
|
}
|
|
110
112
|
// Display usage summary before exit
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"yargs": "^17.7.2",
|
|
42
42
|
"@agentclientprotocol/sdk": "0.16.1",
|
|
43
43
|
"zod": "^3.23.8",
|
|
44
|
-
"wave-agent-sdk": "0.
|
|
44
|
+
"wave-agent-sdk": "0.11.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "^19.1.8",
|