@dereekb/dbx-cli 14.2.0 → 14.3.0

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/index.esm.js CHANGED
@@ -7,11 +7,13 @@ import { Firestore, getFirestore, connectFirestoreEmulator } from 'firebase/fire
7
7
  import { getApps, initializeApp, deleteApp } from 'firebase/app';
8
8
  import { initializeAppCheck, CustomProvider } from 'firebase/app-check';
9
9
  import { signInWithCustomToken, getAuth, connectAuthEmulator } from 'firebase/auth';
10
- import { expirationDetails, performAsyncTasks, compareStrings, OidcRelyingPartyError, buildAuthorizationUrl as buildAuthorizationUrl$1, parseAuthorizationRedirect, noop, generateOAuthState, generatePkceMaterial, MS_IN_SECOND, isPlainObject as isPlainObject$1, MS_IN_HOUR, asArray, buildOidcDiscoveryCandidates, unique, AUTH_TOS_SIGNED_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ADMIN_ROLE, AUTH_USER_ROLE } from '@dereekb/util';
10
+ import { expirationDetails, performAsyncTasks, compareStrings, OidcRelyingPartyError, buildAuthorizationUrl as buildAuthorizationUrl$1, parseAuthorizationRedirect, noop, generateOAuthState, MS_IN_SECOND, generatePkceMaterial, isPlainObject as isPlainObject$1, MS_IN_HOUR, asArray, buildOidcDiscoveryCandidates, unique, AUTH_TOS_SIGNED_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ADMIN_ROLE, AUTH_USER_ROLE } from '@dereekb/util';
11
11
  import { createMemoizedJsonFileAsyncKeyedValueCache, readJsonFile, writeJsonFile, DEFAULT_JSON_FILE_CACHE_MODE, removeFile } from '@dereekb/nestjs';
12
12
  import { durationDataToMilliseconds, parseDurationString } from '@dereekb/date';
13
13
  import { homedir } from 'node:os';
14
14
  import { discoverOidcMetadata as discoverOidcMetadata$1, exchangeAuthorizationCode as exchangeAuthorizationCode$1, refreshAccessToken as refreshAccessToken$1, revokeToken as revokeToken$1, fetchUserInfo as fetchUserInfo$1, fetchSessionInfo as fetchSessionInfo$1 } from '@dereekb/util/oidc';
15
+ import { createServer } from 'node:http';
16
+ import { spawn } from 'node:child_process';
15
17
  import { createInterface } from 'node:readline';
16
18
  import { chmod, writeFile, mkdir, readFile, glob, stat, readdir } from 'node:fs/promises';
17
19
  import { createHash } from 'node:crypto';
@@ -36,7 +38,7 @@ function _assert_this_initialized(self) {
36
38
  if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
37
39
  return self;
38
40
  }
39
- function asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, key, arg) {
41
+ function asyncGeneratorStep$1u(gen, resolve, reject, _next, _throw, key, arg) {
40
42
  try {
41
43
  var info = gen[key](arg);
42
44
  var value = info.value;
@@ -47,16 +49,16 @@ function asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, key, arg) {
47
49
  if (info.done) resolve(value);
48
50
  else Promise.resolve(value).then(_next, _throw);
49
51
  }
50
- function _async_to_generator$1t(fn) {
52
+ function _async_to_generator$1u(fn) {
51
53
  return function() {
52
54
  var self = this, args = arguments;
53
55
  return new Promise(function(resolve, reject) {
54
56
  var gen = fn.apply(self, args);
55
57
  function _next(value) {
56
- asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, "next", value);
58
+ asyncGeneratorStep$1u(gen, resolve, reject, _next, _throw, "next", value);
57
59
  }
58
60
  function _throw(err) {
59
- asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, "throw", err);
61
+ asyncGeneratorStep$1u(gen, resolve, reject, _next, _throw, "throw", err);
60
62
  }
61
63
  _next(undefined);
62
64
  });
@@ -115,7 +117,7 @@ function _inherits(subClass, superClass) {
115
117
  });
116
118
  if (superClass) _set_prototype_of(subClass, superClass);
117
119
  }
118
- function _instanceof$x(left, right) {
120
+ function _instanceof$y(left, right) {
119
121
  "@swc/helpers - instanceof";
120
122
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
121
123
  return !!right[Symbol.hasInstance](left);
@@ -187,7 +189,7 @@ function _set_prototype_of(o, p) {
187
189
  function _to_consumable_array$_(arr) {
188
190
  return _array_without_holes$_(arr) || _iterable_to_array$_(arr) || _unsupported_iterable_to_array$1c(arr) || _non_iterable_spread$_();
189
191
  }
190
- function _ts_generator$1t(thisArg, body) {
192
+ function _ts_generator$1u(thisArg, body) {
191
193
  var f, y, t, _ = {
192
194
  label: 0,
193
195
  sent: function() {
@@ -407,10 +409,10 @@ var _timeoutMs = DEFAULT_CLI_HTTP_TIMEOUT_MS;
407
409
  * @param init - The RequestInit. Any existing `signal` is preserved; we only attach our own when no signal was supplied.
408
410
  * @returns The fetch Response.
409
411
  */ function tracedFetch(fetcher, input, init) {
410
- return _async_to_generator$1t(function() {
412
+ return _async_to_generator$1u(function() {
411
413
  var _ref, fetchImpl, timeoutMs, method, url, controller, timeoutHandle, finalInit, // Don't let the abort timer itself keep the Node event loop (or a test worker) alive.
412
414
  _timeoutHandle_unref, localController, e;
413
- return _ts_generator$1t(this, function(_state) {
415
+ return _ts_generator$1u(this, function(_state) {
414
416
  switch(_state.label){
415
417
  case 0:
416
418
  fetchImpl = fetcher !== null && fetcher !== void 0 ? fetcher : fetch;
@@ -418,7 +420,7 @@ var _timeoutMs = DEFAULT_CLI_HTTP_TIMEOUT_MS;
418
420
  method = (_ref = init === null || init === void 0 ? void 0 : init.method) !== null && _ref !== void 0 ? _ref : 'GET';
419
421
  if (typeof input === 'string') {
420
422
  url = input;
421
- } else if (_instanceof$x(input, URL)) {
423
+ } else if (_instanceof$y(input, URL)) {
422
424
  url = input.toString();
423
425
  } else {
424
426
  url = input.url;
@@ -729,7 +731,7 @@ function stringifyEnvelope(value) {
729
731
  var result;
730
732
  if (mapped) {
731
733
  result = mapped;
732
- } else if (_instanceof$x(error, CliError)) {
734
+ } else if (_instanceof$y(error, CliError)) {
733
735
  result = _object_spread$10({
734
736
  ok: false,
735
737
  error: sanitizeString(error.message),
@@ -737,7 +739,7 @@ function stringifyEnvelope(value) {
737
739
  }, error.suggestion ? {
738
740
  suggestion: error.suggestion
739
741
  } : {});
740
- } else if (_instanceof$x(error, Error)) {
742
+ } else if (_instanceof$y(error, Error)) {
741
743
  result = {
742
744
  ok: false,
743
745
  error: sanitizeString(error.message),
@@ -761,7 +763,7 @@ function _array_like_to_array$1b(arr, len) {
761
763
  function _array_without_holes$Z(arr) {
762
764
  if (Array.isArray(arr)) return _array_like_to_array$1b(arr);
763
765
  }
764
- function asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, key, arg) {
766
+ function asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, key, arg) {
765
767
  try {
766
768
  var info = gen[key](arg);
767
769
  var value = info.value;
@@ -772,16 +774,16 @@ function asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, key, arg) {
772
774
  if (info.done) resolve(value);
773
775
  else Promise.resolve(value).then(_next, _throw);
774
776
  }
775
- function _async_to_generator$1s(fn) {
777
+ function _async_to_generator$1t(fn) {
776
778
  return function() {
777
779
  var self = this, args = arguments;
778
780
  return new Promise(function(resolve, reject) {
779
781
  var gen = fn.apply(self, args);
780
782
  function _next(value) {
781
- asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, "next", value);
783
+ asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, "next", value);
782
784
  }
783
785
  function _throw(err) {
784
- asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, "throw", err);
786
+ asyncGeneratorStep$1t(gen, resolve, reject, _next, _throw, "throw", err);
785
787
  }
786
788
  _next(undefined);
787
789
  });
@@ -842,7 +844,7 @@ function _object_spread_props$H(target, source) {
842
844
  function _to_consumable_array$Z(arr) {
843
845
  return _array_without_holes$Z(arr) || _iterable_to_array$Z(arr) || _unsupported_iterable_to_array$1b(arr) || _non_iterable_spread$Z();
844
846
  }
845
- function _ts_generator$1s(thisArg, body) {
847
+ function _ts_generator$1t(thisArg, body) {
846
848
  var f, y, t, _ = {
847
849
  label: 0,
848
850
  sent: function() {
@@ -966,9 +968,9 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
966
968
  * @param input - The call envelope describing the API target, access token, model params, and optional fetch override.
967
969
  * @returns The parsed JSON response body cast to `R`.
968
970
  */ function callModelOverHttp(input) {
969
- return _async_to_generator$1s(function() {
971
+ return _async_to_generator$1t(function() {
970
972
  var _input_params_call;
971
- return _ts_generator$1s(this, function(_state) {
973
+ return _ts_generator$1t(this, function(_state) {
972
974
  return [
973
975
  2,
974
976
  requestJson({
@@ -996,8 +998,8 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
996
998
  * @param input - The request envelope describing the API target, access token, model + key, and optional fetch override.
997
999
  * @returns The parsed `{ key, data }` envelope.
998
1000
  */ function getModelOverHttp(input) {
999
- return _async_to_generator$1s(function() {
1000
- return _ts_generator$1s(this, function(_state) {
1001
+ return _async_to_generator$1t(function() {
1002
+ return _ts_generator$1t(this, function(_state) {
1001
1003
  return [
1002
1004
  2,
1003
1005
  requestJson({
@@ -1025,8 +1027,8 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
1025
1027
  * @param input - The request envelope describing the API target, access token, model, keys, and optional fetch override.
1026
1028
  * @returns The parsed `{ results, errors }` envelope.
1027
1029
  */ function getMultipleModelsOverHttp(input) {
1028
- return _async_to_generator$1s(function() {
1029
- return _ts_generator$1s(this, function(_state) {
1030
+ return _async_to_generator$1t(function() {
1031
+ return _ts_generator$1t(this, function(_state) {
1030
1032
  if (input.keys.length === 0) {
1031
1033
  throw new CliError({
1032
1034
  message: 'get-many requires at least one key.',
@@ -1064,9 +1066,9 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
1064
1066
  * @param input - Same shape as {@link GetMultipleModelsOverHttpInput} but without the 50-key cap.
1065
1067
  * @returns The merged `{ results, errors }` envelope across all chunks.
1066
1068
  */ function getMultipleModelsOverHttpChunked(input) {
1067
- return _async_to_generator$1s(function() {
1069
+ return _async_to_generator$1t(function() {
1068
1070
  var chunks, i, mergedResults, mergedErrors, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _mergedResults, _mergedErrors, batch, err;
1069
- return _ts_generator$1s(this, function(_state) {
1071
+ return _ts_generator$1t(this, function(_state) {
1070
1072
  switch(_state.label){
1071
1073
  case 0:
1072
1074
  if (input.keys.length === 0) {
@@ -1154,9 +1156,9 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
1154
1156
  })();
1155
1157
  }
1156
1158
  function requestJson(input) {
1157
- return _async_to_generator$1s(function() {
1159
+ return _async_to_generator$1t(function() {
1158
1160
  var hasJsonBody, init, res, _ref, ok, body, fallbackMessage;
1159
- return _ts_generator$1s(this, function(_state) {
1161
+ return _ts_generator$1t(this, function(_state) {
1160
1162
  switch(_state.label){
1161
1163
  case 0:
1162
1164
  hasJsonBody = input.jsonBody !== undefined;
@@ -1199,9 +1201,9 @@ function requestJson(input) {
1199
1201
  })();
1200
1202
  }
1201
1203
  function readJsonResponse(res) {
1202
- return _async_to_generator$1s(function() {
1204
+ return _async_to_generator$1t(function() {
1203
1205
  var text, body;
1204
- return _ts_generator$1s(this, function(_state) {
1206
+ return _ts_generator$1t(this, function(_state) {
1205
1207
  switch(_state.label){
1206
1208
  case 0:
1207
1209
  return [
@@ -1268,7 +1270,7 @@ function _define_property$$(obj, key, value) {
1268
1270
  } else obj[key] = value;
1269
1271
  return obj;
1270
1272
  }
1271
- function _instanceof$w(left, right) {
1273
+ function _instanceof$x(left, right) {
1272
1274
  "@swc/helpers - instanceof";
1273
1275
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1274
1276
  return !!right[Symbol.hasInstance](left);
@@ -1349,7 +1351,7 @@ function _object_spread_props$G(target, source) {
1349
1351
  var driverIdentifier = (_input_firestoreContext1 = input.firestoreContext) === null || _input_firestoreContext1 === void 0 ? void 0 : (_input_firestoreContext_drivers = _input_firestoreContext1.drivers) === null || _input_firestoreContext_drivers === void 0 ? void 0 : _input_firestoreContext_drivers.firestoreDriverIdentifier;
1350
1352
  var firestoreDriverIdentifier = typeof driverIdentifier === 'string' ? driverIdentifier : undefined;
1351
1353
  var firestorePresent = firestore != null;
1352
- var firestoreIsSdkInstance = _instanceof$w(firestore, Firestore);
1354
+ var firestoreIsSdkInstance = _instanceof$x(firestore, Firestore);
1353
1355
  var firestoreConstructor = firestoreConstructorName(firestore);
1354
1356
  var modules = resolveCliFirestoreSdkModules();
1355
1357
  var sdkDuplicated = modules.sdkFromDbxCli.packageDir != null && modules.sdkFromDbxFirebase.packageDir != null && modules.sdkFromDbxCli.packageDir !== modules.sdkFromDbxFirebase.packageDir;
@@ -1429,7 +1431,7 @@ function _object_spread_props$G(target, source) {
1429
1431
  */ function cliFirestoreWiringError(input) {
1430
1432
  var error = input.error, operation = input.operation, modelType = input.modelType, collectionName = input.collectionName, parentKey = input.parentKey, firestoreContext = input.firestoreContext;
1431
1433
  var result;
1432
- if (_instanceof$w(error, CliError)) {
1434
+ if (_instanceof$x(error, CliError)) {
1433
1435
  result = error;
1434
1436
  } else {
1435
1437
  var _cliFirestoreSdkIdentitySuggestion, _report_firestoreDriverIdentifier, _report_sdkFromDbxCli_version, _report_sdkFromDbxCli_packageDir;
@@ -1443,7 +1445,7 @@ function _object_spread_props$G(target, source) {
1443
1445
  var report = inspectCliFirestoreSdkIdentity({
1444
1446
  firestoreContext: firestoreContext
1445
1447
  });
1446
- var message = "Could not ".concat(operation, " (").concat(facts.join(', '), "): ").concat(_instanceof$w(error, Error) ? error.message : String(error));
1448
+ var message = "Could not ".concat(operation, " (").concat(facts.join(', '), "): ").concat(_instanceof$x(error, Error) ? error.message : String(error));
1447
1449
  result = new CliError({
1448
1450
  message: message,
1449
1451
  code: report.ok ? FIRESTORE_COLLECTION_UNRESOLVABLE_CODE : FIRESTORE_SDK_INSTANCE_MISMATCH_CODE,
@@ -1480,7 +1482,7 @@ function _object_spread_props$G(target, source) {
1480
1482
  sdkFromDbxFirebase = resolveFirestoreSdkIdentity(createRequire(requireFromDbxCli.resolve('@dereekb/firebase')));
1481
1483
  } catch (e) {
1482
1484
  sdkFromDbxFirebase = {
1483
- error: _instanceof$w(e, Error) ? e.message : String(e)
1485
+ error: _instanceof$x(e, Error) ? e.message : String(e)
1484
1486
  };
1485
1487
  }
1486
1488
  var firebaseVersion;
@@ -1518,7 +1520,7 @@ function _object_spread_props$G(target, source) {
1518
1520
  });
1519
1521
  } catch (e) {
1520
1522
  result = {
1521
- error: _instanceof$w(e, Error) ? e.message : String(e)
1523
+ error: _instanceof$x(e, Error) ? e.message : String(e)
1522
1524
  };
1523
1525
  }
1524
1526
  return result;
@@ -1542,7 +1544,7 @@ function _array_like_to_array$1a(arr, len) {
1542
1544
  function _array_without_holes$Y(arr) {
1543
1545
  if (Array.isArray(arr)) return _array_like_to_array$1a(arr);
1544
1546
  }
1545
- function asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, key, arg) {
1547
+ function asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, key, arg) {
1546
1548
  try {
1547
1549
  var info = gen[key](arg);
1548
1550
  var value = info.value;
@@ -1553,16 +1555,16 @@ function asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, key, arg) {
1553
1555
  if (info.done) resolve(value);
1554
1556
  else Promise.resolve(value).then(_next, _throw);
1555
1557
  }
1556
- function _async_to_generator$1r(fn) {
1558
+ function _async_to_generator$1s(fn) {
1557
1559
  return function() {
1558
1560
  var self = this, args = arguments;
1559
1561
  return new Promise(function(resolve, reject) {
1560
1562
  var gen = fn.apply(self, args);
1561
1563
  function _next(value) {
1562
- asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, "next", value);
1564
+ asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, "next", value);
1563
1565
  }
1564
1566
  function _throw(err) {
1565
- asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, "throw", err);
1567
+ asyncGeneratorStep$1s(gen, resolve, reject, _next, _throw, "throw", err);
1566
1568
  }
1567
1569
  _next(undefined);
1568
1570
  });
@@ -1579,7 +1581,7 @@ function _non_iterable_spread$Y() {
1579
1581
  function _to_consumable_array$Y(arr) {
1580
1582
  return _array_without_holes$Y(arr) || _iterable_to_array$Y(arr) || _unsupported_iterable_to_array$1a(arr) || _non_iterable_spread$Y();
1581
1583
  }
1582
- function _ts_generator$1r(thisArg, body) {
1584
+ function _ts_generator$1s(thisArg, body) {
1583
1585
  var f, y, t, _ = {
1584
1586
  label: 0,
1585
1587
  sent: function() {
@@ -1728,9 +1730,9 @@ function _unsupported_iterable_to_array$1a(o, minLen) {
1728
1730
  * @returns The session-bound {@link CliFirestoreModels}.
1729
1731
  * @throws {CliError} When the CLI was not configured with a `firestore` binding, or the session cannot be opened.
1730
1732
  */ function requireCliFirestoreModels(context) {
1731
- return _async_to_generator$1r(function() {
1733
+ return _async_to_generator$1s(function() {
1732
1734
  var getFirestoreModels;
1733
- return _ts_generator$1r(this, function(_state) {
1735
+ return _ts_generator$1s(this, function(_state) {
1734
1736
  getFirestoreModels = context.getFirestoreModels;
1735
1737
  if (!getFirestoreModels) {
1736
1738
  throw new CliError({
@@ -1891,7 +1893,7 @@ function tryReadCollectionIdentity(binding, collections, modelType) {
1891
1893
  return result;
1892
1894
  }
1893
1895
 
1894
- function asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, key, arg) {
1896
+ function asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, key, arg) {
1895
1897
  try {
1896
1898
  var info = gen[key](arg);
1897
1899
  var value = info.value;
@@ -1902,22 +1904,22 @@ function asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, key, arg) {
1902
1904
  if (info.done) resolve(value);
1903
1905
  else Promise.resolve(value).then(_next, _throw);
1904
1906
  }
1905
- function _async_to_generator$1q(fn) {
1907
+ function _async_to_generator$1r(fn) {
1906
1908
  return function() {
1907
1909
  var self = this, args = arguments;
1908
1910
  return new Promise(function(resolve, reject) {
1909
1911
  var gen = fn.apply(self, args);
1910
1912
  function _next(value) {
1911
- asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, "next", value);
1913
+ asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, "next", value);
1912
1914
  }
1913
1915
  function _throw(err) {
1914
- asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, "throw", err);
1916
+ asyncGeneratorStep$1r(gen, resolve, reject, _next, _throw, "throw", err);
1915
1917
  }
1916
1918
  _next(undefined);
1917
1919
  });
1918
1920
  };
1919
1921
  }
1920
- function _ts_generator$1q(thisArg, body) {
1922
+ function _ts_generator$1r(thisArg, body) {
1921
1923
  var f, y, t, _ = {
1922
1924
  label: 0,
1923
1925
  sent: function() {
@@ -2037,9 +2039,9 @@ function _type_of$6(obj) {
2037
2039
  * @returns The parsed {@link CliFirestoreSession}.
2038
2040
  * @throws {CliError} When the endpoint answers non-2xx or returns an unusable body.
2039
2041
  */ function fetchFirestoreSession(input) {
2040
- return _async_to_generator$1q(function() {
2042
+ return _async_to_generator$1r(function() {
2041
2043
  var url, res, text, body, session;
2042
- return _ts_generator$1q(this, function(_state) {
2044
+ return _ts_generator$1r(this, function(_state) {
2043
2045
  switch(_state.label){
2044
2046
  case 0:
2045
2047
  url = "".concat(trimSlash(input.apiBaseUrl)).concat(FIRESTORE_SESSION_API_PATH);
@@ -2176,7 +2178,12 @@ function _object_spread_props$F(target, source) {
2176
2178
  /**
2177
2179
  * The default redirect URI used by the CLI.
2178
2180
  *
2179
- * Opens up to nothing in the browser so the user can copy/paste the resulting token url back into the CLI.
2181
+ * The `0` port is a placeholder, not a bindable port: the redirect resolves to nothing in the
2182
+ * browser and the user copy/pastes the resulting URL back into the CLI.
2183
+ *
2184
+ * To have `auth login` capture the redirect automatically instead, configure a redirect URI with a
2185
+ * concrete loopback port (e.g. `http://127.0.0.1:8976/callback`) and register that exact URI with
2186
+ * the OAuth client — `auth login` binds it and reads the code straight out of the browser redirect.
2180
2187
  */ var DEFAULT_CLI_REDIRECT_URI = 'http://127.0.0.1:0/callback';
2181
2188
  /**
2182
2189
  * The generic OIDC scopes a `--service-token` login adds to the requested set.
@@ -2264,15 +2271,16 @@ function _object_spread_props$F(target, source) {
2264
2271
  var d = input.defaultEnv;
2265
2272
  var result;
2266
2273
  if (e || d) {
2267
- var _ref, _nonEmpty, _ref1, _nonEmpty1, _nonEmpty2, _nonEmpty3, _nonEmpty4, _nonEmpty5, _nonEmpty6;
2274
+ var _ref, _nonEmpty, _ref1, _nonEmpty1, _nonEmpty2, _nonEmpty3, _nonEmpty4, _nonEmpty5, _nonEmpty6, _nonEmpty7;
2268
2275
  result = {
2269
2276
  apiBaseUrl: (_ref = (_nonEmpty = nonEmpty(e === null || e === void 0 ? void 0 : e.apiBaseUrl)) !== null && _nonEmpty !== void 0 ? _nonEmpty : nonEmpty(d === null || d === void 0 ? void 0 : d.apiBaseUrl)) !== null && _ref !== void 0 ? _ref : '',
2270
2277
  oidcIssuer: (_ref1 = (_nonEmpty1 = nonEmpty(e === null || e === void 0 ? void 0 : e.oidcIssuer)) !== null && _nonEmpty1 !== void 0 ? _nonEmpty1 : nonEmpty(d === null || d === void 0 ? void 0 : d.oidcIssuer)) !== null && _ref1 !== void 0 ? _ref1 : '',
2271
2278
  appClientUrl: (_nonEmpty2 = nonEmpty(e === null || e === void 0 ? void 0 : e.appClientUrl)) !== null && _nonEmpty2 !== void 0 ? _nonEmpty2 : nonEmpty(d === null || d === void 0 ? void 0 : d.appClientUrl),
2272
2279
  clientId: (_nonEmpty3 = nonEmpty(e === null || e === void 0 ? void 0 : e.clientId)) !== null && _nonEmpty3 !== void 0 ? _nonEmpty3 : nonEmpty(d === null || d === void 0 ? void 0 : d.clientId),
2273
2280
  clientSecret: (_nonEmpty4 = nonEmpty(e === null || e === void 0 ? void 0 : e.clientSecret)) !== null && _nonEmpty4 !== void 0 ? _nonEmpty4 : nonEmpty(d === null || d === void 0 ? void 0 : d.clientSecret),
2274
- redirectUri: (_nonEmpty5 = nonEmpty(e === null || e === void 0 ? void 0 : e.redirectUri)) !== null && _nonEmpty5 !== void 0 ? _nonEmpty5 : nonEmpty(d === null || d === void 0 ? void 0 : d.redirectUri),
2275
- scopes: (_nonEmpty6 = nonEmpty(e === null || e === void 0 ? void 0 : e.scopes)) !== null && _nonEmpty6 !== void 0 ? _nonEmpty6 : nonEmpty(d === null || d === void 0 ? void 0 : d.scopes),
2281
+ tokenEndpointAuthMethod: (_nonEmpty5 = nonEmpty(e === null || e === void 0 ? void 0 : e.tokenEndpointAuthMethod)) !== null && _nonEmpty5 !== void 0 ? _nonEmpty5 : nonEmpty(d === null || d === void 0 ? void 0 : d.tokenEndpointAuthMethod),
2282
+ redirectUri: (_nonEmpty6 = nonEmpty(e === null || e === void 0 ? void 0 : e.redirectUri)) !== null && _nonEmpty6 !== void 0 ? _nonEmpty6 : nonEmpty(d === null || d === void 0 ? void 0 : d.redirectUri),
2283
+ scopes: (_nonEmpty7 = nonEmpty(e === null || e === void 0 ? void 0 : e.scopes)) !== null && _nonEmpty7 !== void 0 ? _nonEmpty7 : nonEmpty(d === null || d === void 0 ? void 0 : d.scopes),
2276
2284
  firebase: mergeCliFirebaseConfig(e === null || e === void 0 ? void 0 : e.firebase, d === null || d === void 0 ? void 0 : d.firebase)
2277
2285
  };
2278
2286
  }
@@ -2418,10 +2426,15 @@ function parsePort(value) {
2418
2426
  /**
2419
2427
  * Returns true when the env has the minimum fields needed to attempt an OAuth login or token refresh.
2420
2428
  *
2429
+ * `clientSecret` is NOT among them. A CLI is a public client in the usual case
2430
+ * (`token_endpoint_auth_method: 'none'`), authenticating with PKCE rather than a secret, so requiring
2431
+ * one here would report a correctly-configured public env as incomplete — and send the caller back to
2432
+ * `auth setup` to supply a credential the provider would then reject.
2433
+ *
2421
2434
  * @param env - The env config to check.
2422
- * @returns `true` when `apiBaseUrl`, `oidcIssuer`, `clientId`, `clientSecret`, and `redirectUri` are all present and non-empty.
2435
+ * @returns `true` when `apiBaseUrl`, `oidcIssuer`, `clientId`, and `redirectUri` are all present and non-empty.
2423
2436
  */ function isCliEnvConfigComplete(env) {
2424
- return Boolean((env === null || env === void 0 ? void 0 : env.apiBaseUrl) && (env === null || env === void 0 ? void 0 : env.oidcIssuer) && (env === null || env === void 0 ? void 0 : env.clientId) && (env === null || env === void 0 ? void 0 : env.clientSecret) && (env === null || env === void 0 ? void 0 : env.redirectUri));
2437
+ return Boolean((env === null || env === void 0 ? void 0 : env.apiBaseUrl) && (env === null || env === void 0 ? void 0 : env.oidcIssuer) && (env === null || env === void 0 ? void 0 : env.clientId) && (env === null || env === void 0 ? void 0 : env.redirectUri));
2425
2438
  }
2426
2439
  /**
2427
2440
  * Reads an OAuth token entry from environment variables, for non-interactive server consumption.
@@ -2519,7 +2532,7 @@ function parsePort(value) {
2519
2532
  }).hasExpired();
2520
2533
  }
2521
2534
 
2522
- function asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, key, arg) {
2535
+ function asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, key, arg) {
2523
2536
  try {
2524
2537
  var info = gen[key](arg);
2525
2538
  var value = info.value;
@@ -2530,16 +2543,16 @@ function asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, key, arg) {
2530
2543
  if (info.done) resolve(value);
2531
2544
  else Promise.resolve(value).then(_next, _throw);
2532
2545
  }
2533
- function _async_to_generator$1p(fn) {
2546
+ function _async_to_generator$1q(fn) {
2534
2547
  return function() {
2535
2548
  var self = this, args = arguments;
2536
2549
  return new Promise(function(resolve, reject) {
2537
2550
  var gen = fn.apply(self, args);
2538
2551
  function _next(value) {
2539
- asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, "next", value);
2552
+ asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, "next", value);
2540
2553
  }
2541
2554
  function _throw(err) {
2542
- asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, "throw", err);
2555
+ asyncGeneratorStep$1q(gen, resolve, reject, _next, _throw, "throw", err);
2543
2556
  }
2544
2557
  _next(undefined);
2545
2558
  });
@@ -2556,7 +2569,7 @@ function _define_property$Z(obj, key, value) {
2556
2569
  } else obj[key] = value;
2557
2570
  return obj;
2558
2571
  }
2559
- function _instanceof$v(left, right) {
2572
+ function _instanceof$w(left, right) {
2560
2573
  "@swc/helpers - instanceof";
2561
2574
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2562
2575
  return !!right[Symbol.hasInstance](left);
@@ -2595,7 +2608,7 @@ function _object_spread_props$E(target, source) {
2595
2608
  }
2596
2609
  return target;
2597
2610
  }
2598
- function _ts_generator$1p(thisArg, body) {
2611
+ function _ts_generator$1q(thisArg, body) {
2599
2612
  var f, y, t, _ = {
2600
2613
  label: 0,
2601
2614
  sent: function() {
@@ -2736,9 +2749,9 @@ function _ts_generator$1p(thisArg, body) {
2736
2749
  * @returns The live {@link CliFirestoreSessionContext}.
2737
2750
  * @throws {CliError} When the env lacks Firebase client config, or any step of the handshake fails.
2738
2751
  */ function createCliFirestoreSessionContext(input) {
2739
- return _async_to_generator$1p(function() {
2752
+ return _async_to_generator$1q(function() {
2740
2753
  var _ref, _getApps_find, _firebase_emulators, _firebase_emulators1, _firebase_emulators2, cliName, envName, env, accessToken, fetcher, sessionCache, _input_refreshSession, refreshSession, firebase, cached, _tmp, liveCached, fromCache, session, _tmp1, appName, app, useEmulators, appCheckToken, expireTimeMillis, emulatorHost, auth, firestore, e;
2741
- return _ts_generator$1p(this, function(_state) {
2754
+ return _ts_generator$1q(this, function(_state) {
2742
2755
  switch(_state.label){
2743
2756
  case 0:
2744
2757
  cliName = input.cliName, envName = input.envName, env = input.env, accessToken = input.accessToken, fetcher = input.fetcher, sessionCache = input.sessionCache, _input_refreshSession = input.refreshSession, refreshSession = _input_refreshSession === void 0 ? false : _input_refreshSession;
@@ -2831,8 +2844,8 @@ function _ts_generator$1p(thisArg, body) {
2831
2844
  initializeAppCheck(app, {
2832
2845
  provider: new CustomProvider({
2833
2846
  getToken: function getToken() {
2834
- return _async_to_generator$1p(function() {
2835
- return _ts_generator$1p(this, function(_state) {
2847
+ return _async_to_generator$1q(function() {
2848
+ return _ts_generator$1q(this, function(_state) {
2836
2849
  return [
2837
2850
  2,
2838
2851
  {
@@ -2897,7 +2910,7 @@ function _ts_generator$1p(thisArg, body) {
2897
2910
  ];
2898
2911
  case 13:
2899
2912
  throw new CliError({
2900
- message: "Failed to sign in with the minted custom token: ".concat(_instanceof$v(e, Error) ? e.message : String(e)),
2913
+ message: "Failed to sign in with the minted custom token: ".concat(_instanceof$w(e, Error) ? e.message : String(e)),
2901
2914
  code: 'AUTH_UNAUTHORIZED',
2902
2915
  suggestion: 'Verify the env `firebase.projectId`/`firebase.apiKey` match the project the API mints tokens for.'
2903
2916
  });
@@ -2934,8 +2947,8 @@ function _ts_generator$1p(thisArg, body) {
2934
2947
  *
2935
2948
  * @param session - The session context to close.
2936
2949
  */ function closeCliFirestoreSessionContext(session) {
2937
- return _async_to_generator$1p(function() {
2938
- return _ts_generator$1p(this, function(_state) {
2950
+ return _async_to_generator$1q(function() {
2951
+ return _ts_generator$1q(this, function(_state) {
2939
2952
  switch(_state.label){
2940
2953
  case 0:
2941
2954
  return [
@@ -2956,8 +2969,8 @@ function _ts_generator$1p(thisArg, body) {
2956
2969
  *
2957
2970
  * @param app - The app to delete.
2958
2971
  */ function closeCliFirebaseApp(app) {
2959
- return _async_to_generator$1p(function() {
2960
- return _ts_generator$1p(this, function(_state) {
2972
+ return _async_to_generator$1q(function() {
2973
+ return _ts_generator$1q(this, function(_state) {
2961
2974
  switch(_state.label){
2962
2975
  case 0:
2963
2976
  _state.trys.push([
@@ -3015,9 +3028,9 @@ function _ts_generator$1p(thisArg, body) {
3015
3028
  * consumers in the same process are left alone.
3016
3029
  * @returns Resolves once every matching app has been deleted.
3017
3030
  */ function closeAllCliFirebaseApps(input) {
3018
- return _async_to_generator$1p(function() {
3031
+ return _async_to_generator$1q(function() {
3019
3032
  var prefix, apps;
3020
- return _ts_generator$1p(this, function(_state) {
3033
+ return _ts_generator$1q(this, function(_state) {
3021
3034
  switch(_state.label){
3022
3035
  case 0:
3023
3036
  // every env this process opened a session for, which is normally exactly one
@@ -3090,7 +3103,7 @@ function _ts_generator$1p(thisArg, body) {
3090
3103
  };
3091
3104
  }
3092
3105
 
3093
- function asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, key, arg) {
3106
+ function asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, key, arg) {
3094
3107
  try {
3095
3108
  var info = gen[key](arg);
3096
3109
  var value = info.value;
@@ -3101,22 +3114,22 @@ function asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, key, arg) {
3101
3114
  if (info.done) resolve(value);
3102
3115
  else Promise.resolve(value).then(_next, _throw);
3103
3116
  }
3104
- function _async_to_generator$1o(fn) {
3117
+ function _async_to_generator$1p(fn) {
3105
3118
  return function() {
3106
3119
  var self = this, args = arguments;
3107
3120
  return new Promise(function(resolve, reject) {
3108
3121
  var gen = fn.apply(self, args);
3109
3122
  function _next(value) {
3110
- asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, "next", value);
3123
+ asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, "next", value);
3111
3124
  }
3112
3125
  function _throw(err) {
3113
- asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, "throw", err);
3126
+ asyncGeneratorStep$1p(gen, resolve, reject, _next, _throw, "throw", err);
3114
3127
  }
3115
3128
  _next(undefined);
3116
3129
  });
3117
3130
  };
3118
3131
  }
3119
- function _ts_generator$1o(thisArg, body) {
3132
+ function _ts_generator$1p(thisArg, body) {
3120
3133
  var f, y, t, _ = {
3121
3134
  label: 0,
3122
3135
  sent: function() {
@@ -3228,9 +3241,9 @@ function _ts_generator$1o(thisArg, body) {
3228
3241
  * @returns The opened (and memoized) direct-Firestore session.
3229
3242
  * @throws {CliError} When the context does not support direct-Firestore sessions.
3230
3243
  */ function requireCliFirestoreSession(context) {
3231
- return _async_to_generator$1o(function() {
3244
+ return _async_to_generator$1p(function() {
3232
3245
  var getFirestoreSession;
3233
- return _ts_generator$1o(this, function(_state) {
3246
+ return _ts_generator$1p(this, function(_state) {
3234
3247
  getFirestoreSession = context.getFirestoreSession;
3235
3248
  if (!getFirestoreSession) {
3236
3249
  throw new CliError({
@@ -3257,8 +3270,8 @@ function _ts_generator$1o(thisArg, body) {
3257
3270
  * @returns The client `FirestoreContext` an app's collections factory consumes.
3258
3271
  * @throws {CliError} When the context does not support direct-Firestore sessions.
3259
3272
  */ function requireCliFirestoreContext(context) {
3260
- return _async_to_generator$1o(function() {
3261
- return _ts_generator$1o(this, function(_state) {
3273
+ return _async_to_generator$1p(function() {
3274
+ return _ts_generator$1p(this, function(_state) {
3262
3275
  switch(_state.label){
3263
3276
  case 0:
3264
3277
  return [
@@ -3355,9 +3368,9 @@ var getCliContext = _cliContextSlot.get;
3355
3368
  return getFirestoreModelsForBinding(firestore);
3356
3369
  };
3357
3370
  function closeFirestoreSession() {
3358
- return _async_to_generator$1o(function() {
3371
+ return _async_to_generator$1p(function() {
3359
3372
  var opened, session;
3360
- return _ts_generator$1o(this, function(_state) {
3373
+ return _ts_generator$1p(this, function(_state) {
3361
3374
  switch(_state.label){
3362
3375
  case 0:
3363
3376
  opened = firestoreSession;
@@ -3436,7 +3449,7 @@ var getCliContext = _cliContextSlot.get;
3436
3449
  };
3437
3450
  }
3438
3451
 
3439
- function asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, key, arg) {
3452
+ function asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, key, arg) {
3440
3453
  try {
3441
3454
  var info = gen[key](arg);
3442
3455
  var value = info.value;
@@ -3447,22 +3460,22 @@ function asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, key, arg) {
3447
3460
  if (info.done) resolve(value);
3448
3461
  else Promise.resolve(value).then(_next, _throw);
3449
3462
  }
3450
- function _async_to_generator$1n(fn) {
3463
+ function _async_to_generator$1o(fn) {
3451
3464
  return function() {
3452
3465
  var self = this, args = arguments;
3453
3466
  return new Promise(function(resolve, reject) {
3454
3467
  var gen = fn.apply(self, args);
3455
3468
  function _next(value) {
3456
- asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, "next", value);
3469
+ asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, "next", value);
3457
3470
  }
3458
3471
  function _throw(err) {
3459
- asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, "throw", err);
3472
+ asyncGeneratorStep$1o(gen, resolve, reject, _next, _throw, "throw", err);
3460
3473
  }
3461
3474
  _next(undefined);
3462
3475
  });
3463
3476
  };
3464
3477
  }
3465
- function _ts_generator$1n(thisArg, body) {
3478
+ function _ts_generator$1o(thisArg, body) {
3466
3479
  var f, y, t, _ = {
3467
3480
  label: 0,
3468
3481
  sent: function() {
@@ -3575,9 +3588,9 @@ function _ts_generator$1n(thisArg, body) {
3575
3588
  */ function wrapCommandHandler(handler) {
3576
3589
  var exitCode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : CLI_EXIT_CODE_HANDLER;
3577
3590
  return function(argv) {
3578
- return _async_to_generator$1n(function() {
3591
+ return _async_to_generator$1o(function() {
3579
3592
  var e;
3580
- return _ts_generator$1n(this, function(_state) {
3593
+ return _ts_generator$1o(this, function(_state) {
3581
3594
  switch(_state.label){
3582
3595
  case 0:
3583
3596
  _state.trys.push([
@@ -3638,7 +3651,7 @@ function _ts_generator$1n(thisArg, body) {
3638
3651
  };
3639
3652
  }
3640
3653
 
3641
- function asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, key, arg) {
3654
+ function asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, key, arg) {
3642
3655
  try {
3643
3656
  var info = gen[key](arg);
3644
3657
  var value = info.value;
@@ -3649,22 +3662,22 @@ function asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, key, arg) {
3649
3662
  if (info.done) resolve(value);
3650
3663
  else Promise.resolve(value).then(_next, _throw);
3651
3664
  }
3652
- function _async_to_generator$1m(fn) {
3665
+ function _async_to_generator$1n(fn) {
3653
3666
  return function() {
3654
3667
  var self = this, args = arguments;
3655
3668
  return new Promise(function(resolve, reject) {
3656
3669
  var gen = fn.apply(self, args);
3657
3670
  function _next(value) {
3658
- asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, "next", value);
3671
+ asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, "next", value);
3659
3672
  }
3660
3673
  function _throw(err) {
3661
- asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, "throw", err);
3674
+ asyncGeneratorStep$1n(gen, resolve, reject, _next, _throw, "throw", err);
3662
3675
  }
3663
3676
  _next(undefined);
3664
3677
  });
3665
3678
  };
3666
3679
  }
3667
- function _ts_generator$1m(thisArg, body) {
3680
+ function _ts_generator$1n(thisArg, body) {
3668
3681
  var f, y, t, _ = {
3669
3682
  label: 0,
3670
3683
  sent: function() {
@@ -3784,9 +3797,9 @@ function _ts_generator$1m(thisArg, body) {
3784
3797
  return spec.helpEpilogue ? built.epilogue(spec.helpEpilogue) : built;
3785
3798
  },
3786
3799
  handler: wrapCommandHandler(function(argv) {
3787
- return _async_to_generator$1m(function() {
3800
+ return _async_to_generator$1n(function() {
3788
3801
  var context, result;
3789
- return _ts_generator$1m(this, function(_state) {
3802
+ return _ts_generator$1n(this, function(_state) {
3790
3803
  switch(_state.label){
3791
3804
  case 0:
3792
3805
  context = requireCliContext();
@@ -4010,7 +4023,7 @@ function _array_with_holes$o(arr) {
4010
4023
  function _array_without_holes$X(arr) {
4011
4024
  if (Array.isArray(arr)) return _array_like_to_array$18(arr);
4012
4025
  }
4013
- function asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, key, arg) {
4026
+ function asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, key, arg) {
4014
4027
  try {
4015
4028
  var info = gen[key](arg);
4016
4029
  var value = info.value;
@@ -4021,16 +4034,16 @@ function asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, key, arg) {
4021
4034
  if (info.done) resolve(value);
4022
4035
  else Promise.resolve(value).then(_next, _throw);
4023
4036
  }
4024
- function _async_to_generator$1l(fn) {
4037
+ function _async_to_generator$1m(fn) {
4025
4038
  return function() {
4026
4039
  var self = this, args = arguments;
4027
4040
  return new Promise(function(resolve, reject) {
4028
4041
  var gen = fn.apply(self, args);
4029
4042
  function _next(value) {
4030
- asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, "next", value);
4043
+ asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, "next", value);
4031
4044
  }
4032
4045
  function _throw(err) {
4033
- asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, "throw", err);
4046
+ asyncGeneratorStep$1m(gen, resolve, reject, _next, _throw, "throw", err);
4034
4047
  }
4035
4048
  _next(undefined);
4036
4049
  });
@@ -4121,7 +4134,7 @@ function _sliced_to_array$o(arr, i) {
4121
4134
  function _to_consumable_array$X(arr) {
4122
4135
  return _array_without_holes$X(arr) || _iterable_to_array$X(arr) || _unsupported_iterable_to_array$18(arr) || _non_iterable_spread$X();
4123
4136
  }
4124
- function _ts_generator$1l(thisArg, body) {
4137
+ function _ts_generator$1m(thisArg, body) {
4125
4138
  var f, y, t, _ = {
4126
4139
  label: 0,
4127
4140
  sent: function() {
@@ -4253,9 +4266,9 @@ function _defaultBuildRequestData(params, state, limit) {
4253
4266
  return base;
4254
4267
  }
4255
4268
  function _runItemTasks(input) {
4256
- return _async_to_generator$1l(function() {
4269
+ return _async_to_generator$1m(function() {
4257
4270
  var context, items, keys, pageIndex, iterateItem, itemPerformTasksConfig, maxParallelPerPage, indexed, taskConfig, performResult;
4258
- return _ts_generator$1l(this, function(_state) {
4271
+ return _ts_generator$1m(this, function(_state) {
4259
4272
  switch(_state.label){
4260
4273
  case 0:
4261
4274
  context = input.context, items = input.items, keys = input.keys, pageIndex = input.pageIndex, iterateItem = input.iterateItem, itemPerformTasksConfig = input.itemPerformTasksConfig, maxParallelPerPage = input.maxParallelPerPage;
@@ -4300,9 +4313,9 @@ function _runItemTasks(input) {
4300
4313
  })();
4301
4314
  }
4302
4315
  function _processPage(input) {
4303
- return _async_to_generator$1l(function() {
4316
+ return _async_to_generator$1m(function() {
4304
4317
  var context, raw, pageIndex, responseAdapter, iterateItem, iteratePage, itemPerformTasksConfig, maxParallelPerPage, items, keys, nextCursorDocumentKey, hasMore, itemResults, _tmp, pageResult, _tmp1, output;
4305
- return _ts_generator$1l(this, function(_state) {
4318
+ return _ts_generator$1m(this, function(_state) {
4306
4319
  switch(_state.label){
4307
4320
  case 0:
4308
4321
  context = input.context, raw = input.raw, pageIndex = input.pageIndex, responseAdapter = input.responseAdapter, iterateItem = input.iterateItem, iteratePage = input.iteratePage, itemPerformTasksConfig = input.itemPerformTasksConfig, maxParallelPerPage = input.maxParallelPerPage;
@@ -4442,9 +4455,9 @@ function _evaluateLoopExit(input) {
4442
4455
  * });
4443
4456
  * ```
4444
4457
  */ function iterateDbxCliCallModel(config) {
4445
- return _async_to_generator$1l(function() {
4458
+ return _async_to_generator$1m(function() {
4446
4459
  var context, modelType, call, specifier, params, _config_buildRequestData, buildRequestData, _config_responseAdapter, responseAdapter, limitPerPage, totalItemsLimit, maxPages, iterateItem, iteratePage, itemPerformTasksConfig, maxParallelPerPage, _config_collectItems, collectItems, _config_collectItemResults, collectItemResults, _config_collectPageResults, collectPageResults, allItems, allItemResults, allPageResults, pageIndex, totalItems, cursorDocumentKey, hitLimit, keepGoing, collectItemsForPage, collectItemResultsForPage, collectPageResultsForPage, effectiveLimit, data, raw, pageOutcome, _allItems, _allItemResults, exit, result;
4447
- return _ts_generator$1l(this, function(_state) {
4460
+ return _ts_generator$1m(this, function(_state) {
4448
4461
  switch(_state.label){
4449
4462
  case 0:
4450
4463
  context = config.context, modelType = config.modelType, call = config.call, specifier = config.specifier, params = config.params, _config_buildRequestData = config.buildRequestData, buildRequestData = _config_buildRequestData === void 0 ? _defaultBuildRequestData : _config_buildRequestData, _config_responseAdapter = config.responseAdapter, responseAdapter = _config_responseAdapter === void 0 ? _defaultResponseAdapter : _config_responseAdapter, limitPerPage = config.limitPerPage, totalItemsLimit = config.totalItemsLimit, maxPages = config.maxPages, iterateItem = config.iterateItem, iteratePage = config.iteratePage, itemPerformTasksConfig = config.itemPerformTasksConfig, maxParallelPerPage = config.maxParallelPerPage, _config_collectItems = config.collectItems, collectItems = _config_collectItems === void 0 ? true : _config_collectItems, _config_collectItemResults = config.collectItemResults, collectItemResults = _config_collectItemResults === void 0 ? iterateItem != null : _config_collectItemResults, _config_collectPageResults = config.collectPageResults, collectPageResults = _config_collectPageResults === void 0 ? iteratePage != null : _config_collectPageResults;
@@ -4545,7 +4558,7 @@ function _evaluateLoopExit(input) {
4545
4558
  })();
4546
4559
  }
4547
4560
 
4548
- function asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, key, arg) {
4561
+ function asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, key, arg) {
4549
4562
  try {
4550
4563
  var info = gen[key](arg);
4551
4564
  var value = info.value;
@@ -4556,16 +4569,16 @@ function asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, key, arg) {
4556
4569
  if (info.done) resolve(value);
4557
4570
  else Promise.resolve(value).then(_next, _throw);
4558
4571
  }
4559
- function _async_to_generator$1k(fn) {
4572
+ function _async_to_generator$1l(fn) {
4560
4573
  return function() {
4561
4574
  var self = this, args = arguments;
4562
4575
  return new Promise(function(resolve, reject) {
4563
4576
  var gen = fn.apply(self, args);
4564
4577
  function _next(value) {
4565
- asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, "next", value);
4578
+ asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, "next", value);
4566
4579
  }
4567
4580
  function _throw(err) {
4568
- asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, "throw", err);
4581
+ asyncGeneratorStep$1l(gen, resolve, reject, _next, _throw, "throw", err);
4569
4582
  }
4570
4583
  _next(undefined);
4571
4584
  });
@@ -4615,7 +4628,7 @@ function _object_spread_props$C(target, source) {
4615
4628
  }
4616
4629
  return target;
4617
4630
  }
4618
- function _ts_generator$1k(thisArg, body) {
4631
+ function _ts_generator$1l(thisArg, body) {
4619
4632
  var f, y, t, _ = {
4620
4633
  label: 0,
4621
4634
  sent: function() {
@@ -4731,9 +4744,9 @@ function _ts_generator$1k(thisArg, body) {
4731
4744
  return spec.builder ? spec.builder(yargs) : yargs;
4732
4745
  },
4733
4746
  handler: wrapCommandHandler(function(argv) {
4734
- return _async_to_generator$1k(function() {
4747
+ return _async_to_generator$1l(function() {
4735
4748
  var context, data, params, result;
4736
- return _ts_generator$1k(this, function(_state) {
4749
+ return _ts_generator$1l(this, function(_state) {
4737
4750
  switch(_state.label){
4738
4751
  case 0:
4739
4752
  context = requireCliContext();
@@ -4918,7 +4931,7 @@ function AsyncFromSyncIterator$4(s) {
4918
4931
  }
4919
4932
  }, new AsyncFromSyncIterator$4(s);
4920
4933
  }
4921
- function asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, key, arg) {
4934
+ function asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, key, arg) {
4922
4935
  try {
4923
4936
  var info = gen[key](arg);
4924
4937
  var value = info.value;
@@ -4929,22 +4942,22 @@ function asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, key, arg) {
4929
4942
  if (info.done) resolve(value);
4930
4943
  else Promise.resolve(value).then(_next, _throw);
4931
4944
  }
4932
- function _async_to_generator$1j(fn) {
4945
+ function _async_to_generator$1k(fn) {
4933
4946
  return function() {
4934
4947
  var self = this, args = arguments;
4935
4948
  return new Promise(function(resolve, reject) {
4936
4949
  var gen = fn.apply(self, args);
4937
4950
  function _next(value) {
4938
- asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, "next", value);
4951
+ asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, "next", value);
4939
4952
  }
4940
4953
  function _throw(err) {
4941
- asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, "throw", err);
4954
+ asyncGeneratorStep$1k(gen, resolve, reject, _next, _throw, "throw", err);
4942
4955
  }
4943
4956
  _next(undefined);
4944
4957
  });
4945
4958
  };
4946
4959
  }
4947
- function _ts_generator$1j(thisArg, body) {
4960
+ function _ts_generator$1k(thisArg, body) {
4948
4961
  var f, y, t, _ = {
4949
4962
  label: 0,
4950
4963
  sent: function() {
@@ -5107,9 +5120,9 @@ function _ts_generator$1j(thisArg, body) {
5107
5120
  * @returns The UTF-8 decoded stdin contents.
5108
5121
  * @throws {CliError} When stdin is a TTY, with `code: 'STDIN_NOT_PIPED'`.
5109
5122
  */ function readAllStdin() {
5110
- return _async_to_generator$1j(function() {
5123
+ return _async_to_generator$1k(function() {
5111
5124
  var chunks, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
5112
- return _ts_generator$1j(this, function(_state) {
5125
+ return _ts_generator$1k(this, function(_state) {
5113
5126
  switch(_state.label){
5114
5127
  case 0:
5115
5128
  if (process.stdin.isTTY) {
@@ -5213,9 +5226,9 @@ function _ts_generator$1j(thisArg, body) {
5213
5226
  *
5214
5227
  * @returns The tokens parsed from stdin.
5215
5228
  */ function readStdinTokens() {
5216
- return _async_to_generator$1j(function() {
5229
+ return _async_to_generator$1k(function() {
5217
5230
  var raw;
5218
- return _ts_generator$1j(this, function(_state) {
5231
+ return _ts_generator$1k(this, function(_state) {
5219
5232
  switch(_state.label){
5220
5233
  case 0:
5221
5234
  return [
@@ -5235,7 +5248,7 @@ function _ts_generator$1j(thisArg, body) {
5235
5248
  })();
5236
5249
  }
5237
5250
 
5238
- function asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, key, arg) {
5251
+ function asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, key, arg) {
5239
5252
  try {
5240
5253
  var info = gen[key](arg);
5241
5254
  var value = info.value;
@@ -5246,16 +5259,16 @@ function asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, key, arg) {
5246
5259
  if (info.done) resolve(value);
5247
5260
  else Promise.resolve(value).then(_next, _throw);
5248
5261
  }
5249
- function _async_to_generator$1i(fn) {
5262
+ function _async_to_generator$1j(fn) {
5250
5263
  return function() {
5251
5264
  var self = this, args = arguments;
5252
5265
  return new Promise(function(resolve, reject) {
5253
5266
  var gen = fn.apply(self, args);
5254
5267
  function _next(value) {
5255
- asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, "next", value);
5268
+ asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, "next", value);
5256
5269
  }
5257
5270
  function _throw(err) {
5258
- asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, "throw", err);
5271
+ asyncGeneratorStep$1j(gen, resolve, reject, _next, _throw, "throw", err);
5259
5272
  }
5260
5273
  _next(undefined);
5261
5274
  });
@@ -5272,7 +5285,7 @@ function _define_property$W(obj, key, value) {
5272
5285
  } else obj[key] = value;
5273
5286
  return obj;
5274
5287
  }
5275
- function _instanceof$u(left, right) {
5288
+ function _instanceof$v(left, right) {
5276
5289
  "@swc/helpers - instanceof";
5277
5290
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5278
5291
  return !!right[Symbol.hasInstance](left);
@@ -5311,7 +5324,7 @@ function _object_spread_props$B(target, source) {
5311
5324
  }
5312
5325
  return target;
5313
5326
  }
5314
- function _ts_generator$1i(thisArg, body) {
5327
+ function _ts_generator$1j(thisArg, body) {
5315
5328
  var f, y, t, _ = {
5316
5329
  label: 0,
5317
5330
  sent: function() {
@@ -5422,9 +5435,9 @@ function _ts_generator$1i(thisArg, body) {
5422
5435
  return withCallModelArgs(yargs);
5423
5436
  },
5424
5437
  handler: wrapCommandHandler(function(argv) {
5425
- return _async_to_generator$1i(function() {
5438
+ return _async_to_generator$1j(function() {
5426
5439
  var context, data, rawData, _tmp, params, result;
5427
- return _ts_generator$1i(this, function(_state) {
5440
+ return _ts_generator$1j(this, function(_state) {
5428
5441
  switch(_state.label){
5429
5442
  case 0:
5430
5443
  context = requireCliContext();
@@ -5459,7 +5472,7 @@ function _ts_generator$1i(thisArg, body) {
5459
5472
  data = JSON.parse(rawData);
5460
5473
  } catch (e) {
5461
5474
  throw new CliError({
5462
- message: "--data must be valid JSON: ".concat(_instanceof$u(e, Error) ? e.message : String(e)),
5475
+ message: "--data must be valid JSON: ".concat(_instanceof$v(e, Error) ? e.message : String(e)),
5463
5476
  code: 'INVALID_DATA_JSON'
5464
5477
  });
5465
5478
  }
@@ -5496,7 +5509,7 @@ function _array_like_to_array$17(arr, len) {
5496
5509
  function _array_with_holes$n(arr) {
5497
5510
  if (Array.isArray(arr)) return arr;
5498
5511
  }
5499
- function _instanceof$t(left, right) {
5512
+ function _instanceof$u(left, right) {
5500
5513
  "@swc/helpers - instanceof";
5501
5514
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5502
5515
  return !!right[Symbol.hasInstance](left);
@@ -5684,7 +5697,7 @@ function isPlainObject(value) {
5684
5697
  var result;
5685
5698
  if (value === null || (typeof value === "undefined" ? "undefined" : _type_of$5(value)) !== 'object') {
5686
5699
  result = false;
5687
- } else if (Array.isArray(value) || _instanceof$t(value, Date)) {
5700
+ } else if (Array.isArray(value) || _instanceof$u(value, Date)) {
5688
5701
  result = false;
5689
5702
  } else {
5690
5703
  // Objects from JSON.parse have Object.prototype as their proto. Anything
@@ -6142,7 +6155,7 @@ function _array_with_holes$l(arr) {
6142
6155
  function _array_without_holes$U(arr) {
6143
6156
  if (Array.isArray(arr)) return _array_like_to_array$14(arr);
6144
6157
  }
6145
- function asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, key, arg) {
6158
+ function asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, key, arg) {
6146
6159
  try {
6147
6160
  var info = gen[key](arg);
6148
6161
  var value = info.value;
@@ -6153,16 +6166,16 @@ function asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, key, arg) {
6153
6166
  if (info.done) resolve(value);
6154
6167
  else Promise.resolve(value).then(_next, _throw);
6155
6168
  }
6156
- function _async_to_generator$1h(fn) {
6169
+ function _async_to_generator$1i(fn) {
6157
6170
  return function() {
6158
6171
  var self = this, args = arguments;
6159
6172
  return new Promise(function(resolve, reject) {
6160
6173
  var gen = fn.apply(self, args);
6161
6174
  function _next(value) {
6162
- asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, "next", value);
6175
+ asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, "next", value);
6163
6176
  }
6164
6177
  function _throw(err) {
6165
- asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, "throw", err);
6178
+ asyncGeneratorStep$1i(gen, resolve, reject, _next, _throw, "throw", err);
6166
6179
  }
6167
6180
  _next(undefined);
6168
6181
  });
@@ -6179,7 +6192,7 @@ function _define_property$V(obj, key, value) {
6179
6192
  } else obj[key] = value;
6180
6193
  return obj;
6181
6194
  }
6182
- function _instanceof$s(left, right) {
6195
+ function _instanceof$t(left, right) {
6183
6196
  "@swc/helpers - instanceof";
6184
6197
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
6185
6198
  return !!right[Symbol.hasInstance](left);
@@ -6241,7 +6254,7 @@ function _sliced_to_array$l(arr, i) {
6241
6254
  function _to_consumable_array$U(arr) {
6242
6255
  return _array_without_holes$U(arr) || _iterable_to_array$U(arr) || _unsupported_iterable_to_array$14(arr) || _non_iterable_spread$U();
6243
6256
  }
6244
- function _ts_generator$1h(thisArg, body) {
6257
+ function _ts_generator$1i(thisArg, body) {
6245
6258
  var f, y, t, _ = {
6246
6259
  label: 0,
6247
6260
  sent: function() {
@@ -6443,9 +6456,9 @@ function _unsupported_iterable_to_array$14(o, minLen) {
6443
6456
  * @returns The resolved source, carrying the opened models view when it is `firestore`.
6444
6457
  * @throws {CliError} `MODEL_IS_SERVER_ONLY` for a server-only model, or the session's own error when `--via firestore` was demanded and the session could not open.
6445
6458
  */ function resolveCliReadSource(input) {
6446
- return _async_to_generator$1h(function() {
6459
+ return _async_to_generator$1i(function() {
6447
6460
  var context, via, modelType, result, _tmp;
6448
- return _ts_generator$1h(this, function(_state) {
6461
+ return _ts_generator$1i(this, function(_state) {
6449
6462
  switch(_state.label){
6450
6463
  case 0:
6451
6464
  context = input.context, via = input.via, modelType = input.modelType;
@@ -6542,9 +6555,9 @@ function _unsupported_iterable_to_array$14(o, minLen) {
6542
6555
  * @param via - The requested via, carried onto the result.
6543
6556
  * @returns The resolved source.
6544
6557
  */ function resolveAutoReadSource(context, via) {
6545
- return _async_to_generator$1h(function() {
6558
+ return _async_to_generator$1i(function() {
6546
6559
  var result, _tmp, e, code, message;
6547
- return _ts_generator$1h(this, function(_state) {
6560
+ return _ts_generator$1i(this, function(_state) {
6548
6561
  switch(_state.label){
6549
6562
  case 0:
6550
6563
  _state.trys.push([
@@ -6570,8 +6583,8 @@ function _unsupported_iterable_to_array$14(o, minLen) {
6570
6583
  ];
6571
6584
  case 2:
6572
6585
  e = _state.sent();
6573
- code = _instanceof$s(e, CliError) ? e.code : undefined;
6574
- message = _instanceof$s(e, Error) ? e.message : String(e);
6586
+ code = _instanceof$t(e, CliError) ? e.code : undefined;
6587
+ message = _instanceof$t(e, Error) ? e.message : String(e);
6575
6588
  if (code != null && CAPABILITY_FAILURE_CODES.has(code)) {
6576
6589
  verboseLog("read: --via auto → api (direct-Firestore session unavailable: ".concat(code, " ").concat(message, ")"));
6577
6590
  result = {
@@ -6597,9 +6610,9 @@ function _unsupported_iterable_to_array$14(o, minLen) {
6597
6610
  })();
6598
6611
  }
6599
6612
  function requireModels(context) {
6600
- return _async_to_generator$1h(function() {
6613
+ return _async_to_generator$1i(function() {
6601
6614
  var getFirestoreModels;
6602
- return _ts_generator$1h(this, function(_state) {
6615
+ return _ts_generator$1i(this, function(_state) {
6603
6616
  getFirestoreModels = context.getFirestoreModels;
6604
6617
  if (getFirestoreModels == null) {
6605
6618
  throw new CliError({
@@ -6647,9 +6660,9 @@ function requireModels(context) {
6647
6660
  * @returns `{ key, data }`, with `data: null` when the document does not exist.
6648
6661
  * @throws {CliError} When the key does not match the model's path shape.
6649
6662
  */ function getModelOverFirestore(input) {
6650
- return _async_to_generator$1h(function() {
6663
+ return _async_to_generator$1i(function() {
6651
6664
  var models, modelType, key, service, data, _ref, e;
6652
- return _ts_generator$1h(this, function(_state) {
6665
+ return _ts_generator$1i(this, function(_state) {
6653
6666
  switch(_state.label){
6654
6667
  case 0:
6655
6668
  models = input.models, modelType = input.modelType, key = input.key;
@@ -6708,9 +6721,9 @@ function requireModels(context) {
6708
6721
  * @returns `{ results, errors }`, key order preserved within each partition.
6709
6722
  * @throws {CliError} `INVALID_ARGUMENT` when `modelType` is not a registered model.
6710
6723
  */ function getMultipleModelsOverFirestore(input) {
6711
- return _async_to_generator$1h(function() {
6724
+ return _async_to_generator$1i(function() {
6712
6725
  var models, modelType, keys, service, taskResult;
6713
- return _ts_generator$1h(this, function(_state) {
6726
+ return _ts_generator$1i(this, function(_state) {
6714
6727
  switch(_state.label){
6715
6728
  case 0:
6716
6729
  models = input.models, modelType = input.modelType, keys = input.keys;
@@ -6722,8 +6735,8 @@ function requireModels(context) {
6722
6735
  4,
6723
6736
  performAsyncTasks(_to_consumable_array$U(keys), function(key) {
6724
6737
  var _ref;
6725
- return _async_to_generator$1h(function() {
6726
- return _ts_generator$1h(this, function(_state) {
6738
+ return _async_to_generator$1i(function() {
6739
+ return _ts_generator$1i(this, function(_state) {
6727
6740
  switch(_state.label){
6728
6741
  case 0:
6729
6742
  return [
@@ -6785,7 +6798,7 @@ function requireModels(context) {
6785
6798
  return _object_spread$U({
6786
6799
  key: key,
6787
6800
  error: mapped.message
6788
- }, _instanceof$s(mapped, CliError) ? {
6801
+ }, _instanceof$t(mapped, CliError) ? {
6789
6802
  code: mapped.code
6790
6803
  } : {});
6791
6804
  }
@@ -6802,19 +6815,19 @@ function requireModels(context) {
6802
6815
  * @returns A `CliError` for a key-shape mismatch, otherwise the original error.
6803
6816
  */ function asKeyShapeError(error, modelType, key) {
6804
6817
  var result;
6805
- if (_instanceof$s(error, Error) && /unexpected key\/path/i.test(error.message)) {
6818
+ if (_instanceof$t(error, Error) && /unexpected key\/path/i.test(error.message)) {
6806
6819
  result = new CliError({
6807
6820
  message: 'Key "'.concat(key, '" does not match the path shape for model "').concat(modelType, '": ').concat(error.message),
6808
6821
  code: 'INVALID_ARGUMENT',
6809
6822
  suggestion: 'Nested models need their full parent path, e.g. "gb/<guestbookId>/gbe/<entryId>".'
6810
6823
  });
6811
6824
  } else {
6812
- result = _instanceof$s(error, Error) ? error : new Error(String(error));
6825
+ result = _instanceof$t(error, Error) ? error : new Error(String(error));
6813
6826
  }
6814
6827
  return result;
6815
6828
  }
6816
6829
 
6817
- function asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, key, arg) {
6830
+ function asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, key, arg) {
6818
6831
  try {
6819
6832
  var info = gen[key](arg);
6820
6833
  var value = info.value;
@@ -6825,22 +6838,22 @@ function asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, key, arg) {
6825
6838
  if (info.done) resolve(value);
6826
6839
  else Promise.resolve(value).then(_next, _throw);
6827
6840
  }
6828
- function _async_to_generator$1g(fn) {
6841
+ function _async_to_generator$1h(fn) {
6829
6842
  return function() {
6830
6843
  var self = this, args = arguments;
6831
6844
  return new Promise(function(resolve, reject) {
6832
6845
  var gen = fn.apply(self, args);
6833
6846
  function _next(value) {
6834
- asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, "next", value);
6847
+ asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, "next", value);
6835
6848
  }
6836
6849
  function _throw(err) {
6837
- asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, "throw", err);
6850
+ asyncGeneratorStep$1h(gen, resolve, reject, _next, _throw, "throw", err);
6838
6851
  }
6839
6852
  _next(undefined);
6840
6853
  });
6841
6854
  };
6842
6855
  }
6843
- function _ts_generator$1g(thisArg, body) {
6856
+ function _ts_generator$1h(thisArg, body) {
6844
6857
  var f, y, t, _ = {
6845
6858
  label: 0,
6846
6859
  sent: function() {
@@ -6993,9 +7006,9 @@ function _ts_generator$1g(thisArg, body) {
6993
7006
  }));
6994
7007
  },
6995
7008
  handler: wrapCommandHandler(function(argv) {
6996
- return _async_to_generator$1g(function() {
7009
+ return _async_to_generator$1h(function() {
6997
7010
  var context, _parseGetArgs, modelType, key, resolved, result, _tmp;
6998
- return _ts_generator$1g(this, function(_state) {
7011
+ return _ts_generator$1h(this, function(_state) {
6999
7012
  switch(_state.label){
7000
7013
  case 0:
7001
7014
  context = requireCliContext();
@@ -7052,7 +7065,7 @@ function _ts_generator$1g(thisArg, body) {
7052
7065
  })
7053
7066
  };
7054
7067
 
7055
- function asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, key, arg) {
7068
+ function asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, key, arg) {
7056
7069
  try {
7057
7070
  var info = gen[key](arg);
7058
7071
  var value = info.value;
@@ -7063,22 +7076,22 @@ function asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, key, arg) {
7063
7076
  if (info.done) resolve(value);
7064
7077
  else Promise.resolve(value).then(_next, _throw);
7065
7078
  }
7066
- function _async_to_generator$1f(fn) {
7079
+ function _async_to_generator$1g(fn) {
7067
7080
  return function() {
7068
7081
  var self = this, args = arguments;
7069
7082
  return new Promise(function(resolve, reject) {
7070
7083
  var gen = fn.apply(self, args);
7071
7084
  function _next(value) {
7072
- asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, "next", value);
7085
+ asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, "next", value);
7073
7086
  }
7074
7087
  function _throw(err) {
7075
- asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, "throw", err);
7088
+ asyncGeneratorStep$1g(gen, resolve, reject, _next, _throw, "throw", err);
7076
7089
  }
7077
7090
  _next(undefined);
7078
7091
  });
7079
7092
  };
7080
7093
  }
7081
- function _ts_generator$1f(thisArg, body) {
7094
+ function _ts_generator$1g(thisArg, body) {
7082
7095
  var f, y, t, _ = {
7083
7096
  label: 0,
7084
7097
  sent: function() {
@@ -7214,9 +7227,9 @@ function _ts_generator$1f(thisArg, body) {
7214
7227
  }).epilogue(CLI_READ_VIA_EPILOGUE);
7215
7228
  },
7216
7229
  handler: wrapCommandHandler(function(argv) {
7217
- return _async_to_generator$1f(function() {
7230
+ return _async_to_generator$1g(function() {
7218
7231
  var context, firstArg, rest, resolvedFirst, resolvedRest, stdinKeys, _parseGetManyArgs, modelType, keys, resolved, result, _tmp;
7219
- return _ts_generator$1f(this, function(_state) {
7232
+ return _ts_generator$1g(this, function(_state) {
7220
7233
  switch(_state.label){
7221
7234
  case 0:
7222
7235
  context = requireCliContext();
@@ -7291,7 +7304,7 @@ function _ts_generator$1f(thisArg, body) {
7291
7304
  })
7292
7305
  };
7293
7306
 
7294
- function asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, key, arg) {
7307
+ function asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, key, arg) {
7295
7308
  try {
7296
7309
  var info = gen[key](arg);
7297
7310
  var value = info.value;
@@ -7302,16 +7315,16 @@ function asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, key, arg) {
7302
7315
  if (info.done) resolve(value);
7303
7316
  else Promise.resolve(value).then(_next, _throw);
7304
7317
  }
7305
- function _async_to_generator$1e(fn) {
7318
+ function _async_to_generator$1f(fn) {
7306
7319
  return function() {
7307
7320
  var self = this, args = arguments;
7308
7321
  return new Promise(function(resolve, reject) {
7309
7322
  var gen = fn.apply(self, args);
7310
7323
  function _next(value) {
7311
- asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, "next", value);
7324
+ asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, "next", value);
7312
7325
  }
7313
7326
  function _throw(err) {
7314
- asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, "throw", err);
7327
+ asyncGeneratorStep$1f(gen, resolve, reject, _next, _throw, "throw", err);
7315
7328
  }
7316
7329
  _next(undefined);
7317
7330
  });
@@ -7343,7 +7356,7 @@ function _object_spread$T(target) {
7343
7356
  }
7344
7357
  return target;
7345
7358
  }
7346
- function _ts_generator$1e(thisArg, body) {
7359
+ function _ts_generator$1f(thisArg, body) {
7347
7360
  var f, y, t, _ = {
7348
7361
  label: 0,
7349
7362
  sent: function() {
@@ -7502,9 +7515,9 @@ function _ts_generator$1e(thisArg, body) {
7502
7515
  * @param input.updates - The partial {@link CliConfig} to merge on top of the existing on-disk config.
7503
7516
  * @returns The merged {@link CliConfig} that was just written.
7504
7517
  */ function mergeCliConfig(input) {
7505
- return _async_to_generator$1e(function() {
7518
+ return _async_to_generator$1f(function() {
7506
7519
  var _ref, _input_updates_activeEnv, existing, merged;
7507
- return _ts_generator$1e(this, function(_state) {
7520
+ return _ts_generator$1f(this, function(_state) {
7508
7521
  switch(_state.label){
7509
7522
  case 0:
7510
7523
  return [
@@ -7629,7 +7642,7 @@ function mergeOutputCommandsConfig(existing, updates) {
7629
7642
  return result;
7630
7643
  }
7631
7644
 
7632
- function asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, key, arg) {
7645
+ function asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, key, arg) {
7633
7646
  try {
7634
7647
  var info = gen[key](arg);
7635
7648
  var value = info.value;
@@ -7640,22 +7653,22 @@ function asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, key, arg) {
7640
7653
  if (info.done) resolve(value);
7641
7654
  else Promise.resolve(value).then(_next, _throw);
7642
7655
  }
7643
- function _async_to_generator$1d(fn) {
7656
+ function _async_to_generator$1e(fn) {
7644
7657
  return function() {
7645
7658
  var self = this, args = arguments;
7646
7659
  return new Promise(function(resolve, reject) {
7647
7660
  var gen = fn.apply(self, args);
7648
7661
  function _next(value) {
7649
- asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, "next", value);
7662
+ asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, "next", value);
7650
7663
  }
7651
7664
  function _throw(err) {
7652
- asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, "throw", err);
7665
+ asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, "throw", err);
7653
7666
  }
7654
7667
  _next(undefined);
7655
7668
  });
7656
7669
  };
7657
7670
  }
7658
- function _ts_generator$1d(thisArg, body) {
7671
+ function _ts_generator$1e(thisArg, body) {
7659
7672
  var f, y, t, _ = {
7660
7673
  label: 0,
7661
7674
  sent: function() {
@@ -7782,9 +7795,9 @@ function _ts_generator$1d(thisArg, body) {
7782
7795
  * @param input - Resolution inputs.
7783
7796
  * @returns The resolved env triple.
7784
7797
  */ function resolveCliEnv(input) {
7785
- return _async_to_generator$1d(function() {
7798
+ return _async_to_generator$1e(function() {
7786
7799
  var _ref, _input_envVarName, _ref1, _input_flagEnv, _config_envs, _findCliEnvDefault, config, envVarName, envName, stored, defaultEnv, merged, env;
7787
- return _ts_generator$1d(this, function(_state) {
7800
+ return _ts_generator$1e(this, function(_state) {
7788
7801
  switch(_state.label){
7789
7802
  case 0:
7790
7803
  return [
@@ -7823,9 +7836,9 @@ function _ts_generator$1d(thisArg, body) {
7823
7836
  })();
7824
7837
  }
7825
7838
  function resolveCliEnvOrThrow(input) {
7826
- return _async_to_generator$1d(function() {
7839
+ return _async_to_generator$1e(function() {
7827
7840
  var _ref, config, envName, env;
7828
- return _ts_generator$1d(this, function(_state) {
7841
+ return _ts_generator$1e(this, function(_state) {
7829
7842
  switch(_state.label){
7830
7843
  case 0:
7831
7844
  return [
@@ -7924,7 +7937,7 @@ function resolveCliEnvOrThrow(input) {
7924
7937
  }).hasExpired();
7925
7938
  }
7926
7939
 
7927
- function asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, key, arg) {
7940
+ function asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, key, arg) {
7928
7941
  try {
7929
7942
  var info = gen[key](arg);
7930
7943
  var value = info.value;
@@ -7935,16 +7948,16 @@ function asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, key, arg) {
7935
7948
  if (info.done) resolve(value);
7936
7949
  else Promise.resolve(value).then(_next, _throw);
7937
7950
  }
7938
- function _async_to_generator$1c(fn) {
7951
+ function _async_to_generator$1d(fn) {
7939
7952
  return function() {
7940
7953
  var self = this, args = arguments;
7941
7954
  return new Promise(function(resolve, reject) {
7942
7955
  var gen = fn.apply(self, args);
7943
7956
  function _next(value) {
7944
- asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, "next", value);
7957
+ asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, "next", value);
7945
7958
  }
7946
7959
  function _throw(err) {
7947
- asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, "throw", err);
7960
+ asyncGeneratorStep$1d(gen, resolve, reject, _next, _throw, "throw", err);
7948
7961
  }
7949
7962
  _next(undefined);
7950
7963
  });
@@ -7961,7 +7974,7 @@ function _define_property$T(obj, key, value) {
7961
7974
  } else obj[key] = value;
7962
7975
  return obj;
7963
7976
  }
7964
- function _instanceof$r(left, right) {
7977
+ function _instanceof$s(left, right) {
7965
7978
  "@swc/helpers - instanceof";
7966
7979
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
7967
7980
  return !!right[Symbol.hasInstance](left);
@@ -8000,7 +8013,7 @@ function _object_spread_props$A(target, source) {
8000
8013
  }
8001
8014
  return target;
8002
8015
  }
8003
- function _ts_generator$1c(thisArg, body) {
8016
+ function _ts_generator$1d(thisArg, body) {
8004
8017
  var f, y, t, _ = {
8005
8018
  label: 0,
8006
8019
  sent: function() {
@@ -8155,7 +8168,7 @@ var cliOidcFetch = function cliOidcFetch(input, init) {
8155
8168
  * @returns A {@link CliError} for relying-party errors, otherwise the original value.
8156
8169
  */ function oidcRelyingPartyErrorToCliError(error) {
8157
8170
  var result = error;
8158
- if (_instanceof$r(error, OidcRelyingPartyError)) {
8171
+ if (_instanceof$s(error, OidcRelyingPartyError)) {
8159
8172
  var mapped = OIDC_ERROR_CODE_MAP[error.code];
8160
8173
  result = new CliError(_object_spread$S({
8161
8174
  message: error.message,
@@ -8167,9 +8180,9 @@ var cliOidcFetch = function cliOidcFetch(input, init) {
8167
8180
  return result;
8168
8181
  }
8169
8182
  function withCliErrors(fn) {
8170
- return _async_to_generator$1c(function() {
8183
+ return _async_to_generator$1d(function() {
8171
8184
  var e;
8172
- return _ts_generator$1c(this, function(_state) {
8185
+ return _ts_generator$1d(this, function(_state) {
8173
8186
  switch(_state.label){
8174
8187
  case 0:
8175
8188
  _state.trys.push([
@@ -8360,6 +8373,450 @@ function _object_spread_props$z(target, source) {
8360
8373
  }
8361
8374
  }
8362
8375
 
8376
+ function asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, key, arg) {
8377
+ try {
8378
+ var info = gen[key](arg);
8379
+ var value = info.value;
8380
+ } catch (error) {
8381
+ reject(error);
8382
+ return;
8383
+ }
8384
+ if (info.done) resolve(value);
8385
+ else Promise.resolve(value).then(_next, _throw);
8386
+ }
8387
+ function _async_to_generator$1c(fn) {
8388
+ return function() {
8389
+ var self = this, args = arguments;
8390
+ return new Promise(function(resolve, reject) {
8391
+ var gen = fn.apply(self, args);
8392
+ function _next(value) {
8393
+ asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, "next", value);
8394
+ }
8395
+ function _throw(err) {
8396
+ asyncGeneratorStep$1c(gen, resolve, reject, _next, _throw, "throw", err);
8397
+ }
8398
+ _next(undefined);
8399
+ });
8400
+ };
8401
+ }
8402
+ function _instanceof$r(left, right) {
8403
+ "@swc/helpers - instanceof";
8404
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
8405
+ return !!right[Symbol.hasInstance](left);
8406
+ } else return left instanceof right;
8407
+ }
8408
+ function _ts_generator$1c(thisArg, body) {
8409
+ var f, y, t, _ = {
8410
+ label: 0,
8411
+ sent: function() {
8412
+ if (t[0] & 1) throw t[1];
8413
+ return t[1];
8414
+ },
8415
+ trys: [],
8416
+ ops: []
8417
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
8418
+ return d(g, "next", {
8419
+ value: verb(0)
8420
+ }), d(g, "throw", {
8421
+ value: verb(1)
8422
+ }), d(g, "return", {
8423
+ value: verb(2)
8424
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
8425
+ value: function() {
8426
+ return this;
8427
+ }
8428
+ }), g;
8429
+ function verb(n) {
8430
+ return function(v) {
8431
+ return step([
8432
+ n,
8433
+ v
8434
+ ]);
8435
+ };
8436
+ }
8437
+ function step(op) {
8438
+ if (f) throw new TypeError("Generator is already executing.");
8439
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
8440
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8441
+ if (y = 0, t) op = [
8442
+ op[0] & 2,
8443
+ t.value
8444
+ ];
8445
+ switch(op[0]){
8446
+ case 0:
8447
+ case 1:
8448
+ t = op;
8449
+ break;
8450
+ case 4:
8451
+ _.label++;
8452
+ return {
8453
+ value: op[1],
8454
+ done: false
8455
+ };
8456
+ case 5:
8457
+ _.label++;
8458
+ y = op[1];
8459
+ op = [
8460
+ 0
8461
+ ];
8462
+ continue;
8463
+ case 7:
8464
+ op = _.ops.pop();
8465
+ _.trys.pop();
8466
+ continue;
8467
+ default:
8468
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
8469
+ _ = 0;
8470
+ continue;
8471
+ }
8472
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
8473
+ _.label = op[1];
8474
+ break;
8475
+ }
8476
+ if (op[0] === 6 && _.label < t[1]) {
8477
+ _.label = t[1];
8478
+ t = op;
8479
+ break;
8480
+ }
8481
+ if (t && _.label < t[2]) {
8482
+ _.label = t[2];
8483
+ _.ops.push(op);
8484
+ break;
8485
+ }
8486
+ if (t[2]) _.ops.pop();
8487
+ _.trys.pop();
8488
+ continue;
8489
+ }
8490
+ op = body.call(thisArg, _);
8491
+ } catch (e) {
8492
+ op = [
8493
+ 6,
8494
+ e
8495
+ ];
8496
+ y = 0;
8497
+ } finally{
8498
+ f = t = 0;
8499
+ }
8500
+ if (op[0] & 5) throw op[1];
8501
+ return {
8502
+ value: op[0] ? op[1] : void 0,
8503
+ done: true
8504
+ };
8505
+ }
8506
+ }
8507
+ /**
8508
+ * Hostnames RFC 8252 §7.3 treats as the loopback interface, and the exact set `oidc-provider`
8509
+ * recognizes as a loopback redirect host.
8510
+ *
8511
+ * `[::1]` carries its brackets because that is what `URL.hostname` returns for an IPv6 literal —
8512
+ * the brackets are stripped again before the address is handed to `server.listen`.
8513
+ */ var LOOPBACK_REDIRECT_HOSTNAMES = [
8514
+ '127.0.0.1',
8515
+ 'localhost',
8516
+ '[::1]'
8517
+ ];
8518
+ /**
8519
+ * The loopback port the CLI suggests when the configured redirect URI has no bindable port.
8520
+ *
8521
+ * Deliberately outside the 9900-9910 block the Firebase emulators occupy, so a suggested redirect
8522
+ * URI never collides with a running emulator.
8523
+ */ var SUGGESTED_CLI_LOOPBACK_REDIRECT_PORT = 8976;
8524
+ /**
8525
+ * Error code raised when the loopback listener cannot bind the redirect URI's port (e.g. the port
8526
+ * is already in use, or is privileged).
8527
+ */ var LOOPBACK_REDIRECT_LISTEN_FAILED_ERROR_CODE = 'AUTH_REDIRECT_LISTEN_FAILED';
8528
+ /**
8529
+ * Error code raised when no redirect reached the loopback listener within the allotted time.
8530
+ */ var LOOPBACK_REDIRECT_TIMEOUT_ERROR_CODE = 'AUTH_REDIRECT_TIMEOUT';
8531
+ /**
8532
+ * Decomposes a redirect URI into a {@link LoopbackRedirectTarget} when the CLI can bind a local
8533
+ * listener for it.
8534
+ *
8535
+ * A target is only produced for an `http:` loopback URI carrying a concrete, non-zero port. The
8536
+ * conventional `http://127.0.0.1:0/callback` placeholder is deliberately NOT capturable: binding an
8537
+ * ephemeral port would mean sending a `redirect_uri` that differs from the registered one, which
8538
+ * every OAuth provider rejects unless the client is registered as a native app (where loopback
8539
+ * ports are compared port-insensitively).
8540
+ *
8541
+ * @param input - The parse inputs.
8542
+ * @param input.redirectUri - The configured redirect URI.
8543
+ * @param input.port - Optional port override applied to the parsed URI.
8544
+ * @returns The bindable target, or `undefined` when the URI cannot be captured locally.
8545
+ * @__NO_SIDE_EFFECTS__
8546
+ */ function parseLoopbackRedirectUri(input) {
8547
+ var result;
8548
+ if (input.redirectUri) {
8549
+ var parsed;
8550
+ try {
8551
+ parsed = new URL(input.redirectUri);
8552
+ } catch (unused) {
8553
+ // A non-URL redirect (e.g. the `urn:ietf:wg:oauth:2.0:oob` out-of-band URN) is a valid
8554
+ // configuration — it just has nothing to bind.
8555
+ parsed = undefined;
8556
+ }
8557
+ if ((parsed === null || parsed === void 0 ? void 0 : parsed.protocol) === 'http:' && LOOPBACK_REDIRECT_HOSTNAMES.includes(parsed.hostname)) {
8558
+ var _input_port;
8559
+ var port = (_input_port = input.port) !== null && _input_port !== void 0 ? _input_port : Number(parsed.port);
8560
+ if (Number.isInteger(port) && port > 0) {
8561
+ parsed.port = String(port);
8562
+ result = {
8563
+ redirectUri: parsed.toString(),
8564
+ hostname: parsed.hostname,
8565
+ port: port,
8566
+ pathname: parsed.pathname
8567
+ };
8568
+ }
8569
+ }
8570
+ }
8571
+ return result;
8572
+ }
8573
+ /**
8574
+ * Renders the single page the browser lands on after the provider redirects back.
8575
+ *
8576
+ * @param input - The page inputs.
8577
+ * @param input.title - The heading + document title.
8578
+ * @param input.message - The body line under the heading.
8579
+ * @returns A self-contained HTML document.
8580
+ * @__NO_SIDE_EFFECTS__
8581
+ */ function renderLoopbackRedirectPage(input) {
8582
+ // Both values are CLI-authored or provider-supplied error text, so they are escaped rather than
8583
+ // interpolated raw — an `error_description` is attacker-influenceable in the general case.
8584
+ var escape = function escape(value) {
8585
+ return value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
8586
+ };
8587
+ var title = escape(input.title);
8588
+ var message = escape(input.message);
8589
+ return '<!doctype html><html lang="en"><head><meta charset="utf-8"><title>'.concat(title, "</title><style>body{font-family:system-ui,-apple-system,sans-serif;margin:0;display:flex;min-height:100vh;align-items:center;justify-content:center;background:#101418;color:#e8eaed}main{text-align:center;padding:2rem}h1{font-size:1.25rem;font-weight:600;margin:0 0 .5rem}p{margin:0;opacity:.75}</style></head><body><main><h1>").concat(title, "</h1><p>").concat(message, "</p></main></body></html>");
8590
+ }
8591
+ /**
8592
+ * Binds a local HTTP listener to a loopback redirect URI so the authorization code can be read
8593
+ * straight out of the browser redirect instead of being pasted back by hand.
8594
+ *
8595
+ * The listener answers exactly one path — the redirect URI's own — and serves a short "you can close
8596
+ * this tab" page. Everything else is answered `404`, which is what keeps the browser's automatic
8597
+ * `/favicon.ico` request from being mistaken for the redirect.
8598
+ *
8599
+ * @param input - The capture inputs.
8600
+ * @param input.target - The bindable target, from {@link parseLoopbackRedirectUri}.
8601
+ * @param input.successMessage - Optional override for the browser success page's body line.
8602
+ * @returns The started {@link LoopbackRedirectCapture}.
8603
+ * @throws {CliError} `AUTH_REDIRECT_LISTEN_FAILED` when the port cannot be bound.
8604
+ */ function startLoopbackRedirectCapture(input) {
8605
+ return _async_to_generator$1c(function() {
8606
+ var target, sockets, resolveRedirect, redirect, handleRequest, hostnames, bindings, servers, close;
8607
+ return _ts_generator$1c(this, function(_state) {
8608
+ switch(_state.label){
8609
+ case 0:
8610
+ target = input.target;
8611
+ sockets = new Set();
8612
+ resolveRedirect = noop;
8613
+ redirect = new Promise(function(resolve) {
8614
+ resolveRedirect = resolve;
8615
+ });
8616
+ handleRequest = function handleRequest(req, res) {
8617
+ var requestUrl;
8618
+ try {
8619
+ var _req_url;
8620
+ requestUrl = new URL((_req_url = req.url) !== null && _req_url !== void 0 ? _req_url : '/', target.redirectUri);
8621
+ } catch (unused) {
8622
+ requestUrl = undefined;
8623
+ }
8624
+ if ((requestUrl === null || requestUrl === void 0 ? void 0 : requestUrl.pathname) === target.pathname) {
8625
+ var _requestUrl_searchParams_get, _input_successMessage;
8626
+ var error = requestUrl.searchParams.get('error');
8627
+ var page = error ? renderLoopbackRedirectPage({
8628
+ title: 'Sign-in failed',
8629
+ message: (_requestUrl_searchParams_get = requestUrl.searchParams.get('error_description')) !== null && _requestUrl_searchParams_get !== void 0 ? _requestUrl_searchParams_get : error
8630
+ }) : renderLoopbackRedirectPage({
8631
+ title: 'Signed in',
8632
+ message: (_input_successMessage = input.successMessage) !== null && _input_successMessage !== void 0 ? _input_successMessage : 'You can close this tab and return to your terminal.'
8633
+ });
8634
+ res.writeHead(error ? 400 : 200, {
8635
+ 'content-type': 'text/html; charset=utf-8',
8636
+ connection: 'close'
8637
+ });
8638
+ res.end(page);
8639
+ resolveRedirect(requestUrl.toString());
8640
+ } else {
8641
+ res.writeHead(404, {
8642
+ 'content-type': 'text/plain; charset=utf-8',
8643
+ connection: 'close'
8644
+ });
8645
+ res.end('Not found.');
8646
+ }
8647
+ };
8648
+ // `localhost` is bound on BOTH loopback families rather than on whatever the resolver happens to
8649
+ // return first. Node binds a single address, and browsers pick their own — a listener that landed
8650
+ // only on `::1` refuses the connection whenever the browser reaches for `127.0.0.1`.
8651
+ // An explicit literal is bound as written; `URL.hostname` brackets an IPv6 literal, and
8652
+ // `server.listen` wants the bare address.
8653
+ hostnames = target.hostname === 'localhost' ? [
8654
+ '::1',
8655
+ '127.0.0.1'
8656
+ ] : [
8657
+ target.hostname.replaceAll(/^\[|\]$/g, '')
8658
+ ];
8659
+ return [
8660
+ 4,
8661
+ Promise.all(hostnames.map(function(hostname) {
8662
+ return new Promise(function(resolveBinding) {
8663
+ var server = createServer(handleRequest);
8664
+ var onListenError = function onListenError(e) {
8665
+ resolveBinding(new CliError({
8666
+ message: "Could not bind the loopback redirect listener on ".concat(hostname, ":").concat(target.port, " (").concat(e.message, ")."),
8667
+ code: LOOPBACK_REDIRECT_LISTEN_FAILED_ERROR_CODE
8668
+ }));
8669
+ };
8670
+ server.once('error', onListenError);
8671
+ server.on('connection', function(socket) {
8672
+ sockets.add(socket);
8673
+ socket.once('close', function() {
8674
+ return sockets.delete(socket);
8675
+ });
8676
+ });
8677
+ server.listen(target.port, hostname, function() {
8678
+ server.removeListener('error', onListenError);
8679
+ // Past bind, a socket-level error (a browser hanging up mid-response) must not take the
8680
+ // CLI down — the flow either already has its code or falls through to the paste prompt.
8681
+ server.on('error', noop);
8682
+ resolveBinding(server);
8683
+ });
8684
+ });
8685
+ }))
8686
+ ];
8687
+ case 1:
8688
+ bindings = _state.sent();
8689
+ servers = bindings.filter(function(x) {
8690
+ return !_instanceof$r(x, CliError);
8691
+ });
8692
+ if (servers.length === 0) {
8693
+ // Both families failing is one failure to report; the first is the representative one.
8694
+ throw bindings[0];
8695
+ }
8696
+ close = function close() {
8697
+ return new Promise(function(resolveClose) {
8698
+ sockets.forEach(function(socket) {
8699
+ return socket.destroy();
8700
+ });
8701
+ sockets.clear();
8702
+ void Promise.all(servers.map(function(server) {
8703
+ return new Promise(function(resolveServer) {
8704
+ return server.close(function() {
8705
+ return resolveServer();
8706
+ });
8707
+ });
8708
+ })).then(function() {
8709
+ return resolveClose();
8710
+ });
8711
+ });
8712
+ };
8713
+ return [
8714
+ 2,
8715
+ {
8716
+ redirectUri: target.redirectUri,
8717
+ port: target.port,
8718
+ waitForRedirect: function waitForRedirect(timeoutMs) {
8719
+ var result;
8720
+ if (timeoutMs != null && timeoutMs > 0) {
8721
+ result = new Promise(function(resolveWait, rejectWait) {
8722
+ var // A caller that races this against another source (the paste prompt) abandons the loser
8723
+ // mid-flight — a still-ref'd timer would then hold the CLI open for the rest of the
8724
+ // timeout after the command was otherwise done.
8725
+ _timer_unref;
8726
+ var timer = setTimeout(function() {
8727
+ rejectWait(new CliError({
8728
+ message: "Timed out after ".concat(timeoutMs, "ms waiting for the browser redirect to ").concat(target.redirectUri, "."),
8729
+ code: LOOPBACK_REDIRECT_TIMEOUT_ERROR_CODE
8730
+ }));
8731
+ }, timeoutMs);
8732
+ (_timer_unref = timer.unref) === null || _timer_unref === void 0 ? void 0 : _timer_unref.call(timer);
8733
+ redirect.then(function(url) {
8734
+ clearTimeout(timer);
8735
+ resolveWait(url);
8736
+ }, rejectWait);
8737
+ });
8738
+ } else {
8739
+ result = redirect;
8740
+ }
8741
+ return result;
8742
+ },
8743
+ close: close
8744
+ }
8745
+ ];
8746
+ }
8747
+ });
8748
+ })();
8749
+ }
8750
+
8751
+ /**
8752
+ * Opens a URL in the user's default browser.
8753
+ *
8754
+ * Shells out to the platform's URL handler (`open` on macOS, `start` on Windows, `xdg-open`
8755
+ * elsewhere) rather than taking a dependency for what is a single spawn. The child is detached with
8756
+ * its stdio ignored, so the browser neither holds the CLI's event loop open nor interleaves output
8757
+ * into the CLI's own stdout/stderr.
8758
+ *
8759
+ * Never throws or rejects: a headless machine with no handler registered is an ordinary outcome, and
8760
+ * the caller falls back to the printed URL.
8761
+ *
8762
+ * @param input - The open inputs.
8763
+ * @param input.url - The URL to open.
8764
+ * @returns `true` when the handler process was spawned, `false` when it could not be.
8765
+ */ function openUrlInBrowser(input) {
8766
+ var url = input.url;
8767
+ var command;
8768
+ var args;
8769
+ var windowsVerbatimArguments = false;
8770
+ switch(process.platform){
8771
+ case 'darwin':
8772
+ command = 'open';
8773
+ args = [
8774
+ url
8775
+ ];
8776
+ break;
8777
+ case 'win32':
8778
+ // `start` is a cmd builtin whose first quoted argument is the window title, hence the empty
8779
+ // `""`. `windowsVerbatimArguments` suppresses Node's own quoting so the `^`-escaped `&`
8780
+ // separating the OAuth query params survives — unescaped, cmd reads it as a command separator
8781
+ // and truncates the authorization URL at the first parameter.
8782
+ command = 'cmd.exe';
8783
+ args = [
8784
+ '/s',
8785
+ '/c',
8786
+ 'start',
8787
+ '""',
8788
+ '/b',
8789
+ url.replaceAll('&', '^&')
8790
+ ];
8791
+ windowsVerbatimArguments = true;
8792
+ break;
8793
+ default:
8794
+ command = 'xdg-open';
8795
+ args = [
8796
+ url
8797
+ ];
8798
+ break;
8799
+ }
8800
+ return new Promise(function(resolve) {
8801
+ try {
8802
+ var child = spawn(command, args, {
8803
+ detached: true,
8804
+ stdio: 'ignore',
8805
+ windowsVerbatimArguments: windowsVerbatimArguments
8806
+ });
8807
+ child.once('error', function() {
8808
+ return resolve(false);
8809
+ });
8810
+ child.once('spawn', function() {
8811
+ child.unref();
8812
+ resolve(true);
8813
+ });
8814
+ } catch (unused) {
8815
+ resolve(false);
8816
+ }
8817
+ });
8818
+ }
8819
+
8363
8820
  /**
8364
8821
  * Error code thrown by {@link promptLine} when the user cancels a masked prompt with Ctrl-C.
8365
8822
  *
@@ -8377,17 +8834,18 @@ var KEY_DEL = ''; // DEL
8377
8834
  * pasted redirect URL.
8378
8835
  *
8379
8836
  * Rejects with a {@link CliError} (`code: 'PROMPT_CANCELLED'`) when the user presses Ctrl-C
8380
- * during a masked prompt, instead of forcibly terminating the process.
8837
+ * during a masked prompt, or when `signal` aborts, instead of forcibly terminating the process.
8381
8838
  *
8382
8839
  * @param input - The prompt inputs.
8383
8840
  * @param input.question - The prompt text written to stdout (or stderr when masking).
8384
8841
  * @param input.mask - When `true`, characters are echoed as `*` and Ctrl-C cancels the prompt.
8842
+ * @param input.signal - Optional signal that cancels the prompt and releases stdin.
8385
8843
  * @returns The line entered by the user (without the trailing newline).
8386
8844
  */ function promptLine(input) {
8387
8845
  var result;
8388
8846
  if (input.mask) {
8389
8847
  result = new Promise(function(resolve, reject) {
8390
- var _process_stdin_setRawMode, _process_stdin;
8848
+ var _input_signal, _process_stdin_setRawMode, _process_stdin;
8391
8849
  var stdout = process.stdout;
8392
8850
  stdout.write(input.question);
8393
8851
  var buffer = '';
@@ -8443,6 +8901,20 @@ var KEY_DEL = ''; // DEL
8443
8901
  }
8444
8902
  }
8445
8903
  };
8904
+ var onAbort = function onAbort() {
8905
+ var _process_stdin_setRawMode, _process_stdin;
8906
+ stdout.write('\n');
8907
+ process.stdin.removeListener('data', onData);
8908
+ (_process_stdin_setRawMode = (_process_stdin = process.stdin).setRawMode) === null || _process_stdin_setRawMode === void 0 ? void 0 : _process_stdin_setRawMode.call(_process_stdin, false);
8909
+ process.stdin.pause();
8910
+ reject(new CliError({
8911
+ message: 'Prompt cancelled.',
8912
+ code: PROMPT_CANCELLED_ERROR_CODE
8913
+ }));
8914
+ };
8915
+ (_input_signal = input.signal) === null || _input_signal === void 0 ? void 0 : _input_signal.addEventListener('abort', onAbort, {
8916
+ once: true
8917
+ });
8446
8918
  (_process_stdin_setRawMode = (_process_stdin = process.stdin).setRawMode) === null || _process_stdin_setRawMode === void 0 ? void 0 : _process_stdin_setRawMode.call(_process_stdin, true);
8447
8919
  process.stdin.resume();
8448
8920
  process.stdin.on('data', onData);
@@ -8453,11 +8925,30 @@ var KEY_DEL = ''; // DEL
8453
8925
  output: process.stdout,
8454
8926
  terminal: false
8455
8927
  });
8456
- result = new Promise(function(resolve) {
8457
- rl.question(input.question, function(answer) {
8928
+ result = new Promise(function(resolve, reject) {
8929
+ var signal = input.signal;
8930
+ var onAbort = function onAbort() {
8458
8931
  rl.close();
8459
- resolve(answer);
8460
- });
8932
+ // `rl.close()` detaches the interface but leaves the stream flowing, which keeps the CLI's
8933
+ // event loop alive after the racing source already produced the answer.
8934
+ process.stdin.pause();
8935
+ reject(new CliError({
8936
+ message: 'Prompt cancelled.',
8937
+ code: PROMPT_CANCELLED_ERROR_CODE
8938
+ }));
8939
+ };
8940
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
8941
+ onAbort();
8942
+ } else {
8943
+ signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', onAbort, {
8944
+ once: true
8945
+ });
8946
+ rl.question(input.question, function(answer) {
8947
+ signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', onAbort);
8948
+ rl.close();
8949
+ resolve(answer);
8950
+ });
8951
+ }
8461
8952
  });
8462
8953
  }
8463
8954
  return result;
@@ -8632,6 +9123,13 @@ function _ts_generator$1b(thisArg, body) {
8632
9123
  };
8633
9124
  }
8634
9125
  }
9126
+ /**
9127
+ * Default time `auth login` waits for the browser redirect to reach the loopback listener before
9128
+ * falling back to the paste prompt.
9129
+ *
9130
+ * Long enough to cover a first-time sign-in (account picker, password manager, MFA, consent screen),
9131
+ * since the fallback costs the user the whole flow again.
9132
+ */ var DEFAULT_AUTH_LOGIN_LISTEN_FOR = '5m';
8635
9133
  function resolveAuthSetupPrompt(input) {
8636
9134
  return _async_to_generator$1b(function() {
8637
9135
  var argvValue, existingValue, prompt, mask, result, answer;
@@ -8646,19 +9144,33 @@ function resolveAuthSetupPrompt(input) {
8646
9144
  result = argvValue;
8647
9145
  return [
8648
9146
  3,
8649
- 4
9147
+ 5
8650
9148
  ];
8651
9149
  case 1:
8652
- if (!existingValue) return [
9150
+ if (!(argvValue === '')) return [
8653
9151
  3,
8654
9152
  2
8655
9153
  ];
8656
- result = existingValue;
9154
+ // An EXPLICIT empty flag clears the stored value. Distinguished from an absent flag — which is
9155
+ // `undefined` and falls through to the existing value — because the two mean opposite things:
9156
+ // `--client-secret ''` is how a confidential client is converted to a public one, and treating
9157
+ // it as "not supplied" silently keeps the old secret, which the provider then rejects.
9158
+ result = undefined;
8657
9159
  return [
8658
9160
  3,
8659
- 4
9161
+ 5
8660
9162
  ];
8661
9163
  case 2:
9164
+ if (!existingValue) return [
9165
+ 3,
9166
+ 3
9167
+ ];
9168
+ result = existingValue;
9169
+ return [
9170
+ 3,
9171
+ 5
9172
+ ];
9173
+ case 3:
8662
9174
  return [
8663
9175
  4,
8664
9176
  promptLine({
@@ -8666,11 +9178,11 @@ function resolveAuthSetupPrompt(input) {
8666
9178
  mask: mask
8667
9179
  })
8668
9180
  ];
8669
- case 3:
9181
+ case 4:
8670
9182
  answer = _state.sent().trim();
8671
9183
  result = answer.length > 0 ? answer : existingValue;
8672
- _state.label = 4;
8673
- case 4:
9184
+ _state.label = 5;
9185
+ case 5:
8674
9186
  return [
8675
9187
  2,
8676
9188
  result
@@ -8852,7 +9364,15 @@ function resolveAuthSetupPrompt(input) {
8852
9364
  describe: 'OAuth client ID registered with the target app'
8853
9365
  }).option('client-secret', {
8854
9366
  type: 'string',
8855
- describe: 'OAuth client secret'
9367
+ describe: "OAuth client secret; omit for a public (PKCE) client, or pass '' to clear a stored one"
9368
+ }).option('token-endpoint-auth-method', {
9369
+ type: 'string',
9370
+ choices: [
9371
+ 'none',
9372
+ 'client_secret_post',
9373
+ 'client_secret_basic'
9374
+ ],
9375
+ describe: "The OAuth client's registered token_endpoint_auth_method; 'none' marks a public (PKCE) client and skips the client-secret prompt"
8856
9376
  }).option('redirect-uri', {
8857
9377
  type: 'string',
8858
9378
  describe: 'OAuth redirect URI registered with the OAuth client'
@@ -8867,7 +9387,7 @@ function resolveAuthSetupPrompt(input) {
8867
9387
  },
8868
9388
  handler: wrapCommandHandler(function(argv) {
8869
9389
  return _async_to_generator$1b(function() {
8870
- var _ref, _ref1, _argv_env, _ref2, _ref3, _argv_appClientUrl, _ref4, _ref5, _argv_scopes, _config_envs, _findCliEnvDefault, config, envName, stored, defaultEnv, existing, apiBaseUrl, oidcIssuer, appClientUrl, clientId, clientSecret, redirectUri, scopes, nextEnv, merged;
9390
+ var _ref, _ref1, _argv_env, _ref2, _ref3, _argv_appClientUrl, _argv_tokenEndpointAuthMethod, _ref4, _ref5, _argv_scopes, _config_envs, _findCliEnvDefault, config, envName, stored, defaultEnv, existing, apiBaseUrl, oidcIssuer, appClientUrl, clientId, tokenEndpointAuthMethod, publicClient, clientSecret, _tmp, redirectUri, scopes, nextEnv, merged;
8871
9391
  return _ts_generator$1b(this, function(_state) {
8872
9392
  switch(_state.label){
8873
9393
  case 0:
@@ -8926,6 +9446,22 @@ function resolveAuthSetupPrompt(input) {
8926
9446
  ];
8927
9447
  case 4:
8928
9448
  clientId = _state.sent();
9449
+ tokenEndpointAuthMethod = (_argv_tokenEndpointAuthMethod = argv.tokenEndpointAuthMethod) !== null && _argv_tokenEndpointAuthMethod !== void 0 ? _argv_tokenEndpointAuthMethod : existing === null || existing === void 0 ? void 0 : existing.tokenEndpointAuthMethod;
9450
+ // A public client has no secret to ask for, so a KNOWN `none` skips the prompt entirely rather
9451
+ // than asking and accepting an empty answer. Any other value — including an unknown one — keeps
9452
+ // the prompt, since "no secret configured yet" and "never has a secret" are indistinguishable
9453
+ // without this field.
9454
+ publicClient = tokenEndpointAuthMethod === 'none';
9455
+ if (!publicClient) return [
9456
+ 3,
9457
+ 5
9458
+ ];
9459
+ _tmp = undefined;
9460
+ return [
9461
+ 3,
9462
+ 7
9463
+ ];
9464
+ case 5:
8929
9465
  return [
8930
9466
  4,
8931
9467
  resolveAuthSetupPrompt({
@@ -8935,8 +9471,11 @@ function resolveAuthSetupPrompt(input) {
8935
9471
  mask: true
8936
9472
  })
8937
9473
  ];
8938
- case 5:
8939
- clientSecret = _state.sent();
9474
+ case 6:
9475
+ _tmp = _state.sent();
9476
+ _state.label = 7;
9477
+ case 7:
9478
+ clientSecret = _tmp;
8940
9479
  return [
8941
9480
  4,
8942
9481
  resolveAuthSetupPrompt({
@@ -8945,12 +9484,16 @@ function resolveAuthSetupPrompt(input) {
8945
9484
  prompt: "Redirect URI [".concat((_ref5 = existing === null || existing === void 0 ? void 0 : existing.redirectUri) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_CLI_REDIRECT_URI, "]: ")
8946
9485
  })
8947
9486
  ];
8948
- case 6:
9487
+ case 8:
8949
9488
  redirectUri = (_ref4 = _state.sent()) !== null && _ref4 !== void 0 ? _ref4 : DEFAULT_CLI_REDIRECT_URI;
8950
9489
  scopes = (_argv_scopes = argv.scopes) !== null && _argv_scopes !== void 0 ? _argv_scopes : existing === null || existing === void 0 ? void 0 : existing.scopes;
8951
- if (!apiBaseUrl || !oidcIssuer || !clientId || !clientSecret) {
9490
+ // `clientSecret` is deliberately NOT required: a CLI is a public client in the usual case
9491
+ // (`token_endpoint_auth_method: 'none'`), authenticating with PKCE instead of a secret. The
9492
+ // protocol layer already omits an absent secret from the token request, so requiring one here
9493
+ // was the only thing making a public client unconfigurable.
9494
+ if (!apiBaseUrl || !oidcIssuer || !clientId) {
8952
9495
  throw new CliError({
8953
- message: 'apiBaseUrl, oidcIssuer, clientId, and clientSecret are all required.',
9496
+ message: 'apiBaseUrl, oidcIssuer, and clientId are all required.',
8954
9497
  code: 'AUTH_SETUP_INCOMPLETE'
8955
9498
  });
8956
9499
  }
@@ -8958,9 +9501,12 @@ function resolveAuthSetupPrompt(input) {
8958
9501
  apiBaseUrl: apiBaseUrl,
8959
9502
  oidcIssuer: oidcIssuer,
8960
9503
  clientId: clientId,
8961
- clientSecret: clientSecret,
8962
9504
  redirectUri: redirectUri
8963
- }, appClientUrl ? {
9505
+ }, clientSecret ? {
9506
+ clientSecret: clientSecret
9507
+ } : {}, tokenEndpointAuthMethod ? {
9508
+ tokenEndpointAuthMethod: tokenEndpointAuthMethod
9509
+ } : {}, appClientUrl ? {
8964
9510
  appClientUrl: appClientUrl
8965
9511
  } : {}, scopes ? {
8966
9512
  scopes: scopes
@@ -8977,7 +9523,7 @@ function resolveAuthSetupPrompt(input) {
8977
9523
  } : {})
8978
9524
  })
8979
9525
  ];
8980
- case 7:
9526
+ case 9:
8981
9527
  merged = _state.sent();
8982
9528
  outputResult({
8983
9529
  saved: true,
@@ -9000,8 +9546,19 @@ function resolveAuthSetupPrompt(input) {
9000
9546
  builder: function builder(yargs) {
9001
9547
  return withEnv(yargs).option('open', {
9002
9548
  type: 'boolean',
9003
- default: false,
9004
- describe: 'Print the auth URL only (does not auto-open a browser)'
9549
+ default: true,
9550
+ describe: 'Open the authorization URL in the default browser. Use --no-open to print it only.'
9551
+ }).option('listen', {
9552
+ type: 'boolean',
9553
+ default: true,
9554
+ describe: 'Bind the loopback redirect URI and read the authorization code straight out of the browser redirect. Use --no-listen to always paste it back by hand.'
9555
+ }).option('listen-for', {
9556
+ type: 'string',
9557
+ default: DEFAULT_AUTH_LOGIN_LISTEN_FOR,
9558
+ describe: "How long to wait for the browser redirect before falling back to the paste prompt (e.g. 5m, 90s). Defaults to ".concat(DEFAULT_AUTH_LOGIN_LISTEN_FOR, ".")
9559
+ }).option('redirect-port', {
9560
+ type: 'number',
9561
+ describe: 'Bind the loopback listener on this port instead of the one in the configured redirect URI. The resulting redirect URI must also be registered with the OAuth client.'
9005
9562
  }).option('code', {
9006
9563
  type: 'string',
9007
9564
  describe: 'Skip the prompt and pass the redirect URL or bare code directly'
@@ -9021,7 +9578,7 @@ function resolveAuthSetupPrompt(input) {
9021
9578
  },
9022
9579
  handler: wrapCommandHandler(function(argv) {
9023
9580
  return _async_to_generator$1b(function() {
9024
- var _argv_code, _tokenResponse_expires_in, _ref, _ref1, envName, env, meta, _ref2, codeVerifier, codeChallenge, state, requestedScopes, requestedSessionTtlSeconds, ms, url, pasted, _tmp, code, tokenResponse, expiresAt, sessionInfo, sessionExpiresAt, rotationDisabled, entry, sessionSummary;
9581
+ var _argv_listenFor, _ref, _tokenResponse_expires_in, _ref1, _ref2, envName, env, meta, _ref3, codeVerifier, codeChallenge, state, requestedScopes, requestedSessionTtlSeconds, ms, listenForMs, suppliedCode, shouldListen, loopbackTarget, capture, e, suggestedRedirectUri, redirectUri, url, _tmp, pasted, controller, prompt, redirected, e1, code, tokenResponse, expiresAt, sessionInfo, sessionExpiresAt, rotationDisabled, entry, sessionSummary;
9025
9582
  return _ts_generator$1b(this, function(_state) {
9026
9583
  switch(_state.label){
9027
9584
  case 0:
@@ -9037,7 +9594,7 @@ function resolveAuthSetupPrompt(input) {
9037
9594
  })
9038
9595
  ];
9039
9596
  case 1:
9040
- _ref1 = _state.sent(), envName = _ref1.envName, env = _ref1.env;
9597
+ _ref2 = _state.sent(), envName = _ref2.envName, env = _ref2.env;
9041
9598
  return [
9042
9599
  4,
9043
9600
  discoverOidcMetadata({
@@ -9052,7 +9609,7 @@ function resolveAuthSetupPrompt(input) {
9052
9609
  generatePkceMaterial()
9053
9610
  ];
9054
9611
  case 3:
9055
- _ref2 = _state.sent(), codeVerifier = _ref2.codeVerifier, codeChallenge = _ref2.codeChallenge;
9612
+ _ref3 = _state.sent(), codeVerifier = _ref3.codeVerifier, codeChallenge = _ref3.codeChallenge;
9056
9613
  state = generateOAuthState();
9057
9614
  requestedScopes = argv.readOnlyScopes ? filterReadOnlyModelScopes(env.scopes) : env.scopes;
9058
9615
  if (argv.serviceToken) {
@@ -9071,42 +9628,214 @@ function resolveAuthSetupPrompt(input) {
9071
9628
  }
9072
9629
  requestedSessionTtlSeconds = Math.floor(ms / MS_IN_SECOND);
9073
9630
  }
9631
+ listenForMs = durationDataToMilliseconds(parseDurationString((_argv_listenFor = argv.listenFor) !== null && _argv_listenFor !== void 0 ? _argv_listenFor : DEFAULT_AUTH_LOGIN_LISTEN_FOR));
9632
+ if (listenForMs <= 0) {
9633
+ throw new CliError({
9634
+ message: '--listen-for: invalid duration "'.concat(argv.listenFor, '". Use formats like "5m", "90s", or mixed units like "1h30m".'),
9635
+ code: 'AUTH_LISTEN_FOR_INVALID'
9636
+ });
9637
+ }
9638
+ // The loopback listener is started BEFORE the authorization URL is built: the port it binds is
9639
+ // part of the `redirect_uri` the provider echoes back, so it has to be settled first.
9640
+ suppliedCode = argv.code;
9641
+ shouldListen = suppliedCode == null && argv.listen !== false;
9642
+ loopbackTarget = shouldListen ? parseLoopbackRedirectUri({
9643
+ redirectUri: env.redirectUri,
9644
+ port: argv.redirectPort
9645
+ }) : undefined;
9646
+ if (!loopbackTarget) return [
9647
+ 3,
9648
+ 8
9649
+ ];
9650
+ _state.label = 4;
9651
+ case 4:
9652
+ _state.trys.push([
9653
+ 4,
9654
+ 6,
9655
+ ,
9656
+ 7
9657
+ ]);
9658
+ return [
9659
+ 4,
9660
+ startLoopbackRedirectCapture({
9661
+ target: loopbackTarget
9662
+ })
9663
+ ];
9664
+ case 5:
9665
+ capture = _state.sent();
9666
+ return [
9667
+ 3,
9668
+ 7
9669
+ ];
9670
+ case 6:
9671
+ e = _state.sent();
9672
+ // A port that is already in use is not worth failing the whole login over — the paste
9673
+ // flow is still there, and it is what the CLI did unconditionally before.
9674
+ process.stderr.write("".concat(e.message, " Falling back to pasting the redirect URL.\n"));
9675
+ return [
9676
+ 3,
9677
+ 7
9678
+ ];
9679
+ case 7:
9680
+ return [
9681
+ 3,
9682
+ 9
9683
+ ];
9684
+ case 8:
9685
+ if (shouldListen) {
9686
+ suggestedRedirectUri = "http://127.0.0.1:".concat(SUGGESTED_CLI_LOOPBACK_REDIRECT_PORT, "/callback");
9687
+ process.stderr.write('Redirect capture is unavailable: "'.concat(env.redirectUri, '" has no loopback port to bind.\n To capture the redirect automatically, register ').concat(suggestedRedirectUri, " with the OAuth client, then run:\n ").concat(cliName, " auth setup --env ").concat(envName, " --redirect-uri ").concat(suggestedRedirectUri, "\n"));
9688
+ }
9689
+ _state.label = 9;
9690
+ case 9:
9691
+ // Identical to the configured redirect URI unless `--redirect-port` moved it, and it is what
9692
+ // the token exchange must echo back — a mismatch there is rejected as `invalid_grant`.
9693
+ redirectUri = (_ref = capture === null || capture === void 0 ? void 0 : capture.redirectUri) !== null && _ref !== void 0 ? _ref : env.redirectUri;
9074
9694
  url = buildAuthorizationUrl({
9075
9695
  authorizationEndpoint: meta.authorization_endpoint,
9076
9696
  oidcIssuer: env.oidcIssuer,
9077
9697
  apiBaseUrl: env.apiBaseUrl,
9078
9698
  appClientUrl: env.appClientUrl,
9079
9699
  clientId: env.clientId,
9080
- redirectUri: env.redirectUri,
9700
+ redirectUri: redirectUri,
9081
9701
  scopes: requestedScopes,
9082
9702
  state: state,
9083
9703
  codeChallenge: codeChallenge,
9084
9704
  requestedSessionTtlSeconds: requestedSessionTtlSeconds
9085
9705
  });
9086
- // The CLI never opens a browser itself — it prints the URL and reads the redirect back.
9087
- // Emit the URL through a clearly-prefixed stderr line so JSON stdout stays parseable.
9706
+ // Printed even when the browser opens: it is the fallback whenever the launch fails, and the
9707
+ // record of what was opened. Emitted on stderr so JSON stdout stays parseable.
9088
9708
  process.stderr.write("Authorization URL:\n ".concat(url, "\n"));
9089
- if (!((_argv_code = argv.code) !== null && _argv_code !== void 0)) return [
9709
+ _tmp = suppliedCode == null && argv.open !== false;
9710
+ if (!_tmp) return [
9090
9711
  3,
9091
- 4
9712
+ 11
9713
+ ];
9714
+ return [
9715
+ 4,
9716
+ openUrlInBrowser({
9717
+ url: url
9718
+ })
9719
+ ];
9720
+ case 10:
9721
+ _tmp = !_state.sent();
9722
+ _state.label = 11;
9723
+ case 11:
9724
+ if (_tmp) {
9725
+ process.stderr.write('Could not open a browser automatically — open the URL above by hand.\n');
9726
+ }
9727
+ _state.label = 12;
9728
+ case 12:
9729
+ _state.trys.push([
9730
+ 12,
9731
+ ,
9732
+ 23,
9733
+ 25
9734
+ ]);
9735
+ if (!(suppliedCode != null)) return [
9736
+ 3,
9737
+ 13
9092
9738
  ];
9093
- _tmp = _argv_code;
9739
+ pasted = suppliedCode;
9094
9740
  return [
9095
9741
  3,
9096
- 6
9742
+ 22
9097
9743
  ];
9098
- case 4:
9744
+ case 13:
9745
+ if (!capture) return [
9746
+ 3,
9747
+ 20
9748
+ ];
9749
+ // The hint goes to stderr and the prompt itself is rendered empty, so the readline prompt
9750
+ // never lands on stdout alongside the JSON envelope.
9751
+ process.stderr.write("Waiting for the redirect to ".concat(capture.redirectUri, " ... (or paste the redirect URL here)\n"));
9752
+ // Both sources run at once. The listener is the happy path, and the prompt is the way out
9753
+ // when the browser cannot reach this process's loopback interface at all (an SSH session,
9754
+ // a container) — without it that case would just sit here until the listener timed out.
9755
+ controller = new AbortController();
9756
+ prompt = promptLine({
9757
+ question: '',
9758
+ signal: controller.signal
9759
+ });
9760
+ redirected = capture.waitForRedirect(listenForMs);
9761
+ // Whichever source loses is abandoned mid-flight; its rejection is expected, not unhandled.
9762
+ prompt.catch(noop);
9763
+ redirected.catch(noop);
9764
+ _state.label = 14;
9765
+ case 14:
9766
+ _state.trys.push([
9767
+ 14,
9768
+ 16,
9769
+ 18,
9770
+ 19
9771
+ ]);
9772
+ return [
9773
+ 4,
9774
+ Promise.race([
9775
+ redirected,
9776
+ prompt
9777
+ ])
9778
+ ];
9779
+ case 15:
9780
+ pasted = _state.sent();
9781
+ return [
9782
+ 3,
9783
+ 19
9784
+ ];
9785
+ case 16:
9786
+ e1 = _state.sent();
9787
+ // Only the listener's timeout reaches here — the prompt is still open, so keep waiting on it.
9788
+ process.stderr.write("".concat(e1.message, "\n"));
9789
+ return [
9790
+ 4,
9791
+ prompt
9792
+ ];
9793
+ case 17:
9794
+ pasted = _state.sent();
9795
+ return [
9796
+ 3,
9797
+ 19
9798
+ ];
9799
+ case 18:
9800
+ // Released only once a winner is settled. Aborting from inside the redirect's own `then`
9801
+ // instead would reject the prompt a microtask BEFORE the redirect resolved, and the race
9802
+ // would hand back that rejection rather than the code it just captured.
9803
+ controller.abort();
9804
+ return [
9805
+ 7
9806
+ ];
9807
+ case 19:
9808
+ return [
9809
+ 3,
9810
+ 22
9811
+ ];
9812
+ case 20:
9099
9813
  return [
9100
9814
  4,
9101
9815
  promptLine({
9102
9816
  question: 'Paste redirect URL or code: '
9103
9817
  })
9104
9818
  ];
9105
- case 5:
9106
- _tmp = _state.sent();
9107
- _state.label = 6;
9108
- case 6:
9109
- pasted = _tmp;
9819
+ case 21:
9820
+ pasted = _state.sent();
9821
+ _state.label = 22;
9822
+ case 22:
9823
+ return [
9824
+ 3,
9825
+ 25
9826
+ ];
9827
+ case 23:
9828
+ // Unconditional: a listener left bound keeps the process alive well past the command.
9829
+ return [
9830
+ 4,
9831
+ capture === null || capture === void 0 ? void 0 : capture.close()
9832
+ ];
9833
+ case 24:
9834
+ _state.sent();
9835
+ return [
9836
+ 7
9837
+ ];
9838
+ case 25:
9110
9839
  code = parsePastedRedirect({
9111
9840
  pasted: pasted,
9112
9841
  expectedState: state
@@ -9117,12 +9846,12 @@ function resolveAuthSetupPrompt(input) {
9117
9846
  tokenEndpoint: meta.token_endpoint,
9118
9847
  clientId: env.clientId,
9119
9848
  clientSecret: env.clientSecret,
9120
- redirectUri: env.redirectUri,
9849
+ redirectUri: redirectUri,
9121
9850
  code: code,
9122
9851
  codeVerifier: codeVerifier
9123
9852
  })
9124
9853
  ];
9125
- case 7:
9854
+ case 26:
9126
9855
  tokenResponse = _state.sent();
9127
9856
  expiresAt = Date.now() + ((_tokenResponse_expires_in = tokenResponse.expires_in) !== null && _tokenResponse_expires_in !== void 0 ? _tokenResponse_expires_in : 0) * 1000;
9128
9857
  return [
@@ -9132,9 +9861,9 @@ function resolveAuthSetupPrompt(input) {
9132
9861
  accessToken: tokenResponse.access_token
9133
9862
  })
9134
9863
  ];
9135
- case 8:
9864
+ case 27:
9136
9865
  sessionInfo = _state.sent();
9137
- sessionExpiresAt = (_ref = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.expiresAt) !== null && _ref !== void 0 ? _ref : undefined;
9866
+ sessionExpiresAt = (_ref1 = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.expiresAt) !== null && _ref1 !== void 0 ? _ref1 : undefined;
9138
9867
  rotationDisabled = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.rotationDisabled;
9139
9868
  entry = _object_spread$Q({
9140
9869
  accessToken: tokenResponse.access_token,
@@ -9152,7 +9881,7 @@ function resolveAuthSetupPrompt(input) {
9152
9881
  4,
9153
9882
  tokens.set(envName, entry)
9154
9883
  ];
9155
- case 9:
9884
+ case 28:
9156
9885
  _state.sent();
9157
9886
  sessionSummary = describeSessionLifetime({
9158
9887
  sessionExpiresAt: sessionExpiresAt,
@@ -9216,7 +9945,7 @@ function resolveAuthSetupPrompt(input) {
9216
9945
  ];
9217
9946
  case 2:
9218
9947
  entry = _state.sent();
9219
- if (!(argv.revoke && (entry === null || entry === void 0 ? void 0 : entry.refreshToken) && env.clientId && env.clientSecret)) return [
9948
+ if (!(argv.revoke && (entry === null || entry === void 0 ? void 0 : entry.refreshToken) && env.clientId)) return [
9220
9949
  3,
9221
9950
  8
9222
9951
  ];
@@ -12550,7 +13279,7 @@ function _unsupported_iterable_to_array$$(o, minLen) {
12550
13279
  return _ts_generator$17(this, function(_state) {
12551
13280
  switch(_state.label){
12552
13281
  case 0:
12553
- if (!(!envName || !(env === null || env === void 0 ? void 0 : env.clientId) || !(env === null || env === void 0 ? void 0 : env.clientSecret))) return [
13282
+ if (!(!envName || !(env === null || env === void 0 ? void 0 : env.clientId))) return [
12554
13283
  3,
12555
13284
  1
12556
13285
  ];
@@ -13754,7 +14483,7 @@ function runFirestoreSessionProbe(input) {
13754
14483
  7
13755
14484
  ];
13756
14485
  case 2:
13757
- if (!((entry === null || entry === void 0 ? void 0 : entry.refreshToken) && env.clientId && env.clientSecret)) return [
14486
+ if (!((entry === null || entry === void 0 ? void 0 : entry.refreshToken) && env.clientId)) return [
13758
14487
  3,
13759
14488
  7
13760
14489
  ];
@@ -69078,4 +69807,4 @@ function printPaginatedOutput(input) {
69078
69807
  })();
69079
69808
  }
69080
69809
 
69081
- export { ACTIONS_SCAN_CONFIG_FILENAME, ACTION_ENTRY_ROLES, ACTION_ROLE_ORDER, ActionDirectiveEntry, ActionEntry, ActionInputEntry, ActionManifest, ActionOutputEntry, ActionStateEntry, ActionStoreEntry, ActionStoreMethodEntry, ActionStoreObservableEntry, ActionsScanConfig, ActionsScanSection, BUILD_DRIFT_DOCTOR_CHECK_NAME, BUILTIN_AUTH_CLAIMS, BUILTIN_AUTH_ROLES, BUILTIN_AUTH_SCOPES, CALL_MODEL_API_PATH, CALL_PASSTHROUGH_COMMAND, CLI_CLIENT_FIRESTORE_DRIVER_IDENTIFIER, CLI_DATA_CACHE_CYCLE_ERROR_CODE, CLI_DATA_CACHE_FINGERPRINT_LENGTH, CLI_DATA_CACHE_GLOBAL_OPTION_NAMES, CLI_DATA_CACHE_INDEX_FILE_NAME, CLI_DATA_CACHE_SCHEMA_VERSION, CLI_DATA_CACHE_UNSUPPORTED_VALUE_ERROR_CODE, CLI_EXIT_CODE_AUTH, CLI_EXIT_CODE_HANDLER, CLI_FIRESTORE_QUERY_DATASET_PREFIX, CLI_FIRESTORE_QUERY_DATASET_VERSION, CLI_FIRESTORE_SESSION_EXPIRY_BUFFER_MS, CLI_FIRESTORE_SESSION_MAX_CACHE_MS, CLI_FRAMEWORK_PACKAGE_PREFIX, CLI_READ_VIA_EPILOGUE, CLI_READ_VIA_VALUES, CORE_TOPICS, CORE_TOPICS_SET, CSS_UTILITIES_SCAN_CONFIG_FILENAME, CSS_UTILITY_ROLES, CSS_UTILITY_SCOPES, CliError, CssUtilitiesScanConfig, CssUtilitiesScanSection, CssUtilityDeclaration, CssUtilityEntry, CssUtilityManifest, DBX_ACTION_STATE_VALUES, DBX_DOCS_UI_EXAMPLES_SCAN_CONFIG_FILENAME, DBX_DOCS_UI_EXAMPLE_USE_KINDS, DEFAULT_ACTIONS_SCAN_OUT_PATH, DEFAULT_ACTION_COMMAND_NAME, DEFAULT_CLI_DATA_CACHE_CODEC, DEFAULT_CLI_DATA_CACHE_COMMAND_NAME, DEFAULT_CLI_DATA_CACHE_MAX_AGE_HOURS, DEFAULT_CLI_DATA_CACHE_OPTIONS, DEFAULT_CLI_FIREBASE_EMULATOR_HOST, DEFAULT_CLI_HTTP_TIMEOUT_MS, DEFAULT_CLI_OIDC_SCOPES, DEFAULT_CLI_READ_VIA, DEFAULT_CLI_REDIRECT_URI, DEFAULT_CLI_SECRET_PATTERNS, DEFAULT_CSS_UTILITIES_SCAN_OUT_PATH, DEFAULT_DBX_DOCS_UI_EXAMPLES_SCAN_OUT_PATH, DEFAULT_FILTERS_SCAN_OUT_PATH, DEFAULT_FIRESTORE_GET_COMMAND_NAME, DEFAULT_FIRESTORE_QUERIES_COMMAND_NAME, DEFAULT_FIRESTORE_QUERY_COMMAND_NAME, DEFAULT_FORGE_FIELDS_SCAN_OUT_PATH, DEFAULT_MANIFEST_HELP_DATA_FORMAT, DEFAULT_MANIFEST_HELP_MODE, DEFAULT_MANIFEST_MODEL_COMMAND_NAME, DEFAULT_MODEL_DECODE_COMMAND_NAME, DEFAULT_MODEL_INFO_COMMAND_NAME, DEFAULT_MODEL_SNAPSHOT_FIELDS_SCAN_OUT_PATH, DEFAULT_PIPES_SCAN_OUT_PATH, DEFAULT_SCAN_OUT_PATH, DEFAULT_SPECIFIER_KEY, DEFAULT_UI_COMPONENTS_SCAN_OUT_PATH, DEFAULT_UTILS_SCAN_OUT_PATH, DISABLED_CLI_DATA_CACHE_OPTIONS, DOWNSTREAM_CLUSTERS, DUMP_MERGE_MODES, DUMP_OUTPUT_MODES, DbxDocsUiExampleEntry, DbxDocsUiExampleManifest, DbxDocsUiExampleUseEntry, DbxDocsUiExamplesScanConfig, DbxDocsUiExamplesScanSection, DbxMcpConfig, EMPTY_ACTION_REGISTRY, EMPTY_AUTH_REGISTRY, EMPTY_CSS_UTILITY_REGISTRY, EMPTY_DBX_DOCS_UI_EXAMPLES_REGISTRY, EMPTY_FILTER_REGISTRY, EMPTY_FORGE_FIELD_REGISTRY, EMPTY_MODEL_SNAPSHOT_FIELD_REGISTRY, EMPTY_PIPE_REGISTRY, EMPTY_SEMANTIC_TYPE_REGISTRY, EMPTY_TOKEN_REGISTRY, EMPTY_UI_COMPONENT_REGISTRY, EMPTY_UTIL_REGISTRY, ExtractedDbxDocsUiExampleEntrySchema, ExtractedEntrySchema, ExtractedForgeFieldEntrySchema, ExtractedUiEntrySchema, FILTERS_SCAN_CONFIG_FILENAME, FILTER_KINDS, FILTER_KIND_ORDER, FIREBASE_MODELS, FIREBASE_MODEL_GROUPS, FIRESTORE_COLLECTION_UNRESOLVABLE_CODE, FIRESTORE_QUERY_PARENT_REQUIRED_CODE, FIRESTORE_QUERY_UNAVAILABLE_CODE, FIRESTORE_SDK_IDENTITY_STAGE, FIRESTORE_SDK_INSTANCE_MISMATCH_CODE, FIRESTORE_SESSION_API_PATH, FIRESTORE_SESSION_DOCTOR_CHECK_NAME, FORGE_FIELDS_SCAN_CONFIG_FILENAME, FORGE_FIELD_ARRAY_OUTPUTS, FORGE_FIELD_COMPOSITE_SUFFIXES, FORGE_FIELD_TIERS, FORGE_FIELD_WRAPPER_PATTERNS, FORM_FIELDS, FORM_TIER_ORDER, FilterDirectiveEntry, FilterEntry, FilterInputEntry, FilterManifest, FilterPatternEntry, FiltersScanConfig, FiltersScanSection, ForgeFieldEntry, ForgeFieldManifest, ForgeFieldPropertyEntry, ForgeFieldsScanConfig, ForgeFieldsScanSection, GET_COMMAND, GET_MANY_COMMAND, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MCP_CALL_TYPE_ABBREVIATIONS, MCP_MANIFEST_VERSION, MCP_TOOL_NAME_MAX_LENGTH, MCP_TOOL_NAME_WARN_LENGTH, MODEL_ARCHETYPES, MODEL_ARCHETYPE_ADDON_SLUGS, MODEL_ARCHETYPE_SYNC_MODES, MODEL_IS_SERVER_ONLY_CODE, MODEL_SNAPSHOT_FIELDS_SCAN_CONFIG_FILENAME, MODEL_SNAPSHOT_FIELD_KINDS, MODEL_WRITE_OIDC_SCOPES, MULTIPLE_PAGES_OUTPUT_MODES, ModelSnapshotFieldEntry, ModelSnapshotFieldManifest, ModelSnapshotFieldParamEntry, ModelSnapshotFieldsScanConfig, ModelSnapshotFieldsScanSection, PIPES_SCAN_CONFIG_FILENAME, PIPE_CATEGORIES, PIPE_CATEGORY_ORDER, PIPE_PURITIES, PROMPT_CANCELLED_ERROR_CODE, PipeArgEntry, PipeEntry, PipeManifest, PipesScanConfig, PipesScanSection, RESERVED_MODEL_FOLDERS, ROUTE_MANIFEST_VERSION, ROUTE_MODEL_LIST_TAG, ROUTE_MODEL_TAG, SCAN_CONFIG_FILENAME$1 as SCAN_CONFIG_FILENAME, SERVICE_TOKEN_REQUIRED_OIDC_SCOPES, STANDARD_GLOBAL_OPTION_NAMES, STDIN_NOT_PIPED_ERROR_CODE, SemanticTypeEntry, SemanticTypeManifest, SemanticTypeScanConfig, TOKEN_ROLES, TOKEN_SOURCES, TokenDefaults, TokenEntry, TokenManifest, UI_COMPONENTS_SCAN_CONFIG_FILENAME, UI_COMPONENT_CATEGORIES, UI_COMPONENT_KINDS, UTILS_SCAN_CONFIG_FILENAME, UTIL_KINDS, UiComponentEntry, UiComponentInputEntry, UiComponentManifest, UiComponentOutputEntry, UiComponentsScanConfig, UiComponentsScanSection, UtilEntry, UtilManifest, UtilParamEntry, UtilsScanConfig, UtilsScanSection, WORKSPACE_AUTH_APPS, WORKSPACE_AUTH_CLAIMS, WORKSPACE_FACTORY_SCAN_EXCLUDE, WORKSPACE_FACTORY_SCAN_INCLUDE, abbreviateMcpCallType, appendCliErrorMapper, applyEnvVarOverrides, assertCliFirestoreQueryCanRun, assertCliFirestoreQueryParentKey, assertCliModelIsNotServerOnly, buildActionCommands, buildActionsManifest, buildAuthorizationUrl, buildCliPaths, buildCssUtilitiesManifest, buildDbxDocsUiExamplesManifest, buildDisambiguatedMcpToolName, buildDispatcherCreditByName, buildDumpFilePath, buildErrorOutput, buildFiltersManifest, buildFirestoreGetCommand, buildFirestoreQueriesCommand, buildFirestoreQueryCommand, buildFirestoreSessionDoctorReadRouting, buildForgeFieldsManifest, buildManifest, buildManifestCommands, buildMcpToolName, buildModelDecodeCommand, buildModelInfoCommand, buildModelSnapshotFieldsManifest, buildPipesManifest, buildRouteManifest, buildRouteTree, buildScanProject, buildUiComponentsManifest, buildUtilsManifest, callModelOverHttp, canonicalCliCacheJson, checkCliDataCacheArgv, clearDownstreamCatalogCache, cliBuildDriftDescription, cliCacheFingerprint, cliDataCacheKey, cliDataCacheMeta, cliDataCacheOptions, cliDataCachePathSegment, cliFirebaseAppName, cliFirebaseEmulatorsInUse, cliFirestoreAccessorFactory, cliFirestoreBinding, cliFirestoreCollectionForQuery, cliFirestoreErrorMapper, cliFirestoreQueryConstraints, cliFirestoreQueryMode, cliFirestoreQueryModeForRules, cliFirestoreSdkIdentitySuggestion, cliFirestoreSessionEntryExpiresAt, cliFirestoreWiringError, cliLifecycleRunner, cliReadResultMeta, closeAllCliFirebaseApps, closeCliFirestoreSessionContext, coerceCliReadVia, collectClassPropertiesWithInheritance, computeRelativeSpecifiers, configureCliDataCacheOptions, configureCliErrorMapper, configureCliSecretPatterns, configureOutputOptions, createActionCommand, createActionRegistry, createActionRegistryFromEntries, createAuthCommand, createAuthMiddleware, createAuthRegistryFromEntries, createCacheCommand, createCallModelCommand, createCli, createCliBuildDriftDoctorCheck, createCliContext, createCliDataCache, createCliFirestoreModels, createCliFirestoreQueryRegistry, createCliFirestoreSessionCacheStore, createCliFirestoreSessionContext, createCliTokenCacheStore, createContextSlot, createCssUtilityRegistry, createCssUtilityRegistryFromEntries, createDbxDocsUiExamplesRegistry, createDbxDocsUiExamplesRegistryFromEntries, createDoctorCommand, createEnvCommand, createFilterRegistry, createFilterRegistryFromEntries, createFirestoreSessionDoctorCheck, createForgeFieldRegistry, createForgeFieldRegistryFromEntries, createModelSnapshotFieldRegistry, createModelSnapshotFieldRegistryFromEntries, createOutputCommand, createOutputMiddleware, createPassthroughAuthMiddleware, createPipeRegistry, createPipeRegistryFromEntries, createSemanticTypeRegistry, createSemanticTypeRegistryFromEntries, createTokenRegistry, createTokenRegistryFromEntries, createUiComponentRegistry, createUiComponentRegistryFromEntries, createUtilRegistry, createUtilRegistryFromEntries, decodeFirestoreModelKey, defaultDoctorChecks, defaultGlobber, defaultReadFile, deriveOptionalFromName, describeCliFirestoreQueryMode, detectDataHelpFormat, detectHelpMode, discoverDownstreamFirebasePackages, discoverDownstreamPackages, discoverOidcMetadata, dumpTimestamp, exchangeAuthorizationCode, expandModelKeys, extractActionEntries, extractAngularInputs, extractAngularOutputs, extractAuthEntries, extractComponentRouteModelTags, extractCssUtilityEntries, extractDbxDocsUiExampleEntries, extractEntries, extractFile, extractFilterEntries, extractForgeFieldEntries, extractModelSnapshotFieldEntries, extractModels, extractPipeEntries, extractUiEntries, extractUrlParamKeys, extractUtilEntries, fetchFirestoreSession, fetchSessionInfo, fetchUserInfo, filterCliFirestoreQueries, filterReadOnlyModelScopes, findAndLoadConfig, findCliEnvDefault, findCliModelManifestEntry, flattenList, formatGeneratedTs, fromCliCacheJson, getBundledManifestsDirectory, getCliContext, getCliEnvVarName, getCliTimeoutMs, getDefaultBundledActionManifestPaths, getDefaultBundledCssUtilityManifestPaths, getDefaultBundledDbxDocsUiExamplesManifestPaths, getDefaultBundledFilterManifestPaths, getDefaultBundledForgeFieldManifestPaths, getDefaultBundledManifestPaths, getDefaultBundledModelFirebaseIndexManifestPaths, getDefaultBundledModelSnapshotFieldManifestPaths, getDefaultBundledPipeManifestPaths, getDefaultBundledTokenManifestPaths, getDefaultBundledUiManifestPaths, getDefaultBundledUtilManifestPaths, getDownstreamCatalog, getFirebaseBucketKeyedByIdModels, getFirebaseDistrictKeyedByIdModels, getFirebaseExternalIdKeyedByIdModels, getFirebaseModel, getFirebaseModelByPrefix, getFirebaseModelGroup, getFirebaseModelGroups, getFirebaseModels, getFirebaseModelsByArchetype, getFirebasePrefixCatalog, getFirebaseRegionKeyedByIdModels, getFirebaseSubcollectionsOf, getFirebaseUserKeyedByIdModels, getFirebaseUserRelatedModels, getModelArchetypeBySlug, getModelArchetypesByAxisValue, getModelArchetypesByCollectionKind, getModelArchetypesBySyncMode, getModelOverFirestore, getModelOverHttp, getMultipleModelsOverFirestore, getMultipleModelsOverHttp, getMultipleModelsOverHttpChunked, getOutputOptions, globToRegex, hasParamSegment, indentLines$1 as indentLines, inspectCliBuildDrift, inspectCliFirestoreSdkIdentity, isCliEnvConfigComplete, isCliFirebaseConfigComplete, isCliFirestoreQueryInvocable, isCliFirestoreSessionExpired, isCliVerbose, isCoreTopic, isEntryExpired, isExportedFromPackage, isStdinPositionalSentinel, isStdinSentinel, isTokenExpired, isVisibleProperty, iterateDbxCliCallModel, loadActionManifests, loadActionRegistry, loadAuthRegistry, loadCliConfig, loadCssUtilityRegistry, loadDbxDocsUiExamplesManifests, loadDbxDocsUiExamplesRegistry, loadFilterManifests, loadFilterRegistry, loadForgeFieldManifests, loadForgeFieldRegistry, loadModelFirebaseIndexManifests, loadModelFirebaseIndexRegistry, loadModelSnapshotFieldManifests, loadModelSnapshotFieldRegistry, loadOrBuildCliCachedData, loadPackageName, loadPipeManifests, loadPipeRegistry, loadRouteTree, loadScanSection, loadSemanticTypeManifests, loadSemanticTypeRegistry, loadTokenManifests, loadTokenRegistry, loadUiComponentManifests, loadUiComponentRegistry, loadUtilManifests, loadUtilRegistry, maskEnv, maskSecret, matchUrlAgainstEntries, mcpManifestKey, mergeCliConfig, mergeCliEnvWithDefault, mergeCliFirebaseConfig, mergeOutputConfig, normalizeCliCacheFilter, normalizePathname, oidcRelyingPartyErrorToCliError, openStreamingDump, outputError, outputResult, packageNameToSlug, parseAnnotation, parseDeclarations$1 as parseDeclarations, parseFirestoreModelIdentityArgs, parseGetArgs, parseGetManyArgs, parsePastedRedirect, parseRouteModelTag, parseScanArgs, pickFields, promptLine, readAllStdin, readCliArtifactPackage, readDirectiveDecorator, readEnvTokenEntry, readPropertyDescription, readSelector, readStdinTokens, readStringProperty, refreshAccessToken, renderCliFirestoreQueryEntry, renderCliFirestoreQueryList, renderDecodedKey, renderGroupedImportLines, renderModelManifestEntry, renderModelManifestFields, renderModelManifestList, renderTable, requireCliContext, requireCliFirestoreContext, requireCliFirestoreModels, requireCliFirestoreSession, resolveActiveEnvName, resolveCliDataCacheOptions, resolveCliEnv, resolveCliEnvOrThrow, resolveCliFirestoreQueryArgs, resolveCliFirestoreQueryEntry, resolveCliModel, resolveCliReadSource, resolveComponentSourceFromSources, resolveDemoClaimsPath, resolveExplicitFirebasePackages, resolveExtendsName, resolveModelArchetype, resolveOutputConfig, resolveOxfmtConfig, resolvePerModelGetKey, resolveRouteSources, revokeToken, runActionsScanCli, runCli, runCliFirestoreQuery, runCssUtilitiesScanCli, runDbxDocsUiExamplesScanCli, runFiltersScanCli, runForgeFieldsScanCli, runModelFirebaseIndexScanCli, runModelSnapshotFieldsScanCli, runPaginatedList, runPipesScanCli, runScanCli, runScanCliBase, runUiComponentsScanCli, runUtilsScanCli, sanitizeString, saveCliConfig, scanFactoryReferences, scoreCandidates, serializeActionManifest, serializeCssUtilityManifest, serializeDbxDocsUiExamplesManifest, serializeFilterManifest, serializeForgeFieldManifest, serializeManifest, serializeModelSnapshotFieldsManifest, serializePipeManifest, serializeUiComponentManifest, serializeUtilManifest, setCliContext, setCliRawArgv, setCliTimeoutMs, setCliVerbose, splitListTagText$1 as splitListTagText, splitSegments, stripUrlQueryAndHash, toActionEntryInfo, toCliCacheJson, toFilterEntryInfo, toFormFieldInfo, tracedFetch, truncate, tryMatchSegments, unwrapFenced, validateMcpToolName, verboseLog, withCallModelArgs, withEnv, withMultiplePages, withOutput, withServiceTokenScopes, wrapCommandHandler, wrapSyncCommandHandler, writeGeneratedTsFile };
69810
+ export { ACTIONS_SCAN_CONFIG_FILENAME, ACTION_ENTRY_ROLES, ACTION_ROLE_ORDER, ActionDirectiveEntry, ActionEntry, ActionInputEntry, ActionManifest, ActionOutputEntry, ActionStateEntry, ActionStoreEntry, ActionStoreMethodEntry, ActionStoreObservableEntry, ActionsScanConfig, ActionsScanSection, BUILD_DRIFT_DOCTOR_CHECK_NAME, BUILTIN_AUTH_CLAIMS, BUILTIN_AUTH_ROLES, BUILTIN_AUTH_SCOPES, CALL_MODEL_API_PATH, CALL_PASSTHROUGH_COMMAND, CLI_CLIENT_FIRESTORE_DRIVER_IDENTIFIER, CLI_DATA_CACHE_CYCLE_ERROR_CODE, CLI_DATA_CACHE_FINGERPRINT_LENGTH, CLI_DATA_CACHE_GLOBAL_OPTION_NAMES, CLI_DATA_CACHE_INDEX_FILE_NAME, CLI_DATA_CACHE_SCHEMA_VERSION, CLI_DATA_CACHE_UNSUPPORTED_VALUE_ERROR_CODE, CLI_EXIT_CODE_AUTH, CLI_EXIT_CODE_HANDLER, CLI_FIRESTORE_QUERY_DATASET_PREFIX, CLI_FIRESTORE_QUERY_DATASET_VERSION, CLI_FIRESTORE_SESSION_EXPIRY_BUFFER_MS, CLI_FIRESTORE_SESSION_MAX_CACHE_MS, CLI_FRAMEWORK_PACKAGE_PREFIX, CLI_READ_VIA_EPILOGUE, CLI_READ_VIA_VALUES, CORE_TOPICS, CORE_TOPICS_SET, CSS_UTILITIES_SCAN_CONFIG_FILENAME, CSS_UTILITY_ROLES, CSS_UTILITY_SCOPES, CliError, CssUtilitiesScanConfig, CssUtilitiesScanSection, CssUtilityDeclaration, CssUtilityEntry, CssUtilityManifest, DBX_ACTION_STATE_VALUES, DBX_DOCS_UI_EXAMPLES_SCAN_CONFIG_FILENAME, DBX_DOCS_UI_EXAMPLE_USE_KINDS, DEFAULT_ACTIONS_SCAN_OUT_PATH, DEFAULT_ACTION_COMMAND_NAME, DEFAULT_CLI_DATA_CACHE_CODEC, DEFAULT_CLI_DATA_CACHE_COMMAND_NAME, DEFAULT_CLI_DATA_CACHE_MAX_AGE_HOURS, DEFAULT_CLI_DATA_CACHE_OPTIONS, DEFAULT_CLI_FIREBASE_EMULATOR_HOST, DEFAULT_CLI_HTTP_TIMEOUT_MS, DEFAULT_CLI_OIDC_SCOPES, DEFAULT_CLI_READ_VIA, DEFAULT_CLI_REDIRECT_URI, DEFAULT_CLI_SECRET_PATTERNS, DEFAULT_CSS_UTILITIES_SCAN_OUT_PATH, DEFAULT_DBX_DOCS_UI_EXAMPLES_SCAN_OUT_PATH, DEFAULT_FILTERS_SCAN_OUT_PATH, DEFAULT_FIRESTORE_GET_COMMAND_NAME, DEFAULT_FIRESTORE_QUERIES_COMMAND_NAME, DEFAULT_FIRESTORE_QUERY_COMMAND_NAME, DEFAULT_FORGE_FIELDS_SCAN_OUT_PATH, DEFAULT_MANIFEST_HELP_DATA_FORMAT, DEFAULT_MANIFEST_HELP_MODE, DEFAULT_MANIFEST_MODEL_COMMAND_NAME, DEFAULT_MODEL_DECODE_COMMAND_NAME, DEFAULT_MODEL_INFO_COMMAND_NAME, DEFAULT_MODEL_SNAPSHOT_FIELDS_SCAN_OUT_PATH, DEFAULT_PIPES_SCAN_OUT_PATH, DEFAULT_SCAN_OUT_PATH, DEFAULT_SPECIFIER_KEY, DEFAULT_UI_COMPONENTS_SCAN_OUT_PATH, DEFAULT_UTILS_SCAN_OUT_PATH, DISABLED_CLI_DATA_CACHE_OPTIONS, DOWNSTREAM_CLUSTERS, DUMP_MERGE_MODES, DUMP_OUTPUT_MODES, DbxDocsUiExampleEntry, DbxDocsUiExampleManifest, DbxDocsUiExampleUseEntry, DbxDocsUiExamplesScanConfig, DbxDocsUiExamplesScanSection, DbxMcpConfig, EMPTY_ACTION_REGISTRY, EMPTY_AUTH_REGISTRY, EMPTY_CSS_UTILITY_REGISTRY, EMPTY_DBX_DOCS_UI_EXAMPLES_REGISTRY, EMPTY_FILTER_REGISTRY, EMPTY_FORGE_FIELD_REGISTRY, EMPTY_MODEL_SNAPSHOT_FIELD_REGISTRY, EMPTY_PIPE_REGISTRY, EMPTY_SEMANTIC_TYPE_REGISTRY, EMPTY_TOKEN_REGISTRY, EMPTY_UI_COMPONENT_REGISTRY, EMPTY_UTIL_REGISTRY, ExtractedDbxDocsUiExampleEntrySchema, ExtractedEntrySchema, ExtractedForgeFieldEntrySchema, ExtractedUiEntrySchema, FILTERS_SCAN_CONFIG_FILENAME, FILTER_KINDS, FILTER_KIND_ORDER, FIREBASE_MODELS, FIREBASE_MODEL_GROUPS, FIRESTORE_COLLECTION_UNRESOLVABLE_CODE, FIRESTORE_QUERY_PARENT_REQUIRED_CODE, FIRESTORE_QUERY_UNAVAILABLE_CODE, FIRESTORE_SDK_IDENTITY_STAGE, FIRESTORE_SDK_INSTANCE_MISMATCH_CODE, FIRESTORE_SESSION_API_PATH, FIRESTORE_SESSION_DOCTOR_CHECK_NAME, FORGE_FIELDS_SCAN_CONFIG_FILENAME, FORGE_FIELD_ARRAY_OUTPUTS, FORGE_FIELD_COMPOSITE_SUFFIXES, FORGE_FIELD_TIERS, FORGE_FIELD_WRAPPER_PATTERNS, FORM_FIELDS, FORM_TIER_ORDER, FilterDirectiveEntry, FilterEntry, FilterInputEntry, FilterManifest, FilterPatternEntry, FiltersScanConfig, FiltersScanSection, ForgeFieldEntry, ForgeFieldManifest, ForgeFieldPropertyEntry, ForgeFieldsScanConfig, ForgeFieldsScanSection, GET_COMMAND, GET_MANY_COMMAND, LOOPBACK_REDIRECT_HOSTNAMES, LOOPBACK_REDIRECT_LISTEN_FAILED_ERROR_CODE, LOOPBACK_REDIRECT_TIMEOUT_ERROR_CODE, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MCP_CALL_TYPE_ABBREVIATIONS, MCP_MANIFEST_VERSION, MCP_TOOL_NAME_MAX_LENGTH, MCP_TOOL_NAME_WARN_LENGTH, MODEL_ARCHETYPES, MODEL_ARCHETYPE_ADDON_SLUGS, MODEL_ARCHETYPE_SYNC_MODES, MODEL_IS_SERVER_ONLY_CODE, MODEL_SNAPSHOT_FIELDS_SCAN_CONFIG_FILENAME, MODEL_SNAPSHOT_FIELD_KINDS, MODEL_WRITE_OIDC_SCOPES, MULTIPLE_PAGES_OUTPUT_MODES, ModelSnapshotFieldEntry, ModelSnapshotFieldManifest, ModelSnapshotFieldParamEntry, ModelSnapshotFieldsScanConfig, ModelSnapshotFieldsScanSection, PIPES_SCAN_CONFIG_FILENAME, PIPE_CATEGORIES, PIPE_CATEGORY_ORDER, PIPE_PURITIES, PROMPT_CANCELLED_ERROR_CODE, PipeArgEntry, PipeEntry, PipeManifest, PipesScanConfig, PipesScanSection, RESERVED_MODEL_FOLDERS, ROUTE_MANIFEST_VERSION, ROUTE_MODEL_LIST_TAG, ROUTE_MODEL_TAG, SCAN_CONFIG_FILENAME$1 as SCAN_CONFIG_FILENAME, SERVICE_TOKEN_REQUIRED_OIDC_SCOPES, STANDARD_GLOBAL_OPTION_NAMES, STDIN_NOT_PIPED_ERROR_CODE, SUGGESTED_CLI_LOOPBACK_REDIRECT_PORT, SemanticTypeEntry, SemanticTypeManifest, SemanticTypeScanConfig, TOKEN_ROLES, TOKEN_SOURCES, TokenDefaults, TokenEntry, TokenManifest, UI_COMPONENTS_SCAN_CONFIG_FILENAME, UI_COMPONENT_CATEGORIES, UI_COMPONENT_KINDS, UTILS_SCAN_CONFIG_FILENAME, UTIL_KINDS, UiComponentEntry, UiComponentInputEntry, UiComponentManifest, UiComponentOutputEntry, UiComponentsScanConfig, UiComponentsScanSection, UtilEntry, UtilManifest, UtilParamEntry, UtilsScanConfig, UtilsScanSection, WORKSPACE_AUTH_APPS, WORKSPACE_AUTH_CLAIMS, WORKSPACE_FACTORY_SCAN_EXCLUDE, WORKSPACE_FACTORY_SCAN_INCLUDE, abbreviateMcpCallType, appendCliErrorMapper, applyEnvVarOverrides, assertCliFirestoreQueryCanRun, assertCliFirestoreQueryParentKey, assertCliModelIsNotServerOnly, buildActionCommands, buildActionsManifest, buildAuthorizationUrl, buildCliPaths, buildCssUtilitiesManifest, buildDbxDocsUiExamplesManifest, buildDisambiguatedMcpToolName, buildDispatcherCreditByName, buildDumpFilePath, buildErrorOutput, buildFiltersManifest, buildFirestoreGetCommand, buildFirestoreQueriesCommand, buildFirestoreQueryCommand, buildFirestoreSessionDoctorReadRouting, buildForgeFieldsManifest, buildManifest, buildManifestCommands, buildMcpToolName, buildModelDecodeCommand, buildModelInfoCommand, buildModelSnapshotFieldsManifest, buildPipesManifest, buildRouteManifest, buildRouteTree, buildScanProject, buildUiComponentsManifest, buildUtilsManifest, callModelOverHttp, canonicalCliCacheJson, checkCliDataCacheArgv, clearDownstreamCatalogCache, cliBuildDriftDescription, cliCacheFingerprint, cliDataCacheKey, cliDataCacheMeta, cliDataCacheOptions, cliDataCachePathSegment, cliFirebaseAppName, cliFirebaseEmulatorsInUse, cliFirestoreAccessorFactory, cliFirestoreBinding, cliFirestoreCollectionForQuery, cliFirestoreErrorMapper, cliFirestoreQueryConstraints, cliFirestoreQueryMode, cliFirestoreQueryModeForRules, cliFirestoreSdkIdentitySuggestion, cliFirestoreSessionEntryExpiresAt, cliFirestoreWiringError, cliLifecycleRunner, cliReadResultMeta, closeAllCliFirebaseApps, closeCliFirestoreSessionContext, coerceCliReadVia, collectClassPropertiesWithInheritance, computeRelativeSpecifiers, configureCliDataCacheOptions, configureCliErrorMapper, configureCliSecretPatterns, configureOutputOptions, createActionCommand, createActionRegistry, createActionRegistryFromEntries, createAuthCommand, createAuthMiddleware, createAuthRegistryFromEntries, createCacheCommand, createCallModelCommand, createCli, createCliBuildDriftDoctorCheck, createCliContext, createCliDataCache, createCliFirestoreModels, createCliFirestoreQueryRegistry, createCliFirestoreSessionCacheStore, createCliFirestoreSessionContext, createCliTokenCacheStore, createContextSlot, createCssUtilityRegistry, createCssUtilityRegistryFromEntries, createDbxDocsUiExamplesRegistry, createDbxDocsUiExamplesRegistryFromEntries, createDoctorCommand, createEnvCommand, createFilterRegistry, createFilterRegistryFromEntries, createFirestoreSessionDoctorCheck, createForgeFieldRegistry, createForgeFieldRegistryFromEntries, createModelSnapshotFieldRegistry, createModelSnapshotFieldRegistryFromEntries, createOutputCommand, createOutputMiddleware, createPassthroughAuthMiddleware, createPipeRegistry, createPipeRegistryFromEntries, createSemanticTypeRegistry, createSemanticTypeRegistryFromEntries, createTokenRegistry, createTokenRegistryFromEntries, createUiComponentRegistry, createUiComponentRegistryFromEntries, createUtilRegistry, createUtilRegistryFromEntries, decodeFirestoreModelKey, defaultDoctorChecks, defaultGlobber, defaultReadFile, deriveOptionalFromName, describeCliFirestoreQueryMode, detectDataHelpFormat, detectHelpMode, discoverDownstreamFirebasePackages, discoverDownstreamPackages, discoverOidcMetadata, dumpTimestamp, exchangeAuthorizationCode, expandModelKeys, extractActionEntries, extractAngularInputs, extractAngularOutputs, extractAuthEntries, extractComponentRouteModelTags, extractCssUtilityEntries, extractDbxDocsUiExampleEntries, extractEntries, extractFile, extractFilterEntries, extractForgeFieldEntries, extractModelSnapshotFieldEntries, extractModels, extractPipeEntries, extractUiEntries, extractUrlParamKeys, extractUtilEntries, fetchFirestoreSession, fetchSessionInfo, fetchUserInfo, filterCliFirestoreQueries, filterReadOnlyModelScopes, findAndLoadConfig, findCliEnvDefault, findCliModelManifestEntry, flattenList, formatGeneratedTs, fromCliCacheJson, getBundledManifestsDirectory, getCliContext, getCliEnvVarName, getCliTimeoutMs, getDefaultBundledActionManifestPaths, getDefaultBundledCssUtilityManifestPaths, getDefaultBundledDbxDocsUiExamplesManifestPaths, getDefaultBundledFilterManifestPaths, getDefaultBundledForgeFieldManifestPaths, getDefaultBundledManifestPaths, getDefaultBundledModelFirebaseIndexManifestPaths, getDefaultBundledModelSnapshotFieldManifestPaths, getDefaultBundledPipeManifestPaths, getDefaultBundledTokenManifestPaths, getDefaultBundledUiManifestPaths, getDefaultBundledUtilManifestPaths, getDownstreamCatalog, getFirebaseBucketKeyedByIdModels, getFirebaseDistrictKeyedByIdModels, getFirebaseExternalIdKeyedByIdModels, getFirebaseModel, getFirebaseModelByPrefix, getFirebaseModelGroup, getFirebaseModelGroups, getFirebaseModels, getFirebaseModelsByArchetype, getFirebasePrefixCatalog, getFirebaseRegionKeyedByIdModels, getFirebaseSubcollectionsOf, getFirebaseUserKeyedByIdModels, getFirebaseUserRelatedModels, getModelArchetypeBySlug, getModelArchetypesByAxisValue, getModelArchetypesByCollectionKind, getModelArchetypesBySyncMode, getModelOverFirestore, getModelOverHttp, getMultipleModelsOverFirestore, getMultipleModelsOverHttp, getMultipleModelsOverHttpChunked, getOutputOptions, globToRegex, hasParamSegment, indentLines$1 as indentLines, inspectCliBuildDrift, inspectCliFirestoreSdkIdentity, isCliEnvConfigComplete, isCliFirebaseConfigComplete, isCliFirestoreQueryInvocable, isCliFirestoreSessionExpired, isCliVerbose, isCoreTopic, isEntryExpired, isExportedFromPackage, isStdinPositionalSentinel, isStdinSentinel, isTokenExpired, isVisibleProperty, iterateDbxCliCallModel, loadActionManifests, loadActionRegistry, loadAuthRegistry, loadCliConfig, loadCssUtilityRegistry, loadDbxDocsUiExamplesManifests, loadDbxDocsUiExamplesRegistry, loadFilterManifests, loadFilterRegistry, loadForgeFieldManifests, loadForgeFieldRegistry, loadModelFirebaseIndexManifests, loadModelFirebaseIndexRegistry, loadModelSnapshotFieldManifests, loadModelSnapshotFieldRegistry, loadOrBuildCliCachedData, loadPackageName, loadPipeManifests, loadPipeRegistry, loadRouteTree, loadScanSection, loadSemanticTypeManifests, loadSemanticTypeRegistry, loadTokenManifests, loadTokenRegistry, loadUiComponentManifests, loadUiComponentRegistry, loadUtilManifests, loadUtilRegistry, maskEnv, maskSecret, matchUrlAgainstEntries, mcpManifestKey, mergeCliConfig, mergeCliEnvWithDefault, mergeCliFirebaseConfig, mergeOutputConfig, normalizeCliCacheFilter, normalizePathname, oidcRelyingPartyErrorToCliError, openStreamingDump, openUrlInBrowser, outputError, outputResult, packageNameToSlug, parseAnnotation, parseDeclarations$1 as parseDeclarations, parseFirestoreModelIdentityArgs, parseGetArgs, parseGetManyArgs, parseLoopbackRedirectUri, parsePastedRedirect, parseRouteModelTag, parseScanArgs, pickFields, promptLine, readAllStdin, readCliArtifactPackage, readDirectiveDecorator, readEnvTokenEntry, readPropertyDescription, readSelector, readStdinTokens, readStringProperty, refreshAccessToken, renderCliFirestoreQueryEntry, renderCliFirestoreQueryList, renderDecodedKey, renderGroupedImportLines, renderModelManifestEntry, renderModelManifestFields, renderModelManifestList, renderTable, requireCliContext, requireCliFirestoreContext, requireCliFirestoreModels, requireCliFirestoreSession, resolveActiveEnvName, resolveCliDataCacheOptions, resolveCliEnv, resolveCliEnvOrThrow, resolveCliFirestoreQueryArgs, resolveCliFirestoreQueryEntry, resolveCliModel, resolveCliReadSource, resolveComponentSourceFromSources, resolveDemoClaimsPath, resolveExplicitFirebasePackages, resolveExtendsName, resolveModelArchetype, resolveOutputConfig, resolveOxfmtConfig, resolvePerModelGetKey, resolveRouteSources, revokeToken, runActionsScanCli, runCli, runCliFirestoreQuery, runCssUtilitiesScanCli, runDbxDocsUiExamplesScanCli, runFiltersScanCli, runForgeFieldsScanCli, runModelFirebaseIndexScanCli, runModelSnapshotFieldsScanCli, runPaginatedList, runPipesScanCli, runScanCli, runScanCliBase, runUiComponentsScanCli, runUtilsScanCli, sanitizeString, saveCliConfig, scanFactoryReferences, scoreCandidates, serializeActionManifest, serializeCssUtilityManifest, serializeDbxDocsUiExamplesManifest, serializeFilterManifest, serializeForgeFieldManifest, serializeManifest, serializeModelSnapshotFieldsManifest, serializePipeManifest, serializeUiComponentManifest, serializeUtilManifest, setCliContext, setCliRawArgv, setCliTimeoutMs, setCliVerbose, splitListTagText$1 as splitListTagText, splitSegments, startLoopbackRedirectCapture, stripUrlQueryAndHash, toActionEntryInfo, toCliCacheJson, toFilterEntryInfo, toFormFieldInfo, tracedFetch, truncate, tryMatchSegments, unwrapFenced, validateMcpToolName, verboseLog, withCallModelArgs, withEnv, withMultiplePages, withOutput, withServiceTokenScopes, wrapCommandHandler, wrapSyncCommandHandler, writeGeneratedTsFile };