-
-
Notifications
You must be signed in to change notification settings - Fork 940
Add Write File Tools to WaveAI #2492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
74d331f
a7a48f8
fe1354c
ae52ac3
6a3b400
7aaa21a
17575df
b9e2365
0367cc2
9b3e732
c9a0400
ed7d421
ed75e09
1075526
02de9a1
478c8c4
84f1cee
0186cfa
c3f691f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ import { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WaveUIMessagePart, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from "@/app/aipanel/aitypes"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { FocusManager } from "@/app/store/focusManager"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { atoms, getOrefMetaKeyAtom } from "@/app/store/global"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { atoms, createBlock, getOrefMetaKeyAtom } from "@/app/store/global"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { globalStore } from "@/app/store/jotaiStore"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import * as WOS from "@/app/store/wos"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { RpcApi } from "@/app/store/wshclientapi"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -412,6 +412,10 @@ export class WaveAIModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getChatId(): string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return globalStore.get(this.chatId); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| toolUseKeepalive(toolcallid: string) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RpcApi.WaveAIToolApproveCommand( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TabRpcClient, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -429,4 +433,23 @@ export class WaveAIModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| approval: approval, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async openDiff(fileName: string, toolcallid: string) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const chatId = this.getChatId(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!chatId || !fileName) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.error("Missing chatId or fileName for opening diff", chatId, fileName); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const blockDef: BlockDef = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| meta: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| view: "aifilediff", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: fileName, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aifilediff:chatid": chatId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aifilediff:toolcallid": toolcallid, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await createBlock(blockDef, false, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+440
to
+457
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate the The validation at line 441 checks Apply this diff to validate all required parameters: - if (!chatId || !fileName) {
- console.error("Missing chatId or fileName for opening diff", chatId, fileName);
+ if (!chatId || !fileName || !toolcallid) {
+ console.error("Missing required parameters for opening diff", { chatId, fileName, toolcallid });
return;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.