btcp-browser-agent 0.1.8 → 0.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btcp-browser-agent",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Give AI agents the power to control browsers. A foundation for building agentic systems with smart DOM snapshots and stable element references.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,7 +12,7 @@
12
12
  * - Routing DOM commands to ContentAgents in target tabs
13
13
  */
14
14
  import { SessionManager } from './session-manager.js';
15
- import { assertUrlOrigin, createVerificationError } from '@btcp/core';
15
+ import { assertUrlOrigin, createVerificationError } from '../../core/dist/index.js';
16
16
  // Command ID counter for auto-generated IDs
17
17
  let bgCommandIdCounter = 0;
18
18
  /**
@@ -491,6 +491,15 @@ export class BackgroundAgent {
491
491
  error: chrome.runtime.lastError.message || 'Failed to send message to tab',
492
492
  });
493
493
  }
494
+ else if (!response) {
495
+ // Response is undefined but no lastError - return success with empty data
496
+ // so the agent can continue gracefully
497
+ resolve({
498
+ id: command.id,
499
+ success: true,
500
+ data: { message: 'No response from content script - page may be unresponsive' },
501
+ });
502
+ }
494
503
  else {
495
504
  const resp = response;
496
505
  if (resp.type === 'btcp:response') {