@pydantic/genai-prices 0.0.42 → 0.0.43
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 +660 -244
- package/dist/index.cjs +3 -3
- package/dist/index.js +469 -53
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { format as
|
|
4
|
-
import { resolve as
|
|
5
|
-
import { readFileSync as
|
|
2
|
+
import dt from "yargs";
|
|
3
|
+
import { format as ht } from "util";
|
|
4
|
+
import { resolve as at, normalize as It } from "path";
|
|
5
|
+
import { readFileSync as _t, writeFile as Lt, statSync as Pt } from "fs";
|
|
6
6
|
import "assert";
|
|
7
|
-
import { fileURLToPath as
|
|
8
|
-
function
|
|
9
|
-
return
|
|
7
|
+
import { fileURLToPath as Tt } from "url";
|
|
8
|
+
function At() {
|
|
9
|
+
return St() ? 0 : 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function St() {
|
|
12
|
+
return Gt() && !process.defaultApp;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Gt() {
|
|
15
15
|
return !!process.versions.electron;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return i.slice(
|
|
17
|
+
function Ct(i) {
|
|
18
|
+
return i.slice(At() + 1);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
@@ -35,7 +35,7 @@ function W(i) {
|
|
|
35
35
|
return m;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ot(i, n) {
|
|
39
39
|
const m = i.toLowerCase();
|
|
40
40
|
n = n || "-";
|
|
41
41
|
let s = "";
|
|
@@ -45,7 +45,7 @@ function Oe(i, n) {
|
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Rt(i) {
|
|
49
49
|
return i == null ? !1 : typeof i == "number" || /^0x[0-9a-f]+$/i.test(i) ? !0 : /^0[^.]/.test(i) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -53,7 +53,7 @@ function Re(i) {
|
|
|
53
53
|
* Copyright (c) 2016, Contributors
|
|
54
54
|
* SPDX-License-Identifier: ISC
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
56
|
+
function Et(i) {
|
|
57
57
|
if (Array.isArray(i))
|
|
58
58
|
return i.map((_) => typeof _ != "string" ? _ + "" : _);
|
|
59
59
|
i = i.trim();
|
|
@@ -83,7 +83,7 @@ var I;
|
|
|
83
83
|
* SPDX-License-Identifier: ISC
|
|
84
84
|
*/
|
|
85
85
|
let A;
|
|
86
|
-
class
|
|
86
|
+
class Nt {
|
|
87
87
|
constructor(n) {
|
|
88
88
|
A = n;
|
|
89
89
|
}
|
|
@@ -105,7 +105,7 @@ class Ne {
|
|
|
105
105
|
number: void 0,
|
|
106
106
|
__: void 0,
|
|
107
107
|
key: void 0
|
|
108
|
-
}, m), u =
|
|
108
|
+
}, m), u = Et(n), k = typeof n == "string", _ = zt(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
|
|
109
109
|
"boolean-negation": !0,
|
|
110
110
|
"camel-case-expansion": !0,
|
|
111
111
|
"combine-arrays": !1,
|
|
@@ -124,7 +124,7 @@ class Ne {
|
|
|
124
124
|
"strip-aliased": !1,
|
|
125
125
|
"strip-dashed": !1,
|
|
126
126
|
"unknown-options-as-args": !1
|
|
127
|
-
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), y = s.configObjects || [], P = s.envPrefix, S = h["populate--"], G = S ? "--" : "_", Q = /* @__PURE__ */ Object.create(null),
|
|
127
|
+
}, s.configuration), f = Object.assign(/* @__PURE__ */ Object.create(null), s.default), y = s.configObjects || [], P = s.envPrefix, S = h["populate--"], G = S ? "--" : "_", Q = /* @__PURE__ */ Object.create(null), ot = /* @__PURE__ */ Object.create(null), C = s.__ || A.format, r = {
|
|
128
128
|
aliases: /* @__PURE__ */ Object.create(null),
|
|
129
129
|
arrays: /* @__PURE__ */ Object.create(null),
|
|
130
130
|
bools: /* @__PURE__ */ Object.create(null),
|
|
@@ -137,8 +137,8 @@ class Ne {
|
|
|
137
137
|
coercions: /* @__PURE__ */ Object.create(null),
|
|
138
138
|
keys: []
|
|
139
139
|
}, L = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, U = new RegExp("^--" + h["negation-prefix"] + "(.+)");
|
|
140
|
-
[].concat(s.array || []).filter(Boolean).forEach(function(
|
|
141
|
-
const a = typeof
|
|
140
|
+
[].concat(s.array || []).filter(Boolean).forEach(function(t) {
|
|
141
|
+
const a = typeof t == "object" ? t.key : t, c = Object.keys(t).map(function(o) {
|
|
142
142
|
return {
|
|
143
143
|
boolean: "bools",
|
|
144
144
|
string: "strings",
|
|
@@ -146,56 +146,56 @@ class Ne {
|
|
|
146
146
|
}[o];
|
|
147
147
|
}).filter(Boolean).pop();
|
|
148
148
|
c && (r[c][a] = !0), r.arrays[a] = !0, r.keys.push(a);
|
|
149
|
-
}), [].concat(s.boolean || []).filter(Boolean).forEach(function(
|
|
150
|
-
r.bools[
|
|
151
|
-
}), [].concat(s.string || []).filter(Boolean).forEach(function(
|
|
152
|
-
r.strings[
|
|
153
|
-
}), [].concat(s.number || []).filter(Boolean).forEach(function(
|
|
154
|
-
r.numbers[
|
|
155
|
-
}), [].concat(s.count || []).filter(Boolean).forEach(function(
|
|
156
|
-
r.counts[
|
|
157
|
-
}), [].concat(s.normalize || []).filter(Boolean).forEach(function(
|
|
158
|
-
r.normalize[
|
|
159
|
-
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([
|
|
160
|
-
typeof a == "number" && (r.nargs[
|
|
161
|
-
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([
|
|
162
|
-
typeof a == "function" && (r.coercions[
|
|
163
|
-
}), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(
|
|
164
|
-
r.configs[
|
|
165
|
-
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([
|
|
166
|
-
(typeof a == "boolean" || typeof a == "function") && (r.configs[
|
|
167
|
-
})),
|
|
168
|
-
(r.aliases[
|
|
169
|
-
f[a] = f[
|
|
149
|
+
}), [].concat(s.boolean || []).filter(Boolean).forEach(function(t) {
|
|
150
|
+
r.bools[t] = !0, r.keys.push(t);
|
|
151
|
+
}), [].concat(s.string || []).filter(Boolean).forEach(function(t) {
|
|
152
|
+
r.strings[t] = !0, r.keys.push(t);
|
|
153
|
+
}), [].concat(s.number || []).filter(Boolean).forEach(function(t) {
|
|
154
|
+
r.numbers[t] = !0, r.keys.push(t);
|
|
155
|
+
}), [].concat(s.count || []).filter(Boolean).forEach(function(t) {
|
|
156
|
+
r.counts[t] = !0, r.keys.push(t);
|
|
157
|
+
}), [].concat(s.normalize || []).filter(Boolean).forEach(function(t) {
|
|
158
|
+
r.normalize[t] = !0, r.keys.push(t);
|
|
159
|
+
}), typeof s.narg == "object" && Object.entries(s.narg).forEach(([t, a]) => {
|
|
160
|
+
typeof a == "number" && (r.nargs[t] = a, r.keys.push(t));
|
|
161
|
+
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([t, a]) => {
|
|
162
|
+
typeof a == "function" && (r.coercions[t] = a, r.keys.push(t));
|
|
163
|
+
}), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(t) {
|
|
164
|
+
r.configs[t] = !0;
|
|
165
|
+
}) : typeof s.config == "object" && Object.entries(s.config).forEach(([t, a]) => {
|
|
166
|
+
(typeof a == "boolean" || typeof a == "function") && (r.configs[t] = a);
|
|
167
|
+
})), qt(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(t) {
|
|
168
|
+
(r.aliases[t] || []).forEach(function(a) {
|
|
169
|
+
f[a] = f[t];
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
172
|
let B = null;
|
|
173
|
-
|
|
173
|
+
Mt();
|
|
174
174
|
let F = [];
|
|
175
|
-
const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }),
|
|
176
|
-
for (let
|
|
177
|
-
const a = u[
|
|
178
|
-
let o,
|
|
175
|
+
const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), nt = {};
|
|
176
|
+
for (let t = 0; t < u.length; t++) {
|
|
177
|
+
const a = u[t], c = a.replace(/^-{3,}/, "---");
|
|
178
|
+
let o, e, p, l, d, v;
|
|
179
179
|
if (a !== "--" && /^-/.test(a) && H(a))
|
|
180
180
|
K(a);
|
|
181
181
|
else if (c.match(/^---+(=|$)/)) {
|
|
182
182
|
K(a);
|
|
183
183
|
continue;
|
|
184
184
|
} else if (a.match(/^--.+=/) || !h["short-option-groups"] && a.match(/^-.+=/))
|
|
185
|
-
l = a.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ?
|
|
185
|
+
l = a.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ? t = V(t, l[1], u, l[2]) : g(l[1], r.nargs) !== !1 ? t = D(t, l[1], u, l[2]) : q(l[1], l[2], !0));
|
|
186
186
|
else if (a.match(U) && h["boolean-negation"])
|
|
187
|
-
l = a.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (
|
|
187
|
+
l = a.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], q(e, g(e, r.arrays) ? [!1] : !1));
|
|
188
188
|
else if (a.match(/^--.+/) || !h["short-option-groups"] && a.match(/^-[^-]+/))
|
|
189
|
-
l = a.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (
|
|
189
|
+
l = a.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], g(e, r.arrays) ? t = V(t, e, u) : g(e, r.nargs) !== !1 ? t = D(t, e, u) : (d = u[t + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, R(e))));
|
|
190
190
|
else if (a.match(/^-.\..+=/))
|
|
191
191
|
l = a.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
|
|
192
192
|
else if (a.match(/^-.\..+/) && !a.match(L))
|
|
193
|
-
d = u[
|
|
193
|
+
d = u[t + 1], l = a.match(/^-(.\..+)/), l !== null && Array.isArray(l) && l.length >= 2 && (e = l[1], d !== void 0 && !d.match(/^-/) && !g(e, r.bools) && !g(e, r.counts) ? (q(e, d), t++) : q(e, R(e)));
|
|
194
194
|
else if (a.match(/^-[^-]+/) && !a.match(L)) {
|
|
195
195
|
p = a.slice(1, -1).split(""), o = !1;
|
|
196
196
|
for (let x = 0; x < p.length; x++) {
|
|
197
197
|
if (d = a.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
|
|
198
|
-
v = a.slice(x + 3),
|
|
198
|
+
v = a.slice(x + 3), e = p[x], g(e, r.arrays) ? t = V(t, e, u, v) : g(e, r.nargs) !== !1 ? t = D(t, e, u, v) : q(e, v), o = !0;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
if (d === "-") {
|
|
@@ -212,82 +212,82 @@ class Ne {
|
|
|
212
212
|
} else
|
|
213
213
|
q(p[x], R(p[x]));
|
|
214
214
|
}
|
|
215
|
-
|
|
215
|
+
e = a.slice(-1)[0], !o && e !== "-" && (g(e, r.arrays) ? t = V(t, e, u) : g(e, r.nargs) !== !1 ? t = D(t, e, u) : (d = u[t + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(e, r.bools) && !g(e, r.counts) || /^(true|false)$/.test(d) ? (q(e, d), t++) : q(e, R(e))));
|
|
216
216
|
} else if (a.match(/^-[0-9]$/) && a.match(L) && g(a.slice(1), r.bools))
|
|
217
|
-
|
|
217
|
+
e = a.slice(1), q(e, R(e));
|
|
218
218
|
else if (a === "--") {
|
|
219
|
-
F = u.slice(
|
|
219
|
+
F = u.slice(t + 1);
|
|
220
220
|
break;
|
|
221
221
|
} else if (h["halt-at-non-option"]) {
|
|
222
|
-
F = u.slice(
|
|
222
|
+
F = u.slice(t);
|
|
223
223
|
break;
|
|
224
224
|
} else
|
|
225
225
|
K(a);
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
E(w,
|
|
229
|
-
}), S && F.length && (w[G] = []), F.forEach(function(
|
|
230
|
-
w[G].push(
|
|
231
|
-
}), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((
|
|
232
|
-
delete w[
|
|
233
|
-
}), h["strip-aliased"] && [].concat(...Object.keys(_).map((
|
|
234
|
-
h["camel-case-expansion"] &&
|
|
227
|
+
rt(w, !0), rt(w, !1), kt(w), gt(), mt(w, r.aliases, f, !0), ft(w), h["set-placeholder-key"] && bt(w), Object.keys(r.counts).forEach(function(t) {
|
|
228
|
+
E(w, t.split(".")) || q(t, 0);
|
|
229
|
+
}), S && F.length && (w[G] = []), F.forEach(function(t) {
|
|
230
|
+
w[G].push(t);
|
|
231
|
+
}), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((t) => t !== "--" && t.includes("-")).forEach((t) => {
|
|
232
|
+
delete w[t];
|
|
233
|
+
}), h["strip-aliased"] && [].concat(...Object.keys(_).map((t) => _[t])).forEach((t) => {
|
|
234
|
+
h["camel-case-expansion"] && t.includes("-") && delete w[t.split(".").map((a) => W(a)).join(".")], delete w[t];
|
|
235
235
|
});
|
|
236
|
-
function K(
|
|
237
|
-
const a = $("_",
|
|
236
|
+
function K(t) {
|
|
237
|
+
const a = $("_", t);
|
|
238
238
|
(typeof a == "string" || typeof a == "number") && w._.push(a);
|
|
239
239
|
}
|
|
240
|
-
function D(
|
|
241
|
-
let
|
|
240
|
+
function D(t, a, c, o) {
|
|
241
|
+
let e, p = g(a, 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", a))), q(a, R(a)),
|
|
243
|
+
return T(o) || (B = Error(C("Argument unexpected for: %s", a))), q(a, R(a)), t;
|
|
244
244
|
let l = T(o) ? 0 : 1;
|
|
245
245
|
if (h["nargs-eats-options"])
|
|
246
|
-
c.length - (
|
|
246
|
+
c.length - (t + 1) + l < p && (B = Error(C("Not enough arguments following: %s", a))), l = p;
|
|
247
247
|
else {
|
|
248
|
-
for (
|
|
248
|
+
for (e = t + 1; e < c.length && (!c[e].match(/^-[^0-9]/) || c[e].match(L) || H(c[e])); e++)
|
|
249
249
|
l++;
|
|
250
250
|
l < p && (B = Error(C("Not enough arguments following: %s", a)));
|
|
251
251
|
}
|
|
252
252
|
let d = Math.min(l, p);
|
|
253
|
-
for (!T(o) && d > 0 && (q(a, o), d--),
|
|
254
|
-
q(a, c[
|
|
255
|
-
return
|
|
253
|
+
for (!T(o) && d > 0 && (q(a, o), d--), e = t + 1; e < d + t + 1; e++)
|
|
254
|
+
q(a, c[e]);
|
|
255
|
+
return t + d;
|
|
256
256
|
}
|
|
257
|
-
function V(
|
|
258
|
-
let
|
|
257
|
+
function V(t, a, c, o) {
|
|
258
|
+
let e = [], p = o || c[t + 1];
|
|
259
259
|
const l = g(a, r.nargs);
|
|
260
260
|
if (g(a, r.bools) && !/^(true|false)$/.test(p))
|
|
261
|
-
|
|
261
|
+
e.push(!0);
|
|
262
262
|
else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
|
|
263
263
|
if (f[a] !== void 0) {
|
|
264
264
|
const d = f[a];
|
|
265
|
-
|
|
265
|
+
e = Array.isArray(d) ? d : [d];
|
|
266
266
|
}
|
|
267
267
|
} else {
|
|
268
|
-
T(o) ||
|
|
269
|
-
for (let d =
|
|
270
|
-
|
|
268
|
+
T(o) || e.push(Y(a, o, !0));
|
|
269
|
+
for (let d = t + 1; d < c.length && !(!h["greedy-arrays"] && e.length > 0 || l && typeof l == "number" && e.length >= l || (p = c[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
|
|
270
|
+
t = d, e.push(Y(a, p, k));
|
|
271
271
|
}
|
|
272
|
-
return typeof l == "number" && (l &&
|
|
272
|
+
return typeof l == "number" && (l && e.length < l || isNaN(l) && e.length === 0) && (B = Error(C("Not enough arguments following: %s", a))), q(a, e), t;
|
|
273
273
|
}
|
|
274
|
-
function q(
|
|
275
|
-
if (/-/.test(
|
|
276
|
-
const p =
|
|
274
|
+
function q(t, a, c = k) {
|
|
275
|
+
if (/-/.test(t) && h["camel-case-expansion"]) {
|
|
276
|
+
const p = t.split(".").map(function(l) {
|
|
277
277
|
return W(l);
|
|
278
278
|
}).join(".");
|
|
279
|
-
|
|
279
|
+
st(t, p);
|
|
280
280
|
}
|
|
281
|
-
const o = Y(
|
|
282
|
-
N(w,
|
|
281
|
+
const o = Y(t, a, c), e = t.split(".");
|
|
282
|
+
N(w, e, o), r.aliases[t] && r.aliases[t].forEach(function(p) {
|
|
283
283
|
const l = p.split(".");
|
|
284
284
|
N(w, l, o);
|
|
285
|
-
}),
|
|
285
|
+
}), e.length > 1 && h["dot-notation"] && (r.aliases[e[0]] || []).forEach(function(p) {
|
|
286
286
|
let l = p.split(".");
|
|
287
|
-
const d = [].concat(
|
|
288
|
-
d.shift(), l = l.concat(d), (r.aliases[
|
|
289
|
-
}), g(
|
|
290
|
-
Object.defineProperty(
|
|
287
|
+
const d = [].concat(e);
|
|
288
|
+
d.shift(), l = l.concat(d), (r.aliases[t] || []).includes(l.join(".")) || N(w, l, o);
|
|
289
|
+
}), g(t, r.normalize) && !g(t, r.arrays) && [t].concat(r.aliases[t] || []).forEach(function(l) {
|
|
290
|
+
Object.defineProperty(nt, l, {
|
|
291
291
|
enumerable: !0,
|
|
292
292
|
get() {
|
|
293
293
|
return a;
|
|
@@ -298,203 +298,203 @@ class Ne {
|
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
r.aliases[
|
|
301
|
+
function st(t, a) {
|
|
302
|
+
r.aliases[t] && r.aliases[t].length || (r.aliases[t] = [a], Q[a] = !0), r.aliases[a] && r.aliases[a].length || st(a, t);
|
|
303
303
|
}
|
|
304
|
-
function Y(
|
|
305
|
-
c && (a =
|
|
306
|
-
let o = Array.isArray(a) ? a.map(function(
|
|
307
|
-
return $(
|
|
308
|
-
}) : $(
|
|
309
|
-
return g(
|
|
304
|
+
function Y(t, a, c) {
|
|
305
|
+
c && (a = jt(a)), (g(t, r.bools) || g(t, r.counts)) && typeof a == "string" && (a = a === "true");
|
|
306
|
+
let o = Array.isArray(a) ? a.map(function(e) {
|
|
307
|
+
return $(t, e);
|
|
308
|
+
}) : $(t, a);
|
|
309
|
+
return g(t, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(t, r.normalize) && g(t, r.arrays) && (Array.isArray(a) ? o = a.map((e) => A.normalize(e)) : o = A.normalize(a)), o;
|
|
310
310
|
}
|
|
311
|
-
function $(
|
|
312
|
-
return !h["parse-positional-numbers"] &&
|
|
311
|
+
function $(t, a) {
|
|
312
|
+
return !h["parse-positional-numbers"] && t === "_" || !g(t, r.strings) && !g(t, r.bools) && !Array.isArray(a) && (Rt(a) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${a}`))) || !T(a) && g(t, r.numbers)) && (a = Number(a)), a;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function kt(t) {
|
|
315
315
|
const a = /* @__PURE__ */ Object.create(null);
|
|
316
|
-
|
|
317
|
-
const o =
|
|
316
|
+
mt(a, r.aliases, f), Object.keys(r.configs).forEach(function(c) {
|
|
317
|
+
const o = t[c] || a[c];
|
|
318
318
|
if (o)
|
|
319
319
|
try {
|
|
320
|
-
let
|
|
320
|
+
let e = null;
|
|
321
321
|
const p = A.resolve(A.cwd(), o), l = r.configs[c];
|
|
322
322
|
if (typeof l == "function") {
|
|
323
323
|
try {
|
|
324
|
-
|
|
324
|
+
e = l(p);
|
|
325
325
|
} catch (d) {
|
|
326
|
-
|
|
326
|
+
e = d;
|
|
327
327
|
}
|
|
328
|
-
if (
|
|
329
|
-
B =
|
|
328
|
+
if (e instanceof Error) {
|
|
329
|
+
B = e;
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
} else
|
|
333
|
-
|
|
334
|
-
J(
|
|
335
|
-
} catch (
|
|
336
|
-
|
|
333
|
+
e = A.require(p);
|
|
334
|
+
J(e);
|
|
335
|
+
} catch (e) {
|
|
336
|
+
e.name === "PermissionDenied" ? B = e : t[c] && (B = Error(C("Invalid JSON config file: %s", o)));
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
function J(
|
|
341
|
-
Object.keys(
|
|
342
|
-
const o =
|
|
343
|
-
typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o,
|
|
340
|
+
function J(t, a) {
|
|
341
|
+
Object.keys(t).forEach(function(c) {
|
|
342
|
+
const o = t[c], e = a ? a + "." + c : c;
|
|
343
|
+
typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, e) : (!E(w, e.split(".")) || g(e, r.arrays) && h["combine-arrays"]) && q(e, o);
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
typeof y < "u" && y.forEach(function(
|
|
348
|
-
J(
|
|
346
|
+
function gt() {
|
|
347
|
+
typeof y < "u" && y.forEach(function(t) {
|
|
348
|
+
J(t);
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function rt(t, a) {
|
|
352
352
|
if (typeof P > "u")
|
|
353
353
|
return;
|
|
354
354
|
const c = typeof P == "string" ? P : "", o = A.env();
|
|
355
|
-
Object.keys(o).forEach(function(
|
|
356
|
-
if (c === "" ||
|
|
357
|
-
const p =
|
|
355
|
+
Object.keys(o).forEach(function(e) {
|
|
356
|
+
if (c === "" || e.lastIndexOf(c, 0) === 0) {
|
|
357
|
+
const p = e.split("__").map(function(l, d) {
|
|
358
358
|
return d === 0 && (l = l.substring(c.length)), W(l);
|
|
359
359
|
});
|
|
360
|
-
(a && r.configs[p.join(".")] || !a) && !E(
|
|
360
|
+
(a && r.configs[p.join(".")] || !a) && !E(t, p) && q(p.join("."), o[e]);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ft(t) {
|
|
365
365
|
let a;
|
|
366
366
|
const c = /* @__PURE__ */ new Set();
|
|
367
|
-
Object.keys(
|
|
367
|
+
Object.keys(t).forEach(function(o) {
|
|
368
368
|
if (!c.has(o) && (a = g(o, r.coercions), typeof a == "function"))
|
|
369
369
|
try {
|
|
370
|
-
const
|
|
370
|
+
const e = $(o, a(t[o]));
|
|
371
371
|
[].concat(r.aliases[o] || [], o).forEach((p) => {
|
|
372
|
-
c.add(p),
|
|
372
|
+
c.add(p), t[p] = e;
|
|
373
373
|
});
|
|
374
|
-
} catch (
|
|
375
|
-
B =
|
|
374
|
+
} catch (e) {
|
|
375
|
+
B = e;
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function bt(t) {
|
|
380
380
|
return r.keys.forEach((a) => {
|
|
381
|
-
~a.indexOf(".") || typeof
|
|
382
|
-
}),
|
|
381
|
+
~a.indexOf(".") || typeof t[a] > "u" && (t[a] = void 0);
|
|
382
|
+
}), t;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
Object.keys(c).forEach(function(
|
|
386
|
-
E(
|
|
387
|
-
E(
|
|
384
|
+
function mt(t, a, c, o = !1) {
|
|
385
|
+
Object.keys(c).forEach(function(e) {
|
|
386
|
+
E(t, e.split(".")) || (N(t, e.split("."), c[e]), o && (ot[e] = !0), (a[e] || []).forEach(function(p) {
|
|
387
|
+
E(t, p.split(".")) || N(t, p.split("."), c[e]);
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function E(
|
|
392
|
-
let c =
|
|
393
|
-
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(
|
|
394
|
-
c = c[
|
|
391
|
+
function E(t, a) {
|
|
392
|
+
let c = t;
|
|
393
|
+
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(e) {
|
|
394
|
+
c = c[e] || {};
|
|
395
395
|
});
|
|
396
396
|
const o = a[a.length - 1];
|
|
397
397
|
return typeof c != "object" ? !1 : o in c;
|
|
398
398
|
}
|
|
399
|
-
function N(
|
|
400
|
-
let o =
|
|
399
|
+
function N(t, a, c) {
|
|
400
|
+
let o = t;
|
|
401
401
|
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(v) {
|
|
402
|
-
v =
|
|
402
|
+
v = ct(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
|
|
404
|
+
const e = ct(a[a.length - 1]), p = g(a.join("."), r.arrays), l = Array.isArray(c);
|
|
405
405
|
let d = h["duplicate-arguments-array"];
|
|
406
|
-
!d && g(
|
|
406
|
+
!d && g(e, r.nargs) && (d = !0, (!T(o[e]) && r.nargs[e] === 1 || Array.isArray(o[e]) && o[e].length === r.nargs[e]) && (o[e] = void 0)), c === Z() ? o[e] = Z(o[e]) : Array.isArray(o[e]) ? d && p && l ? o[e] = h["flatten-duplicate-arrays"] ? o[e].concat(c) : (Array.isArray(o[e][0]) ? o[e] : [o[e]]).concat([c]) : !d && !!p == !!l ? o[e] = c : o[e] = o[e].concat([c]) : o[e] === void 0 && p ? o[e] = l ? c : [c] : d && !(o[e] === void 0 || g(e, r.counts) || g(e, r.bools)) ? o[e] = [o[e], c] : o[e] = c;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
408
|
+
function qt(...t) {
|
|
409
|
+
t.forEach(function(a) {
|
|
410
410
|
Object.keys(a || {}).forEach(function(c) {
|
|
411
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
|
-
const
|
|
414
|
-
|
|
413
|
+
const e = W(o);
|
|
414
|
+
e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), Q[e] = !0);
|
|
415
415
|
}
|
|
416
416
|
}), r.aliases[c].concat(c).forEach(function(o) {
|
|
417
417
|
if (o.length > 1 && /[A-Z]/.test(o) && h["camel-case-expansion"]) {
|
|
418
|
-
const
|
|
419
|
-
|
|
418
|
+
const e = Ot(o, "-");
|
|
419
|
+
e !== c && r.aliases[c].indexOf(e) === -1 && (r.aliases[c].push(e), Q[e] = !0);
|
|
420
420
|
}
|
|
421
421
|
}), r.aliases[c].forEach(function(o) {
|
|
422
|
-
r.aliases[o] = [c].concat(r.aliases[c].filter(function(
|
|
423
|
-
return o !==
|
|
422
|
+
r.aliases[o] = [c].concat(r.aliases[c].filter(function(e) {
|
|
423
|
+
return o !== e;
|
|
424
424
|
}));
|
|
425
425
|
}));
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function g(
|
|
430
|
-
const c = [].concat(r.aliases[
|
|
431
|
-
return
|
|
429
|
+
function g(t, a) {
|
|
430
|
+
const c = [].concat(r.aliases[t] || [], t), o = Object.keys(a), e = c.find((p) => o.includes(p));
|
|
431
|
+
return e ? a[e] : !1;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function ut(t) {
|
|
434
434
|
const a = Object.keys(r);
|
|
435
435
|
return [].concat(a.map((o) => r[o])).some(function(o) {
|
|
436
|
-
return Array.isArray(o) ? o.includes(
|
|
436
|
+
return Array.isArray(o) ? o.includes(t) : o[t];
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function wt(t, ...a) {
|
|
440
440
|
return [].concat(...a).some(function(o) {
|
|
441
|
-
const
|
|
442
|
-
return
|
|
441
|
+
const e = t.match(o);
|
|
442
|
+
return e && ut(e[1]);
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
if (
|
|
445
|
+
function vt(t) {
|
|
446
|
+
if (t.match(L) || !t.match(/^-[^-]+/))
|
|
447
447
|
return !1;
|
|
448
448
|
let a = !0, c;
|
|
449
|
-
const o =
|
|
450
|
-
for (let
|
|
451
|
-
if (c =
|
|
449
|
+
const o = t.slice(1).split("");
|
|
450
|
+
for (let e = 0; e < o.length; e++) {
|
|
451
|
+
if (c = t.slice(e + 2), !ut(o[e])) {
|
|
452
452
|
a = !1;
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
|
-
if (o[
|
|
455
|
+
if (o[e + 1] && o[e + 1] === "=" || c === "-" || /[A-Za-z]/.test(o[e]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(c) || o[e + 1] && o[e + 1].match(/\W/))
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
458
|
return a;
|
|
459
459
|
}
|
|
460
|
-
function H(
|
|
461
|
-
return h["unknown-options-as-args"] &&
|
|
460
|
+
function H(t) {
|
|
461
|
+
return h["unknown-options-as-args"] && xt(t);
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
return
|
|
463
|
+
function xt(t) {
|
|
464
|
+
return t = t.replace(/^-{3,}/, "--"), t.match(L) || vt(t) ? !1 : !wt(t, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
|
|
465
465
|
}
|
|
466
|
-
function R(
|
|
467
|
-
return !g(
|
|
466
|
+
function R(t) {
|
|
467
|
+
return !g(t, r.bools) && !g(t, r.counts) && `${t}` in f ? f[t] : yt(Bt(t));
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function yt(t) {
|
|
470
470
|
return {
|
|
471
471
|
[I.BOOLEAN]: !0,
|
|
472
472
|
[I.STRING]: "",
|
|
473
473
|
[I.NUMBER]: void 0,
|
|
474
474
|
[I.ARRAY]: []
|
|
475
|
-
}[
|
|
475
|
+
}[t];
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Bt(t) {
|
|
478
478
|
let a = I.BOOLEAN;
|
|
479
|
-
return g(
|
|
479
|
+
return g(t, r.strings) ? a = I.STRING : g(t, r.numbers) ? a = I.NUMBER : g(t, r.bools) ? a = I.BOOLEAN : g(t, r.arrays) && (a = I.ARRAY), a;
|
|
480
480
|
}
|
|
481
|
-
function T(
|
|
482
|
-
return
|
|
481
|
+
function T(t) {
|
|
482
|
+
return t === void 0;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
Object.keys(r.counts).find((
|
|
484
|
+
function Mt() {
|
|
485
|
+
Object.keys(r.counts).find((t) => g(t, r.arrays) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.array.", t)), !0) : g(t, r.nargs) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.narg.", t)), !0) : !1);
|
|
486
486
|
}
|
|
487
487
|
return {
|
|
488
488
|
aliases: Object.assign({}, r.aliases),
|
|
489
|
-
argv: Object.assign(
|
|
489
|
+
argv: Object.assign(nt, w),
|
|
490
490
|
configuration: h,
|
|
491
|
-
defaulted: Object.assign({},
|
|
491
|
+
defaulted: Object.assign({}, ot),
|
|
492
492
|
error: B,
|
|
493
493
|
newAliases: Object.assign({}, Q)
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function zt(i) {
|
|
498
498
|
const n = [], m = /* @__PURE__ */ Object.create(null);
|
|
499
499
|
let s = !0;
|
|
500
500
|
for (Object.keys(i).forEach(function(u) {
|
|
@@ -521,10 +521,10 @@ function ze(i) {
|
|
|
521
521
|
function Z(i) {
|
|
522
522
|
return i !== void 0 ? i + 1 : 1;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function ct(i) {
|
|
525
525
|
return i === "__proto__" ? "___proto___" : i;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function jt(i) {
|
|
528
528
|
return typeof i == "string" && (i[0] === "'" || i[0] === '"') && i[i.length - 1] === i[0] ? i.substring(1, i.length - 1) : i;
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
@@ -535,44 +535,44 @@ function je(i) {
|
|
|
535
535
|
* Copyright (c) 2016, Contributors
|
|
536
536
|
* SPDX-License-Identifier: ISC
|
|
537
537
|
*/
|
|
538
|
-
var X,
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
throw Error(`yargs parser supports a minimum Node.js version of ${
|
|
542
|
-
const
|
|
543
|
-
new
|
|
538
|
+
var X, tt, et;
|
|
539
|
+
const lt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, pt = (tt = (X = process == null ? void 0 : process.versions) === null || X === void 0 ? void 0 : X.node) !== null && tt !== void 0 ? tt : (et = process == null ? void 0 : process.version) === null || et === void 0 ? void 0 : et.slice(1);
|
|
540
|
+
if (pt && Number(pt.match(/^([^.]+)/)[1]) < lt)
|
|
541
|
+
throw Error(`yargs parser supports a minimum Node.js version of ${lt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
542
|
+
const Qt = process ? process.env : {};
|
|
543
|
+
new Nt({
|
|
544
544
|
cwd: process.cwd,
|
|
545
|
-
env: () =>
|
|
546
|
-
format:
|
|
547
|
-
normalize:
|
|
548
|
-
resolve:
|
|
545
|
+
env: () => Qt,
|
|
546
|
+
format: ht,
|
|
547
|
+
normalize: It,
|
|
548
|
+
resolve: at,
|
|
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
551
|
require: (i) => {
|
|
552
552
|
if (typeof require < "u")
|
|
553
553
|
return require(i);
|
|
554
554
|
if (i.match(/\.json$/))
|
|
555
|
-
return JSON.parse(
|
|
555
|
+
return JSON.parse(_t(i, "utf8"));
|
|
556
556
|
throw Error("only .json config files are supported in ESM");
|
|
557
557
|
}
|
|
558
558
|
});
|
|
559
|
-
const
|
|
559
|
+
const Ft = {
|
|
560
560
|
fs: {
|
|
561
|
-
readFileSync:
|
|
562
|
-
writeFile:
|
|
561
|
+
readFileSync: _t,
|
|
562
|
+
writeFile: Lt
|
|
563
563
|
},
|
|
564
|
-
format:
|
|
565
|
-
resolve:
|
|
564
|
+
format: ht,
|
|
565
|
+
resolve: at,
|
|
566
566
|
exists: (i) => {
|
|
567
567
|
try {
|
|
568
|
-
return
|
|
568
|
+
return Pt(i).isFile();
|
|
569
569
|
} catch {
|
|
570
570
|
return !1;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
574
|
let M;
|
|
575
|
-
class
|
|
575
|
+
class Dt {
|
|
576
576
|
constructor(n) {
|
|
577
577
|
n = n || {}, this.directory = n.directory || "./locales", this.updateFiles = typeof n.updateFiles == "boolean" ? n.updateFiles : !0, this.locale = n.locale || "en", this.fallbackToLanguage = typeof n.fallbackToLanguage == "boolean" ? n.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = [];
|
|
578
578
|
}
|
|
@@ -658,9 +658,9 @@ class De {
|
|
|
658
658
|
return M.exists(n);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Vt(i, n) {
|
|
662
662
|
M = n;
|
|
663
|
-
const m = new
|
|
663
|
+
const m = new Dt(i);
|
|
664
664
|
return {
|
|
665
665
|
__: m.__.bind(m),
|
|
666
666
|
__n: m.__n.bind(m),
|
|
@@ -670,19 +670,19 @@ function Ve(i, n) {
|
|
|
670
670
|
locale: m.locale
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
const $
|
|
673
|
+
const $t = (i) => Vt(i, Ft);
|
|
674
674
|
let z;
|
|
675
675
|
try {
|
|
676
|
-
z =
|
|
676
|
+
z = Tt(import.meta.url);
|
|
677
677
|
} catch {
|
|
678
678
|
z = process.cwd();
|
|
679
679
|
}
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
directory:
|
|
680
|
+
const Ht = z.substring(0, z.lastIndexOf("node_modules"));
|
|
681
|
+
Ht || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $t({
|
|
682
|
+
directory: at(z, "../../../locales"),
|
|
683
683
|
updateFiles: !1
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const it = [
|
|
686
686
|
{
|
|
687
687
|
id: "anthropic",
|
|
688
688
|
name: "Anthropic",
|
|
@@ -731,6 +731,28 @@ const ie = [
|
|
|
731
731
|
required: !0
|
|
732
732
|
}
|
|
733
733
|
]
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
api_flavor: "chat",
|
|
737
|
+
root: "usage",
|
|
738
|
+
model_path: "model",
|
|
739
|
+
mappings: [
|
|
740
|
+
{
|
|
741
|
+
path: "prompt_tokens",
|
|
742
|
+
dest: "input_tokens",
|
|
743
|
+
required: !0
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
path: "cached_tokens",
|
|
747
|
+
dest: "cache_read_tokens",
|
|
748
|
+
required: !1
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
path: "completion_tokens",
|
|
752
|
+
dest: "output_tokens",
|
|
753
|
+
required: !0
|
|
754
|
+
}
|
|
755
|
+
]
|
|
734
756
|
}
|
|
735
757
|
],
|
|
736
758
|
models: [
|
|
@@ -1280,24 +1302,50 @@ const ie = [
|
|
|
1280
1302
|
}
|
|
1281
1303
|
},
|
|
1282
1304
|
{
|
|
1283
|
-
id: "
|
|
1284
|
-
name: "
|
|
1305
|
+
id: "deepseek.r1-v1:0",
|
|
1306
|
+
name: "DeepSeek-R1",
|
|
1285
1307
|
match: {
|
|
1286
|
-
contains: "
|
|
1308
|
+
contains: "r1"
|
|
1287
1309
|
},
|
|
1288
1310
|
prices: {
|
|
1289
|
-
input_mtok:
|
|
1311
|
+
input_mtok: 1.35,
|
|
1312
|
+
output_mtok: 5.4
|
|
1290
1313
|
}
|
|
1291
1314
|
},
|
|
1292
1315
|
{
|
|
1293
|
-
id: "
|
|
1294
|
-
name: "DeepSeek-R1",
|
|
1316
|
+
id: "global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1295
1317
|
match: {
|
|
1296
|
-
|
|
1318
|
+
starts_with: "global.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1297
1319
|
},
|
|
1298
1320
|
prices: {
|
|
1299
|
-
input_mtok: 1
|
|
1300
|
-
|
|
1321
|
+
input_mtok: 1,
|
|
1322
|
+
cache_write_mtok: 1.25,
|
|
1323
|
+
cache_read_mtok: 0.1,
|
|
1324
|
+
output_mtok: 5
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
id: "global.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
1329
|
+
match: {
|
|
1330
|
+
starts_with: "global.anthropic.claude-sonnet-4-20250514-v1"
|
|
1331
|
+
},
|
|
1332
|
+
prices: {
|
|
1333
|
+
input_mtok: 3,
|
|
1334
|
+
cache_write_mtok: 3.75,
|
|
1335
|
+
cache_read_mtok: 0.3,
|
|
1336
|
+
output_mtok: 15
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
id: "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
1341
|
+
match: {
|
|
1342
|
+
starts_with: "global.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1343
|
+
},
|
|
1344
|
+
prices: {
|
|
1345
|
+
input_mtok: 3,
|
|
1346
|
+
cache_write_mtok: 3.75,
|
|
1347
|
+
cache_read_mtok: 0.3,
|
|
1348
|
+
output_mtok: 15
|
|
1301
1349
|
}
|
|
1302
1350
|
},
|
|
1303
1351
|
{
|
|
@@ -1519,6 +1567,374 @@ const ie = [
|
|
|
1519
1567
|
input_mtok: 0.15,
|
|
1520
1568
|
output_mtok: 0.6
|
|
1521
1569
|
}
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
id: "regional.anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
1573
|
+
match: {
|
|
1574
|
+
or: [
|
|
1575
|
+
{
|
|
1576
|
+
starts_with: "us.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
starts_with: "au.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
starts_with: "apac.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
starts_with: "eu.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
starts_with: "us-gov.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
starts_with: "jp.anthropic.claude-3-5-haiku-20241022-v1"
|
|
1592
|
+
}
|
|
1593
|
+
]
|
|
1594
|
+
},
|
|
1595
|
+
prices: {
|
|
1596
|
+
input_mtok: 0.8,
|
|
1597
|
+
cache_write_mtok: 1,
|
|
1598
|
+
cache_read_mtok: 0.08,
|
|
1599
|
+
output_mtok: 4
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
{
|
|
1603
|
+
id: "regional.anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
1604
|
+
match: {
|
|
1605
|
+
or: [
|
|
1606
|
+
{
|
|
1607
|
+
starts_with: "us.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
starts_with: "au.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
starts_with: "apac.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
starts_with: "eu.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
starts_with: "us-gov.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
starts_with: "jp.anthropic.claude-3-5-sonnet-20240620-v1"
|
|
1623
|
+
}
|
|
1624
|
+
]
|
|
1625
|
+
},
|
|
1626
|
+
prices: {
|
|
1627
|
+
input_mtok: 3,
|
|
1628
|
+
cache_write_mtok: 3.75,
|
|
1629
|
+
cache_read_mtok: 0.3,
|
|
1630
|
+
output_mtok: 15
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
id: "regional.anthropic.claude-3-5-sonnet-20241022-v2:0",
|
|
1635
|
+
match: {
|
|
1636
|
+
or: [
|
|
1637
|
+
{
|
|
1638
|
+
starts_with: "us.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
starts_with: "au.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
starts_with: "apac.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
starts_with: "eu.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
starts_with: "us-gov.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
starts_with: "jp.anthropic.claude-3-5-sonnet-20241022-v2"
|
|
1654
|
+
}
|
|
1655
|
+
]
|
|
1656
|
+
},
|
|
1657
|
+
prices: {
|
|
1658
|
+
input_mtok: 3,
|
|
1659
|
+
cache_write_mtok: 3.75,
|
|
1660
|
+
cache_read_mtok: 0.3,
|
|
1661
|
+
output_mtok: 15
|
|
1662
|
+
}
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
id: "regional.anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
1666
|
+
match: {
|
|
1667
|
+
or: [
|
|
1668
|
+
{
|
|
1669
|
+
starts_with: "us.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
starts_with: "au.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
starts_with: "apac.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
starts_with: "eu.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
starts_with: "us-gov.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
starts_with: "jp.anthropic.claude-3-7-sonnet-20250219-v1"
|
|
1685
|
+
}
|
|
1686
|
+
]
|
|
1687
|
+
},
|
|
1688
|
+
prices: {
|
|
1689
|
+
input_mtok: 3,
|
|
1690
|
+
cache_write_mtok: 3.75,
|
|
1691
|
+
cache_read_mtok: 0.3,
|
|
1692
|
+
output_mtok: 15
|
|
1693
|
+
}
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
id: "regional.anthropic.claude-3-haiku-20240307-v1:0",
|
|
1697
|
+
match: {
|
|
1698
|
+
or: [
|
|
1699
|
+
{
|
|
1700
|
+
starts_with: "us.anthropic.claude-3-haiku-20240307-v1"
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
starts_with: "au.anthropic.claude-3-haiku-20240307-v1"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
starts_with: "apac.anthropic.claude-3-haiku-20240307-v1"
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
starts_with: "eu.anthropic.claude-3-haiku-20240307-v1"
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
starts_with: "us-gov.anthropic.claude-3-haiku-20240307-v1"
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
starts_with: "jp.anthropic.claude-3-haiku-20240307-v1"
|
|
1716
|
+
}
|
|
1717
|
+
]
|
|
1718
|
+
},
|
|
1719
|
+
prices: {
|
|
1720
|
+
input_mtok: 0.25,
|
|
1721
|
+
output_mtok: 1.25
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
id: "regional.anthropic.claude-3-opus-20240229-v1:0",
|
|
1726
|
+
match: {
|
|
1727
|
+
or: [
|
|
1728
|
+
{
|
|
1729
|
+
starts_with: "us.anthropic.claude-3-opus-20240229-v1"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
starts_with: "au.anthropic.claude-3-opus-20240229-v1"
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
starts_with: "apac.anthropic.claude-3-opus-20240229-v1"
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
starts_with: "eu.anthropic.claude-3-opus-20240229-v1"
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
starts_with: "us-gov.anthropic.claude-3-opus-20240229-v1"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
starts_with: "jp.anthropic.claude-3-opus-20240229-v1"
|
|
1745
|
+
}
|
|
1746
|
+
]
|
|
1747
|
+
},
|
|
1748
|
+
prices: {
|
|
1749
|
+
input_mtok: 15,
|
|
1750
|
+
output_mtok: 75
|
|
1751
|
+
}
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
id: "regional.anthropic.claude-3-sonnet-20240229-v1:0",
|
|
1755
|
+
match: {
|
|
1756
|
+
or: [
|
|
1757
|
+
{
|
|
1758
|
+
starts_with: "us.anthropic.claude-3-sonnet-20240229-v1"
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
starts_with: "au.anthropic.claude-3-sonnet-20240229-v1"
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
starts_with: "apac.anthropic.claude-3-sonnet-20240229-v1"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
starts_with: "eu.anthropic.claude-3-sonnet-20240229-v1"
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
starts_with: "us-gov.anthropic.claude-3-sonnet-20240229-v1"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
starts_with: "jp.anthropic.claude-3-sonnet-20240229-v1"
|
|
1774
|
+
}
|
|
1775
|
+
]
|
|
1776
|
+
},
|
|
1777
|
+
prices: {
|
|
1778
|
+
input_mtok: 3,
|
|
1779
|
+
cache_write_mtok: 3.75,
|
|
1780
|
+
cache_read_mtok: 0.3,
|
|
1781
|
+
output_mtok: 15
|
|
1782
|
+
}
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
id: "regional.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1786
|
+
match: {
|
|
1787
|
+
or: [
|
|
1788
|
+
{
|
|
1789
|
+
starts_with: "us.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
starts_with: "au.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
starts_with: "apac.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
starts_with: "eu.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
starts_with: "us-gov.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
starts_with: "jp.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1805
|
+
}
|
|
1806
|
+
]
|
|
1807
|
+
},
|
|
1808
|
+
prices: {
|
|
1809
|
+
input_mtok: 1.1,
|
|
1810
|
+
cache_write_mtok: 1.375,
|
|
1811
|
+
cache_read_mtok: 0.11,
|
|
1812
|
+
output_mtok: 5.5
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
id: "regional.anthropic.claude-opus-4-1-20250805-v1:0",
|
|
1817
|
+
match: {
|
|
1818
|
+
or: [
|
|
1819
|
+
{
|
|
1820
|
+
starts_with: "us.anthropic.claude-opus-4-1-20250805-v1"
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
starts_with: "au.anthropic.claude-opus-4-1-20250805-v1"
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
starts_with: "apac.anthropic.claude-opus-4-1-20250805-v1"
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
starts_with: "eu.anthropic.claude-opus-4-1-20250805-v1"
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
starts_with: "us-gov.anthropic.claude-opus-4-1-20250805-v1"
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
starts_with: "jp.anthropic.claude-opus-4-1-20250805-v1"
|
|
1836
|
+
}
|
|
1837
|
+
]
|
|
1838
|
+
},
|
|
1839
|
+
prices: {
|
|
1840
|
+
input_mtok: 15,
|
|
1841
|
+
cache_write_mtok: 18.75,
|
|
1842
|
+
cache_read_mtok: 1.5,
|
|
1843
|
+
output_mtok: 75
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
id: "regional.anthropic.claude-opus-4-20250514-v1:0",
|
|
1848
|
+
match: {
|
|
1849
|
+
or: [
|
|
1850
|
+
{
|
|
1851
|
+
starts_with: "us.anthropic.claude-opus-4-20250514-v1"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
starts_with: "au.anthropic.claude-opus-4-20250514-v1"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
starts_with: "apac.anthropic.claude-opus-4-20250514-v1"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
starts_with: "eu.anthropic.claude-opus-4-20250514-v1"
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
starts_with: "us-gov.anthropic.claude-opus-4-20250514-v1"
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
starts_with: "jp.anthropic.claude-opus-4-20250514-v1"
|
|
1867
|
+
}
|
|
1868
|
+
]
|
|
1869
|
+
},
|
|
1870
|
+
prices: {
|
|
1871
|
+
input_mtok: 15,
|
|
1872
|
+
cache_write_mtok: 18.75,
|
|
1873
|
+
cache_read_mtok: 1.5,
|
|
1874
|
+
output_mtok: 75
|
|
1875
|
+
}
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
id: "regional.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
1879
|
+
match: {
|
|
1880
|
+
or: [
|
|
1881
|
+
{
|
|
1882
|
+
starts_with: "us.anthropic.claude-sonnet-4-20250514-v1"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
starts_with: "au.anthropic.claude-sonnet-4-20250514-v1"
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
starts_with: "apac.anthropic.claude-sonnet-4-20250514-v1"
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
starts_with: "eu.anthropic.claude-sonnet-4-20250514-v1"
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
starts_with: "us-gov.anthropic.claude-sonnet-4-20250514-v1"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
starts_with: "jp.anthropic.claude-sonnet-4-20250514-v1"
|
|
1898
|
+
}
|
|
1899
|
+
]
|
|
1900
|
+
},
|
|
1901
|
+
prices: {
|
|
1902
|
+
input_mtok: 3,
|
|
1903
|
+
cache_write_mtok: 3.75,
|
|
1904
|
+
cache_read_mtok: 0.3,
|
|
1905
|
+
output_mtok: 15
|
|
1906
|
+
}
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
id: "regional.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
1910
|
+
match: {
|
|
1911
|
+
or: [
|
|
1912
|
+
{
|
|
1913
|
+
starts_with: "us.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
starts_with: "au.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
starts_with: "apac.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
starts_with: "eu.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
starts_with: "us-gov.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
starts_with: "jp.anthropic.claude-sonnet-4-5-20250929-v1"
|
|
1929
|
+
}
|
|
1930
|
+
]
|
|
1931
|
+
},
|
|
1932
|
+
prices: {
|
|
1933
|
+
input_mtok: 3.3,
|
|
1934
|
+
cache_write_mtok: 4.125,
|
|
1935
|
+
cache_read_mtok: 0.33,
|
|
1936
|
+
output_mtok: 16.5
|
|
1937
|
+
}
|
|
1522
1938
|
}
|
|
1523
1939
|
]
|
|
1524
1940
|
},
|
|
@@ -12919,7 +13335,7 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
12919
13335
|
]
|
|
12920
13336
|
}
|
|
12921
13337
|
];
|
|
12922
|
-
function
|
|
13338
|
+
function Wt(i, n) {
|
|
12923
13339
|
if (n <= 0) return 0;
|
|
12924
13340
|
let m = 0;
|
|
12925
13341
|
const s = [...i.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
|
|
@@ -12931,9 +13347,9 @@ function We(i, n) {
|
|
|
12931
13347
|
return m;
|
|
12932
13348
|
}
|
|
12933
13349
|
function O(i, n, m) {
|
|
12934
|
-
return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 :
|
|
13350
|
+
return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : Wt(i, n);
|
|
12935
13351
|
}
|
|
12936
|
-
function
|
|
13352
|
+
function Ut(i, n) {
|
|
12937
13353
|
let m = 0, s = 0;
|
|
12938
13354
|
const u = i.cache_read_tokens ?? 0, k = i.cache_write_tokens ?? 0, _ = i.cache_audio_read_tokens ?? 0, h = i.output_audio_tokens ?? 0;
|
|
12939
13355
|
let f = i.input_audio_tokens ?? 0;
|
|
@@ -12957,7 +13373,7 @@ function Ue(i, n) {
|
|
|
12957
13373
|
total_price: G
|
|
12958
13374
|
};
|
|
12959
13375
|
}
|
|
12960
|
-
function
|
|
13376
|
+
function Kt(i, n) {
|
|
12961
13377
|
if (!Array.isArray(i.prices))
|
|
12962
13378
|
return i.prices;
|
|
12963
13379
|
for (let m = i.prices.length - 1; m >= 0; m--) {
|
|
@@ -12981,29 +13397,29 @@ function Ke(i, n) {
|
|
|
12981
13397
|
function j(i, n) {
|
|
12982
13398
|
return "or" in i ? i.or.some((m) => j(m, n)) : "and" in i ? i.and.every((m) => j(m, n)) : "equals" in i ? n === i.equals : "starts_with" in i ? n.startsWith(i.starts_with) : "ends_with" in i ? n.endsWith(i.ends_with) : "contains" in i ? n.includes(i.contains) : "regex" in i ? new RegExp(i.regex).test(n) : !1;
|
|
12983
13399
|
}
|
|
12984
|
-
function
|
|
13400
|
+
function Yt(i, n) {
|
|
12985
13401
|
const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
|
|
12986
13402
|
return s || i.find((u) => u.provider_match && j(u.provider_match, m));
|
|
12987
13403
|
}
|
|
12988
|
-
function
|
|
13404
|
+
function Jt(i, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
12989
13405
|
if (s)
|
|
12990
|
-
return
|
|
13406
|
+
return Yt(i, s);
|
|
12991
13407
|
if (m)
|
|
12992
13408
|
return i.find((u) => new RegExp(u.api_pattern).test(m));
|
|
12993
13409
|
if (n)
|
|
12994
13410
|
return i.find((u) => u.model_match && j(u.model_match, n));
|
|
12995
13411
|
}
|
|
12996
|
-
function
|
|
13412
|
+
function Zt(i, n) {
|
|
12997
13413
|
return i.find((m) => j(m.match, n));
|
|
12998
13414
|
}
|
|
12999
|
-
let
|
|
13000
|
-
Promise.resolve(
|
|
13001
|
-
function
|
|
13002
|
-
const s = n.toLowerCase().trim(), u = m?.provider ??
|
|
13415
|
+
let Xt = it;
|
|
13416
|
+
Promise.resolve(it);
|
|
13417
|
+
function te(i, n, m) {
|
|
13418
|
+
const s = n.toLowerCase().trim(), u = m?.provider ?? Jt(Xt, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
|
|
13003
13419
|
if (!u) return null;
|
|
13004
|
-
const k =
|
|
13420
|
+
const k = Zt(u.models, s);
|
|
13005
13421
|
if (!k) return null;
|
|
13006
|
-
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h =
|
|
13422
|
+
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Kt(k, _), f = Ut(i, h);
|
|
13007
13423
|
return {
|
|
13008
13424
|
auto_update_timestamp: void 0,
|
|
13009
13425
|
model: k,
|
|
@@ -13012,7 +13428,7 @@ function et(i, n, m) {
|
|
|
13012
13428
|
...f
|
|
13013
13429
|
};
|
|
13014
13430
|
}
|
|
13015
|
-
const b =
|
|
13431
|
+
const b = dt(Ct(process.argv)).scriptName("genai-prices").command(
|
|
13016
13432
|
"list [provider]",
|
|
13017
13433
|
"List providers and models",
|
|
13018
13434
|
(i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
@@ -13021,9 +13437,9 @@ const b = de(Ce(process.argv)).scriptName("genai-prices").command(
|
|
|
13021
13437
|
"Calculate price",
|
|
13022
13438
|
(i) => i.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" })
|
|
13023
13439
|
).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();
|
|
13024
|
-
function
|
|
13440
|
+
function ee() {
|
|
13025
13441
|
if (b._[0] === "list") {
|
|
13026
|
-
const m =
|
|
13442
|
+
const m = it;
|
|
13027
13443
|
if (b.provider) {
|
|
13028
13444
|
const s = m.find((u) => u.id === b.provider);
|
|
13029
13445
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|
|
@@ -13054,7 +13470,7 @@ function tt() {
|
|
|
13054
13470
|
let _, h = k;
|
|
13055
13471
|
h.includes(":") && ([_, h] = h.split(":", 2));
|
|
13056
13472
|
try {
|
|
13057
|
-
const f =
|
|
13473
|
+
const f = te(m, h, { providerId: _, timestamp: s });
|
|
13058
13474
|
if (!f) {
|
|
13059
13475
|
u = !0, console.error(`No price found for model ${k}`);
|
|
13060
13476
|
continue;
|
|
@@ -13077,6 +13493,6 @@ function tt() {
|
|
|
13077
13493
|
}
|
|
13078
13494
|
process.exit(u ? 1 : 0);
|
|
13079
13495
|
}
|
|
13080
|
-
|
|
13496
|
+
dt().showHelp(), process.exit(1);
|
|
13081
13497
|
}
|
|
13082
|
-
|
|
13498
|
+
ee();
|