@anthonyhaussman/opencode-agy-auth 1.1.5 → 1.1.6-alpha.1

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 CHANGED
@@ -17053,7 +17053,15 @@ import { randomUUID as randomUUID2 } from "crypto";
17053
17053
  // src/sdk/request/shared.ts
17054
17054
  var REQUEST_MODEL_FALLBACKS = {
17055
17055
  "gemini-2.5-flash-image": "gemini-2.5-flash",
17056
- "gemini-3.1-pro-high": "gemini-pro-agent"
17056
+ "gemini-3.1-pro-high": "gemini-pro-agent",
17057
+ // Safety net: the gemini-3.5-flash-low/medium/high tier ids no longer
17058
+ // exist server-side. If any stale URL still contains them, remap to the
17059
+ // current live ids. Primary fix is TIER_MAPPING in plugin.ts.
17060
+ // medium -> gemini-3.5-flash-low (enum M20, display "Gemini 3.5 Flash (Medium)")
17061
+ // high -> gemini-3-flash-agent (enum M84, display "Gemini 3.5 Flash (High)")
17062
+ // low -> gemini-3.5-flash-extra-low (enum M187, display "Gemini 3.5 Flash (Low)")
17063
+ "gemini-3.5-flash-medium": "gemini-3.5-flash-low",
17064
+ "gemini-3.5-flash-high": "gemini-3-flash-agent"
17057
17065
  };
17058
17066
  var GENERATIVE_LANGUAGE_HOST = new URL(AGY_GENERATIVE_LANGUAGE_ENDPOINT).host;
17059
17067
  var CODE_ASSIST_HOST_SUFFIX = "cloudcode-pa.googleapis.com";
@@ -18055,9 +18063,9 @@ var TIER_MAPPING = {
18055
18063
  high: "gemini-3.6-flash-high"
18056
18064
  },
18057
18065
  "gemini-3.5-flash": {
18058
- low: "gemini-3.5-flash-low",
18059
- medium: "gemini-3.5-flash-medium",
18060
- high: "gemini-3.5-flash-high"
18066
+ low: "gemini-3.5-flash-extra-low",
18067
+ medium: "gemini-3.5-flash-low",
18068
+ high: "gemini-3-flash-agent"
18061
18069
  },
18062
18070
  "gemini-3.1-pro": {
18063
18071
  low: "gemini-3.1-pro-low",
@@ -18087,6 +18095,19 @@ var buildModelFromSimple = (modelId, simple) => {
18087
18095
  family: modelId.includes("gemini") ? "gemini" : isClaude ? "claude" : isGpt ? "gpt" : "unknown",
18088
18096
  status: "active",
18089
18097
  release_date: "2026-05-26",
18098
+ // Root-level properties for OpenCode v2 cache compatibility
18099
+ reasoning: simple.reasoning,
18100
+ attachment: simple.attachment,
18101
+ tool_call: simple.toolCall,
18102
+ temperature: true,
18103
+ modalities: {
18104
+ input: [
18105
+ "text",
18106
+ ...simple.attachment ? ["image", "pdf"] : [],
18107
+ ...!isClaude && !isGpt ? ["audio", "video"] : []
18108
+ ],
18109
+ output: ["text"]
18110
+ },
18090
18111
  capabilities: {
18091
18112
  temperature: true,
18092
18113
  reasoning: simple.reasoning,
@@ -18211,18 +18232,42 @@ function resolveModelTier(baseModelId, init) {
18211
18232
  var AgyCLIOAuthPlugin = async ({ client }) => {
18212
18233
  let latestConfig;
18213
18234
  const getModelsList = (provider) => {
18214
- provider.models = provider.models || {};
18215
- for (const [modelId, modelDetails] of Object.entries(STATIC_MODELS)) {
18216
- provider.models[modelId] = {
18235
+ const userModels = provider.models || {};
18236
+ const clonedStaticModels = JSON.parse(JSON.stringify(STATIC_MODELS));
18237
+ const strictModels = {};
18238
+ for (const [modelId, modelDetails] of Object.entries(clonedStaticModels)) {
18239
+ const existing = userModels[modelId] || {};
18240
+ strictModels[modelId] = {
18217
18241
  ...modelDetails,
18218
- ...provider.models[modelId] || {}
18242
+ ...existing,
18243
+ reasoning: existing.reasoning ?? modelDetails.reasoning,
18244
+ attachment: existing.attachment ?? modelDetails.attachment,
18245
+ tool_call: existing.tool_call ?? modelDetails.tool_call,
18246
+ temperature: existing.temperature ?? modelDetails.temperature,
18247
+ modalities: {
18248
+ ...modelDetails.modalities || {},
18249
+ ...existing.modalities || {}
18250
+ },
18251
+ capabilities: {
18252
+ ...modelDetails.capabilities || {},
18253
+ ...existing.capabilities || {},
18254
+ input: {
18255
+ ...modelDetails.capabilities?.input || {},
18256
+ ...existing.capabilities?.input || {}
18257
+ },
18258
+ output: {
18259
+ ...modelDetails.capabilities?.output || {},
18260
+ ...existing.capabilities?.output || {}
18261
+ }
18262
+ }
18219
18263
  };
18220
18264
  }
18265
+ provider.models = strictModels;
18221
18266
  if (latestConfig && latestConfig.provider && latestConfig.provider[AGY_PROVIDER_ID]) {
18222
- latestConfig.provider[AGY_PROVIDER_ID].models = STATIC_MODELS;
18267
+ latestConfig.provider[AGY_PROVIDER_ID].models = provider.models;
18223
18268
  }
18224
18269
  normalizeProviderModelCosts(provider);
18225
- return STATIC_MODELS;
18270
+ return provider.models;
18226
18271
  };
18227
18272
  try {
18228
18273
  initDiskSignatureCache({
@@ -18274,7 +18319,7 @@ var AgyCLIOAuthPlugin = async ({ client }) => {
18274
18319
  models: {},
18275
18320
  ...config2.provider[AGY_PROVIDER_ID]
18276
18321
  };
18277
- config2.provider[AGY_PROVIDER_ID].models = STATIC_MODELS;
18322
+ config2.provider[AGY_PROVIDER_ID].models = getModelsList(config2.provider[AGY_PROVIDER_ID]);
18278
18323
  },
18279
18324
  tool: {
18280
18325
  [AGY_QUOTA_TOOL_NAME]: createAgyQuotaTool({