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.
- package/dist/ai-sdk/index.d.mts +5 -5
- package/dist/ai-sdk/index.d.ts +5 -5
- package/dist/ai-sdk/index.js +45 -5
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/ai-sdk/index.mjs +45 -5
- package/dist/ai-sdk/index.mjs.map +1 -1
- package/dist/ai-sdk/middleware.d.mts +3 -3
- package/dist/ai-sdk/middleware.d.ts +3 -3
- package/dist/ai-sdk/middleware.js +37 -3
- package/dist/ai-sdk/middleware.js.map +1 -1
- package/dist/ai-sdk/middleware.mjs +37 -3
- package/dist/ai-sdk/middleware.mjs.map +1 -1
- package/dist/billing/index.d.mts +8 -6
- package/dist/billing/index.d.ts +8 -6
- package/dist/billing/index.js +312 -6
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +319 -6
- package/dist/billing/index.mjs.map +1 -1
- package/dist/cli/index.js +8 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +8 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-eXSwD_kI.d.ts → client-0CuOBECi.d.ts} +1 -1
- package/dist/{client-ttJwYM7x.d.mts → client-xP86Qg_b.d.mts} +1 -1
- package/dist/customers/index.d.mts +1 -1
- package/dist/customers/index.d.ts +1 -1
- package/dist/database/index.d.mts +1 -1
- package/dist/database/index.d.ts +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +52 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -6
- package/dist/index.mjs.map +1 -1
- package/dist/meter/index.d.mts +2 -2
- package/dist/meter/index.d.ts +2 -2
- package/dist/meter/index.js +35 -2
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +35 -2
- package/dist/meter/index.mjs.map +1 -1
- package/dist/pricing/index.d.mts +27 -3
- package/dist/pricing/index.d.ts +27 -3
- package/dist/pricing/index.js +34 -1
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/index.mjs +34 -1
- package/dist/pricing/index.mjs.map +1 -1
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/{session-D9fdP255.d.mts → session-CueUIV77.d.mts} +10 -4
- package/dist/{session-CUnv_muf.d.ts → session-YF67Yij2.d.ts} +10 -4
- package/dist/{types-DHlsaLvI.d.mts → types-CqXTmCNv.d.mts} +2 -0
- package/dist/{types-DHlsaLvI.d.ts → types-CqXTmCNv.d.ts} +2 -0
- package/dist/{with-billing-DhHGWCAp.d.mts → with-billing-Df6izlJ4.d.mts} +4 -2
- package/dist/{with-billing-CVGxl3ot.d.ts → with-billing-DgQ380Zl.d.ts} +4 -2
- package/examples/nextjs-app-router-openai/package.json +1 -1
- package/examples/nextjs-saas-starter/package.json +1 -1
- package/manifest/pricing-v1.json +4904 -974
- package/package.json +2 -1
package/dist/meter/index.mjs
CHANGED
|
@@ -547,6 +547,10 @@ var MODEL_PRICING_TABLE = {
|
|
|
547
547
|
"text-embedding-3-large": { inputPer1M: 0.13, outputPer1M: 0 },
|
|
548
548
|
"text-embedding-ada-002": { inputPer1M: 0.1, outputPer1M: 0 },
|
|
549
549
|
// --- Anthropic (Modern & Extended Thinking) ---
|
|
550
|
+
"claude-haiku-5.5": { inputPer1M: 0.1, outputPer1M: 0.5, cachedInputPer1M: 0.01 },
|
|
551
|
+
"claude-sonnet-5.5": { inputPer1M: 2, outputPer1M: 10, cachedInputPer1M: 0.1 },
|
|
552
|
+
"claude-opus-5.5": { inputPer1M: 4, outputPer1M: 20, cachedInputPer1M: 0.2 },
|
|
553
|
+
"claude-opus-5.5-fast": { inputPer1M: 8, outputPer1M: 40, cachedInputPer1M: 0.4 },
|
|
550
554
|
"claude-3-7-sonnet": { inputPer1M: 0.59, outputPer1M: 2.93, cachedInputPer1M: 0.3 },
|
|
551
555
|
"claude-sonnet-5": { inputPer1M: 2, outputPer1M: 10, cachedInputPer1M: 0.3 },
|
|
552
556
|
"claude-3-5-sonnet": { inputPer1M: 3, outputPer1M: 15, cachedInputPer1M: 0.3 },
|
|
@@ -561,6 +565,8 @@ var MODEL_PRICING_TABLE = {
|
|
|
561
565
|
"claude-2.0": { inputPer1M: 8, outputPer1M: 24 },
|
|
562
566
|
"claude-instant-1.2": { inputPer1M: 1.63, outputPer1M: 5.51 },
|
|
563
567
|
// --- Google Gemini (Modern & Thoughts) ---
|
|
568
|
+
"gemini-3.8-flash": { inputPer1M: 0.75, outputPer1M: 3.75, cachedInputPer1M: 0.075 },
|
|
569
|
+
"gemini-nano-banana-2.1": { inputPer1M: 1.5, outputPer1M: 7.5, cachedInputPer1M: 0.15 },
|
|
564
570
|
"gemini-3.7-flash": { inputPer1M: 0.75, outputPer1M: 3.75, cachedInputPer1M: 0.18 },
|
|
565
571
|
"gemini-3.1-pro": { inputPer1M: 2, outputPer1M: 12, cachedInputPer1M: 0.5 },
|
|
566
572
|
"gemini-3.5-flash": { inputPer1M: 1.5, outputPer1M: 9, cachedInputPer1M: 0.38 },
|
|
@@ -583,6 +589,7 @@ var MODEL_PRICING_TABLE = {
|
|
|
583
589
|
"grok-2-vision": { inputPer1M: 2, outputPer1M: 10 },
|
|
584
590
|
"grok-beta": { inputPer1M: 5, outputPer1M: 15 },
|
|
585
591
|
// --- Mistral ---
|
|
592
|
+
"mistral-large-4": { inputPer1M: 0.68, outputPer1M: 2.09, cachedInputPer1M: 0.07 },
|
|
586
593
|
"mistral-large-3": { inputPer1M: 2, outputPer1M: 6 },
|
|
587
594
|
"mistral-large-latest": { inputPer1M: 2, outputPer1M: 6 },
|
|
588
595
|
"mistral-large-2411": { inputPer1M: 2, outputPer1M: 6 },
|
|
@@ -664,6 +671,9 @@ var MODEL_ALIASES = {
|
|
|
664
671
|
"sonnet-3.5": "claude-3-5-sonnet",
|
|
665
672
|
"haiku": "claude-3-5-haiku",
|
|
666
673
|
"haiku-3.5": "claude-3-5-haiku",
|
|
674
|
+
"haiku-5.5": "claude-haiku-5.5",
|
|
675
|
+
"sonnet-5.5": "claude-sonnet-5.5",
|
|
676
|
+
"opus-5.5": "claude-opus-5.5",
|
|
667
677
|
"opus": "claude-3-opus",
|
|
668
678
|
"claude-2": "claude-2.0",
|
|
669
679
|
"claude-instant": "claude-instant-1.2",
|
|
@@ -673,6 +683,7 @@ var MODEL_ALIASES = {
|
|
|
673
683
|
// Gemini Shorthands
|
|
674
684
|
"flash": "gemini-2.0-flash",
|
|
675
685
|
"pro": "gemini-1.5-pro",
|
|
686
|
+
"gemini-banana": "gemini-nano-banana-2.1",
|
|
676
687
|
// Meta / Groq Shorthands
|
|
677
688
|
"llama-3.3-70b": "llama-3.3-70b-versatile",
|
|
678
689
|
"llama-3.1-70b": "llama-3.1-70b-versatile",
|
|
@@ -756,7 +767,29 @@ function getModelPricing(modelName) {
|
|
|
756
767
|
}
|
|
757
768
|
|
|
758
769
|
// src/pricing/calculator.ts
|
|
759
|
-
function calculateCost(
|
|
770
|
+
function calculateCost(modelOrParams, usage, optionsOrMarkup) {
|
|
771
|
+
let params;
|
|
772
|
+
if (typeof modelOrParams === "string") {
|
|
773
|
+
const opts = typeof optionsOrMarkup === "number" ? { markupMultiplier: optionsOrMarkup } : optionsOrMarkup || {};
|
|
774
|
+
params = {
|
|
775
|
+
model: modelOrParams,
|
|
776
|
+
inputTokens: usage?.inputTokens ?? usage?.promptTokens ?? 0,
|
|
777
|
+
outputTokens: usage?.outputTokens ?? usage?.completionTokens ?? 0,
|
|
778
|
+
reasoningTokens: usage?.reasoningTokens,
|
|
779
|
+
cachedTokens: usage?.cachedTokens,
|
|
780
|
+
cacheWriteTokens: usage?.cacheWriteTokens,
|
|
781
|
+
markupMultiplier: opts.markupMultiplier ?? opts.markup ?? opts.margin,
|
|
782
|
+
minimumChargeUSD: opts.minimumChargeUSD,
|
|
783
|
+
customRate: opts.customRate
|
|
784
|
+
};
|
|
785
|
+
} else {
|
|
786
|
+
params = {
|
|
787
|
+
...modelOrParams,
|
|
788
|
+
inputTokens: modelOrParams.inputTokens ?? modelOrParams.promptTokens ?? 0,
|
|
789
|
+
outputTokens: modelOrParams.outputTokens ?? modelOrParams.completionTokens ?? 0,
|
|
790
|
+
markupMultiplier: modelOrParams.markupMultiplier ?? modelOrParams.markup ?? modelOrParams.margin
|
|
791
|
+
};
|
|
792
|
+
}
|
|
760
793
|
let rates;
|
|
761
794
|
if (params.customRate) {
|
|
762
795
|
const outRate = params.customRate.out ?? params.customRate.output ?? 0;
|
|
@@ -1041,7 +1074,7 @@ var VibezMeter = class {
|
|
|
1041
1074
|
batcher;
|
|
1042
1075
|
markupMultiplier;
|
|
1043
1076
|
constructor(options = {}) {
|
|
1044
|
-
this.markupMultiplier = options.pricing?.margin ?? options.markupMultiplier;
|
|
1077
|
+
this.markupMultiplier = options.pricing?.margin ?? options.pricing?.markup ?? options.markupMultiplier;
|
|
1045
1078
|
this.batcher = new MeterBatcher(options);
|
|
1046
1079
|
}
|
|
1047
1080
|
/**
|