@google/gemini-cli-a2a-server 0.12.0-preview.0 → 0.12.0-preview.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a-server.mjs +67 -29
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -70097,6 +70097,7 @@ var init_events = __esm({
|
|
|
70097
70097
|
(function(CoreEvent2) {
|
|
70098
70098
|
CoreEvent2["UserFeedback"] = "user-feedback";
|
|
70099
70099
|
CoreEvent2["FallbackModeChanged"] = "fallback-mode-changed";
|
|
70100
|
+
CoreEvent2["ModelChanged"] = "model-changed";
|
|
70100
70101
|
})(CoreEvent || (CoreEvent = {}));
|
|
70101
70102
|
CoreEventEmitter = class _CoreEventEmitter extends EventEmitter4 {
|
|
70102
70103
|
_feedbackBacklog = [];
|
|
@@ -70127,6 +70128,13 @@ var init_events = __esm({
|
|
|
70127
70128
|
const payload = { isInFallbackMode };
|
|
70128
70129
|
this.emit(CoreEvent.FallbackModeChanged, payload);
|
|
70129
70130
|
}
|
|
70131
|
+
/**
|
|
70132
|
+
* Notifies subscribers that the model has changed.
|
|
70133
|
+
*/
|
|
70134
|
+
emitModelChanged(model) {
|
|
70135
|
+
const payload = { model };
|
|
70136
|
+
this.emit(CoreEvent.ModelChanged, payload);
|
|
70137
|
+
}
|
|
70130
70138
|
/**
|
|
70131
70139
|
* Flushes buffered messages. Call this immediately after primary UI listener
|
|
70132
70140
|
* subscribes.
|
|
@@ -287210,6 +287218,7 @@ var API_REQUEST_LATENCY = "gemini_cli.api.request.latency";
|
|
|
287210
287218
|
var TOKEN_USAGE = "gemini_cli.token.usage";
|
|
287211
287219
|
var SESSION_COUNT = "gemini_cli.session.count";
|
|
287212
287220
|
var FILE_OPERATION_COUNT = "gemini_cli.file.operation.count";
|
|
287221
|
+
var LINES_CHANGED = "gemini_cli.lines.changed";
|
|
287213
287222
|
var INVALID_CHUNK_COUNT = "gemini_cli.chat.invalid_chunk.count";
|
|
287214
287223
|
var CONTENT_RETRY_COUNT = "gemini_cli.chat.content_retry.count";
|
|
287215
287224
|
var CONTENT_RETRY_FAILURE_COUNT = "gemini_cli.chat.content_retry_failure.count";
|
|
@@ -287268,6 +287277,12 @@ var COUNTER_DEFINITIONS = {
|
|
|
287268
287277
|
assign: (c4) => fileOperationCounter = c4,
|
|
287269
287278
|
attributes: {}
|
|
287270
287279
|
},
|
|
287280
|
+
[LINES_CHANGED]: {
|
|
287281
|
+
description: "Number of lines changed (from file diffs).",
|
|
287282
|
+
valueType: ValueType.INT,
|
|
287283
|
+
assign: (c4) => linesChangedCounter = c4,
|
|
287284
|
+
attributes: {}
|
|
287285
|
+
},
|
|
287271
287286
|
[INVALID_CHUNK_COUNT]: {
|
|
287272
287287
|
description: "Counts invalid chunks received from a stream.",
|
|
287273
287288
|
valueType: ValueType.INT,
|
|
@@ -287512,6 +287527,7 @@ var apiRequestLatencyHistogram;
|
|
|
287512
287527
|
var tokenUsageCounter;
|
|
287513
287528
|
var sessionCounter;
|
|
287514
287529
|
var fileOperationCounter;
|
|
287530
|
+
var linesChangedCounter;
|
|
287515
287531
|
var chatCompressionCounter;
|
|
287516
287532
|
var invalidChunkCounter;
|
|
287517
287533
|
var contentRetryCounter;
|
|
@@ -287627,6 +287643,17 @@ function recordFileOperationMetric(config2, attributes) {
|
|
|
287627
287643
|
...attributes
|
|
287628
287644
|
});
|
|
287629
287645
|
}
|
|
287646
|
+
function recordLinesChanged(config2, lines, changeType, attributes) {
|
|
287647
|
+
if (!linesChangedCounter || !isMetricsInitialized)
|
|
287648
|
+
return;
|
|
287649
|
+
if (!Number.isFinite(lines) || lines <= 0)
|
|
287650
|
+
return;
|
|
287651
|
+
linesChangedCounter.add(lines, {
|
|
287652
|
+
...baseMetricDefinition.getCommonAttributes(config2),
|
|
287653
|
+
type: changeType,
|
|
287654
|
+
...attributes ?? {}
|
|
287655
|
+
});
|
|
287656
|
+
}
|
|
287630
287657
|
function recordContentRetry(config2) {
|
|
287631
287658
|
if (!contentRetryCounter || !isMetricsInitialized)
|
|
287632
287659
|
return;
|
|
@@ -288967,8 +288994,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
288967
288994
|
var PointerVector = import_vector.default.PointerVector;
|
|
288968
288995
|
|
|
288969
288996
|
// packages/core/dist/src/generated/git-commit.js
|
|
288970
|
-
var GIT_COMMIT_INFO = "
|
|
288971
|
-
var CLI_VERSION = "0.12.0-preview.
|
|
288997
|
+
var GIT_COMMIT_INFO = "d6f977cb";
|
|
288998
|
+
var CLI_VERSION = "0.12.0-preview.11";
|
|
288972
288999
|
|
|
288973
289000
|
// packages/core/dist/src/ide/detect-ide.js
|
|
288974
289001
|
var IDE_DEFINITIONS = {
|
|
@@ -291092,14 +291119,22 @@ function logToolCall(config2, event) {
|
|
|
291092
291119
|
function_name: event.function_name,
|
|
291093
291120
|
success: event.success,
|
|
291094
291121
|
decision: event.decision,
|
|
291095
|
-
tool_type: event.tool_type
|
|
291096
|
-
...event.metadata ? {
|
|
291097
|
-
model_added_lines: event.metadata["model_added_lines"],
|
|
291098
|
-
model_removed_lines: event.metadata["model_removed_lines"],
|
|
291099
|
-
user_added_lines: event.metadata["user_added_lines"],
|
|
291100
|
-
user_removed_lines: event.metadata["user_removed_lines"]
|
|
291101
|
-
} : {}
|
|
291122
|
+
tool_type: event.tool_type
|
|
291102
291123
|
});
|
|
291124
|
+
if (event.metadata) {
|
|
291125
|
+
const added = event.metadata["model_added_lines"];
|
|
291126
|
+
if (typeof added === "number" && added > 0) {
|
|
291127
|
+
recordLinesChanged(config2, added, "added", {
|
|
291128
|
+
function_name: event.function_name
|
|
291129
|
+
});
|
|
291130
|
+
}
|
|
291131
|
+
const removed = event.metadata["model_removed_lines"];
|
|
291132
|
+
if (typeof removed === "number" && removed > 0) {
|
|
291133
|
+
recordLinesChanged(config2, removed, "removed", {
|
|
291134
|
+
function_name: event.function_name
|
|
291135
|
+
});
|
|
291136
|
+
}
|
|
291137
|
+
}
|
|
291103
291138
|
}
|
|
291104
291139
|
function logToolOutputTruncated(config2, event) {
|
|
291105
291140
|
ClearcutLogger.getInstance(config2)?.logToolOutputTruncatedEvent(event);
|
|
@@ -291688,7 +291723,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
|
|
|
291688
291723
|
if (gcConfig.fakeResponses) {
|
|
291689
291724
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
291690
291725
|
}
|
|
291691
|
-
const version3 = "0.12.0-preview.
|
|
291726
|
+
const version3 = "0.12.0-preview.11";
|
|
291692
291727
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
291693
291728
|
const baseHeaders = {
|
|
291694
291729
|
"User-Agent": userAgent
|
|
@@ -299485,6 +299520,7 @@ async function openBrowserSecurely(url4) {
|
|
|
299485
299520
|
}
|
|
299486
299521
|
|
|
299487
299522
|
// packages/core/dist/src/mcp/oauth-token-storage.js
|
|
299523
|
+
init_events();
|
|
299488
299524
|
import { promises as fs25 } from "node:fs";
|
|
299489
299525
|
import * as path17 from "node:path";
|
|
299490
299526
|
var MCPOAuthTokenStorage = class {
|
|
@@ -323226,7 +323262,7 @@ var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
|
323226
323262
|
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
|
|
323227
323263
|
var DEFAULT_GEMINI_MODEL_AUTO = "auto";
|
|
323228
323264
|
var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
323229
|
-
var DEFAULT_THINKING_MODE =
|
|
323265
|
+
var DEFAULT_THINKING_MODE = 8192;
|
|
323230
323266
|
function getEffectiveModel(isInFallbackMode, requestedModel) {
|
|
323231
323267
|
if (!isInFallbackMode) {
|
|
323232
323268
|
return requestedModel;
|
|
@@ -325510,8 +325546,7 @@ function classifyGoogleError(error) {
|
|
|
325510
325546
|
for (const violation of quotaFailure.violations) {
|
|
325511
325547
|
const quotaId = violation.quotaId ?? "";
|
|
325512
325548
|
if (quotaId.includes("PerDay") || quotaId.includes("Daily")) {
|
|
325513
|
-
return new TerminalQuotaError(
|
|
325514
|
-
Expected quota reset within 24h.`, googleApiError);
|
|
325549
|
+
return new TerminalQuotaError(`You have exhausted your daily quota on this model.`, googleApiError);
|
|
325515
325550
|
}
|
|
325516
325551
|
}
|
|
325517
325552
|
}
|
|
@@ -325540,8 +325575,7 @@ Expected quota reset within 24h.`, googleApiError);
|
|
|
325540
325575
|
}
|
|
325541
325576
|
const quotaLimit = errorInfo.metadata?.["quota_limit"] ?? "";
|
|
325542
325577
|
if (quotaLimit.includes("PerDay") || quotaLimit.includes("Daily")) {
|
|
325543
|
-
return new TerminalQuotaError(
|
|
325544
|
-
Expected quota reset within 24h.`, googleApiError);
|
|
325578
|
+
return new TerminalQuotaError(`You have exhausted your daily quota on this model.`, googleApiError);
|
|
325545
325579
|
}
|
|
325546
325580
|
}
|
|
325547
325581
|
if (retryInfo?.retryDelay) {
|
|
@@ -340865,7 +340899,10 @@ var LoopDetectionService = class {
|
|
|
340865
340899
|
* @returns true if a loop is detected, false otherwise
|
|
340866
340900
|
*/
|
|
340867
340901
|
addAndCheck(event) {
|
|
340868
|
-
if (this.
|
|
340902
|
+
if (this.disabledForSession) {
|
|
340903
|
+
return false;
|
|
340904
|
+
}
|
|
340905
|
+
if (this.loopDetected) {
|
|
340869
340906
|
return this.loopDetected;
|
|
340870
340907
|
}
|
|
340871
340908
|
switch (event.type) {
|
|
@@ -341123,7 +341160,7 @@ var LoopDetectionService = class {
|
|
|
341123
341160
|
};
|
|
341124
341161
|
|
|
341125
341162
|
// packages/core/dist/src/services/chatCompressionService.js
|
|
341126
|
-
var
|
|
341163
|
+
var DEFAULT_COMPRESSION_TOKEN_THRESHOLD = 0.2;
|
|
341127
341164
|
var COMPRESSION_PRESERVE_THRESHOLD = 0.3;
|
|
341128
341165
|
function findCompressSplitPoint(contents, fraction) {
|
|
341129
341166
|
if (fraction <= 0 || fraction >= 1) {
|
|
@@ -341164,9 +341201,8 @@ var ChatCompressionService = class {
|
|
|
341164
341201
|
};
|
|
341165
341202
|
}
|
|
341166
341203
|
const originalTokenCount = uiTelemetryService.getLastPromptTokenCount();
|
|
341167
|
-
const contextPercentageThreshold = config2.getChatCompression()?.contextPercentageThreshold;
|
|
341168
341204
|
if (!force) {
|
|
341169
|
-
const threshold =
|
|
341205
|
+
const threshold = config2.getCompressionThreshold() ?? DEFAULT_COMPRESSION_TOKEN_THRESHOLD;
|
|
341170
341206
|
if (originalTokenCount < threshold * tokenLimit(model)) {
|
|
341171
341207
|
return {
|
|
341172
341208
|
newHistory: null,
|
|
@@ -346498,6 +346534,9 @@ var GitService = class {
|
|
|
346498
346534
|
}
|
|
346499
346535
|
};
|
|
346500
346536
|
|
|
346537
|
+
// packages/core/dist/src/config/config.js
|
|
346538
|
+
init_events();
|
|
346539
|
+
|
|
346501
346540
|
// packages/core/dist/src/utils/browser.js
|
|
346502
346541
|
function shouldAttemptBrowserLaunch() {
|
|
346503
346542
|
const browserBlocklist = ["www-browser"];
|
|
@@ -349511,7 +349550,7 @@ var Config = class {
|
|
|
349511
349550
|
summarizeToolOutput;
|
|
349512
349551
|
experimentalZedIntegration = false;
|
|
349513
349552
|
loadMemoryFromIncludeDirectories = false;
|
|
349514
|
-
|
|
349553
|
+
compressionThreshold;
|
|
349515
349554
|
interactive;
|
|
349516
349555
|
ptyInfo;
|
|
349517
349556
|
trustedFolder;
|
|
@@ -349599,7 +349638,7 @@ var Config = class {
|
|
|
349599
349638
|
this.folderTrust = params.folderTrust ?? false;
|
|
349600
349639
|
this.ideMode = params.ideMode ?? false;
|
|
349601
349640
|
this.loadMemoryFromIncludeDirectories = params.loadMemoryFromIncludeDirectories ?? false;
|
|
349602
|
-
this.
|
|
349641
|
+
this.compressionThreshold = params.compressionThreshold;
|
|
349603
349642
|
this.interactive = params.interactive ?? false;
|
|
349604
349643
|
this.ptyInfo = params.ptyInfo ?? "child_process";
|
|
349605
349644
|
this.trustedFolder = params.trustedFolder;
|
|
@@ -349619,9 +349658,7 @@ var Config = class {
|
|
|
349619
349658
|
this.useWriteTodos = params.useWriteTodos ?? false;
|
|
349620
349659
|
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
349621
349660
|
this.useModelRouter = this.initialUseModelRouter;
|
|
349622
|
-
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [
|
|
349623
|
-
AuthType2.LOGIN_WITH_GOOGLE
|
|
349624
|
-
];
|
|
349661
|
+
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
349625
349662
|
this.enableMessageBusIntegration = params.enableMessageBusIntegration ?? false;
|
|
349626
349663
|
this.codebaseInvestigatorSettings = {
|
|
349627
349664
|
enabled: params.codebaseInvestigatorSettings?.enabled ?? false,
|
|
@@ -349686,8 +349723,6 @@ var Config = class {
|
|
|
349686
349723
|
if (this.model === DEFAULT_GEMINI_MODEL_AUTO) {
|
|
349687
349724
|
this.model = DEFAULT_GEMINI_MODEL;
|
|
349688
349725
|
}
|
|
349689
|
-
} else if (this.useModelRouter && this.model === DEFAULT_GEMINI_MODEL) {
|
|
349690
|
-
this.model = DEFAULT_GEMINI_MODEL_AUTO;
|
|
349691
349726
|
}
|
|
349692
349727
|
if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod === AuthType2.LOGIN_WITH_GOOGLE) {
|
|
349693
349728
|
this.geminiClient.stripThoughtsFromHistory();
|
|
@@ -349730,7 +349765,10 @@ var Config = class {
|
|
|
349730
349765
|
if (newModel.includes("pro") && this.isInFallbackMode()) {
|
|
349731
349766
|
return;
|
|
349732
349767
|
}
|
|
349733
|
-
this.model
|
|
349768
|
+
if (this.model !== newModel) {
|
|
349769
|
+
this.model = newModel;
|
|
349770
|
+
coreEvents.emitModelChanged(newModel);
|
|
349771
|
+
}
|
|
349734
349772
|
}
|
|
349735
349773
|
isInFallbackMode() {
|
|
349736
349774
|
return this.inFallbackMode;
|
|
@@ -349983,8 +350021,8 @@ var Config = class {
|
|
|
349983
350021
|
setFileSystemService(fileSystemService) {
|
|
349984
350022
|
this.fileSystemService = fileSystemService;
|
|
349985
350023
|
}
|
|
349986
|
-
|
|
349987
|
-
return this.
|
|
350024
|
+
getCompressionThreshold() {
|
|
350025
|
+
return this.compressionThreshold;
|
|
349988
350026
|
}
|
|
349989
350027
|
isInteractiveShellEnabled() {
|
|
349990
350028
|
return this.interactive && this.ptyInfo !== "child_process" && this.enableInteractiveShell;
|