@rtrvr-ai/rover 2.3.0 → 3.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 +48 -0
- package/dist/embed.js +15 -15
- package/dist/index.d.ts +39 -2
- package/dist/rover.js +15 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RoverPageCaptureConfig } from '@rover/shared/lib/types/index.js';
|
|
2
|
-
import { type RoverShortcut, type RoverVoiceConfig } from '@rover/ui';
|
|
2
|
+
import { type RoverAskUserQuestion, type RoverShortcut, type RoverVoiceConfig } from '@rover/ui';
|
|
3
3
|
import { type RoverCloudCheckpointState } from './cloudCheckpoint.js';
|
|
4
4
|
import type { PersistedRuntimeState, PersistedWorkerState } from './runtimeTypes.js';
|
|
5
|
+
import { type FollowupChatEntry } from './followupChatHeuristics.js';
|
|
5
6
|
export type RoverWebToolsConfig = {
|
|
6
7
|
enableExternalWebContext?: boolean;
|
|
7
8
|
allowDomains?: string[];
|
|
@@ -198,8 +199,26 @@ export type ClientToolDefinition = {
|
|
|
198
199
|
schema?: any;
|
|
199
200
|
llmCallable?: boolean;
|
|
200
201
|
};
|
|
201
|
-
export type RoverEventName = 'ready' | 'updated' | 'status' | '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';
|
|
202
|
+
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';
|
|
202
203
|
export type RoverEventHandler = (payload?: any) => void;
|
|
204
|
+
export type RoverPromptContextEntry = {
|
|
205
|
+
role?: 'model';
|
|
206
|
+
message: string;
|
|
207
|
+
source?: string;
|
|
208
|
+
};
|
|
209
|
+
export type RoverPromptContextInput = {
|
|
210
|
+
userText: string;
|
|
211
|
+
isFreshTask: boolean;
|
|
212
|
+
pageUrl: string;
|
|
213
|
+
taskId?: string;
|
|
214
|
+
taskBoundaryId?: string;
|
|
215
|
+
visitorId?: string;
|
|
216
|
+
visitor?: {
|
|
217
|
+
name?: string;
|
|
218
|
+
email?: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export type RoverPromptContextProvider = (input: RoverPromptContextInput) => string | RoverPromptContextEntry | Array<string | RoverPromptContextEntry> | null | undefined | Promise<string | RoverPromptContextEntry | Array<string | RoverPromptContextEntry> | null | undefined>;
|
|
203
222
|
type RoverVoiceTelemetryEventName = 'voice_started' | 'voice_stopped' | 'voice_transcript_ready' | 'voice_error' | 'voice_permission_denied' | 'voice_provider_selected';
|
|
204
223
|
export type RoverInstance = {
|
|
205
224
|
boot: (cfg: RoverInit) => RoverInstance;
|
|
@@ -219,6 +238,8 @@ export type RoverInstance = {
|
|
|
219
238
|
reason?: string;
|
|
220
239
|
}) => void;
|
|
221
240
|
getState: () => any;
|
|
241
|
+
requestSigned: (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
242
|
+
registerPromptContextProvider: (provider: RoverPromptContextProvider) => () => void;
|
|
222
243
|
registerTool: (nameOrDef: string | ClientToolDefinition, handler: (args: any) => any | Promise<any>) => void;
|
|
223
244
|
identify: (visitor: {
|
|
224
245
|
name?: string;
|
|
@@ -227,6 +248,17 @@ export type RoverInstance = {
|
|
|
227
248
|
on: (event: RoverEventName, handler: RoverEventHandler) => () => void;
|
|
228
249
|
};
|
|
229
250
|
type TelemetryEventName = RoverEventName | RoverVoiceTelemetryEventName;
|
|
251
|
+
declare function normalizePromptContextEntry(input: string | RoverPromptContextEntry): FollowupChatEntry | null;
|
|
252
|
+
declare function buildPublicRunStartedPayload(msg: any): Record<string, unknown>;
|
|
253
|
+
declare function buildPublicRunLifecyclePayload(msg: any, completionState: ReturnType<typeof normalizeRunCompletionState>): Record<string, unknown>;
|
|
254
|
+
declare function normalizeRunCompletionState(msg: any): {
|
|
255
|
+
taskComplete: boolean;
|
|
256
|
+
needsUserInput: boolean;
|
|
257
|
+
terminalState: 'waiting_input' | 'in_progress' | 'completed' | 'failed';
|
|
258
|
+
contextResetRecommended: boolean;
|
|
259
|
+
continuationReason?: 'loop_continue' | 'same_tab_navigation_handoff' | 'awaiting_user';
|
|
260
|
+
questions?: RoverAskUserQuestion[];
|
|
261
|
+
};
|
|
230
262
|
declare function sanitizeWorkerState(input: any): PersistedWorkerState | undefined;
|
|
231
263
|
declare function cloneRuntimeStateForCheckpoint(state: PersistedRuntimeState): PersistedRuntimeState;
|
|
232
264
|
export declare function identify(visitor: {
|
|
@@ -242,6 +274,8 @@ export declare function close(): void;
|
|
|
242
274
|
export declare function show(): void;
|
|
243
275
|
export declare function hide(): void;
|
|
244
276
|
export declare function send(text: string): void;
|
|
277
|
+
export declare function requestSigned(input: string | URL, init?: RequestInit): Promise<Response>;
|
|
278
|
+
export declare function registerPromptContextProvider(provider: RoverPromptContextProvider): () => void;
|
|
245
279
|
export declare function newTask(options?: {
|
|
246
280
|
reason?: string;
|
|
247
281
|
clearUi?: boolean;
|
|
@@ -259,6 +293,9 @@ export declare const __roverInternalsForTests: {
|
|
|
259
293
|
maxCoalesceDelayMs: number;
|
|
260
294
|
};
|
|
261
295
|
getTelemetryFastLaneEvents: () => TelemetryEventName[];
|
|
296
|
+
normalizePromptContextEntry: typeof normalizePromptContextEntry;
|
|
297
|
+
buildPublicRunStartedPayload: typeof buildPublicRunStartedPayload;
|
|
298
|
+
buildPublicRunLifecyclePayload: typeof buildPublicRunLifecyclePayload;
|
|
262
299
|
};
|
|
263
300
|
export declare function installGlobal(): void;
|
|
264
301
|
export {};
|