@standardagents/builder 0.17.0-next.1e58032 → 0.17.0

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/runtime.js CHANGED
@@ -195,6 +195,16 @@ function getGoogleFallbackPricing(modelId) {
195
195
  if (prefixMatch) return { ...prefixMatch.pricing, source: "google-static" };
196
196
  return null;
197
197
  }
198
+ function getAnthropicFallbackPricing(modelId) {
199
+ const normalized = normalizeModelId(modelId);
200
+ let best = null;
201
+ for (const entry of ANTHROPIC_MODEL_PRICING_PREFIXES) {
202
+ if (normalized.startsWith(entry.prefix) && (!best || entry.prefix.length > best.prefix.length)) {
203
+ best = entry;
204
+ }
205
+ }
206
+ return best ? { ...best.pricing, source: "anthropic-static" } : null;
207
+ }
198
208
  function getGroqFallbackPricing(modelId) {
199
209
  const pricing = GROQ_MODEL_PRICING[normalizeModelId(modelId)];
200
210
  return pricing ? { ...pricing, source: "groq-static" } : null;
@@ -225,6 +235,9 @@ function resolveModelPricing(modelDef, providerName) {
225
235
  source: "model"
226
236
  };
227
237
  }
238
+ if (providerName === "anthropic") {
239
+ return getAnthropicFallbackPricing(modelDef.model);
240
+ }
228
241
  if (providerName === "cerebras") {
229
242
  return getCerebrasFallbackPricing(modelDef.model);
230
243
  }
@@ -260,10 +273,29 @@ function calculateUsageCost(usage, pricing) {
260
273
  costTotal: roundCost(costInput + costOutput)
261
274
  };
262
275
  }
263
- var TOKENS_PER_MILLION, CEREBRAS_MODEL_PRICING, GOOGLE_MODEL_PRICING, GOOGLE_MODEL_PRICING_PREFIXES, GROQ_MODEL_PRICING, XAI_MODEL_PRICING;
276
+ var TOKENS_PER_MILLION, ANTHROPIC_MODEL_PRICING_PREFIXES, CEREBRAS_MODEL_PRICING, GOOGLE_MODEL_PRICING, GOOGLE_MODEL_PRICING_PREFIXES, GROQ_MODEL_PRICING, XAI_MODEL_PRICING;
264
277
  var init_pricing = __esm({
265
278
  "src/agents/pricing.ts"() {
266
279
  TOKENS_PER_MILLION = 1e6;
280
+ ANTHROPIC_MODEL_PRICING_PREFIXES = [
281
+ { prefix: "claude-fable-5", pricing: { inputPrice: 10, outputPrice: 50, cachedPrice: 1 } },
282
+ { prefix: "claude-mythos", pricing: { inputPrice: 10, outputPrice: 50, cachedPrice: 1 } },
283
+ { prefix: "claude-opus-4-8", pricing: { inputPrice: 5, outputPrice: 25, cachedPrice: 0.5 } },
284
+ { prefix: "claude-opus-4-7", pricing: { inputPrice: 5, outputPrice: 25, cachedPrice: 0.5 } },
285
+ { prefix: "claude-opus-4-6", pricing: { inputPrice: 5, outputPrice: 25, cachedPrice: 0.5 } },
286
+ { prefix: "claude-opus-4-5", pricing: { inputPrice: 5, outputPrice: 25, cachedPrice: 0.5 } },
287
+ { prefix: "claude-opus-4-1", pricing: { inputPrice: 15, outputPrice: 75, cachedPrice: 1.5 } },
288
+ { prefix: "claude-opus-4", pricing: { inputPrice: 15, outputPrice: 75, cachedPrice: 1.5 } },
289
+ { prefix: "claude-sonnet-4-6", pricing: { inputPrice: 3, outputPrice: 15, cachedPrice: 0.3 } },
290
+ { prefix: "claude-sonnet-4-5", pricing: { inputPrice: 3, outputPrice: 15, cachedPrice: 0.3 } },
291
+ { prefix: "claude-sonnet-4", pricing: { inputPrice: 3, outputPrice: 15, cachedPrice: 0.3 } },
292
+ { prefix: "claude-haiku-4-5", pricing: { inputPrice: 1, outputPrice: 5, cachedPrice: 0.1 } },
293
+ { prefix: "claude-3-7-sonnet", pricing: { inputPrice: 3, outputPrice: 15, cachedPrice: 0.3 } },
294
+ { prefix: "claude-3-5-sonnet", pricing: { inputPrice: 3, outputPrice: 15, cachedPrice: 0.3 } },
295
+ { prefix: "claude-3-5-haiku", pricing: { inputPrice: 0.8, outputPrice: 4, cachedPrice: 0.08 } },
296
+ { prefix: "claude-3-opus", pricing: { inputPrice: 15, outputPrice: 75, cachedPrice: 1.5 } },
297
+ { prefix: "claude-3-haiku", pricing: { inputPrice: 0.25, outputPrice: 1.25, cachedPrice: 0.03 } }
298
+ ];
267
299
  CEREBRAS_MODEL_PRICING = {
268
300
  "zai-glm-4.7": {
269
301
  inputPrice: 2.25,