opensteer 0.4.0 → 0.4.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/CHANGELOG.md +1 -16
- package/README.md +20 -80
- package/bin/opensteer.mjs +32 -260
- package/dist/chunk-OXFW5I3Y.js +7679 -0
- package/dist/cli/server.cjs +1177 -2756
- package/dist/cli/server.js +93 -116
- package/dist/index.cjs +1080 -2642
- package/dist/index.d.cts +54 -117
- package/dist/index.d.ts +54 -117
- package/dist/index.js +21 -27
- package/package.json +19 -12
package/dist/index.d.ts
CHANGED
|
@@ -33,27 +33,6 @@ interface ElementPath {
|
|
|
33
33
|
nodes: DomPath;
|
|
34
34
|
}
|
|
35
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
36
|
type SnapshotMode = 'action' | 'extraction' | 'clickable' | 'scrollable' | 'full';
|
|
58
37
|
interface SnapshotOptions {
|
|
59
38
|
mode?: SnapshotMode;
|
|
@@ -99,55 +78,43 @@ interface LaunchOptions {
|
|
|
99
78
|
executablePath?: string;
|
|
100
79
|
slowMo?: number;
|
|
101
80
|
context?: BrowserContextOptions;
|
|
102
|
-
/** Connect to a running
|
|
103
|
-
|
|
104
|
-
/**
|
|
81
|
+
/** Connect to a running Chrome via CDP. Example: "http://localhost:9222" */
|
|
82
|
+
cdpUrl?: string;
|
|
83
|
+
/** Use an installed browser: "chrome", "chrome-beta", "msedge" */
|
|
105
84
|
channel?: string;
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
/** Connection timeout in milliseconds. */
|
|
109
|
-
timeout?: number;
|
|
85
|
+
/** Chrome user data directory. Preserves cookies, extensions, and sessions. */
|
|
86
|
+
userDataDir?: string;
|
|
110
87
|
}
|
|
111
88
|
interface OpensteerBrowserConfig {
|
|
112
89
|
headless?: boolean;
|
|
113
90
|
executablePath?: string;
|
|
114
91
|
slowMo?: number;
|
|
115
|
-
/** Connect to a running
|
|
116
|
-
|
|
117
|
-
/**
|
|
92
|
+
/** Connect to a running Chrome via CDP. Example: "http://localhost:9222" */
|
|
93
|
+
cdpUrl?: string;
|
|
94
|
+
/** Use an installed browser: "chrome", "chrome-beta", "msedge" */
|
|
118
95
|
channel?: string;
|
|
119
|
-
/**
|
|
120
|
-
|
|
96
|
+
/** Chrome user data directory. Preserves cookies, extensions, and sessions. */
|
|
97
|
+
userDataDir?: string;
|
|
121
98
|
}
|
|
122
99
|
interface OpensteerStorageConfig {
|
|
123
100
|
rootDir?: string;
|
|
124
101
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
baseUrl?: string;
|
|
102
|
+
interface OpensteerCloudConfig {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
key?: string;
|
|
129
105
|
}
|
|
130
106
|
interface OpensteerConfig {
|
|
131
107
|
name?: string;
|
|
132
108
|
browser?: OpensteerBrowserConfig;
|
|
133
109
|
storage?: OpensteerStorageConfig;
|
|
134
|
-
|
|
135
|
-
remote?: OpensteerRemoteOptions;
|
|
110
|
+
cloud?: OpensteerCloudConfig;
|
|
136
111
|
model?: string;
|
|
137
112
|
debug?: boolean;
|
|
138
113
|
}
|
|
139
|
-
interface ActionWaitOptions {
|
|
140
|
-
enabled?: boolean;
|
|
141
|
-
timeout?: number;
|
|
142
|
-
settleMs?: number;
|
|
143
|
-
networkQuietMs?: number;
|
|
144
|
-
includeNetwork?: boolean;
|
|
145
|
-
}
|
|
146
114
|
interface BaseActionOptions {
|
|
147
115
|
description?: string;
|
|
148
116
|
element?: number;
|
|
149
117
|
selector?: string;
|
|
150
|
-
wait?: false | ActionWaitOptions;
|
|
151
118
|
}
|
|
152
119
|
interface ClickOptions extends BaseActionOptions {
|
|
153
120
|
button?: 'left' | 'right' | 'middle';
|
|
@@ -303,7 +270,7 @@ declare class Opensteer {
|
|
|
303
270
|
private readonly namespace;
|
|
304
271
|
private readonly storage;
|
|
305
272
|
private readonly pool;
|
|
306
|
-
private readonly
|
|
273
|
+
private readonly cloud;
|
|
307
274
|
private browser;
|
|
308
275
|
private pageRef;
|
|
309
276
|
private contextRef;
|
|
@@ -312,16 +279,14 @@ declare class Opensteer {
|
|
|
312
279
|
constructor(config?: OpensteerConfig);
|
|
313
280
|
private createLazyResolveCallback;
|
|
314
281
|
private createLazyExtractCallback;
|
|
315
|
-
private
|
|
316
|
-
private
|
|
317
|
-
private buildActionError;
|
|
282
|
+
private bindCloudActionMethods;
|
|
283
|
+
private invokeCloudAction;
|
|
318
284
|
get page(): Page;
|
|
319
285
|
get context(): BrowserContext;
|
|
320
|
-
getRemoteSessionId(): string | null;
|
|
321
286
|
launch(options?: LaunchOptions): Promise<void>;
|
|
322
287
|
static from(page: Page, config?: OpensteerConfig): Opensteer;
|
|
323
288
|
close(): Promise<void>;
|
|
324
|
-
private
|
|
289
|
+
private syncLocalSelectorCacheToCloud;
|
|
325
290
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
326
291
|
snapshot(options?: SnapshotOptions): Promise<string>;
|
|
327
292
|
state(): Promise<StateResult>;
|
|
@@ -361,14 +326,12 @@ declare class Opensteer {
|
|
|
361
326
|
getConfig(): OpensteerConfig;
|
|
362
327
|
getStorage(): LocalSelectorStorage;
|
|
363
328
|
clearCache(): void;
|
|
364
|
-
private runWithPostActionWait;
|
|
365
329
|
private executeClickVariant;
|
|
366
330
|
private resolvePath;
|
|
367
331
|
private resolvePathWithAi;
|
|
368
332
|
private buildPathFromElement;
|
|
369
333
|
private tryBuildPathFromCounter;
|
|
370
334
|
private resolveCounterHandle;
|
|
371
|
-
private resolveCounterHandleForAction;
|
|
372
335
|
private buildPathFromResolvedHandle;
|
|
373
336
|
private withIndexedIframeContext;
|
|
374
337
|
private readPathFromCounterIndex;
|
|
@@ -393,33 +356,16 @@ declare class Opensteer {
|
|
|
393
356
|
private normalizePath;
|
|
394
357
|
}
|
|
395
358
|
|
|
396
|
-
|
|
359
|
+
declare function waitForVisualStability(page: Page, options?: {
|
|
397
360
|
timeout?: number;
|
|
398
361
|
settleMs?: number;
|
|
399
|
-
}
|
|
400
|
-
declare function waitForVisualStability(page: Page, options?: VisualStabilityOptions): Promise<void>;
|
|
362
|
+
}): Promise<void>;
|
|
401
363
|
|
|
402
364
|
interface ActionExecutionResult {
|
|
403
365
|
ok: boolean;
|
|
404
366
|
path?: ElementPath;
|
|
405
367
|
usedSelector?: string;
|
|
406
368
|
error?: string;
|
|
407
|
-
failure?: ActionFailure;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
interface OpensteerActionErrorOptions {
|
|
411
|
-
action: string;
|
|
412
|
-
failure: ActionFailure;
|
|
413
|
-
selectorUsed?: string | null;
|
|
414
|
-
message?: string;
|
|
415
|
-
cause?: unknown;
|
|
416
|
-
}
|
|
417
|
-
declare class OpensteerActionError extends Error {
|
|
418
|
-
readonly action: string;
|
|
419
|
-
readonly code: ActionFailureCode;
|
|
420
|
-
readonly failure: ActionFailure;
|
|
421
|
-
readonly selectorUsed: string | null;
|
|
422
|
-
constructor(options: OpensteerActionErrorOptions);
|
|
423
369
|
}
|
|
424
370
|
|
|
425
371
|
declare function performClick(page: Page, path: ElementPath, options: ClickOptions): Promise<ActionExecutionResult>;
|
|
@@ -498,11 +444,11 @@ declare class ElementPathError extends Error {
|
|
|
498
444
|
constructor(code: ElementPathErrorCode, message: string);
|
|
499
445
|
}
|
|
500
446
|
|
|
501
|
-
declare const
|
|
502
|
-
declare const
|
|
503
|
-
declare const
|
|
504
|
-
declare const
|
|
505
|
-
declare const
|
|
447
|
+
declare const OV_NODE_ID_ATTR = "data-ov-node-id";
|
|
448
|
+
declare const OV_BOUNDARY_ATTR = "data-ov-boundary";
|
|
449
|
+
declare const OV_UNAVAILABLE_ATTR = "data-ov-unavailable";
|
|
450
|
+
declare const OV_IFRAME_BOUNDARY_TAG = "ov-iframe-root";
|
|
451
|
+
declare const OV_SHADOW_BOUNDARY_TAG = "ov-shadow-root";
|
|
506
452
|
interface SerializeOptions {
|
|
507
453
|
detectOverlays?: boolean;
|
|
508
454
|
}
|
|
@@ -583,9 +529,6 @@ interface PreparedSnapshot {
|
|
|
583
529
|
}
|
|
584
530
|
declare function prepareSnapshot(page: Page, options?: SnapshotOptions): Promise<PreparedSnapshot>;
|
|
585
531
|
|
|
586
|
-
declare function normalizeNamespace(input?: string): string;
|
|
587
|
-
declare function resolveNamespaceDir(rootDir: string, namespace: string): string;
|
|
588
|
-
|
|
589
532
|
declare function createResolveCallback(model: string, options?: {
|
|
590
533
|
temperature?: number;
|
|
591
534
|
maxTokens?: number | null;
|
|
@@ -604,22 +547,21 @@ interface AiModelConfig {
|
|
|
604
547
|
maxTokens?: number | null;
|
|
605
548
|
}
|
|
606
549
|
|
|
607
|
-
type
|
|
608
|
-
type
|
|
609
|
-
interface
|
|
550
|
+
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';
|
|
551
|
+
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_INTERNAL';
|
|
552
|
+
interface CloudSessionCreateRequest {
|
|
610
553
|
name?: string;
|
|
611
554
|
model?: string;
|
|
612
555
|
launchContext?: Record<string, unknown>;
|
|
613
556
|
}
|
|
614
|
-
interface
|
|
557
|
+
interface CloudSessionCreateResponse {
|
|
615
558
|
sessionId: string;
|
|
616
559
|
actionWsUrl: string;
|
|
617
560
|
cdpWsUrl: string;
|
|
618
561
|
actionToken: string;
|
|
619
562
|
cdpToken: string;
|
|
620
|
-
expiresAt?: number;
|
|
621
563
|
}
|
|
622
|
-
interface
|
|
564
|
+
interface CloudSelectorCacheImportEntry {
|
|
623
565
|
namespace: string;
|
|
624
566
|
siteOrigin: string;
|
|
625
567
|
method: string;
|
|
@@ -629,55 +571,50 @@ interface RemoteSelectorCacheImportEntry {
|
|
|
629
571
|
createdAt: number;
|
|
630
572
|
updatedAt: number;
|
|
631
573
|
}
|
|
632
|
-
interface
|
|
633
|
-
entries:
|
|
574
|
+
interface CloudSelectorCacheImportRequest {
|
|
575
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
634
576
|
}
|
|
635
|
-
interface
|
|
577
|
+
interface CloudSelectorCacheImportResponse {
|
|
636
578
|
imported: number;
|
|
637
579
|
inserted: number;
|
|
638
580
|
updated: number;
|
|
639
581
|
skipped: number;
|
|
640
582
|
}
|
|
641
|
-
interface
|
|
583
|
+
interface CloudActionRequest {
|
|
642
584
|
id: number;
|
|
643
|
-
method:
|
|
585
|
+
method: CloudActionMethod;
|
|
644
586
|
args: Record<string, unknown>;
|
|
645
587
|
sessionId: string;
|
|
646
588
|
token: string;
|
|
647
589
|
}
|
|
648
|
-
interface
|
|
590
|
+
interface CloudActionSuccess {
|
|
649
591
|
id: number;
|
|
650
592
|
ok: true;
|
|
651
593
|
result: unknown;
|
|
652
594
|
}
|
|
653
|
-
interface
|
|
595
|
+
interface CloudActionFailure {
|
|
654
596
|
id: number;
|
|
655
597
|
ok: false;
|
|
656
598
|
error: string;
|
|
657
|
-
code:
|
|
658
|
-
details?: RemoteActionFailureDetails;
|
|
659
|
-
}
|
|
660
|
-
type RemoteActionResponse = RemoteActionSuccess | RemoteActionFailure;
|
|
661
|
-
interface RemoteActionFailureDetails {
|
|
662
|
-
actionFailure?: ActionFailure;
|
|
599
|
+
code: CloudErrorCode;
|
|
663
600
|
}
|
|
601
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
664
602
|
|
|
665
|
-
declare class
|
|
666
|
-
readonly code:
|
|
603
|
+
declare class OpensteerCloudError extends Error {
|
|
604
|
+
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
667
605
|
readonly status?: number;
|
|
668
|
-
|
|
669
|
-
constructor(code: RemoteErrorCode | 'REMOTE_TRANSPORT_ERROR', message: string, status?: number, details?: RemoteActionFailureDetails | Record<string, unknown>);
|
|
606
|
+
constructor(code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR', message: string, status?: number);
|
|
670
607
|
}
|
|
671
|
-
declare function
|
|
672
|
-
declare function
|
|
608
|
+
declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
|
|
609
|
+
declare function cloudNotLaunchedError(): OpensteerCloudError;
|
|
673
610
|
|
|
674
|
-
declare class
|
|
611
|
+
declare class CloudSessionClient {
|
|
675
612
|
private readonly baseUrl;
|
|
676
613
|
private readonly key;
|
|
677
614
|
constructor(baseUrl: string, key: string);
|
|
678
|
-
create(request:
|
|
615
|
+
create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
|
|
679
616
|
close(sessionId: string): Promise<void>;
|
|
680
|
-
importSelectorCache(request:
|
|
617
|
+
importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
|
|
681
618
|
private importSelectorCacheBatch;
|
|
682
619
|
}
|
|
683
620
|
|
|
@@ -695,25 +632,25 @@ declare class ActionWsClient {
|
|
|
695
632
|
private closed;
|
|
696
633
|
private constructor();
|
|
697
634
|
static connect(options: ActionWsClientOptions): Promise<ActionWsClient>;
|
|
698
|
-
request<T>(method:
|
|
635
|
+
request<T>(method: CloudActionMethod, args: Record<string, unknown>): Promise<T>;
|
|
699
636
|
close(): Promise<void>;
|
|
700
637
|
private handleMessage;
|
|
701
638
|
private rejectAll;
|
|
702
639
|
}
|
|
703
640
|
|
|
704
|
-
interface
|
|
641
|
+
interface CloudCdpConnectArgs {
|
|
705
642
|
wsUrl: string;
|
|
706
643
|
token: string;
|
|
707
644
|
}
|
|
708
|
-
interface
|
|
645
|
+
interface CloudCdpConnection {
|
|
709
646
|
browser: Browser;
|
|
710
647
|
context: BrowserContext;
|
|
711
648
|
page: Page;
|
|
712
649
|
}
|
|
713
|
-
declare class
|
|
714
|
-
connect(args:
|
|
650
|
+
declare class CloudCdpClient {
|
|
651
|
+
connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
|
|
715
652
|
}
|
|
716
653
|
|
|
717
|
-
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage):
|
|
654
|
+
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): CloudSelectorCacheImportEntry[];
|
|
718
655
|
|
|
719
|
-
export { type ActionExecutionResult, type
|
|
656
|
+
export { type ActionExecutionResult, type ActionResult, ActionWsClient, type AiExtractArgs, type AiExtractCallback, type AiExtractResult, type AiModelConfig, type AiResolveArgs, type AiResolveCallback, type AiResolveCallbackResult, type AiResolveResult, type ArrayExtractedRow, type ArrayRowMetadata, type ArraySelector, type AttributeMatchClause, type BaseActionOptions, type BoundingBox, type ClickOptions, type CloudActionFailure, type CloudActionMethod, type CloudActionRequest, type CloudActionResponse, type CloudActionSuccess, CloudCdpClient, type CloudCdpConnectArgs, type CloudCdpConnection, type CloudErrorCode, type CloudSelectorCacheImportEntry, type CloudSelectorCacheImportRequest, type CloudSelectorCacheImportResponse, CloudSessionClient, type CloudSessionCreateRequest, type CloudSessionCreateResponse, type ContextHop, type CookieParam, type CounterBinding, type CounterRequest, CounterResolutionError, type CounterResolutionErrorCode, type CounterSnapshotLike, type DomPath, type ElementPath, ElementPathError, type ElementPathErrorCode, type ExtractFromPlanOptions, type ExtractOptions, type ExtractSchema, type ExtractSchemaField, type ExtractSchemaValue, type ExtractionFieldPlan, type ExtractionPlan, type ExtractionRunResult, type FieldSelector, type FileUploadOptions, type GotoOptions, type HoverOptions, type InputOptions, type LaunchOptions, LocalSelectorStorage, type MarkInteractivityOptions, type MatchClause, type MatchOperator, OPENSTEER_HIDDEN_ATTR, OPENSTEER_INTERACTIVE_ATTR, OPENSTEER_SCROLLABLE_ATTR, OV_BOUNDARY_ATTR, OV_IFRAME_BOUNDARY_TAG, OV_NODE_ID_ATTR, OV_SHADOW_BOUNDARY_TAG, OV_UNAVAILABLE_ATTR, Opensteer, type OpensteerBrowserConfig, type OpensteerCloudConfig, OpensteerCloudError, type OpensteerConfig, type OpensteerStorageConfig, type PathNode, type PathNodePosition, type PositionMatchClause, type PreparedSnapshot, type RegistryEntry, type ResolvedElementPath, type ScreenshotOptions, type ScrollOptions, type SelectOptions, type SelectorFile, type SelectorRegistry, type SerializeOptions, type SerializedNodeMeta, type SerializedPageHTML, type SnapshotMode, type SnapshotOptions, type StateResult, type TabInfo, buildElementPathFromHandle, buildElementPathFromSelector, buildPathSelectorHint, cleanForAction, cleanForClickable, cleanForExtraction, cleanForFull, cleanForScrollable, clearCookies, cloneElementPath, closeTab, cloudNotLaunchedError, cloudUnsupportedMethodError, collectLocalSelectorCacheEntries, countArrayItemsWithPath, createEmptyRegistry, createExtractCallback, createResolveCallback, createTab, ensureLiveCounters, exportCookies, extractArrayRowsWithPaths, extractArrayWithPaths, extractWithPaths, getCookies, getElementAttributes, getElementBoundingBox, getElementText, getElementValue, getModelProvider, getPageHtml, getPageTitle, importCookies, listTabs, markInteractiveElements, performClick, performFileUpload, performHover, performInput, performScroll, performSelect, prepareSnapshot, pressKey, resolveCounterElement, resolveCountersBatch, resolveElementPath, sanitizeElementPath, serializePageHTML, setCookie, switchTab, typeText, waitForVisualStability };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActionWsClient,
|
|
3
|
+
CloudCdpClient,
|
|
4
|
+
CloudSessionClient,
|
|
3
5
|
CounterResolutionError,
|
|
4
6
|
ElementPathError,
|
|
5
7
|
LocalSelectorStorage,
|
|
6
8
|
OPENSTEER_HIDDEN_ATTR,
|
|
7
9
|
OPENSTEER_INTERACTIVE_ATTR,
|
|
8
10
|
OPENSTEER_SCROLLABLE_ATTR,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
OV_BOUNDARY_ATTR,
|
|
12
|
+
OV_IFRAME_BOUNDARY_TAG,
|
|
13
|
+
OV_NODE_ID_ATTR,
|
|
14
|
+
OV_SHADOW_BOUNDARY_TAG,
|
|
15
|
+
OV_UNAVAILABLE_ATTR,
|
|
14
16
|
Opensteer,
|
|
15
|
-
|
|
16
|
-
OpensteerRemoteError,
|
|
17
|
-
RemoteCdpClient,
|
|
18
|
-
RemoteSessionClient,
|
|
17
|
+
OpensteerCloudError,
|
|
19
18
|
buildElementPathFromHandle,
|
|
20
19
|
buildElementPathFromSelector,
|
|
21
20
|
buildPathSelectorHint,
|
|
@@ -27,6 +26,8 @@ import {
|
|
|
27
26
|
clearCookies,
|
|
28
27
|
cloneElementPath,
|
|
29
28
|
closeTab,
|
|
29
|
+
cloudNotLaunchedError,
|
|
30
|
+
cloudUnsupportedMethodError,
|
|
30
31
|
collectLocalSelectorCacheEntries,
|
|
31
32
|
countArrayItemsWithPath,
|
|
32
33
|
createEmptyRegistry,
|
|
@@ -46,7 +47,6 @@ import {
|
|
|
46
47
|
importCookies,
|
|
47
48
|
listTabs,
|
|
48
49
|
markInteractiveElements,
|
|
49
|
-
normalizeNamespace,
|
|
50
50
|
performClick,
|
|
51
51
|
performFileUpload,
|
|
52
52
|
performHover,
|
|
@@ -55,19 +55,16 @@ import {
|
|
|
55
55
|
performSelect,
|
|
56
56
|
prepareSnapshot,
|
|
57
57
|
pressKey,
|
|
58
|
-
remoteNotLaunchedError,
|
|
59
|
-
remoteUnsupportedMethodError,
|
|
60
58
|
resolveCounterElement,
|
|
61
59
|
resolveCountersBatch,
|
|
62
60
|
resolveElementPath,
|
|
63
|
-
resolveNamespaceDir,
|
|
64
61
|
sanitizeElementPath,
|
|
65
62
|
serializePageHTML,
|
|
66
63
|
setCookie,
|
|
67
64
|
switchTab,
|
|
68
65
|
typeText,
|
|
69
66
|
waitForVisualStability
|
|
70
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-OXFW5I3Y.js";
|
|
71
68
|
import {
|
|
72
69
|
createResolveCallback
|
|
73
70
|
} from "./chunk-SRJLH34D.js";
|
|
@@ -80,22 +77,21 @@ import {
|
|
|
80
77
|
} from "./chunk-L4FHT64T.js";
|
|
81
78
|
export {
|
|
82
79
|
ActionWsClient,
|
|
80
|
+
CloudCdpClient,
|
|
81
|
+
CloudSessionClient,
|
|
83
82
|
CounterResolutionError,
|
|
84
83
|
ElementPathError,
|
|
85
84
|
LocalSelectorStorage,
|
|
86
85
|
OPENSTEER_HIDDEN_ATTR,
|
|
87
86
|
OPENSTEER_INTERACTIVE_ATTR,
|
|
88
87
|
OPENSTEER_SCROLLABLE_ATTR,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
OV_BOUNDARY_ATTR,
|
|
89
|
+
OV_IFRAME_BOUNDARY_TAG,
|
|
90
|
+
OV_NODE_ID_ATTR,
|
|
91
|
+
OV_SHADOW_BOUNDARY_TAG,
|
|
92
|
+
OV_UNAVAILABLE_ATTR,
|
|
94
93
|
Opensteer,
|
|
95
|
-
|
|
96
|
-
OpensteerRemoteError,
|
|
97
|
-
RemoteCdpClient,
|
|
98
|
-
RemoteSessionClient,
|
|
94
|
+
OpensteerCloudError,
|
|
99
95
|
buildElementPathFromHandle,
|
|
100
96
|
buildElementPathFromSelector,
|
|
101
97
|
buildPathSelectorHint,
|
|
@@ -107,6 +103,8 @@ export {
|
|
|
107
103
|
clearCookies,
|
|
108
104
|
cloneElementPath,
|
|
109
105
|
closeTab,
|
|
106
|
+
cloudNotLaunchedError,
|
|
107
|
+
cloudUnsupportedMethodError,
|
|
110
108
|
collectLocalSelectorCacheEntries,
|
|
111
109
|
countArrayItemsWithPath,
|
|
112
110
|
createEmptyRegistry,
|
|
@@ -129,7 +127,6 @@ export {
|
|
|
129
127
|
importCookies,
|
|
130
128
|
listTabs,
|
|
131
129
|
markInteractiveElements,
|
|
132
|
-
normalizeNamespace,
|
|
133
130
|
performClick,
|
|
134
131
|
performFileUpload,
|
|
135
132
|
performHover,
|
|
@@ -138,12 +135,9 @@ export {
|
|
|
138
135
|
performSelect,
|
|
139
136
|
prepareSnapshot,
|
|
140
137
|
pressKey,
|
|
141
|
-
remoteNotLaunchedError,
|
|
142
|
-
remoteUnsupportedMethodError,
|
|
143
138
|
resolveCounterElement,
|
|
144
139
|
resolveCountersBatch,
|
|
145
140
|
resolveElementPath,
|
|
146
|
-
resolveNamespaceDir,
|
|
147
141
|
sanitizeElementPath,
|
|
148
142
|
serializePageHTML,
|
|
149
143
|
setCookie,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opensteer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"packageManager": "pnpm@10.29.3",
|
|
5
5
|
"description": "Open-source browser automation SDK with robust selectors and deterministic replay.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"CHANGELOG.md"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "tsup src/index.ts src/cli/server.ts --dts --format esm,cjs --
|
|
30
|
-
"prepublishOnly": "pnpm run build",
|
|
29
|
+
"build": "tsup src/index.ts src/cli/server.ts --dts --format esm,cjs --external ai --external zod --external @ai-sdk/openai --external @ai-sdk/anthropic --external @ai-sdk/google --external @ai-sdk/xai --external @ai-sdk/groq",
|
|
31
30
|
"test": "vitest run",
|
|
32
31
|
"test:live-web": "vitest run --config vitest.live-web.config.ts",
|
|
33
32
|
"test:unit": "vitest run tests/html tests/element-path tests/config.test.ts tests/storage",
|
|
@@ -39,26 +38,34 @@
|
|
|
39
38
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
|
-
"@ai-sdk/anthropic": "^3.0.46",
|
|
43
|
-
"@ai-sdk/google": "^3.0.30",
|
|
44
|
-
"@ai-sdk/groq": "^3.0.24",
|
|
45
|
-
"@ai-sdk/openai": "^3.0.26",
|
|
46
|
-
"@ai-sdk/xai": "^3.0.57",
|
|
47
|
-
"ai": "^6.0.77",
|
|
48
41
|
"cheerio": "^1.0.0-rc.12",
|
|
49
42
|
"dotenv": "^17.2.4",
|
|
50
43
|
"playwright": "^1.50.0",
|
|
51
|
-
"ws": "^8.18.0"
|
|
52
|
-
"zod": "^4.3.6"
|
|
44
|
+
"ws": "^8.18.0"
|
|
53
45
|
},
|
|
54
46
|
"devDependencies": {
|
|
47
|
+
"@ai-sdk/openai": "^3.0.26",
|
|
55
48
|
"@types/node": "^22.10.0",
|
|
56
49
|
"@types/ws": "^8.5.13",
|
|
50
|
+
"ai": "^6.0.77",
|
|
57
51
|
"domhandler": "^5.0.3",
|
|
58
52
|
"tsup": "^8.0.1",
|
|
59
53
|
"typescript": "^5.6.3",
|
|
60
54
|
"vite": "^7.3.1",
|
|
61
|
-
"vitest": "^2.1.8"
|
|
55
|
+
"vitest": "^2.1.8",
|
|
56
|
+
"zod": "^4.3.6"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"ai": ">=4.0.0",
|
|
60
|
+
"zod": ">=3.0.0"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"ai": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"zod": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
62
69
|
},
|
|
63
70
|
"pnpm": {
|
|
64
71
|
"onlyBuiltDependencies": [
|