@carrierllc/mcp 0.13.3 → 0.13.5
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/{chunk-2TVU2GRC.js → chunk-6UPXMY4Q.js} +2 -2
- package/dist/{chunk-2TVU2GRC.js.map → chunk-6UPXMY4Q.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +34 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/storefront/src/app/activate/[orderId]/ActivateClient.tsx +2 -2
- package/templates/storefront/src/components/faq/FaqSection.tsx +2 -2
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
usageOverPeriodParams,
|
|
70
70
|
verifyStorefront,
|
|
71
71
|
withOcsListSummary
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-6UPXMY4Q.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
|
|
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
|
|
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
|
|
9815
|
+
model_id: modelRan ? resolveModelId(ctx.env.BEDROCK_MODEL_ID) : "none",
|
|
9786
9816
|
tier: ctx.props.tier,
|
|
9787
9817
|
usage: routeUsage
|
|
9788
9818
|
});
|