opensteer 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  BrowserProfileClient
3
- } from "../chunk-6B6LOYU3.js";
3
+ } from "../chunk-O4HVMKX2.js";
4
4
  import {
5
5
  createKeychainStore,
6
6
  ensureCloudCredentialsForCommand
7
- } from "../chunk-54KNQTOL.js";
7
+ } from "../chunk-UQYVMJOZ.js";
8
8
  import {
9
9
  Opensteer
10
- } from "../chunk-ACRSRDRN.js";
10
+ } from "../chunk-C6AJL5XU.js";
11
11
  import {
12
12
  resolveConfigWithEnv
13
- } from "../chunk-KPPOTU3D.js";
13
+ } from "../chunk-LTREUXLO.js";
14
14
  import {
15
15
  expandHome
16
16
  } from "../chunk-K5CL76MG.js";
@@ -8909,7 +8909,96 @@ function stripPositionClauses2(path5) {
8909
8909
  }
8910
8910
 
8911
8911
  // src/cloud/contracts.ts
8912
+ var cloudActionMethods = [
8913
+ "goto",
8914
+ "snapshot",
8915
+ "screenshot",
8916
+ "state",
8917
+ "click",
8918
+ "dblclick",
8919
+ "rightclick",
8920
+ "hover",
8921
+ "input",
8922
+ "select",
8923
+ "scroll",
8924
+ "tabs",
8925
+ "newTab",
8926
+ "switchTab",
8927
+ "closeTab",
8928
+ "getCookies",
8929
+ "setCookie",
8930
+ "clearCookies",
8931
+ "pressKey",
8932
+ "type",
8933
+ "getElementText",
8934
+ "getElementValue",
8935
+ "getElementAttributes",
8936
+ "getElementBoundingBox",
8937
+ "getHtml",
8938
+ "getTitle",
8939
+ "uploadFile",
8940
+ "exportCookies",
8941
+ "importCookies",
8942
+ "waitForText",
8943
+ "extract",
8944
+ "extractFromPlan",
8945
+ "clearCache"
8946
+ ];
8947
+ var cloudErrorCodes = [
8948
+ "CLOUD_AUTH_FAILED",
8949
+ "CLOUD_SESSION_NOT_FOUND",
8950
+ "CLOUD_SESSION_CLOSED",
8951
+ "CLOUD_UNSUPPORTED_METHOD",
8952
+ "CLOUD_INVALID_REQUEST",
8953
+ "CLOUD_MODEL_NOT_ALLOWED",
8954
+ "CLOUD_ACTION_FAILED",
8955
+ "CLOUD_CAPACITY_EXHAUSTED",
8956
+ "CLOUD_RUNTIME_UNAVAILABLE",
8957
+ "CLOUD_RUNTIME_MISMATCH",
8958
+ "CLOUD_SESSION_STALE",
8959
+ "CLOUD_CONTROL_PLANE_ERROR",
8960
+ "CLOUD_CONTRACT_MISMATCH",
8961
+ "CLOUD_PROXY_UNAVAILABLE",
8962
+ "CLOUD_PROXY_REQUIRED",
8963
+ "CLOUD_BILLING_LIMIT_REACHED",
8964
+ "CLOUD_RATE_LIMITED",
8965
+ "CLOUD_BROWSER_PROFILE_NOT_FOUND",
8966
+ "CLOUD_BROWSER_PROFILE_BUSY",
8967
+ "CLOUD_BROWSER_PROFILE_DISABLED",
8968
+ "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE",
8969
+ "CLOUD_BROWSER_PROFILE_SYNC_FAILED",
8970
+ "CLOUD_INTERNAL"
8971
+ ];
8972
+ var cloudSessionStatuses = [
8973
+ "provisioning",
8974
+ "active",
8975
+ "closing",
8976
+ "closed",
8977
+ "failed"
8978
+ ];
8912
8979
  var cloudSessionContractVersion = "v3";
8980
+ var cloudSessionSourceTypes = [
8981
+ "agent-thread",
8982
+ "agent-run",
8983
+ "project-agent-run",
8984
+ "local-cloud",
8985
+ "manual"
8986
+ ];
8987
+ var cloudActionMethodSet = new Set(cloudActionMethods);
8988
+ var cloudErrorCodeSet = new Set(cloudErrorCodes);
8989
+ var cloudSessionSourceTypeSet = new Set(
8990
+ cloudSessionSourceTypes
8991
+ );
8992
+ var cloudSessionStatusSet = new Set(cloudSessionStatuses);
8993
+ function isCloudErrorCode(value) {
8994
+ return typeof value === "string" && cloudErrorCodeSet.has(value);
8995
+ }
8996
+ function isCloudSessionSourceType(value) {
8997
+ return typeof value === "string" && cloudSessionSourceTypeSet.has(value);
8998
+ }
8999
+ function isCloudSessionStatus(value) {
9000
+ return typeof value === "string" && cloudSessionStatusSet.has(value);
9001
+ }
8913
9002
 
8914
9003
  // src/cloud/action-ws-client.ts
8915
9004
  var import_ws2 = __toESM(require("ws"), 1);
@@ -8940,6 +9029,13 @@ function cloudNotLaunchedError() {
8940
9029
  );
8941
9030
  }
8942
9031
 
9032
+ // src/cloud/ws-url.ts
9033
+ function withTokenQuery(wsUrl, token) {
9034
+ const url = new URL(wsUrl);
9035
+ url.searchParams.set("token", token);
9036
+ return url.toString();
9037
+ }
9038
+
8943
9039
  // src/cloud/action-ws-client.ts
8944
9040
  var ActionWsClient = class _ActionWsClient {
8945
9041
  ws;
@@ -9068,11 +9164,6 @@ function rawDataToUtf8(raw) {
9068
9164
  if (Array.isArray(raw)) return Buffer.concat(raw).toString("utf8");
9069
9165
  return raw.toString("utf8");
9070
9166
  }
9071
- function withTokenQuery(wsUrl, token) {
9072
- const url = new URL(wsUrl);
9073
- url.searchParams.set("token", token);
9074
- return url.toString();
9075
- }
9076
9167
 
9077
9168
  // src/cloud/local-cache-sync.ts
9078
9169
  var import_fs4 = __toESM(require("fs"), 1);
@@ -9212,7 +9303,7 @@ function dedupeNewest(entries) {
9212
9303
  var import_playwright2 = require("playwright");
9213
9304
  var CloudCdpClient = class {
9214
9305
  async connect(args) {
9215
- const endpoint = withTokenQuery2(args.wsUrl, args.token);
9306
+ const endpoint = withTokenQuery(args.wsUrl, args.token);
9216
9307
  let browser;
9217
9308
  try {
9218
9309
  browser = await import_playwright2.chromium.connectOverCDP(endpoint);
@@ -9264,11 +9355,6 @@ function isInternalOrEmptyUrl(url) {
9264
9355
  if (url === "about:blank") return true;
9265
9356
  return url.startsWith("chrome://") || url.startsWith("devtools://") || url.startsWith("edge://");
9266
9357
  }
9267
- function withTokenQuery2(wsUrl, token) {
9268
- const url = new URL(wsUrl);
9269
- url.searchParams.set("token", token);
9270
- return url.toString();
9271
- }
9272
9358
 
9273
9359
  // src/utils/strip-trailing-slashes.ts
9274
9360
  function stripTrailingSlashes(value) {
@@ -9305,10 +9391,7 @@ async function parseCloudHttpError(response) {
9305
9391
  return new OpensteerCloudError(code, message, response.status, body?.details);
9306
9392
  }
9307
9393
  function toCloudErrorCode(code) {
9308
- if (code === "CLOUD_AUTH_FAILED" || code === "CLOUD_SESSION_NOT_FOUND" || code === "CLOUD_SESSION_CLOSED" || code === "CLOUD_UNSUPPORTED_METHOD" || code === "CLOUD_INVALID_REQUEST" || code === "CLOUD_MODEL_NOT_ALLOWED" || code === "CLOUD_ACTION_FAILED" || code === "CLOUD_INTERNAL" || code === "CLOUD_CAPACITY_EXHAUSTED" || code === "CLOUD_RUNTIME_UNAVAILABLE" || code === "CLOUD_RUNTIME_MISMATCH" || code === "CLOUD_SESSION_STALE" || code === "CLOUD_CONTRACT_MISMATCH" || code === "CLOUD_CONTROL_PLANE_ERROR" || code === "CLOUD_PROXY_UNAVAILABLE" || code === "CLOUD_PROXY_REQUIRED" || code === "CLOUD_BILLING_LIMIT_REACHED" || code === "CLOUD_RATE_LIMITED" || code === "CLOUD_BROWSER_PROFILE_NOT_FOUND" || code === "CLOUD_BROWSER_PROFILE_BUSY" || code === "CLOUD_BROWSER_PROFILE_DISABLED" || code === "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE" || code === "CLOUD_BROWSER_PROFILE_SYNC_FAILED") {
9309
- return code;
9310
- }
9311
- return "CLOUD_TRANSPORT_ERROR";
9394
+ return isCloudErrorCode(code) ? code : "CLOUD_TRANSPORT_ERROR";
9312
9395
  }
9313
9396
 
9314
9397
  // src/cloud/session-client.ts
@@ -9415,7 +9498,12 @@ function parseCreateResponse(body, status) {
9415
9498
  status,
9416
9499
  "cloudSession"
9417
9500
  ),
9418
- state: requireString(cloudSessionRoot, "state", status, "cloudSession"),
9501
+ state: requireSessionStatus(
9502
+ cloudSessionRoot,
9503
+ "state",
9504
+ status,
9505
+ "cloudSession"
9506
+ ),
9419
9507
  createdAt: requireNumber(cloudSessionRoot, "createdAt", status, "cloudSession"),
9420
9508
  sourceType: requireSourceType(cloudSessionRoot, "sourceType", status, "cloudSession"),
9421
9509
  sourceRef: optionalString(cloudSessionRoot, "sourceRef", status, "cloudSession"),
@@ -9503,7 +9591,7 @@ function optionalNumber(source, field, status, parent) {
9503
9591
  }
9504
9592
  function requireSourceType(source, field, status, parent) {
9505
9593
  const value = source[field];
9506
- if (value === "agent-thread" || value === "agent-run" || value === "local-cloud" || value === "manual") {
9594
+ if (isCloudSessionSourceType(value)) {
9507
9595
  return value;
9508
9596
  }
9509
9597
  throw new OpensteerCloudError(
@@ -9511,13 +9599,30 @@ function requireSourceType(source, field, status, parent) {
9511
9599
  `Invalid cloud session create response: ${formatFieldPath(
9512
9600
  field,
9513
9601
  parent
9514
- )} must be one of "agent-thread", "agent-run", "local-cloud", or "manual".`,
9602
+ )} must be one of ${formatAllowedValues(cloudSessionSourceTypes)}.`,
9603
+ status
9604
+ );
9605
+ }
9606
+ function requireSessionStatus(source, field, status, parent) {
9607
+ const value = source[field];
9608
+ if (isCloudSessionStatus(value)) {
9609
+ return value;
9610
+ }
9611
+ throw new OpensteerCloudError(
9612
+ "CLOUD_CONTRACT_MISMATCH",
9613
+ `Invalid cloud session create response: ${formatFieldPath(
9614
+ field,
9615
+ parent
9616
+ )} must be one of ${formatAllowedValues(cloudSessionStatuses)}.`,
9515
9617
  status
9516
9618
  );
9517
9619
  }
9518
9620
  function formatFieldPath(field, parent) {
9519
9621
  return parent ? `"${parent}.${field}"` : `"${field}"`;
9520
9622
  }
9623
+ function formatAllowedValues(values) {
9624
+ return values.map((value) => `"${value}"`).join(", ");
9625
+ }
9521
9626
  function zeroImportResponse() {
9522
9627
  return {
9523
9628
  imported: 0,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  Opensteer
3
- } from "../chunk-ACRSRDRN.js";
3
+ } from "../chunk-C6AJL5XU.js";
4
4
  import {
5
5
  normalizeError,
6
6
  resolveCloudSelection,
7
7
  resolveConfigWithEnv
8
- } from "../chunk-KPPOTU3D.js";
8
+ } from "../chunk-LTREUXLO.js";
9
9
  import "../chunk-K5CL76MG.js";
10
10
  import "../chunk-3H5RRIMZ.js";
11
11
 
package/dist/index.cjs CHANGED
@@ -463,8 +463,12 @@ __export(index_exports, {
463
463
  clearPersistentProfileSingletons: () => clearPersistentProfileSingletons,
464
464
  cloneElementPath: () => cloneElementPath,
465
465
  closeTab: () => closeTab,
466
+ cloudActionMethods: () => cloudActionMethods,
467
+ cloudErrorCodes: () => cloudErrorCodes,
466
468
  cloudNotLaunchedError: () => cloudNotLaunchedError,
467
469
  cloudSessionContractVersion: () => cloudSessionContractVersion,
470
+ cloudSessionSourceTypes: () => cloudSessionSourceTypes,
471
+ cloudSessionStatuses: () => cloudSessionStatuses,
468
472
  cloudUnsupportedMethodError: () => cloudUnsupportedMethodError,
469
473
  collectLocalSelectorCacheEntries: () => collectLocalSelectorCacheEntries,
470
474
  countArrayItemsWithPath: () => countArrayItemsWithPath,
@@ -489,6 +493,10 @@ __export(index_exports, {
489
493
  getPageHtml: () => getPageHtml,
490
494
  getPageTitle: () => getPageTitle,
491
495
  importCookies: () => importCookies,
496
+ isCloudActionMethod: () => isCloudActionMethod,
497
+ isCloudErrorCode: () => isCloudErrorCode,
498
+ isCloudSessionSourceType: () => isCloudSessionSourceType,
499
+ isCloudSessionStatus: () => isCloudSessionStatus,
492
500
  listLocalChromeProfiles: () => listLocalChromeProfiles,
493
501
  listTabs: () => listTabs,
494
502
  markInteractiveElements: () => markInteractiveElements,
@@ -9016,7 +9024,99 @@ function stripPositionClauses2(path5) {
9016
9024
  }
9017
9025
 
9018
9026
  // src/cloud/contracts.ts
9027
+ var cloudActionMethods = [
9028
+ "goto",
9029
+ "snapshot",
9030
+ "screenshot",
9031
+ "state",
9032
+ "click",
9033
+ "dblclick",
9034
+ "rightclick",
9035
+ "hover",
9036
+ "input",
9037
+ "select",
9038
+ "scroll",
9039
+ "tabs",
9040
+ "newTab",
9041
+ "switchTab",
9042
+ "closeTab",
9043
+ "getCookies",
9044
+ "setCookie",
9045
+ "clearCookies",
9046
+ "pressKey",
9047
+ "type",
9048
+ "getElementText",
9049
+ "getElementValue",
9050
+ "getElementAttributes",
9051
+ "getElementBoundingBox",
9052
+ "getHtml",
9053
+ "getTitle",
9054
+ "uploadFile",
9055
+ "exportCookies",
9056
+ "importCookies",
9057
+ "waitForText",
9058
+ "extract",
9059
+ "extractFromPlan",
9060
+ "clearCache"
9061
+ ];
9062
+ var cloudErrorCodes = [
9063
+ "CLOUD_AUTH_FAILED",
9064
+ "CLOUD_SESSION_NOT_FOUND",
9065
+ "CLOUD_SESSION_CLOSED",
9066
+ "CLOUD_UNSUPPORTED_METHOD",
9067
+ "CLOUD_INVALID_REQUEST",
9068
+ "CLOUD_MODEL_NOT_ALLOWED",
9069
+ "CLOUD_ACTION_FAILED",
9070
+ "CLOUD_CAPACITY_EXHAUSTED",
9071
+ "CLOUD_RUNTIME_UNAVAILABLE",
9072
+ "CLOUD_RUNTIME_MISMATCH",
9073
+ "CLOUD_SESSION_STALE",
9074
+ "CLOUD_CONTROL_PLANE_ERROR",
9075
+ "CLOUD_CONTRACT_MISMATCH",
9076
+ "CLOUD_PROXY_UNAVAILABLE",
9077
+ "CLOUD_PROXY_REQUIRED",
9078
+ "CLOUD_BILLING_LIMIT_REACHED",
9079
+ "CLOUD_RATE_LIMITED",
9080
+ "CLOUD_BROWSER_PROFILE_NOT_FOUND",
9081
+ "CLOUD_BROWSER_PROFILE_BUSY",
9082
+ "CLOUD_BROWSER_PROFILE_DISABLED",
9083
+ "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE",
9084
+ "CLOUD_BROWSER_PROFILE_SYNC_FAILED",
9085
+ "CLOUD_INTERNAL"
9086
+ ];
9087
+ var cloudSessionStatuses = [
9088
+ "provisioning",
9089
+ "active",
9090
+ "closing",
9091
+ "closed",
9092
+ "failed"
9093
+ ];
9019
9094
  var cloudSessionContractVersion = "v3";
9095
+ var cloudSessionSourceTypes = [
9096
+ "agent-thread",
9097
+ "agent-run",
9098
+ "project-agent-run",
9099
+ "local-cloud",
9100
+ "manual"
9101
+ ];
9102
+ var cloudActionMethodSet = new Set(cloudActionMethods);
9103
+ var cloudErrorCodeSet = new Set(cloudErrorCodes);
9104
+ var cloudSessionSourceTypeSet = new Set(
9105
+ cloudSessionSourceTypes
9106
+ );
9107
+ var cloudSessionStatusSet = new Set(cloudSessionStatuses);
9108
+ function isCloudActionMethod(value) {
9109
+ return typeof value === "string" && cloudActionMethodSet.has(value);
9110
+ }
9111
+ function isCloudErrorCode(value) {
9112
+ return typeof value === "string" && cloudErrorCodeSet.has(value);
9113
+ }
9114
+ function isCloudSessionSourceType(value) {
9115
+ return typeof value === "string" && cloudSessionSourceTypeSet.has(value);
9116
+ }
9117
+ function isCloudSessionStatus(value) {
9118
+ return typeof value === "string" && cloudSessionStatusSet.has(value);
9119
+ }
9020
9120
 
9021
9121
  // src/cloud/action-ws-client.ts
9022
9122
  var import_ws2 = __toESM(require("ws"), 1);
@@ -9047,6 +9147,13 @@ function cloudNotLaunchedError() {
9047
9147
  );
9048
9148
  }
9049
9149
 
9150
+ // src/cloud/ws-url.ts
9151
+ function withTokenQuery(wsUrl, token) {
9152
+ const url = new URL(wsUrl);
9153
+ url.searchParams.set("token", token);
9154
+ return url.toString();
9155
+ }
9156
+
9050
9157
  // src/cloud/action-ws-client.ts
9051
9158
  var ActionWsClient = class _ActionWsClient {
9052
9159
  ws;
@@ -9175,11 +9282,6 @@ function rawDataToUtf8(raw) {
9175
9282
  if (Array.isArray(raw)) return Buffer.concat(raw).toString("utf8");
9176
9283
  return raw.toString("utf8");
9177
9284
  }
9178
- function withTokenQuery(wsUrl, token) {
9179
- const url = new URL(wsUrl);
9180
- url.searchParams.set("token", token);
9181
- return url.toString();
9182
- }
9183
9285
 
9184
9286
  // src/cloud/local-cache-sync.ts
9185
9287
  var import_fs4 = __toESM(require("fs"), 1);
@@ -9319,7 +9421,7 @@ function dedupeNewest(entries) {
9319
9421
  var import_playwright2 = require("playwright");
9320
9422
  var CloudCdpClient = class {
9321
9423
  async connect(args) {
9322
- const endpoint = withTokenQuery2(args.wsUrl, args.token);
9424
+ const endpoint = withTokenQuery(args.wsUrl, args.token);
9323
9425
  let browser;
9324
9426
  try {
9325
9427
  browser = await import_playwright2.chromium.connectOverCDP(endpoint);
@@ -9371,11 +9473,6 @@ function isInternalOrEmptyUrl(url) {
9371
9473
  if (url === "about:blank") return true;
9372
9474
  return url.startsWith("chrome://") || url.startsWith("devtools://") || url.startsWith("edge://");
9373
9475
  }
9374
- function withTokenQuery2(wsUrl, token) {
9375
- const url = new URL(wsUrl);
9376
- url.searchParams.set("token", token);
9377
- return url.toString();
9378
- }
9379
9476
 
9380
9477
  // src/utils/strip-trailing-slashes.ts
9381
9478
  function stripTrailingSlashes(value) {
@@ -9412,10 +9509,7 @@ async function parseCloudHttpError(response) {
9412
9509
  return new OpensteerCloudError(code, message, response.status, body?.details);
9413
9510
  }
9414
9511
  function toCloudErrorCode(code) {
9415
- if (code === "CLOUD_AUTH_FAILED" || code === "CLOUD_SESSION_NOT_FOUND" || code === "CLOUD_SESSION_CLOSED" || code === "CLOUD_UNSUPPORTED_METHOD" || code === "CLOUD_INVALID_REQUEST" || code === "CLOUD_MODEL_NOT_ALLOWED" || code === "CLOUD_ACTION_FAILED" || code === "CLOUD_INTERNAL" || code === "CLOUD_CAPACITY_EXHAUSTED" || code === "CLOUD_RUNTIME_UNAVAILABLE" || code === "CLOUD_RUNTIME_MISMATCH" || code === "CLOUD_SESSION_STALE" || code === "CLOUD_CONTRACT_MISMATCH" || code === "CLOUD_CONTROL_PLANE_ERROR" || code === "CLOUD_PROXY_UNAVAILABLE" || code === "CLOUD_PROXY_REQUIRED" || code === "CLOUD_BILLING_LIMIT_REACHED" || code === "CLOUD_RATE_LIMITED" || code === "CLOUD_BROWSER_PROFILE_NOT_FOUND" || code === "CLOUD_BROWSER_PROFILE_BUSY" || code === "CLOUD_BROWSER_PROFILE_DISABLED" || code === "CLOUD_BROWSER_PROFILE_PROXY_UNAVAILABLE" || code === "CLOUD_BROWSER_PROFILE_SYNC_FAILED") {
9416
- return code;
9417
- }
9418
- return "CLOUD_TRANSPORT_ERROR";
9512
+ return isCloudErrorCode(code) ? code : "CLOUD_TRANSPORT_ERROR";
9419
9513
  }
9420
9514
 
9421
9515
  // src/cloud/session-client.ts
@@ -9522,7 +9616,12 @@ function parseCreateResponse(body, status) {
9522
9616
  status,
9523
9617
  "cloudSession"
9524
9618
  ),
9525
- state: requireString(cloudSessionRoot, "state", status, "cloudSession"),
9619
+ state: requireSessionStatus(
9620
+ cloudSessionRoot,
9621
+ "state",
9622
+ status,
9623
+ "cloudSession"
9624
+ ),
9526
9625
  createdAt: requireNumber(cloudSessionRoot, "createdAt", status, "cloudSession"),
9527
9626
  sourceType: requireSourceType(cloudSessionRoot, "sourceType", status, "cloudSession"),
9528
9627
  sourceRef: optionalString(cloudSessionRoot, "sourceRef", status, "cloudSession"),
@@ -9610,7 +9709,7 @@ function optionalNumber(source, field, status, parent) {
9610
9709
  }
9611
9710
  function requireSourceType(source, field, status, parent) {
9612
9711
  const value = source[field];
9613
- if (value === "agent-thread" || value === "agent-run" || value === "local-cloud" || value === "manual") {
9712
+ if (isCloudSessionSourceType(value)) {
9614
9713
  return value;
9615
9714
  }
9616
9715
  throw new OpensteerCloudError(
@@ -9618,13 +9717,30 @@ function requireSourceType(source, field, status, parent) {
9618
9717
  `Invalid cloud session create response: ${formatFieldPath(
9619
9718
  field,
9620
9719
  parent
9621
- )} must be one of "agent-thread", "agent-run", "local-cloud", or "manual".`,
9720
+ )} must be one of ${formatAllowedValues(cloudSessionSourceTypes)}.`,
9721
+ status
9722
+ );
9723
+ }
9724
+ function requireSessionStatus(source, field, status, parent) {
9725
+ const value = source[field];
9726
+ if (isCloudSessionStatus(value)) {
9727
+ return value;
9728
+ }
9729
+ throw new OpensteerCloudError(
9730
+ "CLOUD_CONTRACT_MISMATCH",
9731
+ `Invalid cloud session create response: ${formatFieldPath(
9732
+ field,
9733
+ parent
9734
+ )} must be one of ${formatAllowedValues(cloudSessionStatuses)}.`,
9622
9735
  status
9623
9736
  );
9624
9737
  }
9625
9738
  function formatFieldPath(field, parent) {
9626
9739
  return parent ? `"${parent}.${field}"` : `"${field}"`;
9627
9740
  }
9741
+ function formatAllowedValues(values) {
9742
+ return values.map((value) => `"${value}"`).join(", ");
9743
+ }
9628
9744
  function zeroImportResponse() {
9629
9745
  return {
9630
9746
  imported: 0,
@@ -15075,8 +15191,12 @@ function sleep7(ms) {
15075
15191
  clearPersistentProfileSingletons,
15076
15192
  cloneElementPath,
15077
15193
  closeTab,
15194
+ cloudActionMethods,
15195
+ cloudErrorCodes,
15078
15196
  cloudNotLaunchedError,
15079
15197
  cloudSessionContractVersion,
15198
+ cloudSessionSourceTypes,
15199
+ cloudSessionStatuses,
15080
15200
  cloudUnsupportedMethodError,
15081
15201
  collectLocalSelectorCacheEntries,
15082
15202
  countArrayItemsWithPath,
@@ -15101,6 +15221,10 @@ function sleep7(ms) {
15101
15221
  getPageHtml,
15102
15222
  getPageTitle,
15103
15223
  importCookies,
15224
+ isCloudActionMethod,
15225
+ isCloudErrorCode,
15226
+ isCloudSessionSourceType,
15227
+ isCloudSessionStatus,
15104
15228
  listLocalChromeProfiles,
15105
15229
  listTabs,
15106
15230
  markInteractiveElements,
package/dist/index.d.cts CHANGED
@@ -2,8 +2,8 @@ import * as playwright from 'playwright';
2
2
  import { Page, BrowserContext, ElementHandle, Cookie, Browser } from 'playwright';
3
3
  import { a as OpensteerConfig, L as LaunchOptions, b as OpensteerLocalProfileDescriptor, c as OpensteerRealBrowserOptions, G as GotoOptions, S as SnapshotOptions, d as StateResult, e as ScreenshotOptions, f as ClickOptions, A as ActionResult, H as HoverOptions, I as InputOptions, g as SelectOptions, h as ScrollOptions, T as TabInfo, C as CookieParam, B as BaseActionOptions, i as BoundingBox, F as FileUploadOptions, E as ExtractOptions, j as ExtractFromPlanOptions, k as ExtractionRunResult, l as OpensteerCursorState, m as OpensteerAgentConfig, n as OpensteerAgentInstance, o as ElementPath, p as SnapshotMode, q as AiResolveCallback, r as AiExtractCallback, O as OpensteerAuthScheme, s as OpensteerAgentProvider, t as OpensteerAgentAction, u as OpensteerAgentResult, v as OpensteerAgentUsage, w as OpensteerCursorStyle, x as OpensteerCursorConfig, y as OpensteerAgentExecuteOptions, z as OpensteerBrowserConfig } from './types-Cr10igF3.cjs';
4
4
  export { D as ActionWaitOptions, J as AiExtractArgs, K as AiExtractResult, M as AiResolveArgs, N as AiResolveCallbackResult, P as AiResolveResult, Q as AttributeMatchClause, R as ContextHop, U as DomPath, V as ExtractSchema, W as ExtractSchemaField, X as ExtractSchemaValue, Y as ExtractionFieldPlan, Z as ExtractionPlan, _ as MatchClause, $ as MatchOperator, a0 as OpensteerAgentMode, a1 as OpensteerAgentModelConfig, a2 as OpensteerCloudAnnouncePolicy, a3 as OpensteerCloudBrowserProfileOptions, a4 as OpensteerCloudConfig, a5 as OpensteerCloudOptions, a6 as OpensteerCursorColor, a7 as OpensteerCursorProfile, a8 as OpensteerLocalBrowserMode, a9 as OpensteerStorageConfig, aa as PathNode, ab as PathNodePosition, ac as PositionMatchClause } from './types-Cr10igF3.cjs';
5
- import { A as ActionFailure, e as ActionFailureCode, C as CloudErrorCode, f as CloudActionFailureDetails, g as CloudSessionCreateRequest, h as CloudSessionCreateResponse, i as CloudSelectorCacheImportRequest, j as CloudSelectorCacheImportResponse, k as CloudActionMethod, l as CloudSelectorCacheImportEntry } from './browser-profile-client-Biu6DyT6.cjs';
6
- export { m as ActionFailureBlocker, n as ActionFailureClassificationSource, o as ActionFailureDetails, p as BrowserProfileArchiveFormat, q as BrowserProfileClient, c as BrowserProfileCreateRequest, d as BrowserProfileDescriptor, a as BrowserProfileListRequest, b as BrowserProfileListResponse, r as BrowserProfileProxyPolicy, B as BrowserProfileStatus, s as CloudActionFailure, t as CloudActionRequest, u as CloudActionResponse, v as CloudActionSuccess, w as CloudBrowserProfileLaunchPreference, x as CloudFingerprintMode, y as CloudSessionContractVersion, z as CloudSessionLaunchConfig, D as CloudSessionSourceType, E as CloudSessionSummary, F as cloudSessionContractVersion } from './browser-profile-client-Biu6DyT6.cjs';
5
+ import { A as ActionFailure, e as ActionFailureCode, C as CloudErrorCode, f as CloudActionFailureDetails, g as CloudSessionCreateRequest, h as CloudSessionCreateResponse, i as CloudSelectorCacheImportRequest, j as CloudSelectorCacheImportResponse, k as CloudActionMethod, l as CloudSelectorCacheImportEntry } from './browser-profile-client-CGXc0-P9.cjs';
6
+ export { m as ActionFailureBlocker, n as ActionFailureClassificationSource, o as ActionFailureDetails, p as BrowserProfileArchiveFormat, q as BrowserProfileClient, c as BrowserProfileCreateRequest, d as BrowserProfileDescriptor, a as BrowserProfileListRequest, b as BrowserProfileListResponse, r as BrowserProfileProxyPolicy, B as BrowserProfileStatus, s as CloudActionFailure, t as CloudActionRequest, u as CloudActionResponse, v as CloudActionSuccess, w as CloudBrowserContextConfig, x as CloudBrowserExtensionConfig, y as CloudBrowserLaunchConfig, z as CloudBrowserProfileLaunchPreference, D as CloudFingerprintMode, E as CloudFingerprintPreference, F as CloudGeolocation, G as CloudProxyMode, H as CloudProxyPreference, I as CloudProxyProtocol, J as CloudSessionContractVersion, K as CloudSessionLaunchConfig, L as CloudSessionSourceType, M as CloudSessionStatus, N as CloudSessionSummary, O as CloudSessionVisibilityScope, P as CloudViewport, Q as cloudActionMethods, R as cloudErrorCodes, S as cloudSessionContractVersion, T as cloudSessionSourceTypes, U as cloudSessionStatuses, V as isCloudActionMethod, W as isCloudErrorCode, X as isCloudSessionSourceType, Y as isCloudSessionStatus } from './browser-profile-client-CGXc0-P9.cjs';
7
7
 
8
8
  interface RegistryEntry {
9
9
  file: string;
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as playwright from 'playwright';
2
2
  import { Page, BrowserContext, ElementHandle, Cookie, Browser } from 'playwright';
3
3
  import { a as OpensteerConfig, L as LaunchOptions, b as OpensteerLocalProfileDescriptor, c as OpensteerRealBrowserOptions, G as GotoOptions, S as SnapshotOptions, d as StateResult, e as ScreenshotOptions, f as ClickOptions, A as ActionResult, H as HoverOptions, I as InputOptions, g as SelectOptions, h as ScrollOptions, T as TabInfo, C as CookieParam, B as BaseActionOptions, i as BoundingBox, F as FileUploadOptions, E as ExtractOptions, j as ExtractFromPlanOptions, k as ExtractionRunResult, l as OpensteerCursorState, m as OpensteerAgentConfig, n as OpensteerAgentInstance, o as ElementPath, p as SnapshotMode, q as AiResolveCallback, r as AiExtractCallback, O as OpensteerAuthScheme, s as OpensteerAgentProvider, t as OpensteerAgentAction, u as OpensteerAgentResult, v as OpensteerAgentUsage, w as OpensteerCursorStyle, x as OpensteerCursorConfig, y as OpensteerAgentExecuteOptions, z as OpensteerBrowserConfig } from './types-Cr10igF3.js';
4
4
  export { D as ActionWaitOptions, J as AiExtractArgs, K as AiExtractResult, M as AiResolveArgs, N as AiResolveCallbackResult, P as AiResolveResult, Q as AttributeMatchClause, R as ContextHop, U as DomPath, V as ExtractSchema, W as ExtractSchemaField, X as ExtractSchemaValue, Y as ExtractionFieldPlan, Z as ExtractionPlan, _ as MatchClause, $ as MatchOperator, a0 as OpensteerAgentMode, a1 as OpensteerAgentModelConfig, a2 as OpensteerCloudAnnouncePolicy, a3 as OpensteerCloudBrowserProfileOptions, a4 as OpensteerCloudConfig, a5 as OpensteerCloudOptions, a6 as OpensteerCursorColor, a7 as OpensteerCursorProfile, a8 as OpensteerLocalBrowserMode, a9 as OpensteerStorageConfig, aa as PathNode, ab as PathNodePosition, ac as PositionMatchClause } from './types-Cr10igF3.js';
5
- import { A as ActionFailure, e as ActionFailureCode, C as CloudErrorCode, f as CloudActionFailureDetails, g as CloudSessionCreateRequest, h as CloudSessionCreateResponse, i as CloudSelectorCacheImportRequest, j as CloudSelectorCacheImportResponse, k as CloudActionMethod, l as CloudSelectorCacheImportEntry } from './browser-profile-client-AGTsLQxT.js';
6
- export { m as ActionFailureBlocker, n as ActionFailureClassificationSource, o as ActionFailureDetails, p as BrowserProfileArchiveFormat, q as BrowserProfileClient, c as BrowserProfileCreateRequest, d as BrowserProfileDescriptor, a as BrowserProfileListRequest, b as BrowserProfileListResponse, r as BrowserProfileProxyPolicy, B as BrowserProfileStatus, s as CloudActionFailure, t as CloudActionRequest, u as CloudActionResponse, v as CloudActionSuccess, w as CloudBrowserProfileLaunchPreference, x as CloudFingerprintMode, y as CloudSessionContractVersion, z as CloudSessionLaunchConfig, D as CloudSessionSourceType, E as CloudSessionSummary, F as cloudSessionContractVersion } from './browser-profile-client-AGTsLQxT.js';
5
+ import { A as ActionFailure, e as ActionFailureCode, C as CloudErrorCode, f as CloudActionFailureDetails, g as CloudSessionCreateRequest, h as CloudSessionCreateResponse, i as CloudSelectorCacheImportRequest, j as CloudSelectorCacheImportResponse, k as CloudActionMethod, l as CloudSelectorCacheImportEntry } from './browser-profile-client-DHLzMf-K.js';
6
+ export { m as ActionFailureBlocker, n as ActionFailureClassificationSource, o as ActionFailureDetails, p as BrowserProfileArchiveFormat, q as BrowserProfileClient, c as BrowserProfileCreateRequest, d as BrowserProfileDescriptor, a as BrowserProfileListRequest, b as BrowserProfileListResponse, r as BrowserProfileProxyPolicy, B as BrowserProfileStatus, s as CloudActionFailure, t as CloudActionRequest, u as CloudActionResponse, v as CloudActionSuccess, w as CloudBrowserContextConfig, x as CloudBrowserExtensionConfig, y as CloudBrowserLaunchConfig, z as CloudBrowserProfileLaunchPreference, D as CloudFingerprintMode, E as CloudFingerprintPreference, F as CloudGeolocation, G as CloudProxyMode, H as CloudProxyPreference, I as CloudProxyProtocol, J as CloudSessionContractVersion, K as CloudSessionLaunchConfig, L as CloudSessionSourceType, M as CloudSessionStatus, N as CloudSessionSummary, O as CloudSessionVisibilityScope, P as CloudViewport, Q as cloudActionMethods, R as cloudErrorCodes, S as cloudSessionContractVersion, T as cloudSessionSourceTypes, U as cloudSessionStatuses, V as isCloudActionMethod, W as isCloudErrorCode, X as isCloudSessionSourceType, Y as isCloudSessionStatus } from './browser-profile-client-DHLzMf-K.js';
7
7
 
8
8
  interface RegistryEntry {
9
9
  file: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BrowserProfileClient
3
- } from "./chunk-6B6LOYU3.js";
3
+ } from "./chunk-O4HVMKX2.js";
4
4
  import {
5
5
  ActionWsClient,
6
6
  BrowserPool,
@@ -40,7 +40,6 @@ import {
40
40
  clearPersistentProfileSingletons,
41
41
  cloneElementPath,
42
42
  closeTab,
43
- cloudSessionContractVersion,
44
43
  collectLocalSelectorCacheEntries,
45
44
  countArrayItemsWithPath,
46
45
  createCuaClient,
@@ -81,16 +80,25 @@ import {
81
80
  switchTab,
82
81
  typeText,
83
82
  waitForVisualStability
84
- } from "./chunk-ACRSRDRN.js";
83
+ } from "./chunk-C6AJL5XU.js";
85
84
  import {
86
85
  CloudCdpClient,
87
86
  CloudSessionClient,
88
87
  OpensteerCloudError,
88
+ cloudActionMethods,
89
+ cloudErrorCodes,
89
90
  cloudNotLaunchedError,
91
+ cloudSessionContractVersion,
92
+ cloudSessionSourceTypes,
93
+ cloudSessionStatuses,
90
94
  cloudUnsupportedMethodError,
95
+ isCloudActionMethod,
96
+ isCloudErrorCode,
97
+ isCloudSessionSourceType,
98
+ isCloudSessionStatus,
91
99
  normalizeNamespace,
92
100
  resolveNamespaceDir
93
- } from "./chunk-KPPOTU3D.js";
101
+ } from "./chunk-LTREUXLO.js";
94
102
  import {
95
103
  detectChromePaths,
96
104
  expandHome,
@@ -332,8 +340,12 @@ export {
332
340
  clearPersistentProfileSingletons,
333
341
  cloneElementPath,
334
342
  closeTab,
343
+ cloudActionMethods,
344
+ cloudErrorCodes,
335
345
  cloudNotLaunchedError,
336
346
  cloudSessionContractVersion,
347
+ cloudSessionSourceTypes,
348
+ cloudSessionStatuses,
337
349
  cloudUnsupportedMethodError,
338
350
  collectLocalSelectorCacheEntries,
339
351
  countArrayItemsWithPath,
@@ -358,6 +370,10 @@ export {
358
370
  getPageHtml,
359
371
  getPageTitle,
360
372
  importCookies,
373
+ isCloudActionMethod,
374
+ isCloudErrorCode,
375
+ isCloudSessionSourceType,
376
+ isCloudSessionStatus,
361
377
  listLocalChromeProfiles,
362
378
  listTabs,
363
379
  markInteractiveElements,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensteer",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Open-source browser automation SDK and CLI that lets AI agents build complex scrapers directly in your codebase.",
5
5
  "license": "MIT",
6
6
  "type": "module",