opensteer 0.4.6 → 0.4.8

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.cts CHANGED
@@ -122,19 +122,21 @@ interface OpensteerBrowserConfig {
122
122
  interface OpensteerStorageConfig {
123
123
  rootDir?: string;
124
124
  }
125
- type OpensteerMode = 'local' | 'remote';
126
125
  type OpensteerAuthScheme = 'api-key' | 'bearer';
127
- interface OpensteerRemoteOptions {
126
+ type OpensteerCloudAnnouncePolicy = 'always' | 'off' | 'tty';
127
+ interface OpensteerCloudOptions {
128
128
  apiKey?: string;
129
129
  baseUrl?: string;
130
+ appUrl?: string;
130
131
  authScheme?: OpensteerAuthScheme;
132
+ announce?: OpensteerCloudAnnouncePolicy;
131
133
  }
134
+ type OpensteerCloudConfig = boolean | OpensteerCloudOptions;
132
135
  interface OpensteerConfig {
133
136
  name?: string;
134
137
  browser?: OpensteerBrowserConfig;
135
138
  storage?: OpensteerStorageConfig;
136
- mode?: OpensteerMode;
137
- remote?: OpensteerRemoteOptions;
139
+ cloud?: OpensteerCloudConfig;
138
140
  model?: string;
139
141
  debug?: boolean;
140
142
  }
@@ -305,7 +307,7 @@ declare class Opensteer {
305
307
  private readonly namespace;
306
308
  private readonly storage;
307
309
  private readonly pool;
308
- private readonly remote;
310
+ private readonly cloud;
309
311
  private browser;
310
312
  private pageRef;
311
313
  private contextRef;
@@ -314,16 +316,19 @@ declare class Opensteer {
314
316
  constructor(config?: OpensteerConfig);
315
317
  private createLazyResolveCallback;
316
318
  private createLazyExtractCallback;
317
- private invokeRemoteActionAndResetCache;
318
- private invokeRemoteAction;
319
+ private invokeCloudActionAndResetCache;
320
+ private invokeCloudAction;
319
321
  private buildActionError;
320
322
  get page(): Page;
321
323
  get context(): BrowserContext;
322
- getRemoteSessionId(): string | null;
324
+ getCloudSessionId(): string | null;
325
+ getCloudSessionUrl(): string | null;
326
+ private announceCloudSession;
327
+ private shouldAnnounceCloudSession;
323
328
  launch(options?: LaunchOptions): Promise<void>;
324
329
  static from(page: Page, config?: OpensteerConfig): Opensteer;
325
330
  close(): Promise<void>;
326
- private syncLocalSelectorCacheToRemote;
331
+ private syncLocalSelectorCacheToCloud;
327
332
  goto(url: string, options?: GotoOptions): Promise<void>;
328
333
  snapshot(options?: SnapshotOptions): Promise<string>;
329
334
  state(): Promise<StateResult>;
@@ -606,22 +611,40 @@ interface AiModelConfig {
606
611
  maxTokens?: number | null;
607
612
  }
608
613
 
609
- 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';
610
- 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';
611
- interface RemoteSessionCreateRequest {
614
+ 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';
615
+ 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';
616
+ declare const cloudSessionContractVersion: "v3";
617
+ type CloudSessionContractVersion = typeof cloudSessionContractVersion;
618
+ type CloudSessionSourceType = 'agent-thread' | 'agent-run' | 'local-cloud' | 'manual';
619
+ interface CloudSessionCreateRequest {
620
+ cloudSessionContractVersion: CloudSessionContractVersion;
621
+ sourceType: 'local-cloud';
622
+ clientSessionHint: string;
623
+ localRunId: string;
612
624
  name?: string;
613
625
  model?: string;
614
626
  launchContext?: Record<string, unknown>;
615
627
  }
616
- interface RemoteSessionCreateResponse {
628
+ interface CloudSessionSummary {
629
+ sessionId: string;
630
+ workspaceId: string;
631
+ state: string;
632
+ createdAt: number;
633
+ sourceType: CloudSessionSourceType;
634
+ sourceRef?: string;
635
+ label?: string;
636
+ }
637
+ interface CloudSessionCreateResponse {
617
638
  sessionId: string;
618
639
  actionWsUrl: string;
619
640
  cdpWsUrl: string;
620
641
  actionToken: string;
621
642
  cdpToken: string;
622
643
  expiresAt?: number;
644
+ cloudSessionUrl: string;
645
+ cloudSession: CloudSessionSummary;
623
646
  }
624
- interface RemoteSelectorCacheImportEntry {
647
+ interface CloudSelectorCacheImportEntry {
625
648
  namespace: string;
626
649
  siteOrigin: string;
627
650
  method: string;
@@ -631,56 +654,56 @@ interface RemoteSelectorCacheImportEntry {
631
654
  createdAt: number;
632
655
  updatedAt: number;
633
656
  }
634
- interface RemoteSelectorCacheImportRequest {
635
- entries: RemoteSelectorCacheImportEntry[];
657
+ interface CloudSelectorCacheImportRequest {
658
+ entries: CloudSelectorCacheImportEntry[];
636
659
  }
637
- interface RemoteSelectorCacheImportResponse {
660
+ interface CloudSelectorCacheImportResponse {
638
661
  imported: number;
639
662
  inserted: number;
640
663
  updated: number;
641
664
  skipped: number;
642
665
  }
643
- interface RemoteActionRequest {
666
+ interface CloudActionRequest {
644
667
  id: number;
645
- method: RemoteActionMethod;
668
+ method: CloudActionMethod;
646
669
  args: Record<string, unknown>;
647
670
  sessionId: string;
648
671
  token: string;
649
672
  }
650
- interface RemoteActionSuccess {
673
+ interface CloudActionSuccess {
651
674
  id: number;
652
675
  ok: true;
653
676
  result: unknown;
654
677
  }
655
- interface RemoteActionFailure {
678
+ interface CloudActionFailure {
656
679
  id: number;
657
680
  ok: false;
658
681
  error: string;
659
- code: RemoteErrorCode;
660
- details?: RemoteActionFailureDetails;
682
+ code: CloudErrorCode;
683
+ details?: CloudActionFailureDetails;
661
684
  }
662
- type RemoteActionResponse = RemoteActionSuccess | RemoteActionFailure;
663
- interface RemoteActionFailureDetails {
685
+ type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
686
+ interface CloudActionFailureDetails {
664
687
  actionFailure?: ActionFailure;
665
688
  }
666
689
 
667
- declare class OpensteerRemoteError extends Error {
668
- readonly code: RemoteErrorCode | 'REMOTE_TRANSPORT_ERROR';
690
+ declare class OpensteerCloudError extends Error {
691
+ readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
669
692
  readonly status?: number;
670
- readonly details?: RemoteActionFailureDetails | Record<string, unknown>;
671
- constructor(code: RemoteErrorCode | 'REMOTE_TRANSPORT_ERROR', message: string, status?: number, details?: RemoteActionFailureDetails | Record<string, unknown>);
693
+ readonly details?: CloudActionFailureDetails | Record<string, unknown>;
694
+ constructor(code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR', message: string, status?: number, details?: CloudActionFailureDetails | Record<string, unknown>);
672
695
  }
673
- declare function remoteUnsupportedMethodError(method: string, message?: string): OpensteerRemoteError;
674
- declare function remoteNotLaunchedError(): OpensteerRemoteError;
696
+ declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
697
+ declare function cloudNotLaunchedError(): OpensteerCloudError;
675
698
 
676
- declare class RemoteSessionClient {
699
+ declare class CloudSessionClient {
677
700
  private readonly baseUrl;
678
701
  private readonly key;
679
702
  private readonly authScheme;
680
703
  constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
681
- create(request: RemoteSessionCreateRequest): Promise<RemoteSessionCreateResponse>;
704
+ create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
682
705
  close(sessionId: string): Promise<void>;
683
- importSelectorCache(request: RemoteSelectorCacheImportRequest): Promise<RemoteSelectorCacheImportResponse>;
706
+ importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
684
707
  private importSelectorCacheBatch;
685
708
  private authHeaders;
686
709
  }
@@ -699,25 +722,25 @@ declare class ActionWsClient {
699
722
  private closed;
700
723
  private constructor();
701
724
  static connect(options: ActionWsClientOptions): Promise<ActionWsClient>;
702
- request<T>(method: RemoteActionMethod, args: Record<string, unknown>): Promise<T>;
725
+ request<T>(method: CloudActionMethod, args: Record<string, unknown>): Promise<T>;
703
726
  close(): Promise<void>;
704
727
  private handleMessage;
705
728
  private rejectAll;
706
729
  }
707
730
 
708
- interface RemoteCdpConnectArgs {
731
+ interface CloudCdpConnectArgs {
709
732
  wsUrl: string;
710
733
  token: string;
711
734
  }
712
- interface RemoteCdpConnection {
735
+ interface CloudCdpConnection {
713
736
  browser: Browser;
714
737
  context: BrowserContext;
715
738
  page: Page;
716
739
  }
717
- declare class RemoteCdpClient {
718
- connect(args: RemoteCdpConnectArgs): Promise<RemoteCdpConnection>;
740
+ declare class CloudCdpClient {
741
+ connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
719
742
  }
720
743
 
721
- declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): RemoteSelectorCacheImportEntry[];
744
+ declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): CloudSelectorCacheImportEntry[];
722
745
 
723
- 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 OpensteerAuthScheme, 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 };
746
+ 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 CloudActionFailure, type CloudActionFailureDetails, type CloudActionMethod, type CloudActionRequest, type CloudActionResponse, type CloudActionSuccess, CloudCdpClient, type CloudCdpConnectArgs, type CloudCdpConnection, type CloudErrorCode, type CloudSelectorCacheImportEntry, type CloudSelectorCacheImportRequest, type CloudSelectorCacheImportResponse, CloudSessionClient, type CloudSessionContractVersion, type CloudSessionCreateRequest, type CloudSessionCreateResponse, type CloudSessionSourceType, type CloudSessionSummary, 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 OpensteerAuthScheme, type OpensteerBrowserConfig, type OpensteerCloudAnnouncePolicy, type OpensteerCloudConfig, OpensteerCloudError, type OpensteerCloudOptions, 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, cloudSessionContractVersion, cloudUnsupportedMethodError, 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, resolveCounterElement, resolveCountersBatch, resolveElementPath, resolveNamespaceDir, sanitizeElementPath, serializePageHTML, setCookie, switchTab, typeText, waitForVisualStability };
package/dist/index.d.ts CHANGED
@@ -122,19 +122,21 @@ interface OpensteerBrowserConfig {
122
122
  interface OpensteerStorageConfig {
123
123
  rootDir?: string;
124
124
  }
125
- type OpensteerMode = 'local' | 'remote';
126
125
  type OpensteerAuthScheme = 'api-key' | 'bearer';
127
- interface OpensteerRemoteOptions {
126
+ type OpensteerCloudAnnouncePolicy = 'always' | 'off' | 'tty';
127
+ interface OpensteerCloudOptions {
128
128
  apiKey?: string;
129
129
  baseUrl?: string;
130
+ appUrl?: string;
130
131
  authScheme?: OpensteerAuthScheme;
132
+ announce?: OpensteerCloudAnnouncePolicy;
131
133
  }
134
+ type OpensteerCloudConfig = boolean | OpensteerCloudOptions;
132
135
  interface OpensteerConfig {
133
136
  name?: string;
134
137
  browser?: OpensteerBrowserConfig;
135
138
  storage?: OpensteerStorageConfig;
136
- mode?: OpensteerMode;
137
- remote?: OpensteerRemoteOptions;
139
+ cloud?: OpensteerCloudConfig;
138
140
  model?: string;
139
141
  debug?: boolean;
140
142
  }
@@ -305,7 +307,7 @@ declare class Opensteer {
305
307
  private readonly namespace;
306
308
  private readonly storage;
307
309
  private readonly pool;
308
- private readonly remote;
310
+ private readonly cloud;
309
311
  private browser;
310
312
  private pageRef;
311
313
  private contextRef;
@@ -314,16 +316,19 @@ declare class Opensteer {
314
316
  constructor(config?: OpensteerConfig);
315
317
  private createLazyResolveCallback;
316
318
  private createLazyExtractCallback;
317
- private invokeRemoteActionAndResetCache;
318
- private invokeRemoteAction;
319
+ private invokeCloudActionAndResetCache;
320
+ private invokeCloudAction;
319
321
  private buildActionError;
320
322
  get page(): Page;
321
323
  get context(): BrowserContext;
322
- getRemoteSessionId(): string | null;
324
+ getCloudSessionId(): string | null;
325
+ getCloudSessionUrl(): string | null;
326
+ private announceCloudSession;
327
+ private shouldAnnounceCloudSession;
323
328
  launch(options?: LaunchOptions): Promise<void>;
324
329
  static from(page: Page, config?: OpensteerConfig): Opensteer;
325
330
  close(): Promise<void>;
326
- private syncLocalSelectorCacheToRemote;
331
+ private syncLocalSelectorCacheToCloud;
327
332
  goto(url: string, options?: GotoOptions): Promise<void>;
328
333
  snapshot(options?: SnapshotOptions): Promise<string>;
329
334
  state(): Promise<StateResult>;
@@ -606,22 +611,40 @@ interface AiModelConfig {
606
611
  maxTokens?: number | null;
607
612
  }
608
613
 
609
- 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';
610
- 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';
611
- interface RemoteSessionCreateRequest {
614
+ 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';
615
+ 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';
616
+ declare const cloudSessionContractVersion: "v3";
617
+ type CloudSessionContractVersion = typeof cloudSessionContractVersion;
618
+ type CloudSessionSourceType = 'agent-thread' | 'agent-run' | 'local-cloud' | 'manual';
619
+ interface CloudSessionCreateRequest {
620
+ cloudSessionContractVersion: CloudSessionContractVersion;
621
+ sourceType: 'local-cloud';
622
+ clientSessionHint: string;
623
+ localRunId: string;
612
624
  name?: string;
613
625
  model?: string;
614
626
  launchContext?: Record<string, unknown>;
615
627
  }
616
- interface RemoteSessionCreateResponse {
628
+ interface CloudSessionSummary {
629
+ sessionId: string;
630
+ workspaceId: string;
631
+ state: string;
632
+ createdAt: number;
633
+ sourceType: CloudSessionSourceType;
634
+ sourceRef?: string;
635
+ label?: string;
636
+ }
637
+ interface CloudSessionCreateResponse {
617
638
  sessionId: string;
618
639
  actionWsUrl: string;
619
640
  cdpWsUrl: string;
620
641
  actionToken: string;
621
642
  cdpToken: string;
622
643
  expiresAt?: number;
644
+ cloudSessionUrl: string;
645
+ cloudSession: CloudSessionSummary;
623
646
  }
624
- interface RemoteSelectorCacheImportEntry {
647
+ interface CloudSelectorCacheImportEntry {
625
648
  namespace: string;
626
649
  siteOrigin: string;
627
650
  method: string;
@@ -631,56 +654,56 @@ interface RemoteSelectorCacheImportEntry {
631
654
  createdAt: number;
632
655
  updatedAt: number;
633
656
  }
634
- interface RemoteSelectorCacheImportRequest {
635
- entries: RemoteSelectorCacheImportEntry[];
657
+ interface CloudSelectorCacheImportRequest {
658
+ entries: CloudSelectorCacheImportEntry[];
636
659
  }
637
- interface RemoteSelectorCacheImportResponse {
660
+ interface CloudSelectorCacheImportResponse {
638
661
  imported: number;
639
662
  inserted: number;
640
663
  updated: number;
641
664
  skipped: number;
642
665
  }
643
- interface RemoteActionRequest {
666
+ interface CloudActionRequest {
644
667
  id: number;
645
- method: RemoteActionMethod;
668
+ method: CloudActionMethod;
646
669
  args: Record<string, unknown>;
647
670
  sessionId: string;
648
671
  token: string;
649
672
  }
650
- interface RemoteActionSuccess {
673
+ interface CloudActionSuccess {
651
674
  id: number;
652
675
  ok: true;
653
676
  result: unknown;
654
677
  }
655
- interface RemoteActionFailure {
678
+ interface CloudActionFailure {
656
679
  id: number;
657
680
  ok: false;
658
681
  error: string;
659
- code: RemoteErrorCode;
660
- details?: RemoteActionFailureDetails;
682
+ code: CloudErrorCode;
683
+ details?: CloudActionFailureDetails;
661
684
  }
662
- type RemoteActionResponse = RemoteActionSuccess | RemoteActionFailure;
663
- interface RemoteActionFailureDetails {
685
+ type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
686
+ interface CloudActionFailureDetails {
664
687
  actionFailure?: ActionFailure;
665
688
  }
666
689
 
667
- declare class OpensteerRemoteError extends Error {
668
- readonly code: RemoteErrorCode | 'REMOTE_TRANSPORT_ERROR';
690
+ declare class OpensteerCloudError extends Error {
691
+ readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
669
692
  readonly status?: number;
670
- readonly details?: RemoteActionFailureDetails | Record<string, unknown>;
671
- constructor(code: RemoteErrorCode | 'REMOTE_TRANSPORT_ERROR', message: string, status?: number, details?: RemoteActionFailureDetails | Record<string, unknown>);
693
+ readonly details?: CloudActionFailureDetails | Record<string, unknown>;
694
+ constructor(code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR', message: string, status?: number, details?: CloudActionFailureDetails | Record<string, unknown>);
672
695
  }
673
- declare function remoteUnsupportedMethodError(method: string, message?: string): OpensteerRemoteError;
674
- declare function remoteNotLaunchedError(): OpensteerRemoteError;
696
+ declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
697
+ declare function cloudNotLaunchedError(): OpensteerCloudError;
675
698
 
676
- declare class RemoteSessionClient {
699
+ declare class CloudSessionClient {
677
700
  private readonly baseUrl;
678
701
  private readonly key;
679
702
  private readonly authScheme;
680
703
  constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
681
- create(request: RemoteSessionCreateRequest): Promise<RemoteSessionCreateResponse>;
704
+ create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
682
705
  close(sessionId: string): Promise<void>;
683
- importSelectorCache(request: RemoteSelectorCacheImportRequest): Promise<RemoteSelectorCacheImportResponse>;
706
+ importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
684
707
  private importSelectorCacheBatch;
685
708
  private authHeaders;
686
709
  }
@@ -699,25 +722,25 @@ declare class ActionWsClient {
699
722
  private closed;
700
723
  private constructor();
701
724
  static connect(options: ActionWsClientOptions): Promise<ActionWsClient>;
702
- request<T>(method: RemoteActionMethod, args: Record<string, unknown>): Promise<T>;
725
+ request<T>(method: CloudActionMethod, args: Record<string, unknown>): Promise<T>;
703
726
  close(): Promise<void>;
704
727
  private handleMessage;
705
728
  private rejectAll;
706
729
  }
707
730
 
708
- interface RemoteCdpConnectArgs {
731
+ interface CloudCdpConnectArgs {
709
732
  wsUrl: string;
710
733
  token: string;
711
734
  }
712
- interface RemoteCdpConnection {
735
+ interface CloudCdpConnection {
713
736
  browser: Browser;
714
737
  context: BrowserContext;
715
738
  page: Page;
716
739
  }
717
- declare class RemoteCdpClient {
718
- connect(args: RemoteCdpConnectArgs): Promise<RemoteCdpConnection>;
740
+ declare class CloudCdpClient {
741
+ connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
719
742
  }
720
743
 
721
- declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): RemoteSelectorCacheImportEntry[];
744
+ declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): CloudSelectorCacheImportEntry[];
722
745
 
723
- 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 OpensteerAuthScheme, 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 };
746
+ 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 CloudActionFailure, type CloudActionFailureDetails, type CloudActionMethod, type CloudActionRequest, type CloudActionResponse, type CloudActionSuccess, CloudCdpClient, type CloudCdpConnectArgs, type CloudCdpConnection, type CloudErrorCode, type CloudSelectorCacheImportEntry, type CloudSelectorCacheImportRequest, type CloudSelectorCacheImportResponse, CloudSessionClient, type CloudSessionContractVersion, type CloudSessionCreateRequest, type CloudSessionCreateResponse, type CloudSessionSourceType, type CloudSessionSummary, 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 OpensteerAuthScheme, type OpensteerBrowserConfig, type OpensteerCloudAnnouncePolicy, type OpensteerCloudConfig, OpensteerCloudError, type OpensteerCloudOptions, 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, cloudSessionContractVersion, cloudUnsupportedMethodError, 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, resolveCounterElement, resolveCountersBatch, resolveElementPath, resolveNamespaceDir, sanitizeElementPath, serializePageHTML, setCookie, switchTab, typeText, waitForVisualStability };
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  ActionWsClient,
3
+ CloudCdpClient,
4
+ CloudSessionClient,
3
5
  CounterResolutionError,
4
6
  ElementPathError,
5
7
  LocalSelectorStorage,
@@ -13,9 +15,7 @@ import {
13
15
  OS_UNAVAILABLE_ATTR,
14
16
  Opensteer,
15
17
  OpensteerActionError,
16
- OpensteerRemoteError,
17
- RemoteCdpClient,
18
- RemoteSessionClient,
18
+ OpensteerCloudError,
19
19
  buildElementPathFromHandle,
20
20
  buildElementPathFromSelector,
21
21
  buildPathSelectorHint,
@@ -27,6 +27,9 @@ import {
27
27
  clearCookies,
28
28
  cloneElementPath,
29
29
  closeTab,
30
+ cloudNotLaunchedError,
31
+ cloudSessionContractVersion,
32
+ cloudUnsupportedMethodError,
30
33
  collectLocalSelectorCacheEntries,
31
34
  countArrayItemsWithPath,
32
35
  createEmptyRegistry,
@@ -55,8 +58,6 @@ import {
55
58
  performSelect,
56
59
  prepareSnapshot,
57
60
  pressKey,
58
- remoteNotLaunchedError,
59
- remoteUnsupportedMethodError,
60
61
  resolveCounterElement,
61
62
  resolveCountersBatch,
62
63
  resolveElementPath,
@@ -67,7 +68,7 @@ import {
67
68
  switchTab,
68
69
  typeText,
69
70
  waitForVisualStability
70
- } from "./chunk-MGZ3QEYT.js";
71
+ } from "./chunk-GQ7HNCM2.js";
71
72
  import {
72
73
  createResolveCallback
73
74
  } from "./chunk-SRJLH34D.js";
@@ -80,6 +81,8 @@ import {
80
81
  } from "./chunk-L4FHT64T.js";
81
82
  export {
82
83
  ActionWsClient,
84
+ CloudCdpClient,
85
+ CloudSessionClient,
83
86
  CounterResolutionError,
84
87
  ElementPathError,
85
88
  LocalSelectorStorage,
@@ -93,9 +96,7 @@ export {
93
96
  OS_UNAVAILABLE_ATTR,
94
97
  Opensteer,
95
98
  OpensteerActionError,
96
- OpensteerRemoteError,
97
- RemoteCdpClient,
98
- RemoteSessionClient,
99
+ OpensteerCloudError,
99
100
  buildElementPathFromHandle,
100
101
  buildElementPathFromSelector,
101
102
  buildPathSelectorHint,
@@ -107,6 +108,9 @@ export {
107
108
  clearCookies,
108
109
  cloneElementPath,
109
110
  closeTab,
111
+ cloudNotLaunchedError,
112
+ cloudSessionContractVersion,
113
+ cloudUnsupportedMethodError,
110
114
  collectLocalSelectorCacheEntries,
111
115
  countArrayItemsWithPath,
112
116
  createEmptyRegistry,
@@ -138,8 +142,6 @@ export {
138
142
  performSelect,
139
143
  prepareSnapshot,
140
144
  pressKey,
141
- remoteNotLaunchedError,
142
- remoteUnsupportedMethodError,
143
145
  resolveCounterElement,
144
146
  resolveCountersBatch,
145
147
  resolveElementPath,