@google/gemini-cli 0.33.0-preview.7 → 0.33.0-preview.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/gemini.js CHANGED
@@ -88852,7 +88852,12 @@ function resolveToRealPath(pathStr) {
88852
88852
  }
88853
88853
  return robustRealpath(path3.resolve(resolvedPath));
88854
88854
  }
88855
- function robustRealpath(p) {
88855
+ function robustRealpath(p, visited = /* @__PURE__ */ new Set()) {
88856
+ const key = process.platform === "win32" ? p.toLowerCase() : p;
88857
+ if (visited.has(key)) {
88858
+ throw new Error(`Infinite recursion detected in robustRealpath: ${p}`);
88859
+ }
88860
+ visited.add(key);
88856
88861
  try {
88857
88862
  return fs9.realpathSync(p);
88858
88863
  } catch (e3) {
@@ -88862,14 +88867,17 @@ function robustRealpath(p) {
88862
88867
  if (stat15.isSymbolicLink()) {
88863
88868
  const target = fs9.readlinkSync(p);
88864
88869
  const resolvedTarget = path3.resolve(path3.dirname(p), target);
88865
- return robustRealpath(resolvedTarget);
88870
+ return robustRealpath(resolvedTarget, visited);
88871
+ }
88872
+ } catch (lstatError) {
88873
+ if (!(lstatError && typeof lstatError === "object" && "code" in lstatError && lstatError.code === "ENOENT")) {
88874
+ throw lstatError;
88866
88875
  }
88867
- } catch {
88868
88876
  }
88869
88877
  const parent = path3.dirname(p);
88870
88878
  if (parent === p)
88871
88879
  return p;
88872
- return path3.join(robustRealpath(parent), path3.basename(p));
88880
+ return path3.join(robustRealpath(parent, visited), path3.basename(p));
88873
88881
  }
88874
88882
  throw e3;
88875
88883
  }
@@ -118054,7 +118062,8 @@ var init_billing = __esm({
118054
118062
  G1_CREDIT_TYPE = "GOOGLE_ONE_AI";
118055
118063
  OVERAGE_ELIGIBLE_MODELS = /* @__PURE__ */ new Set([
118056
118064
  PREVIEW_GEMINI_MODEL,
118057
- PREVIEW_GEMINI_3_1_MODEL
118065
+ PREVIEW_GEMINI_3_1_MODEL,
118066
+ PREVIEW_GEMINI_FLASH_MODEL
118058
118067
  ]);
118059
118068
  G1_AI_BASE_URL = "https://one.google.com/ai";
118060
118069
  ACCOUNT_CHOOSER_URL = "https://accounts.google.com/AccountChooser";
@@ -196341,8 +196350,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
196341
196350
  var init_git_commit = __esm({
196342
196351
  "packages/core/dist/src/generated/git-commit.js"() {
196343
196352
  "use strict";
196344
- GIT_COMMIT_INFO = "5d2983f12";
196345
- CLI_VERSION = "0.33.0-preview.7";
196353
+ GIT_COMMIT_INFO = "5e80faf38";
196354
+ CLI_VERSION = "0.33.0-preview.9";
196346
196355
  }
196347
196356
  });
196348
196357
 
@@ -292810,7 +292819,7 @@ function getVersion() {
292810
292819
  }
292811
292820
  versionPromise = (async () => {
292812
292821
  const pkgJson = await getPackageJson(__dirname3);
292813
- return "0.33.0-preview.7";
292822
+ return "0.33.0-preview.9";
292814
292823
  })();
292815
292824
  return versionPromise;
292816
292825
  }
@@ -292892,6 +292901,7 @@ var init_server = __esm({
292892
292901
  init_types8();
292893
292902
  init_billing();
292894
292903
  init_loggers();
292904
+ init_events();
292895
292905
  init_billingEvents();
292896
292906
  init_converter();
292897
292907
  init_telemetry2();
@@ -292922,6 +292932,10 @@ var init_server = __esm({
292922
292932
  const autoUse = this.config ? shouldAutoUseCredits(this.config.getBillingSettings().overageStrategy, getG1CreditBalance(this.paidTier)) : false;
292923
292933
  const modelIsEligible = isOverageEligibleModel(req.model);
292924
292934
  const shouldEnableCredits = modelIsEligible && autoUse;
292935
+ if (shouldEnableCredits && !this.config?.getCreditsNotificationShown()) {
292936
+ this.config?.setCreditsNotificationShown(true);
292937
+ coreEvents.emitFeedback("info", "Using AI Credits for this request.");
292938
+ }
292925
292939
  const enabledCreditTypes = shouldEnableCredits ? [G1_CREDIT_TYPE] : void 0;
292926
292940
  const responses = await this.requestStreamingPost("streamGenerateContent", toGenerateContentRequest(req, userPromptId, this.projectId, this.sessionId, enabledCreditTypes), req.config?.abortSignal);
292927
292941
  const streamingLatency = {};
@@ -433378,6 +433392,7 @@ var init_config4 = __esm({
433378
433392
  fallbackModelHandler;
433379
433393
  validationHandler;
433380
433394
  quotaErrorOccurred = false;
433395
+ creditsNotificationShown = false;
433381
433396
  modelQuotas = /* @__PURE__ */ new Map();
433382
433397
  lastRetrievedQuota;
433383
433398
  lastQuotaFetchTime = 0;
@@ -433910,6 +433925,11 @@ var init_config4 = __esm({
433910
433925
  resetTurn() {
433911
433926
  this.modelAvailabilityService.resetTurn();
433912
433927
  }
433928
+ /** Resets billing state (overageStrategy, creditsNotificationShown) once per user prompt. */
433929
+ resetBillingTurnState(overageStrategy) {
433930
+ this.creditsNotificationShown = false;
433931
+ this.billing.overageStrategy = overageStrategy ?? "ask";
433932
+ }
433913
433933
  getMaxSessionTurns() {
433914
433934
  return this.maxSessionTurns;
433915
433935
  }
@@ -433919,6 +433939,12 @@ var init_config4 = __esm({
433919
433939
  getQuotaErrorOccurred() {
433920
433940
  return this.quotaErrorOccurred;
433921
433941
  }
433942
+ setCreditsNotificationShown(value) {
433943
+ this.creditsNotificationShown = value;
433944
+ }
433945
+ getCreditsNotificationShown() {
433946
+ return this.creditsNotificationShown;
433947
+ }
433922
433948
  setQuota(remaining, limit, modelId) {
433923
433949
  const activeModel = modelId ?? this.getActiveModel();
433924
433950
  if (remaining !== void 0 && limit !== void 0) {
@@ -515066,7 +515092,7 @@ var WarningMessage = ({ text }) => {
515066
515092
  };
515067
515093
 
515068
515094
  // packages/cli/src/generated/git-commit.ts
515069
- var GIT_COMMIT_INFO2 = "8fa4585eb";
515095
+ var GIT_COMMIT_INFO2 = "94ccdc75c";
515070
515096
 
515071
515097
  // packages/cli/src/ui/components/AboutBox.tsx
515072
515098
  init_dist8();
@@ -538395,8 +538421,7 @@ async function handleOverageMenu(args2, creditBalance) {
538395
538421
  resetTime,
538396
538422
  isDialogPending,
538397
538423
  setOverageMenuRequest,
538398
- setModelSwitchedFromQuotaError,
538399
- historyManager
538424
+ setModelSwitchedFromQuotaError
538400
538425
  } = args2;
538401
538426
  logBillingEvent(
538402
538427
  config2,
@@ -538434,13 +538459,6 @@ async function handleOverageMenu(args2, creditBalance) {
538434
538459
  setModelSwitchedFromQuotaError(false);
538435
538460
  config2.setQuotaErrorOccurred(false);
538436
538461
  config2.setOverageStrategy("always");
538437
- historyManager.addItem(
538438
- {
538439
- type: "info" /* INFO */,
538440
- text: `Using AI Credits for this request.`
538441
- },
538442
- Date.now()
538443
- );
538444
538462
  return "retry_with_credits";
538445
538463
  case "use_fallback":
538446
538464
  return "retry_always";
@@ -538547,7 +538565,6 @@ function useQuotaAndFallback({
538547
538565
  const [emptyWalletRequest, setEmptyWalletRequest] = (0, import_react134.useState)(null);
538548
538566
  const isDialogPending = (0, import_react134.useRef)(false);
538549
538567
  const isValidationPending = (0, import_react134.useRef)(false);
538550
- const initialOverageStrategy = settings.merged.billing?.overageStrategy ?? "ask";
538551
538568
  (0, import_react134.useEffect)(() => {
538552
538569
  const fallbackHandler = async (failedModel, fallbackModel, error40) => {
538553
538570
  const contentGeneratorConfig = config2.getContentGeneratorConfig();
@@ -538560,7 +538577,7 @@ function useQuotaAndFallback({
538560
538577
  const isInsufficientCredits = error40.isInsufficientCredits;
538561
538578
  if (!isInsufficientCredits && paidTier?.availableCredits && isOverageEligibleModel(failedModel)) {
538562
538579
  const resetTime = error40.retryDelayMs ? getResetTimeMessage(error40.retryDelayMs) : void 0;
538563
- const overageStrategy = config2.getBillingSettings().overageStrategy ?? initialOverageStrategy;
538580
+ const overageStrategy = config2.getBillingSettings().overageStrategy;
538564
538581
  const creditsResult = await handleCreditsFlow({
538565
538582
  config: config2,
538566
538583
  paidTier,
@@ -538639,7 +538656,6 @@ function useQuotaAndFallback({
538639
538656
  userTier,
538640
538657
  paidTier,
538641
538658
  settings,
538642
- initialOverageStrategy,
538643
538659
  setModelSwitchedFromQuotaError,
538644
538660
  onShowAuthSelection,
538645
538661
  errorVerbosity
@@ -550952,6 +550968,9 @@ var useGeminiStream = (geminiClient, history, addItem, config2, settings, onDebu
550952
550968
  if (!options?.isContinuation) {
550953
550969
  setModelSwitchedFromQuotaError(false);
550954
550970
  config2.setQuotaErrorOccurred(false);
550971
+ config2.resetBillingTurnState(
550972
+ settings.merged.billing?.overageStrategy
550973
+ );
550955
550974
  suppressedToolErrorCountRef.current = 0;
550956
550975
  suppressedToolErrorNoteShownRef.current = false;
550957
550976
  lowVerbosityFailureNoteShownRef.current = false;
@@ -551089,7 +551108,8 @@ var useGeminiStream = (geminiClient, history, addItem, config2, settings, onDebu
551089
551108
  getPromptCount,
551090
551109
  setThought,
551091
551110
  maybeAddSuppressedToolErrorNote,
551092
- maybeAddLowVerbosityFailureNote
551111
+ maybeAddLowVerbosityFailureNote,
551112
+ settings.merged.billing?.overageStrategy
551093
551113
  ]
551094
551114
  );
551095
551115
  const handleApprovalModeChange = (0, import_react161.useCallback)(
@@ -563483,7 +563503,7 @@ async function loadSandboxConfig(settings, argv) {
563483
563503
  const sandboxOption = argv.sandbox ?? settings.tools?.sandbox;
563484
563504
  const command2 = getSandboxCommand(sandboxOption);
563485
563505
  const packageJson2 = await getPackageJson(__dirname13);
563486
- const image2 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.33.0-preview.7" ?? packageJson2?.config?.sandboxImageUri;
563506
+ const image2 = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.33.0-preview.9" ?? packageJson2?.config?.sandboxImageUri;
563487
563507
  return command2 && image2 ? { command: command2, image: image2 } : void 0;
563488
563508
  }
563489
563509
 
@@ -564113,6 +564133,7 @@ async function loadCliConfig(settings, sessionId2, argv, options = {}) {
564113
564133
  fakeResponses: argv.fakeResponses,
564114
564134
  recordResponses: argv.recordResponses,
564115
564135
  retryFetchErrors: settings.general?.retryFetchErrors,
564136
+ billing: settings.billing,
564116
564137
  maxAttempts: settings.general?.maxAttempts,
564117
564138
  ptyInfo: ptyInfo?.name,
564118
564139
  disableLLMCorrection: settings.tools?.disableLLMCorrection,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/gemini-cli-devtools",
3
- "version": "0.33.0-preview.7",
3
+ "version": "0.33.0-preview.9",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/gemini-cli",
3
- "version": "0.33.0-preview.7",
3
+ "version": "0.33.0-preview.9",
4
4
  "description": "Gemini CLI",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {