opensteer 0.6.1 → 0.6.2

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/cli/auth.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  isCloudModeEnabledForRootDir,
5
5
  parseOpensteerAuthArgs,
6
6
  runOpensteerAuthCli
7
- } from "../chunk-3FNI7JUU.js";
7
+ } from "../chunk-7RMY26CM.js";
8
8
  import "../chunk-WDRMHPWL.js";
9
9
  export {
10
10
  ensureCloudCredentialsForCommand,
@@ -14779,13 +14779,10 @@ var import_node_crypto2 = require("crypto");
14779
14779
  var import_node_fs2 = __toESM(require("fs"), 1);
14780
14780
  var import_node_os2 = __toESM(require("os"), 1);
14781
14781
  var import_node_path2 = __toESM(require("path"), 1);
14782
- var METADATA_VERSION = 1;
14783
- var ACTIVE_TARGET_VERSION = 1;
14782
+ var METADATA_VERSION = 2;
14783
+ var ACTIVE_TARGET_VERSION = 2;
14784
14784
  var KEYCHAIN_SERVICE = "com.opensteer.cli.cloud";
14785
14785
  var KEYCHAIN_ACCOUNT_PREFIX = "machine:";
14786
- var LEGACY_KEYCHAIN_ACCOUNT = "machine";
14787
- var LEGACY_METADATA_FILE_NAME = "cli-login.json";
14788
- var LEGACY_FALLBACK_SECRET_FILE_NAME = "cli-login.secret.json";
14789
14786
  var ACTIVE_TARGET_FILE_NAME = "cli-target.json";
14790
14787
  var MachineCredentialStore = class {
14791
14788
  authDir;
@@ -14800,8 +14797,11 @@ var MachineCredentialStore = class {
14800
14797
  this.warn = options.warn ?? (() => void 0);
14801
14798
  }
14802
14799
  readCloudCredential(target) {
14803
- const slot = resolveCredentialSlot(this.authDir, target);
14804
- return this.readCredentialSlot(slot, target) ?? this.readAndMigrateLegacyCredential(target);
14800
+ const normalizedTarget = normalizeCloudCredentialTarget(target);
14801
+ return this.readCredentialSlot(
14802
+ resolveCredentialSlot(this.authDir, normalizedTarget),
14803
+ normalizedTarget
14804
+ );
14805
14805
  }
14806
14806
  writeCloudCredential(args) {
14807
14807
  const accessToken = args.accessToken.trim();
@@ -14809,12 +14809,8 @@ var MachineCredentialStore = class {
14809
14809
  if (!accessToken || !refreshToken2) {
14810
14810
  throw new Error("Cannot persist empty machine credential secrets.");
14811
14811
  }
14812
- const baseUrl = normalizeCredentialUrl(args.baseUrl, "baseUrl");
14813
- const siteUrl = normalizeCredentialUrl(args.siteUrl, "siteUrl");
14814
- const slot = resolveCredentialSlot(this.authDir, {
14815
- baseUrl,
14816
- siteUrl
14817
- });
14812
+ const baseUrl = normalizeCredentialUrl(args.baseUrl);
14813
+ const slot = resolveCredentialSlot(this.authDir, { baseUrl });
14818
14814
  ensureDirectory(this.authDir);
14819
14815
  const secretPayload = {
14820
14816
  accessToken,
@@ -14841,7 +14837,6 @@ var MachineCredentialStore = class {
14841
14837
  version: METADATA_VERSION,
14842
14838
  secretBackend,
14843
14839
  baseUrl,
14844
- siteUrl,
14845
14840
  scope: args.scope,
14846
14841
  obtainedAt: args.obtainedAt,
14847
14842
  expiresAt: args.expiresAt,
@@ -14853,23 +14848,18 @@ var MachineCredentialStore = class {
14853
14848
  return readActiveCloudTargetMetadata(resolveActiveTargetPath(this.authDir));
14854
14849
  }
14855
14850
  writeActiveCloudTarget(target) {
14856
- const baseUrl = normalizeCredentialUrl(target.baseUrl, "baseUrl");
14857
- const siteUrl = normalizeCredentialUrl(target.siteUrl, "siteUrl");
14851
+ const baseUrl = normalizeCredentialUrl(target.baseUrl);
14858
14852
  ensureDirectory(this.authDir);
14859
14853
  writeJsonFile(resolveActiveTargetPath(this.authDir), {
14860
14854
  version: ACTIVE_TARGET_VERSION,
14861
14855
  baseUrl,
14862
- siteUrl,
14863
14856
  updatedAt: Date.now()
14864
14857
  });
14865
14858
  }
14866
14859
  clearCloudCredential(target) {
14867
- this.clearCredentialSlot(resolveCredentialSlot(this.authDir, target));
14868
- const legacySlot = resolveLegacyCredentialSlot(this.authDir);
14869
- const legacyMetadata = readMetadata(legacySlot.metadataPath);
14870
- if (legacyMetadata && matchesCredentialTarget(legacyMetadata, target)) {
14871
- this.clearCredentialSlot(legacySlot);
14872
- }
14860
+ this.clearCredentialSlot(
14861
+ resolveCredentialSlot(this.authDir, normalizeCloudCredentialTarget(target))
14862
+ );
14873
14863
  }
14874
14864
  readCredentialSlot(slot, target) {
14875
14865
  const metadata = readMetadata(slot.metadataPath);
@@ -14885,7 +14875,6 @@ var MachineCredentialStore = class {
14885
14875
  }
14886
14876
  return {
14887
14877
  baseUrl: metadata.baseUrl,
14888
- siteUrl: metadata.siteUrl,
14889
14878
  scope: metadata.scope,
14890
14879
  accessToken: secret.accessToken,
14891
14880
  refreshToken: secret.refreshToken,
@@ -14893,16 +14882,6 @@ var MachineCredentialStore = class {
14893
14882
  expiresAt: metadata.expiresAt
14894
14883
  };
14895
14884
  }
14896
- readAndMigrateLegacyCredential(target) {
14897
- const legacySlot = resolveLegacyCredentialSlot(this.authDir);
14898
- const legacyCredential = this.readCredentialSlot(legacySlot, target);
14899
- if (!legacyCredential) {
14900
- return null;
14901
- }
14902
- this.writeCloudCredential(legacyCredential);
14903
- this.clearCredentialSlot(legacySlot);
14904
- return legacyCredential;
14905
- }
14906
14885
  readSecret(slot, backend) {
14907
14886
  if (backend === "keychain" && this.keychain) {
14908
14887
  try {
@@ -14943,9 +14922,8 @@ function createMachineCredentialStore(options = {}) {
14943
14922
  return new MachineCredentialStore(options);
14944
14923
  }
14945
14924
  function resolveCredentialSlot(authDir, target) {
14946
- const normalizedBaseUrl = normalizeCredentialUrl(target.baseUrl, "baseUrl");
14947
- const normalizedSiteUrl = normalizeCredentialUrl(target.siteUrl, "siteUrl");
14948
- const storageKey = (0, import_node_crypto2.createHash)("sha256").update(`${normalizedBaseUrl}\0${normalizedSiteUrl}`).digest("hex").slice(0, 24);
14925
+ const normalizedBaseUrl = normalizeCredentialUrl(target.baseUrl);
14926
+ const storageKey = (0, import_node_crypto2.createHash)("sha256").update(normalizedBaseUrl).digest("hex").slice(0, 24);
14949
14927
  return {
14950
14928
  keychainAccount: `${KEYCHAIN_ACCOUNT_PREFIX}${storageKey}`,
14951
14929
  metadataPath: import_node_path2.default.join(authDir, `cli-login.${storageKey}.json`),
@@ -14955,26 +14933,24 @@ function resolveCredentialSlot(authDir, target) {
14955
14933
  )
14956
14934
  };
14957
14935
  }
14958
- function resolveLegacyCredentialSlot(authDir) {
14959
- return {
14960
- keychainAccount: LEGACY_KEYCHAIN_ACCOUNT,
14961
- metadataPath: import_node_path2.default.join(authDir, LEGACY_METADATA_FILE_NAME),
14962
- fallbackSecretPath: import_node_path2.default.join(authDir, LEGACY_FALLBACK_SECRET_FILE_NAME)
14963
- };
14964
- }
14965
14936
  function resolveActiveTargetPath(authDir) {
14966
14937
  return import_node_path2.default.join(authDir, ACTIVE_TARGET_FILE_NAME);
14967
14938
  }
14968
14939
  function matchesCredentialTarget(value, target) {
14969
- return normalizeCredentialUrl(value.baseUrl, "baseUrl") === normalizeCredentialUrl(target.baseUrl, "baseUrl") && normalizeCredentialUrl(value.siteUrl, "siteUrl") === normalizeCredentialUrl(target.siteUrl, "siteUrl");
14940
+ return normalizeCredentialUrl(value.baseUrl) === normalizeCredentialUrl(target.baseUrl);
14970
14941
  }
14971
- function normalizeCredentialUrl(value, field) {
14942
+ function normalizeCredentialUrl(value) {
14972
14943
  const normalized = stripTrailingSlashes(value.trim());
14973
14944
  if (!normalized) {
14974
- throw new Error(`Cannot persist machine credential without ${field}.`);
14945
+ throw new Error("Cannot persist machine credential without baseUrl.");
14975
14946
  }
14976
14947
  return normalized;
14977
14948
  }
14949
+ function normalizeCloudCredentialTarget(target) {
14950
+ return {
14951
+ baseUrl: normalizeCredentialUrl(target.baseUrl)
14952
+ };
14953
+ }
14978
14954
  function resolveConfigDir(appName, env) {
14979
14955
  if (process.platform === "win32") {
14980
14956
  const appData = env.APPDATA?.trim() || import_node_path2.default.join(import_node_os2.default.homedir(), "AppData", "Roaming");
@@ -15013,7 +14989,6 @@ function readMetadata(filePath) {
15013
14989
  return null;
15014
14990
  }
15015
14991
  if (typeof parsed.baseUrl !== "string" || !parsed.baseUrl.trim()) return null;
15016
- if (typeof parsed.siteUrl !== "string" || !parsed.siteUrl.trim()) return null;
15017
14992
  if (!Array.isArray(parsed.scope)) return null;
15018
14993
  if (typeof parsed.obtainedAt !== "number") return null;
15019
14994
  if (typeof parsed.expiresAt !== "number") return null;
@@ -15022,7 +14997,6 @@ function readMetadata(filePath) {
15022
14997
  version: parsed.version,
15023
14998
  secretBackend: parsed.secretBackend,
15024
14999
  baseUrl: parsed.baseUrl,
15025
- siteUrl: parsed.siteUrl,
15026
15000
  scope: parsed.scope.filter(
15027
15001
  (value) => typeof value === "string"
15028
15002
  ),
@@ -15047,12 +15021,8 @@ function readActiveCloudTargetMetadata(filePath) {
15047
15021
  if (typeof parsed.baseUrl !== "string" || !parsed.baseUrl.trim()) {
15048
15022
  return null;
15049
15023
  }
15050
- if (typeof parsed.siteUrl !== "string" || !parsed.siteUrl.trim()) {
15051
- return null;
15052
- }
15053
15024
  return {
15054
- baseUrl: parsed.baseUrl,
15055
- siteUrl: parsed.siteUrl
15025
+ baseUrl: parsed.baseUrl
15056
15026
  };
15057
15027
  } catch {
15058
15028
  return null;
@@ -15077,14 +15047,13 @@ function readSecretFile(filePath) {
15077
15047
  return null;
15078
15048
  }
15079
15049
  try {
15080
- const raw = import_node_fs2.default.readFileSync(filePath, "utf8");
15081
- return parseSecretPayload(raw);
15050
+ return parseSecretPayload(import_node_fs2.default.readFileSync(filePath, "utf8"));
15082
15051
  } catch {
15083
15052
  return null;
15084
15053
  }
15085
15054
  }
15086
- function writeJsonFile(filePath, payload, options = {}) {
15087
- import_node_fs2.default.writeFileSync(filePath, JSON.stringify(payload, null, 2), {
15055
+ function writeJsonFile(filePath, value, options = {}) {
15056
+ import_node_fs2.default.writeFileSync(filePath, JSON.stringify(value, null, 2), {
15088
15057
  encoding: "utf8",
15089
15058
  mode: options.mode ?? 384
15090
15059
  });
@@ -15104,6 +15073,8 @@ var CliAuthHttpError = class extends Error {
15104
15073
  this.body = body;
15105
15074
  }
15106
15075
  };
15076
+ var DEFAULT_AUTH_SITE_URL = "https://opensteer.com";
15077
+ var INTERNAL_AUTH_SITE_URL_ENV = "OPENSTEER_INTERNAL_AUTH_SITE_URL";
15107
15078
  function resolveBaseUrl(provided, env) {
15108
15079
  const baseUrl = normalizeCloudBaseUrl(
15109
15080
  (provided || env.OPENSTEER_BASE_URL || DEFAULT_CLOUD_BASE_URL).trim()
@@ -15111,16 +15082,19 @@ function resolveBaseUrl(provided, env) {
15111
15082
  assertSecureUrl(baseUrl, "--base-url");
15112
15083
  return baseUrl;
15113
15084
  }
15114
- function resolveSiteUrl(provided, baseUrl, env) {
15115
- const siteUrl = normalizeCloudBaseUrl(
15116
- (provided || env.OPENSTEER_CLOUD_SITE_URL || deriveSiteUrlFromBaseUrl(baseUrl)).trim()
15085
+ function resolveAuthSiteUrl(env) {
15086
+ const authSiteUrl = normalizeCloudBaseUrl(
15087
+ (env[INTERNAL_AUTH_SITE_URL_ENV] || DEFAULT_AUTH_SITE_URL).trim()
15088
+ );
15089
+ assertSecureUrl(
15090
+ authSiteUrl,
15091
+ `environment variable ${INTERNAL_AUTH_SITE_URL_ENV}`
15117
15092
  );
15118
- assertSecureUrl(siteUrl, "--site-url");
15119
- return siteUrl;
15093
+ return authSiteUrl;
15120
15094
  }
15121
- function hasExplicitCloudTargetSelection(providedBaseUrl, providedSiteUrl, env) {
15095
+ function hasExplicitCloudTargetSelection(providedBaseUrl, env) {
15122
15096
  return Boolean(
15123
- providedBaseUrl?.trim() || providedSiteUrl?.trim() || env.OPENSTEER_BASE_URL?.trim() || env.OPENSTEER_CLOUD_SITE_URL?.trim()
15097
+ providedBaseUrl?.trim() || env.OPENSTEER_BASE_URL?.trim()
15124
15098
  );
15125
15099
  }
15126
15100
  function readRememberedCloudTarget(store) {
@@ -15130,57 +15104,21 @@ function readRememberedCloudTarget(store) {
15130
15104
  }
15131
15105
  try {
15132
15106
  const baseUrl = normalizeCloudBaseUrl(activeTarget.baseUrl);
15133
- const siteUrl = normalizeCloudBaseUrl(activeTarget.siteUrl);
15134
15107
  assertSecureUrl(baseUrl, "--base-url");
15135
- assertSecureUrl(siteUrl, "--site-url");
15136
- return {
15137
- baseUrl,
15138
- siteUrl
15139
- };
15108
+ return { baseUrl };
15140
15109
  } catch {
15141
15110
  return null;
15142
15111
  }
15143
15112
  }
15144
- function resolveCloudTarget(args, env, store) {
15145
- if (!hasExplicitCloudTargetSelection(args.baseUrl, args.siteUrl, env)) {
15113
+ function resolveCloudTarget(args, env, store, options = {}) {
15114
+ if (options.allowRememberedTarget !== false && !hasExplicitCloudTargetSelection(args.baseUrl, env)) {
15146
15115
  const rememberedTarget = readRememberedCloudTarget(store);
15147
15116
  if (rememberedTarget) {
15148
15117
  return rememberedTarget;
15149
15118
  }
15150
15119
  }
15151
15120
  const baseUrl = resolveBaseUrl(args.baseUrl, env);
15152
- const siteUrl = resolveSiteUrl(args.siteUrl, baseUrl, env);
15153
- return {
15154
- baseUrl,
15155
- siteUrl
15156
- };
15157
- }
15158
- function deriveSiteUrlFromBaseUrl(baseUrl) {
15159
- let parsed;
15160
- try {
15161
- parsed = new URL(baseUrl);
15162
- } catch {
15163
- return "https://opensteer.com";
15164
- }
15165
- const hostname = parsed.hostname.toLowerCase();
15166
- if (hostname.startsWith("api.")) {
15167
- parsed.hostname = hostname.slice("api.".length);
15168
- parsed.pathname = "";
15169
- parsed.search = "";
15170
- parsed.hash = "";
15171
- return normalizeCloudBaseUrl(parsed.toString());
15172
- }
15173
- if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1") {
15174
- parsed.port = "3001";
15175
- parsed.pathname = "";
15176
- parsed.search = "";
15177
- parsed.hash = "";
15178
- return normalizeCloudBaseUrl(parsed.toString());
15179
- }
15180
- parsed.pathname = "";
15181
- parsed.search = "";
15182
- parsed.hash = "";
15183
- return normalizeCloudBaseUrl(parsed.toString());
15121
+ return { baseUrl };
15184
15122
  }
15185
15123
  function assertSecureUrl(value, flag) {
15186
15124
  let parsed;
@@ -15255,10 +15193,10 @@ function parseCliOauthError(error) {
15255
15193
  interval: typeof root.interval === "number" ? root.interval : void 0
15256
15194
  };
15257
15195
  }
15258
- async function startDeviceAuthorization(siteUrl, fetchFn) {
15196
+ async function startDeviceAuthorization(authSiteUrl, fetchFn) {
15259
15197
  const response = await postJson(
15260
15198
  fetchFn,
15261
- `${siteUrl}/api/cli-auth/device/start`,
15199
+ `${authSiteUrl}/api/cli-auth/device/start`,
15262
15200
  {
15263
15201
  scope: ["cloud:browser"]
15264
15202
  }
@@ -15268,18 +15206,18 @@ async function startDeviceAuthorization(siteUrl, fetchFn) {
15268
15206
  }
15269
15207
  return response;
15270
15208
  }
15271
- async function pollDeviceToken(siteUrl, deviceCode, fetchFn) {
15209
+ async function pollDeviceToken(authSiteUrl, deviceCode, fetchFn) {
15272
15210
  return await postJson(
15273
15211
  fetchFn,
15274
- `${siteUrl}/api/cli-auth/device/token`,
15212
+ `${authSiteUrl}/api/cli-auth/device/token`,
15275
15213
  {
15276
15214
  grant_type: "urn:ietf:params:oauth:grant-type:device_code",
15277
15215
  device_code: deviceCode
15278
15216
  }
15279
15217
  );
15280
15218
  }
15281
- async function refreshToken(siteUrl, refreshTokenValue, fetchFn) {
15282
- return await postJson(fetchFn, `${siteUrl}/api/cli-auth/token`, {
15219
+ async function refreshToken(authSiteUrl, refreshTokenValue, fetchFn) {
15220
+ return await postJson(fetchFn, `${authSiteUrl}/api/cli-auth/token`, {
15283
15221
  grant_type: "refresh_token",
15284
15222
  refresh_token: refreshTokenValue
15285
15223
  });
@@ -15297,7 +15235,7 @@ async function openDefaultBrowser(url) {
15297
15235
  }
15298
15236
  }
15299
15237
  async function runDeviceLoginFlow(args) {
15300
- const start = await startDeviceAuthorization(args.siteUrl, args.fetchFn);
15238
+ const start = await startDeviceAuthorization(args.authSiteUrl, args.fetchFn);
15301
15239
  if (args.openBrowser) {
15302
15240
  args.writeProgress(
15303
15241
  "Opening your default browser for Opensteer CLI authentication.\n"
@@ -15342,7 +15280,7 @@ ${start.verification_uri_complete}
15342
15280
  await args.sleep(pollIntervalMs);
15343
15281
  try {
15344
15282
  const tokenPayload = await pollDeviceToken(
15345
- args.siteUrl,
15283
+ args.authSiteUrl,
15346
15284
  start.device_code,
15347
15285
  args.fetchFn
15348
15286
  );
@@ -15390,7 +15328,7 @@ ${start.verification_uri_complete}
15390
15328
  }
15391
15329
  async function refreshSavedCredential(saved, deps) {
15392
15330
  const tokenPayload = await refreshToken(
15393
- saved.siteUrl,
15331
+ resolveAuthSiteUrl(deps.env),
15394
15332
  saved.refreshToken,
15395
15333
  deps.fetchFn
15396
15334
  );
@@ -15403,7 +15341,6 @@ async function refreshSavedCredential(saved, deps) {
15403
15341
  };
15404
15342
  deps.store.writeCloudCredential({
15405
15343
  baseUrl: saved.baseUrl,
15406
- siteUrl: saved.siteUrl,
15407
15344
  scope: updated.scope,
15408
15345
  accessToken: updated.accessToken,
15409
15346
  refreshToken: updated.refreshToken,
@@ -15432,8 +15369,7 @@ async function ensureSavedCredentialIsFresh(saved, deps) {
15432
15369
  const oauth = parseCliOauthError(error.body);
15433
15370
  if (oauth?.error === "invalid_grant" || oauth?.error === "expired_token") {
15434
15371
  deps.store.clearCloudCredential({
15435
- baseUrl: saved.baseUrl,
15436
- siteUrl: saved.siteUrl
15372
+ baseUrl: saved.baseUrl
15437
15373
  });
15438
15374
  return null;
15439
15375
  }
@@ -15468,7 +15404,7 @@ async function ensureCloudCredentialsForCommand(options) {
15468
15404
  `);
15469
15405
  }
15470
15406
  });
15471
- const { baseUrl, siteUrl } = resolveCloudTarget(options, env, store);
15407
+ const { baseUrl } = resolveCloudTarget(options, env, store);
15472
15408
  const initialCredential = resolveCloudCredential({
15473
15409
  env,
15474
15410
  apiKeyFlag: options.apiKeyFlag,
@@ -15476,11 +15412,9 @@ async function ensureCloudCredentialsForCommand(options) {
15476
15412
  });
15477
15413
  let credential = initialCredential;
15478
15414
  if (!credential) {
15479
- const saved = store.readCloudCredential({
15480
- baseUrl,
15481
- siteUrl
15482
- });
15415
+ const saved = store.readCloudCredential({ baseUrl });
15483
15416
  const freshSaved = saved ? await ensureSavedCredentialIsFresh(saved, {
15417
+ env,
15484
15418
  fetchFn,
15485
15419
  store,
15486
15420
  now,
@@ -15498,7 +15432,7 @@ async function ensureCloudCredentialsForCommand(options) {
15498
15432
  if (!credential) {
15499
15433
  if (options.autoLoginIfNeeded && (options.interactive ?? false)) {
15500
15434
  const loggedIn = await runDeviceLoginFlow({
15501
- siteUrl,
15435
+ authSiteUrl: resolveAuthSiteUrl(env),
15502
15436
  fetchFn,
15503
15437
  writeProgress,
15504
15438
  openExternalUrl,
@@ -15508,7 +15442,6 @@ async function ensureCloudCredentialsForCommand(options) {
15508
15442
  });
15509
15443
  store.writeCloudCredential({
15510
15444
  baseUrl,
15511
- siteUrl,
15512
15445
  scope: loggedIn.scope,
15513
15446
  accessToken: loggedIn.accessToken,
15514
15447
  refreshToken: loggedIn.refreshToken,
@@ -15526,20 +15459,15 @@ async function ensureCloudCredentialsForCommand(options) {
15526
15459
  throw new Error(toAuthMissingMessage(options.commandName));
15527
15460
  }
15528
15461
  }
15529
- store.writeActiveCloudTarget({
15530
- baseUrl,
15531
- siteUrl
15532
- });
15462
+ store.writeActiveCloudTarget({ baseUrl });
15533
15463
  applyCloudCredentialToEnv(env, credential);
15534
15464
  env.OPENSTEER_BASE_URL = baseUrl;
15535
- env.OPENSTEER_CLOUD_SITE_URL = siteUrl;
15536
15465
  return {
15537
15466
  token: credential.token,
15538
15467
  authScheme: credential.authScheme,
15539
15468
  source: credential.source,
15540
15469
  kind: credential.kind,
15541
- baseUrl,
15542
- siteUrl
15470
+ baseUrl
15543
15471
  };
15544
15472
  }
15545
15473
 
@@ -15557,7 +15485,6 @@ Cloud auth options (all commands):
15557
15485
  --api-key <key> Cloud API key (defaults to OPENSTEER_API_KEY)
15558
15486
  --access-token <token> Cloud bearer access token (defaults to OPENSTEER_ACCESS_TOKEN)
15559
15487
  --base-url <url> Cloud API base URL (defaults to env or the last selected host)
15560
- --site-url <url> Cloud site URL for login/refresh/revoke flows
15561
15488
  --auth-scheme <scheme> api-key (default) or bearer
15562
15489
  --json JSON output (progress logs go to stderr)
15563
15490
 
@@ -15644,13 +15571,6 @@ function parseListArgs(rawArgs) {
15644
15571
  i = value.nextIndex;
15645
15572
  continue;
15646
15573
  }
15647
- if (arg === "--site-url") {
15648
- const value = readFlagValue(rawArgs, i, "--site-url");
15649
- if (!value.ok) return { mode: "error", error: value.error };
15650
- args.siteUrl = value.value;
15651
- i = value.nextIndex;
15652
- continue;
15653
- }
15654
15574
  if (arg === "--auth-scheme") {
15655
15575
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
15656
15576
  if (!value.ok) return { mode: "error", error: value.error };
@@ -15743,13 +15663,6 @@ function parseCreateArgs(rawArgs) {
15743
15663
  i = value.nextIndex;
15744
15664
  continue;
15745
15665
  }
15746
- if (arg === "--site-url") {
15747
- const value = readFlagValue(rawArgs, i, "--site-url");
15748
- if (!value.ok) return { mode: "error", error: value.error };
15749
- args.siteUrl = value.value;
15750
- i = value.nextIndex;
15751
- continue;
15752
- }
15753
15666
  if (arg === "--auth-scheme") {
15754
15667
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
15755
15668
  if (!value.ok) return { mode: "error", error: value.error };
@@ -15868,13 +15781,6 @@ function parseSyncArgs(rawArgs) {
15868
15781
  i = value.nextIndex;
15869
15782
  continue;
15870
15783
  }
15871
- if (arg === "--site-url") {
15872
- const value = readFlagValue(rawArgs, i, "--site-url");
15873
- if (!value.ok) return { mode: "error", error: value.error };
15874
- args.siteUrl = value.value;
15875
- i = value.nextIndex;
15876
- continue;
15877
- }
15878
15784
  if (arg === "--auth-scheme") {
15879
15785
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
15880
15786
  if (!value.ok) return { mode: "error", error: value.error };
@@ -15965,7 +15871,6 @@ async function buildCloudAuthContext(args, deps) {
15965
15871
  apiKeyFlag: args.apiKey,
15966
15872
  accessTokenFlag: args.accessToken,
15967
15873
  baseUrl: args.baseUrl,
15968
- siteUrl: args.siteUrl,
15969
15874
  interactive: deps.isInteractive(),
15970
15875
  autoLoginIfNeeded: true,
15971
15876
  writeProgress: args.json ? deps.writeStderr : deps.writeStdout,
@@ -15987,7 +15892,6 @@ async function buildCloudAuthContext(args, deps) {
15987
15892
  return {
15988
15893
  token: ensured.token,
15989
15894
  baseUrl: ensured.baseUrl,
15990
- siteUrl: ensured.siteUrl,
15991
15895
  authScheme: ensured.authScheme,
15992
15896
  kind: ensured.kind,
15993
15897
  source: ensured.source
@@ -21,7 +21,6 @@ interface ProfileCommonCloudArgs {
21
21
  apiKey?: string;
22
22
  accessToken?: string;
23
23
  baseUrl?: string;
24
- siteUrl?: string;
25
24
  authScheme?: OpensteerAuthScheme;
26
25
  json?: boolean;
27
26
  }
@@ -46,7 +45,6 @@ interface ProfileSyncArgs extends ProfileCommonCloudArgs {
46
45
  interface CloudAuthContext {
47
46
  token: string;
48
47
  baseUrl: string;
49
- siteUrl: string;
50
48
  authScheme: OpensteerAuthScheme;
51
49
  kind: 'api-key' | 'access-token';
52
50
  source: 'flag' | 'env' | 'saved';
@@ -21,7 +21,6 @@ interface ProfileCommonCloudArgs {
21
21
  apiKey?: string;
22
22
  accessToken?: string;
23
23
  baseUrl?: string;
24
- siteUrl?: string;
25
24
  authScheme?: OpensteerAuthScheme;
26
25
  json?: boolean;
27
26
  }
@@ -46,7 +45,6 @@ interface ProfileSyncArgs extends ProfileCommonCloudArgs {
46
45
  interface CloudAuthContext {
47
46
  token: string;
48
47
  baseUrl: string;
49
- siteUrl: string;
50
48
  authScheme: OpensteerAuthScheme;
51
49
  kind: 'api-key' | 'access-token';
52
50
  source: 'flag' | 'env' | 'saved';
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-WJI7TGBQ.js";
4
4
  import {
5
5
  ensureCloudCredentialsForCommand
6
- } from "../chunk-3FNI7JUU.js";
6
+ } from "../chunk-7RMY26CM.js";
7
7
  import {
8
8
  Opensteer,
9
9
  expandHome,
@@ -130,7 +130,6 @@ Cloud auth options (all commands):
130
130
  --api-key <key> Cloud API key (defaults to OPENSTEER_API_KEY)
131
131
  --access-token <token> Cloud bearer access token (defaults to OPENSTEER_ACCESS_TOKEN)
132
132
  --base-url <url> Cloud API base URL (defaults to env or the last selected host)
133
- --site-url <url> Cloud site URL for login/refresh/revoke flows
134
133
  --auth-scheme <scheme> api-key (default) or bearer
135
134
  --json JSON output (progress logs go to stderr)
136
135
 
@@ -217,13 +216,6 @@ function parseListArgs(rawArgs) {
217
216
  i = value.nextIndex;
218
217
  continue;
219
218
  }
220
- if (arg === "--site-url") {
221
- const value = readFlagValue(rawArgs, i, "--site-url");
222
- if (!value.ok) return { mode: "error", error: value.error };
223
- args.siteUrl = value.value;
224
- i = value.nextIndex;
225
- continue;
226
- }
227
219
  if (arg === "--auth-scheme") {
228
220
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
229
221
  if (!value.ok) return { mode: "error", error: value.error };
@@ -316,13 +308,6 @@ function parseCreateArgs(rawArgs) {
316
308
  i = value.nextIndex;
317
309
  continue;
318
310
  }
319
- if (arg === "--site-url") {
320
- const value = readFlagValue(rawArgs, i, "--site-url");
321
- if (!value.ok) return { mode: "error", error: value.error };
322
- args.siteUrl = value.value;
323
- i = value.nextIndex;
324
- continue;
325
- }
326
311
  if (arg === "--auth-scheme") {
327
312
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
328
313
  if (!value.ok) return { mode: "error", error: value.error };
@@ -441,13 +426,6 @@ function parseSyncArgs(rawArgs) {
441
426
  i = value.nextIndex;
442
427
  continue;
443
428
  }
444
- if (arg === "--site-url") {
445
- const value = readFlagValue(rawArgs, i, "--site-url");
446
- if (!value.ok) return { mode: "error", error: value.error };
447
- args.siteUrl = value.value;
448
- i = value.nextIndex;
449
- continue;
450
- }
451
429
  if (arg === "--auth-scheme") {
452
430
  const value = readFlagValue(rawArgs, i, "--auth-scheme");
453
431
  if (!value.ok) return { mode: "error", error: value.error };
@@ -538,7 +516,6 @@ async function buildCloudAuthContext(args, deps) {
538
516
  apiKeyFlag: args.apiKey,
539
517
  accessTokenFlag: args.accessToken,
540
518
  baseUrl: args.baseUrl,
541
- siteUrl: args.siteUrl,
542
519
  interactive: deps.isInteractive(),
543
520
  autoLoginIfNeeded: true,
544
521
  writeProgress: args.json ? deps.writeStderr : deps.writeStdout,
@@ -560,7 +537,6 @@ async function buildCloudAuthContext(args, deps) {
560
537
  return {
561
538
  token: ensured.token,
562
539
  baseUrl: ensured.baseUrl,
563
- siteUrl: ensured.siteUrl,
564
540
  authScheme: ensured.authScheme,
565
541
  kind: ensured.kind,
566
542
  source: ensured.source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensteer",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
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",