coding-agent-adapters 0.7.4 → 0.8.0

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.cjs CHANGED
@@ -611,6 +611,15 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
611
611
  description: "Decline anonymous usage data",
612
612
  safe: true
613
613
  },
614
+ {
615
+ pattern: /how is claude doing this session\?\s*\(optional\)|1:\s*bad\s+2:\s*fine\s+3:\s*good\s+0:\s*dismiss/i,
616
+ type: "config",
617
+ response: "0",
618
+ responseType: "text",
619
+ description: "Dismiss optional Claude session survey",
620
+ safe: true,
621
+ once: true
622
+ },
614
623
  {
615
624
  pattern: /continue without.*\[y\/n\]/i,
616
625
  type: "config",
@@ -724,6 +733,39 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
724
733
  instructions: loginDetection.instructions
725
734
  };
726
735
  }
736
+ if (/how is claude doing this session\?\s*\(optional\)|1:\s*bad\s+2:\s*fine\s+3:\s*good\s+0:\s*dismiss/i.test(stripped)) {
737
+ return {
738
+ detected: true,
739
+ type: "config",
740
+ prompt: "Claude session survey",
741
+ options: ["1", "2", "3", "0"],
742
+ suggestedResponse: "0",
743
+ canAutoRespond: true,
744
+ instructions: "Optional survey prompt; reply 0 to dismiss"
745
+ };
746
+ }
747
+ if (/enter\/tab\/space to toggle.*esc to cancel|enter to confirm.*esc to cancel|esc to close/i.test(stripped)) {
748
+ return {
749
+ detected: true,
750
+ type: "config",
751
+ prompt: "Claude dialog awaiting navigation",
752
+ options: ["keys:enter", "keys:esc", "keys:down,enter"],
753
+ suggestedResponse: "keys:esc",
754
+ canAutoRespond: false,
755
+ instructions: "Use Enter/Esc or arrow keys to navigate this dialog"
756
+ };
757
+ }
758
+ if (/\/agents\b|\/chrome\b|\/config\b|\/tasks\b|\/skills\b|\/remote-env\b|press .* to navigate .* enter .* esc/i.test(stripped)) {
759
+ return {
760
+ detected: true,
761
+ type: "config",
762
+ prompt: "Claude menu navigation required",
763
+ options: ["keys:esc", "keys:enter", "keys:down,enter"],
764
+ suggestedResponse: "keys:esc",
765
+ canAutoRespond: false,
766
+ instructions: "Claude is showing an interactive menu; use arrow keys + Enter or Esc"
767
+ };
768
+ }
727
769
  if (/Do you want to|wants? (your )?permission|needs your permission/i.test(stripped)) {
728
770
  return {
729
771
  detected: true,
@@ -795,6 +837,36 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
795
837
  }
796
838
  return false;
797
839
  }
840
+ /**
841
+ * Detect if an external tool/process is running within the Claude session.
842
+ *
843
+ * Claude Code can launch external tools (browser, bash, Node, Python, etc.)
844
+ * that show status lines like "Claude in Chrome[javascript_tool]" or
845
+ * "[bash_tool]", "[python_tool]", etc.
846
+ *
847
+ * When detected, stall detection is suppressed and the UI can display
848
+ * which tool is active.
849
+ */
850
+ detectToolRunning(output) {
851
+ const stripped = this.stripAnsi(output);
852
+ const tail = stripped.slice(-500);
853
+ const toolMatch = tail.match(/\[(\w+_tool)\]/i);
854
+ if (toolMatch) {
855
+ const toolType = toolMatch[1].toLowerCase();
856
+ const friendlyName = toolType.replace(/_tool$/i, "");
857
+ const contextMatch = tail.match(/(?:Claude\s+in|Running|Using)\s+(\S+)/i);
858
+ const description = contextMatch ? `${contextMatch[1]} (${toolType})` : toolType;
859
+ return { toolName: friendlyName, description };
860
+ }
861
+ const appMatch = tail.match(/Claude\s+in\s+(\w+)/i);
862
+ if (appMatch) {
863
+ return {
864
+ toolName: appMatch[1].toLowerCase(),
865
+ description: `Claude in ${appMatch[1]}`
866
+ };
867
+ }
868
+ return null;
869
+ }
798
870
  /**
799
871
  * Detect task completion for Claude Code.
800
872
  *
@@ -809,7 +881,6 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
809
881
  detectTaskComplete(output) {
810
882
  const stripped = this.stripAnsi(output);
811
883
  if (!stripped.trim()) return false;
812
- if (this.detectLoading(stripped)) return false;
813
884
  if (/trust.*directory|do you want to|needs? your permission/i.test(stripped)) {
814
885
  return false;
815
886
  }
@@ -827,7 +898,6 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
827
898
  detectReady(output) {
828
899
  const stripped = this.stripAnsi(output);
829
900
  if (!stripped.trim()) return false;
830
- if (this.detectLoading(stripped)) return false;
831
901
  if (/trust.*directory|do you want to|needs? your permission/i.test(stripped)) {
832
902
  return false;
833
903
  }
@@ -1487,7 +1557,6 @@ var CodexAdapter = class extends BaseCodingAdapter {
1487
1557
  detectTaskComplete(output) {
1488
1558
  const stripped = this.stripAnsi(output);
1489
1559
  if (!stripped.trim()) return false;
1490
- if (this.detectLoading(stripped)) return false;
1491
1560
  const hasWorkedFor = /Worked\s+for\s+\d+(?:h\s+\d{2}m\s+\d{2}s|m\s+\d{2}s|s)/.test(stripped);
1492
1561
  const hasComposerPrompt = /›\s+Ask\s+Codex\s+to\s+do\s+anything/.test(stripped) || /^\s*›\s*(?!\d+\.)\S.*$/m.test(stripped);
1493
1562
  const hasIdleFooterHints = /\?\s+for\s+shortcuts/i.test(stripped) || /context\s+left/i.test(stripped) || /tab\s+to\s+queue\s+message/i.test(stripped);
@@ -1505,7 +1574,6 @@ var CodexAdapter = class extends BaseCodingAdapter {
1505
1574
  detectReady(output) {
1506
1575
  const stripped = this.stripAnsi(output);
1507
1576
  if (!stripped.trim()) return false;
1508
- if (this.detectLoading(stripped)) return false;
1509
1577
  const tail = stripped.slice(-1200);
1510
1578
  const hasComposerPrompt = /^\s*›\s*(?!\d+\.)\S.*$/m.test(tail) || /›\s+Ask\s+Codex\s+to\s+do\s+anything/.test(tail);
1511
1579
  const hasComposerFooter = /\?\s+for\s+shortcuts/i.test(tail) || /context\s+left/i.test(tail) || /tab\s+to\s+queue\s+message/i.test(tail) || /shift\s*\+\s*enter\s+for\s+newline/i.test(tail);