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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -291,6 +291,17 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
291
291
  * - General: "esc to interrupt" spinner status line
292
292
  */
293
293
  detectLoading(output: string): boolean;
294
+ /**
295
+ * Detect if an external tool/process is running within the Claude session.
296
+ *
297
+ * Claude Code can launch external tools (browser, bash, Node, Python, etc.)
298
+ * that show status lines like "Claude in Chrome[javascript_tool]" or
299
+ * "[bash_tool]", "[python_tool]", etc.
300
+ *
301
+ * When detected, stall detection is suppressed and the UI can display
302
+ * which tool is active.
303
+ */
304
+ detectToolRunning(output: string): ToolRunningInfo | null;
294
305
  /**
295
306
  * Detect task completion for Claude Code.
296
307
  *
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ParsedOutput } from 'pty-manager';
1
+ import { BaseCLIAdapter, SpawnConfig, AutoResponseRule, LoginDetection, BlockingPromptDetection, ToolRunningInfo, ParsedOutput } from 'pty-manager';
2
2
 
3
3
  /**
4
4
  * Approval Presets
@@ -291,6 +291,17 @@ declare class ClaudeAdapter extends BaseCodingAdapter {
291
291
  * - General: "esc to interrupt" spinner status line
292
292
  */
293
293
  detectLoading(output: string): boolean;
294
+ /**
295
+ * Detect if an external tool/process is running within the Claude session.
296
+ *
297
+ * Claude Code can launch external tools (browser, bash, Node, Python, etc.)
298
+ * that show status lines like "Claude in Chrome[javascript_tool]" or
299
+ * "[bash_tool]", "[python_tool]", etc.
300
+ *
301
+ * When detected, stall detection is suppressed and the UI can display
302
+ * which tool is active.
303
+ */
304
+ detectToolRunning(output: string): ToolRunningInfo | null;
294
305
  /**
295
306
  * Detect task completion for Claude Code.
296
307
  *
package/dist/index.js CHANGED
@@ -835,6 +835,36 @@ var ClaudeAdapter = class extends BaseCodingAdapter {
835
835
  }
836
836
  return false;
837
837
  }
838
+ /**
839
+ * Detect if an external tool/process is running within the Claude session.
840
+ *
841
+ * Claude Code can launch external tools (browser, bash, Node, Python, etc.)
842
+ * that show status lines like "Claude in Chrome[javascript_tool]" or
843
+ * "[bash_tool]", "[python_tool]", etc.
844
+ *
845
+ * When detected, stall detection is suppressed and the UI can display
846
+ * which tool is active.
847
+ */
848
+ detectToolRunning(output) {
849
+ const stripped = this.stripAnsi(output);
850
+ const tail = stripped.slice(-500);
851
+ const toolMatch = tail.match(/\[(\w+_tool)\]/i);
852
+ if (toolMatch) {
853
+ const toolType = toolMatch[1].toLowerCase();
854
+ const friendlyName = toolType.replace(/_tool$/i, "");
855
+ const contextMatch = tail.match(/(?:Claude\s+in|Running|Using)\s+(\S+)/i);
856
+ const description = contextMatch ? `${contextMatch[1]} (${toolType})` : toolType;
857
+ return { toolName: friendlyName, description };
858
+ }
859
+ const appMatch = tail.match(/Claude\s+in\s+(\w+)/i);
860
+ if (appMatch) {
861
+ return {
862
+ toolName: appMatch[1].toLowerCase(),
863
+ description: `Claude in ${appMatch[1]}`
864
+ };
865
+ }
866
+ return null;
867
+ }
838
868
  /**
839
869
  * Detect task completion for Claude Code.
840
870
  *