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/README.md
CHANGED
|
@@ -53,7 +53,9 @@ session.send('Help me refactor this function to use async/await');
|
|
|
53
53
|
|
|
54
54
|
## Session Lifecycle Detection
|
|
55
55
|
|
|
56
|
-
Each adapter implements detection for every stage of a CLI session
|
|
56
|
+
Each adapter implements detection for every stage of a CLI session.
|
|
57
|
+
|
|
58
|
+
All detection methods use `stripAnsi()` which strips ANSI escape sequences, cursor positioning codes, bare control characters, TUI spinner/box-drawing characters, and collapses whitespace — ensuring regex patterns match through raw terminal output. Prompt indicators (`❯`, `›`, `◇`) are preserved.
|
|
57
59
|
|
|
58
60
|
### Login / Auth Detection
|
|
59
61
|
|
|
@@ -129,7 +131,7 @@ aider.detectLoading('code> '); // false
|
|
|
129
131
|
|
|
130
132
|
### Task Completion Detection
|
|
131
133
|
|
|
132
|
-
Each adapter implements `detectTaskComplete(output)` to recognize when the CLI has finished a task and returned to its idle prompt. This is more specific than `detectReady()` — it matches high-confidence completion indicators (duration summaries, explicit done messages) that short-circuit the LLM stall classifier in pty-manager.
|
|
134
|
+
Each adapter implements `detectTaskComplete(output)` to recognize when the CLI has finished a task and returned to its idle prompt. This is more specific than `detectReady()` — it matches high-confidence completion indicators (duration summaries, explicit done messages) that short-circuit the LLM stall classifier in pty-manager. Patterns match through raw ANSI-laden TUI output including spinner characters and cursor positioning codes.
|
|
133
135
|
|
|
134
136
|
| Adapter | Completion Indicators | Source Patterns |
|
|
135
137
|
|---------|----------------------|----------------|
|
package/dist/index.cjs
CHANGED
|
@@ -401,17 +401,27 @@ var BaseCodingAdapter = class extends ptyManager.BaseCLIAdapter {
|
|
|
401
401
|
return adapterConfig?.interactive === true;
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
|
-
* Override stripAnsi to handle TUI cursor movement codes
|
|
404
|
+
* Override stripAnsi to handle TUI cursor movement codes, spinner/box-drawing
|
|
405
|
+
* characters, bare control characters, and extra whitespace.
|
|
406
|
+
*
|
|
405
407
|
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
406
|
-
* sequences instead of literal spaces
|
|
407
|
-
*
|
|
408
|
-
*
|
|
408
|
+
* sequences instead of literal spaces, and render decorative Unicode
|
|
409
|
+
* characters (spinners, box-drawing). All of these must be stripped so
|
|
410
|
+
* adapter detection methods (detectReady, detectTaskComplete, etc.) can
|
|
411
|
+
* match visible text with their regex patterns.
|
|
412
|
+
*
|
|
413
|
+
* Note: ❯ and › are preserved — they are prompt indicators used by
|
|
414
|
+
* detectReady / detectTaskComplete.
|
|
409
415
|
*/
|
|
410
416
|
stripAnsi(str) {
|
|
411
417
|
let result = str.replace(/\x1b\[\d*[CDABGdEF]/g, " ");
|
|
412
418
|
result = result.replace(/\x1b\[\d*(?:;\d+)?[Hf]/g, " ");
|
|
413
419
|
result = result.replace(/\x1b\[\d*[JK]/g, " ");
|
|
414
|
-
|
|
420
|
+
result = super.stripAnsi(result);
|
|
421
|
+
result = result.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
422
|
+
result = result.replace(/[│╭╰╮╯─═╌║╔╗╚╝╠╣╦╩╬┌┐└┘├┤┬┴┼●○❮▶◀⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⣾⣽⣻⢿⡿⣟⣯⣷✻✶✳✢⏺←→↑↓⬆⬇◆▪▫■□▲△▼▽◈⟨⟩⌘⏎⏏⌫⌦⇧⇪⌥]/g, " ");
|
|
423
|
+
result = result.replace(/ {2,}/g, " ");
|
|
424
|
+
return result;
|
|
415
425
|
}
|
|
416
426
|
/**
|
|
417
427
|
* Override detectExit to include installation instructions
|