@carrierllc/mcp 0.13.4 → 0.13.6

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/cli.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  verifyStorefront,
40
40
  walletScreen,
41
41
  which
42
- } from "./chunk-DUAXD7GD.js";
42
+ } from "./chunk-BIZFEVMT.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ import {
69
69
  usageOverPeriodParams,
70
70
  verifyStorefront,
71
71
  withOcsListSummary
72
- } from "./chunk-DUAXD7GD.js";
72
+ } from "./chunk-BIZFEVMT.js";
73
73
  import "./chunk-SHKKVIIA.js";
74
74
 
75
75
  // src/index.ts
@@ -170,6 +170,36 @@ function estimateCostUsd(u, rates = HAIKU_RATES) {
170
170
  }
171
171
  var DEFAULT_BEDROCK_REGION = "us-east-1";
172
172
  var DEFAULT_MODEL_ID = "us.anthropic.claude-haiku-4-5-20251001-v1:0";
173
+ var RETIRED_HAIKU_MARKERS = [
174
+ "claude-3-haiku",
175
+ "claude-3-5-haiku",
176
+ "claude-haiku-3"
177
+ ];
178
+ function isRetiredHaiku(modelId) {
179
+ const lower = modelId.toLowerCase();
180
+ if (lower.startsWith("arn:")) return false;
181
+ return RETIRED_HAIKU_MARKERS.some((marker) => {
182
+ const shapes = [
183
+ marker,
184
+ `anthropic.${marker}`,
185
+ `us.anthropic.${marker}`,
186
+ `eu.anthropic.${marker}`,
187
+ `global.anthropic.${marker}`
188
+ ];
189
+ return shapes.some((shape) => lower === shape || lower.startsWith(`${shape}-`));
190
+ });
191
+ }
192
+ function resolveModelId(modelId) {
193
+ const trimmed = modelId?.trim() ?? "";
194
+ if (!trimmed) return DEFAULT_MODEL_ID;
195
+ if (isRetiredHaiku(trimmed)) {
196
+ console.warn(
197
+ `BEDROCK_MODEL_ID ${trimmed} is a retired Claude Haiku. Using ${DEFAULT_MODEL_ID}.`
198
+ );
199
+ return DEFAULT_MODEL_ID;
200
+ }
201
+ return trimmed;
202
+ }
173
203
  var BEDROCK_TIMEOUT_MS = 3e4;
174
204
  var MAX_ATTEMPTS = 4;
175
205
  var INITIAL_RETRY_MS = 100;
@@ -210,7 +240,7 @@ function client(creds) {
210
240
  retries: 0
211
241
  }),
212
242
  region,
213
- modelId: creds.modelId ?? DEFAULT_MODEL_ID
243
+ modelId: resolveModelId(creds.modelId)
214
244
  };
215
245
  }
216
246
  function body(req) {
@@ -9738,7 +9768,7 @@ function registerAllCarrierAskTools(server2, ctx) {
9738
9768
  latency_ms: Date.now() - start,
9739
9769
  sub: ctx.props.sub,
9740
9770
  reseller_id: ctx.props.reseller_id,
9741
- model_id: modelRan ? ctx.env.BEDROCK_MODEL_ID ?? DEFAULT_MODEL_ID : "none",
9771
+ model_id: modelRan ? resolveModelId(ctx.env.BEDROCK_MODEL_ID) : "none",
9742
9772
  tier: ctx.props.tier,
9743
9773
  // Not ZERO_USAGE: a call can throw AFTER the model answered, and
9744
9774
  // those tokens were billed regardless. Recording zero here is how
@@ -9782,7 +9812,7 @@ function registerAllCarrierAskTools(server2, ctx) {
9782
9812
  latency_ms: Date.now() - start,
9783
9813
  sub: ctx.props.sub,
9784
9814
  reseller_id: ctx.props.reseller_id,
9785
- model_id: modelRan ? ctx.env.BEDROCK_MODEL_ID ?? DEFAULT_MODEL_ID : "none",
9815
+ model_id: modelRan ? resolveModelId(ctx.env.BEDROCK_MODEL_ID) : "none",
9786
9816
  tier: ctx.props.tier,
9787
9817
  usage: routeUsage
9788
9818
  });