btcp-browser-agent 0.1.1 → 0.1.3
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.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|
|
@@ -8,23 +8,28 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
12
13
|
},
|
|
13
14
|
"./core": {
|
|
14
15
|
"types": "./packages/core/dist/index.d.ts",
|
|
15
|
-
"import": "./packages/core/dist/index.js"
|
|
16
|
+
"import": "./packages/core/dist/index.js",
|
|
17
|
+
"default": "./packages/core/dist/index.js"
|
|
16
18
|
},
|
|
17
19
|
"./extension": {
|
|
18
20
|
"types": "./packages/extension/dist/index.d.ts",
|
|
19
|
-
"import": "./packages/extension/dist/index.js"
|
|
21
|
+
"import": "./packages/extension/dist/index.js",
|
|
22
|
+
"default": "./packages/extension/dist/index.js"
|
|
20
23
|
},
|
|
21
24
|
"./extension/content": {
|
|
22
25
|
"types": "./packages/extension/dist/content.d.ts",
|
|
23
|
-
"import": "./packages/extension/dist/content.js"
|
|
26
|
+
"import": "./packages/extension/dist/content.js",
|
|
27
|
+
"default": "./packages/extension/dist/content.js"
|
|
24
28
|
},
|
|
25
29
|
"./extension/background": {
|
|
26
30
|
"types": "./packages/extension/dist/background.d.ts",
|
|
27
|
-
"import": "./packages/extension/dist/background.js"
|
|
31
|
+
"import": "./packages/extension/dist/background.js",
|
|
32
|
+
"default": "./packages/extension/dist/background.js"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
35
|
"scripts": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Runs in web pages, handles DOM commands from the background script.
|
|
5
5
|
* Uses ContentAgent from @btcp/core for DOM operations.
|
|
6
6
|
*/
|
|
7
|
-
import { type ContentAgent, type Response } from '
|
|
7
|
+
import { type ContentAgent, type Response } from '../../core/dist/index.js';
|
|
8
8
|
import type { Command } from './types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Get or create the ContentAgent instance for this page
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Runs in web pages, handles DOM commands from the background script.
|
|
5
5
|
* Uses ContentAgent from @btcp/core for DOM operations.
|
|
6
6
|
*/
|
|
7
|
-
import { createContentAgent } from '
|
|
7
|
+
import { createContentAgent } from '../../core/dist/index.js';
|
|
8
8
|
let agent = null;
|
|
9
9
|
let isContentScriptReady = false;
|
|
10
10
|
/**
|
|
@@ -43,8 +43,8 @@ import type { Command, Response, TabInfo } from './types.js';
|
|
|
43
43
|
import { BackgroundAgent as _BackgroundAgent, getBackgroundAgent as _getBackgroundAgent, setupMessageListener as _setupMessageListener, BrowserAgent as _BrowserAgent, getBrowserAgent as _getBrowserAgent } from './background.js';
|
|
44
44
|
export * from './types.js';
|
|
45
45
|
export { _BackgroundAgent as BackgroundAgent, _getBackgroundAgent as getBackgroundAgent, _setupMessageListener as setupMessageListener, _BrowserAgent as BrowserAgent, _getBrowserAgent as getBrowserAgent, };
|
|
46
|
-
export { createContentAgent, type ContentAgent } from '
|
|
47
|
-
export type { SnapshotData, BoundingBox, Modifier, } from '
|
|
46
|
+
export { createContentAgent, type ContentAgent } from '../../core/dist/index.js';
|
|
47
|
+
export type { SnapshotData, BoundingBox, Modifier, } from '../../core/dist/index.js';
|
|
48
48
|
/**
|
|
49
49
|
* Client for sending commands to the extension background script
|
|
50
50
|
*/
|
|
@@ -47,7 +47,7 @@ export { _BackgroundAgent as BackgroundAgent, _getBackgroundAgent as getBackgrou
|
|
|
47
47
|
// Deprecated aliases for backwards compatibility
|
|
48
48
|
_BrowserAgent as BrowserAgent, _getBrowserAgent as getBrowserAgent, };
|
|
49
49
|
// Re-export ContentAgent for content script usage
|
|
50
|
-
export { createContentAgent } from '
|
|
50
|
+
export { createContentAgent } from '../../core/dist/index.js';
|
|
51
51
|
let commandIdCounter = 0;
|
|
52
52
|
function generateCommandId() {
|
|
53
53
|
return `cmd_${Date.now()}_${commandIdCounter++}`;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for extension commands and Chrome API wrappers.
|
|
5
5
|
*/
|
|
6
|
-
import type { Command as CoreCommand, Response } from '
|
|
6
|
+
import type { Command as CoreCommand, Response } from '../../core/dist/index.js';
|
|
7
7
|
import type { SessionCommand } from './session-types.js';
|
|
8
8
|
export type ExtensionAction = 'navigate' | 'back' | 'forward' | 'reload' | 'getUrl' | 'getTitle' | 'screenshot' | 'tabNew' | 'tabClose' | 'tabSwitch' | 'tabList' | 'groupCreate' | 'groupUpdate' | 'groupDelete' | 'groupList' | 'groupAddTabs' | 'groupRemoveTabs' | 'groupGet' | 'sessionGetCurrent' | 'popupInitialize';
|
|
9
9
|
export interface ExtensionBaseCommand {
|