coding-agent-adapters 0.4.0 → 0.4.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 CHANGED
@@ -100,7 +100,7 @@ Each adapter implements `detectTaskComplete(output)` to recognize when the CLI h
100
100
 
101
101
  | Adapter | Completion Indicators | Source Patterns |
102
102
  |---------|----------------------|----------------|
103
- | Claude | Turn duration (`Cooked for 3m 12s`, custom verb) + `❯` prompt | `claude_completed_turn_duration` |
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
106
  | Aider | `Aider is waiting for your input`, mode prompts with edit/cost markers | `aider_completed_llm_response_ready` |
package/dist/index.cjs CHANGED
@@ -763,7 +763,8 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
763
763
  detectTaskComplete(output) {
764
764
  const stripped = this.stripAnsi(output);
765
765
  const hasDuration = /[A-Z][A-Za-z' -]{2,40}\s+for\s+\d+(?:h\s+\d{1,2}m\s+\d{1,2}s|m\s+\d{1,2}s|s)/.test(stripped);
766
- const hasIdlePrompt = /❯\s*$/.test(stripped);
766
+ const tail = stripped.slice(-300);
767
+ const hasIdlePrompt = /❯/.test(tail);
767
768
  if (hasDuration && hasIdlePrompt) {
768
769
  return true;
769
770
  }
@@ -777,10 +778,11 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
777
778
  if (/trust.*directory|do you want to|needs? your permission/i.test(stripped)) {
778
779
  return false;
779
780
  }
781
+ const tail = stripped.slice(-300);
780
782
  return stripped.includes("How can I help") || stripped.includes("What would you like") || // v2.1+ shows "for shortcuts" hint when ready
781
783
  stripped.includes("for shortcuts") || // Match "claude> " or similar specific prompts, not bare ">"
782
- /claude>\s*$/i.test(stripped) || // v2.1+ uses ❯ as the input prompt
783
- /❯\s*$/.test(stripped);
784
+ /claude>/i.test(tail) || // v2.1+ uses ❯ as the input prompt
785
+ /❯/.test(tail);
784
786
  }
785
787
  parseOutput(output) {
786
788
  const stripped = this.stripAnsi(output);