@rtrvr-ai/rover 2.0.2 → 2.3.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 CHANGED
@@ -18,6 +18,7 @@ You need an rtrvr.ai account with available credits. Free accounts get 250 credi
18
18
  Add this snippet before `</body>` on any page:
19
19
 
20
20
  ```html
21
+ <script type="application/agent+json">{"task":"https://agent.rtrvr.ai/v1/tasks"}</script>
21
22
  <script>
22
23
  (function(){
23
24
  var r = window.rover = window.rover || function(){
@@ -36,6 +37,15 @@ Add this snippet before `</body>` on any page:
36
37
  <script src="https://rover.rtrvr.ai/embed.js" async></script>
37
38
  ```
38
39
 
40
+ Get `siteId`, `publicKey` (`pk_site_*`), and optional `siteKeyId` from Rover Workspace:
41
+
42
+ - `https://rover.rtrvr.ai/workspace`
43
+ - `https://www.rtrvr.ai/rover/workspace`
44
+
45
+ Those values are for site owners installing Rover. External AI callers do **not** need them.
46
+
47
+ If you have a `siteKeyId`, append it to the script URL as `embed.js?v=YOUR_SITE_KEY_ID` for cache-busting and safer key rotation. The `v` query string does not affect domain authorization or scope matching.
48
+
39
49
  Or use the single-tag shorthand with data attributes:
40
50
 
41
51
  ```html
@@ -47,7 +57,14 @@ Or use the single-tag shorthand with data attributes:
47
57
  </script>
48
58
  ```
49
59
 
50
- Use `data-domain-scope-mode="host_only"` to require exact host matches. Plain entries such as `example.com` become exact-host rules in `host_only` mode, while `registrable_domain` continues to allow subdomains.
60
+ Use `data-domain-scope-mode="host_only"` to require exact host matches. Plain entries such as `example.com` become exact-host rules in `host_only` mode. In the default `registrable_domain` mode, plain entries match the apex host and its subdomains, while `*.example.com` matches subdomains only.
61
+
62
+ Common patterns:
63
+
64
+ - `allowedDomains: ['example.com']` with `registrable_domain` allows `example.com` and all subdomains.
65
+ - `allowedDomains: ['*.example.com']` allows subdomains only, not the apex host.
66
+ - `allowedDomains: ['app.example.com']` with `registrable_domain` allows `app.example.com` and its subdomains, but not sibling hosts.
67
+ - `allowedDomains: ['example.com']` with `host_only` allows only the exact host `example.com`.
51
68
 
52
69
  ## npm Install
53
70
 
@@ -118,11 +135,11 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
118
135
  | `siteId` | `string` | *required* | Site identifier |
119
136
  | `publicKey` | `string` | — | Public embeddable site key (`pk_site_*`) from Rover Workspace |
120
137
  | `sessionToken` | `string` | — | Optional short-lived Rover session token (`rvrsess_*`). |
121
- | `siteKeyId` | `string` | — | Site key ID from Workspace |
138
+ | `siteKeyId` | `string` | — | Site key ID from Workspace. Recommended for embed cache-busting/rotation rollouts; not used for scope matching. |
122
139
  | `visitor` | `{ name?: string; email?: string }` | — | Optional visitor profile for greeting personalization. Recommended flow is async updates via `identify(...)` after login/user hydration. |
123
- | `apiBase` | `string` | `https://extensionrouter.rtrvr.ai` | Optional API base override. Rover uses `/v2/rover/*` under this base. |
124
- | `allowedDomains` | `string[]` | `[]` | Hostnames where Rover may operate |
125
- | `domainScopeMode` | `'registrable_domain' \| 'host_only'` | `'registrable_domain'` | Domain matching strategy |
140
+ | `apiBase` | `string` | `https://agent.rtrvr.ai` | Optional API base override. Rover uses `/v2/rover/*` under this base. |
141
+ | `allowedDomains` | `string[]` | `[]` | Hostnames or patterns where Rover may operate. In `registrable_domain`, plain `example.com` covers the apex host and subdomains. |
142
+ | `domainScopeMode` | `'registrable_domain' \| 'host_only'` | `'registrable_domain'` | How Rover interprets plain `allowedDomains` entries: `registrable_domain` = apex + subdomains, `host_only` = exact host only. |
126
143
  | `externalNavigationPolicy` | `'open_new_tab_notice' \| 'block' \| 'allow'` | `'open_new_tab_notice'` | External navigation policy |
127
144
  | `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` | In-scope cross-host navigation policy |
128
145
  | `mode` | `'full' \| 'safe'` | `'full'` | Runtime mode |
@@ -264,9 +281,70 @@ If you enable `tools.web.scrapeMode: 'on_demand'`, use a site key capability pro
264
281
 
265
282
  See [full configuration reference](https://github.com/rtrvr-ai/rover/blob/main/docs/INTEGRATION.md#configuration-reference).
266
283
 
284
+ ## Public Agent Tasks (ATP)
285
+
286
+ Rover-enabled sites expose two public entrypoints:
287
+
288
+ - browser-first convenience via `?rover=` and `?rover_shortcut=`
289
+ - machine-first task resources via `POST https://agent.rtrvr.ai/v1/tasks`
290
+
291
+ Use `/v1/tasks` when you need structured progress, continuation, or the final result back.
292
+
293
+ The source-visible marker is optional but recommended:
294
+
295
+ ```html
296
+ <script type="application/agent+json">{"task":"https://agent.rtrvr.ai/v1/tasks"}</script>
297
+ ```
298
+
299
+ ```http
300
+ POST https://agent.rtrvr.ai/v1/tasks
301
+ Content-Type: application/json
302
+
303
+ { "url": "https://www.rtrvr.ai", "prompt": "get me the latest blog post" }
304
+ ```
305
+
306
+ Anonymous AI callers do **not** need `siteId`, `publicKey`, or `siteKeyId`.
307
+
308
+ The returned task URL is the canonical resource:
309
+
310
+ - `GET` + `Accept: application/json` for polling or final result
311
+ - `GET` + `Accept: text/event-stream` for SSE
312
+ - `GET` + `Accept: application/x-ndjson` for CLI-friendly streaming
313
+ - `POST { "input": "..." }` for continuation when the task asks for more input
314
+ - `DELETE` to cancel
315
+ - a `workflow` URL when the task belongs to an aggregated multi-site workflow
316
+
317
+ Task creation may also return browser handoff URLs:
318
+
319
+ - `open`: clean receipt URL for browser attach
320
+ - `browserLink`: optional readable alias with visible `?rover=` or `?rover_shortcut=` when it fits the URL budget
321
+
322
+ The task URL remains canonical; receipt links are only a browser handoff layer over that same task.
323
+
324
+ - `Prefer: execution=browser` keeps execution browser-first
325
+ - `Prefer: execution=cloud` is the explicit browserless path today
326
+ - `Prefer: execution=auto` prefers browser attach first; delayed cloud auto-promotion is a follow-up robustness phase
327
+
328
+ Rover deep links like `?rover=` and `?rover_shortcut=` remain the simple browser-first entrypoints; `/v1/tasks` is the machine-oriented protocol. Cross-site workflows and handoffs extend that same public contract rather than replacing it.
329
+
330
+ ### Cross-site workflows and handoffs
331
+
332
+ Public tasks can delegate to Rover on another Rover-enabled site without leaving the same protocol surface.
333
+
334
+ - `POST /v1/tasks/{id}/handoffs` creates a child task on another site
335
+ - `GET /v1/workflows/{id}` returns aggregated workflow state or stream
336
+ - child tasks inherit the same workflow lineage as the parent
337
+
338
+ Receiving sites must explicitly opt in through Workspace/site config:
339
+
340
+ - `aiAccess.enabled = true`
341
+ - `aiAccess.allowDelegatedHandoffs = true`
342
+
343
+ By default, handoffs carry a structured summary rather than the full transcript or tool trace.
344
+
267
345
  ## Rover V2 Runtime Endpoints
268
346
 
269
- Browser runtime calls target `https://extensionrouter.rtrvr.ai/v2/rover/*`:
347
+ Browser runtime calls target `https://agent.rtrvr.ai/v2/rover/*`:
270
348
 
271
349
  - `POST /session/open`
272
350
  - `POST /command` (`RUN_INPUT`, `RUN_CONTROL`, `TAB_EVENT`, `ASK_USER_ANSWER`)
@@ -359,7 +437,7 @@ If your site sets a CSP header, add these directives:
359
437
  |---|---|---|
360
438
  | `script-src` | `https://rover.rtrvr.ai blob:` | SDK script + Web Worker blob |
361
439
  | `worker-src` | `blob: https://rover.rtrvr.ai` | Web Worker execution |
362
- | `connect-src` | `https://extensionrouter.rtrvr.ai` | API calls |
440
+ | `connect-src` | `https://agent.rtrvr.ai` | API calls |
363
441
  | `style-src` | `'unsafe-inline'` | Shadow DOM styles |
364
442
  | `font-src` | `https://rover.rtrvr.ai` | Self-hosted Manrope font |
365
443