@rtrvr-ai/rover 3.0.0 → 3.0.1
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 +181 -0
- package/dist/embed.js +15 -13
- package/dist/index.d.ts +5 -1
- package/dist/previewBootstrap.d.ts +27 -0
- package/dist/previewBootstrap.js +203 -0
- package/dist/rolls-cli.mjs +312 -0
- package/dist/rover.js +15 -13
- package/dist/worker/rover-worker.js +1 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Embed on websites, browser extensions, Electron apps, or any DOM environment.
|
|
|
13
13
|
|
|
14
14
|
You need an rtrvr.ai account with available credits. Free accounts get 250 credits/month. [Sign up or manage your plan](https://www.rtrvr.ai/cloud?view=pricing).
|
|
15
15
|
|
|
16
|
+
Before you test Rover on arbitrary websites, get your site config from Workspace first. Hosted Preview is the only path that does not require Workspace config.
|
|
17
|
+
|
|
16
18
|
## Quick Start (Script Tag)
|
|
17
19
|
|
|
18
20
|
Add this snippet before `</body>` on any page:
|
|
@@ -59,6 +61,7 @@ Or use the single-tag shorthand with data attributes:
|
|
|
59
61
|
<script src="https://rover.rtrvr.ai/embed.js"
|
|
60
62
|
data-site-id="YOUR_SITE_ID"
|
|
61
63
|
data-public-key="pk_site_YOUR_PUBLIC_KEY"
|
|
64
|
+
data-session-token="rvrsess_YOUR_SHORT_LIVED_SESSION_TOKEN"
|
|
62
65
|
data-allowed-domains="yourdomain.com"
|
|
63
66
|
data-domain-scope-mode="registrable_domain">
|
|
64
67
|
</script>
|
|
@@ -66,6 +69,8 @@ Or use the single-tag shorthand with data attributes:
|
|
|
66
69
|
|
|
67
70
|
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.
|
|
68
71
|
|
|
72
|
+
For temporary preview sessions, `data-session-token` can bootstrap Rover without a `publicKey`. If you also have a `sessionId`, add `data-session-id` for a stable runtime boundary.
|
|
73
|
+
|
|
69
74
|
Common patterns:
|
|
70
75
|
|
|
71
76
|
- `allowedDomains: ['example.com']` with `registrable_domain` allows `example.com` and all subdomains.
|
|
@@ -73,6 +78,182 @@ Common patterns:
|
|
|
73
78
|
- `allowedDomains: ['app.example.com']` with `registrable_domain` allows `app.example.com` and its subdomains, but not sibling hosts.
|
|
74
79
|
- `allowedDomains: ['example.com']` with `host_only` allows only the exact host `example.com`.
|
|
75
80
|
|
|
81
|
+
## Preview Helpers
|
|
82
|
+
|
|
83
|
+
The SDK also exports generic helper utilities for live demos and previews:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import {
|
|
87
|
+
attachLaunch,
|
|
88
|
+
createRoverBookmarklet,
|
|
89
|
+
createRoverConsoleSnippet,
|
|
90
|
+
createRoverScriptTagSnippet,
|
|
91
|
+
} from '@rtrvr-ai/rover';
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use `createRoverConsoleSnippet(...)` and `createRoverBookmarklet(...)` to generate one-click bootstrap payloads, and `attachLaunch(...)` when you want to attach a pre-created launch from code.
|
|
95
|
+
|
|
96
|
+
Before you use any of these helpers on another website:
|
|
97
|
+
|
|
98
|
+
1. Open Rover Workspace.
|
|
99
|
+
2. Create or rotate a site key so Workspace reveals the full `pk_site_*` value.
|
|
100
|
+
3. Copy the **test config JSON** from Workspace.
|
|
101
|
+
4. Either paste that JSON into the Rover website's "Try on Other Sites" tool, or pass the same values into the SDK helpers below.
|
|
102
|
+
|
|
103
|
+
### Which helper to use
|
|
104
|
+
|
|
105
|
+
| Path | What you need | Best for | Persistence |
|
|
106
|
+
|---|---|---|---|
|
|
107
|
+
| Hosted Preview | Signed-in URL + prompt | Rover-managed demos | Temporary preview session |
|
|
108
|
+
| Preview Helper | Workspace test config JSON or hosted handoff | Multi-page desktop demos | Re-injects after reload/navigation |
|
|
109
|
+
| Console | Workspace test config JSON + generated snippet | Fast DevTools demos | Current page only |
|
|
110
|
+
| Bookmarklet | Workspace test config JSON + generated bookmarklet | Drag-and-click demos | Current page only |
|
|
111
|
+
| Production install | Workspace install snippet | Real site install | Persistent |
|
|
112
|
+
|
|
113
|
+
- `createRoverConsoleSnippet(...)`
|
|
114
|
+
Best for desktop demos, debugging, and screen-sharing when you can paste into DevTools.
|
|
115
|
+
- `createRoverBookmarklet(...)`
|
|
116
|
+
Best for quick one-click demos across many pages, with the same current-page limitations as manual injection.
|
|
117
|
+
- `createRoverScriptTagSnippet(...)`
|
|
118
|
+
Best for generating an actual snippet from known config values such as Workspace `siteId` and `publicKey`.
|
|
119
|
+
- `attachLaunch(...)`
|
|
120
|
+
Best when you already created a launch elsewhere and want Rover to attach to it after boot.
|
|
121
|
+
|
|
122
|
+
### Example: console snippet from Workspace config
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { createRoverConsoleSnippet } from '@rtrvr-ai/rover';
|
|
126
|
+
|
|
127
|
+
const snippet = createRoverConsoleSnippet({
|
|
128
|
+
siteId: 'site_123',
|
|
129
|
+
publicKey: 'pk_site_123',
|
|
130
|
+
siteKeyId: 'key_123',
|
|
131
|
+
allowedDomains: ['example.com'],
|
|
132
|
+
domainScopeMode: 'registrable_domain',
|
|
133
|
+
apiBase: 'https://agent.rtrvr.ai',
|
|
134
|
+
openOnInit: true,
|
|
135
|
+
mode: 'full',
|
|
136
|
+
allowActions: true,
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Example: bookmarklet from Workspace config
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
import { createRoverBookmarklet } from '@rtrvr-ai/rover';
|
|
144
|
+
|
|
145
|
+
const bookmarklet = createRoverBookmarklet({
|
|
146
|
+
siteId: 'site_123',
|
|
147
|
+
publicKey: 'pk_site_123',
|
|
148
|
+
siteKeyId: 'key_123',
|
|
149
|
+
allowedDomains: ['example.com'],
|
|
150
|
+
domainScopeMode: 'registrable_domain',
|
|
151
|
+
apiBase: 'https://agent.rtrvr.ai',
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Example: production script-tag snippet from Workspace config
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import { createRoverScriptTagSnippet } from '@rtrvr-ai/rover';
|
|
159
|
+
|
|
160
|
+
const snippet = createRoverScriptTagSnippet({
|
|
161
|
+
siteId: 'site_123',
|
|
162
|
+
publicKey: 'pk_site_123',
|
|
163
|
+
siteKeyId: 'key_123',
|
|
164
|
+
allowedDomains: ['example.com'],
|
|
165
|
+
domainScopeMode: 'registrable_domain',
|
|
166
|
+
apiBase: 'https://agent.rtrvr.ai',
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Example: attach a pre-created launch
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
import { attachLaunch, boot } from '@rtrvr-ai/rover';
|
|
174
|
+
|
|
175
|
+
boot({
|
|
176
|
+
siteId: 'preview_site',
|
|
177
|
+
sessionToken: 'rvrsess_short_lived_token',
|
|
178
|
+
allowedDomains: ['example.com'],
|
|
179
|
+
domainScopeMode: 'host_only',
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
attachLaunch({
|
|
183
|
+
requestId: 'rl_123',
|
|
184
|
+
attachToken: 'attach_123',
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Two config sources
|
|
189
|
+
|
|
190
|
+
Use one of these sources for the helper functions above:
|
|
191
|
+
|
|
192
|
+
- **Workspace production config**
|
|
193
|
+
Persistent `siteId`, `publicKey`, optional `siteKeyId`, `allowedDomains`, and `domainScopeMode` from Rover Workspace.
|
|
194
|
+
- **Hosted preview config**
|
|
195
|
+
Short-lived preview/runtime values produced by Rover Instant Preview on the website or by your own preview service.
|
|
196
|
+
|
|
197
|
+
Get Workspace config from:
|
|
198
|
+
|
|
199
|
+
- [https://www.rtrvr.ai/rover/workspace](https://www.rtrvr.ai/rover/workspace)
|
|
200
|
+
- [https://rover.rtrvr.ai/workspace](https://rover.rtrvr.ai/workspace)
|
|
201
|
+
|
|
202
|
+
If you want the exact human walkthrough instead of jumping straight into code:
|
|
203
|
+
|
|
204
|
+
- website guide: [https://www.rtrvr.ai/rover/docs/try-on-other-sites](https://www.rtrvr.ai/rover/docs/try-on-other-sites)
|
|
205
|
+
- repo guide: [../../docs/TRY_ON_OTHER_SITES.md](../../docs/TRY_ON_OTHER_SITES.md)
|
|
206
|
+
- one-click helper path: use the website tool's `Open target with helper` action after pasting the Workspace config
|
|
207
|
+
|
|
208
|
+
If you want a public extension that can use either config source, see the Preview Helper app:
|
|
209
|
+
|
|
210
|
+
- [https://github.com/rtrvr-ai/rover/tree/main/apps/preview-helper](https://github.com/rtrvr-ai/rover/tree/main/apps/preview-helper)
|
|
211
|
+
- [https://www.rtrvr.ai/rover/docs/instant-preview-api](https://www.rtrvr.ai/rover/docs/instant-preview-api)
|
|
212
|
+
|
|
213
|
+
### Hosted preview handoff behavior
|
|
214
|
+
|
|
215
|
+
The open-source helper extension understands hosted preview handoff URLs that include:
|
|
216
|
+
|
|
217
|
+
- `rover_preview_id`
|
|
218
|
+
- `rover_preview_token`
|
|
219
|
+
- `rover_preview_api`
|
|
220
|
+
|
|
221
|
+
When those are present, the helper can fetch the short-lived preview config from the hosted Rover API and reconnect it across navigation.
|
|
222
|
+
|
|
223
|
+
### Security notes
|
|
224
|
+
|
|
225
|
+
- `pk_site_*` values are Workspace install credentials for a real site.
|
|
226
|
+
- `rvrsess_*` values are short-lived runtime session credentials.
|
|
227
|
+
- Preview tokens are demo credentials and should be treated as ephemeral.
|
|
228
|
+
- Do not treat preview tokens as a replacement for production Workspace site keys.
|
|
229
|
+
- Keep preview or helper injections scoped to the intended host with `allowedDomains` and the right `domainScopeMode`.
|
|
230
|
+
- Generic `publicKey` config is the normal Workspace path. `sessionToken` is the temporary preview/runtime path.
|
|
231
|
+
|
|
232
|
+
### Troubleshooting
|
|
233
|
+
|
|
234
|
+
- **`This API key is missing capability: roverEmbed`**
|
|
235
|
+
Your Workspace key is not embed-enabled. Rotate or create an embed-ready key, then rebuild the snippet or bookmarklet from the fresh test config JSON.
|
|
236
|
+
- **`React has blocked a javascript: URL`**
|
|
237
|
+
Delete any old Rover bookmarklet and recreate it from the latest Rover Live Test page. The bookmarklet must be dragged from Rover's dedicated drag control, not clicked on the Rover page itself.
|
|
238
|
+
- **Console or Bookmarklet worked once, then stopped**
|
|
239
|
+
Those are current-page-only methods. A full reload drops the injected JavaScript.
|
|
240
|
+
- **A site still blocks Rover after you generated valid output**
|
|
241
|
+
Some sites enforce strict CSP or reload aggressively. Use the Preview Helper or Hosted Preview instead.
|
|
242
|
+
- **`Open hosted shell` does nothing**
|
|
243
|
+
Hosted Preview should open Rover's dedicated hosted viewer route, not the launcher page.
|
|
244
|
+
|
|
245
|
+
### Hosted playground
|
|
246
|
+
|
|
247
|
+
If you want the full managed preview flow, including preview creation and Workspace handoff, use the hosted website:
|
|
248
|
+
|
|
249
|
+
- [https://www.rtrvr.ai/rover/instant-preview](https://www.rtrvr.ai/rover/instant-preview)
|
|
250
|
+
|
|
251
|
+
More architecture detail:
|
|
252
|
+
|
|
253
|
+
- [Instant Preview architecture](https://github.com/rtrvr-ai/rover/blob/main/docs/INSTANT_PREVIEW.md)
|
|
254
|
+
- [Hosted preview API docs](https://www.rtrvr.ai/rover/docs/instant-preview-api)
|
|
255
|
+
- [Hosted preview OpenAPI spec](https://raw.githubusercontent.com/rtrvr-ai/rtrvr-cloud-backend/main/docs/rover-instant-preview.openapi.yaml)
|
|
256
|
+
|
|
76
257
|
## npm Install
|
|
77
258
|
|
|
78
259
|
```bash
|