unbrowse 12.1.1 → 12.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 +6 -3
- package/SKILL.md +45 -13
- package/dist/cli.js +1303 -31
- package/package.json +1 -1
- package/references/tools.json +325 -6
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Call websites as APIs from a shell. A thin CLI over the Unbrowse REST API
|
|
|
4
4
|
(`https://unbrowse.ai/api/v1`), built on [`@unbrowse/sdk`](https://www.npmjs.com/package/@unbrowse/sdk).
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
unbrowse login # browser sign-in, or: login --key ub_live_…
|
|
8
|
-
unbrowse run "top stories on Hacker News" #
|
|
7
|
+
unbrowse login # browser sign-in, or: login --key ub_live_… (first use of any command does this too)
|
|
8
|
+
unbrowse run "top stories on Hacker News" # site requests go from your IP; --from-unbrowse to send them from Unbrowse
|
|
9
9
|
unbrowse discover "flight search" # choose a returned capability
|
|
10
10
|
unbrowse resume <runId> origin=SIN # answer on the same run
|
|
11
11
|
```
|
|
@@ -15,9 +15,12 @@ unbrowse resume <runId> origin=SIN # answer on the same run
|
|
|
15
15
|
| `login [--key K]`, `logout`, `whoami`, `usage` | Account |
|
|
16
16
|
| `discover <query>` | Your capabilities, then the public registry |
|
|
17
17
|
| `run <task…>`, `inspect`, `resume`, `cancel` | Runs |
|
|
18
|
+
| `scrape <url>` | One page as markdown on stdout |
|
|
19
|
+
| `index <url>`, `index status [jobId]` | Teach a site: an agent explores it and compiles each flow into a tool |
|
|
18
20
|
| `learn a.har b.har`, `learned [id]` | Teach a site from two recordings |
|
|
19
21
|
| `logins`, `logins remove <origin>` | Saved logins, masked. The CLI never takes a password |
|
|
20
|
-
| `registry [query]`, `site <host>` | Public compiled sites, no account |
|
|
22
|
+
| `registry [query]`, `site <host>`, `openapi <host>` | Public compiled sites, a site's tools, its OpenAPI 3.1 document — no account |
|
|
23
|
+
| `call <host> <tool> [JSON]` | Run one site tool (`--set k=v`, `--deadline MS`, `--select a,b`, `--idempotency-key K`, `--end-user ID`) |
|
|
21
24
|
|
|
22
25
|
The CLI is the REST client. The remote MCP is a separate client; see the [install guide](https://github.com/unbrowse-ai/unbrowse-skill/blob/main/docs/install.md).
|
|
23
26
|
|
package/SKILL.md
CHANGED
|
@@ -9,20 +9,28 @@ Use the hosted service at `https://unbrowse.ai`. Execution, indexed routes and w
|
|
|
9
9
|
|
|
10
10
|
## Connect
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The MCP and the CLI are different logins. A URL in a client config is not a signed-in session. `unbrowse whoami` succeeding does not mean the MCP is connected, and the CLI bearer is rejected by `/mcp`.
|
|
13
|
+
|
|
14
|
+
- MCP: use the URL the client already configured. Hosted servers are `https://unbrowse.ai/mcp` and `https://v3.unbrowse.ai/mcp`. If `unbrowse.discover` is not in this session's tool list, stop and reconnect that server's own OAuth. Do not paste the CLI token onto the MCP URL.
|
|
15
|
+
- CLI: `unbrowse login` stores an OAuth token for `https://unbrowse.ai/api/v1` only. It is a REST client, not an MCP client.
|
|
13
16
|
|
|
14
17
|
```sh
|
|
15
18
|
claude mcp add --transport http unbrowse https://unbrowse.ai/mcp
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
Complete sign-in through the MCP client's OAuth flow. Other clients can use:
|
|
19
|
-
|
|
20
21
|
```json
|
|
21
|
-
{"mcpServers":{"unbrowse":{"url":"https://unbrowse.ai/mcp"}}}
|
|
22
|
+
{"mcpServers":{"unbrowse":{"url":"https://v3.unbrowse.ai/mcp"}}}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
From a terminal, with the CLI:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx skills add unbrowse-ai/unbrowse && npx unbrowse login
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
Adds the Unbrowse skill to your agent and signs in the CLI. Then `npx unbrowse run 'top stories on hacker news'` runs any site from your terminal. The site requests go from your own IP by default; add `--from-unbrowse` to send them from Unbrowse instead. The first command run with no sign-in starts the same browser sign-in and then carries on; without a terminal it exits 3 and asks for `unbrowse login` or `UNBROWSE_API_KEY`.
|
|
32
|
+
|
|
33
|
+
CLI and SDK: https://github.com/unbrowse-ai/unbrowse
|
|
26
34
|
For automation, supply an API key via `UNBROWSE_API_KEY` using the caller's secret manager. Do not put keys into committed config, prompts, command arguments or logs. Create a key in the signed-in console at https://unbrowse.ai/app.
|
|
27
35
|
|
|
28
36
|
## Host plugins
|
|
@@ -38,27 +46,39 @@ Hosts that need a stdio server or reject dotted tool names can run `npx unbrowse
|
|
|
38
46
|
|
|
39
47
|
## Choose the interface
|
|
40
48
|
|
|
41
|
-
- MCP: discovery, runs, page reading, cloud browsing, saved-login requests and live canvas cards.
|
|
42
|
-
- CLI: `unbrowse discover`, `run`, `inspect`, `resume`, `registry`.
|
|
49
|
+
- MCP: discovery, runs, page reading, cloud browsing, indexing, saved-login requests and live canvas cards. These names are MCP tools. They are not CLI commands.
|
|
50
|
+
- CLI: `unbrowse discover`, `run`, `inspect`, `resume`, `registry`, `site`, `whoami`. `unbrowse run` never drives a website in a browser (the only browser it opens is the first-use sign-in). There is no `unbrowse browse` and no `unbrowse install`. `unbrowse help` describes the installed version.
|
|
43
51
|
- SDK: REST integration and scripting. Consult the public SDK docs for its supported methods; MCP tools and REST methods are not interchangeable names.
|
|
44
52
|
|
|
45
|
-
Core MCP tools: `unbrowse.discover`, `unbrowse.run`, `unbrowse.inspect`, `unbrowse.resume`, `unbrowse.cancel`, `unbrowse.scrape`, `unbrowse.map`, `unbrowse.sites`, `unbrowse.usage`, `unbrowse.credits`, `unbrowse.forget`, `unbrowse.learn`, `unbrowse.index`, `unbrowse.index.status`, `unbrowse.credentials.list`, `unbrowse.credentials.request`, `unbrowse.credentials.status`, and the cloud browser `unbrowse.browse.open`, `unbrowse.browse.snapshot`, `unbrowse.browse.act`, `unbrowse.browse.finish`, `unbrowse.browse.close`.
|
|
53
|
+
Core MCP tools: `unbrowse.discover`, `unbrowse.run`, `unbrowse.inspect`, `unbrowse.resume`, `unbrowse.cancel`, `unbrowse.scrape`, `unbrowse.map`, `unbrowse.sites`, `unbrowse.usage`, `unbrowse.credits`, `unbrowse.forget`, `unbrowse.learn`, `unbrowse.index`, `unbrowse.index.status`, `unbrowse.credentials.list`, `unbrowse.credentials.request`, `unbrowse.credentials.status`, and the cloud browser `unbrowse.browse.open`, `unbrowse.browse.snapshot`, `unbrowse.browse.act`, `unbrowse.browse.finish`, `unbrowse.browse.close`, and session replay `unbrowse.replay.list`, `unbrowse.replay.search`, `unbrowse.replay.get`, `unbrowse.replay.timeline`, `unbrowse.replay.ask`.
|
|
46
54
|
|
|
47
55
|
[references/tools.json](references/tools.json) contains the exported core MCP input schemas. The connected server's `tools/list` is authoritative: it also includes dynamic tools available to this user's workspace. Never invent a capability ID or input schema.
|
|
48
56
|
|
|
49
57
|
## Execute a task
|
|
50
58
|
|
|
51
59
|
1. Discover with `unbrowse.discover {query}`. Inspect returned inputs, choices and hints. Prefer a healthy matching capability; `warm` means HTTP replay, `rendered` needs rendering. Check `unbrowse.sites` for saved session and login state when relevant.
|
|
52
|
-
2. Call the selected tool with its listed schema, or `unbrowse.run {capability, input}`. A natural-language `task` can route when no ID was selected. Use a stable `idempotencyKey` for the same intended mutation.
|
|
60
|
+
2. Call the selected tool with its listed schema, or `unbrowse.run {capability, input}`. A natural-language `task` can route when no ID was selected. Use a stable `idempotencyKey` for the same intended mutation. For a large answer pass `select` (MCP run tools, `unbrowse.resume`, `unbrowse.inspect`, `POST /api/v1/runs`): paths like `["results[].{id,title,price}", "total"]`. It narrows only what comes back, after verification; billing is unchanged. Results over 40,000 characters are shortened (`truncated: true`); `selectMissing` lists paths that matched nothing.
|
|
53
61
|
3. Inspect the returned status and actual result. `input_required` means answer the open requirements on the **same** run: `unbrowse.resume {runId, answers:{field:value}}`. For a choice, pass the listed option's value. Preserve revision checks when supplied.
|
|
54
|
-
4. `no_capability` means no reusable route matched.
|
|
62
|
+
4. `no_capability` means no reusable route matched. Follow `result.next`: `tool` is `unbrowse.index` (`POST /api/v1/index`, then `GET /api/v1/index/{jobId}`). Call `unbrowse.browse.open` only when that name is in this session's tool list. Do not POST `/api/v1/browse/open`. It is not a route. Report unsupported or blocked sites honestly.
|
|
55
63
|
5. Only report completion from a verified result. `outcome_unknown` means a change may have occurred: inspect the effect receipt and destination before retrying. Cancellation stops future dispatches; it does not undo completed effects.
|
|
56
64
|
|
|
57
65
|
Do not infer business success from HTTP 200, tool transport success, a screenshot, or a generated plan. Do not promise universal coverage or browserless execution on every first request. Obtain the user's authorization for posting, sending, purchasing or other external writes.
|
|
58
66
|
|
|
67
|
+
## Unbrowse a URL
|
|
68
|
+
|
|
69
|
+
When the person names a site:
|
|
70
|
+
|
|
71
|
+
1. If `unbrowse.discover` is not in this session's tool list, the MCP is not signed in. Stop. Name the configured MCP URL and say the CLI login does not cover it.
|
|
72
|
+
2. Look the host up (`unbrowse.sites`, or CLI `unbrowse site <host>`). Tools already compiled: use one. Stop.
|
|
73
|
+
3. No tools: `unbrowse.index {url, focus}` or `POST /api/v1/index`. Poll `unbrowse.index.status` or `GET /api/v1/index/{jobId}`.
|
|
74
|
+
4. `status: failed` and `error.code: model_unavailable`: the indexing model is out of credit. Report the job id and the message. Do not browse instead, and do not start the same job again in a loop.
|
|
75
|
+
5. `status: done` with `indexed: 0` means nothing was learned. Say so. `indexed > 0` means call one tool and check the result.
|
|
76
|
+
|
|
77
|
+
A 202 from `/api/v1/index` is a job id, not a compiled tool.
|
|
78
|
+
|
|
59
79
|
## Read or learn a site
|
|
60
80
|
|
|
61
|
-
Use `unbrowse.scrape {url}` for a page; `unbrowse.map {url}` finds same-site pages. For interactive work with no matching route:
|
|
81
|
+
Use `unbrowse.scrape {url}` for a page (a PDF or .docx URL comes back as markdown text with `metadata.pages`); `unbrowse.map {url}` finds same-site pages. For interactive work with no matching route:
|
|
62
82
|
|
|
63
83
|
1. `unbrowse.browse.open {url,task}` returns the page and element refs.
|
|
64
84
|
2. Use `browse.act` with the latest refs. For ordinary inputs, include a meaningful `name` such as `date` or `query`; exercise every filter the task needs. Refresh the snapshot after page changes.
|
|
@@ -69,6 +89,17 @@ To cover a whole site ahead of need, `unbrowse.index {url, focus?}` starts a bac
|
|
|
69
89
|
|
|
70
90
|
An existing HAR pair can be sent through `unbrowse.learn`. Only submit recordings the user authorized; HARs can contain private data. Private and loopback destinations are refused by the hosted service.
|
|
71
91
|
|
|
92
|
+
## Session replay
|
|
93
|
+
|
|
94
|
+
Every cloud-browser session is recorded: your own `unbrowse.browse.open` … `finish` sessions become replays with sid `a_<browse session id>`, with the page recording, each step you took and a screenshot per step. Visitor sessions (people on unbrowse.ai) are visible to unbrowse.ai admins only; agent sessions are visible to the workspace that ran them.
|
|
95
|
+
|
|
96
|
+
- `unbrowse.replay.list` and `unbrowse.replay.search {query}` find sessions and moments (filters: `source`, `site`, `outcome`, `hasError`, `from`, `to`).
|
|
97
|
+
- `unbrowse.replay.get {sid}` returns the summary: intent, outcome, drop-off reason, bugs and key moments.
|
|
98
|
+
- `unbrowse.replay.timeline {sid}` returns the session as text lines with times; narrow long ones with `from`/`to` or `kinds`.
|
|
99
|
+
- `unbrowse.replay.ask {question}` answers across sessions with citations (session and moment, with a link). Only cite what it returns.
|
|
100
|
+
|
|
101
|
+
Use it to find out why a learn failed (`timeline` of the `a_…` session) before retrying. REST: `/api/v1/replays…`; SDK: `client.replays.*`; CLI: `unbrowse replay list|search|show|timeline|ask`.
|
|
102
|
+
|
|
72
103
|
## Website sign-in
|
|
73
104
|
|
|
74
105
|
Unbrowse account sign-in and a website's saved login are separate. Never ask for passwords in chat or type credentials via ordinary tool arguments.
|
|
@@ -101,7 +132,8 @@ Use notes and plans for static text; results for source data; drafts for propose
|
|
|
101
132
|
|
|
102
133
|
## Limits and recovery
|
|
103
134
|
|
|
104
|
-
- 401: reconnect
|
|
135
|
+
- 401: reconnect that door. CLI 401 is `unbrowse login` for `/api/v1`. MCP 401 is the MCP server's own OAuth. One token does not fix the other.
|
|
136
|
+
- `model_unavailable` on an index job: the indexing model is out of credit. Report the job id. No tools were compiled. This is not `unbrowse.usage` and not the site.
|
|
105
137
|
- Quota/payment error: show the returned limit and console link; do not retry payments blindly. When listed, `unbrowse.credits` shows free/paid balances and can return a checkout link for the user. Opening a billing link does not authorize payment.
|
|
106
138
|
- Verification or login block: use the returned handoff; don't present a challenge page as source content.
|
|
107
139
|
- Timeout on a write: inspect the existing run before retrying.
|