@rtrvr-ai/rover 2.0.1 → 2.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 CHANGED
@@ -1,6 +1,13 @@
1
1
  # @rtrvr-ai/rover
2
2
 
3
- Rover is a DOM-native embedded web agent that lives inside your website. Unlike traditional chat widgets that run in iframes, Rover reads the actual DOM and executes actions directly in the user's browser enabling real task completion, not just conversation.
3
+ **Turn any web interface into an AI agentwith one line of code.**
4
+
5
+ Rover is an open-source, DOM-native agent SDK that reads the real DOM,
6
+ plans actions, and executes them directly in the browser. Clicks, form fills,
7
+ navigation, data extraction — sub-second, no screenshots, no remote VMs.
8
+ Embed on websites, browser extensions, Electron apps, or any DOM environment.
9
+
10
+ [GitHub](https://github.com/rtrvr-ai/rover) · [Website](https://www.rtrvr.ai/rover) · [Docs](https://www.rtrvr.ai/rover/docs) · [Discord](https://rtrvr.ai/discord)
4
11
 
5
12
  ## Prerequisites
6
13
 
@@ -11,6 +18,7 @@ You need an rtrvr.ai account with available credits. Free accounts get 250 credi
11
18
  Add this snippet before `</body>` on any page:
12
19
 
13
20
  ```html
21
+ <script type="application/agent+json">{"task":"https://agent.rtrvr.ai/v1/tasks"}</script>
14
22
  <script>
15
23
  (function(){
16
24
  var r = window.rover = window.rover || function(){
@@ -29,6 +37,15 @@ Add this snippet before `</body>` on any page:
29
37
  <script src="https://rover.rtrvr.ai/embed.js" async></script>
30
38
  ```
31
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
+
32
49
  Or use the single-tag shorthand with data attributes:
33
50
 
34
51
  ```html
@@ -40,7 +57,14 @@ Or use the single-tag shorthand with data attributes:
40
57
  </script>
41
58
  ```
42
59
 
43
- 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`.
44
68
 
45
69
  ## npm Install
46
70
 
@@ -104,69 +128,209 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
104
128
 
105
129
  ## Configuration
106
130
 
131
+ ### Core
132
+
107
133
  | Option | Type | Default | Description |
108
134
  |---|---|---|---|
109
135
  | `siteId` | `string` | *required* | Site identifier |
110
136
  | `publicKey` | `string` | — | Public embeddable site key (`pk_site_*`) from Rover Workspace |
111
137
  | `sessionToken` | `string` | — | Optional short-lived Rover session token (`rvrsess_*`). |
112
- | `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. |
113
139
  | `visitor` | `{ name?: string; email?: string }` | — | Optional visitor profile for greeting personalization. Recommended flow is async updates via `identify(...)` after login/user hydration. |
114
- | `apiBase` | `string` | `https://extensionrouter.rtrvr.ai` | Optional API base override. Rover uses `/v2/rover/*` under this base. |
115
- | `allowedDomains` | `string[]` | `[]` | Hostnames where Rover may operate |
116
- | `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. |
117
143
  | `externalNavigationPolicy` | `'open_new_tab_notice' \| 'block' \| 'allow'` | `'open_new_tab_notice'` | External navigation policy |
118
144
  | `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` | In-scope cross-host navigation policy |
119
145
  | `mode` | `'full' \| 'safe'` | `'full'` | Runtime mode |
120
146
  | `allowActions` | `boolean` | `true` | Enable or disable action tools |
121
147
  | `openOnInit` | `boolean` | `false` | Open panel immediately on boot |
122
148
  | `sessionScope` | `'shared_site' \| 'tab'` | `'shared_site'` | Session sharing across tabs |
123
- | `taskRouting.mode` | `'auto' \| 'act' \| 'planner'` | `'act'` | Task routing strategy |
124
- | `taskRouting.plannerOnActError` | `boolean` | `true` | In `auto` mode, retry planner only when ACT does not produce a usable outcome |
125
- | `taskRouting.actHeuristicThreshold` | `number` | `5` (auto mode) | Auto-routing threshold |
149
+ | `workerUrl` | `string` | auto | Custom worker URL for self-hosting |
150
+ | `apiMode` | `boolean` | auto (`true` when `publicKey` or `sessionToken` exists) | Force API execution mode |
151
+
152
+ ### Timing
153
+
154
+ | Option | Type | Default | Description |
155
+ |---|---|---|---|
156
+ | `timing.navigationDelayMs` | `number` | `80` | Delay (ms) before same-tab navigation executes, allowing state persistence |
157
+ | `timing.actionTimeoutMs` | `number` | `30000` | Timeout (ms) for bridge RPC calls from the worker |
158
+ | `timing.domSettleDebounceMs` | `number` | `24` | Adaptive DOM settle debounce before a11y tree capture |
159
+ | `timing.domSettleMaxWaitMs` | `number` | `220` | Adaptive DOM settle max wait before a11y tree capture |
160
+ | `timing.domSettleRetries` | `number` | `0` | Adaptive DOM settle bounded retries before capture |
161
+ | `timing.sparseTreeRetryDelayMs` | `number` | `35` | Additional delay before sparse-tree retry capture |
162
+ | `timing.sparseTreeRetryMaxAttempts` | `number` | `1` | Number of sparse-tree retries when roots are too sparse |
163
+
164
+ ### Tab Indicators
165
+
166
+ | Option | Type | Default | Description |
167
+ |---|---|---|---|
168
+ | `ui.tabIndicator.titlePrefix` | `boolean` | `true` | Prepend "[Rover] " to document.title during task execution |
169
+ | `ui.tabIndicator.faviconBadge` | `boolean` | `false` | Overlay a colored dot on the favicon (opt-in due to CORS) |
170
+ | `ui.tabIndicator.widgetTabBar` | `boolean` | `true` | Show in-widget tab bar of agent-controlled tabs |
171
+
172
+ ### Tab Policy
173
+
174
+ | Option | Type | Default | Description |
175
+ |---|---|---|---|
176
+ | `tabPolicy.observerByDefault` | `boolean` | — | Start tabs in observer mode by default |
177
+ | `tabPolicy.actionLeaseMs` | `number` | — | Action lease duration in milliseconds |
178
+
179
+ ### Task Management
180
+
181
+ | Option | Type | Default | Description |
182
+ |---|---|---|---|
183
+ | `task.singleActiveScope` | `'host_session'` | — | Scope for single active task enforcement |
184
+ | `task.tabScope` | `'task_touched_only'` | — | Tab scope strategy |
185
+ | `task.maxConcurrentWorkers` | `number` | `2` | Maximum concurrent Web Workers (max: 3) |
186
+ | `task.maxQueuedTasks` | `number` | `5` | Maximum queued tasks waiting for a worker |
187
+ | `task.maxArchivedTasks` | `number` | `10` | Maximum archived (terminal) tasks to keep |
188
+ | `task.resume.mode` | `'crash_only'` | — | Resume behavior mode |
189
+ | `task.resume.ttlMs` | `number` | — | Resume TTL in milliseconds |
190
+ | `task.autoResumePolicy` | `'auto' \| 'confirm' \| 'never'` | `'confirm'` | Pending-run resume behavior: auto-resume immediately, require Resume/Cancel confirmation, or always cancel pending interrupted run. |
126
191
  | `task.followup.mode` | `'heuristic_same_window'` | `'heuristic_same_window'` | Heuristic follow-up chat-cue carryover mode |
127
192
  | `task.followup.ttlMs` | `number` | `120000` | Max age (ms) of prior completed/ended task eligible for follow-up chat cues |
128
193
  | `task.followup.minLexicalOverlap` | `number` | `0.18` | Minimum lexical overlap ratio to attach follow-up chat cues |
129
- | `task.autoResumePolicy` | `'auto' \| 'confirm' \| 'never'` | `'confirm'` | Pending-run resume behavior: auto-resume immediately, require Resume/Cancel confirmation, or always cancel pending interrupted run. |
194
+
195
+ ### Task Routing
196
+
197
+ | Option | Type | Default | Description |
198
+ |---|---|---|---|
199
+ | `taskRouting.mode` | `'auto' \| 'act' \| 'planner'` | `'act'` | Task routing strategy |
200
+ | `taskRouting.plannerOnActError` | `boolean` | `true` | In `auto` mode, retry planner only when ACT does not produce a usable outcome |
201
+ | `taskRouting.actHeuristicThreshold` | `number` | `5` (auto mode) | Auto-routing threshold |
202
+
203
+ ### Checkpointing
204
+
205
+ | Option | Type | Default | Description |
206
+ |---|---|---|---|
130
207
  | `checkpointing.enabled` | `boolean` | `true` | Cloud checkpoint sync is enabled by default in v1. Set to `false` to disable. |
131
208
  | `checkpointing.autoVisitorId` | `boolean` | `true` | Auto-generate visitor ID when needed |
132
209
  | `checkpointing.ttlHours` | `number` | `1` | Checkpoint TTL in hours |
133
210
  | `checkpointing.onStateChange` | `(payload) => void` | — | Checkpoint lifecycle updates (`active`, `paused_auth`) |
134
211
  | `checkpointing.onError` | `(payload) => void` | — | Checkpoint request error callback |
212
+
213
+ ### Telemetry
214
+
215
+ | Option | Type | Default | Description |
216
+ |---|---|---|---|
135
217
  | `telemetry.enabled` | `boolean` | `true` | Enable runtime telemetry batching |
136
218
  | `telemetry.sampleRate` | `number` | `1` | Sampling ratio (`1` = all events, `0.1` ≈ 10%) |
137
219
  | `telemetry.flushIntervalMs` | `number` | `12000` | Flush cadence for buffered telemetry events |
138
220
  | `telemetry.maxBatchSize` | `number` | `30` | Maximum number of telemetry events sent per flush request |
139
221
  | `telemetry.includePayloads` | `boolean` | `false` | Include richer per-event payload details (debug/tool context). Increases telemetry volume and may include sensitive runtime content. |
140
- | `apiMode` | `boolean` | auto (`true` when `publicKey` or `sessionToken` exists) | Force API execution mode |
141
- | `apiToolsConfig.mode` | `'allowlist' \| 'profile' \| 'none'` | `'none'` | API additional tool exposure mode |
142
- | `tools.web.enableExternalWebContext` | `boolean` | `false` | External tab cloud context fallback |
143
- | `tools.web.scrapeMode` | `'off' \| 'on_demand'` | `'off'` | On-demand external tab scrape mode |
144
- | `tools.web.allowDomains` | `string[]` | `[]` | External context allowlist |
145
- | `tools.web.denyDomains` | `string[]` | `[]` | External context denylist |
146
- | `tools.client` | `ClientToolDefinition[]` | `[]` | Runtime-registered client tools |
147
- | `workerUrl` | `string` | auto | Custom worker URL for self-hosting |
222
+
223
+ ### UI
224
+
225
+ | Option | Type | Default | Description |
226
+ |---|---|---|---|
148
227
  | `ui.agent.name` | `string` | `'Rover'` | Custom assistant name |
149
228
  | `ui.mascot.disabled` | `boolean` | `false` | Disable mascot video |
150
229
  | `ui.mascot.mp4Url` | `string` | default | Custom mascot MP4 URL |
151
230
  | `ui.mascot.webmUrl` | `string` | default | Custom mascot WebM URL |
152
231
  | `ui.muted` | `boolean` | `true` | Start with audio muted on first load; stored browser preference wins after the user toggles sound |
153
232
  | `ui.thoughtStyle` | `'concise_cards' \| 'minimal'` | `'concise_cards'` | Thought rendering style |
154
- | `ui.panel.resizable` | `boolean` | `true` | Panel resizable preference |
233
+ | `ui.panel.resizable` | `boolean` | `true` | Enables desktop freeform resizing plus phone/tablet snap-height resizing with per-device memory |
155
234
  | `ui.showTaskControls` | `boolean` | `true` | Show new/end task controls |
156
235
  | `ui.shortcuts` | `RoverShortcut[]` | `[]` | Suggested journeys (max 100 stored, max 12 rendered by default; lower site-key policy caps are enforced) |
157
236
  | `ui.greeting` | `{ text?, delay?, duration?, disabled? }` | — | Greeting bubble config (`{name}` token supported) |
237
+ | `ui.voice` | `{ enabled?: boolean; language?: string; autoStopMs?: number }` | — | Browser dictation for supported Chromium browsers. Rover fills the draft live, waits for post-speech silence before stopping, and the user still sends manually. |
238
+
239
+ ### Web Tools
240
+
241
+ | Option | Type | Default | Description |
242
+ |---|---|---|---|
243
+ | `apiToolsConfig.mode` | `'allowlist' \| 'profile' \| 'none'` | `'none'` | API additional tool exposure mode |
244
+ | `tools.web.enableExternalWebContext` | `boolean` | `false` | External tab cloud context fallback |
245
+ | `tools.web.scrapeMode` | `'off' \| 'on_demand'` | `'off'` | On-demand external tab scrape mode |
246
+ | `tools.web.allowDomains` | `string[]` | `[]` | External context allowlist |
247
+ | `tools.web.denyDomains` | `string[]` | `[]` | External context denylist |
248
+ | `tools.client` | `ClientToolDefinition[]` | `[]` | Runtime-registered client tools |
158
249
  | `pageConfig` | `RoverPageCaptureConfig` | — | Optional per-site page-capture overrides such as `disableAutoScroll`, settle timing, and sparse-tree retry settings |
159
250
 
160
- When a site key or session token is used, Rover fetches cloud site config via `/v2/rover/session/open` (shortcuts + greeting + pageConfig).
251
+ ### AI-Callable URLs (Deep Links)
252
+
253
+ Rover can be triggered via URL query parameters, turning any page into an AI-callable endpoint.
254
+
255
+ | Option | Type | Default | Description |
256
+ |---|---|---|---|
257
+ | `deepLink.enabled` | `boolean` | `false` | Enable URL-triggered Rover |
258
+ | `deepLink.promptParam` | `string` | `'rover'` | Query parameter for natural-language prompts |
259
+ | `deepLink.shortcutParam` | `string` | `'rover_shortcut'` | Query parameter for shortcut IDs |
260
+ | `deepLink.consume` | `boolean` | `true` | Strip deep link params from URL after reading |
261
+
262
+ **Prompt deep link** — pass a natural-language instruction:
263
+
264
+ ```
265
+ https://example.com?rover=book%20a%20flight
266
+ ```
267
+
268
+ **Shortcut deep link** — invoke a pre-defined flow by ID:
269
+
270
+ ```
271
+ https://example.com?rover_shortcut=checkout_flow
272
+ ```
273
+
274
+ For AI or CLI-triggered entrypoints, prefer exact shortcut IDs for repeatable flows.
275
+
276
+ When a site key or session token is used, Rover fetches cloud site config via `/v2/rover/session/open` (shortcuts + greeting + voice + pageConfig).
161
277
  If the same field exists in both cloud config and boot config, boot config wins.
278
+ `deepLink` is boot/runtime only and is not persisted in cloud site config.
162
279
 
163
280
  If you enable `tools.web.scrapeMode: 'on_demand'`, use a site key capability profile that includes cloud scrape support.
164
281
 
165
282
  See [full configuration reference](https://github.com/rtrvr-ai/rover/blob/main/docs/INTEGRATION.md#configuration-reference).
166
283
 
284
+ ## Public Agent Tasks
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
+
316
+ Task creation may also return browser handoff URLs:
317
+
318
+ - `open`: clean receipt URL for browser attach
319
+ - `browserLink`: optional readable alias with visible `?rover=` or `?rover_shortcut=` when it fits the URL budget
320
+
321
+ The task URL remains canonical; receipt links are only a browser handoff layer over that same task.
322
+
323
+ The response also includes an `open` URL for browser attach.
324
+
325
+ - `Prefer: execution=browser` keeps execution browser-first
326
+ - `Prefer: execution=cloud` is the explicit browserless path today
327
+ - `Prefer: execution=auto` prefers browser attach first; delayed cloud auto-promotion is a follow-up robustness phase
328
+
329
+ Rover deep links like `?rover=` and `?rover_shortcut=` remain the simple browser-first entrypoints; `/v1/tasks` is the machine-oriented protocol.
330
+
167
331
  ## Rover V2 Runtime Endpoints
168
332
 
169
- Browser runtime calls target `https://extensionrouter.rtrvr.ai/v2/rover/*`:
333
+ Browser runtime calls target `https://agent.rtrvr.ai/v2/rover/*`:
170
334
 
171
335
  - `POST /session/open`
172
336
  - `POST /command` (`RUN_INPUT`, `RUN_CONTROL`, `TAB_EVENT`, `ASK_USER_ANSWER`)
@@ -259,7 +423,7 @@ If your site sets a CSP header, add these directives:
259
423
  |---|---|---|
260
424
  | `script-src` | `https://rover.rtrvr.ai blob:` | SDK script + Web Worker blob |
261
425
  | `worker-src` | `blob: https://rover.rtrvr.ai` | Web Worker execution |
262
- | `connect-src` | `https://extensionrouter.rtrvr.ai` | API calls |
426
+ | `connect-src` | `https://agent.rtrvr.ai` | API calls |
263
427
  | `style-src` | `'unsafe-inline'` | Shadow DOM styles |
264
428
  | `font-src` | `https://rover.rtrvr.ai` | Self-hosted Manrope font |
265
429
 
@@ -301,6 +465,9 @@ Load your self-hosted `embed.js` instead of the CDN version:
301
465
 
302
466
  ## Links
303
467
 
468
+ - [GitHub](https://github.com/rtrvr-ai/rover)
304
469
  - [Integration Guide](https://github.com/rtrvr-ai/rover/blob/main/docs/INTEGRATION.md)
305
470
  - [Rover Workspace](https://rover.rtrvr.ai/workspace) — generate site keys and install snippets
306
471
  - [Website](https://www.rtrvr.ai/rover)
472
+ - [Documentation](https://www.rtrvr.ai/rover/docs)
473
+ - [Discord](https://rtrvr.ai/discord)