coding-agent-adapters 0.7.0 → 0.7.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/README.md +4 -2
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -187,11 +187,17 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
187
187
|
*/
|
|
188
188
|
abstract getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations;
|
|
189
189
|
/**
|
|
190
|
-
* Override stripAnsi to handle TUI cursor movement codes
|
|
190
|
+
* Override stripAnsi to handle TUI cursor movement codes, spinner/box-drawing
|
|
191
|
+
* characters, bare control characters, and extra whitespace.
|
|
192
|
+
*
|
|
191
193
|
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
192
|
-
* sequences instead of literal spaces
|
|
193
|
-
*
|
|
194
|
-
*
|
|
194
|
+
* sequences instead of literal spaces, and render decorative Unicode
|
|
195
|
+
* characters (spinners, box-drawing). All of these must be stripped so
|
|
196
|
+
* adapter detection methods (detectReady, detectTaskComplete, etc.) can
|
|
197
|
+
* match visible text with their regex patterns.
|
|
198
|
+
*
|
|
199
|
+
* Note: ❯ and › are preserved — they are prompt indicators used by
|
|
200
|
+
* detectReady / detectTaskComplete.
|
|
195
201
|
*/
|
|
196
202
|
protected stripAnsi(str: string): string;
|
|
197
203
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -187,11 +187,17 @@ declare abstract class BaseCodingAdapter extends BaseCLIAdapter {
|
|
|
187
187
|
*/
|
|
188
188
|
abstract getRecommendedModels(credentials?: AgentCredentials): ModelRecommendations;
|
|
189
189
|
/**
|
|
190
|
-
* Override stripAnsi to handle TUI cursor movement codes
|
|
190
|
+
* Override stripAnsi to handle TUI cursor movement codes, spinner/box-drawing
|
|
191
|
+
* characters, bare control characters, and extra whitespace.
|
|
192
|
+
*
|
|
191
193
|
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
192
|
-
* sequences instead of literal spaces
|
|
193
|
-
*
|
|
194
|
-
*
|
|
194
|
+
* sequences instead of literal spaces, and render decorative Unicode
|
|
195
|
+
* characters (spinners, box-drawing). All of these must be stripped so
|
|
196
|
+
* adapter detection methods (detectReady, detectTaskComplete, etc.) can
|
|
197
|
+
* match visible text with their regex patterns.
|
|
198
|
+
*
|
|
199
|
+
* Note: ❯ and › are preserved — they are prompt indicators used by
|
|
200
|
+
* detectReady / detectTaskComplete.
|
|
195
201
|
*/
|
|
196
202
|
protected stripAnsi(str: string): string;
|
|
197
203
|
/**
|
package/dist/index.js
CHANGED
|
@@ -399,17 +399,27 @@ var BaseCodingAdapter = class extends BaseCLIAdapter {
|
|
|
399
399
|
return adapterConfig?.interactive === true;
|
|
400
400
|
}
|
|
401
401
|
/**
|
|
402
|
-
* Override stripAnsi to handle TUI cursor movement codes
|
|
402
|
+
* Override stripAnsi to handle TUI cursor movement codes, spinner/box-drawing
|
|
403
|
+
* characters, bare control characters, and extra whitespace.
|
|
404
|
+
*
|
|
403
405
|
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
404
|
-
* sequences instead of literal spaces
|
|
405
|
-
*
|
|
406
|
-
*
|
|
406
|
+
* sequences instead of literal spaces, and render decorative Unicode
|
|
407
|
+
* characters (spinners, box-drawing). All of these must be stripped so
|
|
408
|
+
* adapter detection methods (detectReady, detectTaskComplete, etc.) can
|
|
409
|
+
* match visible text with their regex patterns.
|
|
410
|
+
*
|
|
411
|
+
* Note: ❯ and › are preserved — they are prompt indicators used by
|
|
412
|
+
* detectReady / detectTaskComplete.
|
|
407
413
|
*/
|
|
408
414
|
stripAnsi(str) {
|
|
409
415
|
let result = str.replace(/\x1b\[\d*[CDABGdEF]/g, " ");
|
|
410
416
|
result = result.replace(/\x1b\[\d*(?:;\d+)?[Hf]/g, " ");
|
|
411
417
|
result = result.replace(/\x1b\[\d*[JK]/g, " ");
|
|
412
|
-
|
|
418
|
+
result = super.stripAnsi(result);
|
|
419
|
+
result = result.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
420
|
+
result = result.replace(/[│╭╰╮╯─═╌║╔╗╚╝╠╣╦╩╬┌┐└┘├┤┬┴┼●○❮▶◀⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⣾⣽⣻⢿⡿⣟⣯⣷✻✶✳✢⏺←→↑↓⬆⬇◆▪▫■□▲△▼▽◈⟨⟩⌘⏎⏏⌫⌦⇧⇪⌥]/g, " ");
|
|
421
|
+
result = result.replace(/ {2,}/g, " ");
|
|
422
|
+
return result;
|
|
413
423
|
}
|
|
414
424
|
/**
|
|
415
425
|
* Override detectExit to include installation instructions
|