agentic-browser 1.1.0 → 1.2.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/README.md +29 -31
- package/dist/cli/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp/index.mjs +1 -1
- package/dist/{runtime-B_7vsUma.mjs → runtime-D6awVhGy.mjs} +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,13 +37,15 @@ npm run lint
|
|
|
37
37
|
npm test
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
##
|
|
40
|
+
## Use Your Existing Chrome
|
|
41
41
|
|
|
42
|
-
By default, agentic-browser launches a fresh Chrome
|
|
42
|
+
By default, agentic-browser launches a fresh Chrome with a throwaway profile. If you want to use your logged-in sessions, cookies, or extensions, there are two ways:
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### Option 1: Control your running Chrome (recommended)
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
This lets agentic-browser take over your already-open Chrome — no need to quit it, no need to log in again.
|
|
47
|
+
|
|
48
|
+
**Step 1.** Quit Chrome, then relaunch it with remote debugging enabled:
|
|
47
49
|
|
|
48
50
|
```bash
|
|
49
51
|
# macOS
|
|
@@ -56,44 +58,44 @@ google-chrome --remote-debugging-port=9222
|
|
|
56
58
|
chrome.exe --remote-debugging-port=9222
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Chrome opens normally with all your tabs, extensions, and sessions intact.
|
|
62
|
+
|
|
63
|
+
**Step 2.** Connect agentic-browser:
|
|
60
64
|
|
|
61
65
|
```bash
|
|
62
66
|
agentic-browser agent start --cdp-url http://127.0.0.1:9222
|
|
63
|
-
# or low-level:
|
|
64
|
-
agentic-browser session:start --cdp-url http://127.0.0.1:9222
|
|
65
67
|
```
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
Stopping the session will **not** close your Chrome.
|
|
68
70
|
|
|
69
|
-
### Launch Chrome with your
|
|
71
|
+
### Option 2: Launch a new Chrome with your profile
|
|
72
|
+
|
|
73
|
+
**Important:** You must quit Chrome first. Chrome locks its profile directory — if Chrome is already running, this command will fail.
|
|
70
74
|
|
|
71
75
|
```bash
|
|
72
|
-
#
|
|
76
|
+
# Quit Chrome, then:
|
|
73
77
|
agentic-browser agent start --user-profile default
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This launches a new Chrome window using your default profile. You can also pass a custom profile path:
|
|
74
81
|
|
|
75
|
-
|
|
82
|
+
```bash
|
|
76
83
|
agentic-browser agent start --user-profile /path/to/chrome/profile
|
|
77
84
|
```
|
|
78
85
|
|
|
79
|
-
|
|
86
|
+
Default profile locations per platform:
|
|
80
87
|
- **macOS:** `~/Library/Application Support/Google/Chrome`
|
|
81
88
|
- **Linux:** `~/.config/google-chrome`
|
|
82
89
|
- **Windows:** `%LOCALAPPDATA%\Google\Chrome\User Data`
|
|
83
90
|
|
|
84
91
|
### Environment variables
|
|
85
92
|
|
|
86
|
-
|
|
93
|
+
These options can also be set via environment variables (CLI flags take precedence):
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# Use default Chrome profile (set to "default", "true", or an absolute path)
|
|
93
|
-
export AGENTIC_BROWSER_USER_PROFILE=default
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
CLI flags take precedence over environment variables.
|
|
95
|
+
| Variable | Example | Description |
|
|
96
|
+
| ------------------------------ | ------------------------------ | ------------------------------- |
|
|
97
|
+
| `AGENTIC_BROWSER_CDP_URL` | `http://127.0.0.1:9222` | Connect to a running Chrome |
|
|
98
|
+
| `AGENTIC_BROWSER_USER_PROFILE` | `default` or an absolute path | Launch with a real profile |
|
|
97
99
|
|
|
98
100
|
## Agent Commands (Recommended for LLMs)
|
|
99
101
|
|
|
@@ -282,29 +284,25 @@ const memory = core.searchMemory({
|
|
|
282
284
|
await core.stopSession(session.sessionId);
|
|
283
285
|
```
|
|
284
286
|
|
|
285
|
-
### Connect to
|
|
287
|
+
### Connect to your running Chrome
|
|
286
288
|
|
|
287
289
|
```ts
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
// Connect to a Chrome instance running with --remote-debugging-port=9222
|
|
290
|
+
// Chrome must be running with --remote-debugging-port=9222
|
|
291
291
|
const core = createAgenticBrowserCore({
|
|
292
292
|
env: { ...process.env, AGENTIC_BROWSER_CDP_URL: "http://127.0.0.1:9222" },
|
|
293
293
|
});
|
|
294
294
|
const session = await core.startSession();
|
|
295
|
-
//
|
|
295
|
+
// Stopping the session will NOT close your Chrome
|
|
296
296
|
```
|
|
297
297
|
|
|
298
|
-
###
|
|
298
|
+
### Launch Chrome with your real profile
|
|
299
299
|
|
|
300
300
|
```ts
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
// Chrome must be closed first
|
|
303
302
|
const core = createAgenticBrowserCore({
|
|
304
303
|
env: { ...process.env, AGENTIC_BROWSER_USER_PROFILE: "default" },
|
|
305
304
|
});
|
|
306
305
|
const session = await core.startSession();
|
|
307
|
-
// Chrome launched with your real profile (cookies, bookmarks, extensions)
|
|
308
306
|
```
|
|
309
307
|
|
|
310
308
|
## Documentation
|
package/dist/cli/index.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as createMockAgenticBrowserCore, n as createAgenticBrowserCore, t as AgenticBrowserCore } from "./runtime-
|
|
2
|
+
import { i as createMockAgenticBrowserCore, n as createAgenticBrowserCore, t as AgenticBrowserCore } from "./runtime-D6awVhGy.mjs";
|
|
3
3
|
|
|
4
4
|
export { AgenticBrowserCore, createAgenticBrowserCore, createMockAgenticBrowserCore };
|
package/dist/mcp/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as createAgenticBrowserCore } from "../runtime-
|
|
2
|
+
import { n as createAgenticBrowserCore } from "../runtime-D6awVhGy.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -232,6 +232,8 @@ var ChromeCdpBrowserController = class {
|
|
|
232
232
|
else if (userProfileDir) profileDir = userProfileDir;
|
|
233
233
|
else profileDir = path.join(this.baseDir, "profiles", sessionId);
|
|
234
234
|
fs.mkdirSync(profileDir, { recursive: true });
|
|
235
|
+
const lockFile = path.join(profileDir, "SingletonLock");
|
|
236
|
+
if (fs.existsSync(lockFile)) throw new Error(`Chrome profile is already in use (lock file exists: ${lockFile}). Quit the running Chrome instance first, or use --cdp-url to connect to it instead.`);
|
|
235
237
|
const launchAttempts = [
|
|
236
238
|
{
|
|
237
239
|
withExtension: true,
|