coding-agent-adapters 0.7.5 → 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
@@ -837,6 +837,36 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
837
837
  }
838
838
  return false;
839
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
+ }
840
870
  /**
841
871
  * Detect task completion for Claude Code.
842
872
  *