coding-agent-adapters 0.4.0 → 0.4.2

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.js CHANGED
@@ -761,7 +761,8 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
761
761
  detectTaskComplete(output) {
762
762
  const stripped = this.stripAnsi(output);
763
763
  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);
764
- const hasIdlePrompt = /❯\s*$/.test(stripped);
764
+ const tail = stripped.slice(-300);
765
+ const hasIdlePrompt = /❯/.test(tail);
765
766
  if (hasDuration && hasIdlePrompt) {
766
767
  return true;
767
768
  }
@@ -775,10 +776,11 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
775
776
  if (/trust.*directory|do you want to|needs? your permission/i.test(stripped)) {
776
777
  return false;
777
778
  }
779
+ const tail = stripped.slice(-300);
778
780
  return stripped.includes("How can I help") || stripped.includes("What would you like") || // v2.1+ shows "for shortcuts" hint when ready
779
781
  stripped.includes("for shortcuts") || // Match "claude> " or similar specific prompts, not bare ">"
780
- /claude>\s*$/i.test(stripped) || // v2.1+ uses ❯ as the input prompt
781
- /❯\s*$/.test(stripped);
782
+ /claude>/i.test(tail) || // v2.1+ uses ❯ as the input prompt
783
+ /❯/.test(tail);
782
784
  }
783
785
  parseOutput(output) {
784
786
  const stripped = this.stripAnsi(output);
@@ -920,7 +922,7 @@ var GeminiAdapter = class extends BaseCodingAdapter {
920
922
  }
921
923
  detectLogin(output) {
922
924
  const stripped = this.stripAnsi(output);
923
- if (stripped.includes("API key not found") || stripped.includes("GOOGLE_API_KEY") || stripped.includes("GEMINI_API_KEY") || stripped.includes("authentication required") || stripped.includes("Invalid API key") || stripped.includes("API key is not valid")) {
925
+ if (stripped.includes("API key not found") || /set (?:GOOGLE_API_KEY|GEMINI_API_KEY)/i.test(stripped) || stripped.includes("authentication required") || stripped.includes("Invalid API key") || stripped.includes("API key is not valid")) {
924
926
  return {
925
927
  required: true,
926
928
  type: "api_key",