@google/gemini-cli-a2a-server 0.12.0-preview.0 → 0.13.0-nightly.20251030.42c79c64

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.
@@ -123359,32 +123359,32 @@ var require_Meter = __commonJS({
123359
123359
  */
123360
123360
  createGauge(name4, options2) {
123361
123361
  const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name4, MetricData_1.InstrumentType.GAUGE, options2);
123362
- const storage = this._meterSharedState.registerMetricStorage(descriptor);
123363
- return new Instruments_1.GaugeInstrument(storage, descriptor);
123362
+ const storage2 = this._meterSharedState.registerMetricStorage(descriptor);
123363
+ return new Instruments_1.GaugeInstrument(storage2, descriptor);
123364
123364
  }
123365
123365
  /**
123366
123366
  * Create a {@link Histogram} instrument.
123367
123367
  */
123368
123368
  createHistogram(name4, options2) {
123369
123369
  const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name4, MetricData_1.InstrumentType.HISTOGRAM, options2);
123370
- const storage = this._meterSharedState.registerMetricStorage(descriptor);
123371
- return new Instruments_1.HistogramInstrument(storage, descriptor);
123370
+ const storage2 = this._meterSharedState.registerMetricStorage(descriptor);
123371
+ return new Instruments_1.HistogramInstrument(storage2, descriptor);
123372
123372
  }
123373
123373
  /**
123374
123374
  * Create a {@link Counter} instrument.
123375
123375
  */
123376
123376
  createCounter(name4, options2) {
123377
123377
  const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name4, MetricData_1.InstrumentType.COUNTER, options2);
123378
- const storage = this._meterSharedState.registerMetricStorage(descriptor);
123379
- return new Instruments_1.CounterInstrument(storage, descriptor);
123378
+ const storage2 = this._meterSharedState.registerMetricStorage(descriptor);
123379
+ return new Instruments_1.CounterInstrument(storage2, descriptor);
123380
123380
  }
123381
123381
  /**
123382
123382
  * Create a {@link UpDownCounter} instrument.
123383
123383
  */
123384
123384
  createUpDownCounter(name4, options2) {
123385
123385
  const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name4, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options2);
123386
- const storage = this._meterSharedState.registerMetricStorage(descriptor);
123387
- return new Instruments_1.UpDownCounterInstrument(storage, descriptor);
123386
+ const storage2 = this._meterSharedState.registerMetricStorage(descriptor);
123387
+ return new Instruments_1.UpDownCounterInstrument(storage2, descriptor);
123388
123388
  }
123389
123389
  /**
123390
123390
  * Create a {@link ObservableGauge} instrument.
@@ -123870,16 +123870,16 @@ var require_MetricStorageRegistry = __commonJS({
123870
123870
  }
123871
123871
  return storages;
123872
123872
  }
123873
- register(storage) {
123874
- this._registerStorage(storage, this._sharedRegistry);
123873
+ register(storage2) {
123874
+ this._registerStorage(storage2, this._sharedRegistry);
123875
123875
  }
123876
- registerForCollector(collector, storage) {
123876
+ registerForCollector(collector, storage2) {
123877
123877
  let storageMap = this._perCollectorRegistry.get(collector);
123878
123878
  if (storageMap == null) {
123879
123879
  storageMap = /* @__PURE__ */ new Map();
123880
123880
  this._perCollectorRegistry.set(collector, storageMap);
123881
123881
  }
123882
- this._registerStorage(storage, storageMap);
123882
+ this._registerStorage(storage2, storageMap);
123883
123883
  }
123884
123884
  findOrUpdateCompatibleStorage(expectedDescriptor) {
123885
123885
  const storages = this._sharedRegistry.get(expectedDescriptor.name);
@@ -123899,14 +123899,14 @@ var require_MetricStorageRegistry = __commonJS({
123899
123899
  }
123900
123900
  return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages);
123901
123901
  }
123902
- _registerStorage(storage, storageMap) {
123903
- const descriptor = storage.getInstrumentDescriptor();
123902
+ _registerStorage(storage2, storageMap) {
123903
+ const descriptor = storage2.getInstrumentDescriptor();
123904
123904
  const storages = storageMap.get(descriptor.name);
123905
123905
  if (storages === void 0) {
123906
- storageMap.set(descriptor.name, [storage]);
123906
+ storageMap.set(descriptor.name, [storage2]);
123907
123907
  return;
123908
123908
  }
123909
- storages.push(storage);
123909
+ storages.push(storage2);
123910
123910
  }
123911
123911
  _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) {
123912
123912
  let compatibleStorage = null;
@@ -124324,9 +124324,9 @@ var require_MeterSharedState = __commonJS({
124324
124324
  }
124325
124325
  const aggregator = aggregation.createAggregator(descriptor);
124326
124326
  const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type);
124327
- const storage = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit);
124328
- this.metricStorageRegistry.registerForCollector(collector, storage);
124329
- return storage;
124327
+ const storage2 = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit);
124328
+ this.metricStorageRegistry.registerForCollector(collector, storage2);
124329
+ return storage2;
124330
124330
  });
124331
124331
  storages = storages.concat(collectorStorages);
124332
124332
  }
@@ -233447,8 +233447,8 @@ var require_cache4 = __commonJS({
233447
233447
  */
233448
233448
  #queryCache(requestQuery, options2, targetStorage) {
233449
233449
  const resultList = [];
233450
- const storage = targetStorage ?? this.#relevantRequestResponseList;
233451
- for (const requestResponse of storage) {
233450
+ const storage2 = targetStorage ?? this.#relevantRequestResponseList;
233451
+ for (const requestResponse of storage2) {
233452
233452
  const [cachedRequest, cachedResponse] = requestResponse;
233453
233453
  if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options2)) {
233454
233454
  resultList.push(requestResponse);
@@ -252648,11 +252648,11 @@ var SignerExceptionMessages;
252648
252648
  var DEFAULT_SIGNING_VERSION = "v2";
252649
252649
  var SEVEN_DAYS = 7 * 24 * 60 * 60;
252650
252650
  var URLSigner = class {
252651
- constructor(auth2, bucket, file, storage = new Storage()) {
252651
+ constructor(auth2, bucket, file, storage2 = new Storage()) {
252652
252652
  this.auth = auth2;
252653
252653
  this.bucket = bucket;
252654
252654
  this.file = file;
252655
- this.storage = storage;
252655
+ this.storage = storage2;
252656
252656
  }
252657
252657
  getSignedUrl(cfg) {
252658
252658
  const expiresInSeconds = this.parseExpires(cfg.expires);
@@ -257203,7 +257203,7 @@ var Bucket = class _Bucket extends ServiceObject {
257203
257203
  getFilesStream(query) {
257204
257204
  return new Readable2();
257205
257205
  }
257206
- constructor(storage, name4, options2) {
257206
+ constructor(storage2, name4, options2) {
257207
257207
  var _a3, _b, _c, _d;
257208
257208
  options2 = options2 || {};
257209
257209
  name4 = name4.replace(/^gs:\/\//, "").replace(/\/+$/, "");
@@ -257565,14 +257565,14 @@ var Bucket = class _Bucket extends ServiceObject {
257565
257565
  }
257566
257566
  };
257567
257567
  super({
257568
- parent: storage,
257568
+ parent: storage2,
257569
257569
  baseUrl: "/b",
257570
257570
  id: name4,
257571
- createMethod: storage.createBucket.bind(storage),
257571
+ createMethod: storage2.createBucket.bind(storage2),
257572
257572
  methods
257573
257573
  });
257574
257574
  this.name = name4;
257575
- this.storage = storage;
257575
+ this.storage = storage2;
257576
257576
  this.userProject = options2.userProject;
257577
257577
  this.acl = new Acl({
257578
257578
  request: this.request.bind(this),
@@ -257585,7 +257585,7 @@ var Bucket = class _Bucket extends ServiceObject {
257585
257585
  this.crc32cGenerator = options2.crc32cGenerator || this.storage.crc32cGenerator;
257586
257586
  this.iam = new Iam(this);
257587
257587
  this.getFilesStream = import_paginator.paginator.streamify("getFiles");
257588
- this.instanceRetryValue = storage.retryOptions.autoRetry;
257588
+ this.instanceRetryValue = storage2.retryOptions.autoRetry;
257589
257589
  this.instancePreconditionOpts = options2 === null || options2 === void 0 ? void 0 : options2.preconditionOpts;
257590
257590
  }
257591
257591
  /**
@@ -260271,9 +260271,9 @@ import_paginator.paginator.extend(Bucket, "getFiles");
260271
260271
  // node_modules/@google-cloud/storage/build/esm/src/channel.js
260272
260272
  var import_promisify7 = __toESM(require_src14(), 1);
260273
260273
  var Channel = class extends ServiceObject {
260274
- constructor(storage, id, resourceId) {
260274
+ constructor(storage2, id, resourceId) {
260275
260275
  const config2 = {
260276
- parent: storage,
260276
+ parent: storage2,
260277
260277
  baseUrl: "/channels",
260278
260278
  // An ID shouldn't be included in the API requests.
260279
260279
  // RE:
@@ -260363,7 +260363,7 @@ var HmacKey = class extends ServiceObject {
260363
260363
  * const hmacKey = storage.hmacKey('access-id');
260364
260364
  * ```
260365
260365
  */
260366
- constructor(storage, accessId, options2) {
260366
+ constructor(storage2, accessId, options2) {
260367
260367
  const methods = {
260368
260368
  /**
260369
260369
  * @typedef {object} DeleteHmacKeyOptions
@@ -260601,15 +260601,15 @@ var HmacKey = class extends ServiceObject {
260601
260601
  }
260602
260602
  }
260603
260603
  };
260604
- const projectId = options2 && options2.projectId || storage.projectId;
260604
+ const projectId = options2 && options2.projectId || storage2.projectId;
260605
260605
  super({
260606
- parent: storage,
260606
+ parent: storage2,
260607
260607
  id: accessId,
260608
260608
  baseUrl: `/projects/${projectId}/hmacKeys`,
260609
260609
  methods
260610
260610
  });
260611
- this.storage = storage;
260612
- this.instanceRetryValue = storage.retryOptions.autoRetry;
260611
+ this.storage = storage2;
260612
+ this.instanceRetryValue = storage2.retryOptions.autoRetry;
260613
260613
  }
260614
260614
  setMetadata(metadata2, optionsOrCallback, cb) {
260615
260615
  if (this.storage.retryOptions.idempotencyStrategy !== IdempotencyStrategy.RetryAlways) {
@@ -285567,28 +285567,28 @@ var HybridTokenStorage = class extends BaseTokenStorage {
285567
285567
  return await this.storageInitPromise;
285568
285568
  }
285569
285569
  async getCredentials(serverName) {
285570
- const storage = await this.getStorage();
285571
- return storage.getCredentials(serverName);
285570
+ const storage2 = await this.getStorage();
285571
+ return storage2.getCredentials(serverName);
285572
285572
  }
285573
285573
  async setCredentials(credentials) {
285574
- const storage = await this.getStorage();
285575
- await storage.setCredentials(credentials);
285574
+ const storage2 = await this.getStorage();
285575
+ await storage2.setCredentials(credentials);
285576
285576
  }
285577
285577
  async deleteCredentials(serverName) {
285578
- const storage = await this.getStorage();
285579
- await storage.deleteCredentials(serverName);
285578
+ const storage2 = await this.getStorage();
285579
+ await storage2.deleteCredentials(serverName);
285580
285580
  }
285581
285581
  async listServers() {
285582
- const storage = await this.getStorage();
285583
- return storage.listServers();
285582
+ const storage2 = await this.getStorage();
285583
+ return storage2.listServers();
285584
285584
  }
285585
285585
  async getAllCredentials() {
285586
- const storage = await this.getStorage();
285587
- return storage.getAllCredentials();
285586
+ const storage2 = await this.getStorage();
285587
+ return storage2.getAllCredentials();
285588
285588
  }
285589
285589
  async clearAll() {
285590
- const storage = await this.getStorage();
285591
- await storage.clearAll();
285590
+ const storage2 = await this.getStorage();
285591
+ await storage2.clearAll();
285592
285592
  }
285593
285593
  async getStorageType() {
285594
285594
  await this.getStorage();
@@ -285625,8 +285625,8 @@ var OAuthCredentialStorage = class {
285625
285625
  }
285626
285626
  return await this.migrateFromFileStorage();
285627
285627
  } catch (error) {
285628
- console.error(error);
285629
- throw new Error("Failed to load OAuth credentials");
285628
+ coreEvents.emitFeedback("error", "Failed to load OAuth credentials", error);
285629
+ throw new Error("Failed to load OAuth credentials", { cause: error });
285630
285630
  }
285631
285631
  }
285632
285632
  /**
@@ -285659,8 +285659,8 @@ var OAuthCredentialStorage = class {
285659
285659
  await fs21.rm(oldFilePath, { force: true }).catch(() => {
285660
285660
  });
285661
285661
  } catch (error) {
285662
- console.error(error);
285663
- throw new Error("Failed to clear OAuth credentials");
285662
+ coreEvents.emitFeedback("error", "Failed to clear OAuth credentials", error);
285663
+ throw new Error("Failed to clear OAuth credentials", { cause: error });
285664
285664
  }
285665
285665
  }
285666
285666
  /**
@@ -288967,8 +288967,8 @@ var Float64Vector = import_vector.default.Float64Vector;
288967
288967
  var PointerVector = import_vector.default.PointerVector;
288968
288968
 
288969
288969
  // packages/core/dist/src/generated/git-commit.js
288970
- var GIT_COMMIT_INFO = "cca41edc";
288971
- var CLI_VERSION = "0.12.0-preview.0";
288970
+ var GIT_COMMIT_INFO = "42c79c64";
288971
+ var CLI_VERSION = "0.13.0-nightly.20251030.42c79c64";
288972
288972
 
288973
288973
  // packages/core/dist/src/ide/detect-ide.js
288974
288974
  var IDE_DEFINITIONS = {
@@ -289337,6 +289337,7 @@ var ClearcutLogger = class _ClearcutLogger {
289337
289337
  gemini_cli_key: EventMetadataKey.GEMINI_CLI_START_SESSION_EXTENSIONS_COUNT,
289338
289338
  value: event.extensions_count.toString()
289339
289339
  },
289340
+ // We deliberately do not log the names of extensions here, to be safe.
289340
289341
  {
289341
289342
  gemini_cli_key: EventMetadataKey.GEMINI_CLI_START_SESSION_EXTENSION_IDS,
289342
289343
  value: event.extension_ids.toString()
@@ -291536,6 +291537,26 @@ async function createCodeAssistContentGenerator(httpOptions, authType, config2,
291536
291537
  throw new Error(`Unsupported authType: ${authType}`);
291537
291538
  }
291538
291539
 
291540
+ // packages/core/dist/src/core/apiKeyCredentialStorage.js
291541
+ var KEYCHAIN_SERVICE_NAME2 = "gemini-cli-api-key";
291542
+ var DEFAULT_API_KEY_ENTRY = "default-api-key";
291543
+ var storage = new HybridTokenStorage(KEYCHAIN_SERVICE_NAME2);
291544
+ async function loadApiKey() {
291545
+ try {
291546
+ const credentials = await storage.getCredentials(DEFAULT_API_KEY_ENTRY);
291547
+ if (credentials?.token?.accessToken) {
291548
+ return credentials.token.accessToken;
291549
+ }
291550
+ return null;
291551
+ } catch (error) {
291552
+ if (error instanceof Error && error.message === "Token file does not exist") {
291553
+ return null;
291554
+ }
291555
+ debugLogger.error("Failed to load API key from storage:", error);
291556
+ return null;
291557
+ }
291558
+ }
291559
+
291539
291560
  // packages/core/dist/src/core/fakeContentGenerator.js
291540
291561
  import { promises } from "node:fs";
291541
291562
  var FakeContentGenerator = class _FakeContentGenerator {
@@ -291659,8 +291680,8 @@ var AuthType2;
291659
291680
  AuthType3["USE_VERTEX_AI"] = "vertex-ai";
291660
291681
  AuthType3["CLOUD_SHELL"] = "cloud-shell";
291661
291682
  })(AuthType2 || (AuthType2 = {}));
291662
- function createContentGeneratorConfig(config2, authType) {
291663
- const geminiApiKey = process.env["GEMINI_API_KEY"] || void 0;
291683
+ async function createContentGeneratorConfig(config2, authType) {
291684
+ const geminiApiKey = await loadApiKey() || process.env["GEMINI_API_KEY"] || void 0;
291664
291685
  const googleApiKey = process.env["GOOGLE_API_KEY"] || void 0;
291665
291686
  const googleCloudProject = process.env["GOOGLE_CLOUD_PROJECT"] || process.env["GOOGLE_CLOUD_PROJECT_ID"] || void 0;
291666
291687
  const googleCloudLocation = process.env["GOOGLE_CLOUD_LOCATION"] || void 0;
@@ -291688,7 +291709,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
291688
291709
  if (gcConfig.fakeResponses) {
291689
291710
  return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
291690
291711
  }
291691
- const version3 = "0.12.0-preview.0";
291712
+ const version3 = "0.13.0-nightly.20251030.42c79c64";
291692
291713
  const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
291693
291714
  const baseHeaders = {
291694
291715
  "User-Agent": userAgent
@@ -332284,7 +332305,7 @@ var ShellToolInvocation = class extends BaseToolInvocation {
332284
332305
  const pgrepLines = fs41.readFileSync(tempFilePath, "utf8").split(EOL3).filter(Boolean);
332285
332306
  for (const line of pgrepLines) {
332286
332307
  if (!/^\d+$/.test(line)) {
332287
- console.error(`pgrep: ${line}`);
332308
+ debugLogger.error(`pgrep: ${line}`);
332288
332309
  }
332289
332310
  const pid2 = Number(line);
332290
332311
  if (pid2 !== result.pid) {
@@ -332293,7 +332314,7 @@ var ShellToolInvocation = class extends BaseToolInvocation {
332293
332314
  }
332294
332315
  } else {
332295
332316
  if (!signal.aborted) {
332296
- console.error("missing pgrep output");
332317
+ debugLogger.error("missing pgrep output");
332297
332318
  }
332298
332319
  }
332299
332320
  }
@@ -332445,7 +332466,7 @@ var ShellTool = class _ShellTool extends BaseDeclarativeTool {
332445
332466
  const commandCheck = isCommandAllowed(params.command, this.config);
332446
332467
  if (!commandCheck.allowed) {
332447
332468
  if (!commandCheck.reason) {
332448
- console.error("Unexpected: isCommandAllowed returned false without a reason");
332469
+ debugLogger.error("Unexpected: isCommandAllowed returned false without a reason");
332449
332470
  return `Command is not allowed: ${params.command}`;
332450
332471
  }
332451
332472
  return commandCheck.reason;
@@ -346411,9 +346432,9 @@ var simpleGit = gitInstanceFactory;
346411
346432
  var GitService = class {
346412
346433
  projectRoot;
346413
346434
  storage;
346414
- constructor(projectRoot, storage) {
346435
+ constructor(projectRoot, storage2) {
346415
346436
  this.projectRoot = path53.resolve(projectRoot);
346416
- this.storage = storage;
346437
+ this.storage = storage2;
346417
346438
  }
346418
346439
  getHistoryDir() {
346419
346440
  return this.storage.getHistoryDir();
@@ -349692,7 +349713,7 @@ var Config = class {
349692
349713
  if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod === AuthType2.LOGIN_WITH_GOOGLE) {
349693
349714
  this.geminiClient.stripThoughtsFromHistory();
349694
349715
  }
349695
- const newContentGeneratorConfig = createContentGeneratorConfig(this, authMethod);
349716
+ const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
349696
349717
  this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
349697
349718
  this.contentGeneratorConfig = newContentGeneratorConfig;
349698
349719
  this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);