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