coding-agent-adapters 0.4.2 → 0.4.3
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/README.md +1 -1
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -181,10 +181,11 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
181
181
|
*/
|
|
182
182
|
abstract getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations;
|
|
183
183
|
/**
|
|
184
|
-
* Override stripAnsi to handle TUI cursor
|
|
185
|
-
* TUI CLIs (Claude Code, Gemini CLI) use
|
|
186
|
-
* instead of literal spaces
|
|
187
|
-
* before stripping other ANSI codes so regex
|
|
184
|
+
* Override stripAnsi to handle TUI cursor movement codes.
|
|
185
|
+
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
186
|
+
* sequences instead of literal spaces. Replace ALL cursor movement
|
|
187
|
+
* codes with spaces before stripping other ANSI codes so regex
|
|
188
|
+
* patterns can match the visible text.
|
|
188
189
|
*/
|
|
189
190
|
protected stripAnsi(str: string): string;
|
|
190
191
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -181,10 +181,11 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
181
181
|
*/
|
|
182
182
|
abstract getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations;
|
|
183
183
|
/**
|
|
184
|
-
* Override stripAnsi to handle TUI cursor
|
|
185
|
-
* TUI CLIs (Claude Code, Gemini CLI) use
|
|
186
|
-
* instead of literal spaces
|
|
187
|
-
* before stripping other ANSI codes so regex
|
|
184
|
+
* Override stripAnsi to handle TUI cursor movement codes.
|
|
185
|
+
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
186
|
+
* sequences instead of literal spaces. Replace ALL cursor movement
|
|
187
|
+
* codes with spaces before stripping other ANSI codes so regex
|
|
188
|
+
* patterns can match the visible text.
|
|
188
189
|
*/
|
|
189
190
|
protected stripAnsi(str: string): string;
|
|
190
191
|
/**
|
package/dist/index.js
CHANGED
|
@@ -393,14 +393,17 @@ var BaseCodingAdapter = class extends BaseCLIAdapter {
|
|
|
393
393
|
return adapterConfig?.interactive === true;
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
|
-
* Override stripAnsi to handle TUI cursor
|
|
397
|
-
* TUI CLIs (Claude Code, Gemini CLI) use
|
|
398
|
-
* instead of literal spaces
|
|
399
|
-
* before stripping other ANSI codes so regex
|
|
396
|
+
* Override stripAnsi to handle TUI cursor movement codes.
|
|
397
|
+
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
398
|
+
* sequences instead of literal spaces. Replace ALL cursor movement
|
|
399
|
+
* codes with spaces before stripping other ANSI codes so regex
|
|
400
|
+
* patterns can match the visible text.
|
|
400
401
|
*/
|
|
401
402
|
stripAnsi(str) {
|
|
402
|
-
|
|
403
|
-
|
|
403
|
+
let result = str.replace(/\x1b\[\d*[CDABGdEF]/g, " ");
|
|
404
|
+
result = result.replace(/\x1b\[\d*(?:;\d+)?[Hf]/g, " ");
|
|
405
|
+
result = result.replace(/\x1b\[\d*[JK]/g, " ");
|
|
406
|
+
return super.stripAnsi(result);
|
|
404
407
|
}
|
|
405
408
|
/**
|
|
406
409
|
* Override detectExit to include installation instructions
|
|
@@ -546,7 +549,7 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
546
549
|
*/
|
|
547
550
|
autoResponseRules = [
|
|
548
551
|
{
|
|
549
|
-
pattern: /trust.*folder|safety.?check|project.you.created/i,
|
|
552
|
+
pattern: /trust.*(?:folder|directory)|safety.?check|project.you.created|(?:Yes|Allow).*(?:No|Deny).*(?:Enter|Return)/i,
|
|
550
553
|
type: "permission",
|
|
551
554
|
response: "",
|
|
552
555
|
responseType: "keys",
|
|
@@ -1804,7 +1807,7 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
1804
1807
|
if (/Aider\s+is\s+waiting\s+for\s+your\s+input/.test(stripped)) {
|
|
1805
1808
|
return true;
|
|
1806
1809
|
}
|
|
1807
|
-
const hasPrompt = /(?:ask|code|architect)(?:\s+multi)?>\s*$/m.test(stripped);
|
|
1810
|
+
const hasPrompt = /(?:(?:ask|code|architect)(?:\s+multi)?)?>\s*$/m.test(stripped);
|
|
1808
1811
|
if (hasPrompt) {
|
|
1809
1812
|
const hasEditMarkers = /Applied edit to|Commit [a-f0-9]+|wrote to|Updated/i.test(stripped);
|
|
1810
1813
|
const hasTokenUsage = /Tokens:|Cost:/i.test(stripped);
|