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/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. Replace ALL cursor movement
193
- * codes with spaces before stripping other ANSI codes so regex
194
- * patterns can match the visible text.
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. Replace ALL cursor movement
193
- * codes with spaces before stripping other ANSI codes so regex
194
- * patterns can match the visible text.
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. Replace ALL cursor movement
405
- * codes with spaces before stripping other ANSI codes so regex
406
- * patterns can match the visible text.
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
- return super.stripAnsi(result);
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