vibezcheck 0.4.2 → 0.5.3
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/LICENSE +21 -21
- package/README.md +249 -273
- package/bin/vibezcheck.js +4 -4
- package/dist/ai-sdk/index.d.mts +28 -59
- package/dist/ai-sdk/index.d.ts +28 -59
- package/dist/ai-sdk/index.js +307 -69
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/ai-sdk/index.mjs +307 -69
- package/dist/ai-sdk/index.mjs.map +1 -1
- package/dist/ai-sdk/middleware.d.mts +15 -0
- package/dist/ai-sdk/middleware.d.ts +15 -0
- package/dist/ai-sdk/middleware.js +1433 -0
- package/dist/ai-sdk/middleware.js.map +1 -0
- package/dist/ai-sdk/middleware.mjs +1396 -0
- package/dist/ai-sdk/middleware.mjs.map +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs.map +1 -1
- package/dist/billing/index.d.mts +90 -1
- package/dist/billing/index.d.ts +90 -1
- package/dist/billing/index.js +1542 -2
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +1537 -1
- package/dist/billing/index.mjs.map +1 -1
- package/dist/cli/index.js +59 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +59 -7
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{client-ynfWcHX6.d.ts → client-BORmJy8s.d.ts} +1 -1
- package/dist/{client-w_hWhQ6g.d.mts → client-CbuXmoXz.d.mts} +1 -1
- package/dist/compat/stripe-meter.d.mts +21 -0
- package/dist/compat/stripe-meter.d.ts +21 -0
- package/dist/compat/stripe-meter.js +1451 -0
- package/dist/compat/stripe-meter.js.map +1 -0
- package/dist/compat/stripe-meter.mjs +1414 -0
- package/dist/compat/stripe-meter.mjs.map +1 -0
- package/dist/compat/stripe-provider.d.mts +34 -0
- package/dist/compat/stripe-provider.d.ts +34 -0
- package/dist/compat/stripe-provider.js +1620 -0
- package/dist/compat/stripe-provider.js.map +1 -0
- package/dist/compat/stripe-provider.mjs +1587 -0
- package/dist/compat/stripe-provider.mjs.map +1 -0
- package/dist/compat/token-meter.d.mts +28 -0
- package/dist/compat/token-meter.d.ts +28 -0
- package/dist/compat/token-meter.js +1320 -0
- package/dist/compat/token-meter.js.map +1 -0
- package/dist/compat/token-meter.mjs +1283 -0
- package/dist/compat/token-meter.mjs.map +1 -0
- package/dist/customers/index.d.mts +1 -1
- package/dist/customers/index.d.ts +1 -1
- package/dist/customers/index.js.map +1 -1
- package/dist/customers/index.mjs.map +1 -1
- package/dist/index.d.mts +25 -11
- package/dist/index.d.ts +25 -11
- package/dist/index.js +810 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +798 -72
- 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 +176 -42
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +176 -42
- package/dist/meter/index.mjs.map +1 -1
- package/dist/pricing/index.d.mts +15 -4
- package/dist/pricing/index.d.ts +15 -4
- package/dist/pricing/index.js +165 -29
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/index.mjs +164 -29
- package/dist/pricing/index.mjs.map +1 -1
- package/dist/react/index.d.mts +46 -2
- package/dist/react/index.d.ts +46 -2
- package/dist/react/index.js +471 -29
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +469 -29
- package/dist/react/index.mjs.map +1 -1
- package/dist/{types-Mozk4-Mr.d.mts → types-6P71CXAD.d.mts} +16 -6
- package/dist/{types-Mozk4-Mr.d.ts → types-6P71CXAD.d.ts} +16 -6
- package/dist/with-billing-Bj6Ya_Iy.d.ts +49 -0
- package/dist/with-billing-DndWGxL8.d.mts +49 -0
- package/package.json +35 -10
package/dist/react/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { createContext, useState, useEffect, useCallback, useMemo } from "react"
|
|
|
3
3
|
|
|
4
4
|
// src/pricing/table.ts
|
|
5
5
|
var MODEL_PRICING_TABLE = {
|
|
6
|
-
// --- OpenAI ---
|
|
6
|
+
// --- OpenAI (Modern & Reasoning) ---
|
|
7
7
|
"gpt-5.6-sol": { inputPer1M: 4, outputPer1M: 20, cachedInputPer1M: 0.4 },
|
|
8
8
|
"gpt-5.6-terra": { inputPer1M: 2, outputPer1M: 12, cachedInputPer1M: 0.2 },
|
|
9
9
|
"gpt-5.6-luna": { inputPer1M: 0.2, outputPer1M: 1.2, cachedInputPer1M: 0.02 },
|
|
@@ -15,11 +15,22 @@ var MODEL_PRICING_TABLE = {
|
|
|
15
15
|
"o3-mini": { inputPer1M: 1.1, outputPer1M: 4.4, cachedInputPer1M: 0.55 },
|
|
16
16
|
"gpt-4o": { inputPer1M: 2.5, outputPer1M: 10, cachedInputPer1M: 1.25 },
|
|
17
17
|
"gpt-4o-mini": { inputPer1M: 0.15, outputPer1M: 0.6, cachedInputPer1M: 0.075 },
|
|
18
|
+
"gpt-4.5": { inputPer1M: 75, outputPer1M: 150, cachedInputPer1M: 37.5 },
|
|
19
|
+
"gpt-4.5-preview": { inputPer1M: 75, outputPer1M: 150, cachedInputPer1M: 37.5 },
|
|
20
|
+
"chatgpt-4o-latest": { inputPer1M: 5, outputPer1M: 15 },
|
|
18
21
|
"gpt-4.1": { inputPer1M: 2, outputPer1M: 8, cachedInputPer1M: 1 },
|
|
19
22
|
"gpt-4.1-nano": { inputPer1M: 0.1, outputPer1M: 0.4, cachedInputPer1M: 0.05 },
|
|
23
|
+
// --- OpenAI (Legacy & Backward Compatibility) ---
|
|
24
|
+
"gpt-4-turbo": { inputPer1M: 10, outputPer1M: 30, cachedInputPer1M: 5 },
|
|
25
|
+
"gpt-4-turbo-preview": { inputPer1M: 10, outputPer1M: 30, cachedInputPer1M: 5 },
|
|
26
|
+
"gpt-4": { inputPer1M: 30, outputPer1M: 60 },
|
|
27
|
+
"gpt-4-32k": { inputPer1M: 60, outputPer1M: 120 },
|
|
28
|
+
"gpt-3.5-turbo": { inputPer1M: 0.5, outputPer1M: 1.5 },
|
|
29
|
+
"gpt-3.5-turbo-16k": { inputPer1M: 3, outputPer1M: 4 },
|
|
20
30
|
"text-embedding-3-small": { inputPer1M: 0.02, outputPer1M: 0 },
|
|
21
31
|
"text-embedding-3-large": { inputPer1M: 0.13, outputPer1M: 0 },
|
|
22
|
-
|
|
32
|
+
"text-embedding-ada-002": { inputPer1M: 0.1, outputPer1M: 0 },
|
|
33
|
+
// --- Anthropic (Modern & Extended Thinking) ---
|
|
23
34
|
"claude-3-7-sonnet": { inputPer1M: 0.59, outputPer1M: 2.93, cachedInputPer1M: 0.3 },
|
|
24
35
|
"claude-sonnet-5": { inputPer1M: 2, outputPer1M: 10, cachedInputPer1M: 0.3 },
|
|
25
36
|
"claude-3-5-sonnet": { inputPer1M: 3, outputPer1M: 15, cachedInputPer1M: 0.3 },
|
|
@@ -27,48 +38,145 @@ var MODEL_PRICING_TABLE = {
|
|
|
27
38
|
"haiku-4.5": { inputPer1M: 1, outputPer1M: 5, cachedInputPer1M: 0.1 },
|
|
28
39
|
"claude-opus-5": { inputPer1M: 5, outputPer1M: 25, cachedInputPer1M: 1.5 },
|
|
29
40
|
"claude-3-opus": { inputPer1M: 15, outputPer1M: 75, cachedInputPer1M: 1.5 },
|
|
30
|
-
// ---
|
|
41
|
+
// --- Anthropic (Legacy & Backward Compatibility) ---
|
|
42
|
+
"claude-3-sonnet": { inputPer1M: 3, outputPer1M: 15, cachedInputPer1M: 0.3 },
|
|
43
|
+
"claude-3-haiku": { inputPer1M: 0.25, outputPer1M: 1.25, cachedInputPer1M: 0.025 },
|
|
44
|
+
"claude-2.1": { inputPer1M: 8, outputPer1M: 24 },
|
|
45
|
+
"claude-2.0": { inputPer1M: 8, outputPer1M: 24 },
|
|
46
|
+
"claude-instant-1.2": { inputPer1M: 1.63, outputPer1M: 5.51 },
|
|
47
|
+
// --- Google Gemini (Modern & Thoughts) ---
|
|
31
48
|
"gemini-3.7-flash": { inputPer1M: 0.75, outputPer1M: 3.75, cachedInputPer1M: 0.18 },
|
|
32
49
|
"gemini-3.1-pro": { inputPer1M: 2, outputPer1M: 12, cachedInputPer1M: 0.5 },
|
|
33
50
|
"gemini-3.5-flash": { inputPer1M: 1.5, outputPer1M: 9, cachedInputPer1M: 0.38 },
|
|
34
51
|
"gemini-3.1-flash-lite": { inputPer1M: 0.25, outputPer1M: 1.5, cachedInputPer1M: 0.06 },
|
|
52
|
+
"gemini-2.5-pro": { inputPer1M: 1.25, outputPer1M: 5, cachedInputPer1M: 0.3125 },
|
|
53
|
+
"gemini-2.5-flash": { inputPer1M: 0.15, outputPer1M: 0.6, cachedInputPer1M: 0.0375 },
|
|
35
54
|
"gemini-2.0-flash": { inputPer1M: 0.1, outputPer1M: 0.4, cachedInputPer1M: 0.025 },
|
|
55
|
+
"gemini-2.0-flash-lite": { inputPer1M: 0.075, outputPer1M: 0.3, cachedInputPer1M: 0.01875 },
|
|
56
|
+
"gemini-2.0-pro": { inputPer1M: 1.25, outputPer1M: 5, cachedInputPer1M: 0.3125 },
|
|
57
|
+
// --- Google Gemini (Legacy & Backward Compatibility) ---
|
|
36
58
|
"gemini-1.5-pro": { inputPer1M: 1.25, outputPer1M: 5, cachedInputPer1M: 0.3125 },
|
|
37
59
|
"gemini-1.5-flash": { inputPer1M: 0.075, outputPer1M: 0.3, cachedInputPer1M: 0.01875 },
|
|
60
|
+
"gemini-1.5-flash-8b": { inputPer1M: 0.0375, outputPer1M: 0.15, cachedInputPer1M: 9375e-6 },
|
|
61
|
+
"gemini-1.0-pro": { inputPer1M: 0.5, outputPer1M: 1.5 },
|
|
38
62
|
// --- xAI Grok ---
|
|
39
63
|
"grok-4.6": { inputPer1M: 3, outputPer1M: 15 },
|
|
64
|
+
"grok-3": { inputPer1M: 3, outputPer1M: 15 },
|
|
65
|
+
"grok-3-mini": { inputPer1M: 0.3, outputPer1M: 1.5 },
|
|
40
66
|
"grok-2": { inputPer1M: 2, outputPer1M: 10 },
|
|
41
67
|
"grok-2-vision": { inputPer1M: 2, outputPer1M: 10 },
|
|
42
68
|
"grok-beta": { inputPer1M: 5, outputPer1M: 15 },
|
|
43
69
|
// --- Mistral ---
|
|
44
70
|
"mistral-large-3": { inputPer1M: 2, outputPer1M: 6 },
|
|
45
71
|
"mistral-large-latest": { inputPer1M: 2, outputPer1M: 6 },
|
|
72
|
+
"mistral-large-2411": { inputPer1M: 2, outputPer1M: 6 },
|
|
46
73
|
"codestral-latest": { inputPer1M: 0.3, outputPer1M: 0.9 },
|
|
74
|
+
"mistral-medium-latest": { inputPer1M: 2.7, outputPer1M: 8.1 },
|
|
47
75
|
"mistral-small-latest": { inputPer1M: 0.2, outputPer1M: 0.6 },
|
|
48
76
|
"ministral-8b-latest": { inputPer1M: 0.1, outputPer1M: 0.1 },
|
|
49
|
-
|
|
77
|
+
"ministral-3b-latest": { inputPer1M: 0.04, outputPer1M: 0.04 },
|
|
78
|
+
"open-mistral-7b": { inputPer1M: 0.2, outputPer1M: 0.2 },
|
|
79
|
+
"open-mixtral-8x7b": { inputPer1M: 0.7, outputPer1M: 0.7 },
|
|
80
|
+
"open-mixtral-8x22b": { inputPer1M: 2, outputPer1M: 6 },
|
|
81
|
+
// --- Groq & Meta Llama LPUs ---
|
|
50
82
|
"llama-3.3-70b-versatile": { inputPer1M: 0.59, outputPer1M: 0.79 },
|
|
83
|
+
"llama-3.1-405b": { inputPer1M: 3, outputPer1M: 3 },
|
|
84
|
+
"llama-3.1-70b-versatile": { inputPer1M: 0.59, outputPer1M: 0.79 },
|
|
51
85
|
"llama-3.1-8b-instant": { inputPer1M: 0.05, outputPer1M: 0.08 },
|
|
86
|
+
"llama-3.2-1b-preview": { inputPer1M: 0.04, outputPer1M: 0.04 },
|
|
87
|
+
"llama-3.2-3b-preview": { inputPer1M: 0.06, outputPer1M: 0.06 },
|
|
88
|
+
"llama-3.2-11b-vision": { inputPer1M: 0.18, outputPer1M: 0.18 },
|
|
89
|
+
"llama-3.2-90b-vision": { inputPer1M: 0.9, outputPer1M: 0.9 },
|
|
52
90
|
"deepseek-r1-distill-llama-70b": { inputPer1M: 0.75, outputPer1M: 0.99 },
|
|
91
|
+
"deepseek-r1-distill-qwen-32b": { inputPer1M: 0.49, outputPer1M: 0.49 },
|
|
53
92
|
"qwen-2.5-32b": { inputPer1M: 0.29, outputPer1M: 0.39 },
|
|
93
|
+
"qwen-2.5-72b": { inputPer1M: 0.35, outputPer1M: 0.4 },
|
|
94
|
+
"mixtral-8x7b-32768": { inputPer1M: 0.24, outputPer1M: 0.24 },
|
|
95
|
+
"gemma2-9b-it": { inputPer1M: 0.2, outputPer1M: 0.2 },
|
|
54
96
|
// --- DeepSeek ---
|
|
55
97
|
"deepseek-v4-pro": { inputPer1M: 0.66, outputPer1M: 1.98, cachedInputPer1M: 0.15 },
|
|
56
98
|
"deepseek-v4-flash": { inputPer1M: 0.22, outputPer1M: 0.66, cachedInputPer1M: 0.05 },
|
|
57
|
-
"deepseek-
|
|
58
|
-
"deepseek-
|
|
99
|
+
"deepseek-v3": { inputPer1M: 0.14, outputPer1M: 0.28, cachedInputPer1M: 0.014 },
|
|
100
|
+
"deepseek-chat": { inputPer1M: 0.14, outputPer1M: 0.28, cachedInputPer1M: 0.014 },
|
|
101
|
+
"deepseek-r1": { inputPer1M: 0.55, outputPer1M: 2.19, cachedInputPer1M: 0.14 },
|
|
102
|
+
"deepseek-reasoner": { inputPer1M: 0.55, outputPer1M: 2.19, cachedInputPer1M: 0.14 },
|
|
59
103
|
// --- Cohere ---
|
|
60
104
|
"command-r-plus": { inputPer1M: 2.5, outputPer1M: 10 },
|
|
61
|
-
"command-r": { inputPer1M: 0.15, outputPer1M: 0.6 }
|
|
105
|
+
"command-r": { inputPer1M: 0.15, outputPer1M: 0.6 },
|
|
106
|
+
"command": { inputPer1M: 1, outputPer1M: 2 },
|
|
107
|
+
"command-light": { inputPer1M: 0.3, outputPer1M: 0.6 },
|
|
108
|
+
"embed-english-v3.0": { inputPer1M: 0.1, outputPer1M: 0 },
|
|
109
|
+
// --- Perplexity ---
|
|
110
|
+
"sonar": { inputPer1M: 1, outputPer1M: 1 },
|
|
111
|
+
"sonar-pro": { inputPer1M: 3, outputPer1M: 15 },
|
|
112
|
+
"sonar-reasoning": { inputPer1M: 1, outputPer1M: 5 },
|
|
113
|
+
"sonar-reasoning-pro": { inputPer1M: 2, outputPer1M: 8 }
|
|
114
|
+
};
|
|
115
|
+
var MODEL_ALIASES = {
|
|
116
|
+
// OpenAI Shorthands & Aliases
|
|
117
|
+
"gpt4": "gpt-4",
|
|
118
|
+
"gpt4o": "gpt-4o",
|
|
119
|
+
"gpt-4-preview": "gpt-4-turbo",
|
|
120
|
+
"gpt-4-0125-preview": "gpt-4-turbo",
|
|
121
|
+
"gpt-4-1106-preview": "gpt-4-turbo",
|
|
122
|
+
"gpt-3.5": "gpt-3.5-turbo",
|
|
123
|
+
"gpt-3.5-turbo-0125": "gpt-3.5-turbo",
|
|
124
|
+
"gpt-3.5-turbo-1106": "gpt-3.5-turbo",
|
|
125
|
+
"gpt-3.5-turbo-16k-0613": "gpt-3.5-turbo-16k",
|
|
126
|
+
// Anthropic Shorthands
|
|
127
|
+
"sonnet": "claude-3-5-sonnet",
|
|
128
|
+
"sonnet-3.7": "claude-3-7-sonnet",
|
|
129
|
+
"sonnet-3.5": "claude-3-5-sonnet",
|
|
130
|
+
"haiku": "claude-3-5-haiku",
|
|
131
|
+
"haiku-3.5": "claude-3-5-haiku",
|
|
132
|
+
"opus": "claude-3-opus",
|
|
133
|
+
"claude-2": "claude-2.0",
|
|
134
|
+
"claude-instant": "claude-instant-1.2",
|
|
135
|
+
// DeepSeek Shorthands
|
|
136
|
+
"r1": "deepseek-r1",
|
|
137
|
+
"v3": "deepseek-v3",
|
|
138
|
+
// Gemini Shorthands
|
|
139
|
+
"flash": "gemini-2.0-flash",
|
|
140
|
+
"pro": "gemini-1.5-pro",
|
|
141
|
+
// Meta / Groq Shorthands
|
|
142
|
+
"llama-3.3-70b": "llama-3.3-70b-versatile",
|
|
143
|
+
"llama-3.1-70b": "llama-3.1-70b-versatile",
|
|
144
|
+
"llama-3.1-8b": "llama-3.1-8b-instant",
|
|
145
|
+
"llama-3-70b": "llama-3.1-70b-versatile",
|
|
146
|
+
"llama-3-8b": "llama-3.1-8b-instant",
|
|
147
|
+
// Mistral Shorthands
|
|
148
|
+
"codestral": "codestral-latest",
|
|
149
|
+
"mistral-large": "mistral-large-latest",
|
|
150
|
+
"mistral-small": "mistral-small-latest"
|
|
62
151
|
};
|
|
63
152
|
var customPricingRegistry = {};
|
|
64
153
|
function normalizeModelKey(rawModel) {
|
|
65
154
|
if (!rawModel) return "unknown";
|
|
66
155
|
let model = rawModel.toLowerCase().trim();
|
|
156
|
+
model = model.replace(/^[a-z0-9_-]+\.(anthropic|meta|amazon|cohere|mistral|ai21)\./i, "");
|
|
157
|
+
model = model.replace(/^(anthropic|meta|amazon|cohere|mistral|ai21)\./i, "");
|
|
158
|
+
model = model.replace(/-v\d+(:\d+)?$/, "");
|
|
159
|
+
model = model.replace(/:\d+$/, "");
|
|
67
160
|
if (model.includes("/")) {
|
|
68
|
-
model = model.split("/")
|
|
161
|
+
model = model.split("/").slice(1).join("/");
|
|
69
162
|
}
|
|
163
|
+
model = model.replace(/:(latest|free|beta)$/, "");
|
|
70
164
|
model = model.replace(/-\d{8}$/, "");
|
|
71
165
|
model = model.replace(/-\d{4}-\d{2}-\d{2}$/, "");
|
|
166
|
+
model = model.replace(/llama(\d+)-(\d+)-/g, "llama-$1.$2-");
|
|
167
|
+
model = model.replace(/llama(\d+)\.(\d+)-/g, "llama-$1.$2-");
|
|
168
|
+
if (MODEL_ALIASES[model]) {
|
|
169
|
+
return MODEL_ALIASES[model];
|
|
170
|
+
}
|
|
171
|
+
if (!MODEL_PRICING_TABLE[model]) {
|
|
172
|
+
const withoutInstruct = model.replace(/-(instruct|chat|preview)$/, "");
|
|
173
|
+
if (MODEL_PRICING_TABLE[withoutInstruct]) {
|
|
174
|
+
return withoutInstruct;
|
|
175
|
+
}
|
|
176
|
+
if (MODEL_ALIASES[withoutInstruct]) {
|
|
177
|
+
return MODEL_ALIASES[withoutInstruct];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
72
180
|
return model;
|
|
73
181
|
}
|
|
74
182
|
function getModelPricing(modelName) {
|
|
@@ -85,6 +193,10 @@ function getModelPricing(modelName) {
|
|
|
85
193
|
if (MODEL_PRICING_TABLE[modelName]) {
|
|
86
194
|
return MODEL_PRICING_TABLE[modelName];
|
|
87
195
|
}
|
|
196
|
+
const alias = MODEL_ALIASES[modelName.toLowerCase().trim()];
|
|
197
|
+
if (alias && MODEL_PRICING_TABLE[alias]) {
|
|
198
|
+
return MODEL_PRICING_TABLE[alias];
|
|
199
|
+
}
|
|
88
200
|
return {
|
|
89
201
|
inputPer1M: 1,
|
|
90
202
|
outputPer1M: 3,
|
|
@@ -107,35 +219,57 @@ function calculateCost(params) {
|
|
|
107
219
|
} else {
|
|
108
220
|
rates = getModelPricing(params.model);
|
|
109
221
|
}
|
|
110
|
-
const inputTokens = params.inputTokens ?? 0;
|
|
111
|
-
const outputTokens = params.outputTokens ?? 0;
|
|
112
|
-
const reasoningTokens = params.reasoningTokens ?? 0;
|
|
113
|
-
const cachedTokens = params.cachedTokens ?? 0;
|
|
114
|
-
const regularInputTokens =
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
|
|
222
|
+
const inputTokens = BigInt(Math.max(0, params.inputTokens ?? 0));
|
|
223
|
+
const outputTokens = BigInt(Math.max(0, params.outputTokens ?? 0));
|
|
224
|
+
const reasoningTokens = BigInt(Math.max(0, params.reasoningTokens ?? 0));
|
|
225
|
+
const cachedTokens = BigInt(Math.max(0, params.cachedTokens ?? 0));
|
|
226
|
+
const regularInputTokens = inputTokens > cachedTokens ? inputTokens - cachedTokens : 0n;
|
|
227
|
+
const rateInputNano = BigInt(Math.round(rates.inputPer1M * 1e3));
|
|
228
|
+
const cachedPer1M = rates.cachedInputPer1M ?? rates.inputPer1M * 0.15;
|
|
229
|
+
const rateCachedNano = BigInt(Math.round(cachedPer1M * 1e3));
|
|
230
|
+
const rateOutputNano = BigInt(Math.round(rates.outputPer1M * 1e3));
|
|
231
|
+
const reasoningPer1M = rates.reasoningPer1M ?? rates.outputPer1M;
|
|
232
|
+
const rateReasoningNano = BigInt(Math.round(reasoningPer1M * 1e3));
|
|
233
|
+
const regularInputCostNano = regularInputTokens * rateInputNano;
|
|
234
|
+
const cachedInputCostNano = cachedTokens * rateCachedNano;
|
|
235
|
+
const inputCostNano = regularInputCostNano + cachedInputCostNano;
|
|
236
|
+
const outputCostNano = outputTokens * rateOutputNano;
|
|
237
|
+
const reasoningCostNano = reasoningTokens * rateReasoningNano;
|
|
238
|
+
const standardCacheCostNano = cachedTokens * rateInputNano;
|
|
239
|
+
const cachedDiscountNano = standardCacheCostNano > cachedInputCostNano ? standardCacheCostNano - cachedInputCostNano : 0n;
|
|
240
|
+
const wholesaleNano = inputCostNano + outputCostNano;
|
|
125
241
|
const markup = params.markupMultiplier ?? 1;
|
|
126
|
-
let
|
|
242
|
+
let billedNano = wholesaleNano;
|
|
243
|
+
let hasRetail = false;
|
|
127
244
|
if (markup !== 1 || params.minimumChargeUSD !== void 0) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
245
|
+
hasRetail = true;
|
|
246
|
+
const markupMultiplierNano = BigInt(Math.round(markup * 1e3));
|
|
247
|
+
billedNano = wholesaleNano * markupMultiplierNano / 1000n;
|
|
248
|
+
if (params.minimumChargeUSD !== void 0 && params.minimumChargeUSD > 0) {
|
|
249
|
+
const minChargeNano = BigInt(Math.round(params.minimumChargeUSD * 1e9));
|
|
250
|
+
if (billedNano < minChargeNano) {
|
|
251
|
+
billedNano = minChargeNano;
|
|
252
|
+
}
|
|
131
253
|
}
|
|
132
254
|
}
|
|
255
|
+
const inputCostUSD = Number(inputCostNano) / 1e9;
|
|
256
|
+
const outputCostUSD = Number(outputCostNano) / 1e9;
|
|
257
|
+
const reasoningCostUSD = Number(reasoningCostNano) / 1e9;
|
|
258
|
+
const cachedDiscountUSD = Number(cachedDiscountNano) / 1e9;
|
|
259
|
+
const totalUSD = Number(wholesaleNano) / 1e9;
|
|
260
|
+
const wholesaleTotalUSD = totalUSD;
|
|
261
|
+
const billedUSD = Number(billedNano) / 1e9;
|
|
262
|
+
const profitUSD = Math.max(0, billedUSD - wholesaleTotalUSD);
|
|
263
|
+
const retailUSD = hasRetail ? billedUSD : void 0;
|
|
133
264
|
return {
|
|
134
265
|
inputCostUSD: Number(inputCostUSD.toFixed(8)),
|
|
135
266
|
outputCostUSD: Number(outputCostUSD.toFixed(8)),
|
|
136
|
-
reasoningCostUSD: reasoningTokens >
|
|
137
|
-
cachedDiscountUSD: cachedTokens >
|
|
267
|
+
reasoningCostUSD: reasoningTokens > 0n ? Number(reasoningCostUSD.toFixed(8)) : void 0,
|
|
268
|
+
cachedDiscountUSD: cachedTokens > 0n ? Number(cachedDiscountUSD.toFixed(8)) : void 0,
|
|
138
269
|
totalUSD: Number(totalUSD.toFixed(8)),
|
|
270
|
+
wholesaleTotalUSD: Number(wholesaleTotalUSD.toFixed(8)),
|
|
271
|
+
billedUSD: Number(billedUSD.toFixed(8)),
|
|
272
|
+
profitUSD: Number(profitUSD.toFixed(8)),
|
|
139
273
|
retailUSD: retailUSD !== void 0 ? Number(retailUSD.toFixed(8)) : void 0,
|
|
140
274
|
currency: rates.currency || "USD"
|
|
141
275
|
};
|
|
@@ -1086,8 +1220,314 @@ var VibezBillingModal = ({
|
|
|
1086
1220
|
}
|
|
1087
1221
|
) });
|
|
1088
1222
|
};
|
|
1223
|
+
|
|
1224
|
+
// src/react/vibezcheck-ui.tsx
|
|
1225
|
+
import { useState as useState5, useMemo as useMemo2, useEffect as useEffect2 } from "react";
|
|
1226
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1227
|
+
var DEV_RATES = {
|
|
1228
|
+
"gpt-4o": { input: 2.5, output: 10 },
|
|
1229
|
+
"gpt-4o-mini": { input: 0.15, output: 0.6 },
|
|
1230
|
+
"claude-3-5-sonnet": { input: 3, output: 15 },
|
|
1231
|
+
"claude-3-7-sonnet": { input: 3, output: 15 },
|
|
1232
|
+
"gemini-1.5-pro": { input: 1.25, output: 5 },
|
|
1233
|
+
"gemini-1.5-flash": { input: 0.075, output: 0.3 },
|
|
1234
|
+
"deepseek-chat": { input: 0.14, output: 0.28 },
|
|
1235
|
+
default: { input: 2, output: 8 }
|
|
1236
|
+
};
|
|
1237
|
+
function VibezCheck({
|
|
1238
|
+
messages,
|
|
1239
|
+
events,
|
|
1240
|
+
model = "gpt-4o",
|
|
1241
|
+
margin = 1.25,
|
|
1242
|
+
totalCostUSD: manualCost,
|
|
1243
|
+
totalTokens: manualTokens,
|
|
1244
|
+
remainingBalanceUSD,
|
|
1245
|
+
position = "bottom-center",
|
|
1246
|
+
theme = "dark",
|
|
1247
|
+
devMode,
|
|
1248
|
+
className = "",
|
|
1249
|
+
onTopUp,
|
|
1250
|
+
onCostUpdate
|
|
1251
|
+
}) {
|
|
1252
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
1253
|
+
const normalizedModel = useMemo2(() => {
|
|
1254
|
+
const clean = model.toLowerCase().replace(/^(openai|anthropic|google)\//, "");
|
|
1255
|
+
return Object.keys(DEV_RATES).find((k) => clean.includes(k)) || "default";
|
|
1256
|
+
}, [model]);
|
|
1257
|
+
const stats = useMemo2(() => {
|
|
1258
|
+
let hasServerTelemetry = false;
|
|
1259
|
+
let wholesaleUSD = 0;
|
|
1260
|
+
let billedUSD = manualCost ?? 0;
|
|
1261
|
+
let totalTokens = manualTokens ?? 0;
|
|
1262
|
+
let promptTokens = 0;
|
|
1263
|
+
let completionTokens = 0;
|
|
1264
|
+
let cachedTokens = 0;
|
|
1265
|
+
let reasoningTokens = 0;
|
|
1266
|
+
let turns = 0;
|
|
1267
|
+
if (events && events.length > 0) {
|
|
1268
|
+
hasServerTelemetry = true;
|
|
1269
|
+
for (const ev of events) {
|
|
1270
|
+
billedUSD += ev.cost?.retailUSD ?? ev.cost?.billedUSD ?? ev.cost?.totalUSD ?? 0;
|
|
1271
|
+
wholesaleUSD += ev.cost?.wholesaleTotalUSD ?? ev.cost?.totalUSD ?? 0;
|
|
1272
|
+
totalTokens += ev.usage?.totalTokens ?? 0;
|
|
1273
|
+
promptTokens += ev.usage?.inputTokens ?? 0;
|
|
1274
|
+
completionTokens += ev.usage?.outputTokens ?? 0;
|
|
1275
|
+
cachedTokens += ev.usage?.cachedTokens ?? 0;
|
|
1276
|
+
reasoningTokens += ev.usage?.reasoningTokens ?? 0;
|
|
1277
|
+
turns++;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (messages && messages.length > 0) {
|
|
1281
|
+
for (const msg of messages) {
|
|
1282
|
+
turns++;
|
|
1283
|
+
let eventFound = null;
|
|
1284
|
+
if (Array.isArray(msg.annotations)) {
|
|
1285
|
+
for (const ann of msg.annotations) {
|
|
1286
|
+
if (ann && (ann.cost || ann.usage || ann.vibez)) {
|
|
1287
|
+
eventFound = ann.vibez || ann;
|
|
1288
|
+
break;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
if (!eventFound && Array.isArray(msg.parts)) {
|
|
1293
|
+
for (const part of msg.parts) {
|
|
1294
|
+
if (part && (part.type === "data" || part.type === "custom") && part.data?.vibez) {
|
|
1295
|
+
eventFound = part.data.vibez;
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
if (eventFound) {
|
|
1301
|
+
hasServerTelemetry = true;
|
|
1302
|
+
billedUSD += eventFound.cost?.retailUSD ?? eventFound.cost?.billedUSD ?? eventFound.cost?.totalUSD ?? 0;
|
|
1303
|
+
wholesaleUSD += eventFound.cost?.wholesaleTotalUSD ?? eventFound.cost?.totalUSD ?? 0;
|
|
1304
|
+
totalTokens += eventFound.usage?.totalTokens ?? 0;
|
|
1305
|
+
promptTokens += eventFound.usage?.inputTokens ?? 0;
|
|
1306
|
+
completionTokens += eventFound.usage?.outputTokens ?? 0;
|
|
1307
|
+
cachedTokens += eventFound.usage?.cachedTokens ?? 0;
|
|
1308
|
+
reasoningTokens += eventFound.usage?.reasoningTokens ?? 0;
|
|
1309
|
+
} else {
|
|
1310
|
+
let text = "";
|
|
1311
|
+
if (typeof msg.content === "string") {
|
|
1312
|
+
text = msg.content;
|
|
1313
|
+
} else if (Array.isArray(msg.parts)) {
|
|
1314
|
+
text = msg.parts.filter((p) => p.type === "text").map((p) => p.text).join(" ");
|
|
1315
|
+
}
|
|
1316
|
+
const estimatedTok = Math.ceil(text.length / 3.8);
|
|
1317
|
+
if (msg.role === "user") {
|
|
1318
|
+
promptTokens += estimatedTok;
|
|
1319
|
+
} else if (msg.role === "assistant") {
|
|
1320
|
+
completionTokens += estimatedTok;
|
|
1321
|
+
} else {
|
|
1322
|
+
promptTokens += estimatedTok;
|
|
1323
|
+
}
|
|
1324
|
+
totalTokens += estimatedTok;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
if (!hasServerTelemetry && totalTokens > 0) {
|
|
1328
|
+
const rates = DEV_RATES[normalizedModel] || DEV_RATES.default;
|
|
1329
|
+
wholesaleUSD = (promptTokens * rates.input + completionTokens * rates.output) / 1e6;
|
|
1330
|
+
billedUSD = wholesaleUSD * margin;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
const profitUSD = Math.max(0, billedUSD - wholesaleUSD);
|
|
1334
|
+
const isDev = devMode !== void 0 ? devMode : !hasServerTelemetry;
|
|
1335
|
+
return {
|
|
1336
|
+
wholesaleUSD,
|
|
1337
|
+
billedUSD,
|
|
1338
|
+
profitUSD,
|
|
1339
|
+
totalTokens,
|
|
1340
|
+
promptTokens,
|
|
1341
|
+
completionTokens,
|
|
1342
|
+
cachedTokens,
|
|
1343
|
+
reasoningTokens,
|
|
1344
|
+
turns,
|
|
1345
|
+
isDevMode: isDev
|
|
1346
|
+
};
|
|
1347
|
+
}, [messages, events, manualCost, manualTokens, normalizedModel, margin, devMode]);
|
|
1348
|
+
useEffect2(() => {
|
|
1349
|
+
if (onCostUpdate) {
|
|
1350
|
+
onCostUpdate({
|
|
1351
|
+
totalCostUSD: stats.billedUSD,
|
|
1352
|
+
wholesaleUSD: stats.wholesaleUSD,
|
|
1353
|
+
profitUSD: stats.profitUSD,
|
|
1354
|
+
totalTokens: stats.totalTokens,
|
|
1355
|
+
isDevMode: stats.isDevMode
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
}, [stats.billedUSD, stats.totalTokens, stats.isDevMode, onCostUpdate]);
|
|
1359
|
+
const isDark = theme === "dark" || theme === "auto";
|
|
1360
|
+
const positionStyles = useMemo2(() => {
|
|
1361
|
+
const base = { position: "fixed", zIndex: 9999 };
|
|
1362
|
+
switch (position) {
|
|
1363
|
+
case "bottom-center":
|
|
1364
|
+
return { ...base, bottom: "24px", left: "50%", transform: "translateX(-50%)" };
|
|
1365
|
+
case "bottom-right":
|
|
1366
|
+
return { ...base, bottom: "24px", right: "24px" };
|
|
1367
|
+
case "bottom-left":
|
|
1368
|
+
return { ...base, bottom: "24px", left: "24px" };
|
|
1369
|
+
case "top-center":
|
|
1370
|
+
return { ...base, top: "24px", left: "50%", transform: "translateX(-50%)" };
|
|
1371
|
+
default:
|
|
1372
|
+
return { ...base, bottom: "24px", left: "50%", transform: "translateX(-50%)" };
|
|
1373
|
+
}
|
|
1374
|
+
}, [position]);
|
|
1375
|
+
const formatTokens = (num) => {
|
|
1376
|
+
if (num >= 1e6) return (num / 1e6).toFixed(2) + "M";
|
|
1377
|
+
if (num >= 1e3) return (num / 1e3).toFixed(1) + "k";
|
|
1378
|
+
return num.toLocaleString();
|
|
1379
|
+
};
|
|
1380
|
+
return /* @__PURE__ */ jsxs5("div", { style: positionStyles, className: `vibezcheck-ui-root font-sans text-xs select-none ${className}`, children: [
|
|
1381
|
+
isOpen && /* @__PURE__ */ jsxs5(
|
|
1382
|
+
"div",
|
|
1383
|
+
{
|
|
1384
|
+
style: {
|
|
1385
|
+
background: isDark ? "rgba(15, 23, 42, 0.96)" : "rgba(255, 255, 255, 0.98)",
|
|
1386
|
+
backdropFilter: "blur(16px)",
|
|
1387
|
+
borderColor: isDark ? "#334155" : "#e2e8f0",
|
|
1388
|
+
color: isDark ? "#f8fafc" : "#0f172a"
|
|
1389
|
+
},
|
|
1390
|
+
className: "mb-3 p-4 rounded-2xl border shadow-2xl w-84 space-y-3.5 transition-all animate-in fade-in slide-in-from-bottom-2",
|
|
1391
|
+
children: [
|
|
1392
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between border-b pb-2 border-slate-700/50", children: [
|
|
1393
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
1394
|
+
/* @__PURE__ */ jsx6("span", { className: "text-lime-400 font-bold text-sm", children: "\u2726" }),
|
|
1395
|
+
/* @__PURE__ */ jsx6("span", { className: "font-semibold tracking-wide uppercase text-[11px] text-lime-400", children: "VibezCheck Financial Meter" })
|
|
1396
|
+
] }),
|
|
1397
|
+
/* @__PURE__ */ jsx6(
|
|
1398
|
+
"button",
|
|
1399
|
+
{
|
|
1400
|
+
onClick: () => setIsOpen(false),
|
|
1401
|
+
className: "text-slate-400 hover:text-white text-xs px-1.5 py-0.5 rounded cursor-pointer transition",
|
|
1402
|
+
children: "\u2715"
|
|
1403
|
+
}
|
|
1404
|
+
)
|
|
1405
|
+
] }),
|
|
1406
|
+
stats.isDevMode ? /* @__PURE__ */ jsxs5("div", { className: "bg-amber-950/40 border border-amber-500/30 rounded-lg p-2 text-[10px] text-amber-300 flex items-center justify-between", children: [
|
|
1407
|
+
/* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-1.5 font-medium", children: [
|
|
1408
|
+
/* @__PURE__ */ jsx6("span", { className: "w-2 h-2 rounded-full bg-amber-400 animate-ping" }),
|
|
1409
|
+
"Zero-DB Dev Mode (Simulated Bill)"
|
|
1410
|
+
] }),
|
|
1411
|
+
/* @__PURE__ */ jsxs5("span", { className: "text-[9px] bg-amber-500/20 px-1.5 py-0.5 rounded font-mono", children: [
|
|
1412
|
+
"+",
|
|
1413
|
+
Math.round((margin - 1) * 100),
|
|
1414
|
+
"% Margin"
|
|
1415
|
+
] })
|
|
1416
|
+
] }) : /* @__PURE__ */ jsxs5("div", { className: "bg-emerald-950/40 border border-emerald-500/30 rounded-lg p-2 text-[10px] text-emerald-300 flex items-center gap-1.5", children: [
|
|
1417
|
+
/* @__PURE__ */ jsx6("span", { className: "w-2 h-2 rounded-full bg-emerald-400" }),
|
|
1418
|
+
/* @__PURE__ */ jsx6("span", { children: "Live Stripe Usage Meter Active" })
|
|
1419
|
+
] }),
|
|
1420
|
+
/* @__PURE__ */ jsxs5("div", { className: "bg-slate-800/60 p-2.5 rounded-lg border border-slate-700/40 space-y-2 text-[11px]", children: [
|
|
1421
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center text-slate-400", children: [
|
|
1422
|
+
/* @__PURE__ */ jsx6("span", { children: "Provider Cost (Wholesale):" }),
|
|
1423
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono text-slate-300", children: [
|
|
1424
|
+
"$",
|
|
1425
|
+
stats.wholesaleUSD.toFixed(4)
|
|
1426
|
+
] })
|
|
1427
|
+
] }),
|
|
1428
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center text-slate-400", children: [
|
|
1429
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1430
|
+
"Your Profit (+",
|
|
1431
|
+
Math.round((margin - 1) * 100),
|
|
1432
|
+
"%):"
|
|
1433
|
+
] }),
|
|
1434
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono text-lime-400 font-medium", children: [
|
|
1435
|
+
"+$",
|
|
1436
|
+
stats.profitUSD.toFixed(4)
|
|
1437
|
+
] })
|
|
1438
|
+
] }),
|
|
1439
|
+
/* @__PURE__ */ jsxs5("div", { className: "border-t border-slate-700/60 pt-1.5 flex justify-between items-center font-bold", children: [
|
|
1440
|
+
/* @__PURE__ */ jsx6("span", { className: "text-white", children: "Customer Billed Total:" }),
|
|
1441
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono text-lime-400 text-sm", children: [
|
|
1442
|
+
"$",
|
|
1443
|
+
stats.billedUSD.toFixed(4)
|
|
1444
|
+
] })
|
|
1445
|
+
] })
|
|
1446
|
+
] }),
|
|
1447
|
+
/* @__PURE__ */ jsxs5("div", { className: "bg-slate-800/40 p-2.5 rounded-lg border border-slate-700/30 space-y-1.5 text-[11px]", children: [
|
|
1448
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between text-slate-400", children: [
|
|
1449
|
+
/* @__PURE__ */ jsx6("span", { children: "Prompt Tokens:" }),
|
|
1450
|
+
/* @__PURE__ */ jsx6("span", { className: "font-mono text-slate-200", children: formatTokens(stats.promptTokens) })
|
|
1451
|
+
] }),
|
|
1452
|
+
stats.cachedTokens > 0 && /* @__PURE__ */ jsxs5("div", { className: "flex justify-between text-[10px] text-lime-300", children: [
|
|
1453
|
+
/* @__PURE__ */ jsx6("span", { children: "\u21B3 Cache Savings (85% off):" }),
|
|
1454
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono", children: [
|
|
1455
|
+
"-",
|
|
1456
|
+
formatTokens(stats.cachedTokens)
|
|
1457
|
+
] })
|
|
1458
|
+
] }),
|
|
1459
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between text-slate-400", children: [
|
|
1460
|
+
/* @__PURE__ */ jsx6("span", { children: "Completion Tokens:" }),
|
|
1461
|
+
/* @__PURE__ */ jsx6("span", { className: "font-mono text-slate-200", children: formatTokens(stats.completionTokens) })
|
|
1462
|
+
] }),
|
|
1463
|
+
stats.reasoningTokens > 0 && /* @__PURE__ */ jsxs5("div", { className: "flex justify-between text-[10px] text-purple-300", children: [
|
|
1464
|
+
/* @__PURE__ */ jsx6("span", { children: "\u21B3 Thinking / Reasoning:" }),
|
|
1465
|
+
/* @__PURE__ */ jsx6("span", { className: "font-mono", children: formatTokens(stats.reasoningTokens) })
|
|
1466
|
+
] }),
|
|
1467
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between border-t border-slate-700/50 pt-1 font-semibold text-slate-300", children: [
|
|
1468
|
+
/* @__PURE__ */ jsx6("span", { children: "Total Tokens:" }),
|
|
1469
|
+
/* @__PURE__ */ jsx6("span", { className: "font-mono text-white", children: formatTokens(stats.totalTokens) })
|
|
1470
|
+
] })
|
|
1471
|
+
] }),
|
|
1472
|
+
typeof remainingBalanceUSD === "number" && /* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center text-[11px] px-1", children: [
|
|
1473
|
+
/* @__PURE__ */ jsx6("span", { className: "text-slate-400", children: "Remaining Balance:" }),
|
|
1474
|
+
/* @__PURE__ */ jsxs5(
|
|
1475
|
+
"span",
|
|
1476
|
+
{
|
|
1477
|
+
className: `font-mono font-bold ${remainingBalanceUSD < 1 ? "text-amber-400" : "text-slate-200"}`,
|
|
1478
|
+
children: [
|
|
1479
|
+
"$",
|
|
1480
|
+
remainingBalanceUSD.toFixed(2)
|
|
1481
|
+
]
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
] }),
|
|
1485
|
+
onTopUp && /* @__PURE__ */ jsx6(
|
|
1486
|
+
"button",
|
|
1487
|
+
{
|
|
1488
|
+
onClick: onTopUp,
|
|
1489
|
+
className: "w-full py-2 px-3 rounded-lg bg-lime-500 hover:bg-lime-400 text-slate-950 font-semibold text-xs transition cursor-pointer shadow-md active:scale-98",
|
|
1490
|
+
children: "+ Add / Top Up Credits"
|
|
1491
|
+
}
|
|
1492
|
+
),
|
|
1493
|
+
stats.isDevMode && /* @__PURE__ */ jsx6("p", { className: "text-[9px] text-slate-500 text-center leading-tight", children: "Zero-DB Dev Mode: Running in local memory without database or Stripe dependencies." })
|
|
1494
|
+
]
|
|
1495
|
+
}
|
|
1496
|
+
),
|
|
1497
|
+
/* @__PURE__ */ jsxs5(
|
|
1498
|
+
"div",
|
|
1499
|
+
{
|
|
1500
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1501
|
+
style: {
|
|
1502
|
+
background: isDark ? "rgba(15, 23, 42, 0.90)" : "rgba(255, 255, 255, 0.95)",
|
|
1503
|
+
backdropFilter: "blur(12px)",
|
|
1504
|
+
borderColor: isDark ? "#334155" : "#e2e8f0",
|
|
1505
|
+
color: isDark ? "#f8fafc" : "#0f172a"
|
|
1506
|
+
},
|
|
1507
|
+
className: "flex items-center gap-2.5 px-3.5 py-1.5 rounded-full border shadow-xl cursor-pointer hover:scale-105 active:scale-95 transition-all select-none",
|
|
1508
|
+
children: [
|
|
1509
|
+
/* @__PURE__ */ jsx6("span", { className: "text-lime-400 font-bold text-xs animate-pulse", children: "\u2726" }),
|
|
1510
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono font-semibold text-lime-400 text-xs", children: [
|
|
1511
|
+
"$",
|
|
1512
|
+
stats.billedUSD.toFixed(4)
|
|
1513
|
+
] }),
|
|
1514
|
+
/* @__PURE__ */ jsx6("span", { className: "text-slate-500", children: "\u2022" }),
|
|
1515
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono text-slate-300 text-xs", children: [
|
|
1516
|
+
formatTokens(stats.totalTokens),
|
|
1517
|
+
" tok"
|
|
1518
|
+
] }),
|
|
1519
|
+
stats.isDevMode && /* @__PURE__ */ jsx6("span", { className: "text-[9px] font-mono text-amber-400 bg-amber-400/10 px-1 py-0.2 rounded", children: "DEV" }),
|
|
1520
|
+
/* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 ml-0.5", children: isOpen ? "\u25BC" : "\u25B2" })
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] });
|
|
1525
|
+
}
|
|
1526
|
+
var VibezPill = VibezCheck;
|
|
1089
1527
|
export {
|
|
1090
1528
|
VibezBillingModal,
|
|
1529
|
+
VibezCheck,
|
|
1530
|
+
VibezPill,
|
|
1091
1531
|
VibezReceipt,
|
|
1092
1532
|
VibezSessionBadge,
|
|
1093
1533
|
VibezSessionContext,
|