@google/gemini-cli-a2a-server 0.30.0-preview.1 → 0.30.0-preview.3
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 +308 -31
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -40431,6 +40431,245 @@ var require_utils4 = __commonJS({
|
|
|
40431
40431
|
}
|
|
40432
40432
|
});
|
|
40433
40433
|
|
|
40434
|
+
// node_modules/punycode/punycode.js
|
|
40435
|
+
var require_punycode = __commonJS({
|
|
40436
|
+
"node_modules/punycode/punycode.js"(exports2, module2) {
|
|
40437
|
+
"use strict";
|
|
40438
|
+
var maxInt = 2147483647;
|
|
40439
|
+
var base = 36;
|
|
40440
|
+
var tMin = 1;
|
|
40441
|
+
var tMax = 26;
|
|
40442
|
+
var skew = 38;
|
|
40443
|
+
var damp = 700;
|
|
40444
|
+
var initialBias = 72;
|
|
40445
|
+
var initialN = 128;
|
|
40446
|
+
var delimiter3 = "-";
|
|
40447
|
+
var regexPunycode = /^xn--/;
|
|
40448
|
+
var regexNonASCII = /[^\0-\x7F]/;
|
|
40449
|
+
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
|
|
40450
|
+
var errors = {
|
|
40451
|
+
"overflow": "Overflow: input needs wider integers to process",
|
|
40452
|
+
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
40453
|
+
"invalid-input": "Invalid input"
|
|
40454
|
+
};
|
|
40455
|
+
var baseMinusTMin = base - tMin;
|
|
40456
|
+
var floor = Math.floor;
|
|
40457
|
+
var stringFromCharCode = String.fromCharCode;
|
|
40458
|
+
function error2(type2) {
|
|
40459
|
+
throw new RangeError(errors[type2]);
|
|
40460
|
+
}
|
|
40461
|
+
function map3(array2, callback) {
|
|
40462
|
+
const result2 = [];
|
|
40463
|
+
let length = array2.length;
|
|
40464
|
+
while (length--) {
|
|
40465
|
+
result2[length] = callback(array2[length]);
|
|
40466
|
+
}
|
|
40467
|
+
return result2;
|
|
40468
|
+
}
|
|
40469
|
+
function mapDomain(domain, callback) {
|
|
40470
|
+
const parts2 = domain.split("@");
|
|
40471
|
+
let result2 = "";
|
|
40472
|
+
if (parts2.length > 1) {
|
|
40473
|
+
result2 = parts2[0] + "@";
|
|
40474
|
+
domain = parts2[1];
|
|
40475
|
+
}
|
|
40476
|
+
domain = domain.replace(regexSeparators, ".");
|
|
40477
|
+
const labels = domain.split(".");
|
|
40478
|
+
const encoded = map3(labels, callback).join(".");
|
|
40479
|
+
return result2 + encoded;
|
|
40480
|
+
}
|
|
40481
|
+
function ucs2decode(string4) {
|
|
40482
|
+
const output = [];
|
|
40483
|
+
let counter = 0;
|
|
40484
|
+
const length = string4.length;
|
|
40485
|
+
while (counter < length) {
|
|
40486
|
+
const value = string4.charCodeAt(counter++);
|
|
40487
|
+
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
40488
|
+
const extra = string4.charCodeAt(counter++);
|
|
40489
|
+
if ((extra & 64512) == 56320) {
|
|
40490
|
+
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
40491
|
+
} else {
|
|
40492
|
+
output.push(value);
|
|
40493
|
+
counter--;
|
|
40494
|
+
}
|
|
40495
|
+
} else {
|
|
40496
|
+
output.push(value);
|
|
40497
|
+
}
|
|
40498
|
+
}
|
|
40499
|
+
return output;
|
|
40500
|
+
}
|
|
40501
|
+
var ucs2encode = (codePoints) => String.fromCodePoint(...codePoints);
|
|
40502
|
+
var basicToDigit = function(codePoint) {
|
|
40503
|
+
if (codePoint >= 48 && codePoint < 58) {
|
|
40504
|
+
return 26 + (codePoint - 48);
|
|
40505
|
+
}
|
|
40506
|
+
if (codePoint >= 65 && codePoint < 91) {
|
|
40507
|
+
return codePoint - 65;
|
|
40508
|
+
}
|
|
40509
|
+
if (codePoint >= 97 && codePoint < 123) {
|
|
40510
|
+
return codePoint - 97;
|
|
40511
|
+
}
|
|
40512
|
+
return base;
|
|
40513
|
+
};
|
|
40514
|
+
var digitToBasic = function(digit, flag) {
|
|
40515
|
+
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
40516
|
+
};
|
|
40517
|
+
var adapt = function(delta, numPoints, firstTime) {
|
|
40518
|
+
let k = 0;
|
|
40519
|
+
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
40520
|
+
delta += floor(delta / numPoints);
|
|
40521
|
+
for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
|
40522
|
+
delta = floor(delta / baseMinusTMin);
|
|
40523
|
+
}
|
|
40524
|
+
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
40525
|
+
};
|
|
40526
|
+
var decode3 = function(input) {
|
|
40527
|
+
const output = [];
|
|
40528
|
+
const inputLength = input.length;
|
|
40529
|
+
let i4 = 0;
|
|
40530
|
+
let n3 = initialN;
|
|
40531
|
+
let bias = initialBias;
|
|
40532
|
+
let basic = input.lastIndexOf(delimiter3);
|
|
40533
|
+
if (basic < 0) {
|
|
40534
|
+
basic = 0;
|
|
40535
|
+
}
|
|
40536
|
+
for (let j = 0; j < basic; ++j) {
|
|
40537
|
+
if (input.charCodeAt(j) >= 128) {
|
|
40538
|
+
error2("not-basic");
|
|
40539
|
+
}
|
|
40540
|
+
output.push(input.charCodeAt(j));
|
|
40541
|
+
}
|
|
40542
|
+
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
40543
|
+
const oldi = i4;
|
|
40544
|
+
for (let w = 1, k = base; ; k += base) {
|
|
40545
|
+
if (index >= inputLength) {
|
|
40546
|
+
error2("invalid-input");
|
|
40547
|
+
}
|
|
40548
|
+
const digit = basicToDigit(input.charCodeAt(index++));
|
|
40549
|
+
if (digit >= base) {
|
|
40550
|
+
error2("invalid-input");
|
|
40551
|
+
}
|
|
40552
|
+
if (digit > floor((maxInt - i4) / w)) {
|
|
40553
|
+
error2("overflow");
|
|
40554
|
+
}
|
|
40555
|
+
i4 += digit * w;
|
|
40556
|
+
const t3 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
40557
|
+
if (digit < t3) {
|
|
40558
|
+
break;
|
|
40559
|
+
}
|
|
40560
|
+
const baseMinusT = base - t3;
|
|
40561
|
+
if (w > floor(maxInt / baseMinusT)) {
|
|
40562
|
+
error2("overflow");
|
|
40563
|
+
}
|
|
40564
|
+
w *= baseMinusT;
|
|
40565
|
+
}
|
|
40566
|
+
const out2 = output.length + 1;
|
|
40567
|
+
bias = adapt(i4 - oldi, out2, oldi == 0);
|
|
40568
|
+
if (floor(i4 / out2) > maxInt - n3) {
|
|
40569
|
+
error2("overflow");
|
|
40570
|
+
}
|
|
40571
|
+
n3 += floor(i4 / out2);
|
|
40572
|
+
i4 %= out2;
|
|
40573
|
+
output.splice(i4++, 0, n3);
|
|
40574
|
+
}
|
|
40575
|
+
return String.fromCodePoint(...output);
|
|
40576
|
+
};
|
|
40577
|
+
var encode3 = function(input) {
|
|
40578
|
+
const output = [];
|
|
40579
|
+
input = ucs2decode(input);
|
|
40580
|
+
const inputLength = input.length;
|
|
40581
|
+
let n3 = initialN;
|
|
40582
|
+
let delta = 0;
|
|
40583
|
+
let bias = initialBias;
|
|
40584
|
+
for (const currentValue of input) {
|
|
40585
|
+
if (currentValue < 128) {
|
|
40586
|
+
output.push(stringFromCharCode(currentValue));
|
|
40587
|
+
}
|
|
40588
|
+
}
|
|
40589
|
+
const basicLength = output.length;
|
|
40590
|
+
let handledCPCount = basicLength;
|
|
40591
|
+
if (basicLength) {
|
|
40592
|
+
output.push(delimiter3);
|
|
40593
|
+
}
|
|
40594
|
+
while (handledCPCount < inputLength) {
|
|
40595
|
+
let m2 = maxInt;
|
|
40596
|
+
for (const currentValue of input) {
|
|
40597
|
+
if (currentValue >= n3 && currentValue < m2) {
|
|
40598
|
+
m2 = currentValue;
|
|
40599
|
+
}
|
|
40600
|
+
}
|
|
40601
|
+
const handledCPCountPlusOne = handledCPCount + 1;
|
|
40602
|
+
if (m2 - n3 > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
40603
|
+
error2("overflow");
|
|
40604
|
+
}
|
|
40605
|
+
delta += (m2 - n3) * handledCPCountPlusOne;
|
|
40606
|
+
n3 = m2;
|
|
40607
|
+
for (const currentValue of input) {
|
|
40608
|
+
if (currentValue < n3 && ++delta > maxInt) {
|
|
40609
|
+
error2("overflow");
|
|
40610
|
+
}
|
|
40611
|
+
if (currentValue === n3) {
|
|
40612
|
+
let q = delta;
|
|
40613
|
+
for (let k = base; ; k += base) {
|
|
40614
|
+
const t3 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
40615
|
+
if (q < t3) {
|
|
40616
|
+
break;
|
|
40617
|
+
}
|
|
40618
|
+
const qMinusT = q - t3;
|
|
40619
|
+
const baseMinusT = base - t3;
|
|
40620
|
+
output.push(
|
|
40621
|
+
stringFromCharCode(digitToBasic(t3 + qMinusT % baseMinusT, 0))
|
|
40622
|
+
);
|
|
40623
|
+
q = floor(qMinusT / baseMinusT);
|
|
40624
|
+
}
|
|
40625
|
+
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
40626
|
+
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
|
|
40627
|
+
delta = 0;
|
|
40628
|
+
++handledCPCount;
|
|
40629
|
+
}
|
|
40630
|
+
}
|
|
40631
|
+
++delta;
|
|
40632
|
+
++n3;
|
|
40633
|
+
}
|
|
40634
|
+
return output.join("");
|
|
40635
|
+
};
|
|
40636
|
+
var toUnicode = function(input) {
|
|
40637
|
+
return mapDomain(input, function(string4) {
|
|
40638
|
+
return regexPunycode.test(string4) ? decode3(string4.slice(4).toLowerCase()) : string4;
|
|
40639
|
+
});
|
|
40640
|
+
};
|
|
40641
|
+
var toASCII = function(input) {
|
|
40642
|
+
return mapDomain(input, function(string4) {
|
|
40643
|
+
return regexNonASCII.test(string4) ? "xn--" + encode3(string4) : string4;
|
|
40644
|
+
});
|
|
40645
|
+
};
|
|
40646
|
+
var punycode = {
|
|
40647
|
+
/**
|
|
40648
|
+
* A string representing the current Punycode.js version number.
|
|
40649
|
+
* @memberOf punycode
|
|
40650
|
+
* @type String
|
|
40651
|
+
*/
|
|
40652
|
+
"version": "2.3.1",
|
|
40653
|
+
/**
|
|
40654
|
+
* An object of methods to convert from JavaScript's internal character
|
|
40655
|
+
* representation (UCS-2) to Unicode code points, and back.
|
|
40656
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
40657
|
+
* @memberOf punycode
|
|
40658
|
+
* @type Object
|
|
40659
|
+
*/
|
|
40660
|
+
"ucs2": {
|
|
40661
|
+
"decode": ucs2decode,
|
|
40662
|
+
"encode": ucs2encode
|
|
40663
|
+
},
|
|
40664
|
+
"decode": decode3,
|
|
40665
|
+
"encode": encode3,
|
|
40666
|
+
"toASCII": toASCII,
|
|
40667
|
+
"toUnicode": toUnicode
|
|
40668
|
+
};
|
|
40669
|
+
module2.exports = punycode;
|
|
40670
|
+
}
|
|
40671
|
+
});
|
|
40672
|
+
|
|
40434
40673
|
// node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json
|
|
40435
40674
|
var require_mappingTable = __commonJS({
|
|
40436
40675
|
"node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json"(exports2, module2) {
|
|
@@ -40442,7 +40681,7 @@ var require_mappingTable = __commonJS({
|
|
|
40442
40681
|
var require_tr46 = __commonJS({
|
|
40443
40682
|
"node_modules/node-fetch/node_modules/tr46/index.js"(exports2, module2) {
|
|
40444
40683
|
"use strict";
|
|
40445
|
-
var punycode =
|
|
40684
|
+
var punycode = require_punycode();
|
|
40446
40685
|
var mappingTable = require_mappingTable();
|
|
40447
40686
|
var PROCESSING_OPTIONS = {
|
|
40448
40687
|
TRANSITIONAL: 0,
|
|
@@ -40603,7 +40842,7 @@ var require_tr46 = __commonJS({
|
|
|
40603
40842
|
var require_url_state_machine = __commonJS({
|
|
40604
40843
|
"node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module2) {
|
|
40605
40844
|
"use strict";
|
|
40606
|
-
var punycode =
|
|
40845
|
+
var punycode = require_punycode();
|
|
40607
40846
|
var tr46 = require_tr46();
|
|
40608
40847
|
var specialSchemes = {
|
|
40609
40848
|
ftp: 21,
|
|
@@ -122655,18 +122894,20 @@ var init_partUtils = __esm({
|
|
|
122655
122894
|
});
|
|
122656
122895
|
|
|
122657
122896
|
// packages/core/dist/src/config/models.js
|
|
122658
|
-
function resolveModel(requestedModel) {
|
|
122897
|
+
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false) {
|
|
122659
122898
|
switch (requestedModel) {
|
|
122660
|
-
case
|
|
122899
|
+
case PREVIEW_GEMINI_MODEL:
|
|
122900
|
+
case PREVIEW_GEMINI_MODEL_AUTO:
|
|
122901
|
+
case GEMINI_MODEL_ALIAS_AUTO:
|
|
122902
|
+
case GEMINI_MODEL_ALIAS_PRO: {
|
|
122903
|
+
if (useGemini3_1) {
|
|
122904
|
+
return useCustomToolModel ? PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL : PREVIEW_GEMINI_3_1_MODEL;
|
|
122905
|
+
}
|
|
122661
122906
|
return PREVIEW_GEMINI_MODEL;
|
|
122662
122907
|
}
|
|
122663
122908
|
case DEFAULT_GEMINI_MODEL_AUTO: {
|
|
122664
122909
|
return DEFAULT_GEMINI_MODEL;
|
|
122665
122910
|
}
|
|
122666
|
-
case GEMINI_MODEL_ALIAS_AUTO:
|
|
122667
|
-
case GEMINI_MODEL_ALIAS_PRO: {
|
|
122668
|
-
return PREVIEW_GEMINI_MODEL;
|
|
122669
|
-
}
|
|
122670
122911
|
case GEMINI_MODEL_ALIAS_FLASH: {
|
|
122671
122912
|
return PREVIEW_GEMINI_FLASH_MODEL;
|
|
122672
122913
|
}
|
|
@@ -122678,7 +122919,7 @@ function resolveModel(requestedModel) {
|
|
|
122678
122919
|
}
|
|
122679
122920
|
}
|
|
122680
122921
|
}
|
|
122681
|
-
function resolveClassifierModel(requestedModel, modelAlias) {
|
|
122922
|
+
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false) {
|
|
122682
122923
|
if (modelAlias === GEMINI_MODEL_ALIAS_FLASH) {
|
|
122683
122924
|
if (requestedModel === DEFAULT_GEMINI_MODEL_AUTO || requestedModel === DEFAULT_GEMINI_MODEL) {
|
|
122684
122925
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
@@ -122688,10 +122929,10 @@ function resolveClassifierModel(requestedModel, modelAlias) {
|
|
|
122688
122929
|
}
|
|
122689
122930
|
return resolveModel(GEMINI_MODEL_ALIAS_FLASH);
|
|
122690
122931
|
}
|
|
122691
|
-
return resolveModel(requestedModel);
|
|
122932
|
+
return resolveModel(requestedModel, useGemini3_1, useCustomToolModel);
|
|
122692
122933
|
}
|
|
122693
122934
|
function isPreviewModel(model) {
|
|
122694
|
-
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO;
|
|
122935
|
+
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO;
|
|
122695
122936
|
}
|
|
122696
122937
|
function isGemini3Model(model) {
|
|
122697
122938
|
const resolved = resolveModel(model);
|
|
@@ -122715,11 +122956,13 @@ function isAutoModel(model) {
|
|
|
122715
122956
|
function supportsMultimodalFunctionResponse(model) {
|
|
122716
122957
|
return model.startsWith("gemini-3-");
|
|
122717
122958
|
}
|
|
122718
|
-
var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
|
|
122959
|
+
var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
|
|
122719
122960
|
var init_models = __esm({
|
|
122720
122961
|
"packages/core/dist/src/config/models.js"() {
|
|
122721
122962
|
"use strict";
|
|
122722
122963
|
PREVIEW_GEMINI_MODEL = "gemini-3-pro-preview";
|
|
122964
|
+
PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
|
|
122965
|
+
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
|
|
122723
122966
|
PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
|
|
122724
122967
|
DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
122725
122968
|
DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
@@ -131102,7 +131345,7 @@ function getVersion() {
|
|
|
131102
131345
|
}
|
|
131103
131346
|
versionPromise = (async () => {
|
|
131104
131347
|
const pkgJson = await getPackageJson(__dirname3);
|
|
131105
|
-
return "0.30.0-preview.
|
|
131348
|
+
return "0.30.0-preview.3";
|
|
131106
131349
|
})();
|
|
131107
131350
|
return versionPromise;
|
|
131108
131351
|
}
|
|
@@ -208502,8 +208745,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
208502
208745
|
var init_git_commit = __esm({
|
|
208503
208746
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
208504
208747
|
"use strict";
|
|
208505
|
-
GIT_COMMIT_INFO = "
|
|
208506
|
-
CLI_VERSION = "0.30.0-preview.
|
|
208748
|
+
GIT_COMMIT_INFO = "9ddc46c59";
|
|
208749
|
+
CLI_VERSION = "0.30.0-preview.3";
|
|
208507
208750
|
}
|
|
208508
208751
|
});
|
|
208509
208752
|
|
|
@@ -280543,7 +280786,7 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
280543
280786
|
return new LoggingContentGenerator(fakeGenerator, gcConfig);
|
|
280544
280787
|
}
|
|
280545
280788
|
const version4 = await getVersion();
|
|
280546
|
-
const model = resolveModel(gcConfig.getModel());
|
|
280789
|
+
const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false));
|
|
280547
280790
|
const customHeadersEnv = process.env["GEMINI_CLI_CUSTOM_HEADERS"] || void 0;
|
|
280548
280791
|
const userAgent = `GeminiCLI/${version4}/${model} (${process.platform}; ${process.arch})`;
|
|
280549
280792
|
const customHeadersMap = parseCustomHeaders(customHeadersEnv);
|
|
@@ -355206,7 +355449,7 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
|
|
|
355206
355449
|
const modelFromConfig = preferredModel ?? config3.getActiveModel?.() ?? config3.getModel();
|
|
355207
355450
|
const configuredModel = config3.getModel();
|
|
355208
355451
|
let chain2;
|
|
355209
|
-
const resolvedModel = resolveModel(modelFromConfig);
|
|
355452
|
+
const resolvedModel = resolveModel(modelFromConfig, config3.getGemini31LaunchedSync?.() ?? false);
|
|
355210
355453
|
const isAutoPreferred = preferredModel ? isAutoModel(preferredModel) : false;
|
|
355211
355454
|
const isAutoConfigured = isAutoModel(configuredModel);
|
|
355212
355455
|
const hasAccessToPreview = config3.getHasAccessToPreviewModel?.() ?? true;
|
|
@@ -377321,9 +377564,10 @@ var init_geminiChat = __esm({
|
|
|
377321
377564
|
const getAvailabilityContext = createAvailabilityContextProvider(this.config, () => lastModelToUse);
|
|
377322
377565
|
const initialActiveModel = this.config.getActiveModel();
|
|
377323
377566
|
const apiCall = async () => {
|
|
377324
|
-
|
|
377567
|
+
const useGemini3_1 = await this.config.getGemini31Launched?.() ?? false;
|
|
377568
|
+
let modelToUse = resolveModel(lastModelToUse, useGemini3_1);
|
|
377325
377569
|
if (this.config.getActiveModel() !== initialActiveModel) {
|
|
377326
|
-
modelToUse = resolveModel(this.config.getActiveModel());
|
|
377570
|
+
modelToUse = resolveModel(this.config.getActiveModel(), useGemini3_1);
|
|
377327
377571
|
}
|
|
377328
377572
|
if (modelToUse !== lastModelToUse) {
|
|
377329
377573
|
const { generateContentConfig: newConfig } = this.config.modelConfigService.getResolvedConfig({
|
|
@@ -379247,7 +379491,7 @@ var init_promptProvider = __esm({
|
|
|
379247
379491
|
const toolNames = config3.getToolRegistry().getAllToolNames();
|
|
379248
379492
|
const enabledToolNames = new Set(toolNames);
|
|
379249
379493
|
const approvedPlanPath = config3.getApprovedPlanPath();
|
|
379250
|
-
const desiredModel = resolveModel(config3.getActiveModel());
|
|
379494
|
+
const desiredModel = resolveModel(config3.getActiveModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
379251
379495
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
379252
379496
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
379253
379497
|
const contextFilenames = getAllGeminiMdFilenames();
|
|
@@ -379334,7 +379578,7 @@ ${mcpToolsList}`;
|
|
|
379334
379578
|
return sanitizedPrompt;
|
|
379335
379579
|
}
|
|
379336
379580
|
getCompressionPrompt(config3) {
|
|
379337
|
-
const desiredModel = resolveModel(config3.getActiveModel());
|
|
379581
|
+
const desiredModel = resolveModel(config3.getActiveModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
379338
379582
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
379339
379583
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
379340
379584
|
return activeSnippets.getCompressionPrompt();
|
|
@@ -379884,6 +380128,7 @@ function findCompressSplitPoint(contents, fraction) {
|
|
|
379884
380128
|
function modelStringToModelConfigAlias(model) {
|
|
379885
380129
|
switch (model) {
|
|
379886
380130
|
case PREVIEW_GEMINI_MODEL:
|
|
380131
|
+
case PREVIEW_GEMINI_3_1_MODEL:
|
|
379887
380132
|
return "chat-compression-3-pro";
|
|
379888
380133
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
379889
380134
|
return "chat-compression-3-flash";
|
|
@@ -380714,7 +380959,7 @@ var init_client3 = __esm({
|
|
|
380714
380959
|
if (this.currentSequenceModel) {
|
|
380715
380960
|
return this.currentSequenceModel;
|
|
380716
380961
|
}
|
|
380717
|
-
return resolveModel(this.config.getActiveModel());
|
|
380962
|
+
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false);
|
|
380718
380963
|
}
|
|
380719
380964
|
async *processTurn(request, signal, prompt_id, boundedTurns, isInvalidStreamRetry, displayContent) {
|
|
380720
380965
|
let turn = new Turn(this.getChat(), prompt_id);
|
|
@@ -385912,7 +386157,7 @@ var init_defaultStrategy = __esm({
|
|
|
385912
386157
|
DefaultStrategy = class {
|
|
385913
386158
|
name = "default";
|
|
385914
386159
|
async route(_context, config3, _baseLlmClient) {
|
|
385915
|
-
const defaultModel = resolveModel(config3.getModel());
|
|
386160
|
+
const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
385916
386161
|
return {
|
|
385917
386162
|
model: defaultModel,
|
|
385918
386163
|
metadata: {
|
|
@@ -385938,6 +386183,7 @@ var init_classifierStrategy = __esm({
|
|
|
385938
386183
|
init_messageInspectors();
|
|
385939
386184
|
init_debugLogger();
|
|
385940
386185
|
init_types6();
|
|
386186
|
+
init_contentGenerator();
|
|
385941
386187
|
HISTORY_TURNS_FOR_CONTEXT = 4;
|
|
385942
386188
|
HISTORY_SEARCH_WINDOW = 20;
|
|
385943
386189
|
FLASH_MODEL = "flash";
|
|
@@ -386058,7 +386304,9 @@ Respond *only* in JSON format according to the following schema. Do not include
|
|
|
386058
386304
|
const routerResponse = ClassifierResponseSchema.parse(jsonResponse);
|
|
386059
386305
|
const reasoning = routerResponse.reasoning;
|
|
386060
386306
|
const latencyMs = Date.now() - startTime;
|
|
386061
|
-
const
|
|
386307
|
+
const useGemini3_1 = await config3.getGemini31Launched?.() ?? false;
|
|
386308
|
+
const useCustomToolModel = useGemini3_1 && config3.getContentGeneratorConfig().authType === AuthType2.USE_GEMINI;
|
|
386309
|
+
const selectedModel = resolveClassifierModel(model, routerResponse.model_choice, useGemini3_1, useCustomToolModel);
|
|
386062
386310
|
return {
|
|
386063
386311
|
model: selectedModel,
|
|
386064
386312
|
metadata: {
|
|
@@ -386099,6 +386347,7 @@ var init_numericalClassifierStrategy = __esm({
|
|
|
386099
386347
|
init_node();
|
|
386100
386348
|
init_debugLogger();
|
|
386101
386349
|
init_types6();
|
|
386350
|
+
init_contentGenerator();
|
|
386102
386351
|
HISTORY_TURNS_FOR_CONTEXT2 = 8;
|
|
386103
386352
|
FLASH_MODEL2 = "flash";
|
|
386104
386353
|
PRO_MODEL2 = "pro";
|
|
@@ -386203,7 +386452,9 @@ Model: {"complexity_reasoning": "High-level architecture and strategic planning.
|
|
|
386203
386452
|
const routerResponse = ClassifierResponseSchema2.parse(jsonResponse);
|
|
386204
386453
|
const score = routerResponse.complexity_score;
|
|
386205
386454
|
const { threshold, groupLabel, modelAlias } = await this.getRoutingDecision(score, config3, config3.getSessionId() || "unknown-session");
|
|
386206
|
-
const
|
|
386455
|
+
const useGemini3_1 = await config3.getGemini31Launched?.() ?? false;
|
|
386456
|
+
const useCustomToolModel = useGemini3_1 && config3.getContentGeneratorConfig().authType === AuthType2.USE_GEMINI;
|
|
386457
|
+
const selectedModel = resolveClassifierModel(model, modelAlias, useGemini3_1, useCustomToolModel);
|
|
386207
386458
|
const latencyMs = Date.now() - startTime;
|
|
386208
386459
|
return {
|
|
386209
386460
|
model: selectedModel,
|
|
@@ -386309,7 +386560,7 @@ var init_fallbackStrategy = __esm({
|
|
|
386309
386560
|
name = "fallback";
|
|
386310
386561
|
async route(context2, config3, _baseLlmClient) {
|
|
386311
386562
|
const requestedModel = context2.requestedModel ?? config3.getModel();
|
|
386312
|
-
const resolvedModel = resolveModel(requestedModel);
|
|
386563
|
+
const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false);
|
|
386313
386564
|
const service = config3.getModelAvailabilityService();
|
|
386314
386565
|
const snapshot = service.snapshot(resolvedModel);
|
|
386315
386566
|
if (snapshot.available) {
|
|
@@ -386346,7 +386597,7 @@ var init_overrideStrategy = __esm({
|
|
|
386346
386597
|
return null;
|
|
386347
386598
|
}
|
|
386348
386599
|
return {
|
|
386349
|
-
model: resolveModel(overrideModel),
|
|
386600
|
+
model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false),
|
|
386350
386601
|
metadata: {
|
|
386351
386602
|
source: this.name,
|
|
386352
386603
|
latencyMs: 0,
|
|
@@ -397084,7 +397335,8 @@ var init_flagNames = __esm({
|
|
|
397084
397335
|
ENABLE_ADMIN_CONTROLS: 45752213,
|
|
397085
397336
|
MASKING_PROTECTION_THRESHOLD: 45758817,
|
|
397086
397337
|
MASKING_PRUNABLE_THRESHOLD: 45758818,
|
|
397087
|
-
MASKING_PROTECT_LATEST_TURN: 45758819
|
|
397338
|
+
MASKING_PROTECT_LATEST_TURN: 45758819,
|
|
397339
|
+
GEMINI_3_1_PRO_LAUNCHED: 45760185
|
|
397088
397340
|
};
|
|
397089
397341
|
}
|
|
397090
397342
|
});
|
|
@@ -401175,6 +401427,9 @@ var init_config3 = __esm({
|
|
|
401175
401427
|
this.geminiClient.stripThoughtsFromHistory();
|
|
401176
401428
|
}
|
|
401177
401429
|
this.modelAvailabilityService.reset();
|
|
401430
|
+
if (this.contentGeneratorConfig) {
|
|
401431
|
+
this.contentGeneratorConfig.authType = void 0;
|
|
401432
|
+
}
|
|
401178
401433
|
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
|
|
401179
401434
|
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
401180
401435
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
@@ -401359,7 +401614,7 @@ var init_config3 = __esm({
|
|
|
401359
401614
|
if (pooled.remaining !== void 0) {
|
|
401360
401615
|
return pooled.remaining;
|
|
401361
401616
|
}
|
|
401362
|
-
const primaryModel = resolveModel(this.getModel());
|
|
401617
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
401363
401618
|
return this.modelQuotas.get(primaryModel)?.remaining;
|
|
401364
401619
|
}
|
|
401365
401620
|
getQuotaLimit() {
|
|
@@ -401367,7 +401622,7 @@ var init_config3 = __esm({
|
|
|
401367
401622
|
if (pooled.limit !== void 0) {
|
|
401368
401623
|
return pooled.limit;
|
|
401369
401624
|
}
|
|
401370
|
-
const primaryModel = resolveModel(this.getModel());
|
|
401625
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
401371
401626
|
return this.modelQuotas.get(primaryModel)?.limit;
|
|
401372
401627
|
}
|
|
401373
401628
|
getQuotaResetTime() {
|
|
@@ -401375,7 +401630,7 @@ var init_config3 = __esm({
|
|
|
401375
401630
|
if (pooled.resetTime !== void 0) {
|
|
401376
401631
|
return pooled.resetTime;
|
|
401377
401632
|
}
|
|
401378
|
-
const primaryModel = resolveModel(this.getModel());
|
|
401633
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
401379
401634
|
return this.modelQuotas.get(primaryModel)?.resetTime;
|
|
401380
401635
|
}
|
|
401381
401636
|
getEmbeddingModel() {
|
|
@@ -401988,6 +402243,28 @@ var init_config3 = __esm({
|
|
|
401988
402243
|
await this.ensureExperimentsLoaded();
|
|
401989
402244
|
return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
|
|
401990
402245
|
}
|
|
402246
|
+
/**
|
|
402247
|
+
* Returns whether Gemini 3.1 has been launched.
|
|
402248
|
+
* This method is async and ensures that experiments are loaded before returning the result.
|
|
402249
|
+
*/
|
|
402250
|
+
async getGemini31Launched() {
|
|
402251
|
+
await this.ensureExperimentsLoaded();
|
|
402252
|
+
return this.getGemini31LaunchedSync();
|
|
402253
|
+
}
|
|
402254
|
+
/**
|
|
402255
|
+
* Returns whether Gemini 3.1 has been launched.
|
|
402256
|
+
*
|
|
402257
|
+
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
402258
|
+
* If you need to call this during startup or from an async context, use
|
|
402259
|
+
* getGemini31Launched instead.
|
|
402260
|
+
*/
|
|
402261
|
+
getGemini31LaunchedSync() {
|
|
402262
|
+
const authType = this.contentGeneratorConfig?.authType;
|
|
402263
|
+
if (authType === AuthType2.USE_GEMINI || authType === AuthType2.USE_VERTEX_AI) {
|
|
402264
|
+
return true;
|
|
402265
|
+
}
|
|
402266
|
+
return this.experiments?.flags[ExperimentFlags.GEMINI_3_1_PRO_LAUNCHED]?.boolValue ?? false;
|
|
402267
|
+
}
|
|
401991
402268
|
async ensureExperimentsLoaded() {
|
|
401992
402269
|
if (!this.experimentsPromise) {
|
|
401993
402270
|
return;
|