unbrowse 2.12.1 → 2.12.2
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 +5 -64
- package/bin/unbrowse-wrapper.mjs +14 -85
- package/dist/cli.js +290 -975
- package/package.json +1 -1
- package/runtime-src/analytics-session.ts +5 -27
- package/runtime-src/api/browse-session.ts +3 -1
- package/runtime-src/api/browse-submit.ts +27 -34
- package/runtime-src/api/routes.ts +105 -153
- package/runtime-src/capture/index.ts +5 -7
- package/runtime-src/cli.ts +19 -201
- package/runtime-src/client/index.ts +48 -32
- package/runtime-src/execution/index.ts +1 -6
- package/runtime-src/indexer/index.ts +2 -4
- package/runtime-src/kuri/client.ts +35 -2
- package/runtime-src/orchestrator/index.ts +2 -2
- package/runtime-src/reverse-engineer/index.ts +0 -8
- package/runtime-src/runtime/local-server.ts +6 -35
- package/runtime-src/runtime/setup.ts +7 -11
- package/runtime-src/server.ts +4 -3
- package/runtime-src/version.ts +0 -12
- package/scripts/postinstall.mjs +4 -17
- package/bin/unbrowse-update-hint.mjs +0 -22
- package/dist/mcp.js +0 -20468
- package/runtime-src/agent-outcome.ts +0 -166
- package/runtime-src/mcp.ts +0 -1065
- package/runtime-src/runtime/update-hints.ts +0 -351
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This package installs the `unbrowse` CLI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Turn any website into a reusable API interface for agents. Unbrowse captures network traffic, reverse-engineers the real endpoints underneath the UI, and stores what it learns in a shared marketplace so the next agent can reuse it instantly.
|
|
6
6
|
|
|
7
7
|
One agent learns a site once. Every later agent gets the fast path.
|
|
8
8
|
|
|
@@ -10,35 +10,6 @@ Unbrowse is a drop-in replacement for OpenClaw / `agent-browser` browser flows f
|
|
|
10
10
|
|
|
11
11
|
> Security note: capture and execution stay local by default. Credentials stay on your machine. Learned API contracts are published to the shared marketplace only after capture. See [SKILL.md](./SKILL.md) for the full agent-facing API reference and tool-policy guidance.
|
|
12
12
|
|
|
13
|
-
## MCP server
|
|
14
|
-
|
|
15
|
-
Unbrowse implements the Model Context Protocol over stdio. `unbrowse mcp` is the MCP server entrypoint.
|
|
16
|
-
|
|
17
|
-
- Protocol: JSON-RPC 2.0 MCP over stdio
|
|
18
|
-
- Handshake: `initialize`, `notifications/initialized`, `ping`
|
|
19
|
-
- Capability surface today: `tools/list` and `tools/call`
|
|
20
|
-
- Current MCP shape: tools only. No `resources/*` or `prompts/*` methods yet.
|
|
21
|
-
- Runtime model: the MCP server fronts the local Unbrowse runtime on `http://localhost:6969`; hosts talk standard MCP, and Unbrowse uses the local HTTP runtime behind the scenes.
|
|
22
|
-
|
|
23
|
-
Core MCP tools:
|
|
24
|
-
|
|
25
|
-
- Discovery: `unbrowse_health`, `unbrowse_search`, `unbrowse_resolve`, `unbrowse_execute`, `unbrowse_feedback`
|
|
26
|
-
- Auth/cache: `unbrowse_login`, `unbrowse_skills`, `unbrowse_skill`, `unbrowse_sessions`
|
|
27
|
-
- Browser capture: `unbrowse_go`, `unbrowse_snap`, `unbrowse_click`, `unbrowse_fill`, `unbrowse_type`, `unbrowse_press`, `unbrowse_select`, `unbrowse_scroll`, `unbrowse_submit`, `unbrowse_screenshot`, `unbrowse_text`, `unbrowse_markdown`, `unbrowse_cookies`, `unbrowse_eval`, `unbrowse_sync`, `unbrowse_close`
|
|
28
|
-
|
|
29
|
-
Typical MCP host config:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"mcpServers": {
|
|
34
|
-
"unbrowse": {
|
|
35
|
-
"command": "npx",
|
|
36
|
-
"args": ["-y", "unbrowse", "mcp"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
13
|
## Quick start
|
|
43
14
|
|
|
44
15
|
```bash
|
|
@@ -51,9 +22,7 @@ cd ~/unbrowse && ./setup --host off
|
|
|
51
22
|
|
|
52
23
|
If a wallet is configured, that wallet address becomes the contributor/payment truth: it is synced onto your agent profile, used as the destination for contributor payouts when your routes earn, and used as the spending wallet for paid marketplace routes.
|
|
53
24
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Unbrowse supports wallet providers such as Crossmint `lobster.cash` for x402-gated routes. If you use `lobster.cash`, set `LOBSTER_WALLET_ADDRESS`. Other providers can use `AGENT_WALLET_ADDRESS` and optional `AGENT_WALLET_PROVIDER`.
|
|
25
|
+
Unbrowse supports wallet providers such as `lobster.cash` for x402-gated routes. If you use `lobster.cash`, set `LOBSTER_WALLET_ADDRESS`. Other providers can use `AGENT_WALLET_ADDRESS` and optional `AGENT_WALLET_PROVIDER`.
|
|
57
26
|
|
|
58
27
|
For repeat npm use after a healthy publish:
|
|
59
28
|
|
|
@@ -62,15 +31,6 @@ npm install -g unbrowse
|
|
|
62
31
|
unbrowse setup
|
|
63
32
|
```
|
|
64
33
|
|
|
65
|
-
For generic MCP hosts:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
git clone --single-branch --depth 1 https://github.com/unbrowse-ai/unbrowse.git ~/unbrowse
|
|
69
|
-
cd ~/unbrowse && ./setup --host mcp
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
That writes a ready-to-import MCP config to `~/.config/unbrowse/mcp/unbrowse.json`. A generic template is also published at [`/mcp.json`](https://www.unbrowse.ai/mcp.json).
|
|
73
|
-
|
|
74
34
|
If your agent host uses skills:
|
|
75
35
|
|
|
76
36
|
```bash
|
|
@@ -81,14 +41,6 @@ npx skills add unbrowse-ai/unbrowse
|
|
|
81
41
|
|
|
82
42
|
Unbrowse no longer self-updates at runtime. If you already have Unbrowse installed, upgrade to the latest version after each release or the new flow may not work on your machine.
|
|
83
43
|
|
|
84
|
-
Check the exact command for your install with:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
unbrowse upgrade
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Codex and Claude installs now also get a session-start update hint during `unbrowse setup`, so newer releases are surfaced in the host before the CLI drifts too far behind.
|
|
91
|
-
|
|
92
44
|
If you installed from a repo clone:
|
|
93
45
|
|
|
94
46
|
```bash
|
|
@@ -97,14 +49,6 @@ git pull --ff-only
|
|
|
97
49
|
./setup --host off
|
|
98
50
|
```
|
|
99
51
|
|
|
100
|
-
If you installed for a generic MCP host:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
cd ~/unbrowse
|
|
104
|
-
git pull --ff-only
|
|
105
|
-
./setup --host mcp
|
|
106
|
-
```
|
|
107
|
-
|
|
108
52
|
If your agent host uses skills, rerun its skill install/update command too:
|
|
109
53
|
|
|
110
54
|
```bash
|
|
@@ -113,8 +57,8 @@ npx skills add unbrowse-ai/unbrowse
|
|
|
113
57
|
|
|
114
58
|
Need help or want release updates? Join the Discord: [discord.gg/VWugEeFNsG](https://discord.gg/VWugEeFNsG)
|
|
115
59
|
|
|
116
|
-
Every CLI command auto-starts the local
|
|
117
|
-
|
|
60
|
+
Every CLI command auto-starts the local server on `http://localhost:6969` by default. Override with `UNBROWSE_URL`, `PORT`, or `HOST`. On first startup it auto-registers as an agent with the marketplace and caches credentials in `~/.unbrowse/config.json`. `unbrowse setup` now prompts for an email-shaped identity first; headless setups can provide `UNBROWSE_AGENT_EMAIL`.
|
|
61
|
+
Canonical docs: [docs.unbrowse.ai](https://docs.unbrowse.ai)
|
|
118
62
|
|
|
119
63
|
Works with Claude Code, Open Code, Cursor, Codex, Windsurf, and any agent host that can call a local CLI or skill.
|
|
120
64
|
|
|
@@ -124,22 +68,19 @@ Works with Claude Code, Open Code, Cursor, Codex, Windsurf, and any agent host t
|
|
|
124
68
|
- Prebuilds the packaged CLI runtime and installs the stable `unbrowse` shim for the repo bootstrap path.
|
|
125
69
|
- Verifies the bundled Kuri binary, or builds it from the vendored Kuri source when working from repo source with Zig installed.
|
|
126
70
|
- Registers the Open Code `/unbrowse` command when Open Code is present.
|
|
127
|
-
- Runs the first-use flow: ToS, agent registration/API-key caching, wallet detection
|
|
71
|
+
- Runs the first-use flow: ToS, agent registration/API-key caching, and wallet detection.
|
|
128
72
|
- Starts the local Unbrowse server unless `--no-start` is passed.
|
|
129
73
|
|
|
130
74
|
## Common commands
|
|
131
75
|
|
|
132
76
|
```bash
|
|
133
77
|
unbrowse health
|
|
134
|
-
unbrowse mcp
|
|
135
78
|
unbrowse resolve --intent "get trending searches" --url "https://google.com" --pretty
|
|
136
79
|
unbrowse login --url "https://calendar.google.com"
|
|
137
80
|
unbrowse skills
|
|
138
81
|
unbrowse search --intent "get stock prices"
|
|
139
82
|
```
|
|
140
83
|
|
|
141
|
-
For most MCP hosts, the standard flow is `unbrowse_resolve` first, then `unbrowse_execute`. For JS-heavy or first-time capture workflows, use the browser tool chain: `unbrowse_go -> unbrowse_snap -> action tools -> unbrowse_submit/unbrowse_sync -> unbrowse_close`.
|
|
142
|
-
|
|
143
84
|
## Demo notes
|
|
144
85
|
|
|
145
86
|
- First-time capture/indexing on a site can take 20-80 seconds. That is the slow path; repeats should be much faster.
|
package/bin/unbrowse-wrapper.mjs
CHANGED
|
@@ -5,106 +5,35 @@
|
|
|
5
5
|
* falls back to the package-managed Node launcher if not.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { existsSync
|
|
9
|
-
import { createRequire } from "node:module";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
10
9
|
import { join, dirname } from "node:path";
|
|
11
10
|
import { fileURLToPath } from "node:url";
|
|
12
11
|
import { spawn } from "node:child_process";
|
|
13
12
|
|
|
14
13
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
|
-
const packageRoot = join(__dirname, "..");
|
|
16
14
|
const binaryPath = join(__dirname, "unbrowse");
|
|
17
|
-
const launcherPath = join(__dirname, "unbrowse.js");
|
|
18
|
-
const require = createRequire(import.meta.url);
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"@solana/kit",
|
|
24
|
-
"@cascade-fyi/splits-sdk",
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const KNOWN_BAD_FALLBACK_VERSIONS = new Set([
|
|
28
|
-
"2.10.2",
|
|
29
|
-
]);
|
|
30
|
-
|
|
31
|
-
function readInstalledVersion() {
|
|
32
|
-
try {
|
|
33
|
-
const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
|
|
34
|
-
return typeof pkg.version === "string" ? pkg.version : "unknown";
|
|
35
|
-
} catch {
|
|
36
|
-
return "unknown";
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function printRepairHelp(reason) {
|
|
41
|
-
const installedVersion = readInstalledVersion();
|
|
42
|
-
const lines = [
|
|
43
|
-
`[unbrowse] ${reason}`,
|
|
44
|
-
`[unbrowse] Installed package version: ${installedVersion}`,
|
|
45
|
-
"[unbrowse] Repair: npm uninstall -g unbrowse && npm install -g unbrowse@latest",
|
|
46
|
-
];
|
|
47
|
-
process.stderr.write(lines.join("\n") + "\n");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function failInstall(reason, exitCode = 1) {
|
|
51
|
-
printRepairHelp(reason);
|
|
52
|
-
process.exit(exitCode);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function missingFallbackPackages() {
|
|
56
|
-
const missing = [];
|
|
57
|
-
for (const specifier of REQUIRED_FALLBACK_PACKAGES) {
|
|
58
|
-
try {
|
|
59
|
-
require.resolve(specifier);
|
|
60
|
-
} catch {
|
|
61
|
-
missing.push(specifier);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return missing;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function spawnEntrypoint(command, args) {
|
|
68
|
-
const child = spawn(command, args, {
|
|
16
|
+
if (existsSync(binaryPath)) {
|
|
17
|
+
// Compiled binary — exec directly, replace this process
|
|
18
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
69
19
|
stdio: "inherit",
|
|
70
|
-
cwd: process.cwd(),
|
|
71
20
|
env: process.env,
|
|
72
21
|
});
|
|
73
|
-
child.on("error", (error) => {
|
|
74
|
-
const details = error instanceof Error ? error.message : String(error);
|
|
75
|
-
if (error && typeof error === "object" && "code" in error && error.code === "EACCES") {
|
|
76
|
-
failInstall(`Launch target is not executable (${command}). Global install permissions are corrupted.`);
|
|
77
|
-
}
|
|
78
|
-
failInstall(`Failed to launch ${command}: ${details}`);
|
|
79
|
-
});
|
|
80
22
|
child.on("exit", (code, signal) => {
|
|
81
23
|
if (signal) { process.kill(process.pid, signal); return; }
|
|
82
24
|
process.exit(code ?? 1);
|
|
83
25
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (process.argv.includes("--version") || process.argv.includes("-v")) {
|
|
87
|
-
process.stdout.write(`${readInstalledVersion()}\n`);
|
|
88
|
-
process.exit(0);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (existsSync(binaryPath)) {
|
|
92
|
-
// Compiled binary — exec directly, replace this process
|
|
93
|
-
spawnEntrypoint(binaryPath, process.argv.slice(2));
|
|
94
26
|
} else {
|
|
95
|
-
const installedVersion = readInstalledVersion();
|
|
96
|
-
if (KNOWN_BAD_FALLBACK_VERSIONS.has(installedVersion)) {
|
|
97
|
-
failInstall(
|
|
98
|
-
`Installed package version ${installedVersion} is known-bad in source fallback mode and shipped an incomplete runtime dependency set.`,
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const missing = missingFallbackPackages();
|
|
103
|
-
if (missing.length > 0) {
|
|
104
|
-
failInstall(`Fallback runtime is missing required packages: ${missing.join(", ")}.`);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
27
|
// Fallback: delegate to the stable package launcher so
|
|
108
28
|
// npm installs and npx use the same dependency resolution path.
|
|
109
|
-
|
|
29
|
+
const launcherPath = join(__dirname, "unbrowse.js");
|
|
30
|
+
const child = spawn(process.execPath, [launcherPath, ...process.argv.slice(2)], {
|
|
31
|
+
stdio: "inherit",
|
|
32
|
+
cwd: process.cwd(),
|
|
33
|
+
env: process.env,
|
|
34
|
+
});
|
|
35
|
+
child.on("exit", (code, signal) => {
|
|
36
|
+
if (signal) { process.kill(process.pid, signal); return; }
|
|
37
|
+
process.exit(code ?? 1);
|
|
38
|
+
});
|
|
110
39
|
}
|