wave-code 0.11.4 → 0.11.6
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.map +1 -1
- package/dist/acp/agent.js +17 -5
- package/package.json +2 -2
- package/src/acp/agent.ts +20 -5
package/dist/acp/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/acp/agent.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,KAAK,IAAI,QAAQ,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAUzB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EAMpC,MAAM,0BAA0B,CAAC;AAElC,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,UAAU,CAAsB;gBAE5B,UAAU,EAAE,mBAAmB;IAI3C,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,uBAAuB;YAmBjB,gBAAgB;IASxB,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAwBzC,YAAY,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAI5C,WAAW;IAiEnB,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAalE,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAWrE,YAAY,CAChB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC;I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_USER_QUESTION_TOOL_NAME) {
|
|
370
|
+
options = [];
|
|
371
|
+
}
|
|
369
372
|
const content = context.toolName
|
|
370
373
|
? this.getToolContent(context.toolName, context.toolInput, undefined, context.planContent)
|
|
371
374
|
: undefined;
|
|
@@ -392,6 +395,12 @@ export class WaveAcpAgent {
|
|
|
392
395
|
if (response.outcome.outcome === "cancelled") {
|
|
393
396
|
return { behavior: "deny", message: "Cancelled by user" };
|
|
394
397
|
}
|
|
398
|
+
if (context.toolName === ASK_USER_QUESTION_TOOL_NAME) {
|
|
399
|
+
return {
|
|
400
|
+
behavior: "allow",
|
|
401
|
+
message: response.message,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
395
404
|
const selectedOptionId = response.outcome.optionId;
|
|
396
405
|
logger.info(`User selected permission option: ${selectedOptionId}`);
|
|
397
406
|
switch (selectedOptionId) {
|
|
@@ -438,7 +447,7 @@ export class WaveAcpAgent {
|
|
|
438
447
|
getToolContent(name, parameters, shortResult, planContent) {
|
|
439
448
|
const contents = [];
|
|
440
449
|
if (parameters) {
|
|
441
|
-
if (name ===
|
|
450
|
+
if (name === WRITE_TOOL_NAME &&
|
|
442
451
|
typeof parameters.file_path === "string" &&
|
|
443
452
|
typeof parameters.content === "string") {
|
|
444
453
|
contents.push({
|
|
@@ -448,7 +457,7 @@ export class WaveAcpAgent {
|
|
|
448
457
|
newText: parameters.content,
|
|
449
458
|
});
|
|
450
459
|
}
|
|
451
|
-
else if (name ===
|
|
460
|
+
else if (name === EDIT_TOOL_NAME &&
|
|
452
461
|
typeof parameters.file_path === "string" &&
|
|
453
462
|
typeof parameters.old_string === "string" &&
|
|
454
463
|
typeof parameters.new_string === "string") {
|
|
@@ -459,12 +468,13 @@ export class WaveAcpAgent {
|
|
|
459
468
|
newText: parameters.new_string,
|
|
460
469
|
});
|
|
461
470
|
}
|
|
462
|
-
else if (name ===
|
|
471
|
+
else if (name === BASH_TOOL_NAME &&
|
|
472
|
+
typeof parameters.command === "string") {
|
|
463
473
|
contents.push({
|
|
464
474
|
type: "content",
|
|
465
475
|
content: {
|
|
466
476
|
type: "text",
|
|
467
|
-
text: parameters.command,
|
|
477
|
+
text: "**Command:**\n```bash\n" + parameters.command + "\n```",
|
|
468
478
|
},
|
|
469
479
|
});
|
|
470
480
|
}
|
|
@@ -504,7 +514,9 @@ export class WaveAcpAgent {
|
|
|
504
514
|
type: "content",
|
|
505
515
|
content: {
|
|
506
516
|
type: "text",
|
|
507
|
-
text:
|
|
517
|
+
text: name === BASH_TOOL_NAME
|
|
518
|
+
? "```\n" + shortResult + "\n```"
|
|
519
|
+
: shortResult,
|
|
508
520
|
},
|
|
509
521
|
});
|
|
510
522
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
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
|
"react-dom": "19.2.4",
|
|
42
42
|
"yargs": "^17.7.2",
|
|
43
43
|
"zod": "^3.23.8",
|
|
44
|
-
"wave-agent-sdk": "0.11.
|
|
44
|
+
"wave-agent-sdk": "0.11.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "^19.1.8",
|
package/src/acp/agent.ts
CHANGED
|
@@ -502,6 +502,8 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
502
502
|
kind: "allow_always",
|
|
503
503
|
},
|
|
504
504
|
];
|
|
505
|
+
} else if (context.toolName === ASK_USER_QUESTION_TOOL_NAME) {
|
|
506
|
+
options = [];
|
|
505
507
|
}
|
|
506
508
|
|
|
507
509
|
const content = context.toolName
|
|
@@ -538,6 +540,13 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
538
540
|
return { behavior: "deny", message: "Cancelled by user" };
|
|
539
541
|
}
|
|
540
542
|
|
|
543
|
+
if (context.toolName === ASK_USER_QUESTION_TOOL_NAME) {
|
|
544
|
+
return {
|
|
545
|
+
behavior: "allow",
|
|
546
|
+
message: (response as unknown as { message?: string }).message,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
|
|
541
550
|
const selectedOptionId = response.outcome.optionId;
|
|
542
551
|
logger.info(`User selected permission option: ${selectedOptionId}`);
|
|
543
552
|
|
|
@@ -593,7 +602,7 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
593
602
|
const contents: ToolCallContent[] = [];
|
|
594
603
|
if (parameters) {
|
|
595
604
|
if (
|
|
596
|
-
name ===
|
|
605
|
+
name === WRITE_TOOL_NAME &&
|
|
597
606
|
typeof parameters.file_path === "string" &&
|
|
598
607
|
typeof parameters.content === "string"
|
|
599
608
|
) {
|
|
@@ -604,7 +613,7 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
604
613
|
newText: parameters.content,
|
|
605
614
|
});
|
|
606
615
|
} else if (
|
|
607
|
-
name ===
|
|
616
|
+
name === EDIT_TOOL_NAME &&
|
|
608
617
|
typeof parameters.file_path === "string" &&
|
|
609
618
|
typeof parameters.old_string === "string" &&
|
|
610
619
|
typeof parameters.new_string === "string"
|
|
@@ -615,12 +624,15 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
615
624
|
oldText: parameters.old_string,
|
|
616
625
|
newText: parameters.new_string,
|
|
617
626
|
});
|
|
618
|
-
} else if (
|
|
627
|
+
} else if (
|
|
628
|
+
name === BASH_TOOL_NAME &&
|
|
629
|
+
typeof parameters.command === "string"
|
|
630
|
+
) {
|
|
619
631
|
contents.push({
|
|
620
632
|
type: "content",
|
|
621
633
|
content: {
|
|
622
634
|
type: "text",
|
|
623
|
-
text: parameters.command,
|
|
635
|
+
text: "**Command:**\n```bash\n" + parameters.command + "\n```",
|
|
624
636
|
},
|
|
625
637
|
});
|
|
626
638
|
} else if (name === EXIT_PLAN_MODE_TOOL_NAME && planContent) {
|
|
@@ -664,7 +676,10 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
664
676
|
type: "content",
|
|
665
677
|
content: {
|
|
666
678
|
type: "text",
|
|
667
|
-
text:
|
|
679
|
+
text:
|
|
680
|
+
name === BASH_TOOL_NAME
|
|
681
|
+
? "```\n" + shortResult + "\n```"
|
|
682
|
+
: shortResult,
|
|
668
683
|
},
|
|
669
684
|
});
|
|
670
685
|
}
|