vibezcheck 0.5.11 → 0.5.13

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.
Files changed (58) hide show
  1. package/dist/ai-sdk/index.d.mts +5 -5
  2. package/dist/ai-sdk/index.d.ts +5 -5
  3. package/dist/ai-sdk/index.js +45 -5
  4. package/dist/ai-sdk/index.js.map +1 -1
  5. package/dist/ai-sdk/index.mjs +45 -5
  6. package/dist/ai-sdk/index.mjs.map +1 -1
  7. package/dist/ai-sdk/middleware.d.mts +3 -3
  8. package/dist/ai-sdk/middleware.d.ts +3 -3
  9. package/dist/ai-sdk/middleware.js +37 -3
  10. package/dist/ai-sdk/middleware.js.map +1 -1
  11. package/dist/ai-sdk/middleware.mjs +37 -3
  12. package/dist/ai-sdk/middleware.mjs.map +1 -1
  13. package/dist/billing/index.d.mts +8 -6
  14. package/dist/billing/index.d.ts +8 -6
  15. package/dist/billing/index.js +312 -6
  16. package/dist/billing/index.js.map +1 -1
  17. package/dist/billing/index.mjs +319 -6
  18. package/dist/billing/index.mjs.map +1 -1
  19. package/dist/cli/index.js +8 -1
  20. package/dist/cli/index.js.map +1 -1
  21. package/dist/cli/index.mjs +8 -1
  22. package/dist/cli/index.mjs.map +1 -1
  23. package/dist/{client-eXSwD_kI.d.ts → client-0CuOBECi.d.ts} +1 -1
  24. package/dist/{client-ttJwYM7x.d.mts → client-xP86Qg_b.d.mts} +1 -1
  25. package/dist/customers/index.d.mts +1 -1
  26. package/dist/customers/index.d.ts +1 -1
  27. package/dist/database/index.d.mts +1 -1
  28. package/dist/database/index.d.ts +1 -1
  29. package/dist/index.d.mts +8 -8
  30. package/dist/index.d.ts +8 -8
  31. package/dist/index.js +52 -6
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +52 -6
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/meter/index.d.mts +2 -2
  36. package/dist/meter/index.d.ts +2 -2
  37. package/dist/meter/index.js +35 -2
  38. package/dist/meter/index.js.map +1 -1
  39. package/dist/meter/index.mjs +35 -2
  40. package/dist/meter/index.mjs.map +1 -1
  41. package/dist/pricing/index.d.mts +27 -3
  42. package/dist/pricing/index.d.ts +27 -3
  43. package/dist/pricing/index.js +34 -1
  44. package/dist/pricing/index.js.map +1 -1
  45. package/dist/pricing/index.mjs +34 -1
  46. package/dist/pricing/index.mjs.map +1 -1
  47. package/dist/react/index.d.mts +1 -1
  48. package/dist/react/index.d.ts +1 -1
  49. package/dist/{session-D9fdP255.d.mts → session-CueUIV77.d.mts} +10 -4
  50. package/dist/{session-CUnv_muf.d.ts → session-YF67Yij2.d.ts} +10 -4
  51. package/dist/{types-DHlsaLvI.d.mts → types-CqXTmCNv.d.mts} +2 -0
  52. package/dist/{types-DHlsaLvI.d.ts → types-CqXTmCNv.d.ts} +2 -0
  53. package/dist/{with-billing-DhHGWCAp.d.mts → with-billing-Df6izlJ4.d.mts} +4 -2
  54. package/dist/{with-billing-CVGxl3ot.d.ts → with-billing-DgQ380Zl.d.ts} +4 -2
  55. package/examples/nextjs-app-router-openai/package.json +1 -1
  56. package/examples/nextjs-saas-starter/package.json +1 -1
  57. package/manifest/pricing-v1.json +4904 -974
  58. package/package.json +2 -1
@@ -557,6 +557,10 @@ var MODEL_PRICING_TABLE = {
557
557
  "text-embedding-3-large": { inputPer1M: 0.13, outputPer1M: 0 },
558
558
  "text-embedding-ada-002": { inputPer1M: 0.1, outputPer1M: 0 },
559
559
  // --- Anthropic (Modern & Extended Thinking) ---
560
+ "claude-haiku-5.5": { inputPer1M: 0.1, outputPer1M: 0.5, cachedInputPer1M: 0.01 },
561
+ "claude-sonnet-5.5": { inputPer1M: 2, outputPer1M: 10, cachedInputPer1M: 0.1 },
562
+ "claude-opus-5.5": { inputPer1M: 4, outputPer1M: 20, cachedInputPer1M: 0.2 },
563
+ "claude-opus-5.5-fast": { inputPer1M: 8, outputPer1M: 40, cachedInputPer1M: 0.4 },
560
564
  "claude-3-7-sonnet": { inputPer1M: 0.59, outputPer1M: 2.93, cachedInputPer1M: 0.3 },
561
565
  "claude-sonnet-5": { inputPer1M: 2, outputPer1M: 10, cachedInputPer1M: 0.3 },
562
566
  "claude-3-5-sonnet": { inputPer1M: 3, outputPer1M: 15, cachedInputPer1M: 0.3 },
@@ -571,6 +575,8 @@ var MODEL_PRICING_TABLE = {
571
575
  "claude-2.0": { inputPer1M: 8, outputPer1M: 24 },
572
576
  "claude-instant-1.2": { inputPer1M: 1.63, outputPer1M: 5.51 },
573
577
  // --- Google Gemini (Modern & Thoughts) ---
578
+ "gemini-3.8-flash": { inputPer1M: 0.75, outputPer1M: 3.75, cachedInputPer1M: 0.075 },
579
+ "gemini-nano-banana-2.1": { inputPer1M: 1.5, outputPer1M: 7.5, cachedInputPer1M: 0.15 },
574
580
  "gemini-3.7-flash": { inputPer1M: 0.75, outputPer1M: 3.75, cachedInputPer1M: 0.18 },
575
581
  "gemini-3.1-pro": { inputPer1M: 2, outputPer1M: 12, cachedInputPer1M: 0.5 },
576
582
  "gemini-3.5-flash": { inputPer1M: 1.5, outputPer1M: 9, cachedInputPer1M: 0.38 },
@@ -593,6 +599,7 @@ var MODEL_PRICING_TABLE = {
593
599
  "grok-2-vision": { inputPer1M: 2, outputPer1M: 10 },
594
600
  "grok-beta": { inputPer1M: 5, outputPer1M: 15 },
595
601
  // --- Mistral ---
602
+ "mistral-large-4": { inputPer1M: 0.68, outputPer1M: 2.09, cachedInputPer1M: 0.07 },
596
603
  "mistral-large-3": { inputPer1M: 2, outputPer1M: 6 },
597
604
  "mistral-large-latest": { inputPer1M: 2, outputPer1M: 6 },
598
605
  "mistral-large-2411": { inputPer1M: 2, outputPer1M: 6 },
@@ -674,6 +681,9 @@ var MODEL_ALIASES = {
674
681
  "sonnet-3.5": "claude-3-5-sonnet",
675
682
  "haiku": "claude-3-5-haiku",
676
683
  "haiku-3.5": "claude-3-5-haiku",
684
+ "haiku-5.5": "claude-haiku-5.5",
685
+ "sonnet-5.5": "claude-sonnet-5.5",
686
+ "opus-5.5": "claude-opus-5.5",
677
687
  "opus": "claude-3-opus",
678
688
  "claude-2": "claude-2.0",
679
689
  "claude-instant": "claude-instant-1.2",
@@ -683,6 +693,7 @@ var MODEL_ALIASES = {
683
693
  // Gemini Shorthands
684
694
  "flash": "gemini-2.0-flash",
685
695
  "pro": "gemini-1.5-pro",
696
+ "gemini-banana": "gemini-nano-banana-2.1",
686
697
  // Meta / Groq Shorthands
687
698
  "llama-3.3-70b": "llama-3.3-70b-versatile",
688
699
  "llama-3.1-70b": "llama-3.1-70b-versatile",
@@ -766,7 +777,29 @@ function getModelPricing(modelName) {
766
777
  }
767
778
 
768
779
  // src/pricing/calculator.ts
769
- function calculateCost(params) {
780
+ function calculateCost(modelOrParams, usage, optionsOrMarkup) {
781
+ let params;
782
+ if (typeof modelOrParams === "string") {
783
+ const opts = typeof optionsOrMarkup === "number" ? { markupMultiplier: optionsOrMarkup } : optionsOrMarkup || {};
784
+ params = {
785
+ model: modelOrParams,
786
+ inputTokens: usage?.inputTokens ?? usage?.promptTokens ?? 0,
787
+ outputTokens: usage?.outputTokens ?? usage?.completionTokens ?? 0,
788
+ reasoningTokens: usage?.reasoningTokens,
789
+ cachedTokens: usage?.cachedTokens,
790
+ cacheWriteTokens: usage?.cacheWriteTokens,
791
+ markupMultiplier: opts.markupMultiplier ?? opts.markup ?? opts.margin,
792
+ minimumChargeUSD: opts.minimumChargeUSD,
793
+ customRate: opts.customRate
794
+ };
795
+ } else {
796
+ params = {
797
+ ...modelOrParams,
798
+ inputTokens: modelOrParams.inputTokens ?? modelOrParams.promptTokens ?? 0,
799
+ outputTokens: modelOrParams.outputTokens ?? modelOrParams.completionTokens ?? 0,
800
+ markupMultiplier: modelOrParams.markupMultiplier ?? modelOrParams.markup ?? modelOrParams.margin
801
+ };
802
+ }
770
803
  let rates;
771
804
  if (params.customRate) {
772
805
  const outRate = params.customRate.out ?? params.customRate.output ?? 0;
@@ -1051,7 +1084,7 @@ var VibezMeter = class {
1051
1084
  batcher;
1052
1085
  markupMultiplier;
1053
1086
  constructor(options = {}) {
1054
- this.markupMultiplier = options.pricing?.margin ?? options.markupMultiplier;
1087
+ this.markupMultiplier = options.pricing?.margin ?? options.pricing?.markup ?? options.markupMultiplier;
1055
1088
  this.batcher = new MeterBatcher(options);
1056
1089
  }
1057
1090
  /**
@@ -1243,7 +1276,7 @@ function withBilling(model, optionsOrCustomer, extraOptions = {}) {
1243
1276
  cacheWriteTokens: cacheWriteTokens > 0 ? cacheWriteTokens : void 0
1244
1277
  };
1245
1278
  const cost = calculateUsageCost(modelId, usage, {
1246
- markupMultiplier: options.pricing?.margin,
1279
+ markupMultiplier: options.pricing?.margin ?? options.pricing?.markup,
1247
1280
  minimumChargeUSD: options.pricing?.minimumChargeUSD,
1248
1281
  customRate: options.rate
1249
1282
  });
@@ -1282,6 +1315,7 @@ function withBilling(model, optionsOrCustomer, extraOptions = {}) {
1282
1315
  const mergedMetadata = {
1283
1316
  ...customerMetadata,
1284
1317
  ...options.metadata,
1318
+ ...options.threadId ? { threadId: options.threadId } : {},
1285
1319
  ...extraMeta
1286
1320
  };
1287
1321
  const event = {