@rtrvr-ai/rover 1.3.2 → 2.0.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 +50 -13
- package/dist/embed.js +360 -58
- package/dist/index.d.ts +84 -9
- package/dist/rover.js +1675 -21328
- package/dist/worker/rover-worker.js +18 -6290
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Add this snippet before `</body>` on any page:
|
|
|
21
21
|
|
|
22
22
|
rover('boot', {
|
|
23
23
|
siteId: 'YOUR_SITE_ID',
|
|
24
|
-
|
|
24
|
+
publicKey: 'pk_site_YOUR_PUBLIC_KEY',
|
|
25
25
|
allowedDomains: ['yourdomain.com'],
|
|
26
26
|
});
|
|
27
27
|
</script>
|
|
@@ -33,7 +33,7 @@ Or use the single-tag shorthand with data attributes:
|
|
|
33
33
|
```html
|
|
34
34
|
<script src="https://rover.rtrvr.ai/embed.js"
|
|
35
35
|
data-site-id="YOUR_SITE_ID"
|
|
36
|
-
data-
|
|
36
|
+
data-public-key="pk_site_YOUR_PUBLIC_KEY"
|
|
37
37
|
data-allowed-domains="yourdomain.com">
|
|
38
38
|
</script>
|
|
39
39
|
```
|
|
@@ -49,7 +49,7 @@ import { boot, shutdown } from '@rtrvr-ai/rover';
|
|
|
49
49
|
|
|
50
50
|
boot({
|
|
51
51
|
siteId: 'YOUR_SITE_ID',
|
|
52
|
-
|
|
52
|
+
publicKey: 'pk_site_YOUR_PUBLIC_KEY',
|
|
53
53
|
allowedDomains: ['yourdomain.com'],
|
|
54
54
|
});
|
|
55
55
|
```
|
|
@@ -64,7 +64,7 @@ export function RoverWidget() {
|
|
|
64
64
|
useEffect(() => {
|
|
65
65
|
boot({
|
|
66
66
|
siteId: 'YOUR_SITE_ID',
|
|
67
|
-
|
|
67
|
+
publicKey: 'pk_site_YOUR_PUBLIC_KEY',
|
|
68
68
|
allowedDomains: ['yourdomain.com'],
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -101,23 +101,27 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
101
101
|
| Option | Type | Default | Description |
|
|
102
102
|
|---|---|---|---|
|
|
103
103
|
| `siteId` | `string` | *required* | Site identifier |
|
|
104
|
-
| `
|
|
104
|
+
| `publicKey` | `string` | — | Public embeddable site key (`pk_site_*`) from Rover Workspace |
|
|
105
|
+
| `sessionToken` | `string` | — | Optional short-lived Rover session token (`rvrsess_*`). |
|
|
105
106
|
| `siteKeyId` | `string` | — | Site key ID from Workspace |
|
|
106
|
-
| `authToken` | `string` | — | Optional bearer token override (takes precedence over `apiKey` when both are set) |
|
|
107
107
|
| `visitor` | `{ name?: string; email?: string }` | — | Optional visitor profile for greeting personalization. Recommended flow is async updates via `identify(...)` after login/user hydration. |
|
|
108
|
-
| `apiBase` | `string` | `https://extensionrouter.rtrvr.ai` | Optional API base override.
|
|
108
|
+
| `apiBase` | `string` | `https://extensionrouter.rtrvr.ai` | Optional API base override. Rover uses `/v2/rover/*` under this base. |
|
|
109
109
|
| `allowedDomains` | `string[]` | `[]` | Hostnames where Rover may operate |
|
|
110
110
|
| `domainScopeMode` | `'registrable_domain' \| 'host_only'` | `'registrable_domain'` | Domain matching strategy |
|
|
111
111
|
| `externalNavigationPolicy` | `'open_new_tab_notice' \| 'block' \| 'allow'` | `'open_new_tab_notice'` | External navigation policy |
|
|
112
|
-
| `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` |
|
|
112
|
+
| `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` | In-scope cross-host navigation policy |
|
|
113
113
|
| `mode` | `'full' \| 'safe'` | `'full'` | Runtime mode |
|
|
114
114
|
| `allowActions` | `boolean` | `true` | Enable or disable action tools |
|
|
115
115
|
| `openOnInit` | `boolean` | `false` | Open panel immediately on boot |
|
|
116
116
|
| `sessionScope` | `'shared_site' \| 'tab'` | `'shared_site'` | Session sharing across tabs |
|
|
117
117
|
| `taskRouting.mode` | `'auto' \| 'act' \| 'planner'` | `'act'` | Task routing strategy |
|
|
118
|
-
| `taskRouting.plannerOnActError` | `boolean` | `true` |
|
|
118
|
+
| `taskRouting.plannerOnActError` | `boolean` | `true` | In `auto` mode, retry planner only when ACT does not produce a usable outcome |
|
|
119
119
|
| `taskRouting.actHeuristicThreshold` | `number` | `5` (auto mode) | Auto-routing threshold |
|
|
120
|
-
| `
|
|
120
|
+
| `task.followup.mode` | `'heuristic_same_window'` | `'heuristic_same_window'` | Heuristic follow-up chat-cue carryover mode |
|
|
121
|
+
| `task.followup.ttlMs` | `number` | `120000` | Max age (ms) of prior completed/ended task eligible for follow-up chat cues |
|
|
122
|
+
| `task.followup.minLexicalOverlap` | `number` | `0.18` | Minimum lexical overlap ratio to attach follow-up chat cues |
|
|
123
|
+
| `task.autoResumePolicy` | `'auto' \| 'confirm' \| 'never'` | `'confirm'` | Pending-run resume behavior: auto-resume immediately, require Resume/Cancel confirmation, or always cancel pending interrupted run. |
|
|
124
|
+
| `checkpointing.enabled` | `boolean` | `true` | Cloud checkpoint sync is enabled by default in v1. Set to `false` to disable. |
|
|
121
125
|
| `checkpointing.autoVisitorId` | `boolean` | `true` | Auto-generate visitor ID when needed |
|
|
122
126
|
| `checkpointing.ttlHours` | `number` | `1` | Checkpoint TTL in hours |
|
|
123
127
|
| `checkpointing.onStateChange` | `(payload) => void` | — | Checkpoint lifecycle updates (`active`, `paused_auth`) |
|
|
@@ -127,7 +131,7 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
127
131
|
| `telemetry.flushIntervalMs` | `number` | `12000` | Flush cadence for buffered telemetry events |
|
|
128
132
|
| `telemetry.maxBatchSize` | `number` | `30` | Maximum number of telemetry events sent per flush request |
|
|
129
133
|
| `telemetry.includePayloads` | `boolean` | `false` | Include richer per-event payload details (debug/tool context). Increases telemetry volume and may include sensitive runtime content. |
|
|
130
|
-
| `apiMode` | `boolean` | auto (`true` when `
|
|
134
|
+
| `apiMode` | `boolean` | auto (`true` when `publicKey` or `sessionToken` exists) | Force API execution mode |
|
|
131
135
|
| `apiToolsConfig.mode` | `'allowlist' \| 'profile' \| 'none'` | `'none'` | API additional tool exposure mode |
|
|
132
136
|
| `tools.web.enableExternalWebContext` | `boolean` | `false` | External tab cloud context fallback |
|
|
133
137
|
| `tools.web.scrapeMode` | `'off' \| 'on_demand'` | `'off'` | On-demand external tab scrape mode |
|
|
@@ -146,13 +150,43 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
146
150
|
| `ui.shortcuts` | `RoverShortcut[]` | `[]` | Suggested journeys (max 100 stored, max 12 rendered by default; lower site-key policy caps are enforced) |
|
|
147
151
|
| `ui.greeting` | `{ text?, delay?, duration?, disabled? }` | — | Greeting bubble config (`{name}` token supported) |
|
|
148
152
|
|
|
149
|
-
When a site key is used, Rover
|
|
153
|
+
When a site key or session token is used, Rover fetches cloud site config via `/v2/rover/session/open` (shortcuts + greeting).
|
|
150
154
|
If the same field exists in both cloud config and boot config, boot config wins.
|
|
151
155
|
|
|
152
156
|
If you enable `tools.web.scrapeMode: 'on_demand'`, use a site key capability profile that includes cloud scrape support.
|
|
153
157
|
|
|
154
158
|
See [full configuration reference](https://github.com/rtrvr-ai/rover/blob/main/docs/INTEGRATION.md#configuration-reference).
|
|
155
159
|
|
|
160
|
+
## Rover V2 Runtime Endpoints
|
|
161
|
+
|
|
162
|
+
Browser runtime calls target `https://extensionrouter.rtrvr.ai/v2/rover/*`:
|
|
163
|
+
|
|
164
|
+
- `POST /session/open`
|
|
165
|
+
- `POST /command` (`RUN_INPUT`, `RUN_CONTROL`, `TAB_EVENT`, `ASK_USER_ANSWER`)
|
|
166
|
+
- `GET /stream` (SSE)
|
|
167
|
+
- `GET /state`
|
|
168
|
+
- `POST /snapshot`
|
|
169
|
+
- `POST /context/external`
|
|
170
|
+
- `POST /telemetry/ingest`
|
|
171
|
+
|
|
172
|
+
Runtime contract notes:
|
|
173
|
+
|
|
174
|
+
- Server is authoritative (`sessionId + runId + epoch + seq`).
|
|
175
|
+
- `taskRouting.mode` maps to `requestedMode` in `POST /command` payloads with `type='RUN_INPUT'`.
|
|
176
|
+
- `plannerOnActError` applies only in `auto` mode and only when ACT has no usable outcome.
|
|
177
|
+
- Typed conflicts: `stale_seq`, `stale_epoch`, `active_run_exists`.
|
|
178
|
+
- `POST /command` stale/missing run is non-fatal for tab navigation decisions (`decision='stale_run'`).
|
|
179
|
+
- Cross-registrable navigation preflight is resilient: if command-tab decision checks are unavailable, Rover falls back to local policy (in-scope targets follow `navigation.crossHostPolicy`, default `same_tab`; out-of-scope targets follow `externalNavigationPolicy`).
|
|
180
|
+
- External intent routing: `/context/external` uses `read_context` (read/navigation-context prompts) or `act` (mutation prompts). Navigation-only external opens are represented by `POST /command` with `type='TAB_EVENT'` plus external placeholder tab handling.
|
|
181
|
+
- Any normal user send starts a fresh task boundary (fresh `prevSteps`, fresh run-scoped tab order/scope).
|
|
182
|
+
- `ask_user` answer submissions are the only continuation path and keep the same task boundary.
|
|
183
|
+
- `task.followup` is operative heuristic carryover for chat cues only (`user` + `model` summary pair); it never carries previous task state/tab scope.
|
|
184
|
+
- `task.autoResumePolicy` is enforced at runtime: `auto` resumes, `confirm` shows explicit Resume/Cancel suggestion, `never` cancels pending resume.
|
|
185
|
+
- Resume blocked/declined/never paths terminalize the local task to `cancelled`, clear local running indicators, and schedule backend cancel repair (`RUN_CONTROL cancel`) unless a live remote controller owns that run.
|
|
186
|
+
- Server projection never re-adopts locally ignored run IDs; ignored projected active runs trigger cancel repair retry.
|
|
187
|
+
- Same-domain/subdomain continuity is preserved when a live controller tab owns the active run; reopening tabs stay observer-safe and do not force-cancel that run.
|
|
188
|
+
- Runtime does not use legacy browser checkpoint routes (`roverSessionCheckpointGet/Upsert`).
|
|
189
|
+
|
|
156
190
|
## API Methods
|
|
157
191
|
|
|
158
192
|
All methods are available as both command-style and method-style calls:
|
|
@@ -206,6 +240,9 @@ rover.on('error', (err) => console.error(err));
|
|
|
206
240
|
| `task_ended` | `{ reason }` | Task ended |
|
|
207
241
|
| `checkpoint_state` | `{ state, reason?, action?, code?, message? }` | Checkpoint sync state updates |
|
|
208
242
|
| `checkpoint_error` | `{ action, code?, message, ... }` | Checkpoint request failure details |
|
|
243
|
+
| `tab_event_conflict_retry` | `{ runId, conflict?, ... }` | One stale seq/epoch tab-event conflict was recovered by silent retry |
|
|
244
|
+
| `tab_event_conflict_exhausted` | `{ runId, conflict?, ... }` | Tab-event stale conflict retry exhausted (non-fatal; projection sync follows) |
|
|
245
|
+
| `checkpoint_token_missing` | `{ action, status }` | Legacy checkpoint browser path blocked |
|
|
209
246
|
|
|
210
247
|
## Content Security Policy (CSP)
|
|
211
248
|
|
|
@@ -244,7 +281,7 @@ For environments that cannot allow external domains:
|
|
|
244
281
|
```javascript
|
|
245
282
|
rover('boot', {
|
|
246
283
|
siteId: 'YOUR_SITE_ID',
|
|
247
|
-
|
|
284
|
+
publicKey: 'pk_site_YOUR_PUBLIC_KEY',
|
|
248
285
|
workerUrl: '/assets/rover-worker.js',
|
|
249
286
|
});
|
|
250
287
|
```
|