vibezcheck 0.5.4 → 0.5.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/bin/examples.js +8 -0
- package/dist/ai-sdk/index.d.mts +4 -4
- package/dist/ai-sdk/index.d.ts +4 -4
- package/dist/ai-sdk/index.js +4 -2
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/ai-sdk/index.mjs +4 -2
- 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 +4 -2
- package/dist/ai-sdk/middleware.js.map +1 -1
- package/dist/ai-sdk/middleware.mjs +4 -2
- package/dist/ai-sdk/middleware.mjs.map +1 -1
- package/dist/billing/index.d.mts +3 -3
- package/dist/billing/index.d.ts +3 -3
- package/dist/billing/index.js +4 -2
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +4 -2
- package/dist/billing/index.mjs.map +1 -1
- package/dist/cli/index.js +231 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +255 -41
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-CbuXmoXz.d.mts → client-BzwEHQlC.d.mts} +1 -1
- package/dist/{client-BORmJy8s.d.ts → client-CbO6vLUe.d.ts} +1 -1
- package/dist/compat/stripe-meter.d.mts +3 -3
- package/dist/compat/stripe-meter.d.ts +3 -3
- package/dist/compat/stripe-meter.js +4 -2
- package/dist/compat/stripe-meter.js.map +1 -1
- package/dist/compat/stripe-meter.mjs +4 -2
- package/dist/compat/stripe-meter.mjs.map +1 -1
- package/dist/compat/stripe-provider.js +4 -2
- package/dist/compat/stripe-provider.js.map +1 -1
- package/dist/compat/stripe-provider.mjs +4 -2
- package/dist/compat/stripe-provider.mjs.map +1 -1
- package/dist/compat/token-meter.js +4 -2
- package/dist/compat/token-meter.js.map +1 -1
- package/dist/compat/token-meter.mjs +4 -2
- package/dist/compat/token-meter.mjs.map +1 -1
- package/dist/customers/index.d.mts +1 -1
- package/dist/customers/index.d.ts +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- 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 +4 -2
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +4 -2
- package/dist/meter/index.mjs.map +1 -1
- package/dist/pricing/index.d.mts +1 -1
- package/dist/pricing/index.d.ts +1 -1
- package/dist/pricing/index.js +2 -0
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/index.mjs +2 -0
- 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/react/index.js +14 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +14 -0
- package/dist/react/index.mjs.map +1 -1
- package/dist/{types-6P71CXAD.d.mts → types-Btf2OhIr.d.mts} +6 -0
- package/dist/{types-6P71CXAD.d.ts → types-Btf2OhIr.d.ts} +6 -0
- package/dist/{with-billing-DndWGxL8.d.mts → with-billing-BEqiJtCR.d.mts} +2 -2
- package/dist/{with-billing-Bj6Ya_Iy.d.ts → with-billing-D7QRoNHM.d.ts} +2 -2
- package/examples/01-local-cost-meter.ts +63 -0
- package/examples/02-vercel-ai-sdk.ts +43 -0
- package/examples/03-native-openai-stream.ts +40 -0
- package/examples/04-claude-thinking.ts +41 -0
- package/examples/05-reasoning-agent-stream.ts +54 -0
- package/examples/nextjs-app-router-openai/.env.example +5 -0
- package/examples/nextjs-app-router-openai/README.md +29 -0
- package/examples/nextjs-app-router-openai/app/api/chat/route.ts +22 -0
- package/examples/nextjs-app-router-openai/app/globals.css +21 -0
- package/examples/nextjs-app-router-openai/app/layout.tsx +21 -0
- package/examples/nextjs-app-router-openai/app/page.tsx +43 -0
- package/examples/nextjs-app-router-openai/next.config.mjs +7 -0
- package/examples/nextjs-app-router-openai/package.json +31 -0
- package/examples/nextjs-app-router-openai/postcss.config.mjs +9 -0
- package/examples/nextjs-app-router-openai/tailwind.config.ts +13 -0
- package/examples/nextjs-app-router-openai/tsconfig.json +27 -0
- package/examples/nextjs-saas-starter/README.md +29 -0
- package/examples/nextjs-saas-starter/app/api/chat/route.ts +65 -0
- package/examples/nextjs-saas-starter/app/api/checkout/route.ts +51 -0
- package/examples/nextjs-saas-starter/app/globals.css +14 -0
- package/examples/nextjs-saas-starter/app/layout.tsx +24 -0
- package/examples/nextjs-saas-starter/app/page.tsx +326 -0
- package/examples/nextjs-saas-starter/next.config.mjs +7 -0
- package/examples/nextjs-saas-starter/package.json +34 -0
- package/examples/nextjs-saas-starter/postcss.config.mjs +9 -0
- package/examples/nextjs-saas-starter/tailwind.config.ts +20 -0
- package/examples/nextjs-saas-starter/tsconfig.json +27 -0
- package/package.json +5 -3
package/bin/examples.js
ADDED
package/dist/ai-sdk/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as WithBillingOptions } from '../with-billing-
|
|
2
|
-
export { m as meteredModel, w as withBilling } from '../with-billing-
|
|
3
|
-
import { C as CustomerParam } from '../types-
|
|
4
|
-
import { V as VibezMeter } from '../client-
|
|
1
|
+
import { W as WithBillingOptions } from '../with-billing-BEqiJtCR.mjs';
|
|
2
|
+
export { m as meteredModel, w as withBilling } from '../with-billing-BEqiJtCR.mjs';
|
|
3
|
+
import { C as CustomerParam } from '../types-Btf2OhIr.mjs';
|
|
4
|
+
import { V as VibezMeter } from '../client-BzwEHQlC.mjs';
|
|
5
5
|
import 'stripe';
|
|
6
6
|
|
|
7
7
|
interface VibezCheckModelOptions extends WithBillingOptions {
|
package/dist/ai-sdk/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as WithBillingOptions } from '../with-billing-
|
|
2
|
-
export { m as meteredModel, w as withBilling } from '../with-billing-
|
|
3
|
-
import { C as CustomerParam } from '../types-
|
|
4
|
-
import { V as VibezMeter } from '../client-
|
|
1
|
+
import { W as WithBillingOptions } from '../with-billing-D7QRoNHM.js';
|
|
2
|
+
export { m as meteredModel, w as withBilling } from '../with-billing-D7QRoNHM.js';
|
|
3
|
+
import { C as CustomerParam } from '../types-Btf2OhIr.js';
|
|
4
|
+
import { V as VibezMeter } from '../client-CbO6vLUe.js';
|
|
5
5
|
import 'stripe';
|
|
6
6
|
|
|
7
7
|
interface VibezCheckModelOptions extends WithBillingOptions {
|
package/dist/ai-sdk/index.js
CHANGED
|
@@ -844,8 +844,10 @@ function calculateCost(params) {
|
|
|
844
844
|
outputCostUSD: Number(outputCostUSD.toFixed(8)),
|
|
845
845
|
reasoningCostUSD: reasoningTokens > 0n ? Number(reasoningCostUSD.toFixed(8)) : void 0,
|
|
846
846
|
cachedDiscountUSD: cachedTokens > 0n ? Number(cachedDiscountUSD.toFixed(8)) : void 0,
|
|
847
|
+
savingsUSD: cachedTokens > 0n ? Number(cachedDiscountUSD.toFixed(8)) : void 0,
|
|
847
848
|
totalUSD: Number(totalUSD.toFixed(8)),
|
|
848
849
|
wholesaleTotalUSD: Number(wholesaleTotalUSD.toFixed(8)),
|
|
850
|
+
wholesaleUSD: Number(wholesaleTotalUSD.toFixed(8)),
|
|
849
851
|
billedUSD: Number(billedUSD.toFixed(8)),
|
|
850
852
|
profitUSD: Number(profitUSD.toFixed(8)),
|
|
851
853
|
retailUSD: retailUSD !== void 0 ? Number(retailUSD.toFixed(8)) : void 0,
|
|
@@ -1067,7 +1069,7 @@ var VibezMeter = class {
|
|
|
1067
1069
|
stripeClient;
|
|
1068
1070
|
markupMultiplier;
|
|
1069
1071
|
constructor(options = {}) {
|
|
1070
|
-
this.markupMultiplier = options.markupMultiplier;
|
|
1072
|
+
this.markupMultiplier = options.pricing?.margin ?? options.markupMultiplier;
|
|
1071
1073
|
if (options.stripe) {
|
|
1072
1074
|
this.stripeClient = options.stripe;
|
|
1073
1075
|
} else if (options.apiKey || process.env.STRIPE_SECRET_KEY) {
|
|
@@ -1075,7 +1077,7 @@ var VibezMeter = class {
|
|
|
1075
1077
|
this.stripeClient = new import_stripe.default(key, {
|
|
1076
1078
|
appInfo: {
|
|
1077
1079
|
name: "vibezcheck",
|
|
1078
|
-
version: "0.5.
|
|
1080
|
+
version: "0.5.5",
|
|
1079
1081
|
url: "https://vibezcheck.xyz"
|
|
1080
1082
|
}
|
|
1081
1083
|
});
|