@gitlab/gitlab-ai-provider 3.0.9 → 3.1.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.mjs CHANGED
@@ -699,6 +699,16 @@ var GitLabOAuthManager = class {
699
699
  }
700
700
  };
701
701
 
702
+ // src/model-mappings.ts
703
+ var MODEL_ID_TO_ANTHROPIC_MODEL = {
704
+ "duo-chat-opus-4-5": "claude-opus-4-5-20251101",
705
+ "duo-chat-sonnet-4-5": "claude-sonnet-4-5-20250929",
706
+ "duo-chat-haiku-4-5": "claude-haiku-4-5-20251001"
707
+ };
708
+ function getAnthropicModelForModelId(modelId) {
709
+ return MODEL_ID_TO_ANTHROPIC_MODEL[modelId];
710
+ }
711
+
702
712
  // src/gitlab-provider.ts
703
713
  import * as fs from "fs";
704
714
  import * as path from "path";
@@ -845,7 +855,7 @@ function createGitLab(options = {}) {
845
855
  getHeaders,
846
856
  refreshApiKey,
847
857
  fetch: options.fetch,
848
- anthropicModel: agenticOptions?.anthropicModel,
858
+ anthropicModel: agenticOptions?.anthropicModel ?? getAnthropicModelForModelId(modelId),
849
859
  maxTokens: agenticOptions?.maxTokens,
850
860
  featureFlags
851
861
  });
@@ -2341,9 +2351,11 @@ export {
2341
2351
  GitLabOAuthManager,
2342
2352
  GitLabProjectCache,
2343
2353
  GitLabProjectDetector,
2354
+ MODEL_ID_TO_ANTHROPIC_MODEL,
2344
2355
  OAUTH_SCOPES,
2345
2356
  TOKEN_EXPIRY_SKEW_MS,
2346
2357
  createGitLab,
2358
+ getAnthropicModelForModelId,
2347
2359
  gitlab,
2348
2360
  isGitLabApiTool
2349
2361
  };