opensteer 0.6.7 → 0.6.9
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/browser-profile-client-CGXc0-P9.d.cts +228 -0
- package/dist/browser-profile-client-DHLzMf-K.d.ts +228 -0
- package/dist/{chunk-6B6LOYU3.js → chunk-A6LF44E3.js} +1 -1
- package/dist/{chunk-KPPOTU3D.js → chunk-GTT3A3RU.js} +150 -12
- package/dist/{chunk-ACRSRDRN.js → chunk-I66RNYIW.js} +46 -47
- package/dist/{chunk-54KNQTOL.js → chunk-K7DQUSZG.js} +27 -12
- package/dist/cli/auth.cjs +108 -11
- package/dist/cli/auth.js +2 -2
- package/dist/cli/profile.cjs +175 -54
- package/dist/cli/profile.d.cts +1 -1
- package/dist/cli/profile.d.ts +1 -1
- package/dist/cli/profile.js +4 -4
- package/dist/cli/server.cjs +175 -54
- package/dist/cli/server.js +2 -2
- package/dist/index.cjs +194 -54
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -4
- package/package.json +1 -1
- package/skills/opensteer/references/sdk-reference.md +18 -0
- package/dist/browser-profile-client-AGTsLQxT.d.ts +0 -168
- package/dist/browser-profile-client-Biu6DyT6.d.cts +0 -168
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { O as OpensteerAuthScheme } from './types-Cr10igF3.cjs';
|
|
2
|
+
|
|
3
|
+
type ActionFailureCode = 'TARGET_NOT_FOUND' | 'TARGET_UNAVAILABLE' | 'TARGET_STALE' | 'TARGET_AMBIGUOUS' | 'BLOCKED_BY_INTERCEPTOR' | 'NOT_VISIBLE' | 'NOT_ENABLED' | 'NOT_EDITABLE' | 'INVALID_TARGET' | 'INVALID_OPTIONS' | 'ACTION_TIMEOUT' | 'UNKNOWN';
|
|
4
|
+
type ActionFailureClassificationSource = 'typed_error' | 'playwright_call_log' | 'dom_probe' | 'message_heuristic' | 'unknown';
|
|
5
|
+
interface ActionFailureBlocker {
|
|
6
|
+
tag: string;
|
|
7
|
+
id: string | null;
|
|
8
|
+
classes: string[];
|
|
9
|
+
role: string | null;
|
|
10
|
+
text: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface ActionFailureDetails {
|
|
13
|
+
blocker?: ActionFailureBlocker;
|
|
14
|
+
observation?: string;
|
|
15
|
+
}
|
|
16
|
+
interface ActionFailure {
|
|
17
|
+
code: ActionFailureCode;
|
|
18
|
+
message: string;
|
|
19
|
+
retryable: boolean;
|
|
20
|
+
classificationSource: ActionFailureClassificationSource;
|
|
21
|
+
details?: ActionFailureDetails;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const cloudActionMethods: readonly ["goto", "snapshot", "screenshot", "state", "click", "dblclick", "rightclick", "hover", "input", "select", "scroll", "tabs", "newTab", "switchTab", "closeTab", "getCookies", "setCookie", "clearCookies", "pressKey", "type", "getElementText", "getElementValue", "getElementAttributes", "getElementBoundingBox", "getHtml", "getTitle", "uploadFile", "exportCookies", "importCookies", "waitForText", "extract", "extractFromPlan", "clearCache"];
|
|
25
|
+
type CloudActionMethod = (typeof cloudActionMethods)[number];
|
|
26
|
+
declare const cloudErrorCodes: readonly ["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_PROXY_UNAVAILABLE", "CLOUD_PROXY_REQUIRED", "CLOUD_BILLING_LIMIT_REACHED", "CLOUD_RATE_LIMITED", "CLOUD_BROWSER_PROFILE_NOT_FOUND", "CLOUD_BROWSER_PROFILE_BUSY", "CLOUD_BROWSER_PROFILE_DISABLED", "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE", "CLOUD_BROWSER_PROFILE_SYNC_FAILED", "CLOUD_INTERNAL"];
|
|
27
|
+
type CloudErrorCode = (typeof cloudErrorCodes)[number];
|
|
28
|
+
declare const cloudSessionStatuses: readonly ["provisioning", "active", "closing", "closed", "failed"];
|
|
29
|
+
type CloudSessionStatus = (typeof cloudSessionStatuses)[number];
|
|
30
|
+
declare const cloudSessionContractVersion: "v3";
|
|
31
|
+
type CloudSessionContractVersion = typeof cloudSessionContractVersion;
|
|
32
|
+
declare const cloudSessionSourceTypes: readonly ["agent-thread", "agent-run", "project-agent-run", "local-cloud", "manual"];
|
|
33
|
+
type CloudSessionSourceType = (typeof cloudSessionSourceTypes)[number];
|
|
34
|
+
type CloudSessionVisibilityScope = 'team' | 'owner';
|
|
35
|
+
type CloudProxyMode = 'disabled' | 'optional' | 'required';
|
|
36
|
+
type CloudProxyProtocol = 'http' | 'https' | 'socks5';
|
|
37
|
+
type CloudFingerprintMode = 'off' | 'auto';
|
|
38
|
+
type BrowserProfileStatus = 'active' | 'archived' | 'error';
|
|
39
|
+
type BrowserProfileProxyPolicy = 'strict_sticky';
|
|
40
|
+
type BrowserProfileArchiveFormat = 'tar.gz';
|
|
41
|
+
interface CloudViewport {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}
|
|
45
|
+
interface CloudGeolocation {
|
|
46
|
+
latitude: number;
|
|
47
|
+
longitude: number;
|
|
48
|
+
accuracy?: number;
|
|
49
|
+
}
|
|
50
|
+
interface CloudBrowserContextConfig {
|
|
51
|
+
viewport?: CloudViewport;
|
|
52
|
+
locale?: string;
|
|
53
|
+
timezoneId?: string;
|
|
54
|
+
geolocation?: CloudGeolocation;
|
|
55
|
+
colorScheme?: 'light' | 'dark' | 'no-preference';
|
|
56
|
+
userAgent?: string;
|
|
57
|
+
javaScriptEnabled?: boolean;
|
|
58
|
+
ignoreHTTPSErrors?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface CloudBrowserExtensionConfig {
|
|
61
|
+
includeDefaults?: boolean;
|
|
62
|
+
extensionKeys?: string[];
|
|
63
|
+
}
|
|
64
|
+
interface CloudBrowserLaunchConfig {
|
|
65
|
+
headless?: boolean;
|
|
66
|
+
context?: CloudBrowserContextConfig;
|
|
67
|
+
chromeArgs?: string[];
|
|
68
|
+
extensions?: CloudBrowserExtensionConfig;
|
|
69
|
+
}
|
|
70
|
+
interface CloudProxyPreference {
|
|
71
|
+
mode?: CloudProxyMode;
|
|
72
|
+
countryCode?: string;
|
|
73
|
+
region?: string;
|
|
74
|
+
city?: string;
|
|
75
|
+
proxyId?: string;
|
|
76
|
+
}
|
|
77
|
+
interface CloudFingerprintPreference {
|
|
78
|
+
mode?: CloudFingerprintMode;
|
|
79
|
+
locales?: string[];
|
|
80
|
+
minWidth?: number;
|
|
81
|
+
maxWidth?: number;
|
|
82
|
+
minHeight?: number;
|
|
83
|
+
maxHeight?: number;
|
|
84
|
+
slim?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface CloudBrowserProfileLaunchPreference {
|
|
87
|
+
profileId: string;
|
|
88
|
+
reuseIfActive?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface CloudSessionLaunchConfig {
|
|
91
|
+
browser?: CloudBrowserLaunchConfig;
|
|
92
|
+
proxy?: CloudProxyPreference;
|
|
93
|
+
fingerprint?: CloudFingerprintPreference;
|
|
94
|
+
browserProfile?: CloudBrowserProfileLaunchPreference;
|
|
95
|
+
}
|
|
96
|
+
interface CloudSessionCreateRequest {
|
|
97
|
+
cloudSessionContractVersion: CloudSessionContractVersion;
|
|
98
|
+
sourceType: 'local-cloud';
|
|
99
|
+
clientSessionHint: string;
|
|
100
|
+
localRunId: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
model?: string;
|
|
103
|
+
launchContext?: Record<string, unknown>;
|
|
104
|
+
launchConfig?: CloudSessionLaunchConfig;
|
|
105
|
+
}
|
|
106
|
+
interface CloudSessionSummary {
|
|
107
|
+
sessionId: string;
|
|
108
|
+
workspaceId: string;
|
|
109
|
+
state: CloudSessionStatus;
|
|
110
|
+
createdAt: number;
|
|
111
|
+
sourceType: CloudSessionSourceType;
|
|
112
|
+
sourceRef?: string;
|
|
113
|
+
label?: string;
|
|
114
|
+
}
|
|
115
|
+
interface CloudSessionCreateResponse {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
actionWsUrl: string;
|
|
118
|
+
cdpWsUrl: string;
|
|
119
|
+
actionToken: string;
|
|
120
|
+
cdpToken: string;
|
|
121
|
+
expiresAt?: number;
|
|
122
|
+
cloudSessionUrl: string;
|
|
123
|
+
cloudSession: CloudSessionSummary;
|
|
124
|
+
}
|
|
125
|
+
interface CloudSelectorCacheImportEntry {
|
|
126
|
+
namespace: string;
|
|
127
|
+
siteOrigin: string;
|
|
128
|
+
method: string;
|
|
129
|
+
descriptionHash: string;
|
|
130
|
+
path: unknown;
|
|
131
|
+
schemaHash?: string;
|
|
132
|
+
createdAt: number;
|
|
133
|
+
updatedAt: number;
|
|
134
|
+
}
|
|
135
|
+
interface CloudSelectorCacheImportRequest {
|
|
136
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
137
|
+
}
|
|
138
|
+
interface CloudSelectorCacheImportResponse {
|
|
139
|
+
imported: number;
|
|
140
|
+
inserted: number;
|
|
141
|
+
updated: number;
|
|
142
|
+
skipped: number;
|
|
143
|
+
}
|
|
144
|
+
interface CloudActionRequest {
|
|
145
|
+
id: number;
|
|
146
|
+
method: CloudActionMethod;
|
|
147
|
+
args: Record<string, unknown>;
|
|
148
|
+
sessionId: string;
|
|
149
|
+
token: string;
|
|
150
|
+
}
|
|
151
|
+
interface CloudActionSuccess {
|
|
152
|
+
id: number;
|
|
153
|
+
ok: true;
|
|
154
|
+
result: unknown;
|
|
155
|
+
}
|
|
156
|
+
interface CloudActionFailure {
|
|
157
|
+
id: number;
|
|
158
|
+
ok: false;
|
|
159
|
+
error: string;
|
|
160
|
+
code: CloudErrorCode;
|
|
161
|
+
details?: CloudActionFailureDetails;
|
|
162
|
+
}
|
|
163
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
164
|
+
interface CloudActionFailureDetails {
|
|
165
|
+
actionFailure?: ActionFailure;
|
|
166
|
+
}
|
|
167
|
+
interface BrowserProfileDescriptor {
|
|
168
|
+
profileId: string;
|
|
169
|
+
teamId: string;
|
|
170
|
+
ownerUserId: string;
|
|
171
|
+
name: string;
|
|
172
|
+
status: BrowserProfileStatus;
|
|
173
|
+
proxyPolicy: BrowserProfileProxyPolicy;
|
|
174
|
+
stickyProxyId?: string;
|
|
175
|
+
proxyCountryCode?: string;
|
|
176
|
+
proxyRegion?: string;
|
|
177
|
+
proxyCity?: string;
|
|
178
|
+
fingerprintMode: CloudFingerprintMode;
|
|
179
|
+
fingerprintHash?: string;
|
|
180
|
+
activeSessionId?: string;
|
|
181
|
+
lastSessionId?: string;
|
|
182
|
+
lastLaunchedAt?: number;
|
|
183
|
+
latestRevision?: number;
|
|
184
|
+
latestStorageId?: string;
|
|
185
|
+
latestSizeBytes?: number;
|
|
186
|
+
latestArchiveSha256?: string;
|
|
187
|
+
latestArchiveFormat?: BrowserProfileArchiveFormat;
|
|
188
|
+
createdAt: number;
|
|
189
|
+
updatedAt: number;
|
|
190
|
+
lastError?: string;
|
|
191
|
+
}
|
|
192
|
+
interface BrowserProfileListResponse {
|
|
193
|
+
profiles: BrowserProfileDescriptor[];
|
|
194
|
+
nextCursor?: string;
|
|
195
|
+
}
|
|
196
|
+
interface BrowserProfileCreateRequest {
|
|
197
|
+
name: string;
|
|
198
|
+
proxy?: {
|
|
199
|
+
proxyId?: string;
|
|
200
|
+
countryCode?: string;
|
|
201
|
+
region?: string;
|
|
202
|
+
city?: string;
|
|
203
|
+
};
|
|
204
|
+
fingerprint?: {
|
|
205
|
+
mode?: CloudFingerprintMode;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
declare function isCloudActionMethod(value: unknown): value is CloudActionMethod;
|
|
209
|
+
declare function isCloudErrorCode(value: unknown): value is CloudErrorCode;
|
|
210
|
+
declare function isCloudSessionSourceType(value: unknown): value is CloudSessionSourceType;
|
|
211
|
+
declare function isCloudSessionStatus(value: unknown): value is CloudSessionStatus;
|
|
212
|
+
|
|
213
|
+
interface BrowserProfileListRequest {
|
|
214
|
+
cursor?: string;
|
|
215
|
+
limit?: number;
|
|
216
|
+
status?: BrowserProfileStatus;
|
|
217
|
+
}
|
|
218
|
+
declare class BrowserProfileClient {
|
|
219
|
+
private readonly baseUrl;
|
|
220
|
+
private readonly key;
|
|
221
|
+
private readonly authScheme;
|
|
222
|
+
constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
|
|
223
|
+
list(request?: BrowserProfileListRequest): Promise<BrowserProfileListResponse>;
|
|
224
|
+
get(profileId: string): Promise<BrowserProfileDescriptor>;
|
|
225
|
+
create(request: BrowserProfileCreateRequest): Promise<BrowserProfileDescriptor>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { type ActionFailure as A, type BrowserProfileStatus as B, type CloudErrorCode as C, type CloudFingerprintMode as D, type CloudFingerprintPreference as E, type CloudGeolocation as F, type CloudProxyMode as G, type CloudProxyPreference as H, type CloudProxyProtocol as I, type CloudSessionContractVersion as J, type CloudSessionLaunchConfig as K, type CloudSessionSourceType as L, type CloudSessionStatus as M, type CloudSessionSummary as N, type CloudSessionVisibilityScope as O, type CloudViewport as P, cloudActionMethods as Q, cloudErrorCodes as R, cloudSessionContractVersion as S, cloudSessionSourceTypes as T, cloudSessionStatuses as U, isCloudActionMethod as V, isCloudErrorCode as W, isCloudSessionSourceType as X, isCloudSessionStatus as Y, type BrowserProfileListRequest as a, type BrowserProfileListResponse as b, type BrowserProfileCreateRequest as c, type BrowserProfileDescriptor as d, type ActionFailureCode as e, type CloudActionFailureDetails as f, type CloudSessionCreateRequest as g, type CloudSessionCreateResponse as h, type CloudSelectorCacheImportRequest as i, type CloudSelectorCacheImportResponse as j, type CloudActionMethod as k, type CloudSelectorCacheImportEntry as l, type ActionFailureBlocker as m, type ActionFailureClassificationSource as n, type ActionFailureDetails as o, type BrowserProfileArchiveFormat as p, BrowserProfileClient as q, type BrowserProfileProxyPolicy as r, type CloudActionFailure as s, type CloudActionRequest as t, type CloudActionResponse as u, type CloudActionSuccess as v, type CloudBrowserContextConfig as w, type CloudBrowserExtensionConfig as x, type CloudBrowserLaunchConfig as y, type CloudBrowserProfileLaunchPreference as z };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { O as OpensteerAuthScheme } from './types-Cr10igF3.js';
|
|
2
|
+
|
|
3
|
+
type ActionFailureCode = 'TARGET_NOT_FOUND' | 'TARGET_UNAVAILABLE' | 'TARGET_STALE' | 'TARGET_AMBIGUOUS' | 'BLOCKED_BY_INTERCEPTOR' | 'NOT_VISIBLE' | 'NOT_ENABLED' | 'NOT_EDITABLE' | 'INVALID_TARGET' | 'INVALID_OPTIONS' | 'ACTION_TIMEOUT' | 'UNKNOWN';
|
|
4
|
+
type ActionFailureClassificationSource = 'typed_error' | 'playwright_call_log' | 'dom_probe' | 'message_heuristic' | 'unknown';
|
|
5
|
+
interface ActionFailureBlocker {
|
|
6
|
+
tag: string;
|
|
7
|
+
id: string | null;
|
|
8
|
+
classes: string[];
|
|
9
|
+
role: string | null;
|
|
10
|
+
text: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface ActionFailureDetails {
|
|
13
|
+
blocker?: ActionFailureBlocker;
|
|
14
|
+
observation?: string;
|
|
15
|
+
}
|
|
16
|
+
interface ActionFailure {
|
|
17
|
+
code: ActionFailureCode;
|
|
18
|
+
message: string;
|
|
19
|
+
retryable: boolean;
|
|
20
|
+
classificationSource: ActionFailureClassificationSource;
|
|
21
|
+
details?: ActionFailureDetails;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const cloudActionMethods: readonly ["goto", "snapshot", "screenshot", "state", "click", "dblclick", "rightclick", "hover", "input", "select", "scroll", "tabs", "newTab", "switchTab", "closeTab", "getCookies", "setCookie", "clearCookies", "pressKey", "type", "getElementText", "getElementValue", "getElementAttributes", "getElementBoundingBox", "getHtml", "getTitle", "uploadFile", "exportCookies", "importCookies", "waitForText", "extract", "extractFromPlan", "clearCache"];
|
|
25
|
+
type CloudActionMethod = (typeof cloudActionMethods)[number];
|
|
26
|
+
declare const cloudErrorCodes: readonly ["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_PROXY_UNAVAILABLE", "CLOUD_PROXY_REQUIRED", "CLOUD_BILLING_LIMIT_REACHED", "CLOUD_RATE_LIMITED", "CLOUD_BROWSER_PROFILE_NOT_FOUND", "CLOUD_BROWSER_PROFILE_BUSY", "CLOUD_BROWSER_PROFILE_DISABLED", "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE", "CLOUD_BROWSER_PROFILE_SYNC_FAILED", "CLOUD_INTERNAL"];
|
|
27
|
+
type CloudErrorCode = (typeof cloudErrorCodes)[number];
|
|
28
|
+
declare const cloudSessionStatuses: readonly ["provisioning", "active", "closing", "closed", "failed"];
|
|
29
|
+
type CloudSessionStatus = (typeof cloudSessionStatuses)[number];
|
|
30
|
+
declare const cloudSessionContractVersion: "v3";
|
|
31
|
+
type CloudSessionContractVersion = typeof cloudSessionContractVersion;
|
|
32
|
+
declare const cloudSessionSourceTypes: readonly ["agent-thread", "agent-run", "project-agent-run", "local-cloud", "manual"];
|
|
33
|
+
type CloudSessionSourceType = (typeof cloudSessionSourceTypes)[number];
|
|
34
|
+
type CloudSessionVisibilityScope = 'team' | 'owner';
|
|
35
|
+
type CloudProxyMode = 'disabled' | 'optional' | 'required';
|
|
36
|
+
type CloudProxyProtocol = 'http' | 'https' | 'socks5';
|
|
37
|
+
type CloudFingerprintMode = 'off' | 'auto';
|
|
38
|
+
type BrowserProfileStatus = 'active' | 'archived' | 'error';
|
|
39
|
+
type BrowserProfileProxyPolicy = 'strict_sticky';
|
|
40
|
+
type BrowserProfileArchiveFormat = 'tar.gz';
|
|
41
|
+
interface CloudViewport {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}
|
|
45
|
+
interface CloudGeolocation {
|
|
46
|
+
latitude: number;
|
|
47
|
+
longitude: number;
|
|
48
|
+
accuracy?: number;
|
|
49
|
+
}
|
|
50
|
+
interface CloudBrowserContextConfig {
|
|
51
|
+
viewport?: CloudViewport;
|
|
52
|
+
locale?: string;
|
|
53
|
+
timezoneId?: string;
|
|
54
|
+
geolocation?: CloudGeolocation;
|
|
55
|
+
colorScheme?: 'light' | 'dark' | 'no-preference';
|
|
56
|
+
userAgent?: string;
|
|
57
|
+
javaScriptEnabled?: boolean;
|
|
58
|
+
ignoreHTTPSErrors?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface CloudBrowserExtensionConfig {
|
|
61
|
+
includeDefaults?: boolean;
|
|
62
|
+
extensionKeys?: string[];
|
|
63
|
+
}
|
|
64
|
+
interface CloudBrowserLaunchConfig {
|
|
65
|
+
headless?: boolean;
|
|
66
|
+
context?: CloudBrowserContextConfig;
|
|
67
|
+
chromeArgs?: string[];
|
|
68
|
+
extensions?: CloudBrowserExtensionConfig;
|
|
69
|
+
}
|
|
70
|
+
interface CloudProxyPreference {
|
|
71
|
+
mode?: CloudProxyMode;
|
|
72
|
+
countryCode?: string;
|
|
73
|
+
region?: string;
|
|
74
|
+
city?: string;
|
|
75
|
+
proxyId?: string;
|
|
76
|
+
}
|
|
77
|
+
interface CloudFingerprintPreference {
|
|
78
|
+
mode?: CloudFingerprintMode;
|
|
79
|
+
locales?: string[];
|
|
80
|
+
minWidth?: number;
|
|
81
|
+
maxWidth?: number;
|
|
82
|
+
minHeight?: number;
|
|
83
|
+
maxHeight?: number;
|
|
84
|
+
slim?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface CloudBrowserProfileLaunchPreference {
|
|
87
|
+
profileId: string;
|
|
88
|
+
reuseIfActive?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface CloudSessionLaunchConfig {
|
|
91
|
+
browser?: CloudBrowserLaunchConfig;
|
|
92
|
+
proxy?: CloudProxyPreference;
|
|
93
|
+
fingerprint?: CloudFingerprintPreference;
|
|
94
|
+
browserProfile?: CloudBrowserProfileLaunchPreference;
|
|
95
|
+
}
|
|
96
|
+
interface CloudSessionCreateRequest {
|
|
97
|
+
cloudSessionContractVersion: CloudSessionContractVersion;
|
|
98
|
+
sourceType: 'local-cloud';
|
|
99
|
+
clientSessionHint: string;
|
|
100
|
+
localRunId: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
model?: string;
|
|
103
|
+
launchContext?: Record<string, unknown>;
|
|
104
|
+
launchConfig?: CloudSessionLaunchConfig;
|
|
105
|
+
}
|
|
106
|
+
interface CloudSessionSummary {
|
|
107
|
+
sessionId: string;
|
|
108
|
+
workspaceId: string;
|
|
109
|
+
state: CloudSessionStatus;
|
|
110
|
+
createdAt: number;
|
|
111
|
+
sourceType: CloudSessionSourceType;
|
|
112
|
+
sourceRef?: string;
|
|
113
|
+
label?: string;
|
|
114
|
+
}
|
|
115
|
+
interface CloudSessionCreateResponse {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
actionWsUrl: string;
|
|
118
|
+
cdpWsUrl: string;
|
|
119
|
+
actionToken: string;
|
|
120
|
+
cdpToken: string;
|
|
121
|
+
expiresAt?: number;
|
|
122
|
+
cloudSessionUrl: string;
|
|
123
|
+
cloudSession: CloudSessionSummary;
|
|
124
|
+
}
|
|
125
|
+
interface CloudSelectorCacheImportEntry {
|
|
126
|
+
namespace: string;
|
|
127
|
+
siteOrigin: string;
|
|
128
|
+
method: string;
|
|
129
|
+
descriptionHash: string;
|
|
130
|
+
path: unknown;
|
|
131
|
+
schemaHash?: string;
|
|
132
|
+
createdAt: number;
|
|
133
|
+
updatedAt: number;
|
|
134
|
+
}
|
|
135
|
+
interface CloudSelectorCacheImportRequest {
|
|
136
|
+
entries: CloudSelectorCacheImportEntry[];
|
|
137
|
+
}
|
|
138
|
+
interface CloudSelectorCacheImportResponse {
|
|
139
|
+
imported: number;
|
|
140
|
+
inserted: number;
|
|
141
|
+
updated: number;
|
|
142
|
+
skipped: number;
|
|
143
|
+
}
|
|
144
|
+
interface CloudActionRequest {
|
|
145
|
+
id: number;
|
|
146
|
+
method: CloudActionMethod;
|
|
147
|
+
args: Record<string, unknown>;
|
|
148
|
+
sessionId: string;
|
|
149
|
+
token: string;
|
|
150
|
+
}
|
|
151
|
+
interface CloudActionSuccess {
|
|
152
|
+
id: number;
|
|
153
|
+
ok: true;
|
|
154
|
+
result: unknown;
|
|
155
|
+
}
|
|
156
|
+
interface CloudActionFailure {
|
|
157
|
+
id: number;
|
|
158
|
+
ok: false;
|
|
159
|
+
error: string;
|
|
160
|
+
code: CloudErrorCode;
|
|
161
|
+
details?: CloudActionFailureDetails;
|
|
162
|
+
}
|
|
163
|
+
type CloudActionResponse = CloudActionSuccess | CloudActionFailure;
|
|
164
|
+
interface CloudActionFailureDetails {
|
|
165
|
+
actionFailure?: ActionFailure;
|
|
166
|
+
}
|
|
167
|
+
interface BrowserProfileDescriptor {
|
|
168
|
+
profileId: string;
|
|
169
|
+
teamId: string;
|
|
170
|
+
ownerUserId: string;
|
|
171
|
+
name: string;
|
|
172
|
+
status: BrowserProfileStatus;
|
|
173
|
+
proxyPolicy: BrowserProfileProxyPolicy;
|
|
174
|
+
stickyProxyId?: string;
|
|
175
|
+
proxyCountryCode?: string;
|
|
176
|
+
proxyRegion?: string;
|
|
177
|
+
proxyCity?: string;
|
|
178
|
+
fingerprintMode: CloudFingerprintMode;
|
|
179
|
+
fingerprintHash?: string;
|
|
180
|
+
activeSessionId?: string;
|
|
181
|
+
lastSessionId?: string;
|
|
182
|
+
lastLaunchedAt?: number;
|
|
183
|
+
latestRevision?: number;
|
|
184
|
+
latestStorageId?: string;
|
|
185
|
+
latestSizeBytes?: number;
|
|
186
|
+
latestArchiveSha256?: string;
|
|
187
|
+
latestArchiveFormat?: BrowserProfileArchiveFormat;
|
|
188
|
+
createdAt: number;
|
|
189
|
+
updatedAt: number;
|
|
190
|
+
lastError?: string;
|
|
191
|
+
}
|
|
192
|
+
interface BrowserProfileListResponse {
|
|
193
|
+
profiles: BrowserProfileDescriptor[];
|
|
194
|
+
nextCursor?: string;
|
|
195
|
+
}
|
|
196
|
+
interface BrowserProfileCreateRequest {
|
|
197
|
+
name: string;
|
|
198
|
+
proxy?: {
|
|
199
|
+
proxyId?: string;
|
|
200
|
+
countryCode?: string;
|
|
201
|
+
region?: string;
|
|
202
|
+
city?: string;
|
|
203
|
+
};
|
|
204
|
+
fingerprint?: {
|
|
205
|
+
mode?: CloudFingerprintMode;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
declare function isCloudActionMethod(value: unknown): value is CloudActionMethod;
|
|
209
|
+
declare function isCloudErrorCode(value: unknown): value is CloudErrorCode;
|
|
210
|
+
declare function isCloudSessionSourceType(value: unknown): value is CloudSessionSourceType;
|
|
211
|
+
declare function isCloudSessionStatus(value: unknown): value is CloudSessionStatus;
|
|
212
|
+
|
|
213
|
+
interface BrowserProfileListRequest {
|
|
214
|
+
cursor?: string;
|
|
215
|
+
limit?: number;
|
|
216
|
+
status?: BrowserProfileStatus;
|
|
217
|
+
}
|
|
218
|
+
declare class BrowserProfileClient {
|
|
219
|
+
private readonly baseUrl;
|
|
220
|
+
private readonly key;
|
|
221
|
+
private readonly authScheme;
|
|
222
|
+
constructor(baseUrl: string, key: string, authScheme?: OpensteerAuthScheme);
|
|
223
|
+
list(request?: BrowserProfileListRequest): Promise<BrowserProfileListResponse>;
|
|
224
|
+
get(profileId: string): Promise<BrowserProfileDescriptor>;
|
|
225
|
+
create(request: BrowserProfileCreateRequest): Promise<BrowserProfileDescriptor>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { type ActionFailure as A, type BrowserProfileStatus as B, type CloudErrorCode as C, type CloudFingerprintMode as D, type CloudFingerprintPreference as E, type CloudGeolocation as F, type CloudProxyMode as G, type CloudProxyPreference as H, type CloudProxyProtocol as I, type CloudSessionContractVersion as J, type CloudSessionLaunchConfig as K, type CloudSessionSourceType as L, type CloudSessionStatus as M, type CloudSessionSummary as N, type CloudSessionVisibilityScope as O, type CloudViewport as P, cloudActionMethods as Q, cloudErrorCodes as R, cloudSessionContractVersion as S, cloudSessionSourceTypes as T, cloudSessionStatuses as U, isCloudActionMethod as V, isCloudErrorCode as W, isCloudSessionSourceType as X, isCloudSessionStatus as Y, type BrowserProfileListRequest as a, type BrowserProfileListResponse as b, type BrowserProfileCreateRequest as c, type BrowserProfileDescriptor as d, type ActionFailureCode as e, type CloudActionFailureDetails as f, type CloudSessionCreateRequest as g, type CloudSessionCreateResponse as h, type CloudSelectorCacheImportRequest as i, type CloudSelectorCacheImportResponse as j, type CloudActionMethod as k, type CloudSelectorCacheImportEntry as l, type ActionFailureBlocker as m, type ActionFailureClassificationSource as n, type ActionFailureDetails as o, type BrowserProfileArchiveFormat as p, BrowserProfileClient as q, type BrowserProfileProxyPolicy as r, type CloudActionFailure as s, type CloudActionRequest as t, type CloudActionResponse as u, type CloudActionSuccess as v, type CloudBrowserContextConfig as w, type CloudBrowserExtensionConfig as x, type CloudBrowserLaunchConfig as y, type CloudBrowserProfileLaunchPreference as z };
|
|
@@ -890,6 +890,101 @@ function getCallerFilePath() {
|
|
|
890
890
|
return null;
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
+
// src/cloud/contracts.ts
|
|
894
|
+
var cloudActionMethods = [
|
|
895
|
+
"goto",
|
|
896
|
+
"snapshot",
|
|
897
|
+
"screenshot",
|
|
898
|
+
"state",
|
|
899
|
+
"click",
|
|
900
|
+
"dblclick",
|
|
901
|
+
"rightclick",
|
|
902
|
+
"hover",
|
|
903
|
+
"input",
|
|
904
|
+
"select",
|
|
905
|
+
"scroll",
|
|
906
|
+
"tabs",
|
|
907
|
+
"newTab",
|
|
908
|
+
"switchTab",
|
|
909
|
+
"closeTab",
|
|
910
|
+
"getCookies",
|
|
911
|
+
"setCookie",
|
|
912
|
+
"clearCookies",
|
|
913
|
+
"pressKey",
|
|
914
|
+
"type",
|
|
915
|
+
"getElementText",
|
|
916
|
+
"getElementValue",
|
|
917
|
+
"getElementAttributes",
|
|
918
|
+
"getElementBoundingBox",
|
|
919
|
+
"getHtml",
|
|
920
|
+
"getTitle",
|
|
921
|
+
"uploadFile",
|
|
922
|
+
"exportCookies",
|
|
923
|
+
"importCookies",
|
|
924
|
+
"waitForText",
|
|
925
|
+
"extract",
|
|
926
|
+
"extractFromPlan",
|
|
927
|
+
"clearCache"
|
|
928
|
+
];
|
|
929
|
+
var cloudErrorCodes = [
|
|
930
|
+
"CLOUD_AUTH_FAILED",
|
|
931
|
+
"CLOUD_SESSION_NOT_FOUND",
|
|
932
|
+
"CLOUD_SESSION_CLOSED",
|
|
933
|
+
"CLOUD_UNSUPPORTED_METHOD",
|
|
934
|
+
"CLOUD_INVALID_REQUEST",
|
|
935
|
+
"CLOUD_MODEL_NOT_ALLOWED",
|
|
936
|
+
"CLOUD_ACTION_FAILED",
|
|
937
|
+
"CLOUD_CAPACITY_EXHAUSTED",
|
|
938
|
+
"CLOUD_RUNTIME_UNAVAILABLE",
|
|
939
|
+
"CLOUD_RUNTIME_MISMATCH",
|
|
940
|
+
"CLOUD_SESSION_STALE",
|
|
941
|
+
"CLOUD_CONTROL_PLANE_ERROR",
|
|
942
|
+
"CLOUD_CONTRACT_MISMATCH",
|
|
943
|
+
"CLOUD_PROXY_UNAVAILABLE",
|
|
944
|
+
"CLOUD_PROXY_REQUIRED",
|
|
945
|
+
"CLOUD_BILLING_LIMIT_REACHED",
|
|
946
|
+
"CLOUD_RATE_LIMITED",
|
|
947
|
+
"CLOUD_BROWSER_PROFILE_NOT_FOUND",
|
|
948
|
+
"CLOUD_BROWSER_PROFILE_BUSY",
|
|
949
|
+
"CLOUD_BROWSER_PROFILE_DISABLED",
|
|
950
|
+
"CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE",
|
|
951
|
+
"CLOUD_BROWSER_PROFILE_SYNC_FAILED",
|
|
952
|
+
"CLOUD_INTERNAL"
|
|
953
|
+
];
|
|
954
|
+
var cloudSessionStatuses = [
|
|
955
|
+
"provisioning",
|
|
956
|
+
"active",
|
|
957
|
+
"closing",
|
|
958
|
+
"closed",
|
|
959
|
+
"failed"
|
|
960
|
+
];
|
|
961
|
+
var cloudSessionContractVersion = "v3";
|
|
962
|
+
var cloudSessionSourceTypes = [
|
|
963
|
+
"agent-thread",
|
|
964
|
+
"agent-run",
|
|
965
|
+
"project-agent-run",
|
|
966
|
+
"local-cloud",
|
|
967
|
+
"manual"
|
|
968
|
+
];
|
|
969
|
+
var cloudActionMethodSet = new Set(cloudActionMethods);
|
|
970
|
+
var cloudErrorCodeSet = new Set(cloudErrorCodes);
|
|
971
|
+
var cloudSessionSourceTypeSet = new Set(
|
|
972
|
+
cloudSessionSourceTypes
|
|
973
|
+
);
|
|
974
|
+
var cloudSessionStatusSet = new Set(cloudSessionStatuses);
|
|
975
|
+
function isCloudActionMethod(value) {
|
|
976
|
+
return typeof value === "string" && cloudActionMethodSet.has(value);
|
|
977
|
+
}
|
|
978
|
+
function isCloudErrorCode(value) {
|
|
979
|
+
return typeof value === "string" && cloudErrorCodeSet.has(value);
|
|
980
|
+
}
|
|
981
|
+
function isCloudSessionSourceType(value) {
|
|
982
|
+
return typeof value === "string" && cloudSessionSourceTypeSet.has(value);
|
|
983
|
+
}
|
|
984
|
+
function isCloudSessionStatus(value) {
|
|
985
|
+
return typeof value === "string" && cloudSessionStatusSet.has(value);
|
|
986
|
+
}
|
|
987
|
+
|
|
893
988
|
// src/cloud/errors.ts
|
|
894
989
|
var OpensteerCloudError = class extends Error {
|
|
895
990
|
code;
|
|
@@ -920,6 +1015,15 @@ function cloudNotLaunchedError() {
|
|
|
920
1015
|
import {
|
|
921
1016
|
chromium
|
|
922
1017
|
} from "playwright";
|
|
1018
|
+
|
|
1019
|
+
// src/cloud/ws-url.ts
|
|
1020
|
+
function withTokenQuery(wsUrl, token) {
|
|
1021
|
+
const url = new URL(wsUrl);
|
|
1022
|
+
url.searchParams.set("token", token);
|
|
1023
|
+
return url.toString();
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// src/cloud/cdp-client.ts
|
|
923
1027
|
var CloudCdpClient = class {
|
|
924
1028
|
async connect(args) {
|
|
925
1029
|
const endpoint = withTokenQuery(args.wsUrl, args.token);
|
|
@@ -974,11 +1078,6 @@ function isInternalOrEmptyUrl(url) {
|
|
|
974
1078
|
if (url === "about:blank") return true;
|
|
975
1079
|
return url.startsWith("chrome://") || url.startsWith("devtools://") || url.startsWith("edge://");
|
|
976
1080
|
}
|
|
977
|
-
function withTokenQuery(wsUrl, token) {
|
|
978
|
-
const url = new URL(wsUrl);
|
|
979
|
-
url.searchParams.set("token", token);
|
|
980
|
-
return url.toString();
|
|
981
|
-
}
|
|
982
1081
|
|
|
983
1082
|
// src/utils/strip-trailing-slashes.ts
|
|
984
1083
|
function stripTrailingSlashes(value) {
|
|
@@ -1015,10 +1114,7 @@ async function parseCloudHttpError(response) {
|
|
|
1015
1114
|
return new OpensteerCloudError(code, message, response.status, body?.details);
|
|
1016
1115
|
}
|
|
1017
1116
|
function toCloudErrorCode(code) {
|
|
1018
|
-
|
|
1019
|
-
return code;
|
|
1020
|
-
}
|
|
1021
|
-
return "CLOUD_TRANSPORT_ERROR";
|
|
1117
|
+
return isCloudErrorCode(code) ? code : "CLOUD_TRANSPORT_ERROR";
|
|
1022
1118
|
}
|
|
1023
1119
|
|
|
1024
1120
|
// src/cloud/session-client.ts
|
|
@@ -1125,7 +1221,12 @@ function parseCreateResponse(body, status) {
|
|
|
1125
1221
|
status,
|
|
1126
1222
|
"cloudSession"
|
|
1127
1223
|
),
|
|
1128
|
-
state:
|
|
1224
|
+
state: requireSessionStatus(
|
|
1225
|
+
cloudSessionRoot,
|
|
1226
|
+
"state",
|
|
1227
|
+
status,
|
|
1228
|
+
"cloudSession"
|
|
1229
|
+
),
|
|
1129
1230
|
createdAt: requireNumber(cloudSessionRoot, "createdAt", status, "cloudSession"),
|
|
1130
1231
|
sourceType: requireSourceType(cloudSessionRoot, "sourceType", status, "cloudSession"),
|
|
1131
1232
|
sourceRef: optionalString(cloudSessionRoot, "sourceRef", status, "cloudSession"),
|
|
@@ -1213,7 +1314,21 @@ function optionalNumber(source, field, status, parent) {
|
|
|
1213
1314
|
}
|
|
1214
1315
|
function requireSourceType(source, field, status, parent) {
|
|
1215
1316
|
const value = source[field];
|
|
1216
|
-
if (value
|
|
1317
|
+
if (isCloudSessionSourceType(value)) {
|
|
1318
|
+
return value;
|
|
1319
|
+
}
|
|
1320
|
+
throw new OpensteerCloudError(
|
|
1321
|
+
"CLOUD_CONTRACT_MISMATCH",
|
|
1322
|
+
`Invalid cloud session create response: ${formatFieldPath(
|
|
1323
|
+
field,
|
|
1324
|
+
parent
|
|
1325
|
+
)} must be one of ${formatAllowedValues(cloudSessionSourceTypes)}.`,
|
|
1326
|
+
status
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
function requireSessionStatus(source, field, status, parent) {
|
|
1330
|
+
const value = source[field];
|
|
1331
|
+
if (isCloudSessionStatus(value)) {
|
|
1217
1332
|
return value;
|
|
1218
1333
|
}
|
|
1219
1334
|
throw new OpensteerCloudError(
|
|
@@ -1221,13 +1336,26 @@ function requireSourceType(source, field, status, parent) {
|
|
|
1221
1336
|
`Invalid cloud session create response: ${formatFieldPath(
|
|
1222
1337
|
field,
|
|
1223
1338
|
parent
|
|
1224
|
-
)} must be one of
|
|
1339
|
+
)} must be one of ${formatAllowedValues(cloudSessionStatuses)}.`,
|
|
1225
1340
|
status
|
|
1226
1341
|
);
|
|
1227
1342
|
}
|
|
1228
1343
|
function formatFieldPath(field, parent) {
|
|
1229
1344
|
return parent ? `"${parent}.${field}"` : `"${field}"`;
|
|
1230
1345
|
}
|
|
1346
|
+
function formatAllowedValues(values) {
|
|
1347
|
+
if (values.length === 0) {
|
|
1348
|
+
return "";
|
|
1349
|
+
}
|
|
1350
|
+
if (values.length === 1) {
|
|
1351
|
+
return `"${values[0]}"`;
|
|
1352
|
+
}
|
|
1353
|
+
if (values.length === 2) {
|
|
1354
|
+
return `"${values[0]}" or "${values[1]}"`;
|
|
1355
|
+
}
|
|
1356
|
+
const quotedValues = values.map((value) => `"${value}"`);
|
|
1357
|
+
return `${quotedValues.slice(0, -1).join(", ")}, or ${quotedValues[quotedValues.length - 1]}`;
|
|
1358
|
+
}
|
|
1231
1359
|
function zeroImportResponse() {
|
|
1232
1360
|
return {
|
|
1233
1361
|
imported: 0,
|
|
@@ -1284,9 +1412,19 @@ export {
|
|
|
1284
1412
|
resolveCloudSelection,
|
|
1285
1413
|
resolveConfigWithEnv,
|
|
1286
1414
|
resolveNamespace,
|
|
1415
|
+
cloudActionMethods,
|
|
1416
|
+
cloudErrorCodes,
|
|
1417
|
+
cloudSessionStatuses,
|
|
1418
|
+
cloudSessionContractVersion,
|
|
1419
|
+
cloudSessionSourceTypes,
|
|
1420
|
+
isCloudActionMethod,
|
|
1421
|
+
isCloudErrorCode,
|
|
1422
|
+
isCloudSessionSourceType,
|
|
1423
|
+
isCloudSessionStatus,
|
|
1287
1424
|
OpensteerCloudError,
|
|
1288
1425
|
cloudUnsupportedMethodError,
|
|
1289
1426
|
cloudNotLaunchedError,
|
|
1427
|
+
withTokenQuery,
|
|
1290
1428
|
CloudCdpClient,
|
|
1291
1429
|
stripTrailingSlashes,
|
|
1292
1430
|
normalizeCloudBaseUrl,
|