opensteer 0.6.0 → 0.6.2
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/CHANGELOG.md +16 -1
- package/README.md +63 -0
- package/bin/opensteer.mjs +214 -3
- package/dist/browser-profile-client-CaL-mwqs.d.ts +168 -0
- package/dist/browser-profile-client-DK9qa_Dj.d.cts +168 -0
- package/dist/chunk-7RMY26CM.js +1130 -0
- package/dist/{chunk-SGZYTGY3.js → chunk-F2VDVOJO.js} +1890 -1520
- package/dist/chunk-WDRMHPWL.js +1320 -0
- package/dist/chunk-WJI7TGBQ.js +77 -0
- package/dist/cli/auth.cjs +1834 -0
- package/dist/cli/auth.d.cts +114 -0
- package/dist/cli/auth.d.ts +114 -0
- package/dist/cli/auth.js +15 -0
- package/dist/cli/profile.cjs +16222 -0
- package/dist/cli/profile.d.cts +79 -0
- package/dist/cli/profile.d.ts +79 -0
- package/dist/cli/profile.js +866 -0
- package/dist/cli/server.cjs +1816 -422
- package/dist/cli/server.js +310 -10
- package/dist/index.cjs +1772 -414
- package/dist/index.d.cts +141 -395
- package/dist/index.d.ts +141 -395
- package/dist/index.js +203 -8
- package/dist/types-BxiRblC7.d.cts +327 -0
- package/dist/types-BxiRblC7.d.ts +327 -0
- package/package.json +3 -2
- package/skills/opensteer/SKILL.md +34 -5
- package/skills/opensteer/references/cli-reference.md +10 -8
- package/skills/opensteer/references/sdk-reference.md +14 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,317 +1,9 @@
|
|
|
1
1
|
import * as playwright from 'playwright';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
key: string;
|
|
8
|
-
op?: MatchOperator;
|
|
9
|
-
value?: string;
|
|
10
|
-
}
|
|
11
|
-
interface PositionMatchClause {
|
|
12
|
-
kind: 'position';
|
|
13
|
-
axis: 'nthOfType' | 'nthChild';
|
|
14
|
-
}
|
|
15
|
-
type MatchClause = AttributeMatchClause | PositionMatchClause;
|
|
16
|
-
interface PathNodePosition {
|
|
17
|
-
nthChild: number;
|
|
18
|
-
nthOfType: number;
|
|
19
|
-
}
|
|
20
|
-
interface PathNode {
|
|
21
|
-
tag: string;
|
|
22
|
-
attrs: Record<string, string>;
|
|
23
|
-
position: PathNodePosition;
|
|
24
|
-
match: MatchClause[];
|
|
25
|
-
}
|
|
26
|
-
type DomPath = PathNode[];
|
|
27
|
-
interface ContextHop {
|
|
28
|
-
kind: 'iframe' | 'shadow';
|
|
29
|
-
host: DomPath;
|
|
30
|
-
}
|
|
31
|
-
interface ElementPath {
|
|
32
|
-
context: ContextHop[];
|
|
33
|
-
nodes: DomPath;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
type ActionFailureCode = 'TARGET_NOT_FOUND' | 'TARGET_UNAVAILABLE' | 'TARGET_STALE' | 'TARGET_AMBIGUOUS' | 'BLOCKED_BY_INTERCEPTOR' | 'NOT_VISIBLE' | 'NOT_ENABLED' | 'NOT_EDITABLE' | 'INVALID_TARGET' | 'INVALID_OPTIONS' | 'ACTION_TIMEOUT' | 'UNKNOWN';
|
|
37
|
-
type ActionFailureClassificationSource = 'typed_error' | 'playwright_call_log' | 'dom_probe' | 'message_heuristic' | 'unknown';
|
|
38
|
-
interface ActionFailureBlocker {
|
|
39
|
-
tag: string;
|
|
40
|
-
id: string | null;
|
|
41
|
-
classes: string[];
|
|
42
|
-
role: string | null;
|
|
43
|
-
text: string | null;
|
|
44
|
-
}
|
|
45
|
-
interface ActionFailureDetails {
|
|
46
|
-
blocker?: ActionFailureBlocker;
|
|
47
|
-
observation?: string;
|
|
48
|
-
}
|
|
49
|
-
interface ActionFailure {
|
|
50
|
-
code: ActionFailureCode;
|
|
51
|
-
message: string;
|
|
52
|
-
retryable: boolean;
|
|
53
|
-
classificationSource: ActionFailureClassificationSource;
|
|
54
|
-
details?: ActionFailureDetails;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
type SnapshotMode = 'action' | 'extraction' | 'clickable' | 'scrollable' | 'full';
|
|
58
|
-
interface SnapshotOptions {
|
|
59
|
-
mode?: SnapshotMode;
|
|
60
|
-
withCounters?: boolean;
|
|
61
|
-
markInteractive?: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface ScreenshotOptions {
|
|
64
|
-
fullPage?: boolean;
|
|
65
|
-
type?: 'png' | 'jpeg';
|
|
66
|
-
/** Ignored for PNG. */
|
|
67
|
-
quality?: number;
|
|
68
|
-
omitBackground?: boolean;
|
|
69
|
-
}
|
|
70
|
-
interface AiResolveArgs {
|
|
71
|
-
html: string;
|
|
72
|
-
action: string;
|
|
73
|
-
description: string;
|
|
74
|
-
url: string | null;
|
|
75
|
-
}
|
|
76
|
-
interface AiResolveResult {
|
|
77
|
-
element?: number;
|
|
78
|
-
selector?: string;
|
|
79
|
-
path?: ElementPath;
|
|
80
|
-
}
|
|
81
|
-
type AiResolveCallbackResult = AiResolveResult | number | string | null | undefined;
|
|
82
|
-
type AiResolveCallback = (args: AiResolveArgs) => Promise<AiResolveCallbackResult>;
|
|
83
|
-
interface AiExtractArgs<TSchema = ExtractSchema> {
|
|
84
|
-
html: string;
|
|
85
|
-
schema: TSchema;
|
|
86
|
-
description?: string;
|
|
87
|
-
prompt?: string;
|
|
88
|
-
url: string | null;
|
|
89
|
-
}
|
|
90
|
-
type AiExtractResult<TData = unknown> = TData | ExtractionPlan | string;
|
|
91
|
-
type AiExtractCallback = <TSchema = ExtractSchema, TData = unknown>(args: AiExtractArgs<TSchema>) => Promise<AiExtractResult<TData>>;
|
|
92
|
-
interface GotoOptions {
|
|
93
|
-
timeout?: number;
|
|
94
|
-
waitUntil?: 'commit' | 'domcontentloaded' | 'load' | 'networkidle';
|
|
95
|
-
settleMs?: number;
|
|
96
|
-
}
|
|
97
|
-
interface LaunchOptions {
|
|
98
|
-
headless?: boolean;
|
|
99
|
-
executablePath?: string;
|
|
100
|
-
slowMo?: number;
|
|
101
|
-
context?: BrowserContextOptions;
|
|
102
|
-
/** Connect to a running browser. Example: "http://localhost:9222" */
|
|
103
|
-
connectUrl?: string;
|
|
104
|
-
/** Browser channel: "chrome", "chrome-beta", or "msedge" */
|
|
105
|
-
channel?: string;
|
|
106
|
-
/** Browser profile directory. Preserves cookies, extensions, and sessions. */
|
|
107
|
-
profileDir?: string;
|
|
108
|
-
/** Connection timeout in milliseconds. */
|
|
109
|
-
timeout?: number;
|
|
110
|
-
}
|
|
111
|
-
interface OpensteerBrowserConfig {
|
|
112
|
-
headless?: boolean;
|
|
113
|
-
executablePath?: string;
|
|
114
|
-
slowMo?: number;
|
|
115
|
-
/** Connect to a running browser. Example: "http://localhost:9222" */
|
|
116
|
-
connectUrl?: string;
|
|
117
|
-
/** Browser channel: "chrome", "chrome-beta", or "msedge" */
|
|
118
|
-
channel?: string;
|
|
119
|
-
/** Browser profile directory. Preserves cookies, extensions, and sessions. */
|
|
120
|
-
profileDir?: string;
|
|
121
|
-
}
|
|
122
|
-
interface OpensteerStorageConfig {
|
|
123
|
-
rootDir?: string;
|
|
124
|
-
}
|
|
125
|
-
type OpensteerAuthScheme = 'api-key' | 'bearer';
|
|
126
|
-
type OpensteerCloudAnnouncePolicy = 'always' | 'off' | 'tty';
|
|
127
|
-
interface OpensteerCloudOptions {
|
|
128
|
-
apiKey?: string;
|
|
129
|
-
baseUrl?: string;
|
|
130
|
-
authScheme?: OpensteerAuthScheme;
|
|
131
|
-
announce?: OpensteerCloudAnnouncePolicy;
|
|
132
|
-
}
|
|
133
|
-
type OpensteerCloudConfig = boolean | OpensteerCloudOptions;
|
|
134
|
-
interface OpensteerConfig {
|
|
135
|
-
name?: string;
|
|
136
|
-
browser?: OpensteerBrowserConfig;
|
|
137
|
-
storage?: OpensteerStorageConfig;
|
|
138
|
-
cloud?: OpensteerCloudConfig;
|
|
139
|
-
model?: string;
|
|
140
|
-
debug?: boolean;
|
|
141
|
-
}
|
|
142
|
-
interface ActionWaitOptions {
|
|
143
|
-
enabled?: boolean;
|
|
144
|
-
timeout?: number;
|
|
145
|
-
settleMs?: number;
|
|
146
|
-
networkQuietMs?: number;
|
|
147
|
-
includeNetwork?: boolean;
|
|
148
|
-
}
|
|
149
|
-
interface BaseActionOptions {
|
|
150
|
-
description?: string;
|
|
151
|
-
element?: number;
|
|
152
|
-
selector?: string;
|
|
153
|
-
wait?: false | ActionWaitOptions;
|
|
154
|
-
}
|
|
155
|
-
interface ClickOptions extends BaseActionOptions {
|
|
156
|
-
button?: 'left' | 'right' | 'middle';
|
|
157
|
-
clickCount?: number;
|
|
158
|
-
modifiers?: Array<'Alt' | 'Control' | 'Meta' | 'Shift'>;
|
|
159
|
-
}
|
|
160
|
-
interface HoverOptions extends BaseActionOptions {
|
|
161
|
-
force?: boolean;
|
|
162
|
-
position?: {
|
|
163
|
-
x: number;
|
|
164
|
-
y: number;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
interface InputOptions extends BaseActionOptions {
|
|
168
|
-
text: string;
|
|
169
|
-
clear?: boolean;
|
|
170
|
-
pressEnter?: boolean;
|
|
171
|
-
}
|
|
172
|
-
interface SelectOptions extends BaseActionOptions {
|
|
173
|
-
value?: string;
|
|
174
|
-
label?: string;
|
|
175
|
-
index?: number;
|
|
176
|
-
}
|
|
177
|
-
interface ScrollOptions extends BaseActionOptions {
|
|
178
|
-
direction?: 'up' | 'down' | 'left' | 'right';
|
|
179
|
-
amount?: number;
|
|
180
|
-
}
|
|
181
|
-
interface ExtractSchemaField {
|
|
182
|
-
element?: number;
|
|
183
|
-
selector?: string;
|
|
184
|
-
attribute?: string;
|
|
185
|
-
source?: 'current_url';
|
|
186
|
-
}
|
|
187
|
-
type ExtractSchemaValue = ExtractSchemaField | string | number | boolean | null | ExtractSchema | ExtractSchema[];
|
|
188
|
-
interface ExtractSchema {
|
|
189
|
-
[key: string]: ExtractSchemaValue;
|
|
190
|
-
}
|
|
191
|
-
interface ExtractOptions<TSchema = ExtractSchema> extends BaseActionOptions {
|
|
192
|
-
schema?: TSchema;
|
|
193
|
-
prompt?: string;
|
|
194
|
-
snapshot?: SnapshotOptions;
|
|
195
|
-
}
|
|
196
|
-
interface ExtractionFieldPlan {
|
|
197
|
-
element?: number;
|
|
198
|
-
selector?: string;
|
|
199
|
-
attribute?: string;
|
|
200
|
-
source?: 'current_url';
|
|
201
|
-
}
|
|
202
|
-
interface ExtractionPlan {
|
|
203
|
-
fields?: Record<string, ExtractionFieldPlan>;
|
|
204
|
-
paths?: Record<string, ElementPath>;
|
|
205
|
-
data?: unknown;
|
|
206
|
-
}
|
|
207
|
-
interface ExtractFromPlanOptions<TSchema = ExtractSchema> {
|
|
208
|
-
description?: string;
|
|
209
|
-
schema: TSchema;
|
|
210
|
-
plan: ExtractionPlan;
|
|
211
|
-
}
|
|
212
|
-
interface ActionResult {
|
|
213
|
-
method: string;
|
|
214
|
-
namespace: string;
|
|
215
|
-
persisted: boolean;
|
|
216
|
-
pathFile: string | null;
|
|
217
|
-
selectorUsed?: string | null;
|
|
218
|
-
}
|
|
219
|
-
interface ExtractionRunResult<T = unknown> {
|
|
220
|
-
namespace: string;
|
|
221
|
-
persisted: boolean;
|
|
222
|
-
pathFile: string | null;
|
|
223
|
-
data: T;
|
|
224
|
-
paths: Record<string, ElementPath>;
|
|
225
|
-
}
|
|
226
|
-
interface StateResult {
|
|
227
|
-
url: string;
|
|
228
|
-
title: string;
|
|
229
|
-
html: string;
|
|
230
|
-
}
|
|
231
|
-
interface TabInfo {
|
|
232
|
-
index: number;
|
|
233
|
-
url: string;
|
|
234
|
-
title: string;
|
|
235
|
-
active: boolean;
|
|
236
|
-
}
|
|
237
|
-
interface CookieParam {
|
|
238
|
-
name: string;
|
|
239
|
-
value: string;
|
|
240
|
-
url?: string;
|
|
241
|
-
domain?: string;
|
|
242
|
-
path?: string;
|
|
243
|
-
expires?: number;
|
|
244
|
-
httpOnly?: boolean;
|
|
245
|
-
secure?: boolean;
|
|
246
|
-
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
247
|
-
}
|
|
248
|
-
interface FileUploadOptions extends BaseActionOptions {
|
|
249
|
-
paths: string[];
|
|
250
|
-
}
|
|
251
|
-
interface BoundingBox {
|
|
252
|
-
x: number;
|
|
253
|
-
y: number;
|
|
254
|
-
width: number;
|
|
255
|
-
height: number;
|
|
256
|
-
}
|
|
257
|
-
type OpensteerAgentMode = 'cua';
|
|
258
|
-
type OpensteerAgentProvider = 'openai' | 'anthropic' | 'google';
|
|
259
|
-
interface OpensteerAgentModelConfig {
|
|
260
|
-
modelName: string;
|
|
261
|
-
apiKey?: string;
|
|
262
|
-
baseUrl?: string;
|
|
263
|
-
organization?: string;
|
|
264
|
-
thinkingBudget?: number;
|
|
265
|
-
environment?: string;
|
|
266
|
-
}
|
|
267
|
-
interface OpensteerAgentConfig {
|
|
268
|
-
mode: OpensteerAgentMode;
|
|
269
|
-
model?: string | OpensteerAgentModelConfig;
|
|
270
|
-
systemPrompt?: string;
|
|
271
|
-
waitBetweenActionsMs?: number;
|
|
272
|
-
}
|
|
273
|
-
interface OpensteerAgentExecuteOptions {
|
|
274
|
-
instruction: string;
|
|
275
|
-
maxSteps?: number;
|
|
276
|
-
highlightCursor?: boolean;
|
|
277
|
-
}
|
|
278
|
-
interface OpensteerAgentUsage {
|
|
279
|
-
inputTokens: number;
|
|
280
|
-
outputTokens: number;
|
|
281
|
-
reasoningTokens?: number;
|
|
282
|
-
inferenceTimeMs: number;
|
|
283
|
-
}
|
|
284
|
-
interface OpensteerAgentAction {
|
|
285
|
-
type: string;
|
|
286
|
-
reasoning?: string;
|
|
287
|
-
button?: string;
|
|
288
|
-
clickCount?: number;
|
|
289
|
-
x?: number;
|
|
290
|
-
y?: number;
|
|
291
|
-
text?: string;
|
|
292
|
-
keys?: string[];
|
|
293
|
-
scrollX?: number;
|
|
294
|
-
scrollY?: number;
|
|
295
|
-
timeMs?: number;
|
|
296
|
-
url?: string;
|
|
297
|
-
path?: Array<{
|
|
298
|
-
x: number;
|
|
299
|
-
y: number;
|
|
300
|
-
}>;
|
|
301
|
-
[key: string]: unknown;
|
|
302
|
-
}
|
|
303
|
-
interface OpensteerAgentResult {
|
|
304
|
-
success: boolean;
|
|
305
|
-
completed: boolean;
|
|
306
|
-
message: string;
|
|
307
|
-
actions: OpensteerAgentAction[];
|
|
308
|
-
usage?: OpensteerAgentUsage;
|
|
309
|
-
provider: OpensteerAgentProvider;
|
|
310
|
-
model: string;
|
|
311
|
-
}
|
|
312
|
-
interface OpensteerAgentInstance {
|
|
313
|
-
execute(instructionOrOptions: string | OpensteerAgentExecuteOptions): Promise<OpensteerAgentResult>;
|
|
314
|
-
}
|
|
2
|
+
import { Page, BrowserContext, ElementHandle, Cookie, Browser } from 'playwright';
|
|
3
|
+
import { a as OpensteerConfig, L as LaunchOptions, G as GotoOptions, S as SnapshotOptions, b as StateResult, c as ScreenshotOptions, d as ClickOptions, A as ActionResult, H as HoverOptions, I as InputOptions, e as SelectOptions, f as ScrollOptions, T as TabInfo, C as CookieParam, B as BaseActionOptions, g as BoundingBox, F as FileUploadOptions, E as ExtractOptions, h as ExtractFromPlanOptions, i as ExtractionRunResult, j as OpensteerCursorState, k as OpensteerAgentConfig, l as OpensteerAgentInstance, m as ElementPath, n as SnapshotMode, o as AiResolveCallback, p as AiExtractCallback, O as OpensteerAuthScheme, q as OpensteerAgentProvider, r as OpensteerAgentAction, s as OpensteerAgentResult, t as OpensteerAgentUsage, u as OpensteerCursorStyle, v as OpensteerCursorConfig, w as OpensteerAgentExecuteOptions } from './types-BxiRblC7.js';
|
|
4
|
+
export { x as ActionWaitOptions, y as AiExtractArgs, z as AiExtractResult, D as AiResolveArgs, J as AiResolveCallbackResult, K as AiResolveResult, M as AttributeMatchClause, N as ContextHop, P as DomPath, Q as ExtractSchema, R as ExtractSchemaField, U as ExtractSchemaValue, V as ExtractionFieldPlan, W as ExtractionPlan, X as MatchClause, Y as MatchOperator, Z as OpensteerAgentMode, _ as OpensteerAgentModelConfig, $ as OpensteerBrowserConfig, a0 as OpensteerCloudAnnouncePolicy, a1 as OpensteerCloudBrowserProfileOptions, a2 as OpensteerCloudConfig, a3 as OpensteerCloudOptions, a4 as OpensteerCursorColor, a5 as OpensteerCursorProfile, a6 as OpensteerStorageConfig, a7 as PathNode, a8 as PathNodePosition, a9 as PositionMatchClause } from './types-BxiRblC7.js';
|
|
5
|
+
import { A as ActionFailure, e as ActionFailureCode, C as CloudErrorCode, f as CloudActionFailureDetails, g as CloudSessionCreateRequest, h as CloudSessionCreateResponse, i as CloudSelectorCacheImportRequest, j as CloudSelectorCacheImportResponse, k as CloudActionMethod, l as CloudSelectorCacheImportEntry } from './browser-profile-client-CaL-mwqs.js';
|
|
6
|
+
export { m as ActionFailureBlocker, n as ActionFailureClassificationSource, o as ActionFailureDetails, p as BrowserProfileArchiveFormat, q as BrowserProfileClient, c as BrowserProfileCreateRequest, d as BrowserProfileDescriptor, a as BrowserProfileListRequest, b as BrowserProfileListResponse, r as BrowserProfileProxyPolicy, B as BrowserProfileStatus, s as CloudActionFailure, t as CloudActionRequest, u as CloudActionResponse, v as CloudActionSuccess, w as CloudBrowserProfileLaunchPreference, x as CloudFingerprintMode, y as CloudSessionContractVersion, z as CloudSessionLaunchConfig, D as CloudSessionSourceType, E as CloudSessionSummary, F as cloudSessionContractVersion } from './browser-profile-client-CaL-mwqs.js';
|
|
315
7
|
|
|
316
8
|
interface RegistryEntry {
|
|
317
9
|
file: string;
|
|
@@ -375,6 +67,7 @@ declare class Opensteer {
|
|
|
375
67
|
private ownsBrowser;
|
|
376
68
|
private snapshotCache;
|
|
377
69
|
private agentExecutionInFlight;
|
|
70
|
+
private cursorController;
|
|
378
71
|
constructor(config?: OpensteerConfig);
|
|
379
72
|
private logDebugError;
|
|
380
73
|
private createLazyResolveCallback;
|
|
@@ -389,6 +82,7 @@ declare class Opensteer {
|
|
|
389
82
|
getCloudSessionUrl(): string | null;
|
|
390
83
|
private announceCloudSession;
|
|
391
84
|
private shouldAnnounceCloudSession;
|
|
85
|
+
private buildCloudSessionLaunchConfig;
|
|
392
86
|
launch(options?: LaunchOptions): Promise<void>;
|
|
393
87
|
static from(page: Page, config?: OpensteerConfig): Opensteer;
|
|
394
88
|
close(): Promise<void>;
|
|
@@ -430,9 +124,19 @@ declare class Opensteer {
|
|
|
430
124
|
extractFromPlan<T = unknown>(options: ExtractFromPlanOptions): Promise<ExtractionRunResult<T>>;
|
|
431
125
|
getNamespace(): string;
|
|
432
126
|
getConfig(): OpensteerConfig;
|
|
127
|
+
setCursorEnabled(enabled: boolean): void;
|
|
128
|
+
getCursorState(): OpensteerCursorState;
|
|
433
129
|
getStorage(): LocalSelectorStorage;
|
|
434
130
|
clearCache(): void;
|
|
435
131
|
agent(config: OpensteerAgentConfig): OpensteerAgentInstance;
|
|
132
|
+
private getCursorController;
|
|
133
|
+
private runWithCursorPreview;
|
|
134
|
+
private isCursorPreviewEnabled;
|
|
135
|
+
private previewCursorPoint;
|
|
136
|
+
private resolveCursorPointFromBoundingBox;
|
|
137
|
+
private resolveHandleTargetPoint;
|
|
138
|
+
private resolvePathTargetPoint;
|
|
139
|
+
private resolveViewportAnchorPoint;
|
|
436
140
|
private runWithPostActionWait;
|
|
437
141
|
private executeClickVariant;
|
|
438
142
|
private resolvePath;
|
|
@@ -671,82 +375,6 @@ interface AiModelConfig {
|
|
|
671
375
|
maxTokens?: number | null;
|
|
672
376
|
}
|
|
673
377
|
|
|
674
|
-
type CloudActionMethod = 'goto' | 'snapshot' | 'state' | 'click' | 'dblclick' | 'rightclick' | 'hover' | 'input' | 'select' | 'scroll' | 'tabs' | 'newTab' | 'switchTab' | 'closeTab' | 'getCookies' | 'setCookie' | 'clearCookies' | 'pressKey' | 'type' | 'getElementText' | 'getElementValue' | 'getElementAttributes' | 'getElementBoundingBox' | 'getHtml' | 'getTitle' | 'waitForText' | 'extract' | 'extractFromPlan' | 'clearCache' | 'uploadFile' | 'exportCookies' | 'importCookies' | 'screenshot';
|
|
675
|
-
type CloudErrorCode = 'CLOUD_AUTH_FAILED' | 'CLOUD_SESSION_NOT_FOUND' | 'CLOUD_SESSION_CLOSED' | 'CLOUD_UNSUPPORTED_METHOD' | 'CLOUD_INVALID_REQUEST' | 'CLOUD_MODEL_NOT_ALLOWED' | 'CLOUD_ACTION_FAILED' | 'CLOUD_CAPACITY_EXHAUSTED' | 'CLOUD_RUNTIME_UNAVAILABLE' | 'CLOUD_RUNTIME_MISMATCH' | 'CLOUD_SESSION_STALE' | 'CLOUD_CONTROL_PLANE_ERROR' | 'CLOUD_CONTRACT_MISMATCH' | 'CLOUD_INTERNAL';
|
|
676
|
-
declare const cloudSessionContractVersion: "v3";
|
|
677
|
-
type CloudSessionContractVersion = typeof cloudSessionContractVersion;
|
|
678
|
-
type CloudSessionSourceType = 'agent-thread' | 'agent-run' | 'local-cloud' | 'manual';
|
|
679
|
-
interface CloudSessionCreateRequest {
|
|
680
|
-
cloudSessionContractVersion: CloudSessionContractVersion;
|
|
681
|
-
sourceType: 'local-cloud';
|
|
682
|
-
clientSessionHint: string;
|
|
683
|
-
localRunId: string;
|
|
684
|
-
name?: string;
|
|
685
|
-
model?: string;
|
|
686
|
-
launchContext?: Record<string, unknown>;
|
|
687
|
-
}
|
|
688
|
-
interface CloudSessionSummary {
|
|
689
|
-
sessionId: string;
|
|
690
|
-
workspaceId: string;
|
|
691
|
-
state: string;
|
|
692
|
-
createdAt: number;
|
|
693
|
-
sourceType: CloudSessionSourceType;
|
|
694
|
-
sourceRef?: string;
|
|
695
|
-
label?: string;
|
|
696
|
-
}
|
|
697
|
-
interface CloudSessionCreateResponse {
|
|
698
|
-
sessionId: string;
|
|
699
|
-
actionWsUrl: string;
|
|
700
|
-
cdpWsUrl: string;
|
|
701
|
-
actionToken: string;
|
|
702
|
-
cdpToken: string;
|
|
703
|
-
expiresAt?: number;
|
|
704
|
-
cloudSessionUrl: string;
|
|
705
|
-
cloudSession: CloudSessionSummary;
|
|
706
|
-
}
|
|
707
|
-
interface CloudSelectorCacheImportEntry {
|
|
708
|
-
namespace: string;
|
|
709
|
-
siteOrigin: string;
|
|
710
|
-
method: string;
|
|
711
|
-
descriptionHash: string;
|
|
712
|
-
path: unknown;
|
|
713
|
-
schemaHash?: string;
|
|
714
|
-
createdAt: number;
|
|
715
|
-
updatedAt: number;
|
|
716
|
-
}
|
|
717
|
-
interface CloudSelectorCacheImportRequest {
|
|
718
|
-
entries: CloudSelectorCacheImportEntry[];
|
|
719
|
-
}
|
|
720
|
-
interface CloudSelectorCacheImportResponse {
|
|
721
|
-
imported: number;
|
|
722
|
-
inserted: number;
|
|
723
|
-
updated: number;
|
|
724
|
-
skipped: number;
|
|
725
|
-
}
|
|
726
|
-
interface CloudActionRequest {
|
|
727
|
-
id: number;
|
|
728
|
-
method: CloudActionMethod;
|
|
729
|
-
args: Record<string, unknown>;
|
|
730
|
-
sessionId: string;
|
|
731
|
-
token: string;
|
|
732
|
-
}
|
|
733
|
-
interface CloudActionSuccess {
|
|
734
|
-
id: number;
|
|
735
|
-
ok: true;
|
|
736
|
-
result: unknown;
|
|
737
|
-
}
|
|
738
|
-
interface CloudActionFailure {
|
|
739
|
-
id: number;
|
|
740
|
-
ok: false;
|
|
741
|
-
error: string;
|
|
742
|
-
code: CloudErrorCode;
|
|
743
|
-
details?: CloudActionFailureDetails;
|
|
744
|
-
}
|
|
745
|
-
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
746
|
-
interface CloudActionFailureDetails {
|
|
747
|
-
actionFailure?: ActionFailure;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
378
|
declare class OpensteerCloudError extends Error {
|
|
751
379
|
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
752
380
|
readonly status?: number;
|
|
@@ -765,7 +393,6 @@ declare class CloudSessionClient {
|
|
|
765
393
|
close(sessionId: string): Promise<void>;
|
|
766
394
|
importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
|
|
767
395
|
private importSelectorCacheBatch;
|
|
768
|
-
private authHeaders;
|
|
769
396
|
}
|
|
770
397
|
|
|
771
398
|
interface ActionWsClientOptions {
|
|
@@ -878,25 +505,144 @@ declare function resolveAgentConfig(args: {
|
|
|
878
505
|
}): ResolvedAgentConfig;
|
|
879
506
|
declare function createCuaClient(config: ResolvedAgentConfig): CuaClient;
|
|
880
507
|
|
|
508
|
+
interface CursorPoint {
|
|
509
|
+
x: number;
|
|
510
|
+
y: number;
|
|
511
|
+
}
|
|
512
|
+
type CursorIntent = 'click' | 'dblclick' | 'rightclick' | 'hover' | 'input' | 'select' | 'scroll' | 'uploadFile' | 'agent';
|
|
513
|
+
interface CursorMotionPlan {
|
|
514
|
+
points: CursorPoint[];
|
|
515
|
+
stepDelayMs: number;
|
|
516
|
+
}
|
|
517
|
+
type CursorCapabilityReason = 'disabled' | 'page_closed' | 'cdp_unavailable' | 'cdp_detached' | 'unsupported' | 'renderer_error';
|
|
518
|
+
interface CursorStatus {
|
|
519
|
+
enabled: boolean;
|
|
520
|
+
active: boolean;
|
|
521
|
+
reason?: string;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
interface CursorRenderer {
|
|
525
|
+
initialize(page: Page): Promise<void>;
|
|
526
|
+
move(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
527
|
+
pulse(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
528
|
+
clear(): Promise<void>;
|
|
529
|
+
dispose(): Promise<void>;
|
|
530
|
+
isActive(): boolean;
|
|
531
|
+
status(): CursorStatus;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
interface CursorControllerOptions {
|
|
535
|
+
config?: OpensteerCursorConfig;
|
|
536
|
+
debug?: boolean;
|
|
537
|
+
renderer?: CursorRenderer;
|
|
538
|
+
}
|
|
539
|
+
declare class CursorController {
|
|
540
|
+
private readonly debug;
|
|
541
|
+
private readonly renderer;
|
|
542
|
+
private page;
|
|
543
|
+
private listenerPage;
|
|
544
|
+
private lastPoint;
|
|
545
|
+
private initializedForPage;
|
|
546
|
+
private lastInitializeAttemptAt;
|
|
547
|
+
private enabled;
|
|
548
|
+
private readonly profile;
|
|
549
|
+
private readonly style;
|
|
550
|
+
private readonly onDomContentLoaded;
|
|
551
|
+
constructor(options?: CursorControllerOptions);
|
|
552
|
+
setEnabled(enabled: boolean): void;
|
|
553
|
+
isEnabled(): boolean;
|
|
554
|
+
getStatus(): CursorStatus;
|
|
555
|
+
attachPage(page: Page): Promise<void>;
|
|
556
|
+
preview(point: CursorPoint | null, intent: CursorIntent): Promise<void>;
|
|
557
|
+
clear(): Promise<void>;
|
|
558
|
+
dispose(): Promise<void>;
|
|
559
|
+
private ensureInitialized;
|
|
560
|
+
private attachPageListeners;
|
|
561
|
+
private detachPageListeners;
|
|
562
|
+
private planMotion;
|
|
563
|
+
private reinitializeIfEligible;
|
|
564
|
+
private initializeRenderer;
|
|
565
|
+
private restoreCursorAfterNavigation;
|
|
566
|
+
private resolveMotionStart;
|
|
567
|
+
}
|
|
568
|
+
|
|
881
569
|
interface CuaAgentHandlerOptions {
|
|
882
570
|
page: Page;
|
|
883
571
|
config: ResolvedAgentConfig;
|
|
884
572
|
client: CuaClient;
|
|
885
|
-
|
|
573
|
+
cursorController: CursorController;
|
|
886
574
|
onMutatingAction?: (action: OpensteerAgentAction) => void;
|
|
887
575
|
}
|
|
888
576
|
declare class OpensteerCuaAgentHandler {
|
|
889
577
|
private readonly page;
|
|
890
578
|
private readonly config;
|
|
891
579
|
private readonly client;
|
|
892
|
-
private readonly
|
|
580
|
+
private readonly cursorController;
|
|
893
581
|
private readonly onMutatingAction?;
|
|
894
|
-
private cursorOverlayInjected;
|
|
895
582
|
constructor(options: CuaAgentHandlerOptions);
|
|
896
583
|
execute(options: OpensteerAgentExecuteOptions): Promise<OpensteerAgentResult>;
|
|
897
584
|
private initializeClient;
|
|
898
585
|
private resolveViewport;
|
|
899
|
-
private
|
|
586
|
+
private maybePreviewCursor;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
interface SnappyMotionOptions {
|
|
590
|
+
minDurationMs?: number;
|
|
591
|
+
maxDurationMs?: number;
|
|
592
|
+
maxPoints?: number;
|
|
593
|
+
}
|
|
594
|
+
declare function planSnappyCursorMotion(from: CursorPoint, to: CursorPoint, options?: SnappyMotionOptions): CursorMotionPlan;
|
|
595
|
+
|
|
596
|
+
declare class CdpOverlayCursorRenderer implements CursorRenderer {
|
|
597
|
+
private page;
|
|
598
|
+
private session;
|
|
599
|
+
private active;
|
|
600
|
+
private reason;
|
|
601
|
+
private lastMessage;
|
|
602
|
+
private lastPoint;
|
|
603
|
+
initialize(page: Page): Promise<void>;
|
|
604
|
+
isActive(): boolean;
|
|
605
|
+
status(): CursorStatus;
|
|
606
|
+
move(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
607
|
+
pulse(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
608
|
+
clear(): Promise<void>;
|
|
609
|
+
dispose(): Promise<void>;
|
|
610
|
+
private sendWithRecovery;
|
|
611
|
+
private createSession;
|
|
612
|
+
private cleanupSession;
|
|
613
|
+
private markInactive;
|
|
900
614
|
}
|
|
901
615
|
|
|
902
|
-
|
|
616
|
+
/**
|
|
617
|
+
* Injects a real SVG cursor into the page via a Shadow DOM host.
|
|
618
|
+
*
|
|
619
|
+
* Stealth considerations:
|
|
620
|
+
* - Shadow DOM hides internal structure from page querySelectorAll
|
|
621
|
+
* - pointer-events: none so it never intercepts page interactions
|
|
622
|
+
* - No detectable side-effects on page behavior
|
|
623
|
+
* - Anti-bot systems look for navigator.webdriver, fingerprints, and timing —
|
|
624
|
+
* not DOM overlays
|
|
625
|
+
*
|
|
626
|
+
* Performance:
|
|
627
|
+
* - Single absolutely-positioned element moved via CSS transform (GPU-composited)
|
|
628
|
+
* - No CDP round-trips per frame — just page.evaluate calls
|
|
629
|
+
* - Much faster than Overlay.highlightQuad protocol calls
|
|
630
|
+
*/
|
|
631
|
+
declare class SvgCursorRenderer implements CursorRenderer {
|
|
632
|
+
private page;
|
|
633
|
+
private active;
|
|
634
|
+
private reason;
|
|
635
|
+
private lastMessage;
|
|
636
|
+
initialize(page: Page): Promise<void>;
|
|
637
|
+
isActive(): boolean;
|
|
638
|
+
status(): CursorStatus;
|
|
639
|
+
move(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
640
|
+
pulse(point: CursorPoint, style: Required<OpensteerCursorStyle>): Promise<void>;
|
|
641
|
+
clear(): Promise<void>;
|
|
642
|
+
dispose(): Promise<void>;
|
|
643
|
+
private reinject;
|
|
644
|
+
private markInactive;
|
|
645
|
+
private handleError;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export { type ActionExecutionResult, ActionFailure, ActionFailureCode, ActionResult, ActionWsClient, AiExtractCallback, type AiModelConfig, AiResolveCallback, type ArrayExtractedRow, type ArrayRowMetadata, type ArraySelector, BaseActionOptions, BoundingBox, CdpOverlayCursorRenderer, ClickOptions, CloudActionFailureDetails, CloudActionMethod, CloudCdpClient, type CloudCdpConnectArgs, type CloudCdpConnection, CloudErrorCode, CloudSelectorCacheImportEntry, CloudSelectorCacheImportRequest, CloudSelectorCacheImportResponse, CloudSessionClient, CloudSessionCreateRequest, CloudSessionCreateResponse, CookieParam, type CounterRequest, CounterResolutionError, type CounterResolutionErrorCode, type CursorCapabilityReason, CursorController, type CursorIntent, type CursorMotionPlan, type CursorPoint, type CursorRenderer, type CursorStatus, ElementPath, ElementPathError, type ElementPathErrorCode, ExtractFromPlanOptions, ExtractOptions, ExtractionRunResult, type FieldSelector, FileUploadOptions, GotoOptions, HoverOptions, InputOptions, LaunchOptions, LocalSelectorStorage, type MarkInteractivityOptions, OPENSTEER_HIDDEN_ATTR, OPENSTEER_INTERACTIVE_ATTR, OPENSTEER_SCROLLABLE_ATTR, OS_BOUNDARY_ATTR, OS_IFRAME_BOUNDARY_TAG, OS_NODE_ID_ATTR, OS_SHADOW_BOUNDARY_TAG, OS_UNAVAILABLE_ATTR, Opensteer, OpensteerActionError, OpensteerAgentAction, OpensteerAgentActionError, OpensteerAgentApiError, OpensteerAgentBusyError, OpensteerAgentConfig, OpensteerAgentConfigError, OpensteerAgentError, OpensteerAgentExecuteOptions, OpensteerAgentExecutionError, OpensteerAgentInstance, OpensteerAgentProvider, OpensteerAgentProviderError, OpensteerAgentResult, OpensteerAgentUsage, OpensteerAuthScheme, OpensteerCloudError, OpensteerConfig, OpensteerCuaAgentHandler, OpensteerCursorConfig, OpensteerCursorState, OpensteerCursorStyle, type PreparedSnapshot, type RegistryEntry, type ResolvedElementPath, ScreenshotOptions, ScrollOptions, SelectOptions, type SelectorFile, type SelectorRegistry, type SerializeOptions, type SerializedNodeMeta, type SerializedPageHTML, SnapshotMode, SnapshotOptions, StateResult, SvgCursorRenderer, TabInfo, buildArrayFieldPathCandidates, buildElementPathFromHandle, buildElementPathFromSelector, buildPathSelectorHint, cleanForAction, cleanForClickable, cleanForExtraction, cleanForFull, cleanForScrollable, clearCookies, cloneElementPath, closeTab, cloudNotLaunchedError, cloudUnsupportedMethodError, collectLocalSelectorCacheEntries, countArrayItemsWithPath, createCuaClient, createEmptyRegistry, createExtractCallback, createResolveCallback, createTab, exportCookies, extractArrayRowsWithPaths, extractArrayWithPaths, extractWithPaths, getCookies, getElementAttributes, getElementBoundingBox, getElementText, getElementValue, getModelProvider, getPageHtml, getPageTitle, importCookies, listTabs, markInteractiveElements, normalizeNamespace, performClick, performFileUpload, performHover, performInput, performScroll, performSelect, planSnappyCursorMotion, prepareSnapshot, pressKey, queryAllByElementPath, resolveAgentConfig, resolveCounterElement, resolveCountersBatch, resolveElementPath, resolveNamespaceDir, sanitizeElementPath, serializePageHTML, setCookie, switchTab, typeText, waitForVisualStability };
|