@rtrvr-ai/rover 4.0.0 → 4.1.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/dist/index.d.ts CHANGED
@@ -45,7 +45,6 @@ export type RoverInit = {
45
45
  pageConfig?: RoverPageCaptureConfig;
46
46
  allowedDomains?: string[];
47
47
  domainScopeMode?: 'host_only' | 'registrable_domain';
48
- externalNavigationPolicy?: 'open_new_tab_notice' | 'block' | 'allow';
49
48
  tabPolicy?: {
50
49
  observerByDefault?: boolean;
51
50
  actionLeaseMs?: number;
@@ -55,9 +54,6 @@ export type RoverInit = {
55
54
  actHeuristicThreshold?: number;
56
55
  plannerOnActError?: boolean;
57
56
  };
58
- navigation?: {
59
- crossHostPolicy?: 'open_new_tab' | 'same_tab';
60
- };
61
57
  timing?: {
62
58
  /** Delay (ms) before same-tab navigation executes, allowing state persistence. Default: 80 */
63
59
  navigationDelayMs?: number;
@@ -165,6 +161,7 @@ export type RoverInit = {
165
161
  };
166
162
  mascot?: {
167
163
  disabled?: boolean;
164
+ imageUrl?: string;
168
165
  mp4Url?: string;
169
166
  webmUrl?: string;
170
167
  soundEnabled?: boolean;
@@ -210,7 +207,7 @@ export type ClientToolDefinition = {
210
207
  annotations?: Record<string, any>;
211
208
  llmCallable?: boolean;
212
209
  };
213
- export type RoverEventName = 'ready' | 'updated' | 'status' | 'run_started' | 'run_state_transition' | 'run_completed' | 'tool_start' | 'tool_result' | 'error' | 'auth_required' | 'navigation_guardrail' | 'mode_change' | 'task_started' | 'task_ended' | 'task_suggested_reset' | 'context_restored' | 'checkpoint_state' | 'checkpoint_error' | 'tab_event_conflict_retry' | 'tab_event_conflict_exhausted' | 'checkpoint_token_missing' | 'open' | 'close';
210
+ export type RoverEventName = 'ready' | 'updated' | 'status' | 'visit_started' | 'visit_ended' | 'run_started' | 'run_state_transition' | 'run_completed' | 'tool_start' | 'tool_result' | 'error' | 'auth_required' | 'navigation_guardrail' | 'mode_change' | 'task_suggested_reset' | 'context_restored' | 'checkpoint_state' | 'checkpoint_error' | 'tab_event_conflict_retry' | 'tab_event_conflict_exhausted' | 'checkpoint_token_missing' | 'open' | 'close';
214
211
  export type RoverEventHandler = (payload?: any) => void;
215
212
  export type RoverPromptContextEntry = {
216
213
  role?: 'model';
@@ -266,7 +263,7 @@ declare function buildPublicRunStartedPayload(msg: any): Record<string, unknown>
266
263
  declare function buildPublicRunLifecyclePayload(msg: any, completionState: ReturnType<typeof normalizeRunCompletionState>): Record<string, unknown>;
267
264
  export declare function getAgentCard(): RoverAgentCard | null;
268
265
  declare function normalizeRunCompletionState(msg: any): {
269
- taskComplete: boolean;
266
+ runComplete: boolean;
270
267
  needsUserInput: boolean;
271
268
  terminalState: 'waiting_input' | 'in_progress' | 'completed' | 'failed';
272
269
  contextResetRecommended: boolean;
@@ -13,7 +13,7 @@ export type RoverOwnerInstallBootConfig = {
13
13
  workerUrl?: string;
14
14
  allowedDomains?: string[];
15
15
  domainScopeMode?: 'host_only' | 'registrable_domain';
16
- externalNavigationPolicy?: 'open_new_tab_notice' | 'block' | 'allow';
16
+ cloudSandboxEnabled?: boolean;
17
17
  sessionScope?: 'shared_site' | 'tab';
18
18
  openOnInit?: boolean;
19
19
  mode?: 'safe' | 'full';
@@ -25,9 +25,6 @@ export type RoverOwnerInstallBootConfig = {
25
25
  consume?: boolean;
26
26
  };
27
27
  pageConfig?: RoverPageCaptureConfig | null;
28
- navigation?: {
29
- crossHostPolicy?: 'open_new_tab' | 'same_tab';
30
- };
31
28
  tabPolicy?: {
32
29
  observerByDefault?: boolean;
33
30
  actionLeaseMs?: number;
@@ -70,6 +67,7 @@ export type RoverOwnerInstallBootConfig = {
70
67
  };
71
68
  mascot?: {
72
69
  disabled?: boolean;
70
+ imageUrl?: string;
73
71
  mp4Url?: string;
74
72
  webmUrl?: string;
75
73
  soundEnabled?: boolean;
@@ -135,8 +135,10 @@ function llmsEnabled(input, config) {
135
135
  return input.emitLlmsTxt === true || !!text(config.llmsUrl);
136
136
  }
137
137
  function buildOwnerMarker(card, publishedAgentCardUrl) {
138
+ const runEndpoint = card.extensions?.rover.runEndpoint;
138
139
  return {
139
- task: card.extensions?.rover.taskEndpoint,
140
+ a2w: runEndpoint,
141
+ run: runEndpoint,
140
142
  card: publishedAgentCardUrl,
141
143
  roverSite: card.extensions?.rover.roverSiteUrl,
142
144
  site: card.extensions?.rover.siteUrl,
@@ -167,9 +169,9 @@ function buildDefaultLlmsTxt(card, options) {
167
169
  '',
168
170
  card.description,
169
171
  '',
170
- 'Prefer Rover shortcuts, explicit site tools, and public task flows over raw DOM automation when they match the requested outcome.',
171
- `Primary task endpoint: ${text(card.extensions?.rover.taskEndpoint || card.url)}`,
172
- `Workflow endpoint: ${text(card.extensions?.rover.workflowEndpoint)}`,
172
+ 'Prefer Rover shortcuts, explicit site tools, and A2W runs over raw DOM automation when they match the requested outcome.',
173
+ `Primary A2W run endpoint: ${text(card.extensions?.rover.runEndpoint || card.url)}`,
174
+ `A2W workflow endpoint: ${text(card.extensions?.rover.workflowEndpoint)}`,
173
175
  `Capability card: ${options.agentCardUrl}`,
174
176
  ];
175
177
  const skills = card.skills
@@ -177,7 +179,7 @@ function buildDefaultLlmsTxt(card, options) {
177
179
  id: text(skill.id),
178
180
  name: text(skill.name),
179
181
  description: text(skill.description),
180
- interface: text(skill.preferredInterface || skill.rover?.source || 'task'),
182
+ interface: text(skill.preferredInterface || skill.rover?.source || 'run'),
181
183
  }))
182
184
  .filter(skill => skill.id && skill.name);
183
185
  if (skills.length > 0) {
@@ -203,11 +205,28 @@ function buildQueueStubLines() {
203
205
  '(function(){ var r = window.rover = window.rover || function(){ (r.q = r.q || []).push(arguments); }; r.l = +new Date(); })();',
204
206
  ];
205
207
  }
208
+ function materializeCloudSandboxBootConfig(bootConfig) {
209
+ if (bootConfig.cloudSandboxEnabled !== true) {
210
+ return bootConfig;
211
+ }
212
+ return {
213
+ ...bootConfig,
214
+ tools: {
215
+ ...(bootConfig.tools || {}),
216
+ web: {
217
+ ...(bootConfig.tools?.web || {}),
218
+ enableExternalWebContext: true,
219
+ scrapeMode: 'on_demand',
220
+ },
221
+ },
222
+ };
223
+ }
206
224
  function buildBootScript(bootConfig) {
225
+ const normalizedBootConfig = materializeCloudSandboxBootConfig(bootConfig);
207
226
  const lines = [
208
227
  '<script>',
209
228
  ...buildQueueStubLines().map(line => ` ${line}`),
210
- ` rover('boot', ${indentJson(bootConfig)});`,
229
+ ` rover('boot', ${indentJson(normalizedBootConfig)});`,
211
230
  '</script>',
212
231
  ];
213
232
  return lines.join('\n');
@@ -239,7 +258,7 @@ function buildRoverBookAttachScript(config, options) {
239
258
  ].join('\n');
240
259
  }
241
260
  export function createRoverOwnerInstallBundle(input) {
242
- const bootConfig = input.bootConfig;
261
+ const bootConfig = materializeCloudSandboxBootConfig(input.bootConfig);
243
262
  const discoveryConfig = discoveryEnabled(input.discovery) ? input.discovery : null;
244
263
  const publishedAgentCardUrl = discoveryConfig ? text(discoveryConfig.agentCardUrl) || DEFAULT_AGENT_CARD_PATH : '';
245
264
  const publishedRoverSiteUrl = discoveryConfig ? text(discoveryConfig.roverSiteUrl) || DEFAULT_ROVER_SITE_PATH : '';
@@ -21,7 +21,6 @@ export type RoverPreviewBootstrapConfig = {
21
21
  workerUrl?: string;
22
22
  allowedDomains?: string[];
23
23
  domainScopeMode?: 'host_only' | 'registrable_domain';
24
- externalNavigationPolicy?: 'open_new_tab_notice' | 'block' | 'allow';
25
24
  sessionScope?: 'shared_site' | 'tab';
26
25
  openOnInit?: boolean;
27
26
  mode?: 'safe' | 'full';
@@ -98,8 +98,6 @@ function buildBootstrapPayload(config) {
98
98
  payload.allowedDomains = normalized.allowedDomains;
99
99
  if (normalized.domainScopeMode)
100
100
  payload.domainScopeMode = normalized.domainScopeMode;
101
- if (normalized.externalNavigationPolicy)
102
- payload.externalNavigationPolicy = normalized.externalNavigationPolicy;
103
101
  if (normalized.sessionScope)
104
102
  payload.sessionScope = normalized.sessionScope;
105
103
  if (typeof normalized.openOnInit === 'boolean')
@@ -182,8 +180,6 @@ export function createRoverScriptTagSnippet(config) {
182
180
  attrs.push(`data-allowed-domains="${escapeHtmlAttr(normalized.allowedDomains.join(','))}"`);
183
181
  if (normalized.domainScopeMode)
184
182
  attrs.push(`data-domain-scope-mode="${escapeHtmlAttr(normalized.domainScopeMode)}"`);
185
- if (normalized.externalNavigationPolicy)
186
- attrs.push(`data-external-navigation-policy="${escapeHtmlAttr(normalized.externalNavigationPolicy)}"`);
187
183
  if (normalized.sessionScope)
188
184
  attrs.push(`data-session-scope="${escapeHtmlAttr(normalized.sessionScope)}"`);
189
185
  if (typeof normalized.openOnInit === 'boolean')
@@ -198,8 +194,8 @@ export function createRoverScriptTagSnippet(config) {
198
194
  attrs.push(`data-voice-language="${escapeHtmlAttr(normalized.ui.voice.language)}"`);
199
195
  if (typeof normalized.ui?.voice?.autoStopMs === 'number')
200
196
  attrs.push(`data-voice-auto-stop-ms="${escapeHtmlAttr(String(normalized.ui.voice.autoStopMs))}"`);
201
- const taskEndpoint = `${toStringValue(normalized.apiBase) || DEFAULT_AGENT_BASE}/v1/tasks`;
202
- const markerJson = escapeScriptJson(JSON.stringify({ task: taskEndpoint }));
197
+ const runEndpoint = `${toStringValue(normalized.apiBase) || DEFAULT_AGENT_BASE}/v1/a2w/runs`;
198
+ const markerJson = escapeScriptJson(JSON.stringify({ a2w: runEndpoint, run: runEndpoint, task: runEndpoint }));
203
199
  return [
204
200
  `<script type="application/agent+json" data-rover-agent-discovery="marker">${markerJson}</script>`,
205
201
  '<link rel="service-desc" href="/.well-known/agent-card.json" type="application/json" data-rover-agent-discovery="service-desc" />',
@@ -239,10 +235,6 @@ export function readRoverScriptDataAttributes(scriptEl) {
239
235
  if (domainScopeMode === 'host_only' || domainScopeMode === 'registrable_domain') {
240
236
  config.domainScopeMode = domainScopeMode;
241
237
  }
242
- const externalNavigationPolicy = toStringValue(scriptEl.getAttribute('data-external-navigation-policy'));
243
- if (externalNavigationPolicy === 'open_new_tab_notice' || externalNavigationPolicy === 'block' || externalNavigationPolicy === 'allow') {
244
- config.externalNavigationPolicy = externalNavigationPolicy;
245
- }
246
238
  const sessionScope = toStringValue(scriptEl.getAttribute('data-session-scope'));
247
239
  if (sessionScope === 'shared_site' || sessionScope === 'tab') {
248
240
  config.sessionScope = sessionScope;