@rtrvr-ai/rover 3.0.1 → 4.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 +130 -22
- package/dist/agentDiscovery.d.ts +304 -0
- package/dist/agentDiscovery.js +1040 -0
- package/dist/embed.js +3733 -1564
- package/dist/index.d.ts +16 -2
- package/dist/ownerInstall.d.ts +152 -0
- package/dist/ownerInstall.js +357 -0
- package/dist/previewBootstrap.d.ts +9 -0
- package/dist/previewBootstrap.js +72 -2
- package/dist/rover.js +3733 -1564
- package/dist/worker/rover-worker.js +11 -11
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -39,12 +39,14 @@ Add this snippet before `</body>` on any page:
|
|
|
39
39
|
<script src="https://rover.rtrvr.ai/embed.js" async></script>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
If
|
|
42
|
+
If Agent analytics is enabled for the site in Rover Workspace, the generated install snippet also includes `https://rover.rtrvr.ai/roverbook.js` plus an inline attach block that calls `window.RoverBook.enableRoverBook(window.rover, ...)`. Copy the Workspace snippet as-is for production installs.
|
|
43
43
|
|
|
44
44
|
Workspace also controls site mode:
|
|
45
45
|
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
46
|
+
- `Rover Agent`: action-capable Rover runtime plus Agent analytics
|
|
47
|
+
- `Agent Analytics`: embed-oriented analytics deployment with action tools disabled
|
|
48
|
+
|
|
49
|
+
Workspace onboarding now also gives site owners a dedicated Journeys step for shortcuts, defaults new production site keys to `No expiry`, and exposes `Cloud sandboxes` as the single owner-facing switch for cloud execution plus approved third-party browsing.
|
|
48
50
|
|
|
49
51
|
Get `siteId`, `publicKey` (`pk_site_*`), and optional `siteKeyId` from Rover Workspace:
|
|
50
52
|
|
|
@@ -76,7 +78,7 @@ Common patterns:
|
|
|
76
78
|
- `allowedDomains: ['example.com']` with `registrable_domain` allows `example.com` and all subdomains.
|
|
77
79
|
- `allowedDomains: ['*.example.com']` allows subdomains only, not the apex host.
|
|
78
80
|
- `allowedDomains: ['app.example.com']` with `registrable_domain` allows `app.example.com` and its subdomains, but not sibling hosts.
|
|
79
|
-
- `allowedDomains: ['example.com']` with `host_only` allows only the exact host `example.com
|
|
81
|
+
- `allowedDomains: ['example.com']` with `host_only` allows only the exact host `example.com`; sibling subdomains are blocked unless you explicitly list them.
|
|
80
82
|
|
|
81
83
|
## Preview Helpers
|
|
82
84
|
|
|
@@ -85,8 +87,12 @@ The SDK also exports generic helper utilities for live demos and previews:
|
|
|
85
87
|
```ts
|
|
86
88
|
import {
|
|
87
89
|
attachLaunch,
|
|
90
|
+
createRoverAgentCardJson,
|
|
91
|
+
createRoverAgentDiscoveryTags,
|
|
88
92
|
createRoverBookmarklet,
|
|
89
93
|
createRoverConsoleSnippet,
|
|
94
|
+
createRoverOwnerInstallBundle,
|
|
95
|
+
createRoverServiceDescLinkHeader,
|
|
90
96
|
createRoverScriptTagSnippet,
|
|
91
97
|
} from '@rtrvr-ai/rover';
|
|
92
98
|
```
|
|
@@ -116,6 +122,10 @@ Before you use any of these helpers on another website:
|
|
|
116
122
|
Best for quick one-click demos across many pages, with the same current-page limitations as manual injection.
|
|
117
123
|
- `createRoverScriptTagSnippet(...)`
|
|
118
124
|
Best for generating an actual snippet from known config values such as Workspace `siteId` and `publicKey`.
|
|
125
|
+
- `createRoverOwnerInstallBundle(...)`
|
|
126
|
+
Best for canonical owner-facing install output when you need a body-safe runtime snippet plus separate head discovery HTML, `rover-site.json`, `agent-card.json`, and optional `llms.txt`.
|
|
127
|
+
- `createRoverAgentCardJson(...)`, `createRoverAgentDiscoveryTags(...)`, `createRoverServiceDescLinkHeader(...)`
|
|
128
|
+
Best for publishing source-visible discovery metadata so arbitrary agents can find Rover skills before falling back to DOM automation.
|
|
119
129
|
- `attachLaunch(...)`
|
|
120
130
|
Best when you already created a launch elsewhere and want Rover to attach to it after boot.
|
|
121
131
|
|
|
@@ -167,6 +177,44 @@ const snippet = createRoverScriptTagSnippet({
|
|
|
167
177
|
});
|
|
168
178
|
```
|
|
169
179
|
|
|
180
|
+
### Example: canonical owner install bundle
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { createRoverOwnerInstallBundle } from '@rtrvr-ai/rover';
|
|
184
|
+
|
|
185
|
+
const bundle = createRoverOwnerInstallBundle({
|
|
186
|
+
bootConfig: {
|
|
187
|
+
siteId: 'site_123',
|
|
188
|
+
publicKey: 'pk_site_123',
|
|
189
|
+
siteKeyId: 'key_123',
|
|
190
|
+
allowedDomains: ['example.com'],
|
|
191
|
+
domainScopeMode: 'registrable_domain',
|
|
192
|
+
cloudSandboxEnabled: true,
|
|
193
|
+
ui: {
|
|
194
|
+
shortcuts: [
|
|
195
|
+
{ id: 'book_demo', label: 'Book demo', prompt: 'Help me book a demo.' },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
discovery: {
|
|
200
|
+
siteId: 'site_123',
|
|
201
|
+
siteUrl: 'https://example.com/',
|
|
202
|
+
siteName: 'Example Store',
|
|
203
|
+
roverSiteUrl: '/.well-known/rover-site.json',
|
|
204
|
+
agentCardUrl: '/.well-known/agent-card.json',
|
|
205
|
+
llmsUrl: '/llms.txt',
|
|
206
|
+
},
|
|
207
|
+
emitLlmsTxt: true,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
bundle.bodyInstallHtml; // paste before </body>
|
|
211
|
+
bundle.headDiscoveryHtml; // place in <head> or managed head custom code
|
|
212
|
+
bundle.roverSiteJson; // publish at /.well-known/rover-site.json
|
|
213
|
+
bundle.agentCardJson; // publish at /.well-known/agent-card.json
|
|
214
|
+
bundle.serviceDescLinkHeader;
|
|
215
|
+
bundle.llmsTxt;
|
|
216
|
+
```
|
|
217
|
+
|
|
170
218
|
### Example: attach a pre-created launch
|
|
171
219
|
|
|
172
220
|
```ts
|
|
@@ -210,6 +258,52 @@ If you want a public extension that can use either config source, see the Previe
|
|
|
210
258
|
- [https://github.com/rtrvr-ai/rover/tree/main/apps/preview-helper](https://github.com/rtrvr-ai/rover/tree/main/apps/preview-helper)
|
|
211
259
|
- [https://www.rtrvr.ai/rover/docs/instant-preview-api](https://www.rtrvr.ai/rover/docs/instant-preview-api)
|
|
212
260
|
|
|
261
|
+
### Agent Discovery Publishing
|
|
262
|
+
|
|
263
|
+
Use the new discovery helpers when you want generic agents to see explicit Rover skills before they start clicking through the DOM:
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
import {
|
|
267
|
+
createRoverAgentCardJson,
|
|
268
|
+
createRoverAgentDiscoveryTags,
|
|
269
|
+
createRoverServiceDescLinkHeader,
|
|
270
|
+
} from '@rtrvr-ai/rover';
|
|
271
|
+
|
|
272
|
+
const agentCardJson = createRoverAgentCardJson({
|
|
273
|
+
siteUrl: 'https://example.com/',
|
|
274
|
+
siteName: 'Example Store',
|
|
275
|
+
shortcuts: [
|
|
276
|
+
{
|
|
277
|
+
id: 'start_checkout',
|
|
278
|
+
label: 'Start Checkout',
|
|
279
|
+
prompt: 'start checkout',
|
|
280
|
+
description: 'Launch the checkout flow directly.',
|
|
281
|
+
tags: ['checkout', 'commerce'],
|
|
282
|
+
examples: ['Start checkout for the current cart.'],
|
|
283
|
+
sideEffect: 'transactional',
|
|
284
|
+
requiresConfirmation: true,
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
const discoveryTags = createRoverAgentDiscoveryTags({
|
|
290
|
+
siteUrl: 'https://example.com/',
|
|
291
|
+
siteName: 'Example Store',
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
const linkHeader = createRoverServiceDescLinkHeader({
|
|
295
|
+
agentCardUrl: '/.well-known/agent-card.json',
|
|
296
|
+
llmsUrl: '/llms.txt',
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Recommended rollout:
|
|
301
|
+
|
|
302
|
+
1. Serve `roverSiteJson` at `/.well-known/rover-site.json`.
|
|
303
|
+
2. Serve `agentCardJson` at `/.well-known/agent-card.json`.
|
|
304
|
+
3. Add `discoveryTags` near the Rover snippet in page source.
|
|
305
|
+
4. Add the `Link` header generated by `createRoverServiceDescLinkHeader(...)`.
|
|
306
|
+
|
|
213
307
|
### Hosted preview handoff behavior
|
|
214
308
|
|
|
215
309
|
The open-source helper extension understands hosted preview handoff URLs that include:
|
|
@@ -327,9 +421,9 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
327
421
|
| `visitor` | `{ name?: string; email?: string }` | — | Optional visitor profile for greeting personalization. Recommended flow is async updates via `identify(...)` after login/user hydration. |
|
|
328
422
|
| `apiBase` | `string` | `https://agent.rtrvr.ai` | Optional API base override. Rover uses `/v2/rover/*` under this base. |
|
|
329
423
|
| `allowedDomains` | `string[]` | `[]` | Hostnames or patterns where Rover may operate. In `registrable_domain`, plain `example.com` covers the apex host and subdomains. |
|
|
330
|
-
| `domainScopeMode` | `'registrable_domain' \| 'host_only'` | `'registrable_domain'` | How Rover interprets plain `allowedDomains` entries: `registrable_domain` = apex + subdomains, `host_only` = exact host only. |
|
|
331
|
-
| `externalNavigationPolicy` | `'open_new_tab_notice' \| 'block' \| 'allow'` | `'open_new_tab_notice'` |
|
|
332
|
-
| `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` |
|
|
424
|
+
| `domainScopeMode` | `'registrable_domain' \| 'host_only'` | `'registrable_domain'` | How Rover interprets plain `allowedDomains` entries: `registrable_domain` = apex + subdomains, `host_only` = exact host only unless you explicitly allow more hosts. |
|
|
425
|
+
| `externalNavigationPolicy` | `'open_new_tab_notice' \| 'block' \| 'allow'` | `'open_new_tab_notice'` | Advanced / legacy external navigation override. Standard owner-facing installs rely on Rover's default new-tab-with-notice behavior outside allowed scope. |
|
|
426
|
+
| `navigation.crossHostPolicy` | `'same_tab' \| 'open_new_tab'` | `'same_tab'` | Advanced / legacy in-scope cross-host override. Standard owner-facing installs let Rover choose the right tab automatically. |
|
|
333
427
|
| `mode` | `'full' \| 'safe'` | `'full'` | Runtime mode |
|
|
334
428
|
| `allowActions` | `boolean` | `true` | Enable or disable action tools |
|
|
335
429
|
| `openOnInit` | `boolean` | `false` | Open panel immediately on boot |
|
|
@@ -413,14 +507,17 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
413
507
|
| Option | Type | Default | Description |
|
|
414
508
|
|---|---|---|---|
|
|
415
509
|
| `ui.agent.name` | `string` | `'Rover'` | Custom assistant name |
|
|
416
|
-
| `ui.mascot.disabled` | `boolean` | `false` |
|
|
417
|
-
| `ui.mascot.
|
|
418
|
-
| `ui.mascot.
|
|
419
|
-
| `ui.
|
|
510
|
+
| `ui.mascot.disabled` | `boolean` | `false` | Hide mascot media entirely |
|
|
511
|
+
| `ui.mascot.imageUrl` | `string` | default | Custom mascot image URL. Works by itself or as the fallback/poster for custom video mascots |
|
|
512
|
+
| `ui.mascot.mp4Url` | `string` | default | Custom mascot MP4 URL. Video is preferred when MP4 or WebM is provided |
|
|
513
|
+
| `ui.mascot.webmUrl` | `string` | default | Custom mascot WebM URL. Video is preferred when MP4 or WebM is provided |
|
|
514
|
+
| `ui.mascot.soundEnabled` | `boolean` | `false` | Owner gate for mascot sound. Video mascots stay silent unless this is explicitly `true`; image-only mascots remain silent |
|
|
515
|
+
| `ui.muted` | `boolean` | `true` | Initial mute state only when mascot sound is enabled. Visitor preference is stored per Rover site after they toggle sound. |
|
|
420
516
|
| `ui.thoughtStyle` | `'concise_cards' \| 'minimal'` | `'concise_cards'` | Thought rendering style |
|
|
421
517
|
| `ui.panel.resizable` | `boolean` | `true` | Enables desktop freeform resizing plus phone/tablet snap-height resizing with per-device memory |
|
|
422
518
|
| `ui.showTaskControls` | `boolean` | `true` | Show new/end task controls |
|
|
423
|
-
| `ui.shortcuts` | `RoverShortcut[]` | `[]` | Suggested journeys (max 100 stored, max 12 rendered by default; lower site-key policy caps are enforced) |
|
|
519
|
+
| `ui.shortcuts` | `RoverShortcut[]` | `[]` | Suggested journeys (max 100 stored, max 12 rendered by default; lower site-key policy caps are enforced). Shortcuts can also publish agent-facing metadata such as `tags`, `examples`, `inputSchema`, `outputSchema`, `sideEffect`, and `requiresConfirmation`. |
|
|
520
|
+
| `cloudSandboxEnabled` | `boolean` | `false` | Owner-facing shorthand for cloud execution plus approved third-party browsing. When `true`, Rover materializes `tools.web.enableExternalWebContext=true` and `tools.web.scrapeMode='on_demand'`. |
|
|
424
521
|
| `ui.greeting` | `{ text?, delay?, duration?, disabled? }` | — | Greeting bubble config (`{name}` token supported) |
|
|
425
522
|
| `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. |
|
|
426
523
|
|
|
@@ -433,7 +530,8 @@ const RoverWidget = dynamic(() => import('./RoverWidget'), { ssr: false });
|
|
|
433
530
|
| `tools.web.scrapeMode` | `'off' \| 'on_demand'` | `'off'` | On-demand external tab scrape mode |
|
|
434
531
|
| `tools.web.allowDomains` | `string[]` | `[]` | External context allowlist |
|
|
435
532
|
| `tools.web.denyDomains` | `string[]` | `[]` | External context denylist |
|
|
436
|
-
| `tools.client` | `ClientToolDefinition[]` | `[]` | Runtime-registered client tools |
|
|
533
|
+
| `tools.client` | `ClientToolDefinition[]` | `[]` | Runtime-registered client tools. Tool definitions can include `title`, `outputSchema`, and `annotations` (`whenToUse`, `whyUse`, `examples`, `sideEffect`, `requiresConfirmation`) to improve model tool selection and discovery-card quality. |
|
|
534
|
+
| `agentDiscovery` | `{ enabled?, siteName?, description?, version?, siteUrl?, agentCardUrl?, roverSiteUrl?, llmsUrl?, hostSurfaceSelector?, preferExecution?, discoverySurface?, additionalSkills? }` | — | Optional overrides for Rover's generated discovery surfaces. `rover-site.json` is the authoritative rich profile, `agent-card.json` is the interop card, and `discoverySurface.beaconLabel` now feeds the visible seed/presence CTA text in production. Legacy `visibleCue` / `visibleCueLabel` remain compatibility inputs only. |
|
|
437
535
|
| `pageConfig` | `RoverPageCaptureConfig` | — | Optional per-site page-capture overrides such as `disableAutoScroll`, settle timing, and sparse-tree retry settings |
|
|
438
536
|
|
|
439
537
|
### AI-Callable URLs (Deep Links)
|
|
@@ -442,7 +540,7 @@ Rover can be triggered via URL query parameters, turning any page into an AI-cal
|
|
|
442
540
|
|
|
443
541
|
| Option | Type | Default | Description |
|
|
444
542
|
|---|---|---|---|
|
|
445
|
-
| `deepLink.enabled` | `boolean` | `false` |
|
|
543
|
+
| `deepLink.enabled` | `boolean` | derived from `siteConfig.aiAccess.enabled` when available, otherwise `false` | Advanced manual override for URL-triggered Rover |
|
|
446
544
|
| `deepLink.promptParam` | `string` | `'rover'` | Query parameter for natural-language prompts |
|
|
447
545
|
| `deepLink.shortcutParam` | `string` | `'rover_shortcut'` | Query parameter for shortcut IDs |
|
|
448
546
|
| `deepLink.consume` | `boolean` | `true` | Strip deep link params from URL after reading |
|
|
@@ -461,11 +559,11 @@ https://example.com?rover_shortcut=checkout_flow
|
|
|
461
559
|
|
|
462
560
|
For AI or CLI-triggered entrypoints, prefer exact shortcut IDs for repeatable flows.
|
|
463
561
|
|
|
464
|
-
When a site key or session token is used, Rover fetches cloud site config via `/v2/rover/session/open` (shortcuts +
|
|
562
|
+
When a site key or session token is used, Rover fetches cloud site config via `/v2/rover/session/open` (shortcuts + `businessType` + sparse `experience` overrides + legacy voice compatibility + `aiAccess` + `pageConfig`).
|
|
465
563
|
If the same field exists in both cloud config and boot config, boot config wins.
|
|
466
|
-
`
|
|
564
|
+
`siteConfig.aiAccess.enabled` is the canonical owner-facing launch switch persisted from Workspace/Webflow. `deepLink` stays boot/runtime only for advanced manual overrides such as custom param names, explicit enable/disable, or disabling URL param consumption.
|
|
467
565
|
|
|
468
|
-
|
|
566
|
+
For owner-facing installs, prefer `cloudSandboxEnabled: true` instead of hand-wiring low-level scrape/browser flags. Rover materializes the current runtime fields from that shorthand for you.
|
|
469
567
|
|
|
470
568
|
See [full configuration reference](https://github.com/rtrvr-ai/rover/blob/main/docs/INTEGRATION.md#configuration-reference).
|
|
471
569
|
|
|
@@ -484,13 +582,22 @@ The source-visible marker is optional but recommended:
|
|
|
484
582
|
<script type="application/agent+json">{"task":"https://agent.rtrvr.ai/v1/tasks"}</script>
|
|
485
583
|
```
|
|
486
584
|
|
|
585
|
+
For stronger pre-task discovery, publish `/.well-known/rover-site.json` as Rover's authoritative rich profile, publish `/.well-known/agent-card.json` as the interop card, add a `Link: </.well-known/agent-card.json>; rel="service-desc"` header, and include inline discovery tags generated by `createRoverAgentDiscoveryTags(...)`.
|
|
586
|
+
|
|
487
587
|
```http
|
|
488
588
|
POST https://agent.rtrvr.ai/v1/tasks
|
|
489
589
|
Content-Type: application/json
|
|
490
590
|
|
|
491
|
-
{
|
|
591
|
+
{
|
|
592
|
+
"url": "https://www.rtrvr.ai",
|
|
593
|
+
"goal": "Get me the latest blog post",
|
|
594
|
+
"capabilityId": "latest_blog_post",
|
|
595
|
+
"accept": { "modes": ["text", "json"] }
|
|
596
|
+
}
|
|
492
597
|
```
|
|
493
598
|
|
|
599
|
+
Compatibility aliases such as `{ "url": "...", "prompt": "..." }` and `{ "url": "...", "shortcutId": "..." }` still work, but the richer task envelope is the canonical contract.
|
|
600
|
+
|
|
494
601
|
Callers may also provide structured visiting-agent metadata:
|
|
495
602
|
|
|
496
603
|
```http
|
|
@@ -499,7 +606,7 @@ Content-Type: application/json
|
|
|
499
606
|
|
|
500
607
|
{
|
|
501
608
|
"url": "https://www.rtrvr.ai",
|
|
502
|
-
"
|
|
609
|
+
"goal": "Get me the latest blog post",
|
|
503
610
|
"agent": {
|
|
504
611
|
"key": "gpt-5.4-demo-agent",
|
|
505
612
|
"name": "GPT-5.4 Demo Agent",
|
|
@@ -539,13 +646,13 @@ Rover deep links like `?rover=` and `?rover_shortcut=` remain the simple browser
|
|
|
539
646
|
|
|
540
647
|
Rover normalizes visiting-agent attribution in this order:
|
|
541
648
|
|
|
542
|
-
1. verified signal
|
|
649
|
+
1. verified signed signal
|
|
543
650
|
2. explicit `agent` object on public task creation or handoffs
|
|
544
651
|
3. heuristic headers such as `User-Agent`, `Signature-Agent`, `Signature`, `Signature-Input`, and `X-RTRVR-Client-Id`
|
|
545
652
|
4. advanced local fallbacks such as RoverBook `identityResolver`
|
|
546
653
|
5. anonymous fallback
|
|
547
654
|
|
|
548
|
-
|
|
655
|
+
Trust tiers are `verified_signed`, `signed_directory_only`, `self_reported`, `heuristic`, and `anonymous`. Unsigned headers never escalate above `heuristic`.
|
|
549
656
|
|
|
550
657
|
### Cross-site workflows and handoffs
|
|
551
658
|
|
|
@@ -583,7 +690,7 @@ Runtime contract notes:
|
|
|
583
690
|
- `plannerOnActError` applies only in `auto` mode and only when ACT has no usable outcome.
|
|
584
691
|
- Typed conflicts: `stale_seq`, `stale_epoch`, `active_run_exists`.
|
|
585
692
|
- `POST /command` stale/missing run is non-fatal for tab navigation decisions (`decision='stale_run'`).
|
|
586
|
-
- Cross-registrable navigation preflight is resilient: if
|
|
693
|
+
- Cross-registrable navigation preflight is resilient: if decision checks are unavailable, Rover falls back to local runtime behavior. Standard installs open outside-domain pages in a new tab with notice and choose the right tab automatically for allowed-host hops; explicit legacy overrides still apply when present.
|
|
587
694
|
- 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.
|
|
588
695
|
- Any normal user send starts a fresh task boundary (fresh `prevSteps`, fresh run-scoped tab order/scope).
|
|
589
696
|
- `ask_user` answer submissions are the only continuation path and keep the same task boundary.
|
|
@@ -620,6 +727,7 @@ rover.send('Hello');
|
|
|
620
727
|
| `newTask(options?)` | Start a new task, clearing context |
|
|
621
728
|
| `endTask(options?)` | End the current task |
|
|
622
729
|
| `getState()` | Get current runtime state |
|
|
730
|
+
| `getAgentCard()` | Build the current Rover capability card from live shortcuts, client tools, and WebMCP metadata |
|
|
623
731
|
| `update(config)` | Update configuration without rebooting |
|
|
624
732
|
| `registerTool(def, handler)` | Register a client-side tool |
|
|
625
733
|
| `requestSigned(url, init?)` | Issue a fetch signed with the current Rover session token and site/session headers |
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import type { RoverShortcut } from '@rover/ui';
|
|
2
|
+
import { createRoverAgentDiscoverySnapshot } from '@rover/shared/lib/agent-discovery.js';
|
|
3
|
+
import type { RoverAgentDiscoverySnapshot } from '@rover/shared/lib/types/index.js';
|
|
4
|
+
export declare const DEFAULT_AGENT_CARD_PATH = "/.well-known/agent-card.json";
|
|
5
|
+
export declare const DEFAULT_ROVER_SITE_PATH = "/.well-known/rover-site.json";
|
|
6
|
+
export declare const DEFAULT_LLMS_PATH = "/llms.txt";
|
|
7
|
+
export declare const ROVER_WEBMCP_DISCOVERY_GLOBAL = "__ROVER_WEBMCP_TOOL_DEFS__";
|
|
8
|
+
export declare const ROVER_DISCOVERY_ACTION_SHEET_MAX_ACTIONS = 3;
|
|
9
|
+
type JsonSchema = Record<string, any>;
|
|
10
|
+
export type RoverDiscoveryExecutionPreference = 'auto' | 'browser' | 'cloud';
|
|
11
|
+
export type RoverDiscoverySurfaceMode = 'silent' | 'beacon' | 'integrated' | 'debug';
|
|
12
|
+
export type RoverDiscoverySurfaceBranding = 'site' | 'co' | 'rover';
|
|
13
|
+
export type RoverDiscoveryHostSurface = 'auto' | 'existing-assistant' | 'floating-corner' | 'inline-primary';
|
|
14
|
+
export type RoverDiscoveryActionReveal = 'click' | 'focus' | 'keyboard' | 'agent-handshake';
|
|
15
|
+
export type RoverCapabilityResultMode = 'text' | 'markdown' | 'json' | 'observation' | 'artifacts';
|
|
16
|
+
export type RoverSkillSideEffect = 'none' | 'read' | 'write' | 'transactional';
|
|
17
|
+
export type RoverSkillInterface = 'task' | 'shortcut' | 'client_tool' | 'webmcp';
|
|
18
|
+
export type RoverDiscoverySurfacePolicy = {
|
|
19
|
+
mode?: RoverDiscoverySurfaceMode;
|
|
20
|
+
branding?: RoverDiscoverySurfaceBranding;
|
|
21
|
+
hostSurface?: RoverDiscoveryHostSurface;
|
|
22
|
+
actionReveal?: RoverDiscoveryActionReveal;
|
|
23
|
+
beaconLabel?: string;
|
|
24
|
+
agentModeEntryHints?: string[];
|
|
25
|
+
};
|
|
26
|
+
export type RoverToolAnnotations = {
|
|
27
|
+
category?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
examples?: string[];
|
|
30
|
+
whenToUse?: string;
|
|
31
|
+
whyUse?: string;
|
|
32
|
+
sideEffect?: RoverSkillSideEffect;
|
|
33
|
+
requiresConfirmation?: boolean;
|
|
34
|
+
preferredInterface?: RoverSkillInterface;
|
|
35
|
+
priority?: 'primary' | 'secondary';
|
|
36
|
+
};
|
|
37
|
+
export type RoverAgentDiscoveryToolDefinition = {
|
|
38
|
+
name: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
parameters?: Record<string, any>;
|
|
42
|
+
required?: string[];
|
|
43
|
+
schema?: JsonSchema;
|
|
44
|
+
outputSchema?: JsonSchema;
|
|
45
|
+
llmCallable?: boolean;
|
|
46
|
+
annotations?: RoverToolAnnotations | Record<string, any>;
|
|
47
|
+
};
|
|
48
|
+
export type RoverPublicSkillDefinition = {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
examples?: string[];
|
|
54
|
+
inputSchema?: JsonSchema;
|
|
55
|
+
outputSchema?: JsonSchema;
|
|
56
|
+
sideEffect?: RoverSkillSideEffect;
|
|
57
|
+
requiresConfirmation?: boolean;
|
|
58
|
+
preferredInterface?: RoverSkillInterface;
|
|
59
|
+
category?: 'primary' | 'secondary';
|
|
60
|
+
rover?: {
|
|
61
|
+
shortcutId?: string;
|
|
62
|
+
prompt?: string;
|
|
63
|
+
routing?: 'auto' | 'act' | 'planner';
|
|
64
|
+
toolName?: string;
|
|
65
|
+
task?: {
|
|
66
|
+
endpoint: string;
|
|
67
|
+
payload: Record<string, unknown>;
|
|
68
|
+
preferExecution: RoverDiscoveryExecutionPreference;
|
|
69
|
+
};
|
|
70
|
+
deepLink?: string;
|
|
71
|
+
source?: 'shortcut' | 'client_tool' | 'webmcp' | 'additional';
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export type RoverCapabilityRecord = {
|
|
75
|
+
capabilityId: string;
|
|
76
|
+
version: string;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
inputSchema?: JsonSchema;
|
|
80
|
+
outputSchema?: JsonSchema;
|
|
81
|
+
sideEffect?: RoverSkillSideEffect;
|
|
82
|
+
requiresConfirmation?: boolean;
|
|
83
|
+
preferredInterface?: RoverSkillInterface;
|
|
84
|
+
allowedExecutionModes: RoverDiscoveryExecutionPreference[];
|
|
85
|
+
resultModes: RoverCapabilityResultMode[];
|
|
86
|
+
pageScope?: string[];
|
|
87
|
+
analyticsTags?: string[];
|
|
88
|
+
rover?: RoverPublicSkillDefinition['rover'];
|
|
89
|
+
};
|
|
90
|
+
export type RoverPageDefinition = {
|
|
91
|
+
pageId: string;
|
|
92
|
+
route?: string;
|
|
93
|
+
label?: string;
|
|
94
|
+
capabilityIds?: string[];
|
|
95
|
+
entityHints?: string[];
|
|
96
|
+
formHints?: string[];
|
|
97
|
+
visibleCueLabel?: string;
|
|
98
|
+
beaconLabel?: string;
|
|
99
|
+
discoveryMode?: RoverDiscoverySurfaceMode;
|
|
100
|
+
hostSurface?: RoverDiscoveryHostSurface;
|
|
101
|
+
actionReveal?: RoverDiscoveryActionReveal;
|
|
102
|
+
agentModeEntryHints?: string[];
|
|
103
|
+
capabilitySummary?: string[];
|
|
104
|
+
};
|
|
105
|
+
export type RoverSiteProfile = {
|
|
106
|
+
identity: {
|
|
107
|
+
siteId?: string;
|
|
108
|
+
name: string;
|
|
109
|
+
description: string;
|
|
110
|
+
siteUrl: string;
|
|
111
|
+
version: string;
|
|
112
|
+
};
|
|
113
|
+
actions: RoverCapabilityRecord[];
|
|
114
|
+
pages: RoverPageDefinition[];
|
|
115
|
+
policies: {
|
|
116
|
+
preferredExecution: RoverDiscoveryExecutionPreference;
|
|
117
|
+
promptLaunchEnabled: boolean;
|
|
118
|
+
shortcutLaunchEnabled: boolean;
|
|
119
|
+
cloudBrowserAllowed: boolean;
|
|
120
|
+
delegatedHandoffs: boolean;
|
|
121
|
+
};
|
|
122
|
+
auth: {
|
|
123
|
+
taskEndpoint: string;
|
|
124
|
+
workflowEndpoint: string;
|
|
125
|
+
acceptsHttpMessageSignatures: boolean;
|
|
126
|
+
supportsUnsignedSelfReportedIdentity: boolean;
|
|
127
|
+
};
|
|
128
|
+
analytics: {
|
|
129
|
+
layer: 'roverbook';
|
|
130
|
+
taskIdField: 'taskId';
|
|
131
|
+
workflowIdField: 'workflowId';
|
|
132
|
+
capabilityIdField: 'capabilityId';
|
|
133
|
+
pageIdField: 'pageId';
|
|
134
|
+
};
|
|
135
|
+
currentPage?: RoverPageDefinition;
|
|
136
|
+
display: {
|
|
137
|
+
mode: RoverDiscoverySurfaceMode;
|
|
138
|
+
branding: RoverDiscoverySurfaceBranding;
|
|
139
|
+
hostSurface: RoverDiscoveryHostSurface;
|
|
140
|
+
actionReveal: RoverDiscoveryActionReveal;
|
|
141
|
+
beaconLabel?: string;
|
|
142
|
+
agentModeEntryHints: string[];
|
|
143
|
+
compactActionMaxActions: number;
|
|
144
|
+
};
|
|
145
|
+
artifacts: {
|
|
146
|
+
agentCardUrl: string;
|
|
147
|
+
roverSiteUrl: string;
|
|
148
|
+
llmsUrl?: string;
|
|
149
|
+
siteUrl: string;
|
|
150
|
+
};
|
|
151
|
+
interfaces?: RoverAgentCard['interfaces'];
|
|
152
|
+
};
|
|
153
|
+
export type RoverAgentCard = {
|
|
154
|
+
name: string;
|
|
155
|
+
description: string;
|
|
156
|
+
url: string;
|
|
157
|
+
version: string;
|
|
158
|
+
defaultInputModes: string[];
|
|
159
|
+
defaultOutputModes: string[];
|
|
160
|
+
capabilities: {
|
|
161
|
+
streaming: boolean;
|
|
162
|
+
publicTasks: boolean;
|
|
163
|
+
stateTransitions: boolean;
|
|
164
|
+
delegatedHandoffs: boolean;
|
|
165
|
+
webmcp: boolean;
|
|
166
|
+
};
|
|
167
|
+
skills: RoverPublicSkillDefinition[];
|
|
168
|
+
interfaces?: Array<{
|
|
169
|
+
type: 'task' | 'workflow' | 'site' | 'deep_link' | 'webmcp';
|
|
170
|
+
url: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
available?: boolean;
|
|
173
|
+
}>;
|
|
174
|
+
extensions?: {
|
|
175
|
+
rover: {
|
|
176
|
+
siteId?: string;
|
|
177
|
+
siteUrl: string;
|
|
178
|
+
taskEndpoint: string;
|
|
179
|
+
workflowEndpoint: string;
|
|
180
|
+
serviceDescUrl: string;
|
|
181
|
+
roverSiteUrl: string;
|
|
182
|
+
llmsUrl?: string;
|
|
183
|
+
preferredExecution: RoverDiscoveryExecutionPreference;
|
|
184
|
+
promptLaunchEnabled: boolean;
|
|
185
|
+
shortcutLaunchEnabled: boolean;
|
|
186
|
+
cloudBrowserAllowed: boolean;
|
|
187
|
+
delegatedHandoffs: boolean;
|
|
188
|
+
instructions: string[];
|
|
189
|
+
capabilitiesGraph: RoverCapabilityRecord[];
|
|
190
|
+
pages: RoverPageDefinition[];
|
|
191
|
+
currentPage?: RoverPageDefinition;
|
|
192
|
+
discoverySurface: {
|
|
193
|
+
mode: RoverDiscoverySurfaceMode;
|
|
194
|
+
branding: RoverDiscoverySurfaceBranding;
|
|
195
|
+
hostSurface: RoverDiscoveryHostSurface;
|
|
196
|
+
actionReveal: RoverDiscoveryActionReveal;
|
|
197
|
+
beaconLabel?: string;
|
|
198
|
+
agentModeEntryHints: string[];
|
|
199
|
+
compactActionMaxActions: number;
|
|
200
|
+
};
|
|
201
|
+
shortcuts: Array<{
|
|
202
|
+
id: string;
|
|
203
|
+
label: string;
|
|
204
|
+
description?: string;
|
|
205
|
+
prompt: string;
|
|
206
|
+
routing?: 'auto' | 'act' | 'planner';
|
|
207
|
+
}>;
|
|
208
|
+
webmcp: {
|
|
209
|
+
available: boolean;
|
|
210
|
+
tools: string[];
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
export type RoverAgentDiscoveryConfig = {
|
|
216
|
+
enabled?: boolean;
|
|
217
|
+
siteUrl: string;
|
|
218
|
+
siteId?: string;
|
|
219
|
+
apiBase?: string;
|
|
220
|
+
siteName?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
version?: string;
|
|
223
|
+
agentCardUrl?: string;
|
|
224
|
+
roverSiteUrl?: string;
|
|
225
|
+
llmsUrl?: string;
|
|
226
|
+
visibleCue?: boolean;
|
|
227
|
+
discoverySurface?: RoverDiscoverySurfacePolicy;
|
|
228
|
+
hostSurfaceSelector?: string;
|
|
229
|
+
preferExecution?: RoverDiscoveryExecutionPreference;
|
|
230
|
+
shortcuts?: RoverShortcut[];
|
|
231
|
+
tools?: RoverAgentDiscoveryToolDefinition[];
|
|
232
|
+
webmcpTools?: RoverAgentDiscoveryToolDefinition[];
|
|
233
|
+
additionalSkills?: RoverPublicSkillDefinition[];
|
|
234
|
+
capabilities?: RoverCapabilityRecord[];
|
|
235
|
+
pages?: RoverPageDefinition[];
|
|
236
|
+
pageContext?: Omit<RoverPageDefinition, 'capabilityIds'> & {
|
|
237
|
+
capabilityIds?: string[];
|
|
238
|
+
};
|
|
239
|
+
aiAccess?: {
|
|
240
|
+
enabled?: boolean;
|
|
241
|
+
allowPromptLaunch?: boolean;
|
|
242
|
+
allowShortcutLaunch?: boolean;
|
|
243
|
+
allowCloudBrowser?: boolean;
|
|
244
|
+
allowDelegatedHandoffs?: boolean;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
export type RoverAgentDiscoveryRuntimeConfig = Omit<RoverAgentDiscoveryConfig, 'siteUrl'> & {
|
|
248
|
+
siteUrl?: string;
|
|
249
|
+
};
|
|
250
|
+
export declare function sanitizeRoverAgentDiscoveryRuntimeConfig(raw: unknown): RoverAgentDiscoveryRuntimeConfig | undefined;
|
|
251
|
+
export declare function createRoverAgentCard(config: RoverAgentDiscoveryConfig): RoverAgentCard;
|
|
252
|
+
export declare function createRoverSiteProfile(config: RoverAgentDiscoveryConfig): RoverSiteProfile;
|
|
253
|
+
export declare function buildRoverAgentDiscoveryPayloads(config: RoverAgentDiscoveryConfig): {
|
|
254
|
+
card: RoverAgentCard;
|
|
255
|
+
cardJson: string;
|
|
256
|
+
serviceDescHref: string;
|
|
257
|
+
roverSite: RoverSiteProfile;
|
|
258
|
+
roverSiteJson: string;
|
|
259
|
+
roverSiteHref: string;
|
|
260
|
+
pageManifest: RoverPageDefinition;
|
|
261
|
+
pageManifestJson: string;
|
|
262
|
+
llmsUrl?: string;
|
|
263
|
+
marker: {
|
|
264
|
+
task?: string;
|
|
265
|
+
card: string;
|
|
266
|
+
roverSite: string;
|
|
267
|
+
site?: string;
|
|
268
|
+
workflow?: string;
|
|
269
|
+
page?: string;
|
|
270
|
+
preferExecution?: RoverDiscoveryExecutionPreference;
|
|
271
|
+
discoveryMode?: RoverDiscoverySurfaceMode;
|
|
272
|
+
hostSurface?: RoverDiscoveryHostSurface;
|
|
273
|
+
actionReveal?: RoverDiscoveryActionReveal;
|
|
274
|
+
beaconLabel?: string;
|
|
275
|
+
skills: Array<{
|
|
276
|
+
id: string;
|
|
277
|
+
name: string;
|
|
278
|
+
}>;
|
|
279
|
+
capabilities: Array<{
|
|
280
|
+
capabilityId: string;
|
|
281
|
+
label: string;
|
|
282
|
+
}>;
|
|
283
|
+
};
|
|
284
|
+
markerJson: string;
|
|
285
|
+
};
|
|
286
|
+
export declare function createRoverAgentCardJson(config: RoverAgentDiscoveryConfig, options?: {
|
|
287
|
+
pretty?: boolean;
|
|
288
|
+
}): string;
|
|
289
|
+
export declare function createRoverWellKnownAgentCard(config: RoverAgentDiscoveryConfig, options?: {
|
|
290
|
+
pretty?: boolean;
|
|
291
|
+
}): string;
|
|
292
|
+
export declare function createRoverSiteProfileJson(config: RoverAgentDiscoveryConfig, options?: {
|
|
293
|
+
pretty?: boolean;
|
|
294
|
+
}): string;
|
|
295
|
+
export declare function createRoverWellKnownSiteProfile(config: RoverAgentDiscoveryConfig, options?: {
|
|
296
|
+
pretty?: boolean;
|
|
297
|
+
}): string;
|
|
298
|
+
export declare function createRoverServiceDescLinkHeader(config: {
|
|
299
|
+
agentCardUrl?: string;
|
|
300
|
+
llmsUrl?: string;
|
|
301
|
+
}): string;
|
|
302
|
+
export declare function createRoverAgentDiscoveryTags(config: RoverAgentDiscoveryConfig): string;
|
|
303
|
+
export { createRoverAgentDiscoverySnapshot };
|
|
304
|
+
export type { RoverAgentDiscoverySnapshot };
|