@google/gemini-cli 0.54.0-preview.0 → 0.54.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/bundle/{chunk-PMUWVEQP.js → chunk-2MRUXBJ5.js} +7 -7
- package/bundle/{chunk-XTGYOEM3.js → chunk-43HYOV6F.js} +1 -1
- package/bundle/{chunk-CPVZILP2.js → chunk-5SMD2SLQ.js} +2 -2
- package/bundle/{chunk-K7T2IFNS.js → chunk-BBNFLOXC.js} +1 -1
- package/bundle/{chunk-UOZMJZMA.js → chunk-F6IU45OZ.js} +180 -39
- package/bundle/{chunk-KU7W3PYO.js → chunk-G7VQ6O6G.js} +1 -1
- package/bundle/{chunk-4GNXWN36.js → chunk-GOQJOV4P.js} +1 -1
- package/bundle/{chunk-HM6J5QFA.js → chunk-HS7THREL.js} +208 -42
- package/bundle/{chunk-GMYSSSFG.js → chunk-IM5WJKYT.js} +1 -1
- package/bundle/{chunk-JKXIXUUH.js → chunk-JPCDQXHB.js} +1 -1
- package/bundle/{chunk-I2F6JPKA.js → chunk-LH73BY77.js} +7 -7
- package/bundle/{chunk-ZJJUEIJO.js → chunk-MOGTJC2T.js} +1 -1
- package/bundle/{chunk-CZ6IKC6W.js → chunk-MZBH35ZS.js} +1 -1
- package/bundle/{chunk-HYGO4QEK.js → chunk-NZ6P6XKP.js} +2 -2
- package/bundle/{chunk-24AZRO3S.js → chunk-OYZ2XVON.js} +3 -3
- package/bundle/{chunk-S2XDE4E6.js → chunk-RHINAWEP.js} +7 -7
- package/bundle/{chunk-X7LEASVK.js → chunk-SHZORH3T.js} +1 -1
- package/bundle/{chunk-5X6WKNCA.js → chunk-SQWRALPF.js} +1 -1
- package/bundle/{chunk-ANCJ47GY.js → chunk-TZAOURRV.js} +1 -1
- package/bundle/{chunk-KFW7GOXJ.js → chunk-UTXCUPDT.js} +2 -2
- package/bundle/{chunk-BMD42WWR.js → chunk-UW4NSSB6.js} +3 -3
- package/bundle/{chunk-QZ32DOIY.js → chunk-VIQEWLM4.js} +1 -1
- package/bundle/{chunk-YVWOOS5D.js → chunk-WJKZRJIC.js} +3 -3
- package/bundle/{chunk-YOK6TS2W.js → chunk-YYWWE5GW.js} +208 -42
- package/bundle/{cleanup-CI4EZBGK.js → cleanup-5UYKVLIF.js} +2 -2
- package/bundle/{cleanup-NW33L7BG.js → cleanup-6OO5MA6W.js} +2 -2
- package/bundle/{cleanup-WCECJVAH.js → cleanup-ODOGWYRM.js} +2 -2
- package/bundle/{core-X6AKTKZS.js → core-JL633Z4N.js} +15 -1
- package/bundle/{dist-FM4XWKSV.js → core-S5B3NEKC.js} +15 -1
- package/bundle/{devtoolsService-HT4GPBRA.js → devtoolsService-FUTPYP6V.js} +2 -2
- package/bundle/{devtoolsService-YWDOWAQ7.js → devtoolsService-NZQZUVCI.js} +2 -2
- package/bundle/{devtoolsService-I4VSDXDZ.js → devtoolsService-YWNTGRUE.js} +2 -2
- package/bundle/{core-JXOKFSQM.js → dist-DB6LWOKZ.js} +15 -1
- package/bundle/{gemini-6QYTVAVR.js → gemini-AQASGK5V.js} +84 -20
- package/bundle/{gemini-LAE4PTZV.js → gemini-D3BRVDVJ.js} +84 -20
- package/bundle/{gemini-M37ESLGX.js → gemini-PPNY5YY6.js} +84 -20
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-353YNM5T.js → interactiveCli-CXCZMXKQ.js} +99 -9
- package/bundle/{interactiveCli-D26FIBDY.js → interactiveCli-P7QQLIDS.js} +99 -9
- package/bundle/{interactiveCli-OZI3EOZ3.js → interactiveCli-RU7LCVXL.js} +99 -9
- package/bundle/{liteRtServerManager-CHOKKKD7.js → liteRtServerManager-FIVLVXQJ.js} +4 -4
- package/bundle/{liteRtServerManager-QZER65XK.js → liteRtServerManager-ISKYY742.js} +4 -4
- package/bundle/{liteRtServerManager-5L6ZKYIO.js → liteRtServerManager-MPPOFOTR.js} +4 -4
- package/bundle/{oauth2-provider-DOSOCLE2.js → oauth2-provider-DOIL6PEC.js} +1 -1
- package/bundle/{oauth2-provider-2DMHCM63.js → oauth2-provider-G6DF4NEU.js} +1 -1
- package/bundle/{oauth2-provider-RYXZZKGA.js → oauth2-provider-XR5UQYQV.js} +1 -1
- package/bundle/{start-GSFOK3MC.js → start-AJW7OVPU.js} +6 -6
- package/bundle/{start-H6TOQQTQ.js → start-S77W5RNK.js} +6 -6
- package/bundle/{start-6KDQYY22.js → start-YWT3TSZW.js} +6 -6
- package/package.json +1 -1
|
@@ -253597,6 +253597,13 @@ var REFERENCE_CONTENT_END = "--- End of content ---";
|
|
|
253597
253597
|
var DEFAULT_MAX_LINES_TEXT_FILE = 2e3;
|
|
253598
253598
|
var MAX_LINE_LENGTH_TEXT_FILE = 2e3;
|
|
253599
253599
|
var MAX_FILE_SIZE_MB = 20;
|
|
253600
|
+
var EMPTY_RESPONSE_COMPRESS_SUGGESTION = "The model returned an empty text response. If your context window is near capacity, try using /compress.";
|
|
253601
|
+
var THINKING_ONLY_COMPRESS_SUGGESTION = "The model returned reasoning thoughts but no final response text. If your context window is near capacity, try using /compress.";
|
|
253602
|
+
var MAX_TOKENS_EXCEEDED_SUGGESTION = "Model response was truncated because it exceeded the token limit. Try using /compress to free up context space.";
|
|
253603
|
+
var SAFETY_BLOCKED_MESSAGE = "The model response was blocked due to safety settings.";
|
|
253604
|
+
var RECITATION_BLOCKED_MESSAGE = "The model response was blocked due to recitation/copyright filters.";
|
|
253605
|
+
var OTHER_BLOCKED_MESSAGE = "The model response was blocked due to other policy settings.";
|
|
253606
|
+
var TRUE_EMPTY_RESPONSE_MESSAGE = "The model returned an empty response with no text or thoughts. This may be a transient API issue; please try again.";
|
|
253600
253607
|
|
|
253601
253608
|
// packages/core/src/utils/fileUtils.ts
|
|
253602
253609
|
var requireModule = createModuleRequire(import.meta.url);
|
|
@@ -282777,8 +282784,8 @@ function isValidToolName(name3, options = {}) {
|
|
|
282777
282784
|
}
|
|
282778
282785
|
|
|
282779
282786
|
// packages/core/src/generated/git-commit.ts
|
|
282780
|
-
var GIT_COMMIT_INFO = "
|
|
282781
|
-
var CLI_VERSION = "0.54.0
|
|
282787
|
+
var GIT_COMMIT_INFO = "a81db2768";
|
|
282788
|
+
var CLI_VERSION = "0.54.0";
|
|
282782
282789
|
|
|
282783
282790
|
// packages/core/src/ide/detect-ide.ts
|
|
282784
282791
|
var IDE_DEFINITIONS = {
|
|
@@ -285312,6 +285319,15 @@ var AgentChatHistory = class {
|
|
|
285312
285319
|
clear() {
|
|
285313
285320
|
this.history = [];
|
|
285314
285321
|
}
|
|
285322
|
+
/**
|
|
285323
|
+
* Rolls back the history to a specified length.
|
|
285324
|
+
* Useful when a stream fails and we need to remove the un-responded turn(s).
|
|
285325
|
+
*/
|
|
285326
|
+
rollback(length) {
|
|
285327
|
+
if (length >= 0 && length <= this.history.length) {
|
|
285328
|
+
this.history = this.history.slice(0, length);
|
|
285329
|
+
}
|
|
285330
|
+
}
|
|
285315
285331
|
get() {
|
|
285316
285332
|
return this.history;
|
|
285317
285333
|
}
|
|
@@ -286224,7 +286240,8 @@ var createInitialModelMetrics = () => ({
|
|
|
286224
286240
|
api: {
|
|
286225
286241
|
totalRequests: 0,
|
|
286226
286242
|
totalErrors: 0,
|
|
286227
|
-
totalLatencyMs: 0
|
|
286243
|
+
totalLatencyMs: 0,
|
|
286244
|
+
errorsByType: {}
|
|
286228
286245
|
},
|
|
286229
286246
|
tokens: {
|
|
286230
286247
|
input: 0,
|
|
@@ -286279,6 +286296,19 @@ var UiTelemetryService = class extends EventEmitter3 {
|
|
|
286279
286296
|
lastPromptTokenCount: this.#lastPromptTokenCount
|
|
286280
286297
|
});
|
|
286281
286298
|
}
|
|
286299
|
+
recordSemanticValidationError(model, errorType) {
|
|
286300
|
+
const modelMetrics = this.getOrCreateModelMetrics(model);
|
|
286301
|
+
modelMetrics.api.totalErrors++;
|
|
286302
|
+
if (!modelMetrics.api.errorsByType) {
|
|
286303
|
+
modelMetrics.api.errorsByType = {};
|
|
286304
|
+
}
|
|
286305
|
+
const type2 = errorType || "INVALID_STREAM";
|
|
286306
|
+
modelMetrics.api.errorsByType[type2] = (modelMetrics.api.errorsByType[type2] || 0) + 1;
|
|
286307
|
+
this.emit("update", {
|
|
286308
|
+
metrics: this.#metrics,
|
|
286309
|
+
lastPromptTokenCount: this.#lastPromptTokenCount
|
|
286310
|
+
});
|
|
286311
|
+
}
|
|
286282
286312
|
getMetrics() {
|
|
286283
286313
|
return this.#metrics;
|
|
286284
286314
|
}
|
|
@@ -286409,6 +286439,11 @@ var UiTelemetryService = class extends EventEmitter3 {
|
|
|
286409
286439
|
modelMetrics.api.totalRequests++;
|
|
286410
286440
|
modelMetrics.api.totalErrors++;
|
|
286411
286441
|
modelMetrics.api.totalLatencyMs += event.duration_ms;
|
|
286442
|
+
if (!modelMetrics.api.errorsByType) {
|
|
286443
|
+
modelMetrics.api.errorsByType = {};
|
|
286444
|
+
}
|
|
286445
|
+
const errorType = event.error_type || "UNKNOWN";
|
|
286446
|
+
modelMetrics.api.errorsByType[errorType] = (modelMetrics.api.errorsByType[errorType] || 0) + 1;
|
|
286412
286447
|
if (event.role) {
|
|
286413
286448
|
if (!modelMetrics.roles[event.role]) {
|
|
286414
286449
|
modelMetrics.roles[event.role] = createInitialRoleMetrics();
|
|
@@ -306272,7 +306307,7 @@ function getVersion() {
|
|
|
306272
306307
|
}
|
|
306273
306308
|
versionPromise = (async () => {
|
|
306274
306309
|
const pkgJson = await getPackageJson(__dirname4);
|
|
306275
|
-
return "0.54.0
|
|
306310
|
+
return "0.54.0";
|
|
306276
306311
|
})();
|
|
306277
306312
|
return versionPromise;
|
|
306278
306313
|
}
|
|
@@ -307120,6 +307155,16 @@ function classifyGoogleError(error40) {
|
|
|
307120
307155
|
errorInfo.reason
|
|
307121
307156
|
);
|
|
307122
307157
|
}
|
|
307158
|
+
if (errorInfo.reason === "MODEL_CAPACITY_EXHAUSTED" || errorInfo.reason === "MODEL_CAPACITY_EXCEEDED") {
|
|
307159
|
+
if (delaySeconds === void 0) {
|
|
307160
|
+
return new TerminalQuotaError(
|
|
307161
|
+
googleApiError.message,
|
|
307162
|
+
googleApiError,
|
|
307163
|
+
delaySeconds,
|
|
307164
|
+
errorInfo.reason
|
|
307165
|
+
);
|
|
307166
|
+
}
|
|
307167
|
+
}
|
|
307123
307168
|
if (errorInfo.domain) {
|
|
307124
307169
|
if (isCloudCodeDomain(errorInfo.domain)) {
|
|
307125
307170
|
if (errorInfo.reason === "RATE_LIMIT_EXCEEDED") {
|
|
@@ -332109,10 +332154,10 @@ import { randomUUID as randomUUID6 } from "node:crypto";
|
|
|
332109
332154
|
|
|
332110
332155
|
// packages/core/src/utils/messageInspectors.ts
|
|
332111
332156
|
function isFunctionResponse(content) {
|
|
332112
|
-
return content.role === "user" && !!content.parts && content.parts.
|
|
332157
|
+
return content.role === "user" && !!content.parts && content.parts.some((part) => !!part.functionResponse);
|
|
332113
332158
|
}
|
|
332114
332159
|
function isFunctionCall(content) {
|
|
332115
|
-
return content.role === "model" && !!content.parts && content.parts.every((part) => !!part.functionCall);
|
|
332160
|
+
return content.role === "model" && !!content.parts && content.parts.length > 0 && content.parts.every((part) => !!part.functionCall);
|
|
332116
332161
|
}
|
|
332117
332162
|
|
|
332118
332163
|
// packages/core/src/utils/historyHardening.ts
|
|
@@ -332645,15 +332690,18 @@ var GeminiChat = class {
|
|
|
332645
332690
|
*/
|
|
332646
332691
|
async sendMessageStream(modelConfigKey, message, prompt_id, signal, role, displayContent, apiHistoryOverride) {
|
|
332647
332692
|
await this.sendPromise;
|
|
332693
|
+
const historyLengthBefore = this.agentHistory.length;
|
|
332694
|
+
const baselinePromptTokenCount = this.lastPromptTokenCount;
|
|
332648
332695
|
let streamDoneResolver;
|
|
332649
332696
|
const streamDonePromise = new Promise((resolve29) => {
|
|
332650
332697
|
streamDoneResolver = resolve29;
|
|
332651
332698
|
});
|
|
332652
332699
|
this.sendPromise = streamDonePromise;
|
|
332653
332700
|
let userContent = createUserContent(message);
|
|
332701
|
+
const isOriginalFunctionResponse = isFunctionResponse(userContent);
|
|
332654
332702
|
const { model } = this.context.config.modelConfigService.getResolvedConfig(modelConfigKey);
|
|
332655
332703
|
const isContextManagementEnabled = this.context.config.isContextManagementEnabled();
|
|
332656
|
-
if (!
|
|
332704
|
+
if (!isOriginalFunctionResponse) {
|
|
332657
332705
|
const userMessageParts = userContent.parts || [];
|
|
332658
332706
|
const userMessageContent = partListUnionToString(userMessageParts);
|
|
332659
332707
|
let finalDisplayContent = void 0;
|
|
@@ -332743,13 +332791,14 @@ var GeminiChat = class {
|
|
|
332743
332791
|
const streamWithRetries = async function* () {
|
|
332744
332792
|
try {
|
|
332745
332793
|
const maxAttempts = this.context.config.getMaxAttempts();
|
|
332794
|
+
let lastStreamError = void 0;
|
|
332746
332795
|
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
332747
332796
|
let isConnectionPhase = true;
|
|
332748
332797
|
try {
|
|
332749
332798
|
if (attempt > 0) {
|
|
332750
332799
|
yield { type: "retry" /* RETRY */ };
|
|
332751
332800
|
}
|
|
332752
|
-
const currentConfigKey = attempt > 0 ? { ...modelConfigKey, isRetry: true } : modelConfigKey;
|
|
332801
|
+
const currentConfigKey = attempt > 0 ? { ...modelConfigKey, isRetry: true, lastStreamError } : modelConfigKey;
|
|
332753
332802
|
isConnectionPhase = true;
|
|
332754
332803
|
const stream2 = await this.makeApiCallAndProcessStream(
|
|
332755
332804
|
currentConfigKey,
|
|
@@ -332765,6 +332814,9 @@ var GeminiChat = class {
|
|
|
332765
332814
|
}
|
|
332766
332815
|
return;
|
|
332767
332816
|
} catch (error40) {
|
|
332817
|
+
if (error40 instanceof InvalidStreamError) {
|
|
332818
|
+
lastStreamError = error40;
|
|
332819
|
+
}
|
|
332768
332820
|
if (error40 instanceof AgentExecutionStoppedError) {
|
|
332769
332821
|
yield {
|
|
332770
332822
|
type: "agent_execution_stopped" /* AGENT_EXECUTION_STOPPED */,
|
|
@@ -332793,7 +332845,7 @@ var GeminiChat = class {
|
|
|
332793
332845
|
this.context.config.getRetryFetchErrors()
|
|
332794
332846
|
);
|
|
332795
332847
|
const isContentError = error40 instanceof InvalidStreamError;
|
|
332796
|
-
const isRetryableContentError = isContentError
|
|
332848
|
+
const isRetryableContentError = isContentError;
|
|
332797
332849
|
const errorType = isContentError ? error40.type : getRetryErrorType(error40);
|
|
332798
332850
|
if (isRetryableContentError || isRetryable && !signal.aborted) {
|
|
332799
332851
|
const maxMidStreamAttempts = MID_STREAM_RETRY_OPTIONS.maxAttempts;
|
|
@@ -332837,6 +332889,15 @@ var GeminiChat = class {
|
|
|
332837
332889
|
throw error40;
|
|
332838
332890
|
}
|
|
332839
332891
|
}
|
|
332892
|
+
} catch (error40) {
|
|
332893
|
+
if (!isOriginalFunctionResponse) {
|
|
332894
|
+
this.agentHistory.rollback(historyLengthBefore);
|
|
332895
|
+
this.chatRecordingService.updateMessagesFromHistory(
|
|
332896
|
+
this.agentHistory.get()
|
|
332897
|
+
);
|
|
332898
|
+
this.lastPromptTokenCount = baselinePromptTokenCount;
|
|
332899
|
+
}
|
|
332900
|
+
throw error40;
|
|
332840
332901
|
} finally {
|
|
332841
332902
|
streamDoneResolver();
|
|
332842
332903
|
}
|
|
@@ -332916,6 +332977,22 @@ var GeminiChat = class {
|
|
|
332916
332977
|
tools: this.tools,
|
|
332917
332978
|
abortSignal
|
|
332918
332979
|
};
|
|
332980
|
+
if (modelConfigKey.isRetry && modelConfigKey.lastStreamError instanceof InvalidStreamError) {
|
|
332981
|
+
const lastError = modelConfigKey.lastStreamError;
|
|
332982
|
+
let nudgeMessage = "";
|
|
332983
|
+
if (lastError.type === "THINKING_ONLY_RESPONSE") {
|
|
332984
|
+
nudgeMessage = "\n[System: You previously generated thoughts but failed to provide a final user-facing response. Please ensure you provide your final answer or call a tool now.]";
|
|
332985
|
+
} else if (lastError.type === "NO_RESPONSE_TEXT") {
|
|
332986
|
+
nudgeMessage = "\n[System: You previously returned an empty response with no text or thoughts. Please ensure you provide your final answer or call a tool now.]";
|
|
332987
|
+
}
|
|
332988
|
+
if (nudgeMessage) {
|
|
332989
|
+
if (typeof config2.systemInstruction === "string") {
|
|
332990
|
+
config2.systemInstruction += nudgeMessage;
|
|
332991
|
+
} else if (config2.systemInstruction === void 0) {
|
|
332992
|
+
config2.systemInstruction = nudgeMessage;
|
|
332993
|
+
}
|
|
332994
|
+
}
|
|
332995
|
+
}
|
|
332919
332996
|
let contentsToUse = supportsModernFeatures(modelToUse) || isGemini2Model(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
|
|
332920
332997
|
const hookSystem = this.context.config.getHookSystem();
|
|
332921
332998
|
if (hookSystem) {
|
|
@@ -333199,6 +333276,8 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333199
333276
|
let hasToolCall = false;
|
|
333200
333277
|
let hasThoughts = false;
|
|
333201
333278
|
let finishReason;
|
|
333279
|
+
const bufferedThoughts = [];
|
|
333280
|
+
let bufferedUsageMetadata = void 0;
|
|
333202
333281
|
const finalFunctionCallsMap = /* @__PURE__ */ new Map();
|
|
333203
333282
|
const legacyFunctionCalls = [];
|
|
333204
333283
|
const callIndexToId = /* @__PURE__ */ new Map();
|
|
@@ -333246,7 +333325,10 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333246
333325
|
if (content?.parts) {
|
|
333247
333326
|
if (content.parts.some((part) => part.thought)) {
|
|
333248
333327
|
hasThoughts = true;
|
|
333249
|
-
this.
|
|
333328
|
+
const thought = this.extractThoughtFromContent(content);
|
|
333329
|
+
if (thought) {
|
|
333330
|
+
bufferedThoughts.push(thought);
|
|
333331
|
+
}
|
|
333250
333332
|
}
|
|
333251
333333
|
if (content.parts.some((part) => part.functionCall)) {
|
|
333252
333334
|
hasToolCall = true;
|
|
@@ -333270,10 +333352,7 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333270
333352
|
}
|
|
333271
333353
|
}
|
|
333272
333354
|
if (chunk.usageMetadata) {
|
|
333273
|
-
|
|
333274
|
-
if (chunk.usageMetadata.promptTokenCount !== void 0) {
|
|
333275
|
-
this.lastPromptTokenCount = chunk.usageMetadata.promptTokenCount;
|
|
333276
|
-
}
|
|
333355
|
+
bufferedUsageMetadata = chunk.usageMetadata;
|
|
333277
333356
|
}
|
|
333278
333357
|
const hookSystem = this.context.config.getHookSystem();
|
|
333279
333358
|
if (originalRequest && chunk && hookSystem) {
|
|
@@ -333337,20 +333416,17 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333337
333416
|
}
|
|
333338
333417
|
}
|
|
333339
333418
|
}
|
|
333340
|
-
const
|
|
333341
|
-
let
|
|
333342
|
-
|
|
333343
|
-
|
|
333344
|
-
|
|
333345
|
-
|
|
333346
|
-
|
|
333347
|
-
|
|
333348
|
-
|
|
333349
|
-
|
|
333350
|
-
|
|
333351
|
-
consolidatedParts
|
|
333352
|
-
);
|
|
333353
|
-
}
|
|
333419
|
+
const rawResponseText = consolidatedParts.filter((part) => part.text).map((part) => part.text).join("");
|
|
333420
|
+
let responseText = rawResponseText.replace(
|
|
333421
|
+
/[\u200B-\u200D\uFEFF\u200E\u200F]/g,
|
|
333422
|
+
""
|
|
333423
|
+
);
|
|
333424
|
+
let previous;
|
|
333425
|
+
do {
|
|
333426
|
+
previous = responseText;
|
|
333427
|
+
responseText = responseText.replace(/<!--[\s\S]*?-->/g, "");
|
|
333428
|
+
} while (responseText !== previous);
|
|
333429
|
+
responseText = responseText.trim();
|
|
333354
333430
|
if (!hasToolCall) {
|
|
333355
333431
|
if (!finishReason) {
|
|
333356
333432
|
throw new InvalidStreamError(
|
|
@@ -333371,12 +333447,64 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333371
333447
|
);
|
|
333372
333448
|
}
|
|
333373
333449
|
if (!responseText) {
|
|
333450
|
+
if (finishReason === FinishReason.MAX_TOKENS) {
|
|
333451
|
+
throw new InvalidStreamError(
|
|
333452
|
+
"Model stream ended due to token limit exhaustion (MAX_TOKENS) with empty response text.",
|
|
333453
|
+
"MAX_TOKENS_EXCEEDED"
|
|
333454
|
+
);
|
|
333455
|
+
}
|
|
333456
|
+
if (finishReason === FinishReason.SAFETY) {
|
|
333457
|
+
throw new InvalidStreamError(
|
|
333458
|
+
"Model stream ended due to safety settings (SAFETY) with empty response text.",
|
|
333459
|
+
"SAFETY_BLOCKED"
|
|
333460
|
+
);
|
|
333461
|
+
}
|
|
333462
|
+
if (finishReason === FinishReason.RECITATION) {
|
|
333463
|
+
throw new InvalidStreamError(
|
|
333464
|
+
"Model stream ended due to recitation settings (RECITATION) with empty response text.",
|
|
333465
|
+
"RECITATION_BLOCKED"
|
|
333466
|
+
);
|
|
333467
|
+
}
|
|
333468
|
+
if (finishReason === FinishReason.OTHER) {
|
|
333469
|
+
throw new InvalidStreamError(
|
|
333470
|
+
"Model stream ended due to other settings (OTHER) with empty response text.",
|
|
333471
|
+
"OTHER_BLOCKED"
|
|
333472
|
+
);
|
|
333473
|
+
}
|
|
333474
|
+
if (hasThoughts) {
|
|
333475
|
+
throw new InvalidStreamError(
|
|
333476
|
+
"Model stream ended with empty response text but contained reasoning thoughts.",
|
|
333477
|
+
"THINKING_ONLY_RESPONSE"
|
|
333478
|
+
);
|
|
333479
|
+
}
|
|
333374
333480
|
throw new InvalidStreamError(
|
|
333375
333481
|
"Model stream ended with empty response text.",
|
|
333376
333482
|
"NO_RESPONSE_TEXT"
|
|
333377
333483
|
);
|
|
333378
333484
|
}
|
|
333379
333485
|
}
|
|
333486
|
+
for (const thought of bufferedThoughts) {
|
|
333487
|
+
this.chatRecordingService.recordThought(thought);
|
|
333488
|
+
}
|
|
333489
|
+
if (bufferedUsageMetadata) {
|
|
333490
|
+
this.chatRecordingService.recordMessageTokens(bufferedUsageMetadata);
|
|
333491
|
+
if (bufferedUsageMetadata.promptTokenCount !== void 0) {
|
|
333492
|
+
this.lastPromptTokenCount = bufferedUsageMetadata.promptTokenCount;
|
|
333493
|
+
}
|
|
333494
|
+
}
|
|
333495
|
+
let id;
|
|
333496
|
+
if (responseText || hasThoughts || hasToolCall) {
|
|
333497
|
+
id = this.chatRecordingService.recordMessage({
|
|
333498
|
+
model,
|
|
333499
|
+
type: "gemini",
|
|
333500
|
+
content: responseText
|
|
333501
|
+
});
|
|
333502
|
+
} else {
|
|
333503
|
+
id = this.chatRecordingService.recordSyntheticMessage(
|
|
333504
|
+
"gemini",
|
|
333505
|
+
consolidatedParts
|
|
333506
|
+
);
|
|
333507
|
+
}
|
|
333380
333508
|
this.agentHistory.push({
|
|
333381
333509
|
id,
|
|
333382
333510
|
content: { role: "model", parts: consolidatedParts }
|
|
@@ -333414,11 +333542,11 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333414
333542
|
this.chatRecordingService.recordToolCalls(model, toolCallRecords);
|
|
333415
333543
|
}
|
|
333416
333544
|
/**
|
|
333417
|
-
* Extracts
|
|
333545
|
+
* Extracts thought from thought content.
|
|
333418
333546
|
*/
|
|
333419
|
-
|
|
333547
|
+
extractThoughtFromContent(content) {
|
|
333420
333548
|
if (!content.parts || content.parts.length === 0) {
|
|
333421
|
-
return;
|
|
333549
|
+
return void 0;
|
|
333422
333550
|
}
|
|
333423
333551
|
const thoughtPart = content.parts[0];
|
|
333424
333552
|
if (thoughtPart.text) {
|
|
@@ -333426,11 +333554,12 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
333426
333554
|
const subjectStringMatches = rawText.match(/\*\*(.*?)\*\*/s);
|
|
333427
333555
|
const subject = subjectStringMatches ? subjectStringMatches[1].trim() : "";
|
|
333428
333556
|
const description = rawText.replace(/\*\*(.*?)\*\*/s, "").trim();
|
|
333429
|
-
|
|
333557
|
+
return {
|
|
333430
333558
|
subject,
|
|
333431
333559
|
description
|
|
333432
|
-
}
|
|
333560
|
+
};
|
|
333433
333561
|
}
|
|
333562
|
+
return void 0;
|
|
333434
333563
|
}
|
|
333435
333564
|
};
|
|
333436
333565
|
function isSchemaDepthError(errorMessage) {
|
|
@@ -333767,7 +333896,13 @@ ${[...this.pendingCitations].sort().join("\n")}`
|
|
|
333767
333896
|
return;
|
|
333768
333897
|
}
|
|
333769
333898
|
if (e2 instanceof InvalidStreamError) {
|
|
333770
|
-
yield {
|
|
333899
|
+
yield {
|
|
333900
|
+
type: "invalid_stream" /* InvalidStream */,
|
|
333901
|
+
value: {
|
|
333902
|
+
type: e2.type,
|
|
333903
|
+
message: e2.message
|
|
333904
|
+
}
|
|
333905
|
+
};
|
|
333771
333906
|
return;
|
|
333772
333907
|
}
|
|
333773
333908
|
const error40 = toFriendlyError(e2);
|
|
@@ -334114,6 +334249,16 @@ function renderOperationalGuidelines(options) {
|
|
|
334114
334249
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
334115
334250
|
|
|
334116
334251
|
## Tool Usage
|
|
334252
|
+
- **Tool Execution Response Rules:**
|
|
334253
|
+
1. After receiving a \`functionResponse\`, you MUST ALWAYS execute one of the following two actions:
|
|
334254
|
+
a) Call another tool to proceed with the task.
|
|
334255
|
+
b) Provide a user-facing text response explaining the tool output, your analysis, and next steps.
|
|
334256
|
+
2. You MUST NEVER return an empty response with no text and no tool calls.
|
|
334257
|
+
- **Post-Edit Response Rules:**
|
|
334258
|
+
1. After an edit tool execution (e.g. ${formatToolName(EDIT_TOOL_NAME)}, ${formatToolName(WRITE_FILE_TOOL_NAME)}), you MUST ALWAYS generate a user-facing text response summarizing:
|
|
334259
|
+
- What changes were made to the file.
|
|
334260
|
+
- Your verification plan or next steps (e.g. running tests).
|
|
334261
|
+
2. You MUST NEVER return an empty response with 0 text tokens after completing an edit.
|
|
334117
334262
|
- **Parallelism & Sequencing:** Tools execute in parallel by default. Execute multiple independent tool calls in parallel when feasible (e.g., searching, reading files, independent shell commands, or editing *different* files). If a tool depends on the output or side-effects of a previous tool in the same turn (e.g., running a shell command that depends on the success of a previous command), you MUST set the \`wait_for_previous\` parameter to \`true\` on the dependent tool to ensure sequential execution.
|
|
334118
334263
|
- **File Editing Collisions:** Do NOT make multiple calls to the ${formatToolName(EDIT_TOOL_NAME)} tool for the SAME file in a single turn. To make multiple edits to the same file, you MUST perform them sequentially across multiple conversational turns to prevent race conditions and ensure the file state is accurate before each edit.
|
|
334119
334264
|
- **Command Execution:** Use the ${formatToolName(SHELL_TOOL_NAME)} tool for running shell commands, remembering the safety rule to explain modifying commands first.${toolUsageInteractive(
|
|
@@ -340929,7 +341074,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
340929
341074
|
return provider;
|
|
340930
341075
|
}
|
|
340931
341076
|
case "oauth2": {
|
|
340932
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
341077
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-XR5UQYQV.js");
|
|
340933
341078
|
const provider = new OAuth2AuthProvider(
|
|
340934
341079
|
authConfig,
|
|
340935
341080
|
options.agentName ?? "unknown",
|
|
@@ -349266,6 +349411,7 @@ var Scheduler = class {
|
|
|
349266
349411
|
"cancelled" /* Cancelled */,
|
|
349267
349412
|
"Operation cancelled by user"
|
|
349268
349413
|
);
|
|
349414
|
+
this.state.finalizeCall(activeCall.request.callId);
|
|
349269
349415
|
}
|
|
349270
349416
|
}
|
|
349271
349417
|
this.state.cancelAllQueued("Operation cancelled by user");
|
|
@@ -349395,6 +349541,12 @@ var Scheduler = class {
|
|
|
349395
349541
|
*/
|
|
349396
349542
|
async _processNextItem(signal) {
|
|
349397
349543
|
if (signal.aborted || this.isCancelling) {
|
|
349544
|
+
const activeCalls2 = this.state.allActiveCalls;
|
|
349545
|
+
for (const call of activeCalls2) {
|
|
349546
|
+
if (this.isTerminal(call.status)) {
|
|
349547
|
+
this.state.finalizeCall(call.request.callId);
|
|
349548
|
+
}
|
|
349549
|
+
}
|
|
349398
349550
|
this.state.cancelAllQueued("Operation cancelled");
|
|
349399
349551
|
return false;
|
|
349400
349552
|
}
|
|
@@ -392981,8 +393133,13 @@ function translateEvent(event, state) {
|
|
|
392981
393133
|
out2.push(
|
|
392982
393134
|
makeEvent("error", state, {
|
|
392983
393135
|
status: "INTERNAL",
|
|
392984
|
-
message: "Invalid stream received from model",
|
|
392985
|
-
fatal: true
|
|
393136
|
+
message: event.value?.message?.trim() || "Invalid stream received from model",
|
|
393137
|
+
fatal: true,
|
|
393138
|
+
_meta: {
|
|
393139
|
+
code: "INVALID_STREAM",
|
|
393140
|
+
errorType: event.value?.type,
|
|
393141
|
+
rawMessage: event.value?.message
|
|
393142
|
+
}
|
|
392986
393143
|
})
|
|
392987
393144
|
);
|
|
392988
393145
|
break;
|
|
@@ -393254,6 +393411,7 @@ var LegacyAgentProtocol = class {
|
|
|
393254
393411
|
return;
|
|
393255
393412
|
}
|
|
393256
393413
|
const toolCallRequests = [];
|
|
393414
|
+
let finishedReason = void 0;
|
|
393257
393415
|
const responseStream = this._client.sendMessageStream(
|
|
393258
393416
|
currentParts,
|
|
393259
393417
|
this._abortController.signal,
|
|
@@ -393278,10 +393436,7 @@ var LegacyAgentProtocol = class {
|
|
|
393278
393436
|
this._finishStream("failed");
|
|
393279
393437
|
return;
|
|
393280
393438
|
case "finished" /* Finished */:
|
|
393281
|
-
|
|
393282
|
-
this._finishStream(mapFinishReason(event.value.reason));
|
|
393283
|
-
return;
|
|
393284
|
-
}
|
|
393439
|
+
finishedReason = event.value.reason;
|
|
393285
393440
|
break;
|
|
393286
393441
|
case "agent_execution_stopped" /* AgentExecutionStopped */:
|
|
393287
393442
|
case "user_cancelled" /* UserCancelled */:
|
|
@@ -393297,7 +393452,11 @@ var LegacyAgentProtocol = class {
|
|
|
393297
393452
|
return;
|
|
393298
393453
|
}
|
|
393299
393454
|
if (toolCallRequests.length === 0) {
|
|
393300
|
-
|
|
393455
|
+
if (finishedReason !== void 0) {
|
|
393456
|
+
this._finishStream(mapFinishReason(finishedReason));
|
|
393457
|
+
} else {
|
|
393458
|
+
this._finishStream("completed");
|
|
393459
|
+
}
|
|
393301
393460
|
return;
|
|
393302
393461
|
}
|
|
393303
393462
|
const completedToolCalls = await this._scheduler.schedule(
|
|
@@ -401886,6 +402045,13 @@ export {
|
|
|
401886
402045
|
DEFAULT_MAX_LINES_TEXT_FILE,
|
|
401887
402046
|
MAX_LINE_LENGTH_TEXT_FILE,
|
|
401888
402047
|
MAX_FILE_SIZE_MB,
|
|
402048
|
+
EMPTY_RESPONSE_COMPRESS_SUGGESTION,
|
|
402049
|
+
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
402050
|
+
MAX_TOKENS_EXCEEDED_SUGGESTION,
|
|
402051
|
+
SAFETY_BLOCKED_MESSAGE,
|
|
402052
|
+
RECITATION_BLOCKED_MESSAGE,
|
|
402053
|
+
OTHER_BLOCKED_MESSAGE,
|
|
402054
|
+
TRUE_EMPTY_RESPONSE_MESSAGE,
|
|
401889
402055
|
readWasmBinaryFromDisk,
|
|
401890
402056
|
loadWasmBinary,
|
|
401891
402057
|
DEFAULT_ENCODING,
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MOGTJC2T.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -59,14 +59,14 @@ import {
|
|
|
59
59
|
stripUnsafeCharacters,
|
|
60
60
|
toCodePoints,
|
|
61
61
|
validateCustomTheme
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-JPCDQXHB.js";
|
|
63
63
|
import {
|
|
64
64
|
isDevelopment
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-NZ6P6XKP.js";
|
|
66
66
|
import {
|
|
67
67
|
emptyIcon,
|
|
68
68
|
require_react
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-TZAOURRV.js";
|
|
70
70
|
import {
|
|
71
71
|
ALL_EDITORS,
|
|
72
72
|
ApprovalMode,
|
|
@@ -230,7 +230,7 @@ import {
|
|
|
230
230
|
tokenLimit,
|
|
231
231
|
uiTelemetryService,
|
|
232
232
|
unescapePath
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-YYWWE5GW.js";
|
|
234
234
|
import {
|
|
235
235
|
require_src
|
|
236
236
|
} from "./chunk-TUDYL3X4.js";
|
|
@@ -77163,7 +77163,7 @@ var authCommand = {
|
|
|
77163
77163
|
import process29 from "node:process";
|
|
77164
77164
|
|
|
77165
77165
|
// packages/cli/src/generated/git-commit.ts
|
|
77166
|
-
var GIT_COMMIT_INFO = "
|
|
77166
|
+
var GIT_COMMIT_INFO = "a81db2768";
|
|
77167
77167
|
|
|
77168
77168
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
77169
77169
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -82944,7 +82944,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
82944
82944
|
type: "info",
|
|
82945
82945
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
82946
82946
|
});
|
|
82947
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
82947
|
+
const { MCPOAuthProvider } = await import("./core-S5B3NEKC.js");
|
|
82948
82948
|
let oauthConfig = server.oauth;
|
|
82949
82949
|
if (!oauthConfig) {
|
|
82950
82950
|
oauthConfig = { enabled: false };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SHZORH3T.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__require
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
2
|
import {
|
|
3
3
|
runExitCleanup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SHZORH3T.js";
|
|
5
5
|
import {
|
|
6
6
|
RELEASE_CHANNEL_STABILITY,
|
|
7
7
|
debugLogger,
|
|
8
8
|
getChannelFromVersion,
|
|
9
9
|
isGitRepository
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YYWWE5GW.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/src/utils/installationInfo.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-G7VQ6O6G.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_PORT,
|
|
8
8
|
SERVER_START_WAIT_MS,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
isServerRunning,
|
|
15
15
|
resolveGemmaConfig,
|
|
16
16
|
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GOQJOV4P.js";
|
|
18
18
|
import {
|
|
19
19
|
debugLogger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-F6IU45OZ.js";
|
|
21
21
|
import {
|
|
22
22
|
__toESM
|
|
23
23
|
} from "./chunk-34MYV7JD.js";
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BBNFLOXC.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -59,14 +59,14 @@ import {
|
|
|
59
59
|
stripUnsafeCharacters,
|
|
60
60
|
toCodePoints,
|
|
61
61
|
validateCustomTheme
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-VIQEWLM4.js";
|
|
63
63
|
import {
|
|
64
64
|
isDevelopment
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-UTXCUPDT.js";
|
|
66
66
|
import {
|
|
67
67
|
emptyIcon,
|
|
68
68
|
require_react
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-SQWRALPF.js";
|
|
70
70
|
import {
|
|
71
71
|
ALL_EDITORS,
|
|
72
72
|
ApprovalMode,
|
|
@@ -230,7 +230,7 @@ import {
|
|
|
230
230
|
tokenLimit,
|
|
231
231
|
uiTelemetryService,
|
|
232
232
|
unescapePath
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-HS7THREL.js";
|
|
234
234
|
import {
|
|
235
235
|
require_src
|
|
236
236
|
} from "./chunk-TUDYL3X4.js";
|
|
@@ -77163,7 +77163,7 @@ var authCommand = {
|
|
|
77163
77163
|
import process29 from "node:process";
|
|
77164
77164
|
|
|
77165
77165
|
// packages/cli/src/generated/git-commit.ts
|
|
77166
|
-
var GIT_COMMIT_INFO = "
|
|
77166
|
+
var GIT_COMMIT_INFO = "a81db2768";
|
|
77167
77167
|
|
|
77168
77168
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
77169
77169
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -82944,7 +82944,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
82944
82944
|
type: "info",
|
|
82945
82945
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
82946
82946
|
});
|
|
82947
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
82947
|
+
const { MCPOAuthProvider } = await import("./core-JL633Z4N.js");
|
|
82948
82948
|
let oauthConfig = server.oauth;
|
|
82949
82949
|
if (!oauthConfig) {
|
|
82950
82950
|
oauthConfig = { enabled: false };
|