@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 CHANGED
@@ -1,66 +1,66 @@
1
1
  #!/usr/bin/env node
2
- import de from "yargs";
3
- import { format as he } from "util";
4
- import { resolve as ie, normalize as Ie } from "path";
5
- import { readFileSync as _e, writeFile as Le, statSync as Pe } from "fs";
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 Te } from "url";
8
- function Ae() {
9
- return Se() ? 0 : 1;
7
+ import { fileURLToPath as Tt } from "url";
8
+ function At() {
9
+ return St() ? 0 : 1;
10
10
  }
11
- function Se() {
12
- return Ge() && !process.defaultApp;
11
+ function St() {
12
+ return Gt() && !process.defaultApp;
13
13
  }
14
- function Ge() {
14
+ function Gt() {
15
15
  return !!process.versions.electron;
16
16
  }
17
- function Ce(a) {
18
- return a.slice(Ae() + 1);
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(a) {
26
- if (a !== a.toLowerCase() && a !== a.toUpperCase() || (a = a.toLowerCase()), a.indexOf("-") === -1 && a.indexOf("_") === -1)
27
- return a;
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 = a.match(/^-+/);
31
- for (let k = u ? u[0].length : 0; k < a.length; k++) {
32
- let _ = a.charAt(k);
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 Oe(a, n) {
39
- const m = a.toLowerCase();
38
+ function Ot(i, n) {
39
+ const m = i.toLowerCase();
40
40
  n = n || "-";
41
41
  let s = "";
42
- for (let u = 0; u < a.length; u++) {
43
- const k = m.charAt(u), _ = a.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 Re(a) {
49
- return a == null ? !1 : typeof a == "number" || /^0x[0-9a-f]+$/i.test(a) ? !0 : /^0[^.]/.test(a) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(a);
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 Ee(a) {
57
- if (Array.isArray(a))
58
- return a.map((_) => typeof _ != "string" ? _ + "" : _);
59
- a = a.trim();
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; _ < a.length; _++) {
63
- if (m = s, s = a.charAt(_), s === " " && !u) {
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(a) {
78
- a.BOOLEAN = "boolean", a.STRING = "string", a.NUMBER = "number", a.ARRAY = "array";
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 Ne {
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 = Ee(n), k = typeof n == "string", _ = ze(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({
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), oe = /* @__PURE__ */ Object.create(null), C = s.__ || A.format, r = {
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(e) {
141
- const i = typeof e == "object" ? e.key : e, c = Object.keys(e).map(function(o) {
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][i] = !0), r.arrays[i] = !0, r.keys.push(i);
149
- }), [].concat(s.boolean || []).filter(Boolean).forEach(function(e) {
150
- r.bools[e] = !0, r.keys.push(e);
151
- }), [].concat(s.string || []).filter(Boolean).forEach(function(e) {
152
- r.strings[e] = !0, r.keys.push(e);
153
- }), [].concat(s.number || []).filter(Boolean).forEach(function(e) {
154
- r.numbers[e] = !0, r.keys.push(e);
155
- }), [].concat(s.count || []).filter(Boolean).forEach(function(e) {
156
- r.counts[e] = !0, r.keys.push(e);
157
- }), [].concat(s.normalize || []).filter(Boolean).forEach(function(e) {
158
- r.normalize[e] = !0, r.keys.push(e);
159
- }), typeof s.narg == "object" && Object.entries(s.narg).forEach(([e, i]) => {
160
- typeof i == "number" && (r.nargs[e] = i, r.keys.push(e));
161
- }), typeof s.coerce == "object" && Object.entries(s.coerce).forEach(([e, i]) => {
162
- typeof i == "function" && (r.coercions[e] = i, r.keys.push(e));
163
- }), typeof s.config < "u" && (Array.isArray(s.config) || typeof s.config == "string" ? [].concat(s.config).filter(Boolean).forEach(function(e) {
164
- r.configs[e] = !0;
165
- }) : typeof s.config == "object" && Object.entries(s.config).forEach(([e, i]) => {
166
- (typeof i == "boolean" || typeof i == "function") && (r.configs[e] = i);
167
- })), qe(s.key, _, s.default, r.arrays), Object.keys(f).forEach(function(e) {
168
- (r.aliases[e] || []).forEach(function(i) {
169
- f[i] = f[e];
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
- Me();
173
+ Mt();
174
174
  let F = [];
175
- const w = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ne = {};
176
- for (let e = 0; e < u.length; e++) {
177
- const i = u[e], c = i.replace(/^-{3,}/, "---");
178
- let o, t, p, l, d, v;
179
- if (i !== "--" && /^-/.test(i) && H(i))
180
- K(i);
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(i);
182
+ K(a);
183
183
  continue;
184
- } else if (i.match(/^--.+=/) || !h["short-option-groups"] && i.match(/^-.+=/))
185
- l = i.match(/^--?([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && (g(l[1], r.arrays) ? e = V(e, l[1], u, l[2]) : g(l[1], r.nargs) !== !1 ? e = D(e, l[1], u, l[2]) : q(l[1], l[2], !0));
186
- else if (i.match(U) && h["boolean-negation"])
187
- l = i.match(U), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], q(t, g(t, r.arrays) ? [!1] : !1));
188
- else if (i.match(/^--.+/) || !h["short-option-groups"] && i.match(/^-[^-]+/))
189
- l = i.match(/^--?(.+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!d.match(/^-/) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
190
- else if (i.match(/^-.\..+=/))
191
- l = i.match(/^-([^=]+)=([\s\S]*)$/), l !== null && Array.isArray(l) && l.length >= 3 && q(l[1], l[2]);
192
- else if (i.match(/^-.\..+/) && !i.match(L))
193
- d = u[e + 1], l = i.match(/^-(.\..+)/), l !== null && Array.isArray(l) && l.length >= 2 && (t = l[1], d !== void 0 && !d.match(/^-/) && !g(t, r.bools) && !g(t, r.counts) ? (q(t, d), e++) : q(t, R(t)));
194
- else if (i.match(/^-[^-]+/) && !i.match(L)) {
195
- p = i.slice(1, -1).split(""), o = !1;
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 = i.slice(x + 2), p[x + 1] && p[x + 1] === "=") {
198
- v = i.slice(x + 3), t = p[x], g(t, r.arrays) ? e = V(e, t, u, v) : g(t, r.nargs) !== !1 ? e = D(e, t, u, v) : q(t, v), o = !0;
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
- t = i.slice(-1)[0], !o && t !== "-" && (g(t, r.arrays) ? e = V(e, t, u) : g(t, r.nargs) !== !1 ? e = D(e, t, u) : (d = u[e + 1], d !== void 0 && (!/^(-|--)[^-]/.test(d) || d.match(L)) && !g(t, r.bools) && !g(t, r.counts) || /^(true|false)$/.test(d) ? (q(t, d), e++) : q(t, R(t))));
216
- } else if (i.match(/^-[0-9]$/) && i.match(L) && g(i.slice(1), r.bools))
217
- t = i.slice(1), q(t, R(t));
218
- else if (i === "--") {
219
- F = u.slice(e + 1);
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(e);
222
+ F = u.slice(t);
223
223
  break;
224
224
  } else
225
- K(i);
225
+ K(a);
226
226
  }
227
- re(w, !0), re(w, !1), ke(w), ge(), me(w, r.aliases, f, !0), fe(w), h["set-placeholder-key"] && be(w), Object.keys(r.counts).forEach(function(e) {
228
- E(w, e.split(".")) || q(e, 0);
229
- }), S && F.length && (w[G] = []), F.forEach(function(e) {
230
- w[G].push(e);
231
- }), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(w).filter((e) => e !== "--" && e.includes("-")).forEach((e) => {
232
- delete w[e];
233
- }), h["strip-aliased"] && [].concat(...Object.keys(_).map((e) => _[e])).forEach((e) => {
234
- h["camel-case-expansion"] && e.includes("-") && delete w[e.split(".").map((i) => W(i)).join(".")], delete w[e];
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(e) {
237
- const i = $("_", e);
238
- (typeof i == "string" || typeof i == "number") && w._.push(i);
236
+ function K(t) {
237
+ const a = $("_", t);
238
+ (typeof a == "string" || typeof a == "number") && w._.push(a);
239
239
  }
240
- function D(e, i, c, o) {
241
- let t, p = g(i, r.nargs);
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", i))), q(i, R(i)), e;
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 - (e + 1) + l < p && (B = Error(C("Not enough arguments following: %s", i))), l = p;
246
+ c.length - (t + 1) + l < p && (B = Error(C("Not enough arguments following: %s", a))), l = p;
247
247
  else {
248
- for (t = e + 1; t < c.length && (!c[t].match(/^-[^0-9]/) || c[t].match(L) || H(c[t])); t++)
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", i)));
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(i, o), d--), t = e + 1; t < d + e + 1; t++)
254
- q(i, c[t]);
255
- return e + d;
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(e, i, c, o) {
258
- let t = [], p = o || c[e + 1];
259
- const l = g(i, r.nargs);
260
- if (g(i, r.bools) && !/^(true|false)$/.test(p))
261
- t.push(!0);
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[i] !== void 0) {
264
- const d = f[i];
265
- t = Array.isArray(d) ? d : [d];
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) || t.push(Y(i, o, !0));
269
- for (let d = e + 1; d < c.length && !(!h["greedy-arrays"] && t.length > 0 || l && typeof l == "number" && t.length >= l || (p = c[d], /^-/.test(p) && !L.test(p) && !H(p))); d++)
270
- e = d, t.push(Y(i, p, k));
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 && t.length < l || isNaN(l) && t.length === 0) && (B = Error(C("Not enough arguments following: %s", i))), q(i, t), e;
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(e, i, c = k) {
275
- if (/-/.test(e) && h["camel-case-expansion"]) {
276
- const p = e.split(".").map(function(l) {
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
- se(e, p);
279
+ st(t, p);
280
280
  }
281
- const o = Y(e, i, c), t = e.split(".");
282
- N(w, t, o), r.aliases[e] && r.aliases[e].forEach(function(p) {
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
- }), t.length > 1 && h["dot-notation"] && (r.aliases[t[0]] || []).forEach(function(p) {
285
+ }), e.length > 1 && h["dot-notation"] && (r.aliases[e[0]] || []).forEach(function(p) {
286
286
  let l = p.split(".");
287
- const d = [].concat(t);
288
- d.shift(), l = l.concat(d), (r.aliases[e] || []).includes(l.join(".")) || N(w, l, o);
289
- }), g(e, r.normalize) && !g(e, r.arrays) && [e].concat(r.aliases[e] || []).forEach(function(l) {
290
- Object.defineProperty(ne, l, {
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 i;
293
+ return a;
294
294
  },
295
295
  set(d) {
296
- i = typeof d == "string" ? A.normalize(d) : d;
296
+ a = typeof d == "string" ? A.normalize(d) : d;
297
297
  }
298
298
  });
299
299
  });
300
300
  }
301
- function se(e, i) {
302
- r.aliases[e] && r.aliases[e].length || (r.aliases[e] = [i], Q[i] = !0), r.aliases[i] && r.aliases[i].length || se(i, e);
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(e, i, c) {
305
- c && (i = je(i)), (g(e, r.bools) || g(e, r.counts)) && typeof i == "string" && (i = i === "true");
306
- let o = Array.isArray(i) ? i.map(function(t) {
307
- return $(e, t);
308
- }) : $(e, i);
309
- return g(e, r.counts) && (T(o) || typeof o == "boolean") && (o = Z()), g(e, r.normalize) && g(e, r.arrays) && (Array.isArray(i) ? o = i.map((t) => A.normalize(t)) : o = A.normalize(i)), o;
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 $(e, i) {
312
- return !h["parse-positional-numbers"] && e === "_" || !g(e, r.strings) && !g(e, r.bools) && !Array.isArray(i) && (Re(i) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${i}`))) || !T(i) && g(e, r.numbers)) && (i = Number(i)), i;
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 ke(e) {
315
- const i = /* @__PURE__ */ Object.create(null);
316
- me(i, r.aliases, f), Object.keys(r.configs).forEach(function(c) {
317
- const o = e[c] || i[c];
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 t = null;
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
- t = l(p);
324
+ e = l(p);
325
325
  } catch (d) {
326
- t = d;
326
+ e = d;
327
327
  }
328
- if (t instanceof Error) {
329
- B = t;
328
+ if (e instanceof Error) {
329
+ B = e;
330
330
  return;
331
331
  }
332
332
  } else
333
- t = A.require(p);
334
- J(t);
335
- } catch (t) {
336
- t.name === "PermissionDenied" ? B = t : e[c] && (B = Error(C("Invalid JSON config file: %s", o)));
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(e, i) {
341
- Object.keys(e).forEach(function(c) {
342
- const o = e[c], t = i ? i + "." + c : c;
343
- typeof o == "object" && o !== null && !Array.isArray(o) && h["dot-notation"] ? J(o, t) : (!E(w, t.split(".")) || g(t, r.arrays) && h["combine-arrays"]) && q(t, o);
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 ge() {
347
- typeof y < "u" && y.forEach(function(e) {
348
- J(e);
346
+ function gt() {
347
+ typeof y < "u" && y.forEach(function(t) {
348
+ J(t);
349
349
  });
350
350
  }
351
- function re(e, i) {
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(t) {
356
- if (c === "" || t.lastIndexOf(c, 0) === 0) {
357
- const p = t.split("__").map(function(l, d) {
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
- (i && r.configs[p.join(".")] || !i) && !E(e, p) && q(p.join("."), o[t]);
360
+ (a && r.configs[p.join(".")] || !a) && !E(t, p) && q(p.join("."), o[e]);
361
361
  }
362
362
  });
363
363
  }
364
- function fe(e) {
365
- let i;
364
+ function ft(t) {
365
+ let a;
366
366
  const c = /* @__PURE__ */ new Set();
367
- Object.keys(e).forEach(function(o) {
368
- if (!c.has(o) && (i = g(o, r.coercions), typeof i == "function"))
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 t = $(o, i(e[o]));
370
+ const e = $(o, a(t[o]));
371
371
  [].concat(r.aliases[o] || [], o).forEach((p) => {
372
- c.add(p), e[p] = t;
372
+ c.add(p), t[p] = e;
373
373
  });
374
- } catch (t) {
375
- B = t;
374
+ } catch (e) {
375
+ B = e;
376
376
  }
377
377
  });
378
378
  }
379
- function be(e) {
380
- return r.keys.forEach((i) => {
381
- ~i.indexOf(".") || typeof e[i] > "u" && (e[i] = void 0);
382
- }), e;
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 me(e, i, c, o = !1) {
385
- Object.keys(c).forEach(function(t) {
386
- E(e, t.split(".")) || (N(e, t.split("."), c[t]), o && (oe[t] = !0), (i[t] || []).forEach(function(p) {
387
- E(e, p.split(".")) || N(e, p.split("."), c[t]);
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(e, i) {
392
- let c = e;
393
- h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(t) {
394
- c = c[t] || {};
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 = i[i.length - 1];
396
+ const o = a[a.length - 1];
397
397
  return typeof c != "object" ? !1 : o in c;
398
398
  }
399
- function N(e, i, c) {
400
- let o = e;
401
- h["dot-notation"] || (i = [i.join(".")]), i.slice(0, -1).forEach(function(v) {
402
- v = ce(v), typeof o == "object" && o[v] === void 0 && (o[v] = {}), typeof o[v] != "object" || Array.isArray(o[v]) ? (Array.isArray(o[v]) ? o[v].push({}) : o[v] = [o[v], {}], o = o[v][o[v].length - 1]) : o = o[v];
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 t = ce(i[i.length - 1]), p = g(i.join("."), r.arrays), l = Array.isArray(c);
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(t, r.nargs) && (d = !0, (!T(o[t]) && r.nargs[t] === 1 || Array.isArray(o[t]) && o[t].length === r.nargs[t]) && (o[t] = void 0)), c === Z() ? o[t] = Z(o[t]) : Array.isArray(o[t]) ? d && p && l ? o[t] = h["flatten-duplicate-arrays"] ? o[t].concat(c) : (Array.isArray(o[t][0]) ? o[t] : [o[t]]).concat([c]) : !d && !!p == !!l ? o[t] = c : o[t] = o[t].concat([c]) : o[t] === void 0 && p ? o[t] = l ? c : [c] : d && !(o[t] === void 0 || g(t, r.counts) || g(t, r.bools)) ? o[t] = [o[t], c] : o[t] = c;
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 qe(...e) {
409
- e.forEach(function(i) {
410
- Object.keys(i || {}).forEach(function(c) {
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 t = W(o);
414
- t !== c && r.aliases[c].indexOf(t) === -1 && (r.aliases[c].push(t), Q[t] = !0);
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 t = Oe(o, "-");
419
- t !== c && r.aliases[c].indexOf(t) === -1 && (r.aliases[c].push(t), Q[t] = !0);
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(t) {
423
- return o !== t;
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(e, i) {
430
- const c = [].concat(r.aliases[e] || [], e), o = Object.keys(i), t = c.find((p) => o.includes(p));
431
- return t ? i[t] : !1;
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 ue(e) {
434
- const i = Object.keys(r);
435
- return [].concat(i.map((o) => r[o])).some(function(o) {
436
- return Array.isArray(o) ? o.includes(e) : o[e];
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 we(e, ...i) {
440
- return [].concat(...i).some(function(o) {
441
- const t = e.match(o);
442
- return t && ue(t[1]);
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 ve(e) {
446
- if (e.match(L) || !e.match(/^-[^-]+/))
445
+ function vt(t) {
446
+ if (t.match(L) || !t.match(/^-[^-]+/))
447
447
  return !1;
448
- let i = !0, c;
449
- const o = e.slice(1).split("");
450
- for (let t = 0; t < o.length; t++) {
451
- if (c = e.slice(t + 2), !ue(o[t])) {
452
- i = !1;
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[t + 1] && o[t + 1] === "=" || c === "-" || /[A-Za-z]/.test(o[t]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(c) || o[t + 1] && o[t + 1].match(/\W/))
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 i;
458
+ return a;
459
459
  }
460
- function H(e) {
461
- return h["unknown-options-as-args"] && xe(e);
460
+ function H(t) {
461
+ return h["unknown-options-as-args"] && xt(t);
462
462
  }
463
- function xe(e) {
464
- return e = e.replace(/^-{3,}/, "--"), e.match(L) || ve(e) ? !1 : !we(e, /^-+([^=]+?)=[\s\S]*$/, U, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
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(e) {
467
- return !g(e, r.bools) && !g(e, r.counts) && `${e}` in f ? f[e] : ye(Be(e));
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 ye(e) {
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
- }[e];
475
+ }[t];
476
476
  }
477
- function Be(e) {
478
- let i = I.BOOLEAN;
479
- return g(e, r.strings) ? i = I.STRING : g(e, r.numbers) ? i = I.NUMBER : g(e, r.bools) ? i = I.BOOLEAN : g(e, r.arrays) && (i = I.ARRAY), i;
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(e) {
482
- return e === void 0;
481
+ function T(t) {
482
+ return t === void 0;
483
483
  }
484
- function Me() {
485
- Object.keys(r.counts).find((e) => g(e, r.arrays) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.array.", e)), !0) : g(e, r.nargs) ? (B = Error(C("Invalid configuration: %s, opts.count excludes opts.narg.", e)), !0) : !1);
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(ne, w),
489
+ argv: Object.assign(nt, w),
490
490
  configuration: h,
491
- defaulted: Object.assign({}, oe),
491
+ defaulted: Object.assign({}, ot),
492
492
  error: B,
493
493
  newAliases: Object.assign({}, Q)
494
494
  };
495
495
  }
496
496
  }
497
- function ze(a) {
497
+ function zt(i) {
498
498
  const n = [], m = /* @__PURE__ */ Object.create(null);
499
499
  let s = !0;
500
- for (Object.keys(a).forEach(function(u) {
501
- n.push([].concat(a[u], u));
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(a) {
522
- return a !== void 0 ? a + 1 : 1;
521
+ function Z(i) {
522
+ return i !== void 0 ? i + 1 : 1;
523
523
  }
524
- function ce(a) {
525
- return a === "__proto__" ? "___proto___" : a;
524
+ function ct(i) {
525
+ return i === "__proto__" ? "___proto___" : i;
526
526
  }
527
- function je(a) {
528
- return typeof a == "string" && (a[0] === "'" || a[0] === '"') && a[a.length - 1] === a[0] ? a.substring(1, a.length - 1) : a;
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, ee, te;
539
- const le = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, pe = (ee = (X = process == null ? void 0 : process.versions) === null || X === void 0 ? void 0 : X.node) !== null && ee !== void 0 ? ee : (te = process == null ? void 0 : process.version) === null || te === void 0 ? void 0 : te.slice(1);
540
- if (pe && Number(pe.match(/^([^.]+)/)[1]) < le)
541
- throw Error(`yargs parser supports a minimum Node.js version of ${le}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
542
- const Qe = process ? process.env : {};
543
- new Ne({
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: () => Qe,
546
- format: he,
547
- normalize: Ie,
548
- resolve: ie,
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: (a) => {
551
+ require: (i) => {
552
552
  if (typeof require < "u")
553
- return require(a);
554
- if (a.match(/\.json$/))
555
- return JSON.parse(_e(a, "utf8"));
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 Fe = {
559
+ const Ft = {
560
560
  fs: {
561
- readFileSync: _e,
562
- writeFile: Le
561
+ readFileSync: _t,
562
+ writeFile: Lt
563
563
  },
564
- format: he,
565
- resolve: ie,
566
- exists: (a) => {
564
+ format: ht,
565
+ resolve: at,
566
+ exists: (i) => {
567
567
  try {
568
- return Pe(a).isFile();
568
+ return Pt(i).isFile();
569
569
  } catch {
570
570
  return !1;
571
571
  }
572
572
  }
573
573
  };
574
574
  let M;
575
- class De {
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 Ve(a, n) {
661
+ function Vt(i, n) {
662
662
  M = n;
663
- const m = new De(a);
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 $e = (a) => Ve(a, Fe);
673
+ const $t = (i) => Vt(i, Ft);
674
674
  let z;
675
675
  try {
676
- z = Te(import.meta.url);
676
+ z = Tt(import.meta.url);
677
677
  } catch {
678
678
  z = process.cwd();
679
679
  }
680
- const He = z.substring(0, z.lastIndexOf("node_modules"));
681
- He || process.cwd(), process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, $e({
682
- directory: ie(z, "../../../locales"),
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 ae = [
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: "meta.llama3-8b-instruct-v1:0",
1151
- match: {
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
- or: [
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 1.0",
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
- or: [
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-pro-v1",
1195
- name: "Nova Pro 1.0",
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
- or: [
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 We(a, n) {
13338
+ function Wt(i, n) {
12610
13339
  if (n <= 0) return 0;
12611
13340
  let m = 0;
12612
- const s = [...a.tiers].sort((_, h) => _.start - h.start), u = s[0]?.start ?? n, k = Math.min(n, u);
12613
- m += k * a.base / 1e6;
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(a, n, m) {
12621
- return a === void 0 || n === void 0 ? 0 : typeof a == "number" ? a * n / 1e6 : We(a, n);
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 Ue(a, n) {
13352
+ function Ut(i, n) {
12624
13353
  let m = 0, s = 0;
12625
- const u = a.cache_read_tokens ?? 0, k = a.cache_write_tokens ?? 0, _ = a.cache_audio_read_tokens ?? 0, h = a.output_audio_tokens ?? 0;
12626
- let f = a.input_audio_tokens ?? 0;
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 = a.input_tokens ?? 0;
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 = a.output_tokens ?? 0;
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, a.output_audio_tokens);
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 Ke(a, n) {
12648
- if (!Array.isArray(a.prices))
12649
- return a.prices;
12650
- for (let m = a.prices.length - 1; m >= 0; m--) {
12651
- const s = a.prices[m], u = s.constraint;
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 a.prices[0].prices;
13395
+ return i.prices[0].prices;
12667
13396
  }
12668
- function j(a, n) {
12669
- return "or" in a ? a.or.some((m) => j(m, n)) : "and" in a ? a.and.every((m) => j(m, n)) : "equals" in a ? n === a.equals : "starts_with" in a ? n.startsWith(a.starts_with) : "ends_with" in a ? n.endsWith(a.ends_with) : "contains" in a ? n.includes(a.contains) : "regex" in a ? new RegExp(a.regex).test(n) : !1;
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 Ye(a, n) {
12672
- const m = n.toLowerCase().trim(), s = a.find((u) => u.id === m);
12673
- return s || a.find((u) => u.provider_match && j(u.provider_match, m));
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 Je(a, { modelId: n, providerApiUrl: m, providerId: s }) {
13404
+ function Jt(i, { modelId: n, providerApiUrl: m, providerId: s }) {
12676
13405
  if (s)
12677
- return Ye(a, s);
13406
+ return Yt(i, s);
12678
13407
  if (m)
12679
- return a.find((u) => new RegExp(u.api_pattern).test(m));
13408
+ return i.find((u) => new RegExp(u.api_pattern).test(m));
12680
13409
  if (n)
12681
- return a.find((u) => u.model_match && j(u.model_match, n));
13410
+ return i.find((u) => u.model_match && j(u.model_match, n));
12682
13411
  }
12683
- function Ze(a, n) {
12684
- return a.find((m) => j(m.match, n));
13412
+ function Zt(i, n) {
13413
+ return i.find((m) => j(m.match, n));
12685
13414
  }
12686
- let Xe = ae;
12687
- Promise.resolve(ae);
12688
- function et(a, n, m) {
12689
- const s = n.toLowerCase().trim(), u = m?.provider ?? Je(Xe, { modelId: s, providerApiUrl: m?.providerApiUrl, providerId: m?.providerId });
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 = Ze(u.models, s);
13420
+ const k = Zt(u.models, s);
12692
13421
  if (!k) return null;
12693
- const _ = m?.timestamp ?? /* @__PURE__ */ new Date(), h = Ke(k, _), f = Ue(a, 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 = de(Ce(process.argv)).scriptName("genai-prices").command(
13431
+ const b = dt(Ct(process.argv)).scriptName("genai-prices").command(
12703
13432
  "list [provider]",
12704
13433
  "List providers and models",
12705
- (a) => a.positional("provider", { describe: "Provider ID to filter", type: "string" })
13434
+ (i) => i.positional("provider", { describe: "Provider ID to filter", type: "string" })
12706
13435
  ).command(
12707
13436
  "calc <model...>",
12708
13437
  "Calculate price",
12709
- (a) => a.positional("model", { array: !0, describe: "Model(s) (optionally provider:model)", type: "string" }).option("input-tokens", { type: "number" }).option("cache-write-tokens", { type: "number" }).option("cache-read-tokens", { type: "number" }).option("output-tokens", { type: "number" }).option("input-audio-tokens", { type: "number" }).option("cache-audio-read-tokens", { type: "number" }).option("output-audio-tokens", { type: "number" }).option("requests", { type: "number" }).option("provider", { type: "string" }).option("auto-update", { default: !1, type: "boolean" }).option("timestamp", { describe: "RFC3339 timestamp", type: "string" })
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 tt() {
13440
+ function ee() {
12712
13441
  if (b._[0] === "list") {
12713
- const m = ae;
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 = et(m, h, { providerId: _, timestamp: s });
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
- de().showHelp(), process.exit(1);
13496
+ dt().showHelp(), process.exit(1);
12768
13497
  }
12769
- tt();
13498
+ ee();