@pydantic/genai-prices 0.0.39 → 0.0.41
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/cli.js +309 -234
- package/dist/index.cjs +2 -2
- package/dist/index.js +90 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import de from "yargs";
|
|
3
3
|
import { format as he } from "util";
|
|
4
|
-
import { resolve as
|
|
4
|
+
import { resolve as ie, normalize as Ie } from "path";
|
|
5
5
|
import { readFileSync as _e, writeFile as Le, statSync as Pe } from "fs";
|
|
6
6
|
import "assert";
|
|
7
7
|
import { fileURLToPath as Te } from "url";
|
|
@@ -14,53 +14,53 @@ function Se() {
|
|
|
14
14
|
function Ge() {
|
|
15
15
|
return !!process.versions.electron;
|
|
16
16
|
}
|
|
17
|
-
function Ce(
|
|
18
|
-
return
|
|
17
|
+
function Ce(a) {
|
|
18
|
+
return a.slice(Ae() + 1);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright (c) 2016, Contributors
|
|
23
23
|
* SPDX-License-Identifier: ISC
|
|
24
24
|
*/
|
|
25
|
-
function W(
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
25
|
+
function W(a) {
|
|
26
|
+
if (a !== a.toLowerCase() && a !== a.toUpperCase() || (a = a.toLowerCase()), a.indexOf("-") === -1 && a.indexOf("_") === -1)
|
|
27
|
+
return a;
|
|
28
28
|
{
|
|
29
29
|
let m = "", s = !1;
|
|
30
|
-
const u =
|
|
31
|
-
for (let k = u ? u[0].length : 0; k <
|
|
32
|
-
let _ =
|
|
30
|
+
const u = a.match(/^-+/);
|
|
31
|
+
for (let k = u ? u[0].length : 0; k < a.length; k++) {
|
|
32
|
+
let _ = a.charAt(k);
|
|
33
33
|
s && (s = !1, _ = _.toUpperCase()), k !== 0 && (_ === "-" || _ === "_") ? s = !0 : _ !== "-" && _ !== "_" && (m += _);
|
|
34
34
|
}
|
|
35
35
|
return m;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function Oe(
|
|
39
|
-
const m =
|
|
38
|
+
function Oe(a, n) {
|
|
39
|
+
const m = a.toLowerCase();
|
|
40
40
|
n = n || "-";
|
|
41
41
|
let s = "";
|
|
42
|
-
for (let u = 0; u <
|
|
43
|
-
const k = m.charAt(u), _ =
|
|
42
|
+
for (let u = 0; u < a.length; u++) {
|
|
43
|
+
const k = m.charAt(u), _ = a.charAt(u);
|
|
44
44
|
k !== _ && u > 0 ? s += `${n}${m.charAt(u)}` : s += _;
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function Re(
|
|
49
|
-
return
|
|
48
|
+
function Re(a) {
|
|
49
|
+
return a == null ? !1 : typeof a == "number" || /^0x[0-9a-f]+$/i.test(a) ? !0 : /^0[^.]/.test(a) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(a);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright (c) 2016, Contributors
|
|
54
54
|
* SPDX-License-Identifier: ISC
|
|
55
55
|
*/
|
|
56
|
-
function Ee(
|
|
57
|
-
if (Array.isArray(
|
|
58
|
-
return
|
|
59
|
-
|
|
56
|
+
function Ee(a) {
|
|
57
|
+
if (Array.isArray(a))
|
|
58
|
+
return a.map((_) => typeof _ != "string" ? _ + "" : _);
|
|
59
|
+
a = a.trim();
|
|
60
60
|
let n = 0, m = null, s = null, u = null;
|
|
61
61
|
const k = [];
|
|
62
|
-
for (let _ = 0; _ <
|
|
63
|
-
if (m = s, s =
|
|
62
|
+
for (let _ = 0; _ < a.length; _++) {
|
|
63
|
+
if (m = s, s = a.charAt(_), s === " " && !u) {
|
|
64
64
|
m !== " " && n++;
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
@@ -74,8 +74,8 @@ function Ee(i) {
|
|
|
74
74
|
* SPDX-License-Identifier: ISC
|
|
75
75
|
*/
|
|
76
76
|
var I;
|
|
77
|
-
(function(
|
|
78
|
-
|
|
77
|
+
(function(a) {
|
|
78
|
+
a.BOOLEAN = "boolean", a.STRING = "string", a.NUMBER = "number", a.ARRAY = "array";
|
|
79
79
|
})(I || (I = {}));
|
|
80
80
|
/**
|
|
81
81
|
* @license
|
|
@@ -138,14 +138,14 @@ class Ne {
|
|
|
138
138
|
keys: []
|
|
139
139
|
}, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
|
|
140
140
|
[].concat(s.array || []).filter(Boolean).forEach(function(e) {
|
|
141
|
-
const
|
|
141
|
+
const i = typeof e == "object" ? e.key : e, c = Object.keys(e).map(function(o) {
|
|
142
142
|
return {
|
|
143
143
|
boolean: "bools",
|
|
144
144
|
string: "strings",
|
|
145
145
|
number: "numbers"
|
|
146
146
|
}[o];
|
|
147
147
|
}).filter(Boolean).pop();
|
|
148
|
-
|
|
148
|
+
c && (r[c][i] = !0), r.arrays[i] = !0, r.keys.push(i);
|
|
149
149
|
}), [].concat(s.boolean || []).filter(Boolean).forEach(function(e) {
|
|
150
150
|
r.bools[e] = !0, r.keys.push(e);
|
|
151
151
|
}), [].concat(s.string || []).filter(Boolean).forEach(function(e) {
|
|
@@ -156,17 +156,17 @@ class Ne {
|
|
|
156
156
|
r.counts[e] = !0, r.keys.push(e);
|
|
157
157
|
}), [].concat(s.normalize || []).filter(Boolean).forEach(function(e) {
|
|
158
158
|
r.normalize[e] = !0, r.keys.push(e);
|
|
159
|
-
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e,
|
|
160
|
-
typeof
|
|
161
|
-
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e,
|
|
162
|
-
typeof
|
|
159
|
+
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e, i]) => {
|
|
160
|
+
typeof i == "number" && (r.nargs[e] = i, r.keys.push(e));
|
|
161
|
+
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e, i]) => {
|
|
162
|
+
typeof i == "function" && (r.coercions[e] = i, r.keys.push(e));
|
|
163
163
|
}), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(e) {
|
|
164
164
|
r.configs[e] = !0;
|
|
165
|
-
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([e,
|
|
166
|
-
(typeof
|
|
165
|
+
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, i]) => {
|
|
166
|
+
(typeof i == "boolean" || typeof i == "function") && (r.configs[e] = i);
|
|
167
167
|
})), qe(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(e) {
|
|
168
|
-
(r.aliases[e] || []).forEach(function(
|
|
169
|
-
f[
|
|
168
|
+
(r.aliases[e] || []).forEach(function(i) {
|
|
169
|
+
f[i] = f[e];
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
172
|
let B = null;
|
|
@@ -174,28 +174,28 @@ class Ne {
|
|
|
174
174
|
let F = [];
|
|
175
175
|
const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ne = {};
|
|
176
176
|
for (let e = 0; e < u.length; e++) {
|
|
177
|
-
const
|
|
178
|
-
let o, t, p,
|
|
179
|
-
if (
|
|
180
|
-
K(
|
|
181
|
-
else if (
|
|
182
|
-
K(
|
|
177
|
+
const i = u[e], c = i.replace(/^-{3,}/, "---");
|
|
178
|
+
let o, t, p, l, d, v;
|
|
179
|
+
if (i !== "--" && /^-/.test(i) && H(i))
|
|
180
|
+
K(i);
|
|
181
|
+
else if (c.match(/^---+(=|$)/)) {
|
|
182
|
+
K(i);
|
|
183
183
|
continue;
|
|
184
|
-
} else if (
|
|
185
|
-
|
|
186
|
-
else if (
|
|
187
|
-
|
|
188
|
-
else if (
|
|
189
|
-
|
|
190
|
-
else if (
|
|
191
|
-
|
|
192
|
-
else if (
|
|
193
|
-
d = u[e + 1],
|
|
194
|
-
else if (
|
|
195
|
-
p =
|
|
184
|
+
} else if (i.match(/^--.+=/) || !h["short-option-groups"] && i.match(/^-.+=/))
|
|
185
|
+
l = i.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ? e = V(e, l[1], u, l[2]) : g(l[1], r.nargs) !== !1 ? e = D(e, l[1], u, l[2]) : q(l[1], l[2], !0));
|
|
186
|
+
else if (i.match(U) && h["boolean-negation"])
|
|
187
|
+
l = i.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], q(t, g(t, r.arrays) ? [!1] : !1));
|
|
188
|
+
else if (i.match(/^--.+/) || !h["short-option-groups"] && i.match(/^-[^-]+/))
|
|
189
|
+
l = i.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
|
|
190
|
+
else if (i.match(/^-.\..+=/))
|
|
191
|
+
l = i.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
|
|
192
|
+
else if (i.match(/^-.\..+/) && !i.match(L))
|
|
193
|
+
d = u[e + 1], l = i.match(/^-(.\..+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], d !== void 0 && !d.match(/^-/) && !g(t, r.bools) && !g(t, r.counts) ? (q(t, d), e++) : q(t, R(t)));
|
|
194
|
+
else if (i.match(/^-[^-]+/) && !i.match(L)) {
|
|
195
|
+
p = i.slice(1, -1).split(""), o = !1;
|
|
196
196
|
for (let x = 0; x < p.length; x++) {
|
|
197
|
-
if (d =
|
|
198
|
-
v =
|
|
197
|
+
if (d = i.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
|
|
198
|
+
v = i.slice(x + 3), t = p[x], g(t, r.arrays) ? e = V(e, t, u, v) : g(t, r.nargs) !== !1 ? e = D(e, t, u, v) : q(t, v), o = !0;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
if (d === "-") {
|
|
@@ -212,17 +212,17 @@ class Ne {
|
|
|
212
212
|
} else
|
|
213
213
|
q(p[x], R(p[x]));
|
|
214
214
|
}
|
|
215
|
-
t =
|
|
216
|
-
} else if (
|
|
217
|
-
t =
|
|
218
|
-
else if (
|
|
215
|
+
t = i.slice(-1)[0], !o && t !== "-" && (g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
|
|
216
|
+
} else if (i.match(/^-[0-9]$/) && i.match(L) && g(i.slice(1), r.bools))
|
|
217
|
+
t = i.slice(1), q(t, R(t));
|
|
218
|
+
else if (i === "--") {
|
|
219
219
|
F = u.slice(e + 1);
|
|
220
220
|
break;
|
|
221
221
|
} else if (h["halt-at-non-option"]) {
|
|
222
222
|
F = u.slice(e);
|
|
223
223
|
break;
|
|
224
224
|
} else
|
|
225
|
-
K(
|
|
225
|
+
K(i);
|
|
226
226
|
}
|
|
227
227
|
re(w, !0), re(w, !1), ke(w), ge(), me(w, r.aliases, f, !0), fe(w), h["set-placeholder-key"] && be(w), Object.keys(r.counts).forEach(function(e) {
|
|
228
228
|
E(w, e.split(".")) || q(e, 0);
|
|
@@ -231,97 +231,97 @@ class Ne {
|
|
|
231
231
|
}), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((e) => e !== "--" && e.includes("-")).forEach((e) => {
|
|
232
232
|
delete w[e];
|
|
233
233
|
}), h["strip-aliased"] && [].concat(...Object.keys(_).map((e) => _[e])).forEach((e) => {
|
|
234
|
-
h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((
|
|
234
|
+
h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((i) => W(i)).join(".")], delete w[e];
|
|
235
235
|
});
|
|
236
236
|
function K(e) {
|
|
237
|
-
const
|
|
238
|
-
(typeof
|
|
237
|
+
const i = $("_", e);
|
|
238
|
+
(typeof i == "string" || typeof i == "number") && w._.push(i);
|
|
239
239
|
}
|
|
240
|
-
function D(e,
|
|
241
|
-
let t, p = g(
|
|
240
|
+
function D(e, i, c, o) {
|
|
241
|
+
let t, p = g(i, r.nargs);
|
|
242
242
|
if (p = typeof p != "number" || isNaN(p) ? 1 : p, p === 0)
|
|
243
|
-
return T(o) || (B = Error(C("Argument unexpected for: %s",
|
|
244
|
-
let
|
|
243
|
+
return T(o) || (B = Error(C("Argument unexpected for: %s", i))), q(i, R(i)), e;
|
|
244
|
+
let l = T(o) ? 0 : 1;
|
|
245
245
|
if (h["nargs-eats-options"])
|
|
246
|
-
|
|
246
|
+
c.length - (e + 1) + l < p && (B = Error(C("Not enough arguments following: %s", i))), l = p;
|
|
247
247
|
else {
|
|
248
|
-
for (t = e + 1; t <
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
for (t = e + 1; t < c.length && (!c[t].match(/^-[^0-9]/) || c[t].match(L) || H(c[t])); t++)
|
|
249
|
+
l++;
|
|
250
|
+
l < p && (B = Error(C("Not enough arguments following: %s", i)));
|
|
251
251
|
}
|
|
252
|
-
let d = Math.min(
|
|
253
|
-
for (!T(o) && d > 0 && (q(
|
|
254
|
-
q(
|
|
252
|
+
let d = Math.min(l, p);
|
|
253
|
+
for (!T(o) && d > 0 && (q(i, o), d--), t = e + 1; t < d + e + 1; t++)
|
|
254
|
+
q(i, c[t]);
|
|
255
255
|
return e + d;
|
|
256
256
|
}
|
|
257
|
-
function V(e,
|
|
258
|
-
let t = [], p = o ||
|
|
259
|
-
const
|
|
260
|
-
if (g(
|
|
257
|
+
function V(e, i, c, o) {
|
|
258
|
+
let t = [], p = o || c[e + 1];
|
|
259
|
+
const l = g(i, r.nargs);
|
|
260
|
+
if (g(i, r.bools) && !/^(true|false)$/.test(p))
|
|
261
261
|
t.push(!0);
|
|
262
262
|
else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
|
|
263
|
-
if (f[
|
|
264
|
-
const d = f[
|
|
263
|
+
if (f[i] !== void 0) {
|
|
264
|
+
const d = f[i];
|
|
265
265
|
t = Array.isArray(d) ? d : [d];
|
|
266
266
|
}
|
|
267
267
|
} else {
|
|
268
|
-
T(o) || t.push(Y(
|
|
269
|
-
for (let d = e + 1; d <
|
|
270
|
-
e = d, t.push(Y(
|
|
268
|
+
T(o) || t.push(Y(i, o, !0));
|
|
269
|
+
for (let d = e + 1; d < c.length && !(!h["greedy-arrays"] && t.length > 0 || l && typeof l == "number" && t.length >= l || (p = c[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
|
|
270
|
+
e = d, t.push(Y(i, p, k));
|
|
271
271
|
}
|
|
272
|
-
return typeof
|
|
272
|
+
return typeof l == "number" && (l && t.length < l || isNaN(l) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", i))), q(i, t), e;
|
|
273
273
|
}
|
|
274
|
-
function q(e,
|
|
274
|
+
function q(e, i, c = k) {
|
|
275
275
|
if (/-/.test(e) && h["camel-case-expansion"]) {
|
|
276
|
-
const p = e.split(".").map(function(
|
|
277
|
-
return W(
|
|
276
|
+
const p = e.split(".").map(function(l) {
|
|
277
|
+
return W(l);
|
|
278
278
|
}).join(".");
|
|
279
279
|
se(e, p);
|
|
280
280
|
}
|
|
281
|
-
const o = Y(e,
|
|
281
|
+
const o = Y(e, i, c), t = e.split(".");
|
|
282
282
|
N(w, t, o), r.aliases[e] && r.aliases[e].forEach(function(p) {
|
|
283
|
-
const
|
|
284
|
-
N(w,
|
|
283
|
+
const l = p.split(".");
|
|
284
|
+
N(w, l, o);
|
|
285
285
|
}), t.length > 1 && h["dot-notation"] && (r.aliases[t[0]] || []).forEach(function(p) {
|
|
286
|
-
let
|
|
286
|
+
let l = p.split(".");
|
|
287
287
|
const d = [].concat(t);
|
|
288
|
-
d.shift(),
|
|
289
|
-
}), g(e, r.normalize) && !g(e, r.arrays) && [e].concat(r.aliases[e] || []).forEach(function(
|
|
290
|
-
Object.defineProperty(ne,
|
|
288
|
+
d.shift(), l = l.concat(d), (r.aliases[e] || []).includes(l.join(".")) || N(w, l, o);
|
|
289
|
+
}), g(e, r.normalize) && !g(e, r.arrays) && [e].concat(r.aliases[e] || []).forEach(function(l) {
|
|
290
|
+
Object.defineProperty(ne, l, {
|
|
291
291
|
enumerable: !0,
|
|
292
292
|
get() {
|
|
293
|
-
return
|
|
293
|
+
return i;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
|
|
296
|
+
i = typeof d == "string" ? A.normalize(d) : d;
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function se(e,
|
|
302
|
-
r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [
|
|
301
|
+
function se(e, i) {
|
|
302
|
+
r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [i], Q[i] = !0), r.aliases[i] && r.aliases[i].length || se(i, e);
|
|
303
303
|
}
|
|
304
|
-
function Y(e,
|
|
305
|
-
|
|
306
|
-
let o = Array.isArray(
|
|
304
|
+
function Y(e, i, c) {
|
|
305
|
+
c && (i = je(i)), (g(e, r.bools) || g(e, r.counts)) && typeof i == "string" && (i = i === "true");
|
|
306
|
+
let o = Array.isArray(i) ? i.map(function(t) {
|
|
307
307
|
return $(e, t);
|
|
308
|
-
}) : $(e,
|
|
309
|
-
return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(
|
|
308
|
+
}) : $(e, i);
|
|
309
|
+
return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(i) ? o = i.map((t) => A.normalize(t)) : o = A.normalize(i)), o;
|
|
310
310
|
}
|
|
311
|
-
function $(e,
|
|
312
|
-
return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(
|
|
311
|
+
function $(e, i) {
|
|
312
|
+
return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(i) && (Re(i) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !T(i) && g(e, r.numbers)) && (i = Number(i)), i;
|
|
313
313
|
}
|
|
314
314
|
function ke(e) {
|
|
315
|
-
const
|
|
316
|
-
me(
|
|
317
|
-
const o = e[
|
|
315
|
+
const i = /* @__PURE__ */ Object.create(null);
|
|
316
|
+
me(i, r.aliases, f), Object.keys(r.configs).forEach(function(c) {
|
|
317
|
+
const o = e[c] || i[c];
|
|
318
318
|
if (o)
|
|
319
319
|
try {
|
|
320
320
|
let t = null;
|
|
321
|
-
const p = A.resolve(A.cwd(), o),
|
|
322
|
-
if (typeof
|
|
321
|
+
const p = A.resolve(A.cwd(), o), l = r.configs[c];
|
|
322
|
+
if (typeof l == "function") {
|
|
323
323
|
try {
|
|
324
|
-
t =
|
|
324
|
+
t = l(p);
|
|
325
325
|
} catch (d) {
|
|
326
326
|
t = d;
|
|
327
327
|
}
|
|
@@ -333,13 +333,13 @@ class Ne {
|
|
|
333
333
|
t = A.require(p);
|
|
334
334
|
J(t);
|
|
335
335
|
} catch (t) {
|
|
336
|
-
t.name === "PermissionDenied" ? B = t : e[
|
|
336
|
+
t.name === "PermissionDenied" ? B = t : e[c] && (B = Error(C("Invalid JSON config file: %s", o)));
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
function J(e,
|
|
341
|
-
Object.keys(e).forEach(function(
|
|
342
|
-
const o = e[
|
|
340
|
+
function J(e, i) {
|
|
341
|
+
Object.keys(e).forEach(function(c) {
|
|
342
|
+
const o = e[c], t = i ? i + "." + c : c;
|
|
343
343
|
typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, t) : (!E(w, t.split(".")) || g(t, r.arrays) && h["combine-arrays"]) && q(t, o);
|
|
344
344
|
});
|
|
345
345
|
}
|
|
@@ -348,28 +348,28 @@ class Ne {
|
|
|
348
348
|
J(e);
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
function re(e,
|
|
351
|
+
function re(e, i) {
|
|
352
352
|
if (typeof P > "u")
|
|
353
353
|
return;
|
|
354
|
-
const
|
|
354
|
+
const c = typeof P == "string" ? P : "", o = A.env();
|
|
355
355
|
Object.keys(o).forEach(function(t) {
|
|
356
|
-
if (
|
|
357
|
-
const p = t.split("__").map(function(
|
|
358
|
-
return d === 0 && (
|
|
356
|
+
if (c === "" || t.lastIndexOf(c, 0) === 0) {
|
|
357
|
+
const p = t.split("__").map(function(l, d) {
|
|
358
|
+
return d === 0 && (l = l.substring(c.length)), W(l);
|
|
359
359
|
});
|
|
360
|
-
(
|
|
360
|
+
(i && r.configs[p.join(".")] || !i) && !E(e, p) && q(p.join("."), o[t]);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
364
|
function fe(e) {
|
|
365
|
-
let
|
|
366
|
-
const
|
|
365
|
+
let i;
|
|
366
|
+
const c = /* @__PURE__ */ new Set();
|
|
367
367
|
Object.keys(e).forEach(function(o) {
|
|
368
|
-
if (!
|
|
368
|
+
if (!c.has(o) && (i = g(o, r.coercions), typeof i == "function"))
|
|
369
369
|
try {
|
|
370
|
-
const t = $(o,
|
|
370
|
+
const t = $(o, i(e[o]));
|
|
371
371
|
[].concat(r.aliases[o] || [], o).forEach((p) => {
|
|
372
|
-
|
|
372
|
+
c.add(p), e[p] = t;
|
|
373
373
|
});
|
|
374
374
|
} catch (t) {
|
|
375
375
|
B = t;
|
|
@@ -377,67 +377,67 @@ class Ne {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
function be(e) {
|
|
380
|
-
return r.keys.forEach((
|
|
381
|
-
~
|
|
380
|
+
return r.keys.forEach((i) => {
|
|
381
|
+
~i.indexOf(".") || typeof e[i] > "u" && (e[i] = void 0);
|
|
382
382
|
}), e;
|
|
383
383
|
}
|
|
384
|
-
function me(e,
|
|
385
|
-
Object.keys(
|
|
386
|
-
E(e, t.split(".")) || (N(e, t.split("."),
|
|
387
|
-
E(e, p.split(".")) || N(e, p.split("."),
|
|
384
|
+
function me(e, i, c, o = !1) {
|
|
385
|
+
Object.keys(c).forEach(function(t) {
|
|
386
|
+
E(e, t.split(".")) || (N(e, t.split("."), c[t]), o && (oe[t] = !0), (i[t] || []).forEach(function(p) {
|
|
387
|
+
E(e, p.split(".")) || N(e, p.split("."), c[t]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function E(e,
|
|
392
|
-
let
|
|
393
|
-
h["dot-notation"] || (
|
|
394
|
-
|
|
391
|
+
function E(e, i) {
|
|
392
|
+
let c = e;
|
|
393
|
+
h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(t) {
|
|
394
|
+
c = c[t] || {};
|
|
395
395
|
});
|
|
396
|
-
const o =
|
|
397
|
-
return typeof
|
|
396
|
+
const o = i[i.length - 1];
|
|
397
|
+
return typeof c != "object" ? !1 : o in c;
|
|
398
398
|
}
|
|
399
|
-
function N(e,
|
|
399
|
+
function N(e, i, c) {
|
|
400
400
|
let o = e;
|
|
401
|
-
h["dot-notation"] || (
|
|
402
|
-
v =
|
|
401
|
+
h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(v) {
|
|
402
|
+
v = ce(v), typeof o == "object" && o[v] === void 0 && (o[v] = {}), typeof o[v] != "object" || Array.isArray(o[v]) ? (Array.isArray(o[v]) ? o[v].push({}) : o[v] = [o[v], {}], o = o[v][o[v].length - 1]) : o = o[v];
|
|
403
403
|
});
|
|
404
|
-
const t =
|
|
404
|
+
const t = ce(i[i.length - 1]), p = g(i.join("."), r.arrays), l = Array.isArray(c);
|
|
405
405
|
let d = h["duplicate-arguments-array"];
|
|
406
|
-
!d && g(t, r.nargs) && (d = !0, (!T(o[t]) && r.nargs[t] === 1 || Array.isArray(o[t]) && o[t].length === r.nargs[t]) && (o[t] = void 0)),
|
|
406
|
+
!d && g(t, r.nargs) && (d = !0, (!T(o[t]) && r.nargs[t] === 1 || Array.isArray(o[t]) && o[t].length === r.nargs[t]) && (o[t] = void 0)), c === Z() ? o[t] = Z(o[t]) : Array.isArray(o[t]) ? d && p && l ? o[t] = h["flatten-duplicate-arrays"] ? o[t].concat(c) : (Array.isArray(o[t][0]) ? o[t] : [o[t]]).concat([c]) : !d && !!p == !!l ? o[t] = c : o[t] = o[t].concat([c]) : o[t] === void 0 && p ? o[t] = l ? c : [c] : d && !(o[t] === void 0 || g(t, r.counts) || g(t, r.bools)) ? o[t] = [o[t], c] : o[t] = c;
|
|
407
407
|
}
|
|
408
408
|
function qe(...e) {
|
|
409
|
-
e.forEach(function(
|
|
410
|
-
Object.keys(
|
|
411
|
-
r.aliases[
|
|
409
|
+
e.forEach(function(i) {
|
|
410
|
+
Object.keys(i || {}).forEach(function(c) {
|
|
411
|
+
r.aliases[c] || (r.aliases[c] = [].concat(_[c] || []), r.aliases[c].concat(c).forEach(function(o) {
|
|
412
412
|
if (/-/.test(o) && h["camel-case-expansion"]) {
|
|
413
413
|
const t = W(o);
|
|
414
|
-
t !==
|
|
414
|
+
t !== c && r.aliases[c].indexOf(t) === -1 && (r.aliases[c].push(t), Q[t] = !0);
|
|
415
415
|
}
|
|
416
|
-
}), r.aliases[
|
|
416
|
+
}), r.aliases[c].concat(c).forEach(function(o) {
|
|
417
417
|
if (o.length > 1 && /[A-Z]/.test(o) && h["camel-case-expansion"]) {
|
|
418
418
|
const t = Oe(o, "-");
|
|
419
|
-
t !==
|
|
419
|
+
t !== c && r.aliases[c].indexOf(t) === -1 && (r.aliases[c].push(t), Q[t] = !0);
|
|
420
420
|
}
|
|
421
|
-
}), r.aliases[
|
|
422
|
-
r.aliases[o] = [
|
|
421
|
+
}), r.aliases[c].forEach(function(o) {
|
|
422
|
+
r.aliases[o] = [c].concat(r.aliases[c].filter(function(t) {
|
|
423
423
|
return o !== t;
|
|
424
424
|
}));
|
|
425
425
|
}));
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function g(e,
|
|
430
|
-
const
|
|
431
|
-
return t ?
|
|
429
|
+
function g(e, i) {
|
|
430
|
+
const c = [].concat(r.aliases[e] || [], e), o = Object.keys(i), t = c.find((p) => o.includes(p));
|
|
431
|
+
return t ? i[t] : !1;
|
|
432
432
|
}
|
|
433
433
|
function ue(e) {
|
|
434
|
-
const
|
|
435
|
-
return [].concat(
|
|
434
|
+
const i = Object.keys(r);
|
|
435
|
+
return [].concat(i.map((o) => r[o])).some(function(o) {
|
|
436
436
|
return Array.isArray(o) ? o.includes(e) : o[e];
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function we(e, ...
|
|
440
|
-
return [].concat(...
|
|
439
|
+
function we(e, ...i) {
|
|
440
|
+
return [].concat(...i).some(function(o) {
|
|
441
441
|
const t = e.match(o);
|
|
442
442
|
return t && ue(t[1]);
|
|
443
443
|
});
|
|
@@ -445,17 +445,17 @@ class Ne {
|
|
|
445
445
|
function ve(e) {
|
|
446
446
|
if (e.match(L) || !e.match(/^-[^-]+/))
|
|
447
447
|
return !1;
|
|
448
|
-
let
|
|
448
|
+
let i = !0, c;
|
|
449
449
|
const o = e.slice(1).split("");
|
|
450
450
|
for (let t = 0; t < o.length; t++) {
|
|
451
|
-
if (
|
|
452
|
-
|
|
451
|
+
if (c = e.slice(t + 2), !ue(o[t])) {
|
|
452
|
+
i = !1;
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
|
-
if (o[t + 1] && o[t + 1] === "=" ||
|
|
455
|
+
if (o[t + 1] && o[t + 1] === "=" || c === "-" || /[A-Za-z]/.test(o[t]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(c) || o[t + 1] && o[t + 1].match(/\W/))
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return i;
|
|
459
459
|
}
|
|
460
460
|
function H(e) {
|
|
461
461
|
return h["unknown-options-as-args"] && xe(e);
|
|
@@ -475,8 +475,8 @@ class Ne {
|
|
|
475
475
|
}[e];
|
|
476
476
|
}
|
|
477
477
|
function Be(e) {
|
|
478
|
-
let
|
|
479
|
-
return g(e, r.strings) ?
|
|
478
|
+
let i = I.BOOLEAN;
|
|
479
|
+
return g(e, r.strings) ? i = I.STRING : g(e, r.numbers) ? i = I.NUMBER : g(e, r.bools) ? i = I.BOOLEAN : g(e, r.arrays) && (i = I.ARRAY), i;
|
|
480
480
|
}
|
|
481
481
|
function T(e) {
|
|
482
482
|
return e === void 0;
|
|
@@ -494,11 +494,11 @@ class Ne {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function ze(
|
|
497
|
+
function ze(a) {
|
|
498
498
|
const n = [], m = /* @__PURE__ */ Object.create(null);
|
|
499
499
|
let s = !0;
|
|
500
|
-
for (Object.keys(
|
|
501
|
-
n.push([].concat(
|
|
500
|
+
for (Object.keys(a).forEach(function(u) {
|
|
501
|
+
n.push([].concat(a[u], u));
|
|
502
502
|
}); s; ) {
|
|
503
503
|
s = !1;
|
|
504
504
|
for (let u = 0; u < n.length; u++)
|
|
@@ -518,14 +518,14 @@ function ze(i) {
|
|
|
518
518
|
k !== void 0 && typeof k == "string" && (m[k] = u);
|
|
519
519
|
}), m;
|
|
520
520
|
}
|
|
521
|
-
function Z(
|
|
522
|
-
return
|
|
521
|
+
function Z(a) {
|
|
522
|
+
return a !== void 0 ? a + 1 : 1;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
return
|
|
524
|
+
function ce(a) {
|
|
525
|
+
return a === "__proto__" ? "___proto___" : a;
|
|
526
526
|
}
|
|
527
|
-
function je(
|
|
528
|
-
return typeof
|
|
527
|
+
function je(a) {
|
|
528
|
+
return typeof a == "string" && (a[0] === "'" || a[0] === '"') && a[a.length - 1] === a[0] ? a.substring(1, a.length - 1) : a;
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
531
531
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
@@ -536,23 +536,23 @@ function je(i) {
|
|
|
536
536
|
* SPDX-License-Identifier: ISC
|
|
537
537
|
*/
|
|
538
538
|
var X, ee, te;
|
|
539
|
-
const
|
|
540
|
-
if (pe && Number(pe.match(/^([^.]+)/)[1]) <
|
|
541
|
-
throw Error(`yargs parser supports a minimum Node.js version of ${
|
|
539
|
+
const le = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, pe = (ee = (X = process == null ? void 0 : process.versions) === null || X === void 0 ? void 0 : X.node) !== null && ee !== void 0 ? ee : (te = process == null ? void 0 : process.version) === null || te === void 0 ? void 0 : te.slice(1);
|
|
540
|
+
if (pe && Number(pe.match(/^([^.]+)/)[1]) < le)
|
|
541
|
+
throw Error(`yargs parser supports a minimum Node.js version of ${le}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
542
542
|
const Qe = process ? process.env : {};
|
|
543
543
|
new Ne({
|
|
544
544
|
cwd: process.cwd,
|
|
545
545
|
env: () => Qe,
|
|
546
546
|
format: he,
|
|
547
547
|
normalize: Ie,
|
|
548
|
-
resolve:
|
|
548
|
+
resolve: ie,
|
|
549
549
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
550
550
|
// we can exercise all the lines below:
|
|
551
|
-
require: (
|
|
551
|
+
require: (a) => {
|
|
552
552
|
if (typeof require < "u")
|
|
553
|
-
return require(
|
|
554
|
-
if (
|
|
555
|
-
return JSON.parse(_e(
|
|
553
|
+
return require(a);
|
|
554
|
+
if (a.match(/\.json$/))
|
|
555
|
+
return JSON.parse(_e(a, "utf8"));
|
|
556
556
|
throw Error("only .json config files are supported in ESM");
|
|
557
557
|
}
|
|
558
558
|
});
|
|
@@ -562,10 +562,10 @@ const Fe = {
|
|
|
562
562
|
writeFile: Le
|
|
563
563
|
},
|
|
564
564
|
format: he,
|
|
565
|
-
resolve:
|
|
566
|
-
exists: (
|
|
565
|
+
resolve: ie,
|
|
566
|
+
exists: (a) => {
|
|
567
567
|
try {
|
|
568
|
-
return Pe(
|
|
568
|
+
return Pe(a).isFile();
|
|
569
569
|
} catch {
|
|
570
570
|
return !1;
|
|
571
571
|
}
|
|
@@ -658,9 +658,9 @@ class De {
|
|
|
658
658
|
return M.exists(n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function Ve(
|
|
661
|
+
function Ve(a, n) {
|
|
662
662
|
M = n;
|
|
663
|
-
const m = new De(
|
|
663
|
+
const m = new De(a);
|
|
664
664
|
return {
|
|
665
665
|
__: m.__.bind(m),
|
|
666
666
|
__n: m.__n.bind(m),
|
|
@@ -670,7 +670,7 @@ function Ve(i, n) {
|
|
|
670
670
|
locale: m.locale
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
const $e = (
|
|
673
|
+
const $e = (a) => Ve(a, Fe);
|
|
674
674
|
let z;
|
|
675
675
|
try {
|
|
676
676
|
z = Te(import.meta.url);
|
|
@@ -679,10 +679,10 @@ try {
|
|
|
679
679
|
}
|
|
680
680
|
const He = z.substring(0, z.lastIndexOf("node_modules"));
|
|
681
681
|
He || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $e({
|
|
682
|
-
directory:
|
|
682
|
+
directory: ie(z, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const ae = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -2506,7 +2506,12 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2506
2506
|
{
|
|
2507
2507
|
path: "promptTokenCount",
|
|
2508
2508
|
dest: "input_tokens",
|
|
2509
|
-
required: !
|
|
2509
|
+
required: !1
|
|
2510
|
+
},
|
|
2511
|
+
{
|
|
2512
|
+
path: "cachedContentTokenCount",
|
|
2513
|
+
dest: "cache_read_tokens",
|
|
2514
|
+
required: !1
|
|
2510
2515
|
},
|
|
2511
2516
|
{
|
|
2512
2517
|
path: [
|
|
@@ -2515,17 +2520,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2515
2520
|
type: "array-match",
|
|
2516
2521
|
field: "modality",
|
|
2517
2522
|
match: {
|
|
2518
|
-
equals: "
|
|
2523
|
+
equals: "AUDIO"
|
|
2519
2524
|
}
|
|
2520
2525
|
},
|
|
2521
2526
|
"tokenCount"
|
|
2522
2527
|
],
|
|
2523
|
-
dest: "
|
|
2528
|
+
dest: "cache_audio_read_tokens",
|
|
2524
2529
|
required: !1
|
|
2525
2530
|
},
|
|
2526
2531
|
{
|
|
2527
2532
|
path: [
|
|
2528
|
-
"
|
|
2533
|
+
"promptTokensDetails",
|
|
2529
2534
|
{
|
|
2530
2535
|
type: "array-match",
|
|
2531
2536
|
field: "modality",
|
|
@@ -2535,12 +2540,12 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2535
2540
|
},
|
|
2536
2541
|
"tokenCount"
|
|
2537
2542
|
],
|
|
2538
|
-
dest: "
|
|
2543
|
+
dest: "input_audio_tokens",
|
|
2539
2544
|
required: !1
|
|
2540
2545
|
},
|
|
2541
2546
|
{
|
|
2542
2547
|
path: [
|
|
2543
|
-
"
|
|
2548
|
+
"candidatesTokensDetails",
|
|
2544
2549
|
{
|
|
2545
2550
|
type: "array-match",
|
|
2546
2551
|
field: "modality",
|
|
@@ -2550,18 +2555,23 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2550
2555
|
},
|
|
2551
2556
|
"tokenCount"
|
|
2552
2557
|
],
|
|
2553
|
-
dest: "
|
|
2558
|
+
dest: "output_audio_tokens",
|
|
2554
2559
|
required: !1
|
|
2555
2560
|
},
|
|
2556
2561
|
{
|
|
2557
2562
|
path: "candidatesTokenCount",
|
|
2558
2563
|
dest: "output_tokens",
|
|
2559
|
-
required: !
|
|
2564
|
+
required: !1
|
|
2560
2565
|
},
|
|
2561
2566
|
{
|
|
2562
2567
|
path: "thoughtsTokenCount",
|
|
2563
2568
|
dest: "output_tokens",
|
|
2564
2569
|
required: !1
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
path: "toolUsePromptTokenCount",
|
|
2573
|
+
dest: "output_tokens",
|
|
2574
|
+
required: !1
|
|
2565
2575
|
}
|
|
2566
2576
|
]
|
|
2567
2577
|
},
|
|
@@ -2974,6 +2984,43 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
2974
2984
|
}
|
|
2975
2985
|
}
|
|
2976
2986
|
},
|
|
2987
|
+
{
|
|
2988
|
+
id: "gemini-3-pro-preview",
|
|
2989
|
+
name: "Gemini 3 Pro Preview",
|
|
2990
|
+
description: "The best model in the world for multimodal understanding, and our most powerful agentic and vibe-coding model yet.",
|
|
2991
|
+
match: {
|
|
2992
|
+
starts_with: "gemini-3-pro-preview"
|
|
2993
|
+
},
|
|
2994
|
+
prices: {
|
|
2995
|
+
input_mtok: {
|
|
2996
|
+
base: 2,
|
|
2997
|
+
tiers: [
|
|
2998
|
+
{
|
|
2999
|
+
start: 2e5,
|
|
3000
|
+
price: 4
|
|
3001
|
+
}
|
|
3002
|
+
]
|
|
3003
|
+
},
|
|
3004
|
+
cache_read_mtok: {
|
|
3005
|
+
base: 0.2,
|
|
3006
|
+
tiers: [
|
|
3007
|
+
{
|
|
3008
|
+
start: 2e5,
|
|
3009
|
+
price: 0.4
|
|
3010
|
+
}
|
|
3011
|
+
]
|
|
3012
|
+
},
|
|
3013
|
+
output_mtok: {
|
|
3014
|
+
base: 12,
|
|
3015
|
+
tiers: [
|
|
3016
|
+
{
|
|
3017
|
+
start: 2e5,
|
|
3018
|
+
price: 18
|
|
3019
|
+
}
|
|
3020
|
+
]
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
},
|
|
2977
3024
|
{
|
|
2978
3025
|
id: "gemini-embedding-001",
|
|
2979
3026
|
match: {
|
|
@@ -4404,6 +4451,17 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
4404
4451
|
output_mtok: 6
|
|
4405
4452
|
}
|
|
4406
4453
|
},
|
|
4454
|
+
{
|
|
4455
|
+
id: "computer-use",
|
|
4456
|
+
name: "Computer use",
|
|
4457
|
+
match: {
|
|
4458
|
+
starts_with: "computer-use"
|
|
4459
|
+
},
|
|
4460
|
+
prices: {
|
|
4461
|
+
input_mtok: 3,
|
|
4462
|
+
output_mtok: 12
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4407
4465
|
{
|
|
4408
4466
|
id: "curie",
|
|
4409
4467
|
match: {
|
|
@@ -5074,9 +5132,6 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
5074
5132
|
{
|
|
5075
5133
|
equals: "gpt-5.1-codex"
|
|
5076
5134
|
},
|
|
5077
|
-
{
|
|
5078
|
-
equals: "gpt-5.1-mini"
|
|
5079
|
-
},
|
|
5080
5135
|
{
|
|
5081
5136
|
equals: "gpt-5.1-chat-latest"
|
|
5082
5137
|
}
|
|
@@ -5089,6 +5144,26 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
5089
5144
|
output_mtok: 10
|
|
5090
5145
|
}
|
|
5091
5146
|
},
|
|
5147
|
+
{
|
|
5148
|
+
id: "gpt-5.1-codex-mini",
|
|
5149
|
+
name: "GPT-5.1 Codex Mini",
|
|
5150
|
+
match: {
|
|
5151
|
+
or: [
|
|
5152
|
+
{
|
|
5153
|
+
equals: "gpt-5.1-codex-mini"
|
|
5154
|
+
},
|
|
5155
|
+
{
|
|
5156
|
+
equals: "gpt-5.1-mini"
|
|
5157
|
+
}
|
|
5158
|
+
]
|
|
5159
|
+
},
|
|
5160
|
+
context_window: 4e5,
|
|
5161
|
+
prices: {
|
|
5162
|
+
input_mtok: 0.25,
|
|
5163
|
+
cache_read_mtok: 0.025,
|
|
5164
|
+
output_mtok: 2
|
|
5165
|
+
}
|
|
5166
|
+
},
|
|
5092
5167
|
{
|
|
5093
5168
|
id: "gpt-realtime",
|
|
5094
5169
|
match: {
|
|
@@ -12531,37 +12606,37 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
12531
12606
|
]
|
|
12532
12607
|
}
|
|
12533
12608
|
];
|
|
12534
|
-
function We(
|
|
12609
|
+
function We(a, n) {
|
|
12535
12610
|
if (n <= 0) return 0;
|
|
12536
12611
|
let m = 0;
|
|
12537
|
-
const s = [...
|
|
12538
|
-
m += k *
|
|
12612
|
+
const s = [...a.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
|
|
12613
|
+
m += k * a.base / 1e6;
|
|
12539
12614
|
for (let _ = 0; _ < s.length; _++) {
|
|
12540
12615
|
const h = s[_], f = s[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
|
|
12541
12616
|
y > 0 && (m += y * h.price / 1e6);
|
|
12542
12617
|
}
|
|
12543
12618
|
return m;
|
|
12544
12619
|
}
|
|
12545
|
-
function O(
|
|
12546
|
-
return
|
|
12620
|
+
function O(a, n, m) {
|
|
12621
|
+
return a === void 0 || n === void 0 ? 0 : typeof a == "number" ? a * n / 1e6 : We(a, n);
|
|
12547
12622
|
}
|
|
12548
|
-
function Ue(
|
|
12623
|
+
function Ue(a, n) {
|
|
12549
12624
|
let m = 0, s = 0;
|
|
12550
|
-
const u =
|
|
12551
|
-
let f =
|
|
12625
|
+
const u = a.cache_read_tokens ?? 0, k = a.cache_write_tokens ?? 0, _ = a.cache_audio_read_tokens ?? 0, h = a.output_audio_tokens ?? 0;
|
|
12626
|
+
let f = a.input_audio_tokens ?? 0;
|
|
12552
12627
|
if (f -= _, f < 0)
|
|
12553
12628
|
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
12554
|
-
let y =
|
|
12629
|
+
let y = a.input_tokens ?? 0;
|
|
12555
12630
|
if (y -= u, y -= k, y -= f, y < 0)
|
|
12556
12631
|
throw new Error("Uncached text input tokens cannot be negative");
|
|
12557
12632
|
let P = u;
|
|
12558
12633
|
if (P -= _, P < 0)
|
|
12559
12634
|
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
12560
12635
|
m += O(n.input_mtok, y), m += O(n.cache_read_mtok, P), m += O(n.cache_write_mtok, k), m += O(n.input_audio_mtok, f), m += O(n.cache_audio_read_mtok, _);
|
|
12561
|
-
let S =
|
|
12636
|
+
let S = a.output_tokens ?? 0;
|
|
12562
12637
|
if (S -= h, S < 0)
|
|
12563
12638
|
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
12564
|
-
s += O(n.output_mtok, S), s += O(n.output_audio_mtok,
|
|
12639
|
+
s += O(n.output_mtok, S), s += O(n.output_audio_mtok, a.output_audio_tokens);
|
|
12565
12640
|
let G = m + s;
|
|
12566
12641
|
return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
|
|
12567
12642
|
input_price: m,
|
|
@@ -12569,11 +12644,11 @@ function Ue(i, n) {
|
|
|
12569
12644
|
total_price: G
|
|
12570
12645
|
};
|
|
12571
12646
|
}
|
|
12572
|
-
function Ke(
|
|
12573
|
-
if (!Array.isArray(
|
|
12574
|
-
return
|
|
12575
|
-
for (let m =
|
|
12576
|
-
const s =
|
|
12647
|
+
function Ke(a, n) {
|
|
12648
|
+
if (!Array.isArray(a.prices))
|
|
12649
|
+
return a.prices;
|
|
12650
|
+
for (let m = a.prices.length - 1; m >= 0; m--) {
|
|
12651
|
+
const s = a.prices[m], u = s.constraint;
|
|
12577
12652
|
if (u === void 0)
|
|
12578
12653
|
return s.prices;
|
|
12579
12654
|
if (u.type === "start_date") {
|
|
@@ -12588,34 +12663,34 @@ function Ke(i, n) {
|
|
|
12588
12663
|
return s.prices;
|
|
12589
12664
|
}
|
|
12590
12665
|
}
|
|
12591
|
-
return
|
|
12666
|
+
return a.prices[0].prices;
|
|
12592
12667
|
}
|
|
12593
|
-
function j(
|
|
12594
|
-
return "or" in
|
|
12668
|
+
function j(a, n) {
|
|
12669
|
+
return "or" in a ? a.or.some((m) => j(m, n)) : "and" in a ? a.and.every((m) => j(m, n)) : "equals" in a ? n === a.equals : "starts_with" in a ? n.startsWith(a.starts_with) : "ends_with" in a ? n.endsWith(a.ends_with) : "contains" in a ? n.includes(a.contains) : "regex" in a ? new RegExp(a.regex).test(n) : !1;
|
|
12595
12670
|
}
|
|
12596
|
-
function Ye(
|
|
12597
|
-
const m = n.toLowerCase().trim(), s =
|
|
12598
|
-
return s ||
|
|
12671
|
+
function Ye(a, n) {
|
|
12672
|
+
const m = n.toLowerCase().trim(), s = a.find((u) => u.id === m);
|
|
12673
|
+
return s || a.find((u) => u.provider_match && j(u.provider_match, m));
|
|
12599
12674
|
}
|
|
12600
|
-
function Je(
|
|
12675
|
+
function Je(a, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
12601
12676
|
if (s)
|
|
12602
|
-
return Ye(
|
|
12677
|
+
return Ye(a, s);
|
|
12603
12678
|
if (m)
|
|
12604
|
-
return
|
|
12679
|
+
return a.find((u) => new RegExp(u.api_pattern).test(m));
|
|
12605
12680
|
if (n)
|
|
12606
|
-
return
|
|
12681
|
+
return a.find((u) => u.model_match && j(u.model_match, n));
|
|
12607
12682
|
}
|
|
12608
|
-
function Ze(
|
|
12609
|
-
return
|
|
12683
|
+
function Ze(a, n) {
|
|
12684
|
+
return a.find((m) => j(m.match, n));
|
|
12610
12685
|
}
|
|
12611
|
-
let Xe =
|
|
12612
|
-
Promise.resolve(
|
|
12613
|
-
function et(
|
|
12686
|
+
let Xe = ae;
|
|
12687
|
+
Promise.resolve(ae);
|
|
12688
|
+
function et(a, n, m) {
|
|
12614
12689
|
const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
|
|
12615
12690
|
if (!u) return null;
|
|
12616
12691
|
const k = Ze(u.models, s);
|
|
12617
12692
|
if (!k) return null;
|
|
12618
|
-
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(
|
|
12693
|
+
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(a, h);
|
|
12619
12694
|
return {
|
|
12620
12695
|
auto_update_timestamp: void 0,
|
|
12621
12696
|
model: k,
|
|
@@ -12627,15 +12702,15 @@ function et(i, n, m) {
|
|
|
12627
12702
|
const b = de(Ce(process.argv)).scriptName("genai-prices").command(
|
|
12628
12703
|
"list [provider]",
|
|
12629
12704
|
"List providers and models",
|
|
12630
|
-
(
|
|
12705
|
+
(a) => a.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
12631
12706
|
).command(
|
|
12632
12707
|
"calc <model...>",
|
|
12633
12708
|
"Calculate price",
|
|
12634
|
-
(
|
|
12709
|
+
(a) => a.positional("model", { array: !0, describe: "Model(s) (optionally provider:model)", type: "string" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("auto-update", { default: !1, type: "boolean" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" })
|
|
12635
12710
|
).option("auto-update", { describe: "Enable auto-update from GitHub", type: "boolean" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" }).version("0.1.0").help().parseSync();
|
|
12636
12711
|
function tt() {
|
|
12637
12712
|
if (b._[0] === "list") {
|
|
12638
|
-
const m =
|
|
12713
|
+
const m = ae;
|
|
12639
12714
|
if (b.provider) {
|
|
12640
12715
|
const s = m.find((u) => u.id === b.provider);
|
|
12641
12716
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|