opensteer 0.4.6 → 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 -3
- package/dist/{chunk-MGZ3QEYT.js → chunk-PIJI7FBH.js} +469 -220
- package/dist/cli/server.cjs +465 -216
- package/dist/cli/server.js +3 -2
- package/dist/index.cjs +475 -225
- package/dist/index.d.cts +64 -41
- package/dist/index.d.ts +64 -41
- package/dist/index.js +13 -11
- package/package.json +73 -80
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
318
|
-
private
|
|
319
|
+
private invokeCloudActionAndResetCache;
|
|
320
|
+
private invokeCloudAction;
|
|
319
321
|
private buildActionError;
|
|
320
322
|
get page(): Page;
|
|
321
323
|
get context(): BrowserContext;
|
|
322
|
-
|
|
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
|
|
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
|
|
610
|
-
type
|
|
611
|
-
|
|
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
|
|
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
|
|
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
|
|
635
|
-
entries:
|
|
657
|
+
interface CloudSelectorCacheImportRequest {
|
|
658
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
636
659
|
}
|
|
637
|
-
interface
|
|
660
|
+
interface CloudSelectorCacheImportResponse {
|
|
638
661
|
imported: number;
|
|
639
662
|
inserted: number;
|
|
640
663
|
updated: number;
|
|
641
664
|
skipped: number;
|
|
642
665
|
}
|
|
643
|
-
interface
|
|
666
|
+
interface CloudActionRequest {
|
|
644
667
|
id: number;
|
|
645
|
-
method:
|
|
668
|
+
method: CloudActionMethod;
|
|
646
669
|
args: Record<string, unknown>;
|
|
647
670
|
sessionId: string;
|
|
648
671
|
token: string;
|
|
649
672
|
}
|
|
650
|
-
interface
|
|
673
|
+
interface CloudActionSuccess {
|
|
651
674
|
id: number;
|
|
652
675
|
ok: true;
|
|
653
676
|
result: unknown;
|
|
654
677
|
}
|
|
655
|
-
interface
|
|
678
|
+
interface CloudActionFailure {
|
|
656
679
|
id: number;
|
|
657
680
|
ok: false;
|
|
658
681
|
error: string;
|
|
659
|
-
code:
|
|
660
|
-
details?:
|
|
682
|
+
code: CloudErrorCode;
|
|
683
|
+
details?: CloudActionFailureDetails;
|
|
661
684
|
}
|
|
662
|
-
type
|
|
663
|
-
interface
|
|
685
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
686
|
+
interface CloudActionFailureDetails {
|
|
664
687
|
actionFailure?: ActionFailure;
|
|
665
688
|
}
|
|
666
689
|
|
|
667
|
-
declare class
|
|
668
|
-
readonly code:
|
|
690
|
+
declare class OpensteerCloudError extends Error {
|
|
691
|
+
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
669
692
|
readonly status?: number;
|
|
670
|
-
readonly details?:
|
|
671
|
-
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>);
|
|
672
695
|
}
|
|
673
|
-
declare function
|
|
674
|
-
declare function
|
|
696
|
+
declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
|
|
697
|
+
declare function cloudNotLaunchedError(): OpensteerCloudError;
|
|
675
698
|
|
|
676
|
-
declare class
|
|
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:
|
|
704
|
+
create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
|
|
682
705
|
close(sessionId: string): Promise<void>;
|
|
683
|
-
importSelectorCache(request:
|
|
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:
|
|
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
|
|
731
|
+
interface CloudCdpConnectArgs {
|
|
709
732
|
wsUrl: string;
|
|
710
733
|
token: string;
|
|
711
734
|
}
|
|
712
|
-
interface
|
|
735
|
+
interface CloudCdpConnection {
|
|
713
736
|
browser: Browser;
|
|
714
737
|
context: BrowserContext;
|
|
715
738
|
page: Page;
|
|
716
739
|
}
|
|
717
|
-
declare class
|
|
718
|
-
connect(args:
|
|
740
|
+
declare class CloudCdpClient {
|
|
741
|
+
connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
|
|
719
742
|
}
|
|
720
743
|
|
|
721
|
-
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage):
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
318
|
-
private
|
|
319
|
+
private invokeCloudActionAndResetCache;
|
|
320
|
+
private invokeCloudAction;
|
|
319
321
|
private buildActionError;
|
|
320
322
|
get page(): Page;
|
|
321
323
|
get context(): BrowserContext;
|
|
322
|
-
|
|
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
|
|
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
|
|
610
|
-
type
|
|
611
|
-
|
|
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
|
|
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
|
|
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
|
|
635
|
-
entries:
|
|
657
|
+
interface CloudSelectorCacheImportRequest {
|
|
658
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
636
659
|
}
|
|
637
|
-
interface
|
|
660
|
+
interface CloudSelectorCacheImportResponse {
|
|
638
661
|
imported: number;
|
|
639
662
|
inserted: number;
|
|
640
663
|
updated: number;
|
|
641
664
|
skipped: number;
|
|
642
665
|
}
|
|
643
|
-
interface
|
|
666
|
+
interface CloudActionRequest {
|
|
644
667
|
id: number;
|
|
645
|
-
method:
|
|
668
|
+
method: CloudActionMethod;
|
|
646
669
|
args: Record<string, unknown>;
|
|
647
670
|
sessionId: string;
|
|
648
671
|
token: string;
|
|
649
672
|
}
|
|
650
|
-
interface
|
|
673
|
+
interface CloudActionSuccess {
|
|
651
674
|
id: number;
|
|
652
675
|
ok: true;
|
|
653
676
|
result: unknown;
|
|
654
677
|
}
|
|
655
|
-
interface
|
|
678
|
+
interface CloudActionFailure {
|
|
656
679
|
id: number;
|
|
657
680
|
ok: false;
|
|
658
681
|
error: string;
|
|
659
|
-
code:
|
|
660
|
-
details?:
|
|
682
|
+
code: CloudErrorCode;
|
|
683
|
+
details?: CloudActionFailureDetails;
|
|
661
684
|
}
|
|
662
|
-
type
|
|
663
|
-
interface
|
|
685
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
686
|
+
interface CloudActionFailureDetails {
|
|
664
687
|
actionFailure?: ActionFailure;
|
|
665
688
|
}
|
|
666
689
|
|
|
667
|
-
declare class
|
|
668
|
-
readonly code:
|
|
690
|
+
declare class OpensteerCloudError extends Error {
|
|
691
|
+
readonly code: CloudErrorCode | 'CLOUD_TRANSPORT_ERROR';
|
|
669
692
|
readonly status?: number;
|
|
670
|
-
readonly details?:
|
|
671
|
-
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>);
|
|
672
695
|
}
|
|
673
|
-
declare function
|
|
674
|
-
declare function
|
|
696
|
+
declare function cloudUnsupportedMethodError(method: string, message?: string): OpensteerCloudError;
|
|
697
|
+
declare function cloudNotLaunchedError(): OpensteerCloudError;
|
|
675
698
|
|
|
676
|
-
declare class
|
|
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:
|
|
704
|
+
create(request: CloudSessionCreateRequest): Promise<CloudSessionCreateResponse>;
|
|
682
705
|
close(sessionId: string): Promise<void>;
|
|
683
|
-
importSelectorCache(request:
|
|
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:
|
|
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
|
|
731
|
+
interface CloudCdpConnectArgs {
|
|
709
732
|
wsUrl: string;
|
|
710
733
|
token: string;
|
|
711
734
|
}
|
|
712
|
-
interface
|
|
735
|
+
interface CloudCdpConnection {
|
|
713
736
|
browser: Browser;
|
|
714
737
|
context: BrowserContext;
|
|
715
738
|
page: Page;
|
|
716
739
|
}
|
|
717
|
-
declare class
|
|
718
|
-
connect(args:
|
|
740
|
+
declare class CloudCdpClient {
|
|
741
|
+
connect(args: CloudCdpConnectArgs): Promise<CloudCdpConnection>;
|
|
719
742
|
}
|
|
720
743
|
|
|
721
|
-
declare function collectLocalSelectorCacheEntries(storage: LocalSelectorStorage):
|
|
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
|
|
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,
|