@pydantic/genai-prices 0.0.41 → 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 +1082 -353
- package/dist/index.cjs +3 -3
- package/dist/index.js +955 -226
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
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
|
|
17
|
+
function Ct(i) {
|
|
18
|
+
return i.slice(At() + 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(i) {
|
|
26
|
+
if (i !== i.toLowerCase() && i !== i.toUpperCase() || (i = i.toLowerCase()), i.indexOf("-") === -1 && i.indexOf("_") === -1)
|
|
27
|
+
return i;
|
|
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 = i.match(/^-+/);
|
|
31
|
+
for (let k = u ? u[0].length : 0; k < i.length; k++) {
|
|
32
|
+
let _ = i.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
|
|
39
|
-
const m =
|
|
38
|
+
function Ot(i, n) {
|
|
39
|
+
const m = i.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 < i.length; u++) {
|
|
43
|
+
const k = m.charAt(u), _ = i.charAt(u);
|
|
44
44
|
k !== _ && u > 0 ? s += `${n}${m.charAt(u)}` : s += _;
|
|
45
45
|
}
|
|
46
46
|
return s;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
48
|
+
function Rt(i) {
|
|
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
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright (c) 2016, Contributors
|
|
54
54
|
* SPDX-License-Identifier: ISC
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
57
|
-
if (Array.isArray(
|
|
58
|
-
return
|
|
59
|
-
|
|
56
|
+
function Et(i) {
|
|
57
|
+
if (Array.isArray(i))
|
|
58
|
+
return i.map((_) => typeof _ != "string" ? _ + "" : _);
|
|
59
|
+
i = i.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; _ < i.length; _++) {
|
|
63
|
+
if (m = s, s = i.charAt(_), s === " " && !u) {
|
|
64
64
|
m !== " " && n++;
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
@@ -74,8 +74,8 @@ function Ee(a) {
|
|
|
74
74
|
* SPDX-License-Identifier: ISC
|
|
75
75
|
*/
|
|
76
76
|
var I;
|
|
77
|
-
(function(
|
|
78
|
-
|
|
77
|
+
(function(i) {
|
|
78
|
+
i.BOOLEAN = "boolean", i.STRING = "string", i.NUMBER = "number", i.ARRAY = "array";
|
|
79
79
|
})(I || (I = {}));
|
|
80
80
|
/**
|
|
81
81
|
* @license
|
|
@@ -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,65 +137,65 @@ 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
|
|
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",
|
|
145
145
|
number: "numbers"
|
|
146
146
|
}[o];
|
|
147
147
|
}).filter(Boolean).pop();
|
|
148
|
-
c && (r[c][
|
|
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
|
|
161
|
-
}), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([
|
|
162
|
-
typeof
|
|
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
|
|
167
|
-
})),
|
|
168
|
-
(r.aliases[
|
|
169
|
-
f[
|
|
148
|
+
c && (r[c][a] = !0), r.arrays[a] = !0, r.keys.push(a);
|
|
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
|
|
178
|
-
let o,
|
|
179
|
-
if (
|
|
180
|
-
K(
|
|
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
|
+
if (a !== "--" && /^-/.test(a) && H(a))
|
|
180
|
+
K(a);
|
|
181
181
|
else if (c.match(/^---+(=|$)/)) {
|
|
182
|
-
K(
|
|
182
|
+
K(a);
|
|
183
183
|
continue;
|
|
184
|
-
} else if (
|
|
185
|
-
l =
|
|
186
|
-
else if (
|
|
187
|
-
l =
|
|
188
|
-
else if (
|
|
189
|
-
l =
|
|
190
|
-
else if (
|
|
191
|
-
l =
|
|
192
|
-
else if (
|
|
193
|
-
d = u[
|
|
194
|
-
else if (
|
|
195
|
-
p =
|
|
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) ? 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
|
+
else if (a.match(U) && h["boolean-negation"])
|
|
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
|
+
else if (a.match(/^--.+/) || !h["short-option-groups"] && a.match(/^-[^-]+/))
|
|
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
|
+
else if (a.match(/^-.\..+=/))
|
|
191
|
+
l = a.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
|
|
192
|
+
else if (a.match(/^-.\..+/) && !a.match(L))
|
|
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
|
+
else if (a.match(/^-[^-]+/) && !a.match(L)) {
|
|
195
|
+
p = a.slice(1, -1).split(""), o = !1;
|
|
196
196
|
for (let x = 0; x < p.length; x++) {
|
|
197
|
-
if (d =
|
|
198
|
-
v =
|
|
197
|
+
if (d = a.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
|
|
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,293 +212,293 @@ class Ne {
|
|
|
212
212
|
} else
|
|
213
213
|
q(p[x], R(p[x]));
|
|
214
214
|
}
|
|
215
|
-
|
|
216
|
-
} else if (
|
|
217
|
-
|
|
218
|
-
else if (
|
|
219
|
-
F = u.slice(
|
|
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
|
+
} else if (a.match(/^-[0-9]$/) && a.match(L) && g(a.slice(1), r.bools))
|
|
217
|
+
e = a.slice(1), q(e, R(e));
|
|
218
|
+
else if (a === "--") {
|
|
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
|
-
K(
|
|
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
|
|
238
|
-
(typeof
|
|
236
|
+
function K(t) {
|
|
237
|
+
const a = $("_", t);
|
|
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",
|
|
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
|
-
l < p && (B = Error(C("Not enough arguments following: %s",
|
|
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(
|
|
254
|
-
q(
|
|
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
|
|
259
|
-
const l = g(
|
|
260
|
-
if (g(
|
|
261
|
-
|
|
257
|
+
function V(t, a, c, o) {
|
|
258
|
+
let e = [], p = o || c[t + 1];
|
|
259
|
+
const l = g(a, r.nargs);
|
|
260
|
+
if (g(a, r.bools) && !/^(true|false)$/.test(p))
|
|
261
|
+
e.push(!0);
|
|
262
262
|
else if (T(p) || T(o) && /^-/.test(p) && !L.test(p) && !H(p)) {
|
|
263
|
-
if (f[
|
|
264
|
-
const d = f[
|
|
265
|
-
|
|
263
|
+
if (f[a] !== void 0) {
|
|
264
|
+
const d = f[a];
|
|
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
|
-
return
|
|
293
|
+
return a;
|
|
294
294
|
},
|
|
295
295
|
set(d) {
|
|
296
|
-
|
|
296
|
+
a = typeof d == "string" ? A.normalize(d) : d;
|
|
297
297
|
}
|
|
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 && (
|
|
306
|
-
let o = Array.isArray(
|
|
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
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
const o =
|
|
314
|
+
function kt(t) {
|
|
315
|
+
const a = /* @__PURE__ */ Object.create(null);
|
|
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
|
-
(
|
|
360
|
+
(a && r.configs[p.join(".")] || !a) && !E(t, p) && q(p.join("."), o[e]);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
let
|
|
364
|
+
function ft(t) {
|
|
365
|
+
let a;
|
|
366
366
|
const c = /* @__PURE__ */ new Set();
|
|
367
|
-
Object.keys(
|
|
368
|
-
if (!c.has(o) && (
|
|
367
|
+
Object.keys(t).forEach(function(o) {
|
|
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
|
|
380
|
-
return r.keys.forEach((
|
|
381
|
-
~
|
|
382
|
-
}),
|
|
379
|
+
function bt(t) {
|
|
380
|
+
return r.keys.forEach((a) => {
|
|
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"] || (
|
|
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
|
-
const o =
|
|
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 =
|
|
401
|
-
h["dot-notation"] || (
|
|
402
|
-
v =
|
|
399
|
+
function N(t, a, c) {
|
|
400
|
+
let o = t;
|
|
401
|
+
h["dot-notation"] || (a = [a.join(".")]), a.slice(0, -1).forEach(function(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
|
-
|
|
410
|
-
Object.keys(
|
|
408
|
+
function qt(...t) {
|
|
409
|
+
t.forEach(function(a) {
|
|
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
|
|
434
|
-
const
|
|
435
|
-
return [].concat(
|
|
436
|
-
return Array.isArray(o) ? o.includes(
|
|
433
|
+
function ut(t) {
|
|
434
|
+
const a = Object.keys(r);
|
|
435
|
+
return [].concat(a.map((o) => r[o])).some(function(o) {
|
|
436
|
+
return Array.isArray(o) ? o.includes(t) : o[t];
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return [].concat(...
|
|
441
|
-
const
|
|
442
|
-
return
|
|
439
|
+
function wt(t, ...a) {
|
|
440
|
+
return [].concat(...a).some(function(o) {
|
|
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
|
-
let
|
|
449
|
-
const o =
|
|
450
|
-
for (let
|
|
451
|
-
if (c =
|
|
452
|
-
|
|
448
|
+
let a = !0, 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
|
+
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
|
-
return
|
|
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
|
|
478
|
-
let
|
|
479
|
-
return g(
|
|
477
|
+
function Bt(t) {
|
|
478
|
+
let a = I.BOOLEAN;
|
|
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
|
-
for (Object.keys(
|
|
501
|
-
n.push([].concat(
|
|
500
|
+
for (Object.keys(i).forEach(function(u) {
|
|
501
|
+
n.push([].concat(i[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(a) {
|
|
|
518
518
|
k !== void 0 && typeof k == "string" && (m[k] = u);
|
|
519
519
|
}), m;
|
|
520
520
|
}
|
|
521
|
-
function Z(
|
|
522
|
-
return
|
|
521
|
+
function Z(i) {
|
|
522
|
+
return i !== void 0 ? i + 1 : 1;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
return
|
|
524
|
+
function ct(i) {
|
|
525
|
+
return i === "__proto__" ? "___proto___" : i;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
return typeof
|
|
527
|
+
function jt(i) {
|
|
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
|
/**
|
|
531
531
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
@@ -535,44 +535,44 @@ function je(a) {
|
|
|
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
|
-
require: (
|
|
551
|
+
require: (i) => {
|
|
552
552
|
if (typeof require < "u")
|
|
553
|
-
return require(
|
|
554
|
-
if (
|
|
555
|
-
return JSON.parse(
|
|
553
|
+
return require(i);
|
|
554
|
+
if (i.match(/\.json$/))
|
|
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:
|
|
566
|
-
exists: (
|
|
564
|
+
format: ht,
|
|
565
|
+
resolve: at,
|
|
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(a, 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 ae = [
|
|
|
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: [
|
|
@@ -1143,29 +1165,52 @@ const ae = [
|
|
|
1143
1165
|
required: !0
|
|
1144
1166
|
}
|
|
1145
1167
|
]
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
api_flavor: "anthropic",
|
|
1171
|
+
root: "usage",
|
|
1172
|
+
model_path: "model",
|
|
1173
|
+
mappings: [
|
|
1174
|
+
{
|
|
1175
|
+
path: "input_tokens",
|
|
1176
|
+
dest: "input_tokens",
|
|
1177
|
+
required: !0
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
path: "cache_creation_input_tokens",
|
|
1181
|
+
dest: "input_tokens",
|
|
1182
|
+
required: !1
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
path: "cache_read_input_tokens",
|
|
1186
|
+
dest: "input_tokens",
|
|
1187
|
+
required: !1
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
path: "cache_creation_input_tokens",
|
|
1191
|
+
dest: "cache_write_tokens",
|
|
1192
|
+
required: !1
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
path: "cache_read_input_tokens",
|
|
1196
|
+
dest: "cache_read_tokens",
|
|
1197
|
+
required: !1
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
path: "output_tokens",
|
|
1201
|
+
dest: "output_tokens",
|
|
1202
|
+
required: !0
|
|
1203
|
+
}
|
|
1204
|
+
]
|
|
1146
1205
|
}
|
|
1147
1206
|
],
|
|
1148
1207
|
models: [
|
|
1149
1208
|
{
|
|
1150
|
-
id: "
|
|
1151
|
-
|
|
1152
|
-
contains: "llama3-8b-instruct-v1"
|
|
1153
|
-
},
|
|
1154
|
-
prices: {
|
|
1155
|
-
input_mtok: 0.3,
|
|
1156
|
-
output_mtok: 0.6
|
|
1157
|
-
}
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
id: "nova-lite-v1",
|
|
1161
|
-
name: "Nova Lite 1.0",
|
|
1209
|
+
id: "amazon.nova-lite-v1:0",
|
|
1210
|
+
name: "Nova Lite",
|
|
1162
1211
|
description: "Amazon Nova Lite 1.0 is a very low-cost multimodal model from Amazon that focused on fast processing of image, video, and text inputs to generate text output. Amazon Nova Lite can handle real-time customer interactions, document analysis, and visual question-answering tasks with high accuracy.",
|
|
1163
1212
|
match: {
|
|
1164
|
-
|
|
1165
|
-
{
|
|
1166
|
-
contains: "nova-lite-v1"
|
|
1167
|
-
}
|
|
1168
|
-
]
|
|
1213
|
+
contains: "nova-lite"
|
|
1169
1214
|
},
|
|
1170
1215
|
prices: {
|
|
1171
1216
|
input_mtok: 0.06,
|
|
@@ -1174,15 +1219,11 @@ const ae = [
|
|
|
1174
1219
|
}
|
|
1175
1220
|
},
|
|
1176
1221
|
{
|
|
1177
|
-
id: "nova-micro-v1",
|
|
1178
|
-
name: "Nova Micro
|
|
1222
|
+
id: "amazon.nova-micro-v1:0",
|
|
1223
|
+
name: "Nova Micro",
|
|
1179
1224
|
description: "Amazon Nova Micro 1.0 is a text-only model that delivers the lowest latency responses in the Amazon Nova family of models at a very low cost. With a context length of 128K tokens and optimized for speed and cost, Amazon Nova Micro excels at tasks such as text summarization, translation, content classification, interactive chat, and brainstorming. It has simple mathematical reasoning and coding abilities.",
|
|
1180
1225
|
match: {
|
|
1181
|
-
|
|
1182
|
-
{
|
|
1183
|
-
contains: "nova-micro-v1"
|
|
1184
|
-
}
|
|
1185
|
-
]
|
|
1226
|
+
contains: "nova-micro"
|
|
1186
1227
|
},
|
|
1187
1228
|
prices: {
|
|
1188
1229
|
input_mtok: 0.035,
|
|
@@ -1191,21 +1232,709 @@ const ae = [
|
|
|
1191
1232
|
}
|
|
1192
1233
|
},
|
|
1193
1234
|
{
|
|
1194
|
-
id: "nova-
|
|
1195
|
-
name: "Nova
|
|
1235
|
+
id: "amazon.nova-premier-v1:0",
|
|
1236
|
+
name: "Nova Premier",
|
|
1237
|
+
match: {
|
|
1238
|
+
contains: "nova-premier"
|
|
1239
|
+
},
|
|
1240
|
+
prices: {
|
|
1241
|
+
input_mtok: 2.5,
|
|
1242
|
+
cache_read_mtok: 0.625,
|
|
1243
|
+
output_mtok: 12.5
|
|
1244
|
+
}
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
id: "amazon.nova-pro-v1:0",
|
|
1248
|
+
name: "Nova Pro",
|
|
1196
1249
|
description: "Amazon Nova Pro 1.0 is a capable multimodal model from Amazon focused on providing a combination of accuracy, speed, and cost for a wide range of tasks. As of December 2024, it achieves state-of-the-art performance on key benchmarks including visual question answering (TextVQA) and video understanding (VATEX).",
|
|
1197
1250
|
match: {
|
|
1198
|
-
|
|
1199
|
-
{
|
|
1200
|
-
contains: "nova-pro-v1"
|
|
1201
|
-
}
|
|
1202
|
-
]
|
|
1251
|
+
contains: "nova-pro"
|
|
1203
1252
|
},
|
|
1204
1253
|
prices: {
|
|
1205
1254
|
input_mtok: 0.8,
|
|
1206
1255
|
cache_read_mtok: 0.2,
|
|
1207
1256
|
output_mtok: 3.2
|
|
1208
1257
|
}
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
id: "amazon.nova-sonic-v1:0",
|
|
1261
|
+
name: "Nova Sonic",
|
|
1262
|
+
match: {
|
|
1263
|
+
contains: "nova-sonic"
|
|
1264
|
+
},
|
|
1265
|
+
prices: {
|
|
1266
|
+
input_mtok: 0.06,
|
|
1267
|
+
output_mtok: 0.24,
|
|
1268
|
+
input_audio_mtok: 3.4,
|
|
1269
|
+
output_audio_mtok: 13.6
|
|
1270
|
+
}
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
id: "amazon.titan-embed-text-v1",
|
|
1274
|
+
name: "Titan Embeddings G1 - Text",
|
|
1275
|
+
match: {
|
|
1276
|
+
contains: "titan-embed-text"
|
|
1277
|
+
},
|
|
1278
|
+
prices: {
|
|
1279
|
+
input_mtok: 0.1
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
id: "amazon.titan-text-express-v1",
|
|
1284
|
+
name: "Titan Text G1 - Express",
|
|
1285
|
+
match: {
|
|
1286
|
+
contains: "titan-text-express"
|
|
1287
|
+
},
|
|
1288
|
+
prices: {
|
|
1289
|
+
input_mtok: 0.2,
|
|
1290
|
+
output_mtok: 0.6
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
id: "amazon.titan-text-lite-v1",
|
|
1295
|
+
name: "Titan Text G1 - Lite",
|
|
1296
|
+
match: {
|
|
1297
|
+
contains: "titan-text-lite"
|
|
1298
|
+
},
|
|
1299
|
+
prices: {
|
|
1300
|
+
input_mtok: 0.15,
|
|
1301
|
+
output_mtok: 0.2
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
id: "deepseek.r1-v1:0",
|
|
1306
|
+
name: "DeepSeek-R1",
|
|
1307
|
+
match: {
|
|
1308
|
+
contains: "r1"
|
|
1309
|
+
},
|
|
1310
|
+
prices: {
|
|
1311
|
+
input_mtok: 1.35,
|
|
1312
|
+
output_mtok: 5.4
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
id: "global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
1317
|
+
match: {
|
|
1318
|
+
starts_with: "global.anthropic.claude-haiku-4-5-20251001-v1"
|
|
1319
|
+
},
|
|
1320
|
+
prices: {
|
|
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
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
id: "meta.llama3-1-70b-instruct-v1:0",
|
|
1353
|
+
name: "Llama 3.1 70B Instruct",
|
|
1354
|
+
match: {
|
|
1355
|
+
contains: "llama3-1-70b-instruct"
|
|
1356
|
+
},
|
|
1357
|
+
prices: {
|
|
1358
|
+
input_mtok: 0.72,
|
|
1359
|
+
output_mtok: 0.72
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
id: "meta.llama3-1-8b-instruct-v1:0",
|
|
1364
|
+
name: "Llama 3.1 8B Instruct",
|
|
1365
|
+
match: {
|
|
1366
|
+
contains: "llama3-1-8b-instruct"
|
|
1367
|
+
},
|
|
1368
|
+
prices: {
|
|
1369
|
+
input_mtok: 0.22,
|
|
1370
|
+
output_mtok: 0.22
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
id: "meta.llama3-2-11b-instruct-v1:0",
|
|
1375
|
+
name: "Llama 3.2 11B Instruct",
|
|
1376
|
+
match: {
|
|
1377
|
+
contains: "llama3-2-11b-instruct"
|
|
1378
|
+
},
|
|
1379
|
+
prices: {
|
|
1380
|
+
input_mtok: 0.16,
|
|
1381
|
+
output_mtok: 0.16
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
id: "meta.llama3-2-1b-instruct-v1:0",
|
|
1386
|
+
name: "Llama 3.2 1B Instruct",
|
|
1387
|
+
match: {
|
|
1388
|
+
contains: "llama3-2-1b-instruct"
|
|
1389
|
+
},
|
|
1390
|
+
prices: {
|
|
1391
|
+
input_mtok: 0.1,
|
|
1392
|
+
output_mtok: 0.1
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
id: "meta.llama3-2-3b-instruct-v1:0",
|
|
1397
|
+
name: "Llama 3.2 3B Instruct",
|
|
1398
|
+
match: {
|
|
1399
|
+
contains: "llama3-2-3b-instruct"
|
|
1400
|
+
},
|
|
1401
|
+
prices: {
|
|
1402
|
+
input_mtok: 0.15,
|
|
1403
|
+
output_mtok: 0.15
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
id: "meta.llama3-2-90b-instruct-v1:0",
|
|
1408
|
+
name: "Llama 3.2 90B Instruct",
|
|
1409
|
+
match: {
|
|
1410
|
+
contains: "llama3-2-90b-instruct"
|
|
1411
|
+
},
|
|
1412
|
+
prices: {
|
|
1413
|
+
input_mtok: 0.72,
|
|
1414
|
+
output_mtok: 0.72
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
id: "meta.llama3-3-70b-instruct-v1:0",
|
|
1419
|
+
name: "Llama 3.3 70B Instruct",
|
|
1420
|
+
match: {
|
|
1421
|
+
contains: "llama3-3-70b-instruct"
|
|
1422
|
+
},
|
|
1423
|
+
prices: {
|
|
1424
|
+
input_mtok: 0.72,
|
|
1425
|
+
output_mtok: 0.72
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
id: "meta.llama3-70b-instruct-v1:0",
|
|
1430
|
+
name: "Llama 3 70B Instruct",
|
|
1431
|
+
match: {
|
|
1432
|
+
contains: "llama3-70b-instruct"
|
|
1433
|
+
},
|
|
1434
|
+
prices: {
|
|
1435
|
+
input_mtok: 2.65,
|
|
1436
|
+
output_mtok: 3.5
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
id: "meta.llama3-8b-instruct-v1:0",
|
|
1441
|
+
name: "Llama 3 8B Instruct",
|
|
1442
|
+
match: {
|
|
1443
|
+
contains: "llama3-8b-instruct"
|
|
1444
|
+
},
|
|
1445
|
+
prices: {
|
|
1446
|
+
input_mtok: 0.3,
|
|
1447
|
+
output_mtok: 0.6
|
|
1448
|
+
}
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
id: "meta.llama4-maverick-17b-instruct-v1:0",
|
|
1452
|
+
name: "Llama 4 Maverick 17B Instruct",
|
|
1453
|
+
match: {
|
|
1454
|
+
contains: "llama4-maverick-17b-instruct"
|
|
1455
|
+
},
|
|
1456
|
+
prices: {
|
|
1457
|
+
input_mtok: 0.24,
|
|
1458
|
+
output_mtok: 0.97
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
id: "meta.llama4-scout-17b-instruct-v1:0",
|
|
1463
|
+
name: "Llama 4 Scout 17B Instruct",
|
|
1464
|
+
match: {
|
|
1465
|
+
contains: "llama4-scout-17b-instruct"
|
|
1466
|
+
},
|
|
1467
|
+
prices: {
|
|
1468
|
+
input_mtok: 0.17,
|
|
1469
|
+
output_mtok: 0.66
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
id: "mistral.mistral-7b-instruct-v0:2",
|
|
1474
|
+
name: "Mistral 7B Instruct",
|
|
1475
|
+
match: {
|
|
1476
|
+
contains: "mistral-7b-instruct"
|
|
1477
|
+
},
|
|
1478
|
+
prices: {
|
|
1479
|
+
input_mtok: 0.15,
|
|
1480
|
+
output_mtok: 0.2
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
id: "mistral.mistral-large-2402-v1:0",
|
|
1485
|
+
name: "Mistral Large (24.02)",
|
|
1486
|
+
match: {
|
|
1487
|
+
contains: "mistral-large-2402"
|
|
1488
|
+
},
|
|
1489
|
+
prices: {
|
|
1490
|
+
input_mtok: 4,
|
|
1491
|
+
output_mtok: 12
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
id: "mistral.mistral-small-2402-v1:0",
|
|
1496
|
+
name: "Mistral Small (24.02)",
|
|
1497
|
+
match: {
|
|
1498
|
+
contains: "mistral-small-2402"
|
|
1499
|
+
},
|
|
1500
|
+
prices: {
|
|
1501
|
+
input_mtok: 1,
|
|
1502
|
+
output_mtok: 3
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
id: "mistral.mixtral-8x7b-instruct-v0:1",
|
|
1507
|
+
name: "Mixtral 8x7B Instruct",
|
|
1508
|
+
match: {
|
|
1509
|
+
contains: "mixtral-8x7b-instruct"
|
|
1510
|
+
},
|
|
1511
|
+
prices: {
|
|
1512
|
+
input_mtok: 0.45,
|
|
1513
|
+
output_mtok: 0.7
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
id: "mistral.pixtral-large-2502-v1:0",
|
|
1518
|
+
name: "Pixtral Large (25.02)",
|
|
1519
|
+
match: {
|
|
1520
|
+
contains: "pixtral-large-2502"
|
|
1521
|
+
},
|
|
1522
|
+
prices: {
|
|
1523
|
+
input_mtok: 2,
|
|
1524
|
+
output_mtok: 6
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
id: "openai.gpt-oss-120b-1:0",
|
|
1529
|
+
name: "gpt-oss-120b",
|
|
1530
|
+
match: {
|
|
1531
|
+
contains: "gpt-oss-120b"
|
|
1532
|
+
},
|
|
1533
|
+
prices: {
|
|
1534
|
+
input_mtok: 0.15,
|
|
1535
|
+
output_mtok: 0.6
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
id: "openai.gpt-oss-20b-1:0",
|
|
1540
|
+
name: "gpt-oss-20b",
|
|
1541
|
+
match: {
|
|
1542
|
+
contains: "gpt-oss-20b"
|
|
1543
|
+
},
|
|
1544
|
+
prices: {
|
|
1545
|
+
input_mtok: 0.07,
|
|
1546
|
+
output_mtok: 0.3
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
id: "qwen.qwen3-32b-v1:0",
|
|
1551
|
+
name: "Qwen3 32B (dense)",
|
|
1552
|
+
match: {
|
|
1553
|
+
contains: "qwen3-32b"
|
|
1554
|
+
},
|
|
1555
|
+
prices: {
|
|
1556
|
+
input_mtok: 0.15,
|
|
1557
|
+
output_mtok: 0.6
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
id: "qwen.qwen3-coder-30b-a3b-v1:0",
|
|
1562
|
+
name: "Qwen3-Coder-30B-A3B-Instruct",
|
|
1563
|
+
match: {
|
|
1564
|
+
contains: "qwen3-coder-30b-a3b"
|
|
1565
|
+
},
|
|
1566
|
+
prices: {
|
|
1567
|
+
input_mtok: 0.15,
|
|
1568
|
+
output_mtok: 0.6
|
|
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
|
+
}
|
|
1209
1938
|
}
|
|
1210
1939
|
]
|
|
1211
1940
|
},
|
|
@@ -12606,37 +13335,37 @@ Compared to other leading proprietary and open-weights models Command A delivers
|
|
|
12606
13335
|
]
|
|
12607
13336
|
}
|
|
12608
13337
|
];
|
|
12609
|
-
function
|
|
13338
|
+
function Wt(i, n) {
|
|
12610
13339
|
if (n <= 0) return 0;
|
|
12611
13340
|
let m = 0;
|
|
12612
|
-
const s = [...
|
|
12613
|
-
m += k *
|
|
13341
|
+
const s = [...i.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
|
|
13342
|
+
m += k * i.base / 1e6;
|
|
12614
13343
|
for (let _ = 0; _ < s.length; _++) {
|
|
12615
13344
|
const h = s[_], f = s[_ + 1]?.start ?? 1 / 0, y = Math.max(0, Math.min(n, f) - h.start);
|
|
12616
13345
|
y > 0 && (m += y * h.price / 1e6);
|
|
12617
13346
|
}
|
|
12618
13347
|
return m;
|
|
12619
13348
|
}
|
|
12620
|
-
function O(
|
|
12621
|
-
return
|
|
13349
|
+
function O(i, n, m) {
|
|
13350
|
+
return i === void 0 || n === void 0 ? 0 : typeof i == "number" ? i * n / 1e6 : Wt(i, n);
|
|
12622
13351
|
}
|
|
12623
|
-
function
|
|
13352
|
+
function Ut(i, n) {
|
|
12624
13353
|
let m = 0, s = 0;
|
|
12625
|
-
const u =
|
|
12626
|
-
let f =
|
|
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;
|
|
13355
|
+
let f = i.input_audio_tokens ?? 0;
|
|
12627
13356
|
if (f -= _, f < 0)
|
|
12628
13357
|
throw new Error("cache_audio_read_tokens cannot be greater than input_audio_tokens");
|
|
12629
|
-
let y =
|
|
13358
|
+
let y = i.input_tokens ?? 0;
|
|
12630
13359
|
if (y -= u, y -= k, y -= f, y < 0)
|
|
12631
13360
|
throw new Error("Uncached text input tokens cannot be negative");
|
|
12632
13361
|
let P = u;
|
|
12633
13362
|
if (P -= _, P < 0)
|
|
12634
13363
|
throw new Error("cache_audio_read_tokens cannot be greater than cache_read_tokens");
|
|
12635
13364
|
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, _);
|
|
12636
|
-
let S =
|
|
13365
|
+
let S = i.output_tokens ?? 0;
|
|
12637
13366
|
if (S -= h, S < 0)
|
|
12638
13367
|
throw new Error("output_audio_tokens cannot be greater than output_tokens");
|
|
12639
|
-
s += O(n.output_mtok, S), s += O(n.output_audio_mtok,
|
|
13368
|
+
s += O(n.output_mtok, S), s += O(n.output_audio_mtok, i.output_audio_tokens);
|
|
12640
13369
|
let G = m + s;
|
|
12641
13370
|
return n.requests_kcount !== void 0 && (G += n.requests_kcount / 1e3), {
|
|
12642
13371
|
input_price: m,
|
|
@@ -12644,11 +13373,11 @@ function Ue(a, n) {
|
|
|
12644
13373
|
total_price: G
|
|
12645
13374
|
};
|
|
12646
13375
|
}
|
|
12647
|
-
function
|
|
12648
|
-
if (!Array.isArray(
|
|
12649
|
-
return
|
|
12650
|
-
for (let m =
|
|
12651
|
-
const s =
|
|
13376
|
+
function Kt(i, n) {
|
|
13377
|
+
if (!Array.isArray(i.prices))
|
|
13378
|
+
return i.prices;
|
|
13379
|
+
for (let m = i.prices.length - 1; m >= 0; m--) {
|
|
13380
|
+
const s = i.prices[m], u = s.constraint;
|
|
12652
13381
|
if (u === void 0)
|
|
12653
13382
|
return s.prices;
|
|
12654
13383
|
if (u.type === "start_date") {
|
|
@@ -12663,34 +13392,34 @@ function Ke(a, n) {
|
|
|
12663
13392
|
return s.prices;
|
|
12664
13393
|
}
|
|
12665
13394
|
}
|
|
12666
|
-
return
|
|
13395
|
+
return i.prices[0].prices;
|
|
12667
13396
|
}
|
|
12668
|
-
function j(
|
|
12669
|
-
return "or" in
|
|
13397
|
+
function j(i, n) {
|
|
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;
|
|
12670
13399
|
}
|
|
12671
|
-
function
|
|
12672
|
-
const m = n.toLowerCase().trim(), s =
|
|
12673
|
-
return s ||
|
|
13400
|
+
function Yt(i, n) {
|
|
13401
|
+
const m = n.toLowerCase().trim(), s = i.find((u) => u.id === m);
|
|
13402
|
+
return s || i.find((u) => u.provider_match && j(u.provider_match, m));
|
|
12674
13403
|
}
|
|
12675
|
-
function
|
|
13404
|
+
function Jt(i, { modelId: n, providerApiUrl: m, providerId: s }) {
|
|
12676
13405
|
if (s)
|
|
12677
|
-
return
|
|
13406
|
+
return Yt(i, s);
|
|
12678
13407
|
if (m)
|
|
12679
|
-
return
|
|
13408
|
+
return i.find((u) => new RegExp(u.api_pattern).test(m));
|
|
12680
13409
|
if (n)
|
|
12681
|
-
return
|
|
13410
|
+
return i.find((u) => u.model_match && j(u.model_match, n));
|
|
12682
13411
|
}
|
|
12683
|
-
function
|
|
12684
|
-
return
|
|
13412
|
+
function Zt(i, n) {
|
|
13413
|
+
return i.find((m) => j(m.match, n));
|
|
12685
13414
|
}
|
|
12686
|
-
let
|
|
12687
|
-
Promise.resolve(
|
|
12688
|
-
function
|
|
12689
|
-
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 });
|
|
12690
13419
|
if (!u) return null;
|
|
12691
|
-
const k =
|
|
13420
|
+
const k = Zt(u.models, s);
|
|
12692
13421
|
if (!k) return null;
|
|
12693
|
-
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h =
|
|
13422
|
+
const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Kt(k, _), f = Ut(i, h);
|
|
12694
13423
|
return {
|
|
12695
13424
|
auto_update_timestamp: void 0,
|
|
12696
13425
|
model: k,
|
|
@@ -12699,18 +13428,18 @@ function et(a, n, m) {
|
|
|
12699
13428
|
...f
|
|
12700
13429
|
};
|
|
12701
13430
|
}
|
|
12702
|
-
const b =
|
|
13431
|
+
const b = dt(Ct(process.argv)).scriptName("genai-prices").command(
|
|
12703
13432
|
"list [provider]",
|
|
12704
13433
|
"List providers and models",
|
|
12705
|
-
(
|
|
13434
|
+
(i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
|
|
12706
13435
|
).command(
|
|
12707
13436
|
"calc <model...>",
|
|
12708
13437
|
"Calculate price",
|
|
12709
|
-
(
|
|
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" })
|
|
12710
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();
|
|
12711
|
-
function
|
|
13440
|
+
function ee() {
|
|
12712
13441
|
if (b._[0] === "list") {
|
|
12713
|
-
const m =
|
|
13442
|
+
const m = it;
|
|
12714
13443
|
if (b.provider) {
|
|
12715
13444
|
const s = m.find((u) => u.id === b.provider);
|
|
12716
13445
|
s || (console.error(`Provider ${b.provider} not found.`), process.exit(1)), console.log(`${s.name}: (${s.models.length} models)`);
|
|
@@ -12741,7 +13470,7 @@ function tt() {
|
|
|
12741
13470
|
let _, h = k;
|
|
12742
13471
|
h.includes(":") && ([_, h] = h.split(":", 2));
|
|
12743
13472
|
try {
|
|
12744
|
-
const f =
|
|
13473
|
+
const f = te(m, h, { providerId: _, timestamp: s });
|
|
12745
13474
|
if (!f) {
|
|
12746
13475
|
u = !0, console.error(`No price found for model ${k}`);
|
|
12747
13476
|
continue;
|
|
@@ -12764,6 +13493,6 @@ function tt() {
|
|
|
12764
13493
|
}
|
|
12765
13494
|
process.exit(u ? 1 : 0);
|
|
12766
13495
|
}
|
|
12767
|
-
|
|
13496
|
+
dt().showHelp(), process.exit(1);
|
|
12768
13497
|
}
|
|
12769
|
-
|
|
13498
|
+
ee();
|