opensteer 0.4.5 → 0.4.7
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 +4 -3
- package/README.md +4 -4
- package/bin/opensteer.mjs +5 -6
- package/dist/{chunk-2NKR4JZ6.js → chunk-PIJI7FBH.js} +1121 -308
- package/dist/cli/server.cjs +1117 -304
- package/dist/cli/server.js +3 -2
- package/dist/index.cjs +1127 -313
- package/dist/index.d.cts +69 -42
- package/dist/index.d.ts +69 -42
- package/dist/index.js +13 -11
- package/package.json +73 -80
package/dist/index.d.cts
CHANGED
|
@@ -122,17 +122,21 @@ interface OpensteerBrowserConfig {
|
|
|
122
122
|
interface OpensteerStorageConfig {
|
|
123
123
|
rootDir?: string;
|
|
124
124
|
}
|
|
125
|
-
type
|
|
126
|
-
|
|
125
|
+
type OpensteerAuthScheme = 'api-key' | 'bearer';
|
|
126
|
+
type OpensteerCloudAnnouncePolicy = 'always' | 'off' | 'tty';
|
|
127
|
+
interface OpensteerCloudOptions {
|
|
127
128
|
apiKey?: string;
|
|
128
129
|
baseUrl?: string;
|
|
130
|
+
appUrl?: string;
|
|
131
|
+
authScheme?: OpensteerAuthScheme;
|
|
132
|
+
announce?: OpensteerCloudAnnouncePolicy;
|
|
129
133
|
}
|
|
134
|
+
type OpensteerCloudConfig = boolean | OpensteerCloudOptions;
|
|
130
135
|
interface OpensteerConfig {
|
|
131
136
|
name?: string;
|
|
132
137
|
browser?: OpensteerBrowserConfig;
|
|
133
138
|
storage?: OpensteerStorageConfig;
|
|
134
|
-
|
|
135
|
-
remote?: OpensteerRemoteOptions;
|
|
139
|
+
cloud?: OpensteerCloudConfig;
|
|
136
140
|
model?: string;
|
|
137
141
|
debug?: boolean;
|
|
138
142
|
}
|
|
@@ -303,7 +307,7 @@ declare class Opensteer {
|
|
|
303
307
|
private readonly namespace;
|
|
304
308
|
private readonly storage;
|
|
305
309
|
private readonly pool;
|
|
306
|
-
private readonly
|
|
310
|
+
private readonly cloud;
|
|
307
311
|
private browser;
|
|
308
312
|
private pageRef;
|
|
309
313
|
private contextRef;
|
|
@@ -312,16 +316,19 @@ declare class Opensteer {
|
|
|
312
316
|
constructor(config?: OpensteerConfig);
|
|
313
317
|
private createLazyResolveCallback;
|
|
314
318
|
private createLazyExtractCallback;
|
|
315
|
-
private
|
|
316
|
-
private
|
|
319
|
+
private invokeCloudActionAndResetCache;
|
|
320
|
+
private invokeCloudAction;
|
|
317
321
|
private buildActionError;
|
|
318
322
|
get page(): Page;
|
|
319
323
|
get context(): BrowserContext;
|
|
320
|
-
|
|
324
|
+
getCloudSessionId(): string | null;
|
|
325
|
+
getCloudSessionUrl(): string | null;
|
|
326
|
+
private announceCloudSession;
|
|
327
|
+
private shouldAnnounceCloudSession;
|
|
321
328
|
launch(options?: LaunchOptions): Promise<void>;
|
|
322
329
|
static from(page: Page, config?: OpensteerConfig): Opensteer;
|
|
323
330
|
close(): Promise<void>;
|
|
324
|
-
private
|
|
331
|
+
private syncLocalSelectorCacheToCloud;
|
|
325
332
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
326
333
|
snapshot(options?: SnapshotOptions): Promise<string>;
|
|
327
334
|
state(): Promise<StateResult>;
|
|
@@ -604,22 +611,40 @@ interface AiModelConfig {
|
|
|
604
611
|
maxTokens?: number | null;
|
|
605
612
|
}
|
|
606
613
|
|
|
607
|
-
type
|
|
608
|
-
type
|
|
609
|
-
|
|
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;
|
|
610
624
|
name?: string;
|
|
611
625
|
model?: string;
|
|
612
626
|
launchContext?: Record<string, unknown>;
|
|
613
627
|
}
|
|
614
|
-
interface
|
|
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 {
|
|
615
638
|
sessionId: string;
|
|
616
639
|
actionWsUrl: string;
|
|
617
640
|
cdpWsUrl: string;
|
|
618
641
|
actionToken: string;
|
|
619
642
|
cdpToken: string;
|
|
620
643
|
expiresAt?: number;
|
|
644
|
+
cloudSessionUrl: string;
|
|
645
|
+
cloudSession: CloudSessionSummary;
|
|
621
646
|
}
|
|
622
|
-
interface
|
|
647
|
+
interface CloudSelectorCacheImportEntry {
|
|
623
648
|
namespace: string;
|
|
624
649
|
siteOrigin: string;
|
|
625
650
|
method: string;
|
|
@@ -629,56 +654,58 @@ interface RemoteSelectorCacheImportEntry {
|
|
|
629
654
|
createdAt: number;
|
|
630
655
|
updatedAt: number;
|
|
631
656
|
}
|
|
632
|
-
interface
|
|
633
|
-
entries:
|
|
657
|
+
interface CloudSelectorCacheImportRequest {
|
|
658
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
634
659
|
}
|
|
635
|
-
interface
|
|
660
|
+
interface CloudSelectorCacheImportResponse {
|
|
636
661
|
imported: number;
|
|
637
662
|
inserted: number;
|
|
638
663
|
updated: number;
|
|
639
664
|
skipped: number;
|
|
640
665
|
}
|
|
641
|
-
interface
|
|
666
|
+
interface CloudActionRequest {
|
|
642
667
|
id: number;
|
|
643
|
-
method:
|
|
668
|
+
method: CloudActionMethod;
|
|
644
669
|
args: Record<string, unknown>;
|
|
645
670
|
sessionId: string;
|
|
646
671
|
token: string;
|
|
647
672
|
}
|
|
648
|
-
interface
|
|
673
|
+
interface CloudActionSuccess {
|
|
649
674
|
id: number;
|
|
650
675
|
ok: true;
|
|
651
676
|
result: unknown;
|
|
652
677
|
}
|
|
653
|
-
interface
|
|
678
|
+
interface CloudActionFailure {
|
|
654
679
|
id: number;
|
|
655
680
|
ok: false;
|
|
656
681
|
error: string;
|
|
657
|
-
code:
|
|
658
|
-
details?:
|
|
682
|
+
code: CloudErrorCode;
|
|
683
|
+
details?: CloudActionFailureDetails;
|
|
659
684
|
}
|
|
660
|
-
type
|
|
661
|
-
interface
|
|
685
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
686
|
+
interface CloudActionFailureDetails {
|
|
662
687
|
actionFailure?: ActionFailure;
|
|
663
688
|
}
|
|
664
689
|
|
|
665
|
-
declare class
|
|
666
|
-
readonly code:
|
|
690
|
+
declare class OpensteerCloudError extends Error {
|
|
691
|
+
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
667
692
|
readonly status?: number;
|
|
668
|
-
readonly details?:
|
|
669
|
-
constructor(code:
|
|
693
|
+
readonly details?: CloudActionFailureDetails | Record<string, unknown>;
|
|
694
|
+
constructor(code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR', message: string, status?: number, details?: CloudActionFailureDetails | Record<string, unknown>);
|
|
670
695
|
}
|
|
671
|
-
declare function
|
|
672
|
-
declare function
|
|
696
|
+
declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
|
|
697
|
+
declare function cloudNotLaunchedError(): OpensteerCloudError;
|
|
673
698
|
|
|
674
|
-
declare class
|
|
699
|
+
declare class CloudSessionClient {
|
|
675
700
|
private readonly baseUrl;
|
|
676
701
|
private readonly key;
|
|
677
|
-
|
|
678
|
-
|
|
702
|
+
private readonly authScheme;
|
|
703
|
+
constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
|
|
704
|
+
create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
|
|
679
705
|
close(sessionId: string): Promise<void>;
|
|
680
|
-
importSelectorCache(request:
|
|
706
|
+
importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
|
|
681
707
|
private importSelectorCacheBatch;
|
|
708
|
+
private authHeaders;
|
|
682
709
|
}
|
|
683
710
|
|
|
684
711
|
interface ActionWsClientOptions {
|
|
@@ -695,25 +722,25 @@ declare class ActionWsClient {
|
|
|
695
722
|
private closed;
|
|
696
723
|
private constructor();
|
|
697
724
|
static connect(options: ActionWsClientOptions): Promise<ActionWsClient>;
|
|
698
|
-
request<T>(method:
|
|
725
|
+
request<T>(method: CloudActionMethod, args: Record<string, unknown>): Promise<T>;
|
|
699
726
|
close(): Promise<void>;
|
|
700
727
|
private handleMessage;
|
|
701
728
|
private rejectAll;
|
|
702
729
|
}
|
|
703
730
|
|
|
704
|
-
interface
|
|
731
|
+
interface CloudCdpConnectArgs {
|
|
705
732
|
wsUrl: string;
|
|
706
733
|
token: string;
|
|
707
734
|
}
|
|
708
|
-
interface
|
|
735
|
+
interface CloudCdpConnection {
|
|
709
736
|
browser: Browser;
|
|
710
737
|
context: BrowserContext;
|
|
711
738
|
page: Page;
|
|
712
739
|
}
|
|
713
|
-
declare class
|
|
714
|
-
connect(args:
|
|
740
|
+
declare class CloudCdpClient {
|
|
741
|
+
connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
|
|
715
742
|
}
|
|
716
743
|
|
|
717
|
-
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage):
|
|
744
|
+
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): CloudSelectorCacheImportEntry[];
|
|
718
745
|
|
|
719
|
-
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
|
|
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,17 +122,21 @@ interface OpensteerBrowserConfig {
|
|
|
122
122
|
interface OpensteerStorageConfig {
|
|
123
123
|
rootDir?: string;
|
|
124
124
|
}
|
|
125
|
-
type
|
|
126
|
-
|
|
125
|
+
type OpensteerAuthScheme = 'api-key' | 'bearer';
|
|
126
|
+
type OpensteerCloudAnnouncePolicy = 'always' | 'off' | 'tty';
|
|
127
|
+
interface OpensteerCloudOptions {
|
|
127
128
|
apiKey?: string;
|
|
128
129
|
baseUrl?: string;
|
|
130
|
+
appUrl?: string;
|
|
131
|
+
authScheme?: OpensteerAuthScheme;
|
|
132
|
+
announce?: OpensteerCloudAnnouncePolicy;
|
|
129
133
|
}
|
|
134
|
+
type OpensteerCloudConfig = boolean | OpensteerCloudOptions;
|
|
130
135
|
interface OpensteerConfig {
|
|
131
136
|
name?: string;
|
|
132
137
|
browser?: OpensteerBrowserConfig;
|
|
133
138
|
storage?: OpensteerStorageConfig;
|
|
134
|
-
|
|
135
|
-
remote?: OpensteerRemoteOptions;
|
|
139
|
+
cloud?: OpensteerCloudConfig;
|
|
136
140
|
model?: string;
|
|
137
141
|
debug?: boolean;
|
|
138
142
|
}
|
|
@@ -303,7 +307,7 @@ declare class Opensteer {
|
|
|
303
307
|
private readonly namespace;
|
|
304
308
|
private readonly storage;
|
|
305
309
|
private readonly pool;
|
|
306
|
-
private readonly
|
|
310
|
+
private readonly cloud;
|
|
307
311
|
private browser;
|
|
308
312
|
private pageRef;
|
|
309
313
|
private contextRef;
|
|
@@ -312,16 +316,19 @@ declare class Opensteer {
|
|
|
312
316
|
constructor(config?: OpensteerConfig);
|
|
313
317
|
private createLazyResolveCallback;
|
|
314
318
|
private createLazyExtractCallback;
|
|
315
|
-
private
|
|
316
|
-
private
|
|
319
|
+
private invokeCloudActionAndResetCache;
|
|
320
|
+
private invokeCloudAction;
|
|
317
321
|
private buildActionError;
|
|
318
322
|
get page(): Page;
|
|
319
323
|
get context(): BrowserContext;
|
|
320
|
-
|
|
324
|
+
getCloudSessionId(): string | null;
|
|
325
|
+
getCloudSessionUrl(): string | null;
|
|
326
|
+
private announceCloudSession;
|
|
327
|
+
private shouldAnnounceCloudSession;
|
|
321
328
|
launch(options?: LaunchOptions): Promise<void>;
|
|
322
329
|
static from(page: Page, config?: OpensteerConfig): Opensteer;
|
|
323
330
|
close(): Promise<void>;
|
|
324
|
-
private
|
|
331
|
+
private syncLocalSelectorCacheToCloud;
|
|
325
332
|
goto(url: string, options?: GotoOptions): Promise<void>;
|
|
326
333
|
snapshot(options?: SnapshotOptions): Promise<string>;
|
|
327
334
|
state(): Promise<StateResult>;
|
|
@@ -604,22 +611,40 @@ interface AiModelConfig {
|
|
|
604
611
|
maxTokens?: number | null;
|
|
605
612
|
}
|
|
606
613
|
|
|
607
|
-
type
|
|
608
|
-
type
|
|
609
|
-
|
|
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;
|
|
610
624
|
name?: string;
|
|
611
625
|
model?: string;
|
|
612
626
|
launchContext?: Record<string, unknown>;
|
|
613
627
|
}
|
|
614
|
-
interface
|
|
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 {
|
|
615
638
|
sessionId: string;
|
|
616
639
|
actionWsUrl: string;
|
|
617
640
|
cdpWsUrl: string;
|
|
618
641
|
actionToken: string;
|
|
619
642
|
cdpToken: string;
|
|
620
643
|
expiresAt?: number;
|
|
644
|
+
cloudSessionUrl: string;
|
|
645
|
+
cloudSession: CloudSessionSummary;
|
|
621
646
|
}
|
|
622
|
-
interface
|
|
647
|
+
interface CloudSelectorCacheImportEntry {
|
|
623
648
|
namespace: string;
|
|
624
649
|
siteOrigin: string;
|
|
625
650
|
method: string;
|
|
@@ -629,56 +654,58 @@ interface RemoteSelectorCacheImportEntry {
|
|
|
629
654
|
createdAt: number;
|
|
630
655
|
updatedAt: number;
|
|
631
656
|
}
|
|
632
|
-
interface
|
|
633
|
-
entries:
|
|
657
|
+
interface CloudSelectorCacheImportRequest {
|
|
658
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
634
659
|
}
|
|
635
|
-
interface
|
|
660
|
+
interface CloudSelectorCacheImportResponse {
|
|
636
661
|
imported: number;
|
|
637
662
|
inserted: number;
|
|
638
663
|
updated: number;
|
|
639
664
|
skipped: number;
|
|
640
665
|
}
|
|
641
|
-
interface
|
|
666
|
+
interface CloudActionRequest {
|
|
642
667
|
id: number;
|
|
643
|
-
method:
|
|
668
|
+
method: CloudActionMethod;
|
|
644
669
|
args: Record<string, unknown>;
|
|
645
670
|
sessionId: string;
|
|
646
671
|
token: string;
|
|
647
672
|
}
|
|
648
|
-
interface
|
|
673
|
+
interface CloudActionSuccess {
|
|
649
674
|
id: number;
|
|
650
675
|
ok: true;
|
|
651
676
|
result: unknown;
|
|
652
677
|
}
|
|
653
|
-
interface
|
|
678
|
+
interface CloudActionFailure {
|
|
654
679
|
id: number;
|
|
655
680
|
ok: false;
|
|
656
681
|
error: string;
|
|
657
|
-
code:
|
|
658
|
-
details?:
|
|
682
|
+
code: CloudErrorCode;
|
|
683
|
+
details?: CloudActionFailureDetails;
|
|
659
684
|
}
|
|
660
|
-
type
|
|
661
|
-
interface
|
|
685
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
686
|
+
interface CloudActionFailureDetails {
|
|
662
687
|
actionFailure?: ActionFailure;
|
|
663
688
|
}
|
|
664
689
|
|
|
665
|
-
declare class
|
|
666
|
-
readonly code:
|
|
690
|
+
declare class OpensteerCloudError extends Error {
|
|
691
|
+
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
667
692
|
readonly status?: number;
|
|
668
|
-
readonly details?:
|
|
669
|
-
constructor(code:
|
|
693
|
+
readonly details?: CloudActionFailureDetails | Record<string, unknown>;
|
|
694
|
+
constructor(code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR', message: string, status?: number, details?: CloudActionFailureDetails | Record<string, unknown>);
|
|
670
695
|
}
|
|
671
|
-
declare function
|
|
672
|
-
declare function
|
|
696
|
+
declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
|
|
697
|
+
declare function cloudNotLaunchedError(): OpensteerCloudError;
|
|
673
698
|
|
|
674
|
-
declare class
|
|
699
|
+
declare class CloudSessionClient {
|
|
675
700
|
private readonly baseUrl;
|
|
676
701
|
private readonly key;
|
|
677
|
-
|
|
678
|
-
|
|
702
|
+
private readonly authScheme;
|
|
703
|
+
constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
|
|
704
|
+
create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
|
|
679
705
|
close(sessionId: string): Promise<void>;
|
|
680
|
-
importSelectorCache(request:
|
|
706
|
+
importSelectorCache(request: CloudSelectorCacheImportRequest): Promise<CloudSelectorCacheImportResponse>;
|
|
681
707
|
private importSelectorCacheBatch;
|
|
708
|
+
private authHeaders;
|
|
682
709
|
}
|
|
683
710
|
|
|
684
711
|
interface ActionWsClientOptions {
|
|
@@ -695,25 +722,25 @@ declare class ActionWsClient {
|
|
|
695
722
|
private closed;
|
|
696
723
|
private constructor();
|
|
697
724
|
static connect(options: ActionWsClientOptions): Promise<ActionWsClient>;
|
|
698
|
-
request<T>(method:
|
|
725
|
+
request<T>(method: CloudActionMethod, args: Record<string, unknown>): Promise<T>;
|
|
699
726
|
close(): Promise<void>;
|
|
700
727
|
private handleMessage;
|
|
701
728
|
private rejectAll;
|
|
702
729
|
}
|
|
703
730
|
|
|
704
|
-
interface
|
|
731
|
+
interface CloudCdpConnectArgs {
|
|
705
732
|
wsUrl: string;
|
|
706
733
|
token: string;
|
|
707
734
|
}
|
|
708
|
-
interface
|
|
735
|
+
interface CloudCdpConnection {
|
|
709
736
|
browser: Browser;
|
|
710
737
|
context: BrowserContext;
|
|
711
738
|
page: Page;
|
|
712
739
|
}
|
|
713
|
-
declare class
|
|
714
|
-
connect(args:
|
|
740
|
+
declare class CloudCdpClient {
|
|
741
|
+
connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
|
|
715
742
|
}
|
|
716
743
|
|
|
717
|
-
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage):
|
|
744
|
+
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage): CloudSelectorCacheImportEntry[];
|
|
718
745
|
|
|
719
|
-
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
|
|
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
|
-
|
|
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-
|
|
71
|
+
} from "./chunk-PIJI7FBH.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
|
-
|
|
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,
|