@google/gemini-cli-a2a-server 0.18.0-preview.1 → 0.19.0-nightly.20251122.42c2e1b21
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 +256 -101
- package/dist/src/agent/task.js +1 -1
- package/dist/src/agent/task.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -303410,6 +303410,11 @@ var FatalAuthenticationError = class extends FatalError {
|
|
|
303410
303410
|
super(message, 41);
|
|
303411
303411
|
}
|
|
303412
303412
|
};
|
|
303413
|
+
var FatalCancellationError = class extends FatalError {
|
|
303414
|
+
constructor(message) {
|
|
303415
|
+
super(message, 130);
|
|
303416
|
+
}
|
|
303417
|
+
};
|
|
303413
303418
|
var ForbiddenError = class extends Error {
|
|
303414
303419
|
};
|
|
303415
303420
|
var UnauthorizedError = class extends Error {
|
|
@@ -304155,7 +304160,63 @@ init_base_token_storage();
|
|
|
304155
304160
|
var DEFAULT_SERVICE_NAME = "gemini-cli-oauth";
|
|
304156
304161
|
var FORCE_ENCRYPTED_FILE_ENV_VAR = "GEMINI_FORCE_ENCRYPTED_FILE_STORAGE";
|
|
304157
304162
|
|
|
304163
|
+
// packages/core/dist/src/utils/stdio.js
|
|
304164
|
+
init_events();
|
|
304165
|
+
var originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
304166
|
+
var originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
304167
|
+
function writeToStdout(...args2) {
|
|
304168
|
+
return originalStdoutWrite(...args2);
|
|
304169
|
+
}
|
|
304170
|
+
function writeToStderr(...args2) {
|
|
304171
|
+
return originalStderrWrite(...args2);
|
|
304172
|
+
}
|
|
304173
|
+
function createInkStdio() {
|
|
304174
|
+
const inkStdout = new Proxy(process.stdout, {
|
|
304175
|
+
get(target, prop, receiver) {
|
|
304176
|
+
if (prop === "write") {
|
|
304177
|
+
return writeToStdout;
|
|
304178
|
+
}
|
|
304179
|
+
const value = Reflect.get(target, prop, receiver);
|
|
304180
|
+
if (typeof value === "function") {
|
|
304181
|
+
return value.bind(target);
|
|
304182
|
+
}
|
|
304183
|
+
return value;
|
|
304184
|
+
}
|
|
304185
|
+
});
|
|
304186
|
+
const inkStderr = new Proxy(process.stderr, {
|
|
304187
|
+
get(target, prop, receiver) {
|
|
304188
|
+
if (prop === "write") {
|
|
304189
|
+
return writeToStderr;
|
|
304190
|
+
}
|
|
304191
|
+
const value = Reflect.get(target, prop, receiver);
|
|
304192
|
+
if (typeof value === "function") {
|
|
304193
|
+
return value.bind(target);
|
|
304194
|
+
}
|
|
304195
|
+
return value;
|
|
304196
|
+
}
|
|
304197
|
+
});
|
|
304198
|
+
return { stdout: inkStdout, stderr: inkStderr };
|
|
304199
|
+
}
|
|
304200
|
+
|
|
304201
|
+
// packages/core/dist/src/utils/terminal.js
|
|
304202
|
+
function disableMouseEvents() {
|
|
304203
|
+
writeToStdout("\x1B[?1006l\x1B[?1002l");
|
|
304204
|
+
}
|
|
304205
|
+
function disableKittyKeyboardProtocol() {
|
|
304206
|
+
writeToStdout("\x1B[<u");
|
|
304207
|
+
}
|
|
304208
|
+
function enableLineWrapping() {
|
|
304209
|
+
writeToStdout("\x1B[?7h");
|
|
304210
|
+
}
|
|
304211
|
+
function enterAlternateScreen() {
|
|
304212
|
+
writeToStdout("\x1B[?1049h");
|
|
304213
|
+
}
|
|
304214
|
+
function exitAlternateScreen() {
|
|
304215
|
+
writeToStdout("\x1B[?1049l");
|
|
304216
|
+
}
|
|
304217
|
+
|
|
304158
304218
|
// packages/core/dist/src/code_assist/oauth2.js
|
|
304219
|
+
init_events();
|
|
304159
304220
|
var userAccountManager = new UserAccountManager();
|
|
304160
304221
|
var OAUTH_CLIENT_ID = "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com";
|
|
304161
304222
|
var OAUTH_CLIENT_SECRET = "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";
|
|
@@ -304246,18 +304307,31 @@ async function initOauthClient(authType, config2) {
|
|
|
304246
304307
|
if (config2.isBrowserLaunchSuppressed()) {
|
|
304247
304308
|
let success = false;
|
|
304248
304309
|
const maxRetries = 2;
|
|
304249
|
-
|
|
304250
|
-
|
|
304251
|
-
|
|
304252
|
-
|
|
304310
|
+
enterAlternateScreen();
|
|
304311
|
+
writeToStdout("\x1B[2J\x1B[H");
|
|
304312
|
+
disableMouseEvents();
|
|
304313
|
+
disableKittyKeyboardProtocol();
|
|
304314
|
+
enableLineWrapping();
|
|
304315
|
+
try {
|
|
304316
|
+
for (let i4 = 0; !success && i4 < maxRetries; i4++) {
|
|
304317
|
+
success = await authWithUserCode(client);
|
|
304318
|
+
if (!success) {
|
|
304319
|
+
writeToStderr("\nFailed to authenticate with user code." + (i4 === maxRetries - 1 ? "" : " Retrying...\n"));
|
|
304320
|
+
}
|
|
304253
304321
|
}
|
|
304322
|
+
} finally {
|
|
304323
|
+
exitAlternateScreen();
|
|
304324
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
304254
304325
|
}
|
|
304255
304326
|
if (!success) {
|
|
304327
|
+
writeToStderr("Failed to authenticate with user code.\n");
|
|
304256
304328
|
throw new FatalAuthenticationError("Failed to authenticate with user code.");
|
|
304257
304329
|
}
|
|
304258
304330
|
} else {
|
|
304259
304331
|
const webLogin = await authWithWeb(client);
|
|
304260
|
-
|
|
304332
|
+
coreEvents.emit(CoreEvent.UserFeedback, {
|
|
304333
|
+
severity: "info",
|
|
304334
|
+
message: `
|
|
304261
304335
|
|
|
304262
304336
|
Code Assist login required.
|
|
304263
304337
|
Attempting to open authentication page in your browser.
|
|
@@ -304265,19 +304339,30 @@ Otherwise navigate to:
|
|
|
304265
304339
|
|
|
304266
304340
|
${webLogin.authUrl}
|
|
304267
304341
|
|
|
304268
|
-
|
|
304342
|
+
|
|
304343
|
+
`
|
|
304344
|
+
});
|
|
304269
304345
|
try {
|
|
304270
304346
|
const childProcess2 = await open_default(webLogin.authUrl);
|
|
304271
304347
|
childProcess2.on("error", (error) => {
|
|
304272
|
-
|
|
304273
|
-
|
|
304348
|
+
coreEvents.emit(CoreEvent.UserFeedback, {
|
|
304349
|
+
severity: "error",
|
|
304350
|
+
message: `Failed to open browser with error: ${getErrorMessage(error)}
|
|
304351
|
+
Please try running again with NO_BROWSER=true set.`
|
|
304352
|
+
});
|
|
304274
304353
|
});
|
|
304275
304354
|
} catch (err2) {
|
|
304276
|
-
|
|
304277
|
-
|
|
304355
|
+
coreEvents.emit(CoreEvent.UserFeedback, {
|
|
304356
|
+
severity: "error",
|
|
304357
|
+
message: `Failed to open browser with error: ${getErrorMessage(err2)}
|
|
304358
|
+
Please try running again with NO_BROWSER=true set.`
|
|
304359
|
+
});
|
|
304278
304360
|
throw new FatalAuthenticationError(`Failed to open browser: ${getErrorMessage(err2)}`);
|
|
304279
304361
|
}
|
|
304280
|
-
|
|
304362
|
+
coreEvents.emit(CoreEvent.UserFeedback, {
|
|
304363
|
+
severity: "info",
|
|
304364
|
+
message: "Waiting for authentication...\n"
|
|
304365
|
+
});
|
|
304281
304366
|
const authTimeout = 5 * 60 * 1e3;
|
|
304282
304367
|
const timeoutPromise = new Promise((_, reject) => {
|
|
304283
304368
|
setTimeout(() => {
|
|
@@ -304285,6 +304370,10 @@ Please try running again with NO_BROWSER=true set.`);
|
|
|
304285
304370
|
}, authTimeout);
|
|
304286
304371
|
});
|
|
304287
304372
|
await Promise.race([webLogin.loginCompletePromise, timeoutPromise]);
|
|
304373
|
+
coreEvents.emit(CoreEvent.UserFeedback, {
|
|
304374
|
+
severity: "info",
|
|
304375
|
+
message: "Authentication succeeded\n"
|
|
304376
|
+
});
|
|
304288
304377
|
}
|
|
304289
304378
|
return client;
|
|
304290
304379
|
}
|
|
@@ -304295,47 +304384,56 @@ async function getOauthClient(authType, config2) {
|
|
|
304295
304384
|
return oauthClientPromises.get(authType);
|
|
304296
304385
|
}
|
|
304297
304386
|
async function authWithUserCode(client) {
|
|
304298
|
-
const redirectUri = "https://codeassist.google.com/authcode";
|
|
304299
|
-
const codeVerifier = await client.generateCodeVerifierAsync();
|
|
304300
|
-
const state = crypto13.randomBytes(32).toString("hex");
|
|
304301
|
-
const authUrl = client.generateAuthUrl({
|
|
304302
|
-
redirect_uri: redirectUri,
|
|
304303
|
-
access_type: "offline",
|
|
304304
|
-
scope: OAUTH_SCOPE,
|
|
304305
|
-
code_challenge_method: import_google_auth_library8.CodeChallengeMethod.S256,
|
|
304306
|
-
code_challenge: codeVerifier.codeChallenge,
|
|
304307
|
-
state
|
|
304308
|
-
});
|
|
304309
|
-
debugLogger.log("Please visit the following URL to authorize the application:");
|
|
304310
|
-
debugLogger.log("");
|
|
304311
|
-
debugLogger.log(authUrl);
|
|
304312
|
-
debugLogger.log("");
|
|
304313
|
-
const code2 = await new Promise((resolve14) => {
|
|
304314
|
-
const rl = readline.createInterface({
|
|
304315
|
-
input: process.stdin,
|
|
304316
|
-
output: process.stdout
|
|
304317
|
-
});
|
|
304318
|
-
rl.question("Enter the authorization code: ", (code3) => {
|
|
304319
|
-
rl.close();
|
|
304320
|
-
resolve14(code3.trim());
|
|
304321
|
-
});
|
|
304322
|
-
});
|
|
304323
|
-
if (!code2) {
|
|
304324
|
-
debugLogger.error("Authorization code is required.");
|
|
304325
|
-
return false;
|
|
304326
|
-
}
|
|
304327
304387
|
try {
|
|
304328
|
-
const
|
|
304329
|
-
|
|
304330
|
-
|
|
304331
|
-
|
|
304388
|
+
const redirectUri = "https://codeassist.google.com/authcode";
|
|
304389
|
+
const codeVerifier = await client.generateCodeVerifierAsync();
|
|
304390
|
+
const state = crypto13.randomBytes(32).toString("hex");
|
|
304391
|
+
const authUrl = client.generateAuthUrl({
|
|
304392
|
+
redirect_uri: redirectUri,
|
|
304393
|
+
access_type: "offline",
|
|
304394
|
+
scope: OAUTH_SCOPE,
|
|
304395
|
+
code_challenge_method: import_google_auth_library8.CodeChallengeMethod.S256,
|
|
304396
|
+
code_challenge: codeVerifier.codeChallenge,
|
|
304397
|
+
state
|
|
304332
304398
|
});
|
|
304333
|
-
|
|
304334
|
-
|
|
304335
|
-
|
|
304399
|
+
writeToStdout("Please visit the following URL to authorize the application:\n\n" + authUrl + "\n\n");
|
|
304400
|
+
const code2 = await new Promise((resolve14, _) => {
|
|
304401
|
+
const rl = readline.createInterface({
|
|
304402
|
+
input: process.stdin,
|
|
304403
|
+
output: createInkStdio().stdout,
|
|
304404
|
+
terminal: true
|
|
304405
|
+
});
|
|
304406
|
+
rl.question("Enter the authorization code: ", (code3) => {
|
|
304407
|
+
rl.close();
|
|
304408
|
+
resolve14(code3.trim());
|
|
304409
|
+
});
|
|
304410
|
+
});
|
|
304411
|
+
if (!code2) {
|
|
304412
|
+
writeToStderr("Authorization code is required.\n");
|
|
304413
|
+
debugLogger.error("Authorization code is required.");
|
|
304414
|
+
return false;
|
|
304415
|
+
}
|
|
304416
|
+
try {
|
|
304417
|
+
const { tokens } = await client.getToken({
|
|
304418
|
+
code: code2,
|
|
304419
|
+
codeVerifier: codeVerifier.codeVerifier,
|
|
304420
|
+
redirect_uri: redirectUri
|
|
304421
|
+
});
|
|
304422
|
+
client.setCredentials(tokens);
|
|
304423
|
+
} catch (error) {
|
|
304424
|
+
writeToStderr("Failed to authenticate with authorization code:" + getErrorMessage(error) + "\n");
|
|
304425
|
+
debugLogger.error("Failed to authenticate with authorization code:", getErrorMessage(error));
|
|
304426
|
+
return false;
|
|
304427
|
+
}
|
|
304428
|
+
return true;
|
|
304429
|
+
} catch (err2) {
|
|
304430
|
+
if (err2 instanceof FatalCancellationError) {
|
|
304431
|
+
throw err2;
|
|
304432
|
+
}
|
|
304433
|
+
writeToStderr("Failed to authenticate with user code:" + getErrorMessage(err2) + "\n");
|
|
304434
|
+
debugLogger.error("Failed to authenticate with user code:", getErrorMessage(err2));
|
|
304336
304435
|
return false;
|
|
304337
304436
|
}
|
|
304338
|
-
return true;
|
|
304339
304437
|
}
|
|
304340
304438
|
async function authWithWeb(client) {
|
|
304341
304439
|
const port = await getAvailablePort();
|
|
@@ -304984,7 +305082,7 @@ var addFormatsFunc = addFormats.default || addFormats;
|
|
|
304984
305082
|
addFormatsFunc(ajValidator);
|
|
304985
305083
|
var SchemaValidator = class {
|
|
304986
305084
|
/**
|
|
304987
|
-
* Returns null if the data
|
|
305085
|
+
* Returns null if the data conforms to the schema described by schema (or if schema
|
|
304988
305086
|
* is null). Otherwise, returns a string describing the error.
|
|
304989
305087
|
*/
|
|
304990
305088
|
static validate(schema, data) {
|
|
@@ -306384,7 +306482,7 @@ function toFinishReasons(candidates) {
|
|
|
306384
306482
|
}
|
|
306385
306483
|
function toOutputType(requested_mime) {
|
|
306386
306484
|
switch (requested_mime) {
|
|
306387
|
-
//
|
|
306485
|
+
// explicitly support the known good values of responseMimeType
|
|
306388
306486
|
case "text/plain":
|
|
306389
306487
|
return OTelOutputType.TEXT;
|
|
306390
306488
|
case "application/json":
|
|
@@ -307485,6 +307583,7 @@ var EventMetadataKey;
|
|
|
307485
307583
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_OS"] = 82] = "GEMINI_CLI_OS";
|
|
307486
307584
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_USER_SETTINGS"] = 84] = "GEMINI_CLI_USER_SETTINGS";
|
|
307487
307585
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_GH_WORKFLOW_NAME"] = 130] = "GEMINI_CLI_GH_WORKFLOW_NAME";
|
|
307586
|
+
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_EXPERIMENT_IDS"] = 131] = "GEMINI_CLI_EXPERIMENT_IDS";
|
|
307488
307587
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_LOOP_DETECTED_TYPE"] = 38] = "GEMINI_CLI_LOOP_DETECTED_TYPE";
|
|
307489
307588
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_SLASH_COMMAND_NAME"] = 41] = "GEMINI_CLI_SLASH_COMMAND_NAME";
|
|
307490
307589
|
EventMetadataKey2[EventMetadataKey2["GEMINI_CLI_SLASH_COMMAND_SUBCOMMAND"] = 42] = "GEMINI_CLI_SLASH_COMMAND_SUBCOMMAND";
|
|
@@ -307590,8 +307689,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
307590
307689
|
var PointerVector = import_vector.default.PointerVector;
|
|
307591
307690
|
|
|
307592
307691
|
// packages/core/dist/src/generated/git-commit.js
|
|
307593
|
-
var GIT_COMMIT_INFO = "
|
|
307594
|
-
var CLI_VERSION = "0.
|
|
307692
|
+
var GIT_COMMIT_INFO = "42c2e1b21";
|
|
307693
|
+
var CLI_VERSION = "0.19.0-nightly.20251122.42c2e1b21";
|
|
307595
307694
|
|
|
307596
307695
|
// packages/core/dist/src/ide/detect-ide.js
|
|
307597
307696
|
var IDE_DEFINITIONS = {
|
|
@@ -307764,22 +307863,44 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
307764
307863
|
static clearInstance() {
|
|
307765
307864
|
_ClearcutLogger.instance = void 0;
|
|
307766
307865
|
}
|
|
307866
|
+
enqueueHelper(event) {
|
|
307867
|
+
const wasAtCapacity = this.events.size >= MAX_EVENTS;
|
|
307868
|
+
if (wasAtCapacity) {
|
|
307869
|
+
this.events.shift();
|
|
307870
|
+
}
|
|
307871
|
+
this.events.push([
|
|
307872
|
+
{
|
|
307873
|
+
event_time_ms: Date.now(),
|
|
307874
|
+
source_extension_json: safeJsonStringify(event)
|
|
307875
|
+
}
|
|
307876
|
+
]);
|
|
307877
|
+
if (wasAtCapacity && this.config?.getDebugMode()) {
|
|
307878
|
+
debugLogger.debug(`ClearcutLogger: Dropped old event to prevent memory leak (queue size: ${this.events.size})`);
|
|
307879
|
+
}
|
|
307880
|
+
}
|
|
307767
307881
|
enqueueLogEvent(event) {
|
|
307768
307882
|
try {
|
|
307769
|
-
|
|
307770
|
-
|
|
307771
|
-
|
|
307883
|
+
this.enqueueHelper(event);
|
|
307884
|
+
} catch (error) {
|
|
307885
|
+
if (this.config?.getDebugMode()) {
|
|
307886
|
+
console.error("ClearcutLogger: Failed to enqueue log event.", error);
|
|
307772
307887
|
}
|
|
307773
|
-
|
|
307774
|
-
|
|
307775
|
-
|
|
307776
|
-
|
|
307777
|
-
|
|
307888
|
+
}
|
|
307889
|
+
}
|
|
307890
|
+
async enqueueLogEventAfterExperimentsLoadAsync(event) {
|
|
307891
|
+
try {
|
|
307892
|
+
this.config?.getExperimentsAsync().then((experiments) => {
|
|
307893
|
+
if (experiments) {
|
|
307894
|
+
const exp_id_data = [
|
|
307895
|
+
{
|
|
307896
|
+
gemini_cli_key: EventMetadataKey.GEMINI_CLI_EXPERIMENT_IDS,
|
|
307897
|
+
value: experiments.experimentIds.toString() ?? "NA"
|
|
307898
|
+
}
|
|
307899
|
+
];
|
|
307900
|
+
event.event_metadata = [[...event.event_metadata[0], ...exp_id_data]];
|
|
307778
307901
|
}
|
|
307779
|
-
|
|
307780
|
-
|
|
307781
|
-
debugLogger.debug(`ClearcutLogger: Dropped old event to prevent memory leak (queue size: ${this.events.size})`);
|
|
307782
|
-
}
|
|
307902
|
+
this.enqueueHelper(event);
|
|
307903
|
+
});
|
|
307783
307904
|
} catch (error) {
|
|
307784
307905
|
if (this.config?.getDebugMode()) {
|
|
307785
307906
|
console.error("ClearcutLogger: Failed to enqueue log event.", error);
|
|
@@ -307787,6 +307908,7 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
307787
307908
|
}
|
|
307788
307909
|
}
|
|
307789
307910
|
createBasicLogEvent(eventName, data = []) {
|
|
307911
|
+
const email = this.userAccountManager.getCachedGoogleAccount();
|
|
307790
307912
|
const surface = determineSurface();
|
|
307791
307913
|
const ghWorkflowName = determineGHWorkflowName();
|
|
307792
307914
|
const baseMetadata = [
|
|
@@ -307814,28 +307936,27 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
307814
307936
|
value: ghWorkflowName
|
|
307815
307937
|
});
|
|
307816
307938
|
}
|
|
307817
|
-
|
|
307939
|
+
const logEvent = {
|
|
307818
307940
|
console_type: "GEMINI_CLI",
|
|
307819
307941
|
application: 102,
|
|
307820
307942
|
// GEMINI_CLI
|
|
307821
307943
|
event_name: eventName,
|
|
307822
307944
|
event_metadata: [baseMetadata]
|
|
307823
307945
|
};
|
|
307946
|
+
if (email) {
|
|
307947
|
+
logEvent.client_email = email;
|
|
307948
|
+
} else {
|
|
307949
|
+
logEvent.client_install_id = this.installationManager.getInstallationId();
|
|
307950
|
+
}
|
|
307951
|
+
return logEvent;
|
|
307824
307952
|
}
|
|
307825
307953
|
createLogEvent(eventName, data = []) {
|
|
307826
|
-
const email = this.userAccountManager.getCachedGoogleAccount();
|
|
307827
307954
|
if (eventName !== EventNames.START_SESSION) {
|
|
307828
307955
|
data.push(...this.sessionData);
|
|
307829
307956
|
}
|
|
307830
307957
|
const totalAccounts = this.userAccountManager.getLifetimeGoogleAccounts();
|
|
307831
307958
|
data = this.addDefaultFields(data, totalAccounts);
|
|
307832
|
-
|
|
307833
|
-
if (email) {
|
|
307834
|
-
logEvent.client_email = email;
|
|
307835
|
-
} else {
|
|
307836
|
-
logEvent.client_install_id = this.installationManager.getInstallationId();
|
|
307837
|
-
}
|
|
307838
|
-
return logEvent;
|
|
307959
|
+
return this.createBasicLogEvent(eventName, data);
|
|
307839
307960
|
}
|
|
307840
307961
|
flushIfNeeded() {
|
|
307841
307962
|
if (Date.now() - this.lastFlushTime < FLUSH_INTERVAL_MS) {
|
|
@@ -307983,9 +308104,10 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
307983
308104
|
}
|
|
307984
308105
|
];
|
|
307985
308106
|
this.sessionData = data;
|
|
307986
|
-
this.
|
|
307987
|
-
|
|
307988
|
-
|
|
308107
|
+
this.enqueueLogEventAfterExperimentsLoadAsync(this.createLogEvent(EventNames.START_SESSION, data)).then(() => {
|
|
308108
|
+
this.flushToClearcut().catch((error) => {
|
|
308109
|
+
debugLogger.debug("Error flushing to Clearcut:", error);
|
|
308110
|
+
});
|
|
307989
308111
|
});
|
|
307990
308112
|
}
|
|
307991
308113
|
logNewPromptEvent(event) {
|
|
@@ -308272,8 +308394,11 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
308272
308394
|
value: JSON.stringify(event.connection_type)
|
|
308273
308395
|
}
|
|
308274
308396
|
];
|
|
308275
|
-
this.
|
|
308276
|
-
|
|
308397
|
+
this.enqueueLogEventAfterExperimentsLoadAsync(this.createLogEvent(EventNames.START_SESSION, data)).then(() => {
|
|
308398
|
+
this.flushToClearcut().catch((error) => {
|
|
308399
|
+
debugLogger.debug("Error flushing to Clearcut:", error);
|
|
308400
|
+
});
|
|
308401
|
+
});
|
|
308277
308402
|
}
|
|
308278
308403
|
logConversationFinishedEvent(event) {
|
|
308279
308404
|
const data = [
|
|
@@ -308697,6 +308822,12 @@ var ClearcutLogger = class _ClearcutLogger {
|
|
|
308697
308822
|
value: this.config?.isInteractive().toString() ?? "false"
|
|
308698
308823
|
}
|
|
308699
308824
|
];
|
|
308825
|
+
if (this.config?.getExperiments()) {
|
|
308826
|
+
defaultLogMetadata.push({
|
|
308827
|
+
gemini_cli_key: EventMetadataKey.GEMINI_CLI_EXPERIMENT_IDS,
|
|
308828
|
+
value: this.config?.getExperiments()?.experimentIds.toString() ?? "NA"
|
|
308829
|
+
});
|
|
308830
|
+
}
|
|
308700
308831
|
return [...data, ...defaultLogMetadata];
|
|
308701
308832
|
}
|
|
308702
308833
|
getProxyAgent() {
|
|
@@ -310450,7 +310581,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
|
|
|
310450
310581
|
if (gcConfig.fakeResponses) {
|
|
310451
310582
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
310452
310583
|
}
|
|
310453
|
-
const version3 = "0.
|
|
310584
|
+
const version3 = "0.19.0-nightly.20251122.42c2e1b21";
|
|
310454
310585
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
310455
310586
|
const baseHeaders = {
|
|
310456
310587
|
"User-Agent": userAgent
|
|
@@ -348214,7 +348345,7 @@ function hasPromptCommandTransform(root) {
|
|
|
348214
348345
|
for (let i4 = 0; i4 < current.childCount - 1; i4 += 1) {
|
|
348215
348346
|
const operatorNode = current.child(i4);
|
|
348216
348347
|
const transformNode = current.child(i4 + 1);
|
|
348217
|
-
if (operatorNode?.
|
|
348348
|
+
if (operatorNode?.text === "@" && transformNode?.text?.toLowerCase() === "p") {
|
|
348218
348349
|
return true;
|
|
348219
348350
|
}
|
|
348220
348351
|
}
|
|
@@ -357112,6 +357243,12 @@ var GeminiChat = class {
|
|
|
357112
357243
|
thinkingLevel: ThinkingLevel.HIGH
|
|
357113
357244
|
};
|
|
357114
357245
|
delete config2.thinkingConfig?.thinkingBudget;
|
|
357246
|
+
} else {
|
|
357247
|
+
config2.thinkingConfig = {
|
|
357248
|
+
...config2.thinkingConfig,
|
|
357249
|
+
thinkingBudget: DEFAULT_THINKING_MODE
|
|
357250
|
+
};
|
|
357251
|
+
delete config2.thinkingConfig?.thinkingLevel;
|
|
357115
357252
|
}
|
|
357116
357253
|
return this.config.getContentGenerator().generateContentStream({
|
|
357117
357254
|
model: modelToUse,
|
|
@@ -357588,7 +357725,7 @@ You are a sub-agent in a larger system. Your only responsibility is to provide d
|
|
|
357588
357725
|
- **DO:** Find the key modules, classes, and functions that are part of the problem and its solution.
|
|
357589
357726
|
- **DO:** Understand *why* the code is written the way it is. Question everything.
|
|
357590
357727
|
- **DO:** Foresee the ripple effects of a change. If \`function A\` is modified, you must check its callers. If a data structure is altered, you must identify where its type definitions need to be updated.
|
|
357591
|
-
- **DO:** provide a conclusion and insights to the main agent that invoked you. If the agent is trying to solve a bug, you should provide the root cause of the bug, its impacts, how to fix it etc. If it's a new feature, you should provide insights on where to implement it, what
|
|
357728
|
+
- **DO:** provide a conclusion and insights to the main agent that invoked you. If the agent is trying to solve a bug, you should provide the root cause of the bug, its impacts, how to fix it etc. If it's a new feature, you should provide insights on where to implement it, what changes are necessary etc.
|
|
357592
357729
|
- **DO NOT:** Write the final implementation code yourself.
|
|
357593
357730
|
- **DO NOT:** Stop at the first relevant file. Your goal is a comprehensive understanding of the entire relevant subsystem.
|
|
357594
357731
|
You operate in a non-interactive loop and must reason based on the information provided and the output of your tools.
|
|
@@ -363970,7 +364107,9 @@ var GitService = class {
|
|
|
363970
364107
|
try {
|
|
363971
364108
|
const repo = this.shadowGitRepository;
|
|
363972
364109
|
await repo.add(".");
|
|
363973
|
-
const commitResult = await repo.commit(message
|
|
364110
|
+
const commitResult = await repo.commit(message, {
|
|
364111
|
+
"--no-verify": null
|
|
364112
|
+
});
|
|
363974
364113
|
return commitResult.commit;
|
|
363975
364114
|
} catch (error) {
|
|
363976
364115
|
throw new Error(`Failed to create checkpoint snapshot: ${error instanceof Error ? error.message : "Unknown error"}. Checkpointing may not be working properly.`);
|
|
@@ -364396,8 +364535,12 @@ var ModelConfigService = class {
|
|
|
364396
364535
|
}
|
|
364397
364536
|
internalGetResolvedConfig(context2) {
|
|
364398
364537
|
const config2 = this.config || {};
|
|
364399
|
-
const { aliases: aliases2 = {}, overrides = [] } = config2;
|
|
364400
|
-
const allAliases = {
|
|
364538
|
+
const { aliases: aliases2 = {}, customAliases = {}, overrides = [] } = config2;
|
|
364539
|
+
const allAliases = {
|
|
364540
|
+
...aliases2,
|
|
364541
|
+
...customAliases,
|
|
364542
|
+
...this.runtimeAliases
|
|
364543
|
+
};
|
|
364401
364544
|
let baseModel = context2.model;
|
|
364402
364545
|
let resolvedConfig = {};
|
|
364403
364546
|
if (allAliases[context2.model]) {
|
|
@@ -367575,7 +367718,7 @@ async function getClientMetadata() {
|
|
|
367575
367718
|
clientMetadataPromise = (async () => ({
|
|
367576
367719
|
ideName: "IDE_UNSPECIFIED",
|
|
367577
367720
|
pluginType: "GEMINI",
|
|
367578
|
-
ideVersion: "0.
|
|
367721
|
+
ideVersion: "0.19.0-nightly.20251122.42c2e1b21",
|
|
367579
367722
|
platform: getPlatform(),
|
|
367580
367723
|
updateChannel: await getReleaseChannel(__dirname5)
|
|
367581
367724
|
}))();
|
|
@@ -372329,6 +372472,21 @@ async function createTransportWithOAuth(mcpServerName, mcpServerConfig, accessTo
|
|
|
372329
372472
|
return null;
|
|
372330
372473
|
}
|
|
372331
372474
|
}
|
|
372475
|
+
var LenientJsonSchemaValidator = class {
|
|
372476
|
+
ajvValidator = new AjvJsonSchemaValidator();
|
|
372477
|
+
getValidator(schema) {
|
|
372478
|
+
try {
|
|
372479
|
+
return this.ajvValidator.getValidator(schema);
|
|
372480
|
+
} catch (error) {
|
|
372481
|
+
debugLogger.warn(`Failed to compile MCP tool output schema (${schema?.["$id"] ?? "<no $id>"}): ${error instanceof Error ? error.message : String(error)}. Skipping output validation for this tool.`);
|
|
372482
|
+
return (input) => ({
|
|
372483
|
+
valid: true,
|
|
372484
|
+
data: input,
|
|
372485
|
+
errorMessage: void 0
|
|
372486
|
+
});
|
|
372487
|
+
}
|
|
372488
|
+
}
|
|
372489
|
+
};
|
|
372332
372490
|
function populateMcpServerCommand(mcpServers, mcpServerCommand) {
|
|
372333
372491
|
if (mcpServerCommand) {
|
|
372334
372492
|
const cmd = mcpServerCommand;
|
|
@@ -372471,6 +372629,9 @@ async function connectToMcpServer(mcpServerName, mcpServerConfig, debugMode, wor
|
|
|
372471
372629
|
const mcpClient = new Client({
|
|
372472
372630
|
name: "gemini-cli-mcp-client",
|
|
372473
372631
|
version: "0.0.1"
|
|
372632
|
+
}, {
|
|
372633
|
+
// Use a tolerant validator so bad output schemas don't block discovery.
|
|
372634
|
+
jsonSchemaValidator: new LenientJsonSchemaValidator()
|
|
372474
372635
|
});
|
|
372475
372636
|
mcpClient.registerCapabilities({
|
|
372476
372637
|
roots: {
|
|
@@ -373060,9 +373221,6 @@ var Config = class {
|
|
|
373060
373221
|
messageBus;
|
|
373061
373222
|
policyEngine;
|
|
373062
373223
|
outputSettings;
|
|
373063
|
-
useModelRouter;
|
|
373064
|
-
initialUseModelRouter;
|
|
373065
|
-
disableModelRouterForAuth;
|
|
373066
373224
|
enableMessageBusIntegration;
|
|
373067
373225
|
codebaseInvestigatorSettings;
|
|
373068
373226
|
continueOnFailedApiCall;
|
|
@@ -373159,9 +373317,6 @@ var Config = class {
|
|
|
373159
373317
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
|
373160
373318
|
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
373161
373319
|
this.useWriteTodos = params.useWriteTodos ?? true;
|
|
373162
|
-
this.initialUseModelRouter = params.useModelRouter ?? false;
|
|
373163
|
-
this.useModelRouter = this.initialUseModelRouter;
|
|
373164
|
-
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
|
373165
373320
|
this.enableHooks = params.enableHooks ?? false;
|
|
373166
373321
|
const hasHooks = params.hooks && Object.keys(params.hooks).length > 0;
|
|
373167
373322
|
const hooksNeedMessageBus = this.enableHooks && hasHooks;
|
|
@@ -373244,13 +373399,6 @@ var Config = class {
|
|
|
373244
373399
|
return this.contentGenerator;
|
|
373245
373400
|
}
|
|
373246
373401
|
async refreshAuth(authMethod) {
|
|
373247
|
-
this.useModelRouter = this.initialUseModelRouter;
|
|
373248
|
-
if (this.disableModelRouterForAuth?.includes(authMethod)) {
|
|
373249
|
-
this.useModelRouter = false;
|
|
373250
|
-
if (this.model === DEFAULT_GEMINI_MODEL_AUTO) {
|
|
373251
|
-
this.model = DEFAULT_GEMINI_MODEL;
|
|
373252
|
-
}
|
|
373253
|
-
}
|
|
373254
373402
|
if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod !== AuthType2.USE_GEMINI) {
|
|
373255
373403
|
this.geminiClient.stripThoughtsFromHistory();
|
|
373256
373404
|
}
|
|
@@ -373278,6 +373426,16 @@ var Config = class {
|
|
|
373278
373426
|
}
|
|
373279
373427
|
this.inFallbackMode = false;
|
|
373280
373428
|
}
|
|
373429
|
+
async getExperimentsAsync() {
|
|
373430
|
+
if (this.experiments) {
|
|
373431
|
+
return this.experiments;
|
|
373432
|
+
}
|
|
373433
|
+
const codeAssistServer = getCodeAssistServer(this);
|
|
373434
|
+
if (codeAssistServer) {
|
|
373435
|
+
return getExperiments(codeAssistServer);
|
|
373436
|
+
}
|
|
373437
|
+
return void 0;
|
|
373438
|
+
}
|
|
373281
373439
|
getUserTier() {
|
|
373282
373440
|
return this.contentGenerator?.userTier;
|
|
373283
373441
|
}
|
|
@@ -373744,9 +373902,6 @@ var Config = class {
|
|
|
373744
373902
|
getOutputFormat() {
|
|
373745
373903
|
return this.outputSettings?.format ? this.outputSettings.format : OutputFormat.TEXT;
|
|
373746
373904
|
}
|
|
373747
|
-
getUseModelRouter() {
|
|
373748
|
-
return this.useModelRouter;
|
|
373749
|
-
}
|
|
373750
373905
|
async getGitService() {
|
|
373751
373906
|
if (!this.gitService) {
|
|
373752
373907
|
this.gitService = new GitService(this.targetDir, this.storage);
|
package/dist/src/agent/task.js
CHANGED
|
@@ -287,7 +287,7 @@ export class Task {
|
|
|
287
287
|
}
|
|
288
288
|
toolStatusMessage(tc, taskId, contextId) {
|
|
289
289
|
const messageParts = [];
|
|
290
|
-
// Create a serializable version of the ToolCall (pick
|
|
290
|
+
// Create a serializable version of the ToolCall (pick necessary
|
|
291
291
|
// properties/avoid methods causing circular reference errors)
|
|
292
292
|
const serializableToolCall = this._pickFields(tc, 'request', 'status', 'confirmationDetails', 'liveOutput', 'response');
|
|
293
293
|
if (tc.tool) {
|