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/README.md
CHANGED
|
@@ -103,7 +103,7 @@ Each adapter implements `detectTaskComplete(output)` to recognize when the CLI h
|
|
|
103
103
|
| Claude | Turn duration (`Cooked for 3m 12s`, custom verb) + `❯` prompt (tolerates trailing status bar) | `claude_completed_turn_duration` |
|
|
104
104
|
| Gemini | `◇ Ready` window title, `Type your message` composer | `gemini_ready_title` |
|
|
105
105
|
| Codex | `Worked for 1m 05s` separator + `›` prompt | `codex_completed_worked_for_separator`, `codex_ready_prompt` |
|
|
106
|
-
| Aider | `Aider is waiting for your input`, mode prompts with edit/cost markers | `aider_completed_llm_response_ready` |
|
|
106
|
+
| Aider | `Aider is waiting for your input`, mode prompts (including plain `>`) with edit/cost markers | `aider_completed_llm_response_ready` |
|
|
107
107
|
|
|
108
108
|
```typescript
|
|
109
109
|
const claude = new ClaudeAdapter();
|
package/dist/index.cjs
CHANGED
|
@@ -395,14 +395,17 @@ var BaseCodingAdapter = class extends ptyManager.BaseCLIAdapter {
|
|
|
395
395
|
return adapterConfig?.interactive === true;
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
|
-
* Override stripAnsi to handle TUI cursor
|
|
399
|
-
* TUI CLIs (Claude Code, Gemini CLI) use
|
|
400
|
-
* instead of literal spaces
|
|
401
|
-
* before stripping other ANSI codes so regex
|
|
398
|
+
* Override stripAnsi to handle TUI cursor movement codes.
|
|
399
|
+
* TUI CLIs (Claude Code, Gemini CLI, Codex) use cursor positioning
|
|
400
|
+
* sequences instead of literal spaces. Replace ALL cursor movement
|
|
401
|
+
* codes with spaces before stripping other ANSI codes so regex
|
|
402
|
+
* patterns can match the visible text.
|
|
402
403
|
*/
|
|
403
404
|
stripAnsi(str) {
|
|
404
|
-
|
|
405
|
-
|
|
405
|
+
let result = str.replace(/\x1b\[\d*[CDABGdEF]/g, " ");
|
|
406
|
+
result = result.replace(/\x1b\[\d*(?:;\d+)?[Hf]/g, " ");
|
|
407
|
+
result = result.replace(/\x1b\[\d*[JK]/g, " ");
|
|
408
|
+
return super.stripAnsi(result);
|
|
406
409
|
}
|
|
407
410
|
/**
|
|
408
411
|
* Override detectExit to include installation instructions
|
|
@@ -548,7 +551,7 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
|
|
|
548
551
|
*/
|
|
549
552
|
autoResponseRules = [
|
|
550
553
|
{
|
|
551
|
-
pattern: /trust.*folder|safety.?check|project.you.created/i,
|
|
554
|
+
pattern: /trust.*(?:folder|directory)|safety.?check|project.you.created|(?:Yes|Allow).*(?:No|Deny).*(?:Enter|Return)/i,
|
|
552
555
|
type: "permission",
|
|
553
556
|
response: "",
|
|
554
557
|
responseType: "keys",
|
|
@@ -1806,7 +1809,7 @@ var AiderAdapter = class extends BaseCodingAdapter {
|
|
|
1806
1809
|
if (/Aider\s+is\s+waiting\s+for\s+your\s+input/.test(stripped)) {
|
|
1807
1810
|
return true;
|
|
1808
1811
|
}
|
|
1809
|
-
const hasPrompt = /(?:ask|code|architect)(?:\s+multi)?>\s*$/m.test(stripped);
|
|
1812
|
+
const hasPrompt = /(?:(?:ask|code|architect)(?:\s+multi)?)?>\s*$/m.test(stripped);
|
|
1810
1813
|
if (hasPrompt) {
|
|
1811
1814
|
const hasEditMarkers = /Applied edit to|Commit [a-f0-9]+|wrote to|Updated/i.test(stripped);
|
|
1812
1815
|
const hasTokenUsage = /Tokens:|Cost:/i.test(stripped);
|