@expiren/opencode-antigravity-auth 1.6.12 → 1.6.14
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/index.js +47 -16
- package/dist/index.js.map +2 -2
- package/dist/src/plugin/config/models.d.ts.map +1 -1
- package/dist/src/plugin/config/models.js +9 -8
- package/dist/src/plugin/config/models.js.map +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +7 -1
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
- package/dist/src/plugin/transform/model-resolver.js +49 -15
- package/dist/src/plugin/transform/model-resolver.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1714,9 +1714,7 @@ var OPENCODE_MODEL_DEFINITIONS = {
|
|
|
1714
1714
|
limit: { context: 1048576, output: 65536 },
|
|
1715
1715
|
modalities: DEFAULT_MODALITIES,
|
|
1716
1716
|
variants: {
|
|
1717
|
-
minimal: { thinkingLevel: "minimal" },
|
|
1718
1717
|
low: { thinkingLevel: "low" },
|
|
1719
|
-
medium: { thinkingLevel: "medium" },
|
|
1720
1718
|
high: { thinkingLevel: "high" }
|
|
1721
1719
|
}
|
|
1722
1720
|
}),
|
|
@@ -1788,12 +1786,6 @@ var OPENCODE_MODEL_DEFINITIONS = {
|
|
|
1788
1786
|
limit: { context: 1048576, output: 65535 },
|
|
1789
1787
|
modalities: DEFAULT_MODALITIES
|
|
1790
1788
|
}),
|
|
1791
|
-
"gemini-3.5-flash": defineModel("gemini-3.5-flash", {
|
|
1792
|
-
name: "Gemini 3.5 Flash (Gemini CLI)",
|
|
1793
|
-
reasoning: true,
|
|
1794
|
-
limit: { context: 1048576, output: 65536 },
|
|
1795
|
-
modalities: DEFAULT_MODALITIES
|
|
1796
|
-
}),
|
|
1797
1789
|
"gemini-3.1-flash-image-preview": defineModel("gemini-3.1-flash-image-preview", {
|
|
1798
1790
|
name: "Gemini 3.1 Flash Image Preview (Gemini CLI)",
|
|
1799
1791
|
reasoning: false,
|
|
@@ -1803,6 +1795,15 @@ var OPENCODE_MODEL_DEFINITIONS = {
|
|
|
1803
1795
|
output: ["text", "image"]
|
|
1804
1796
|
}
|
|
1805
1797
|
}),
|
|
1798
|
+
"gemini-3-pro-image-preview": defineModel("gemini-3-pro-image-preview", {
|
|
1799
|
+
name: "Gemini 3 Pro Image Preview (Gemini CLI)",
|
|
1800
|
+
reasoning: false,
|
|
1801
|
+
limit: { context: 66e3, output: 33e3 },
|
|
1802
|
+
modalities: {
|
|
1803
|
+
input: ["text", "image"],
|
|
1804
|
+
output: ["text", "image"]
|
|
1805
|
+
}
|
|
1806
|
+
}),
|
|
1806
1807
|
"gemini-3.1-pro-preview-customtools": defineModel("gemini-3.1-pro-preview-customtools", {
|
|
1807
1808
|
name: "Gemini 3.1 Pro Preview Custom Tools (Gemini CLI)",
|
|
1808
1809
|
reasoning: true,
|
|
@@ -5841,6 +5842,12 @@ function isGemini3ProModel(model) {
|
|
|
5841
5842
|
function isGemini3FlashModel(model) {
|
|
5842
5843
|
return GEMINI_3_FLASH_REGEX.test(model);
|
|
5843
5844
|
}
|
|
5845
|
+
function isGemini35FlashModel(model) {
|
|
5846
|
+
return /^gemini-3\.5-flash/i.test(model);
|
|
5847
|
+
}
|
|
5848
|
+
function resolveGemini35FlashAntigravityModel(tier) {
|
|
5849
|
+
return tier === "low" || tier === "medium" ? "gemini-3.5-flash-low" : "gemini-3-flash-agent";
|
|
5850
|
+
}
|
|
5844
5851
|
function resolveModelWithTier(requestedModel, options = {}) {
|
|
5845
5852
|
const isAntigravity = QUOTA_PREFIX_REGEX.test(requestedModel);
|
|
5846
5853
|
const modelWithoutQuota = requestedModel.replace(QUOTA_PREFIX_REGEX, "");
|
|
@@ -5855,6 +5862,17 @@ function resolveModelWithTier(requestedModel, options = {}) {
|
|
|
5855
5862
|
const skipAlias = isAntigravity && isGemini3;
|
|
5856
5863
|
const isGemini3Pro = isGemini3ProModel(modelWithoutQuota);
|
|
5857
5864
|
const isGemini3Flash = isGemini3FlashModel(modelWithoutQuota);
|
|
5865
|
+
const isGemini35Flash = /^gemini-3\.5-flash/i.test(baseName);
|
|
5866
|
+
if (isGemini35Flash && quotaPreference === "antigravity") {
|
|
5867
|
+
return {
|
|
5868
|
+
actualModel: resolveGemini35FlashAntigravityModel(tier),
|
|
5869
|
+
thinkingLevel: tier ?? "high",
|
|
5870
|
+
tier,
|
|
5871
|
+
isThinkingModel: true,
|
|
5872
|
+
quotaPreference,
|
|
5873
|
+
explicitQuota
|
|
5874
|
+
};
|
|
5875
|
+
}
|
|
5858
5876
|
let antigravityModel = modelWithoutQuota;
|
|
5859
5877
|
if (skipAlias) {
|
|
5860
5878
|
if ((isGemini3Pro || isGemini3Flash) && !tier && !isImageModel) {
|
|
@@ -5880,7 +5898,7 @@ function resolveModelWithTier(requestedModel, options = {}) {
|
|
|
5880
5898
|
if (isEffectiveGemini3) {
|
|
5881
5899
|
return {
|
|
5882
5900
|
actualModel: resolvedModel,
|
|
5883
|
-
thinkingLevel: "low",
|
|
5901
|
+
thinkingLevel: isGemini35Flash ? "medium" : "low",
|
|
5884
5902
|
isThinkingModel: true,
|
|
5885
5903
|
quotaPreference,
|
|
5886
5904
|
explicitQuota
|
|
@@ -5939,9 +5957,10 @@ function resolveModelForHeaderStyle(requestedModel, headerStyle) {
|
|
|
5939
5957
|
let transformedModel = requestedModel.replace(/-preview-customtools$/i, "").replace(/-preview$/i, "").replace(/^antigravity-/i, "");
|
|
5940
5958
|
const isGemini3Pro = isGemini3ProModel(transformedModel);
|
|
5941
5959
|
const isGemini3Flash = isGemini3FlashModel(transformedModel);
|
|
5942
|
-
const hasTierSuffix = /-(low|medium|high)$/i.test(transformedModel);
|
|
5960
|
+
const hasTierSuffix = /-(minimal|low|medium|high)$/i.test(transformedModel);
|
|
5943
5961
|
const isImageModel = IMAGE_GENERATION_MODELS.test(transformedModel);
|
|
5944
|
-
|
|
5962
|
+
const isGemini35Flash = isGemini35FlashModel(transformedModel.replace(TIER_REGEX, ""));
|
|
5963
|
+
if ((isGemini3Pro || isGemini3Flash) && !isGemini35Flash && !hasTierSuffix && !isImageModel) {
|
|
5945
5964
|
const defaultTier = isGemini3Pro ? "low" : "medium";
|
|
5946
5965
|
transformedModel = `${transformedModel}-${defaultTier}`;
|
|
5947
5966
|
}
|
|
@@ -5949,14 +5968,20 @@ function resolveModelForHeaderStyle(requestedModel, headerStyle) {
|
|
|
5949
5968
|
return resolveModelWithTier(prefixedModel);
|
|
5950
5969
|
}
|
|
5951
5970
|
if (headerStyle === "gemini-cli") {
|
|
5952
|
-
|
|
5971
|
+
const requestedTier = extractThinkingTierFromModel(requestedModel.replace(/^antigravity-/i, ""));
|
|
5972
|
+
let transformedModel = requestedModel.replace(/^antigravity-/i, "").replace(/-(minimal|low|medium|high)$/i, "");
|
|
5953
5973
|
const hasPreviewSuffix = /-preview($|-)/i.test(transformedModel);
|
|
5954
|
-
const isGemini35Flash =
|
|
5955
|
-
if (
|
|
5974
|
+
const isGemini35Flash = isGemini35FlashModel(transformedModel);
|
|
5975
|
+
if (isGemini35Flash) {
|
|
5976
|
+
transformedModel = "gemini-3-flash-preview";
|
|
5977
|
+
} else if (!hasPreviewSuffix) {
|
|
5956
5978
|
transformedModel = `${transformedModel}-preview`;
|
|
5957
5979
|
}
|
|
5980
|
+
const resolved = resolveModelWithTier(transformedModel);
|
|
5958
5981
|
return {
|
|
5959
|
-
...
|
|
5982
|
+
...resolved,
|
|
5983
|
+
thinkingLevel: requestedTier ?? resolved.thinkingLevel,
|
|
5984
|
+
tier: requestedTier ?? resolved.tier,
|
|
5960
5985
|
quotaPreference: "gemini-cli"
|
|
5961
5986
|
};
|
|
5962
5987
|
}
|
|
@@ -7161,7 +7186,13 @@ function prepareAntigravityRequest(input2, init, accessToken, projectId, endpoin
|
|
|
7161
7186
|
const isGemini3 = effectiveModel.toLowerCase().includes("gemini-3");
|
|
7162
7187
|
log6.debug(`[ThinkingResolution] rawModel=${rawModel} resolvedModel=${effectiveModel} resolvedTier=${tierThinkingLevel ?? "none"} variantLevel=${variantConfig?.thinkingLevel ?? "none"} variantBudget=${variantConfig?.thinkingBudget ?? "none"} providerOptions.google=${JSON.stringify(requestPayload.providerOptions?.google ?? null)} generationConfig.thinkingConfig=${JSON.stringify(rawGenerationConfig?.thinkingConfig ?? null)}`);
|
|
7163
7188
|
if (variantConfig?.thinkingLevel && isGemini3) {
|
|
7164
|
-
|
|
7189
|
+
const variantModelBase = rawModel.replace(/-preview-customtools$/i, "").replace(/-preview$/i, "").replace(/-(minimal|low|medium|high)$/i, "");
|
|
7190
|
+
const variantResolved = resolveModelForHeaderStyle(
|
|
7191
|
+
`${variantModelBase}-${variantConfig.thinkingLevel}`,
|
|
7192
|
+
headerStyle
|
|
7193
|
+
);
|
|
7194
|
+
effectiveModel = variantResolved.actualModel;
|
|
7195
|
+
tierThinkingLevel = variantResolved.thinkingLevel ?? variantConfig.thinkingLevel;
|
|
7165
7196
|
tierThinkingBudget = void 0;
|
|
7166
7197
|
} else if (variantConfig?.thinkingBudget) {
|
|
7167
7198
|
if (isGemini3) {
|