@teinai/cli 1.1.38 → 1.1.39

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.
Files changed (2) hide show
  1. package/index.js +742 -723
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var Bi = Object.create;
4
- var ve = Object.defineProperty;
5
- var ji = Object.getOwnPropertyDescriptor;
6
- var Gi = Object.getOwnPropertyNames;
7
- var Hi = Object.getPrototypeOf,
8
- zi = Object.prototype.hasOwnProperty;
3
+ var Hi = Object.create;
4
+ var Ie = Object.defineProperty;
5
+ var zi = Object.getOwnPropertyDescriptor;
6
+ var Ji = Object.getOwnPropertyNames;
7
+ var Wi = Object.getPrototypeOf,
8
+ Yi = Object.prototype.hasOwnProperty;
9
9
  var h = (e, t, i) => () => {
10
10
  if (i) throw i[0];
11
11
  try {
@@ -14,45 +14,45 @@ var h = (e, t, i) => () => {
14
14
  throw ((i = [a]), a);
15
15
  }
16
16
  };
17
- var Ji = (e, t) => {
18
- for (var i in t) ve(e, i, { get: t[i], enumerable: !0 });
17
+ var Xi = (e, t) => {
18
+ for (var i in t) Ie(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- Wi = (e, t, i, a) => {
20
+ Qi = (e, t, i, a) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of Gi(t))
23
- !zi.call(e, n) &&
22
+ for (let n of Ji(t))
23
+ !Yi.call(e, n) &&
24
24
  n !== i &&
25
- ve(e, n, { get: () => t[n], enumerable: !(a = ji(t, n)) || a.enumerable });
25
+ Ie(e, n, { get: () => t[n], enumerable: !(a = zi(t, n)) || a.enumerable });
26
26
  return e;
27
27
  };
28
28
  var T = (e, t, i) => (
29
- (i = e != null ? Bi(Hi(e)) : {}),
30
- Wi(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
29
+ (i = e != null ? Hi(Wi(e)) : {}),
30
+ Qi(t || !e || !e.__esModule ? Ie(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
- function Qi(e) {
32
+ function ta(e) {
33
33
  for (let t of e)
34
34
  try {
35
- let i = JSON.parse(ct.default.readFileSync(t, 'utf8'));
35
+ let i = JSON.parse(ut.default.readFileSync(t, 'utf8'));
36
36
  if (i.name === '@teinai/cli' && typeof i.version == 'string' && i.version.trim())
37
37
  return i.version.trim();
38
38
  } catch {}
39
- return Xi;
39
+ return ea;
40
40
  }
41
- function Zi() {
41
+ function ia() {
42
42
  let e = typeof __dirname == 'string' ? __dirname : process.cwd();
43
43
  return [
44
- Te.default.join(e, 'package.json'),
45
- Te.default.join(e, '..', '..', 'cli-package', 'package.json'),
44
+ ve.default.join(e, 'package.json'),
45
+ ve.default.join(e, '..', '..', 'cli-package', 'package.json'),
46
46
  ];
47
47
  }
48
- var ct,
49
- Te,
50
- Xi,
48
+ var ut,
49
+ ve,
50
+ ea,
51
51
  F,
52
- ne = h(() => {
52
+ re = h(() => {
53
53
  'use strict';
54
- ((ct = T(require('node:fs'))), (Te = T(require('node:path'))), (Xi = '0.0.0-dev'));
55
- F = Qi(Zi());
54
+ ((ut = T(require('node:fs'))), (ve = T(require('node:path'))), (ea = '0.0.0-dev'));
55
+ F = ta(ia());
56
56
  });
57
57
  function j() {
58
58
  try {
@@ -63,12 +63,12 @@ function j() {
63
63
  } catch {}
64
64
  return {};
65
65
  }
66
- function Ke(e) {
66
+ function Me(e) {
67
67
  try {
68
- R.default.existsSync(oe) || R.default.mkdirSync(oe, { recursive: !0, mode: 448 });
68
+ R.default.existsSync(se) || R.default.mkdirSync(se, { recursive: !0, mode: 448 });
69
69
  let i = { ...j(), ...e };
70
70
  (R.default.writeFileSync(B, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
71
- R.default.chmodSync(oe, 448),
71
+ R.default.chmodSync(se, 448),
72
72
  R.default.chmodSync(B, 384));
73
73
  } catch (t) {
74
74
  throw new Error(`Failed to save config to ${B}: ${t}`);
@@ -88,47 +88,47 @@ function w(e) {
88
88
  let i = j();
89
89
  return i.apiUrl && i.apiUrl.trim() ? i.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
90
90
  }
91
- function le() {
91
+ function oe() {
92
92
  return B;
93
93
  }
94
94
  var R,
95
- ht,
96
- Me,
97
- oe,
95
+ yt,
96
+ Te,
97
+ se,
98
98
  B,
99
- E = h(() => {
99
+ $ = h(() => {
100
100
  'use strict';
101
101
  ((R = T(require('node:fs'))),
102
- (ht = T(require('node:os'))),
103
- (Me = T(require('node:path'))),
104
- (oe = Me.default.join(ht.default.homedir(), '.tein')),
105
- (B = Me.default.join(oe, 'config.json')));
102
+ (yt = T(require('node:os'))),
103
+ (Te = T(require('node:path'))),
104
+ (se = Te.default.join(yt.default.homedir(), '.tein')),
105
+ (B = Te.default.join(se, 'config.json')));
106
106
  });
107
- var ra,
108
- yt,
107
+ var oa,
109
108
  bt,
110
- kt = h(() => {
109
+ kt,
110
+ wt = h(() => {
111
111
  'use strict';
112
- ((ra = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
- (yt = [...ra, 'auto']),
114
- (bt =
112
+ ((oa = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
+ (bt = [...oa, 'auto']),
114
+ (kt =
115
115
  'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
116
116
  });
117
117
  var J,
118
- Ce = h(() => {
118
+ Se = h(() => {
119
119
  'use strict';
120
120
  J = new Set([]);
121
121
  });
122
122
  function W(e) {
123
123
  return !1;
124
124
  }
125
- var wt = h(() => {
125
+ var xt = h(() => {
126
126
  'use strict';
127
127
  });
128
- var de,
129
- xt = h(() => {
128
+ var le,
129
+ _t = h(() => {
130
130
  'use strict';
131
- de = {
131
+ le = {
132
132
  source: 'TEIN Price Board',
133
133
  checked: '17 Sep 2026',
134
134
  generated: '2026-10-01',
@@ -6240,16 +6240,16 @@ var de,
6240
6240
  ],
6241
6241
  };
6242
6242
  });
6243
- var _t,
6244
- Pt = h(() => {
6243
+ var Pt,
6244
+ It = h(() => {
6245
6245
  'use strict';
6246
- _t = [];
6246
+ Pt = [];
6247
6247
  });
6248
- var pe,
6249
- It,
6250
- $e = h(() => {
6248
+ var de,
6249
+ vt,
6250
+ Ee = h(() => {
6251
6251
  'use strict';
6252
- ((pe = [
6252
+ ((de = [
6253
6253
  {
6254
6254
  slug: 'tein-video-upscaler',
6255
6255
  name: 'Tein Video Upscaler',
@@ -6324,12 +6324,12 @@ var pe,
6324
6324
  from: { variant: 'swap' },
6325
6325
  },
6326
6326
  ]),
6327
- (It = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6327
+ (vt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6328
6328
  });
6329
- function Oe(e, t) {
6329
+ function Ae(e, t) {
6330
6330
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
6331
6331
  }
6332
- function oa(e, t) {
6332
+ function pa(e, t) {
6333
6333
  if (e === 'seedance-2-mini') return 'mini';
6334
6334
  if (e !== 'seedance-2') return;
6335
6335
  let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -6339,100 +6339,99 @@ function oa(e, t) {
6339
6339
  ? 'fast'
6340
6340
  : 'standard';
6341
6341
  }
6342
- function la(e, t) {
6342
+ function ca(e, t) {
6343
6343
  let i = e
6344
6344
  .trim()
6345
6345
  .toLowerCase()
6346
6346
  .replace(/-(?:unfiltered|uncensored)$/, '');
6347
6347
  if (i === 'seedance-2' || i === 'seedance-2-mini') {
6348
- let n = oa(i, t),
6349
- s = Ee.get(Oe('seedance-2', n));
6348
+ let n = pa(i, t),
6349
+ s = Ce.get(Ae('seedance-2', n));
6350
6350
  return s ? s.slug : null;
6351
6351
  }
6352
- let a = ce.get(i) ?? Ee.get(Oe(i));
6352
+ let a = pe.get(i) ?? Ce.get(Ae(i));
6353
6353
  return a ? a.slug : null;
6354
6354
  }
6355
- function pa(e, t) {
6356
- return ce.has(e) && !(da.has(e) && t) ? e : la(e, t);
6355
+ function ma(e, t) {
6356
+ return pe.has(e) && !(ua.has(e) && t) ? e : ca(e, t);
6357
6357
  }
6358
6358
  function Y(e, t) {
6359
- let i = pa(e, t);
6360
- return i ? (ce.get(i) ?? null) : null;
6359
+ let i = ma(e, t);
6360
+ return i ? (pe.get(i) ?? null) : null;
6361
6361
  }
6362
- function ue() {
6363
- return Kt;
6362
+ function ce() {
6363
+ return St;
6364
6364
  }
6365
- var qe,
6366
- Tt,
6365
+ var Oe,
6367
6366
  Mt,
6368
6367
  Kt,
6369
- na,
6370
- ce,
6371
- Ee,
6372
- vt,
6373
- sa,
6374
- Ae,
6368
+ St,
6369
+ la,
6370
+ pe,
6371
+ Ce,
6372
+ Tt,
6375
6373
  da,
6374
+ $e,
6375
+ ua,
6376
6376
  G = h(() => {
6377
6377
  'use strict';
6378
- wt();
6379
6378
  xt();
6380
- Pt();
6381
- $e();
6382
- ((qe = {
6383
- ...de,
6384
- families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
6385
- models: de.models.filter((e) => !W(e.slug)),
6379
+ _t();
6380
+ It();
6381
+ Ee();
6382
+ ((Oe = {
6383
+ ...le,
6384
+ families: le.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
6385
+ models: le.models.filter((e) => !W(e.slug)),
6386
6386
  }),
6387
- (Tt = pe.filter((e) => !W(e.slug))),
6388
- (Mt = _t.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
6389
- (Kt = [...qe.models, ...Mt, ...Tt]),
6390
- (na = [
6391
- ...qe.families.map((e) => {
6392
- let t = Mt.filter((i) => i.family === e.slug).map((i) => i.slug);
6387
+ (Mt = de.filter((e) => !W(e.slug))),
6388
+ (Kt = Pt.filter((e) => !W(e.slug) && !Oe.models.some((t) => t.slug === e.slug))),
6389
+ (St = [...Oe.models, ...Kt, ...Mt]),
6390
+ (la = [
6391
+ ...Oe.families.map((e) => {
6392
+ let t = Kt.filter((i) => i.family === e.slug).map((i) => i.slug);
6393
6393
  return t.length ? { ...e, models: [...e.models, ...t] } : e;
6394
6394
  }),
6395
- ...It.map((e) => ({
6396
- ...e,
6397
- models: Tt.filter((t) => t.family === e.slug).map((t) => t.slug),
6398
- })).filter((e) => e.models.length > 0),
6395
+ ...vt
6396
+ .map((e) => ({ ...e, models: Mt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
6397
+ .filter((e) => e.models.length > 0),
6399
6398
  ]),
6400
- (ce = new Map()),
6401
- (Ee = new Map()),
6402
- (vt = new Map()),
6403
- (sa = new Map()),
6404
- (Ae = new Map()));
6405
- for (let e of Kt) {
6406
- (ce.set(e.slug, e), Ee.set(Oe(e.api.model, e.api.quality), e));
6407
- for (let t of e.variants) vt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6399
+ (pe = new Map()),
6400
+ (Ce = new Map()),
6401
+ (Tt = new Map()),
6402
+ (da = new Map()),
6403
+ ($e = new Map()));
6404
+ for (let e of St) {
6405
+ (pe.set(e.slug, e), Ce.set(Ae(e.api.model, e.api.quality), e));
6406
+ for (let t of e.variants) Tt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6408
6407
  for (let t of e.editVariants ?? [])
6409
- vt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6410
- for (let t of e.addons ?? []) sa.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6411
- Ae.set(e.slug, e.family);
6408
+ Tt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6409
+ for (let t of e.addons ?? []) da.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6410
+ $e.set(e.slug, e.family);
6412
6411
  }
6413
- for (let e of na) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
6414
- da = new Set(['seedance-2']);
6412
+ for (let e of la) for (let t of e.models) $e.has(t) || $e.set(t, e.slug);
6413
+ ua = new Set(['seedance-2']);
6415
6414
  });
6416
- function me(e) {
6415
+ function ue(e) {
6417
6416
  let t = e.from?.variant;
6418
6417
  return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
6419
6418
  }
6420
- function Re(e) {
6419
+ function qe(e) {
6421
6420
  if (e.endpoints?.length)
6422
- return e.editVariants?.length && e.endpoints.some((t) => t.id === St)
6423
- ? St
6421
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === Et)
6422
+ ? Et
6424
6423
  : (e.defaultEndpoint ?? e.endpoints[0].id);
6425
6424
  }
6426
- var St,
6427
- Le = h(() => {
6425
+ var Et,
6426
+ Re = h(() => {
6428
6427
  'use strict';
6429
6428
  G();
6430
- St = 'dynamic';
6429
+ Et = 'dynamic';
6431
6430
  });
6432
- var fe,
6433
- De = h(() => {
6431
+ var me,
6432
+ Le = h(() => {
6434
6433
  'use strict';
6435
- fe = {
6434
+ me = {
6436
6435
  'gemini-3-8-flash': 'gemini-3.8-flash',
6437
6436
  'gemini-3-7-flash': 'gemini-3.7-flash',
6438
6437
  'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
@@ -6446,25 +6445,25 @@ var Ct = h(() => {
6446
6445
  'use strict';
6447
6446
  });
6448
6447
  function $t(e, t) {
6449
- return typeof t == 'string' && (ca[e]?.includes(t) ?? !1);
6448
+ return typeof t == 'string' && (fa[e]?.includes(t) ?? !1);
6450
6449
  }
6451
- var ca,
6452
- Et = h(() => {
6450
+ var fa,
6451
+ At = h(() => {
6453
6452
  'use strict';
6454
6453
  G();
6455
- Le();
6454
+ Re();
6456
6455
  Ct();
6457
- ca = {};
6456
+ fa = {};
6458
6457
  });
6459
- function At(e) {
6460
- return e === 'nano-banana-pro' ? ua : ma;
6458
+ function Ot(e) {
6459
+ return e === 'nano-banana-pro' ? ga : ha;
6461
6460
  }
6462
- var ua,
6463
- ma,
6464
- Ot = h(() => {
6461
+ var ga,
6462
+ ha,
6463
+ qt = h(() => {
6465
6464
  'use strict';
6466
- ((ua = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6467
- (ma = [
6465
+ ((ga = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6466
+ (ha = [
6468
6467
  'auto',
6469
6468
  '1:1',
6470
6469
  '1:4',
@@ -6482,10 +6481,10 @@ var ua,
6482
6481
  '21:9',
6483
6482
  ]));
6484
6483
  });
6485
- var qt,
6486
- Rt = h(() => {
6484
+ var Rt,
6485
+ Lt = h(() => {
6487
6486
  'use strict';
6488
- qt = [
6487
+ Rt = [
6489
6488
  'prompt',
6490
6489
  'system',
6491
6490
  'messages',
@@ -6499,10 +6498,10 @@ var qt,
6499
6498
  'endpoint',
6500
6499
  ];
6501
6500
  });
6502
- var Lt,
6503
- Dt = h(() => {
6501
+ var Dt,
6502
+ Nt = h(() => {
6504
6503
  'use strict';
6505
- Lt = [
6504
+ Dt = [
6506
6505
  {
6507
6506
  slug: 'claude-fable-5-1',
6508
6507
  family: 'fable-5-1',
@@ -6574,10 +6573,10 @@ var Lt,
6574
6573
  function Vt(e) {
6575
6574
  return `$${e}`;
6576
6575
  }
6577
- function Ve(e, t, i) {
6576
+ function De(e, t, i) {
6578
6577
  return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
6579
6578
  }
6580
- function fa(e) {
6579
+ function ya(e) {
6581
6580
  return [
6582
6581
  {
6583
6582
  name: 'prompt',
@@ -6643,12 +6642,12 @@ function fa(e) {
6643
6642
  },
6644
6643
  ];
6645
6644
  }
6646
- function Nt() {
6645
+ function Ut() {
6647
6646
  return Object.fromEntries(
6648
- Lt.map((e) => {
6649
- let t = Ve(e.slug, 'cheap', 'input'),
6650
- i = Ve(e.slug, 'cheap', 'output'),
6651
- a = Ve(e.slug, 'stable', 'input') != null,
6647
+ Dt.map((e) => {
6648
+ let t = De(e.slug, 'cheap', 'input'),
6649
+ i = De(e.slug, 'cheap', 'output'),
6650
+ a = De(e.slug, 'stable', 'input') != null,
6652
6651
  n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
6653
6652
  s = {
6654
6653
  slug: e.slug,
@@ -6660,50 +6659,50 @@ function Nt() {
6660
6659
  priceFormatted: n,
6661
6660
  unit: '/M tokens',
6662
6661
  primaryToolName: 'run_task',
6663
- parameters: fa(a),
6662
+ parameters: ya(a),
6664
6663
  };
6665
6664
  return [e.slug, s];
6666
6665
  }),
6667
6666
  );
6668
6667
  }
6669
- var Ut = h(() => {
6668
+ var Ft = h(() => {
6670
6669
  'use strict';
6671
- Dt();
6670
+ Nt();
6672
6671
  G();
6673
6672
  });
6674
- function ge(e) {
6675
- return e ? ha.get(e) : void 0;
6673
+ function fe(e) {
6674
+ return e ? ka.get(e) : void 0;
6676
6675
  }
6677
- function Gt(e, t) {
6676
+ function Ht(e, t) {
6678
6677
  return !e.aspects?.length || e.sourceFramedModes?.includes(t)
6679
6678
  ? null
6680
6679
  : e.adaptiveModes?.includes(t)
6681
6680
  ? [...e.aspects, 'adaptive']
6682
6681
  : [...e.aspects];
6683
6682
  }
6684
- function Ht(e, t, i) {
6683
+ function zt(e, t, i) {
6685
6684
  return e.modes.includes('motion_control')
6686
6685
  ? t === 'motion_control'
6687
- ? !ba.includes(i)
6688
- : !ya.includes(i)
6686
+ ? !xa.includes(i)
6687
+ : !wa.includes(i)
6689
6688
  : !0;
6690
6689
  }
6691
- var Ft,
6692
- ga,
6693
- Bt,
6694
- In,
6695
- ha,
6690
+ var Bt,
6691
+ ba,
6696
6692
  jt,
6693
+ Mn,
6694
+ ka,
6695
+ Gt,
6697
6696
  Ne,
6698
- vn,
6699
- Ue,
6700
- ya,
6701
- ba,
6702
- Fe = h(() => {
6697
+ Kn,
6698
+ Ve,
6699
+ wa,
6700
+ xa,
6701
+ Ue = h(() => {
6703
6702
  'use strict';
6704
- ((Ft = ['16:9', '9:16', '1:1', '21:9']),
6705
- (ga = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6706
- (Bt = [
6703
+ ((Bt = ['16:9', '9:16', '1:1', '21:9']),
6704
+ (ba = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6705
+ (jt = [
6707
6706
  {
6708
6707
  slug: 'kling-v4',
6709
6708
  kind: 'video',
@@ -6711,7 +6710,7 @@ var Ft,
6711
6710
  promptMax: 26e3,
6712
6711
  duration: { min: 3, max: 30, default: 5 },
6713
6712
  heights: { '720p': 720, '1080p': 1080 },
6714
- aspects: Ft,
6713
+ aspects: Bt,
6715
6714
  sourceFramedModes: ['image_to_video'],
6716
6715
  adaptiveModes: ['multi_reference'],
6717
6716
  fps: 24,
@@ -6735,7 +6734,7 @@ var Ft,
6735
6734
  promptMax: 26e3,
6736
6735
  duration: { min: 3, max: 20, default: 5 },
6737
6736
  heights: { '720p': 720 },
6738
- aspects: [...Ft, '4:3', '3:4'],
6737
+ aspects: [...Bt, '4:3', '3:4'],
6739
6738
  sourceFramedModes: ['image_to_video'],
6740
6739
  adaptiveModes: ['multi_reference'],
6741
6740
  fps: 24,
@@ -6775,7 +6774,7 @@ var Ft,
6775
6774
  promptMax: 65535,
6776
6775
  duration: { min: 5, max: 15, default: 5 },
6777
6776
  heights: { '480p': 480, '768p': 768 },
6778
- aspects: ga,
6777
+ aspects: ba,
6779
6778
  fps: 24,
6780
6779
  audio: 'free',
6781
6780
  seed: !0,
@@ -6850,9 +6849,9 @@ var Ft,
6850
6849
  seed: !0,
6851
6850
  },
6852
6851
  ]),
6853
- (In = Bt.map((e) => e.slug)),
6854
- (ha = new Map(Bt.map((e) => [e.slug, e]))));
6855
- ((jt = 'EXAVITQu4vr4xnSDxMaL'),
6852
+ (Mn = jt.map((e) => e.slug)),
6853
+ (ka = new Map(jt.map((e) => [e.slug, e]))));
6854
+ ((Gt = 'EXAVITQu4vr4xnSDxMaL'),
6856
6855
  (Ne = {
6857
6856
  hpp4J3VqNfWAUOO0d1Us: 'Bella',
6858
6857
  CwhRBWXzGAHq8TQ4Fs17: 'Roger',
@@ -6875,8 +6874,8 @@ var Ft,
6875
6874
  pqHfZKP75CvOlQylNhV4: 'Bill',
6876
6875
  pNInz6obpgDQGcFmaJgB: 'Adam',
6877
6876
  }),
6878
- (vn = Object.keys(Ne)),
6879
- (Ue = [
6877
+ (Kn = Object.keys(Ne)),
6878
+ (Ve = [
6880
6879
  'mp3_44100_128',
6881
6880
  'mp3_22050_32',
6882
6881
  'mp3_24000_48',
@@ -6890,8 +6889,8 @@ var Ft,
6890
6889
  'opus_48000_128',
6891
6890
  'opus_48000_192',
6892
6891
  ]));
6893
- ((ya = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6894
- (ba = [
6892
+ ((wa = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6893
+ (xa = [
6895
6894
  'duration',
6896
6895
  'aspect_ratio',
6897
6896
  'generate_audio',
@@ -6903,7 +6902,7 @@ var Ft,
6903
6902
  'audios',
6904
6903
  ]));
6905
6904
  });
6906
- function wa() {
6905
+ function Pa() {
6907
6906
  return [
6908
6907
  {
6909
6908
  name: 'image_url',
@@ -6931,7 +6930,7 @@ function wa() {
6931
6930
  },
6932
6931
  ];
6933
6932
  }
6934
- function xa(e) {
6933
+ function Ia(e) {
6935
6934
  let t = e.duration,
6936
6935
  i = Object.keys(e.heights),
6937
6936
  a = e.sourceFramedModes?.length
@@ -7024,7 +7023,7 @@ function xa(e) {
7024
7023
  }
7025
7024
  return o;
7026
7025
  }
7027
- function _a(e) {
7026
+ function va(e) {
7028
7027
  let t = Object.keys(e.sizes);
7029
7028
  return [
7030
7029
  {
@@ -7041,13 +7040,13 @@ function _a(e) {
7041
7040
  },
7042
7041
  ];
7043
7042
  }
7044
- function Ia() {
7043
+ function Ma() {
7045
7044
  return [
7046
7045
  {
7047
7046
  name: 'voice_id',
7048
7047
  type: 'string',
7049
- default: jt,
7050
- description: `text_to_speech: the ElevenLabs voice id, one of: ${Pa}.`,
7048
+ default: Gt,
7049
+ description: `text_to_speech: the ElevenLabs voice id, one of: ${Ta}.`,
7051
7050
  },
7052
7051
  {
7053
7052
  name: 'turns',
@@ -7055,7 +7054,7 @@ function Ia() {
7055
7054
  description:
7056
7055
  'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
7057
7056
  },
7058
- { name: 'output_format', type: 'select', default: Ue[0], options: [...Ue] },
7057
+ { name: 'output_format', type: 'select', default: Ve[0], options: [...Ve] },
7059
7058
  { name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
7060
7059
  {
7061
7060
  name: 'similarity_boost',
@@ -7066,7 +7065,7 @@ function Ia() {
7066
7065
  },
7067
7066
  ];
7068
7067
  }
7069
- function zt(e) {
7068
+ function Jt(e) {
7070
7069
  let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
7071
7070
  i = [
7072
7071
  {
@@ -7081,26 +7080,26 @@ function zt(e) {
7081
7080
  required: !0,
7082
7081
  ...(e.modeRequired ? {} : { default: e.modes[0] }),
7083
7082
  options: [...e.modes],
7084
- description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ka[a]).join(' ')}`,
7083
+ description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => _a[a]).join(' ')}`,
7085
7084
  },
7086
7085
  ];
7087
7086
  return (
7088
- e.kind === 'video' ? i.push(...xa(e)) : e.kind === 'image' ? i.push(..._a(e)) : i.push(...Ia()),
7089
- e.modes.includes('motion_control') && i.push(...wa()),
7087
+ e.kind === 'video' ? i.push(...Ia(e)) : e.kind === 'image' ? i.push(...va(e)) : i.push(...Ma()),
7088
+ e.modes.includes('motion_control') && i.push(...Pa()),
7090
7089
  e.seed &&
7091
7090
  i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
7092
7091
  i
7093
7092
  );
7094
7093
  }
7095
7094
  var L,
7096
- ka,
7097
- Pa,
7098
- Jt = h(() => {
7095
+ _a,
7096
+ Ta,
7097
+ Wt = h(() => {
7099
7098
  'use strict';
7100
- Fe();
7099
+ Ue();
7101
7100
  ((L =
7102
7101
  'as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
7103
- (ka = {
7102
+ (_a = {
7104
7103
  text_to_video: 'text_to_video: from the prompt alone.',
7105
7104
  image_to_video: 'image_to_video: a start image in first_frame_image.',
7106
7105
  first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
@@ -7112,34 +7111,49 @@ var L,
7112
7111
  motion_control:
7113
7112
  'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
7114
7113
  }));
7115
- Pa = Object.entries(Ne)
7114
+ Ta = Object.entries(Ne)
7116
7115
  .map(([e, t]) => `${e} (${t})`)
7117
7116
  .join(', ');
7118
7117
  });
7119
- var he,
7120
- Wt,
7121
- X,
7118
+ var ge,
7122
7119
  Yt,
7123
- Sn,
7124
- Cn,
7120
+ Fe,
7121
+ Xt,
7125
7122
  $n,
7126
- En,
7127
- Xt = h(() => {
7123
+ An,
7124
+ On,
7125
+ qn,
7126
+ Qt = h(() => {
7128
7127
  'use strict';
7129
- ((he = 'enhancor-ultrafine'),
7130
- (Wt = 'Enhancor Ultrafine'),
7131
- (X = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7132
- (Yt = 2),
7133
- (Sn = 24 * 1024 * 1024),
7134
- (Cn = 4096 * 4096),
7135
- ($n = 30 * 6e4),
7136
- (En = 120 * 6e4));
7128
+ ((ge = 'enhancor-ultrafine'),
7129
+ (Yt = 'Enhancor Ultrafine'),
7130
+ (Fe = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7131
+ (Xt = 2),
7132
+ ($n = 24 * 1024 * 1024),
7133
+ (An = 4096 * 4096),
7134
+ (On = 30 * 6e4),
7135
+ (qn = 120 * 6e4));
7137
7136
  });
7138
- var Q,
7139
- ye,
7140
- Be = h(() => {
7137
+ var Be,
7138
+ Zt,
7139
+ ei = h(() => {
7140
+ 'use strict';
7141
+ ((Be = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
7142
+ (Zt = {
7143
+ natural: 'Natural',
7144
+ pores: 'Pores',
7145
+ freckles: 'Freckles',
7146
+ more_freckles: 'More freckles',
7147
+ blemish: 'Blemish',
7148
+ glow: 'Glow',
7149
+ unblur: 'Unblur',
7150
+ }));
7151
+ });
7152
+ var X,
7153
+ he,
7154
+ je = h(() => {
7141
7155
  'use strict';
7142
- ((Q = [
7156
+ ((X = [
7143
7157
  'seedance-2-5',
7144
7158
  'seedance-2-5-flash',
7145
7159
  'seedance-2',
@@ -7151,13 +7165,13 @@ var Q,
7151
7165
  'wan-2-5-image',
7152
7166
  'doppel',
7153
7167
  ]),
7154
- (ye =
7168
+ (he =
7155
7169
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
7156
7170
  });
7157
- function Z(e) {
7171
+ function Q(e) {
7158
7172
  return `$${Number(e.toFixed(5))}`;
7159
7173
  }
7160
- function Ma(e) {
7174
+ function Ea(e) {
7161
7175
  if (e.kind === 'llm') {
7162
7176
  let t = e.defaultEndpoint,
7163
7177
  i = (s) =>
@@ -7170,19 +7184,19 @@ function Ma(e) {
7170
7184
  a = i('input'),
7171
7185
  n = i('output');
7172
7186
  return a && n
7173
- ? `${Z(a.price.starter)}/M in \xB7 ${Z(n.price.starter)}/M out`
7174
- : `from ${Z(me(e).price.starter)}/M tokens`;
7187
+ ? `${Q(a.price.starter)}/M in \xB7 ${Q(n.price.starter)}/M out`
7188
+ : `from ${Q(ue(e).price.starter)}/M tokens`;
7175
7189
  }
7176
- return `from ${Z(me(e).price.starter)}${e.unit}`;
7190
+ return `from ${Q(ue(e).price.starter)}${e.unit}`;
7177
7191
  }
7178
- function Ka(e, t) {
7192
+ function Ca(e, t) {
7179
7193
  let i = t.filter((a) => Number.isFinite(a) && a > 0);
7180
- return i.length ? `from ${Z(Math.min(...i))}${e}` : null;
7194
+ return i.length ? `from ${Q(Math.min(...i))}${e}` : null;
7181
7195
  }
7182
- function ii(e) {
7196
+ function ni(e) {
7183
7197
  for (let t of J) {
7184
- let i = ke[t],
7185
- a = i ? Ka(i.unit, e[t] ?? []) : null;
7198
+ let i = be[t],
7199
+ a = i ? Ca(i.unit, e[t] ?? []) : null;
7186
7200
  i && a && (i.priceFormatted = a);
7187
7201
  }
7188
7202
  }
@@ -7193,18 +7207,18 @@ function A(e, t) {
7193
7207
  return {
7194
7208
  name: 'resolution',
7195
7209
  type: 'select',
7196
- default: me(e).resolution ?? i[0],
7210
+ default: ue(e).resolution ?? i[0],
7197
7211
  options: i,
7198
7212
  ...(t ? { description: t } : {}),
7199
7213
  };
7200
7214
  }
7201
- function ai(e) {
7215
+ function si(e) {
7202
7216
  if (!e.endpoints?.length) return null;
7203
7217
  let t = e.endpoints.filter((i) => $t(e.slug, i.id));
7204
7218
  return {
7205
7219
  name: 'endpoint',
7206
7220
  type: 'select',
7207
- default: Re(e),
7221
+ default: qe(e),
7208
7222
  options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
7209
7223
  description:
7210
7224
  (e.slug === 'gemini-3.1-pro-preview'
@@ -7213,20 +7227,20 @@ function ai(e) {
7213
7227
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
7214
7228
  };
7215
7229
  }
7216
- function Ca(e, t) {
7230
+ function Aa(e, t) {
7217
7231
  if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
7218
- let i = Q.includes(e.api.model);
7219
- return [...t.filter((a) => !be.has(a.name)), i ? We : Sa];
7232
+ let i = X.includes(e.api.model);
7233
+ return [...t.filter((a) => !ye.has(a.name)), i ? Ye : $a];
7220
7234
  }
7221
- function je(e, t) {
7222
- let i = e.filter((n) => !be.has(n.name)),
7223
- a = [We, ri];
7224
- return (a.push(Ye, Xe), [...i, ...a]);
7235
+ function Ge(e, t) {
7236
+ let i = e.filter((n) => !ye.has(n.name)),
7237
+ a = [Ye, oi];
7238
+ return (a.push(Xe, Qe), [...i, ...a]);
7225
7239
  }
7226
- function Oa(e) {
7240
+ function La(e) {
7227
7241
  return [
7228
7242
  ...e
7229
- .filter((t) => !Ea.has(t.name) && !be.has(t.name))
7243
+ .filter((t) => !qa.has(t.name) && !ye.has(t.name))
7230
7244
  .map((t) => {
7231
7245
  if (t.name === 'resolution')
7232
7246
  return {
@@ -7238,30 +7252,30 @@ function Oa(e) {
7238
7252
  ),
7239
7253
  }
7240
7254
  : {}),
7241
- description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${ee}`,
7255
+ description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Z}`,
7242
7256
  };
7243
- let i = Aa[t.name];
7257
+ let i = Ra[t.name];
7244
7258
  return i && typeof t.description == 'string'
7245
7259
  ? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
7246
7260
  : t;
7247
7261
  }),
7248
- We,
7249
- ri,
7250
7262
  Ye,
7263
+ oi,
7251
7264
  Xe,
7265
+ Qe,
7252
7266
  ];
7253
7267
  }
7254
- function ni(e) {
7268
+ function li(e) {
7255
7269
  return (
7256
7270
  e.startsWith('seedance-2-5-') &&
7257
7271
  e !== 'seedance-2-5-lite' &&
7258
7272
  !/-(creative-mode|unfiltered|uncensored)$/.test(e)
7259
7273
  );
7260
7274
  }
7261
- function Qt(e, t = {}) {
7275
+ function ti(e, t = {}) {
7262
7276
  return [
7263
7277
  ...e
7264
- .filter((i) => !$a.has(i.name) && !be.has(i.name))
7278
+ .filter((i) => !Oa.has(i.name) && !ye.has(i.name))
7265
7279
  .map((i) =>
7266
7280
  i.name === 'prompt'
7267
7281
  ? { ...i, required: !0 }
@@ -7271,7 +7285,7 @@ function Qt(e, t = {}) {
7271
7285
  ...(t.no4k && i.options
7272
7286
  ? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
7273
7287
  : {}),
7274
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ee}`,
7288
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Z}`,
7275
7289
  }
7276
7290
  : i,
7277
7291
  ),
@@ -7282,13 +7296,13 @@ function Qt(e, t = {}) {
7282
7296
  options: ['standard'],
7283
7297
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
7284
7298
  },
7285
- Ye,
7286
7299
  Xe,
7300
+ Qe,
7287
7301
  ];
7288
7302
  }
7289
- function Ge(e, t) {
7303
+ function He(e, t) {
7290
7304
  return [
7291
- C('Text prompt describing the video.'),
7305
+ E('Text prompt describing the video.'),
7292
7306
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
7293
7307
  {
7294
7308
  name: 'duration',
@@ -7315,10 +7329,10 @@ function Ge(e, t) {
7315
7329
  ),
7316
7330
  ];
7317
7331
  }
7318
- function qa(e) {
7319
- let t = ai(e);
7332
+ function Da(e) {
7333
+ let t = si(e);
7320
7334
  return [
7321
- C('Image prompt text. Supports complex composition and text instructions.'),
7335
+ E('Image prompt text. Supports complex composition and text instructions.'),
7322
7336
  ...(t ? [t] : []),
7323
7337
  {
7324
7338
  name: 'quality',
@@ -7329,14 +7343,14 @@ function qa(e) {
7329
7343
  A(
7330
7344
  e,
7331
7345
  e.slug === 'gpt-image-2'
7332
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${bt}`
7346
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${kt}`
7333
7347
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
7334
7348
  ),
7335
7349
  {
7336
7350
  name: 'aspect_ratio',
7337
7351
  type: 'select',
7338
7352
  default: 'auto',
7339
- options: [...yt],
7353
+ options: [...bt],
7340
7354
  description:
7341
7355
  "The frame. auto: an edit keeps its first input image's ratio (the nearest listed one), text to image is 1:1. The image is delivered at exactly the size for the ratio and resolution.",
7342
7356
  },
@@ -7383,15 +7397,15 @@ function qa(e) {
7383
7397
  },
7384
7398
  ];
7385
7399
  }
7386
- function Ra(e) {
7400
+ function Na(e) {
7387
7401
  return [
7388
- C('Image prompt text.'),
7402
+ E('Image prompt text.'),
7389
7403
  {
7390
7404
  name: 'input_images',
7391
7405
  type: 'string[]',
7392
7406
  description: 'Images to edit or use as reference (up to 14).',
7393
7407
  },
7394
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...At(e.slug)] },
7408
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Ot(e.slug)] },
7395
7409
  A(e),
7396
7410
  {
7397
7411
  name: 'n',
@@ -7417,10 +7431,10 @@ function Ra(e) {
7417
7431
  },
7418
7432
  ];
7419
7433
  }
7420
- function Na() {
7421
- let e = qt,
7434
+ function Ba() {
7435
+ let e = Rt,
7422
7436
  t = [];
7423
- for (let i of Qe(!0))
7437
+ for (let i of Ze(!0))
7424
7438
  e.includes(i.name) &&
7425
7439
  (t.push({
7426
7440
  ...i,
@@ -7442,14 +7456,14 @@ function Na() {
7442
7456
  }));
7443
7457
  return t;
7444
7458
  }
7445
- function Ua() {
7446
- return Qe(!0).map((e) =>
7459
+ function ja() {
7460
+ return Ze(!0).map((e) =>
7447
7461
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
7448
7462
  );
7449
7463
  }
7450
- function Qe(e) {
7464
+ function Ze(e) {
7451
7465
  return [
7452
- C('The user message or task.'),
7466
+ E('The user message or task.'),
7453
7467
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
7454
7468
  {
7455
7469
  name: 'messages',
@@ -7542,21 +7556,21 @@ function Qe(e) {
7542
7556
  },
7543
7557
  ];
7544
7558
  }
7545
- function Fa(e) {
7546
- if (e.slug === 'seed-2-1-turbo') return Da;
7547
- let t = ai(e);
7559
+ function Ga(e) {
7560
+ if (e.slug === 'seed-2-1-turbo') return Ua;
7561
+ let t = si(e);
7548
7562
  return [
7549
7563
  ...(e.slug === 'gemini-3.1-pro-preview'
7550
- ? Na()
7564
+ ? Ba()
7551
7565
  : e.slug === 'gemini-3.7-flash'
7552
- ? Ua()
7553
- : e.slug === 'gpt-6-astra' || Va.includes(e.slug)
7554
- ? Qe(e.slug !== 'gpt-6-astra')
7555
- : La),
7566
+ ? ja()
7567
+ : e.slug === 'gpt-6-astra' || Fa.includes(e.slug)
7568
+ ? Ze(e.slug !== 'gpt-6-astra')
7569
+ : Va),
7556
7570
  ...(t ? [t] : []),
7557
7571
  ];
7558
7572
  }
7559
- function He() {
7573
+ function ze() {
7560
7574
  return {
7561
7575
  name: 'image',
7562
7576
  type: 'string',
@@ -7564,7 +7578,7 @@ function He() {
7564
7578
  description: 'The photo to fix: one JPEG or PNG URL.',
7565
7579
  };
7566
7580
  }
7567
- function ja(e) {
7581
+ function za(e) {
7568
7582
  return [
7569
7583
  {
7570
7584
  name: 'video_url',
@@ -7586,7 +7600,7 @@ function ja(e) {
7586
7600
  },
7587
7601
  ];
7588
7602
  }
7589
- function Ga() {
7603
+ function Ja() {
7590
7604
  return [
7591
7605
  {
7592
7606
  name: 'mode',
@@ -7657,33 +7671,33 @@ function Ga() {
7657
7671
  },
7658
7672
  ];
7659
7673
  }
7660
- function Ha(e) {
7674
+ function Wa(e) {
7661
7675
  let t = e.slug;
7662
- if (e.family === 'tein-labs' && e.kind === 'image') return Ga();
7663
- if (pe.some((a) => a.slug === t)) return ja(e);
7664
- if (e.kind === 'llm') return Fa(e);
7665
- if (e.editVariants?.length) return qa(e);
7666
- let i = ge(t);
7667
- if (i) return zt(i);
7668
- if (ni(t)) return Oa(ze);
7676
+ if (e.family === 'tein-labs' && e.kind === 'image') return Ja();
7677
+ if (de.some((a) => a.slug === t)) return za(e);
7678
+ if (e.kind === 'llm') return Ga(e);
7679
+ if (e.editVariants?.length) return Da(e);
7680
+ let i = fe(t);
7681
+ if (i) return Jt(i);
7682
+ if (li(t)) return La(Je);
7669
7683
  switch (t) {
7670
7684
  case 'seedance-2-5':
7671
- return je(ze, t);
7685
+ return Ge(Je, t);
7672
7686
  case 'seedance-2-5-lite':
7673
- return Qt(ze, { no4k: !0 });
7687
+ return ti(Je, { no4k: !0 });
7674
7688
  case 'seedance-2':
7675
- return je(Zt, t);
7689
+ return Ge(ii, t);
7676
7690
  case 'seedance-2-lite':
7677
- return Qt(Zt);
7691
+ return ti(ii);
7678
7692
  case 'seedance-2-mini':
7679
- return je(za, t);
7693
+ return Ge(Ya, t);
7680
7694
  case 'nano-banana-2':
7681
7695
  case 'nano-banana-2.1':
7682
7696
  case 'nano-banana-pro':
7683
- return Ra(e);
7697
+ return Na(e);
7684
7698
  case 'seedream-5-pro':
7685
7699
  return [
7686
- C('Detailed description of the image to generate.'),
7700
+ E('Detailed description of the image to generate.'),
7687
7701
  { name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
7688
7702
  A(e),
7689
7703
  {
@@ -7697,7 +7711,7 @@ function Ha(e) {
7697
7711
  case 'minimax-h3-image':
7698
7712
  case 'minimax-h3-image-highspeed':
7699
7713
  return [
7700
- C('What to make, or how to change the reference images.'),
7714
+ E('What to make, or how to change the reference images.'),
7701
7715
  {
7702
7716
  name: 'images',
7703
7717
  type: 'string[]',
@@ -7743,7 +7757,7 @@ function Ha(e) {
7743
7757
  description:
7744
7758
  'text_to_image, image_to_image (up to 10 reference images) or layer_decomposition (split one image into a base image and editable transparent layers).',
7745
7759
  },
7746
- C(
7760
+ E(
7747
7761
  'What to make or change. Optional for layer_decomposition, where it can say how to split the image (for example "keep the logo as one layer").',
7748
7762
  ),
7749
7763
  {
@@ -7792,7 +7806,7 @@ function Ha(e) {
7792
7806
  case 'qwen-3':
7793
7807
  case 'qwen-3-pro':
7794
7808
  return [
7795
- C('Image prompt text; dense layouts and multilingual text work well.'),
7809
+ E('Image prompt text; dense layouts and multilingual text work well.'),
7796
7810
  {
7797
7811
  name: 'images',
7798
7812
  type: 'string[]',
@@ -7816,7 +7830,7 @@ function Ha(e) {
7816
7830
  ];
7817
7831
  case 'z-image-pro':
7818
7832
  return [
7819
- C('Image prompt text: subject, scene, style, composition and lighting.'),
7833
+ E('Image prompt text: subject, scene, style, composition and lighting.'),
7820
7834
  A(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
7821
7835
  {
7822
7836
  name: 'aspect_ratio',
@@ -7848,7 +7862,7 @@ function Ha(e) {
7848
7862
  ];
7849
7863
  case 'wan-2-5-image':
7850
7864
  return [
7851
- C('Image prompt, or for an edit the change to make (up to 2000 characters).'),
7865
+ E('Image prompt, or for an edit the change to make (up to 2000 characters).'),
7852
7866
  {
7853
7867
  name: 'images',
7854
7868
  type: 'string[]',
@@ -7914,7 +7928,7 @@ function Ha(e) {
7914
7928
  ];
7915
7929
  case 'enhancor-skin-fix-v1':
7916
7930
  return [
7917
- He(),
7931
+ ze(),
7918
7932
  {
7919
7933
  name: 'mode',
7920
7934
  type: 'select',
@@ -7947,11 +7961,11 @@ function Ha(e) {
7947
7961
  max: 0.4,
7948
7962
  description: 'Portrait depth. Heavy only.',
7949
7963
  },
7950
- ...Ba,
7964
+ ...Ha,
7951
7965
  ];
7952
7966
  case 'enhancor-skin-fix-v3':
7953
7967
  return [
7954
- He(),
7968
+ ze(),
7955
7969
  {
7956
7970
  name: 'mask_image',
7957
7971
  type: 'string',
@@ -7991,7 +8005,7 @@ function Ha(e) {
7991
8005
  ];
7992
8006
  case 'enhancor-skin-fix-v4':
7993
8007
  return [
7994
- He(),
8008
+ ze(),
7995
8009
  {
7996
8010
  name: 'mode',
7997
8011
  type: 'select',
@@ -8022,7 +8036,7 @@ function Ha(e) {
8022
8036
  ];
8023
8037
  case 'wan-3-0':
8024
8038
  case 'wan-3-0-prime':
8025
- return Ge(e, {
8039
+ return He(e, {
8026
8040
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8027
8041
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
8028
8042
  minSec: 2,
@@ -8032,7 +8046,7 @@ function Ha(e) {
8032
8046
  });
8033
8047
  case 'happy-horse-1-1':
8034
8048
  case 'happy-horse-1-0':
8035
- return Ge(e, {
8049
+ return He(e, {
8036
8050
  modes:
8037
8051
  t === 'happy-horse-1-0'
8038
8052
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -8044,7 +8058,7 @@ function Ha(e) {
8044
8058
  });
8045
8059
  case 'gemini-omni-1.2-flash':
8046
8060
  return [
8047
- C(
8061
+ E(
8048
8062
  'Describe the video and its sound (dialogue, effects, music), or for video_edit / video_extend the change or what happens next (up to 20000 characters).',
8049
8063
  ),
8050
8064
  {
@@ -8103,7 +8117,7 @@ function Ha(e) {
8103
8117
  },
8104
8118
  ];
8105
8119
  case 'minimax-h3':
8106
- return Ge(e, {
8120
+ return He(e, {
8107
8121
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8108
8122
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
8109
8123
  minSec: 4,
@@ -8111,10 +8125,10 @@ function Ha(e) {
8111
8125
  references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
8112
8126
  });
8113
8127
  default:
8114
- return [C('Prompt text.')];
8128
+ return [E('Prompt text.')];
8115
8129
  }
8116
8130
  }
8117
- function Ja() {
8131
+ function Xa() {
8118
8132
  let e = (t, i) => ({
8119
8133
  name: t,
8120
8134
  type: 'slider',
@@ -8125,30 +8139,28 @@ function Ja() {
8125
8139
  description: `${i} 0 to 100. 50 is the default look.`,
8126
8140
  });
8127
8141
  return [
8128
- e('skin_strength', 'Strength: how much the skin is repainted. Only with skin_fix on.'),
8129
- e('skin_texture', 'Texture: how much fine pore detail is added. Only with skin_fix on.'),
8130
8142
  e(
8131
8143
  'grain',
8132
- 'Grain: fine noise over the photo. Works in Fast and Full, with or without skin_fix.',
8144
+ 'Grain: fine noise over the photo. Works in Fast and Full, with or without a preset.',
8133
8145
  ),
8134
8146
  e(
8135
8147
  'sharpness',
8136
- 'Sharpness: how crisp the edges are. Works in Fast and Full, with or without skin_fix.',
8148
+ 'Sharpness: how crisp the edges are. Works in Fast and Full, with or without a preset.',
8137
8149
  ),
8138
8150
  ];
8139
8151
  }
8140
- function Wa() {
8152
+ function Qa() {
8141
8153
  return {
8142
- slug: he,
8143
- name: Wt,
8154
+ slug: ge,
8155
+ name: Yt,
8144
8156
  category: 'Image',
8145
8157
  kind: 'Image-to-Image',
8146
8158
  vendor: 'Enhancor',
8147
8159
  description:
8148
- 'Upscales a photo, with an optional skin fix. Full makes the photo its size times the scale; Fast makes a fixed size (long side 2432 px).',
8160
+ 'Upscales a photo, with an optional skin preset that gives AI or smooth skin real texture first (Natural, Pores, Freckles, More freckles, Blemish, Glow, Unblur). Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px).',
8149
8161
  priceFormatted: '',
8150
8162
  unit: '/img',
8151
- primaryToolName: ti.image,
8163
+ primaryToolName: ri.image,
8152
8164
  parameters: [
8153
8165
  {
8154
8166
  name: 'image',
@@ -8157,11 +8169,17 @@ function Wa() {
8157
8169
  description:
8158
8170
  "The photo to upscale: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.",
8159
8171
  },
8172
+ {
8173
+ name: 'preset',
8174
+ type: 'select',
8175
+ options: [...Be],
8176
+ description: `Skin preset, run before the upscale: ${Be.map((e) => `${e} (${Zt[e]})`).join(', ')}. Seedream 5.5 redraws the skin in the photo's own shape (about 4.2 MP, Unblur about 1 MP), keeping the person, the background and any text, then that picture is upscaled. Leave it out for a plain upscale.`,
8177
+ },
8160
8178
  {
8161
8179
  name: 'skin_fix',
8162
8180
  type: 'boolean',
8163
8181
  default: !1,
8164
- description: 'Also fixes the skin. Off by default.',
8182
+ description: 'Same as preset natural. Off by default.',
8165
8183
  },
8166
8184
  {
8167
8185
  name: 'mode',
@@ -8174,194 +8192,195 @@ function Wa() {
8174
8192
  {
8175
8193
  name: 'scale',
8176
8194
  type: 'select',
8177
- default: String(Yt),
8178
- options: X.noSkin.map(String),
8179
- description: `Full only. ${X.skin.join(', ')} with skin_fix on; also ${X.noSkin.filter((e) => !X.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
8195
+ default: String(Xt),
8196
+ options: Fe.noSkin.map(String),
8197
+ description: `Full only: ${Fe.noSkin.join(', ')}. The output is at most 48 megapixels, so with a preset (a picture of about 4.2 MP) up to 3; Unblur up to 4.`,
8180
8198
  },
8181
- ...Ja(),
8199
+ ...Xa(),
8182
8200
  ],
8183
8201
  };
8184
8202
  }
8185
- function Je(e, t = e.api.model) {
8203
+ function We(e, t = e.api.model) {
8186
8204
  return {
8187
8205
  slug: t,
8188
8206
  name: e.name,
8189
- category: va[e.kind],
8190
- kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Ta[e.kind],
8207
+ category: Ka[e.kind],
8208
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Sa[e.kind],
8191
8209
  vendor: e.vendor ?? '',
8192
8210
  description: e.desc ?? e.name,
8193
- priceFormatted: Ma(e),
8211
+ priceFormatted: Ea(e),
8194
8212
  unit: e.unit,
8195
- primaryToolName: ti[e.kind],
8196
- parameters: Ca(e, Ha(e)),
8213
+ primaryToolName: ri[e.kind],
8214
+ parameters: Aa(e, Wa(e)),
8197
8215
  };
8198
8216
  }
8199
- function Ya() {
8217
+ function Za() {
8200
8218
  let e = {};
8201
- for (let t of ue())
8219
+ for (let t of ce())
8202
8220
  if (t.slug !== 'seedance-2-fast') {
8203
8221
  if (t.slug === 'seedance-2-mini') {
8204
- e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
8222
+ e['seedance-2-mini'] = We(t, 'seedance-2-mini');
8205
8223
  continue;
8206
8224
  }
8207
8225
  if (t.slug === 'seedance-2') {
8208
- let i = Je(t);
8226
+ let i = We(t);
8209
8227
  ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
8210
8228
  (e['seedance-2'] = i));
8211
8229
  continue;
8212
8230
  }
8213
- t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
8231
+ t.slug.startsWith('claude-') || (e[t.api.model] = We(t));
8214
8232
  }
8215
- (Object.assign(e, Nt()), (e[he] = Wa()));
8216
- for (let [t, i] of Object.entries(fe))
8233
+ (Object.assign(e, Ut()), (e[ge] = Qa()));
8234
+ for (let [t, i] of Object.entries(me))
8217
8235
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
8218
8236
  return e;
8219
8237
  }
8220
- function we(e) {
8238
+ function ke(e) {
8221
8239
  return !!e?.parameters.some((t) => t.name === 'image');
8222
8240
  }
8223
8241
  function H(e) {
8224
- return ke[e] ?? null;
8242
+ return be[e] ?? null;
8225
8243
  }
8226
- function Xa(e, t, i) {
8244
+ function er(e, t, i) {
8227
8245
  if (
8228
8246
  e.startsWith('enhancor-skin-fix-') ||
8229
- e === he ||
8247
+ e === ge ||
8230
8248
  (e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
8231
8249
  )
8232
8250
  return !1;
8233
- if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ni(e)) && t === 'duration') {
8251
+ if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || li(e)) && t === 'duration') {
8234
8252
  let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
8235
8253
  if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
8236
8254
  }
8237
8255
  if (
8238
- (t === 'max_tokens' && ei(i.max_completion_tokens)) ||
8239
- (t === 'max_completion_tokens' && ei(i.max_tokens))
8256
+ (t === 'max_tokens' && ai(i.max_completion_tokens)) ||
8257
+ (t === 'max_completion_tokens' && ai(i.max_tokens))
8240
8258
  )
8241
8259
  return !1;
8242
8260
  if (t === 'aspect_ratio') {
8243
- let n = ge(e);
8261
+ let n = fe(e);
8244
8262
  if (n) {
8245
8263
  let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8246
8264
  o = s ? s.replace(/-/g, '_') : n.modes[0];
8247
- if (n.modes.includes(o) && !Gt(n, o)) return !1;
8265
+ if (n.modes.includes(o) && !Ht(n, o)) return !1;
8248
8266
  }
8249
8267
  }
8250
- let a = ge(e);
8268
+ let a = fe(e);
8251
8269
  if (a) {
8252
8270
  let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8253
8271
  s = n ? n.replace(/-/g, '_') : a.modes[0];
8254
- if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
8272
+ if (a.modes.includes(s) && !zt(a, s, t)) return !1;
8255
8273
  }
8256
8274
  return !0;
8257
8275
  }
8258
- function ei(e) {
8276
+ function ai(e) {
8259
8277
  return e != null && e !== '';
8260
8278
  }
8261
- function li(e, t) {
8279
+ function ci(e, t) {
8262
8280
  let i = { ...t };
8263
8281
  if (e?.slug === 'seedance-2-5') {
8264
8282
  let a = (n) => typeof n != 'string' || !n.trim();
8265
- for (let n of Qa) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
8283
+ for (let n of tr) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
8266
8284
  if (!a(i.finalize)) return i;
8267
8285
  }
8268
8286
  for (let a of e?.parameters ?? [])
8269
8287
  a.default !== void 0 &&
8270
8288
  i[a.name] === void 0 &&
8271
- Xa(e.slug, a.name, t) &&
8289
+ er(e.slug, a.name, t) &&
8272
8290
  (i[a.name] = a.default);
8273
8291
  return i;
8274
8292
  }
8275
8293
  function D() {
8276
- return Object.values(ke);
8294
+ return Object.values(be);
8277
8295
  }
8278
- var va,
8279
- ti,
8280
- Ta,
8281
- C,
8282
- We,
8283
- Sa,
8296
+ var Ka,
8284
8297
  ri,
8298
+ Sa,
8299
+ E,
8285
8300
  Ye,
8286
- Xe,
8287
- be,
8288
8301
  $a,
8289
- Ea,
8290
- Aa,
8291
- La,
8292
- Da,
8293
- Va,
8294
- Ba,
8295
- ee,
8296
- ze,
8297
- si,
8298
8302
  oi,
8299
- Zt,
8300
- za,
8301
- ke,
8302
- Qa,
8303
- te = h(() => {
8303
+ Xe,
8304
+ Qe,
8305
+ ye,
8306
+ Oa,
8307
+ qa,
8308
+ Ra,
8309
+ Va,
8310
+ Ua,
8311
+ Fa,
8312
+ Ha,
8313
+ Z,
8314
+ Je,
8315
+ di,
8316
+ pi,
8317
+ ii,
8318
+ Ya,
8319
+ be,
8320
+ tr,
8321
+ ee = h(() => {
8304
8322
  'use strict';
8305
- kt();
8306
- Ce();
8323
+ wt();
8324
+ Se();
8307
8325
  G();
8326
+ Re();
8327
+ Ee();
8308
8328
  Le();
8309
- $e();
8310
- De();
8311
- Et();
8312
- Ot();
8313
- Rt();
8314
- Ut();
8315
- Fe();
8316
- Jt();
8317
- Xt();
8318
- Be();
8319
- ((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8320
- (ti = {
8329
+ At();
8330
+ qt();
8331
+ Lt();
8332
+ Ft();
8333
+ Ue();
8334
+ Wt();
8335
+ Qt();
8336
+ ei();
8337
+ je();
8338
+ ((Ka = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8339
+ (ri = {
8321
8340
  video: 'generate_video',
8322
8341
  image: 'generate_image',
8323
8342
  audio: 'generate_audio',
8324
8343
  llm: 'run_task',
8325
8344
  }),
8326
- (Ta = {
8345
+ (Sa = {
8327
8346
  video: 'Text-to-Video',
8328
8347
  image: 'Text-to-Image',
8329
8348
  audio: 'Text-to-Audio',
8330
8349
  llm: 'Reasoning (LLM)',
8331
8350
  }));
8332
- C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8333
- ((We = {
8351
+ E = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8352
+ ((Ye = {
8334
8353
  name: 'creative_mode',
8335
8354
  type: 'boolean',
8336
8355
  default: !1,
8337
8356
  description:
8338
8357
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
8339
8358
  }),
8340
- (Sa = {
8359
+ ($a = {
8341
8360
  name: 'creative_mode',
8342
8361
  type: 'boolean',
8343
8362
  default: !1,
8344
- description: `Not available yet on this model: ${ye}.`,
8363
+ description: `Not available yet on this model: ${he}.`,
8345
8364
  }),
8346
- (ri = {
8365
+ (oi = {
8347
8366
  name: 'priority',
8348
8367
  type: 'boolean',
8349
8368
  default: !1,
8350
8369
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
8351
8370
  }),
8352
- (Ye = {
8371
+ (Xe = {
8353
8372
  name: 'reference_roles',
8354
8373
  type: 'json',
8355
8374
  description: `Omni Reference only. Role of each reference, by tag { "@Image1": "prop" } or by kind { "image": ["prop"] }. Image: appearance, clothing, prop, scene_layout, lighting, first_frame, last_frame; Seedance 2.5 also keyframe, storyboard. Video: motion, camera, style; Seedance 2.5 also blockout_coarse, blockout_fine. Audio: voice, ambience, music, sound_effect. On a tag, the value image, video or audio uses that kind's default (appearance, motion, voice).`,
8356
8375
  }),
8357
- (Xe = {
8376
+ (Qe = {
8358
8377
  name: 'auto_fit_images',
8359
8378
  type: 'boolean',
8360
8379
  description:
8361
8380
  'Fits a reference image whose aspect ratio (width / height) is outside 0.40-2.50 just inside it: a slight stretch, or the image on a blurred copy of itself, never cropped. Off: such an image is refused with a 422. First and last frames are never changed. Same price.',
8362
8381
  }),
8363
- (be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8364
- (($a = new Set([
8382
+ (ye = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8383
+ ((Oa = new Set([
8365
8384
  'quality',
8366
8385
  'bitrate_mode',
8367
8386
  'draft',
@@ -8370,7 +8389,7 @@ var va,
8370
8389
  'draft_generation_id',
8371
8390
  'pass_faces',
8372
8391
  ])),
8373
- (Ea = new Set([
8392
+ (qa = new Set([
8374
8393
  'quality',
8375
8394
  'bitrate_mode',
8376
8395
  'draft',
@@ -8378,13 +8397,13 @@ var va,
8378
8397
  'draft_task_id',
8379
8398
  'draft_generation_id',
8380
8399
  ])),
8381
- (Aa = {
8400
+ (Ra = {
8382
8401
  images: 'up to 10',
8383
8402
  videos: 'up to 5; combined duration < 30s',
8384
8403
  audios: 'up to 5; combined duration < 30s',
8385
8404
  }));
8386
- ((La = [
8387
- C('The user message or task.'),
8405
+ ((Va = [
8406
+ E('The user message or task.'),
8388
8407
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8389
8408
  {
8390
8409
  name: 'messages',
@@ -8401,8 +8420,8 @@ var va,
8401
8420
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
8402
8421
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
8403
8422
  ]),
8404
- (Da = [
8405
- C('The user message or task.'),
8423
+ (Ua = [
8424
+ E('The user message or task.'),
8406
8425
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8407
8426
  {
8408
8427
  name: 'messages',
@@ -8483,8 +8502,8 @@ var va,
8483
8502
  description: 'Video frames read a second.',
8484
8503
  },
8485
8504
  ]),
8486
- (Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8487
- Ba = Object.entries({
8505
+ (Fa = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8506
+ Ha = Object.entries({
8488
8507
  background: !1,
8489
8508
  skin: !1,
8490
8509
  nose: !1,
@@ -8510,8 +8529,8 @@ var va,
8510
8529
  default: t,
8511
8530
  description: 'Keep this part out of the fix. Standard only.',
8512
8531
  }));
8513
- ((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8514
- (ze = [
8532
+ ((Z = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8533
+ (Je = [
8515
8534
  {
8516
8535
  name: 'prompt',
8517
8536
  type: 'string',
@@ -8549,7 +8568,7 @@ var va,
8549
8568
  type: 'select',
8550
8569
  default: '480p',
8551
8570
  options: ['480p', '720p', '1080p', '4k'],
8552
- description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${ee}`,
8571
+ description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${Z}`,
8553
8572
  },
8554
8573
  {
8555
8574
  name: 'aspect_ratio',
@@ -8660,19 +8679,19 @@ var va,
8660
8679
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8661
8680
  },
8662
8681
  ]),
8663
- (si = {
8682
+ (di = {
8664
8683
  name: 'images',
8665
8684
  type: 'string[]',
8666
8685
  description:
8667
8686
  'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
8668
8687
  }),
8669
- (oi = {
8688
+ (pi = {
8670
8689
  name: 'audios',
8671
8690
  type: 'string[]',
8672
8691
  description:
8673
8692
  'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
8674
8693
  }),
8675
- (Zt = [
8694
+ (ii = [
8676
8695
  {
8677
8696
  name: 'prompt',
8678
8697
  type: 'string',
@@ -8716,7 +8735,7 @@ var va,
8716
8735
  type: 'select',
8717
8736
  default: '480p',
8718
8737
  options: ['480p', '720p', '1080p', '4k'],
8719
- description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ee}`,
8738
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Z}`,
8720
8739
  },
8721
8740
  {
8722
8741
  name: 'bitrate_mode',
@@ -8750,8 +8769,8 @@ var va,
8750
8769
  description:
8751
8770
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8752
8771
  },
8753
- si,
8754
- oi,
8772
+ di,
8773
+ pi,
8755
8774
  {
8756
8775
  name: 'first_frame_image',
8757
8776
  type: 'string',
@@ -8772,7 +8791,7 @@ var va,
8772
8791
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8773
8792
  },
8774
8793
  ]),
8775
- (za = [
8794
+ (Ya = [
8776
8795
  {
8777
8796
  name: 'prompt',
8778
8797
  type: 'string',
@@ -8793,7 +8812,7 @@ var va,
8793
8812
  type: 'select',
8794
8813
  default: '480p',
8795
8814
  options: ['480p', '720p'],
8796
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ee}`,
8815
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Z}`,
8797
8816
  },
8798
8817
  {
8799
8818
  name: 'bitrate_mode',
@@ -8827,8 +8846,8 @@ var va,
8827
8846
  description:
8828
8847
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8829
8848
  },
8830
- si,
8831
- oi,
8849
+ di,
8850
+ pi,
8832
8851
  {
8833
8852
  name: 'first_frame_image',
8834
8853
  type: 'string',
@@ -8843,53 +8862,53 @@ var va,
8843
8862
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8844
8863
  },
8845
8864
  ]));
8846
- ke = Ya();
8847
- Qa = ['draft_task_id', 'draft_generation_id'];
8865
+ be = Za();
8866
+ tr = ['draft_task_id', 'draft_generation_id'];
8848
8867
  });
8849
- function xe(e) {
8868
+ function we(e) {
8850
8869
  let t = '/v1/pricing/models',
8851
8870
  i = e?.trim();
8852
8871
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
8853
8872
  }
8854
- var tt = h(() => {
8873
+ var it = h(() => {
8855
8874
  'use strict';
8856
8875
  });
8857
- function Ti(e) {
8876
+ function Si(e) {
8858
8877
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
8859
8878
  }
8860
- function Mi(e) {
8861
- let t = ue().filter((s) => s.kind === e && s.unfiltered != null),
8862
- i = t.filter((s) => Q.includes(s.api.model)).map((s) => s.name),
8863
- a = t.filter((s) => !Q.includes(s.api.model)).map((s) => s.name);
8879
+ function Ei(e) {
8880
+ let t = ce().filter((s) => s.kind === e && s.unfiltered != null),
8881
+ i = t.filter((s) => X.includes(s.api.model)).map((s) => s.name),
8882
+ a = t.filter((s) => !X.includes(s.api.model)).map((s) => s.name);
8864
8883
  return [
8865
8884
  ...(i.length
8866
- ? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8885
+ ? [`${Si(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8867
8886
  : []),
8868
- ...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
8887
+ ...(a.length ? [`Not available yet on ${Si(a)}: ${he}.`] : []),
8869
8888
  'The Acceptable Use Policy applies.',
8870
8889
  ].join(' ');
8871
8890
  }
8872
- function Kr(e) {
8873
- if (Pr.has(e.name)) return e;
8891
+ function Cr(e) {
8892
+ if (Tr.has(e.name)) return e;
8874
8893
  let t = e.inputSchema.properties;
8875
8894
  return !t || t.callback_url
8876
8895
  ? e
8877
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
8896
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: vr } } };
8878
8897
  }
8879
- function Sr(e) {
8898
+ function $r(e) {
8880
8899
  let t = e.inputSchema.properties;
8881
8900
  if (!t) return e;
8882
8901
  let i = !1,
8883
8902
  a = {};
8884
8903
  for (let [n, s] of Object.entries(t))
8885
- Ki.has(n) && s.type === 'string' && !s.format
8904
+ Ci.has(n) && s.type === 'string' && !s.format
8886
8905
  ? ((a[n] = { ...s, format: 'uri' }), (i = !0))
8887
- : Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8906
+ : Ci.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8888
8907
  ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
8889
8908
  : (a[n] = s);
8890
8909
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
8891
8910
  }
8892
- function Cr(e) {
8911
+ function Ar(e) {
8893
8912
  switch (e.type) {
8894
8913
  case 'string':
8895
8914
  return {
@@ -8944,11 +8963,11 @@ function Cr(e) {
8944
8963
  return { type: 'string', description: e.description };
8945
8964
  }
8946
8965
  }
8947
- function $r(e, t) {
8966
+ function Or(e, t) {
8948
8967
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
8949
8968
  a = {},
8950
8969
  n = [];
8951
- for (let o of e.parameters) ((a[o.name] = Cr(o)), o.required && n.push(o.name));
8970
+ for (let o of e.parameters) ((a[o.name] = Ar(o)), o.required && n.push(o.name));
8952
8971
  let s = {
8953
8972
  type: 'object',
8954
8973
  properties: a,
@@ -8961,8 +8980,8 @@ function $r(e, t) {
8961
8980
  inputSchema: s,
8962
8981
  };
8963
8982
  }
8964
- function Er() {
8965
- let e = D().filter((p) => p.category === 'Image' && !we(p)),
8983
+ function qr() {
8984
+ let e = D().filter((p) => p.category === 'Image' && !ke(p)),
8966
8985
  t = D().filter((p) => p.category === 'Video'),
8967
8986
  i = D().filter((p) => p.category === 'Text'),
8968
8987
  a = D().filter((p) => p.category === 'Audio'),
@@ -9052,7 +9071,7 @@ function Er() {
9052
9071
  maximum: 2147483647,
9053
9072
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
9054
9073
  },
9055
- creative_mode: { type: 'boolean', description: Mi('image') },
9074
+ creative_mode: { type: 'boolean', description: Ei('image') },
9056
9075
  },
9057
9076
  required: ['prompt'],
9058
9077
  additionalProperties: !0,
@@ -9089,7 +9108,7 @@ function Er() {
9089
9108
  description:
9090
9109
  "Video resolution, where the model takes it (see each model tool). Left out: the model's own default, which that model's tool shows.",
9091
9110
  },
9092
- creative_mode: { type: 'boolean', description: Mi('video') },
9111
+ creative_mode: { type: 'boolean', description: Ei('video') },
9093
9112
  priority: {
9094
9113
  type: 'boolean',
9095
9114
  description:
@@ -9225,10 +9244,10 @@ function Er() {
9225
9244
  additionalProperties: !0,
9226
9245
  },
9227
9246
  },
9228
- d = Ar();
9229
- return [n, s, o, u, l, d, c, Ir, ...Si];
9247
+ d = Rr();
9248
+ return [n, s, o, u, l, d, c, Mr, ...$i];
9230
9249
  }
9231
- function Ar() {
9250
+ function Rr() {
9232
9251
  return {
9233
9252
  name: 'upload_asset',
9234
9253
  description:
@@ -9275,31 +9294,31 @@ function Ar() {
9275
9294
  },
9276
9295
  };
9277
9296
  }
9278
- function ot() {
9279
- let e = Er(),
9280
- t = D().map((i) => $r(i));
9281
- return [...e, ...t].map(Kr).map(Sr);
9297
+ function lt() {
9298
+ let e = qr(),
9299
+ t = D().map((i) => Or(i));
9300
+ return [...e, ...t].map(Cr).map($r);
9282
9301
  }
9283
- var _r,
9284
- Pr,
9285
- Ir,
9286
- vr,
9302
+ var vr,
9287
9303
  Tr,
9288
9304
  Mr,
9289
- Si,
9290
- Rs,
9291
- Ki,
9292
- Ci = h(() => {
9305
+ Kr,
9306
+ Sr,
9307
+ Er,
9308
+ $i,
9309
+ Us,
9310
+ Ci,
9311
+ Ai = h(() => {
9293
9312
  'use strict';
9294
9313
  G();
9295
- Be();
9296
- te();
9297
- ((_r = {
9314
+ je();
9315
+ ee();
9316
+ ((vr = {
9298
9317
  type: 'string',
9299
9318
  description:
9300
9319
  'Optional HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled. The body matches GET /v1/jobs/:id and is signed with X-Tein-Signature.',
9301
9320
  }),
9302
- (Pr = new Set([
9321
+ (Tr = new Set([
9303
9322
  'upload_asset',
9304
9323
  'upload_media',
9305
9324
  'upload_image',
@@ -9310,7 +9329,7 @@ var _r,
9310
9329
  'get_usage',
9311
9330
  'get_balance_history',
9312
9331
  ])),
9313
- (Ir = {
9332
+ (Mr = {
9314
9333
  name: 'get_pricing',
9315
9334
  description:
9316
9335
  'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
@@ -9325,13 +9344,13 @@ var _r,
9325
9344
  additionalProperties: !1,
9326
9345
  },
9327
9346
  }),
9328
- (vr = {
9347
+ (Kr = {
9329
9348
  name: 'get_balance',
9330
9349
  description:
9331
9350
  "Your Tein workspace's balance right now, what this API key can still spend (the balance, or less when the key has its own spending limit), credits on hold, and the workspace's usage this month and in the last 30 days from every channel (website, API, MCP, CLI, workflows). Use it before a run to check the balance covers it, or to show the balance in an app. Nothing runs and nothing is charged. The same payload as GET /v1/balance.",
9332
9351
  inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
9333
9352
  }),
9334
- (Tr = {
9353
+ (Sr = {
9335
9354
  name: 'get_usage',
9336
9355
  description:
9337
9356
  "Your Tein workspace's usage in detail, the same numbers as the dashboard's Usage page: total spend and requests (succeeded, failed, running), this API key's own share, and breakdowns by model, by channel (website, api, mcp, cli), by API key, and over time. Covers every run of the workspace, wherever it was started. Nothing runs and nothing is charged. The same payload as GET /v1/usage.",
@@ -9362,7 +9381,7 @@ var _r,
9362
9381
  additionalProperties: !1,
9363
9382
  },
9364
9383
  }),
9365
- (Mr = {
9384
+ (Er = {
9366
9385
  name: 'get_balance_history',
9367
9386
  description:
9368
9387
  "Your Tein balance's history, newest first, the same list as the Billing page: top ups, each run's charge (with its job_id and model), refunds, credits from Tein and adjustments, each with the balance after it. Nothing runs and nothing is charged. The same payload as GET /v1/balance/transactions.",
@@ -9380,9 +9399,9 @@ var _r,
9380
9399
  additionalProperties: !1,
9381
9400
  },
9382
9401
  }),
9383
- (Si = [vr, Tr, Mr]),
9384
- (Rs = new Set(Si.map((e) => e.name))));
9385
- Ki = new Set([
9402
+ ($i = [Kr, Sr, Er]),
9403
+ (Us = new Set($i.map((e) => e.name))));
9404
+ Ci = new Set([
9386
9405
  'image',
9387
9406
  'images',
9388
9407
  'image_url',
@@ -9399,19 +9418,19 @@ var _r,
9399
9418
  'lipsyncing_audio',
9400
9419
  ]);
9401
9420
  });
9402
- var Ni = {};
9403
- Ji(Ni, {
9404
- forgetToolSchemas: () => Dr,
9405
- jsonRpcAnswer: () => Oi,
9406
- preprocessLocalFiles: () => Di,
9407
- startStdioServer: () => Vi,
9421
+ var Bi = {};
9422
+ Xi(Bi, {
9423
+ forgetToolSchemas: () => Ur,
9424
+ jsonRpcAnswer: () => Li,
9425
+ preprocessLocalFiles: () => Ui,
9426
+ startStdioServer: () => Fi,
9408
9427
  });
9409
- function Or(e) {
9428
+ function Lr(e) {
9410
9429
  let t = (i) =>
9411
9430
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
9412
9431
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
9413
9432
  }
9414
- function Oi(e, t, i) {
9433
+ function Li(e, t, i) {
9415
9434
  let a = e?.id,
9416
9435
  n = a == null,
9417
9436
  s = null;
@@ -9420,7 +9439,7 @@ function Oi(e, t, i) {
9420
9439
  } catch {
9421
9440
  s = null;
9422
9441
  }
9423
- if (s !== null && Or(s)) return n ? null : s;
9442
+ if (s !== null && Lr(s)) return n ? null : s;
9424
9443
  if (n) return null;
9425
9444
  if (!i && t >= 200 && t < 300) return;
9426
9445
  let o = s?.error,
@@ -9441,16 +9460,16 @@ function Oi(e, t, i) {
9441
9460
  },
9442
9461
  };
9443
9462
  }
9444
- function qr() {
9463
+ function Dr() {
9445
9464
  let e = process.argv.slice(2),
9446
9465
  t = e.indexOf('--api-key');
9447
9466
  return S(t >= 0 ? e[t + 1] : void 0);
9448
9467
  }
9449
- async function qi(e, t, i) {
9468
+ async function Di(e, t, i) {
9450
9469
  let a = z.default.resolve(e);
9451
- if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
9470
+ if (!N.default.existsSync(a) || !N.default.statSync(a).isFile())
9452
9471
  throw new Error(`File not found: ${e}`);
9453
- let n = V.default.readFileSync(a),
9472
+ let n = N.default.readFileSync(a),
9454
9473
  s = n.toString('base64'),
9455
9474
  o = n.length,
9456
9475
  u = `${i.replace(/\/$/, '')}/v1/upload`,
@@ -9475,15 +9494,15 @@ async function qi(e, t, i) {
9475
9494
  mimeType: c.mime_type || c.mimeType || 'image/png',
9476
9495
  };
9477
9496
  }
9478
- function Ri(e) {
9479
- return Rr.has(z.default.extname(e).toLowerCase());
9497
+ function Ni(e) {
9498
+ return Nr.has(z.default.extname(e).toLowerCase());
9480
9499
  }
9481
- function Li(e) {
9500
+ function Vi(e) {
9482
9501
  return new Error(
9483
9502
  `Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
9484
9503
  );
9485
9504
  }
9486
- function Lr(e) {
9505
+ function Vr(e) {
9487
9506
  let t = e.trim();
9488
9507
  if (
9489
9508
  !t ||
@@ -9494,24 +9513,24 @@ function Lr(e) {
9494
9513
  )
9495
9514
  return null;
9496
9515
  let i = z.default.resolve(t);
9497
- return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
9516
+ return N.default.existsSync(i) && N.default.statSync(i).isFile() ? i : null;
9498
9517
  }
9499
- function dt(e) {
9518
+ function pt(e) {
9500
9519
  if (Array.isArray(e))
9501
9520
  for (let t of e) {
9502
9521
  let i = t;
9503
9522
  typeof i.name == 'string' &&
9504
9523
  i.inputSchema &&
9505
9524
  typeof i.inputSchema == 'object' &&
9506
- re.set(i.name, i.inputSchema);
9525
+ ae.set(i.name, i.inputSchema);
9507
9526
  }
9508
9527
  }
9509
- function Dr() {
9510
- (re.clear(), (lt = 0));
9528
+ function Ur() {
9529
+ (ae.clear(), (dt = 0));
9511
9530
  }
9512
- async function Vr(e, t) {
9513
- if (!(Date.now() - lt < 6e4)) {
9514
- lt = Date.now();
9531
+ async function Fr(e, t) {
9532
+ if (!(Date.now() - dt < 6e4)) {
9533
+ dt = Date.now();
9515
9534
  try {
9516
9535
  let a = await (
9517
9536
  await fetch(e, {
@@ -9521,39 +9540,39 @@ async function Vr(e, t) {
9521
9540
  signal: AbortSignal.timeout(1e4),
9522
9541
  })
9523
9542
  ).json();
9524
- dt(a.result?.tools);
9543
+ pt(a.result?.tools);
9525
9544
  } catch {}
9526
9545
  }
9527
9546
  }
9528
- function Nr(e) {
9547
+ function Br(e) {
9529
9548
  return e
9530
9549
  ? e.type === 'string'
9531
9550
  ? e.format === 'uri'
9532
9551
  : e.type === 'array' && e.items?.format === 'uri'
9533
9552
  : !1;
9534
9553
  }
9535
- async function $i(e, t, i) {
9554
+ async function Oi(e, t, i) {
9536
9555
  if (typeof e != 'string') return e;
9537
- let a = Lr(e);
9556
+ let a = Vr(e);
9538
9557
  if (!a) return e;
9539
- if (!Ri(a)) throw Li(a);
9540
- return (await qi(a, t, i)).url;
9558
+ if (!Ni(a)) throw Vi(a);
9559
+ return (await Di(a, t, i)).url;
9541
9560
  }
9542
- async function Di(e, t, i, a, n) {
9543
- (re.size === 0 && dt(ot()), re.has(e) || (await Vr(n, i)));
9544
- let s = re.get(e)?.properties;
9561
+ async function Ui(e, t, i, a, n) {
9562
+ (ae.size === 0 && pt(lt()), ae.has(e) || (await Fr(n, i)));
9563
+ let s = ae.get(e)?.properties;
9545
9564
  if (!s) return t;
9546
9565
  let o = { ...t };
9547
9566
  for (let [u, l] of Object.entries(t))
9548
- if (Nr(s[u]))
9567
+ if (Br(s[u]))
9549
9568
  if (Array.isArray(l)) {
9550
9569
  let c = [];
9551
- for (let d of l) c.push(await $i(d, i, a));
9570
+ for (let d of l) c.push(await Oi(d, i, a));
9552
9571
  o[u] = c;
9553
- } else o[u] = await $i(l, i, a);
9572
+ } else o[u] = await Oi(l, i, a);
9554
9573
  return o;
9555
9574
  }
9556
- function Ur(e) {
9575
+ function jr(e) {
9557
9576
  let t = e.id ?? null;
9558
9577
  switch (e.method) {
9559
9578
  case 'initialize':
@@ -9571,7 +9590,7 @@ function Ur(e) {
9571
9590
  case 'ping':
9572
9591
  return { jsonrpc: '2.0', id: t, result: {} };
9573
9592
  case 'tools/list':
9574
- return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
9593
+ return { jsonrpc: '2.0', id: t, result: { tools: lt() } };
9575
9594
  case 'tools/call':
9576
9595
  return {
9577
9596
  jsonrpc: '2.0',
@@ -9594,13 +9613,13 @@ function Ur(e) {
9594
9613
  };
9595
9614
  }
9596
9615
  }
9597
- async function Vi() {
9598
- if (Ei) return;
9599
- Ei = !0;
9600
- let e = qr(),
9616
+ async function Fi() {
9617
+ if (qi) return;
9618
+ qi = !0;
9619
+ let e = Dr(),
9601
9620
  t = w(),
9602
9621
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
9603
- (Ai.default
9622
+ (Ri.default
9604
9623
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
9605
9624
  .on('line', async (n) => {
9606
9625
  let s = n.trim();
@@ -9612,7 +9631,7 @@ async function Vi() {
9612
9631
  c = o.params.arguments || {};
9613
9632
  if (l === 'get_pricing') {
9614
9633
  let d = typeof c.model == 'string' ? c.model.trim() : '',
9615
- p = `${t.replace(/\/+$/, '')}${xe(d)}`;
9634
+ p = `${t.replace(/\/+$/, '')}${we(d)}`;
9616
9635
  try {
9617
9636
  let m = await fetch(p, { signal: AbortSignal.timeout(1e4) }),
9618
9637
  y = await m.text();
@@ -9660,18 +9679,18 @@ async function Vi() {
9660
9679
  )
9661
9680
  try {
9662
9681
  let p = z.default.resolve(d.trim());
9663
- if (V.default.existsSync(p) && V.default.statSync(p).isFile() && e) {
9664
- if (!Ri(p)) throw Li(p);
9665
- let m = await qi(p, e, t),
9682
+ if (N.default.existsSync(p) && N.default.statSync(p).isFile() && e) {
9683
+ if (!Ni(p)) throw Vi(p);
9684
+ let m = await Di(p, e, t),
9666
9685
  y = (m.sizeBytes / 1024).toFixed(1),
9667
- _e =
9686
+ xe =
9668
9687
  m.mimeType.startsWith('image/') ||
9669
9688
  /\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
9670
9689
  ? `
9671
9690
 
9672
9691
  ![Uploaded Asset](${m.url})`
9673
9692
  : '',
9674
- Pe = {
9693
+ _e = {
9675
9694
  jsonrpc: '2.0',
9676
9695
  id: o.id,
9677
9696
  result: {
@@ -9682,7 +9701,7 @@ async function Vi() {
9682
9701
 
9683
9702
  - **URL:** ${m.url}
9684
9703
  - **Type:** \`${m.mimeType}\`
9685
- - **Size:** ${y} KB${_e}
9704
+ - **Size:** ${y} KB${xe}
9686
9705
 
9687
9706
  Pass this URL to any Tein generation tool.`,
9688
9707
  },
@@ -9691,7 +9710,7 @@ Pass this URL to any Tein generation tool.`,
9691
9710
  },
9692
9711
  };
9693
9712
  process.stdout.write(
9694
- JSON.stringify(Pe) +
9713
+ JSON.stringify(_e) +
9695
9714
  `
9696
9715
  `,
9697
9716
  );
@@ -9718,7 +9737,7 @@ Pass this URL to any Tein generation tool.`,
9718
9737
  }
9719
9738
  if (e)
9720
9739
  try {
9721
- o.params.arguments = await Di(String(l), c, e, t, i);
9740
+ o.params.arguments = await Ui(String(l), c, e, t, i);
9722
9741
  } catch (d) {
9723
9742
  let p = d instanceof Error ? d.message : String(d);
9724
9743
  process.stdout.write(
@@ -9749,10 +9768,10 @@ Pass this URL to any Tein generation tool.`,
9749
9768
  body: JSON.stringify(o),
9750
9769
  }),
9751
9770
  c = await l.text(),
9752
- d = Oi(o, l.status, c);
9771
+ d = Li(o, l.status, c);
9753
9772
  if (d === null) return;
9754
9773
  if (d) {
9755
- (o?.method === 'tools/list' && dt(d.result?.tools),
9774
+ (o?.method === 'tools/list' && pt(d.result?.tools),
9756
9775
  process.stdout.write(
9757
9776
  JSON.stringify(d) +
9758
9777
  `
@@ -9761,7 +9780,7 @@ Pass this URL to any Tein generation tool.`,
9761
9780
  return;
9762
9781
  }
9763
9782
  } catch {}
9764
- let u = Ur(o);
9783
+ let u = jr(o);
9765
9784
  u !== null &&
9766
9785
  process.stdout.write(
9767
9786
  JSON.stringify(u) +
@@ -9784,23 +9803,23 @@ Pass this URL to any Tein generation tool.`,
9784
9803
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
9785
9804
  `));
9786
9805
  }
9787
- var V,
9806
+ var N,
9788
9807
  z,
9789
- Ai,
9790
- Rr,
9791
- re,
9792
- lt,
9793
- Ei,
9794
- Ui = h(() => {
9808
+ Ri,
9809
+ Nr,
9810
+ ae,
9811
+ dt,
9812
+ qi,
9813
+ ji = h(() => {
9795
9814
  'use strict';
9796
- ((V = T(require('node:fs'))),
9815
+ ((N = T(require('node:fs'))),
9797
9816
  (z = T(require('node:path'))),
9798
- (Ai = T(require('node:readline'))));
9799
- tt();
9800
- Ci();
9801
- E();
9802
- ne();
9803
- Rr = new Set([
9817
+ (Ri = T(require('node:readline'))));
9818
+ it();
9819
+ Ai();
9820
+ $();
9821
+ re();
9822
+ Nr = new Set([
9804
9823
  '.png',
9805
9824
  '.jpg',
9806
9825
  '.jpeg',
@@ -9826,20 +9845,20 @@ var V,
9826
9845
  '.flac',
9827
9846
  '.opus',
9828
9847
  ]);
9829
- ((re = new Map()), (lt = 0));
9830
- Ei = !1;
9848
+ ((ae = new Map()), (dt = 0));
9849
+ qi = !1;
9831
9850
  require.main === module &&
9832
- Vi().catch((e) => {
9851
+ Fi().catch((e) => {
9833
9852
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
9834
9853
  `),
9835
9854
  process.exit(1));
9836
9855
  });
9837
9856
  });
9838
- var Yi =
9857
+ var Zi =
9839
9858
  !process.env.NO_COLOR &&
9840
9859
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
9841
9860
  function x(e, t) {
9842
- return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9861
+ return (i) => (Zi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9843
9862
  }
9844
9863
  var r = {
9845
9864
  bold: x(1, 22),
@@ -9861,7 +9880,7 @@ var r = {
9861
9880
  bgCyan: x(46, 49),
9862
9881
  bgGreen: x(42, 49),
9863
9882
  },
9864
- $ = class {
9883
+ C = class {
9865
9884
  constructor(t = '') {
9866
9885
  this.frames = [
9867
9886
  '\u280B',
@@ -9925,11 +9944,11 @@ var r = {
9925
9944
  };
9926
9945
  var U = T(require('node:fs')),
9927
9946
  O = T(require('node:path'));
9928
- var se = T(require('node:fs')),
9929
- ft = T(require('node:path')),
9930
- gt = require('node:stream/promises');
9931
- ne();
9932
- var ea = new Set([
9947
+ var ne = T(require('node:fs')),
9948
+ gt = T(require('node:path')),
9949
+ ht = require('node:stream/promises');
9950
+ re();
9951
+ var aa = new Set([
9933
9952
  'account_suspended',
9934
9953
  'account_terminated',
9935
9954
  'creative_mode_restricted',
@@ -9937,7 +9956,7 @@ var ea = new Set([
9937
9956
  'workspace_paused',
9938
9957
  ]),
9939
9958
  v = 1,
9940
- ta = 3,
9959
+ ra = 3,
9941
9960
  b = class extends Error {
9942
9961
  constructor(t, i, a, n = {}) {
9943
9962
  (super(i),
@@ -9947,10 +9966,10 @@ var ea = new Set([
9947
9966
  (this.fields = n));
9948
9967
  }
9949
9968
  get exitCode() {
9950
- return this.code && ea.has(this.code) ? ta : v;
9969
+ return this.code && aa.has(this.code) ? ra : v;
9951
9970
  }
9952
9971
  };
9953
- function ia(e, t, i) {
9972
+ function na(e, t, i) {
9954
9973
  let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
9955
9974
  if (!i || typeof i != 'object') return new b(e, a);
9956
9975
  let n = i;
@@ -9963,13 +9982,13 @@ function ia(e, t, i) {
9963
9982
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
9964
9983
  return new b(e, c, typeof o == 'string' ? o : void 0, l);
9965
9984
  }
9966
- function ut(e) {
9985
+ function mt(e) {
9967
9986
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
9968
9987
  }
9969
9988
  function K(e) {
9970
9989
  let t = [e.message],
9971
- i = ut(e.fields.required),
9972
- a = ut(e.fields.balance);
9990
+ i = mt(e.fields.required),
9991
+ a = mt(e.fields.balance);
9973
9992
  (i || a) &&
9974
9993
  t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
9975
9994
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -9977,19 +9996,19 @@ function K(e) {
9977
9996
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
9978
9997
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
9979
9998
  }
9980
- function aa(e) {
9999
+ function sa(e) {
9981
10000
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
9982
10001
  ? 'video'
9983
10002
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
9984
10003
  ? 'audio'
9985
10004
  : 'image';
9986
10005
  }
9987
- function mt(e) {
10006
+ function ft(e) {
9988
10007
  let t = [];
9989
10008
  for (let i of e.data ?? [])
9990
10009
  typeof i.message?.content == 'string'
9991
10010
  ? t.push({ type: 'text', text: i.message.content })
9992
- : i.url && t.push({ type: aa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
10011
+ : i.url && t.push({ type: sa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
9993
10012
  return t;
9994
10013
  }
9995
10014
  var M = class {
@@ -10015,7 +10034,7 @@ var M = class {
10015
10034
  try {
10016
10035
  s = await n.json();
10017
10036
  } catch {}
10018
- throw ia(n.status, n.statusText, s);
10037
+ throw na(n.status, n.statusText, s);
10019
10038
  }
10020
10039
  return await n.json();
10021
10040
  }
@@ -10029,7 +10048,7 @@ var M = class {
10029
10048
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
10030
10049
  ? n
10031
10050
  : 'processing',
10032
- o = mt(a);
10051
+ o = ft(a);
10033
10052
  return {
10034
10053
  request_id: a.request_id || a.id || '',
10035
10054
  model: a.model,
@@ -10047,7 +10066,7 @@ var M = class {
10047
10066
  a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
10048
10067
  ? a
10049
10068
  : 'processing',
10050
- s = mt(i),
10069
+ s = ft(i),
10051
10070
  o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
10052
10071
  return {
10053
10072
  request_id: i.id || t,
@@ -10076,14 +10095,14 @@ var M = class {
10076
10095
  async downloadOutput(t, i) {
10077
10096
  let a = await fetch(t);
10078
10097
  if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
10079
- let n = ft.default.dirname(i);
10080
- se.default.existsSync(n) || se.default.mkdirSync(n, { recursive: !0 });
10081
- let s = se.default.createWriteStream(i);
10082
- return (await (0, gt.pipeline)(a.body, s), i);
10098
+ let n = gt.default.dirname(i);
10099
+ ne.default.existsSync(n) || ne.default.mkdirSync(n, { recursive: !0 });
10100
+ let s = ne.default.createWriteStream(i);
10101
+ return (await (0, ht.pipeline)(a.body, s), i);
10083
10102
  }
10084
10103
  };
10085
- E();
10086
- function Se(e) {
10104
+ $();
10105
+ function Ke(e) {
10087
10106
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
10088
10107
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
10089
10108
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
@@ -10091,43 +10110,43 @@ function Se(e) {
10091
10110
  a = Math.round(Number((e * i).toFixed(6))) / i;
10092
10111
  return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
10093
10112
  }
10094
- te();
10095
- var di = ['images', 'input_images', 'videos', 'audios'];
10096
- function Za(e) {
10097
- for (let t of di) typeof e[t] == 'string' && (e[t] = [e[t]]);
10113
+ ee();
10114
+ var ui = ['images', 'input_images', 'videos', 'audios'];
10115
+ function ir(e) {
10116
+ for (let t of ui) typeof e[t] == 'string' && (e[t] = [e[t]]);
10098
10117
  }
10099
- function er(e) {
10118
+ function ar(e) {
10100
10119
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
10101
10120
  let t = O.default.resolve(e);
10102
10121
  return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
10103
10122
  }
10104
- async function tr(e, t) {
10105
- for (let i of di) {
10123
+ async function rr(e, t) {
10124
+ for (let i of ui) {
10106
10125
  if (!Array.isArray(e[i])) continue;
10107
10126
  let a = [];
10108
10127
  for (let n of e[i]) {
10109
10128
  if (typeof n != 'string') continue;
10110
- let s = er(n);
10129
+ let s = ar(n);
10111
10130
  a.push(s ? await t(s) : n);
10112
10131
  }
10113
10132
  e[i] = a;
10114
10133
  }
10115
10134
  }
10116
- var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10117
- function ir(e) {
10135
+ var te = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10136
+ function nr(e) {
10118
10137
  if (e.count === void 0 || e.count === !0) return 1;
10119
10138
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
10120
- i = ie.enterprise;
10139
+ i = te.enterprise;
10121
10140
  return (
10122
10141
  (!Number.isInteger(t) || t < 1 || t > i) &&
10123
10142
  (process.stderr
10124
- .write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${ie.starter}, Plus ${ie.plus}, Scale ${ie.scale}, Enterprise ${ie.enterprise} at once, including polling.
10143
+ .write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${te.starter}, Plus ${te.plus}, Scale ${te.scale}, Enterprise ${te.enterprise} at once, including polling.
10125
10144
  `),
10126
10145
  process.exit(1)),
10127
10146
  t
10128
10147
  );
10129
10148
  }
10130
- async function ar(e, t, i, a, n) {
10149
+ async function sr(e, t, i, a, n) {
10131
10150
  n.isJson ||
10132
10151
  process.stderr.write(`Starting ${a} ${t} jobs together...
10133
10152
  `);
@@ -10189,7 +10208,7 @@ async function ar(e, t, i, a, n) {
10189
10208
  else {
10190
10209
  for (let l of o)
10191
10210
  (process.stdout.write(`${l.request_id} ${l.status}`),
10192
- l.usage?.cost !== void 0 && process.stdout.write(` ${Se(l.usage.cost)}`),
10211
+ l.usage?.cost !== void 0 && process.stdout.write(` ${Ke(l.usage.cost)}`),
10193
10212
  l.error && process.stdout.write(` ${l.error}`),
10194
10213
  process.stdout.write(`
10195
10214
  `));
@@ -10202,12 +10221,12 @@ async function ar(e, t, i, a, n) {
10202
10221
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
10203
10222
  process.exit(v);
10204
10223
  }
10205
- function rr(e, t, i) {
10224
+ function or(e, t, i) {
10206
10225
  if (i <= 1) return e;
10207
10226
  let a = O.default.extname(e);
10208
10227
  return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
10209
10228
  }
10210
- function pi(e) {
10229
+ function mi(e) {
10211
10230
  let t = {},
10212
10231
  i = new Set(),
10213
10232
  a = [];
@@ -10252,7 +10271,7 @@ function pi(e) {
10252
10271
  }
10253
10272
  return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
10254
10273
  }
10255
- async function Ze(e, t) {
10274
+ async function et(e, t) {
10256
10275
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
10257
10276
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
10258
10277
  (i ||
@@ -10274,7 +10293,7 @@ async function Ze(e, t) {
10274
10293
  s = !!t.json,
10275
10294
  o = !!(t.async || t.no_wait),
10276
10295
  u = typeof t.output == 'string' ? t.output : void 0,
10277
- l = ir(t),
10296
+ l = nr(t),
10278
10297
  c = { ...t };
10279
10298
  (delete c.json,
10280
10299
  delete c.async,
@@ -10283,9 +10302,9 @@ async function Ze(e, t) {
10283
10302
  delete c.api_key,
10284
10303
  delete c.api_url,
10285
10304
  delete c.count);
10286
- let d = li(n, c);
10287
- (Za(d),
10288
- typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
10305
+ let d = ci(n, c);
10306
+ (ir(d),
10307
+ typeof d.image == 'string' && !d.images && !ke(n) && ((d.images = [d.image]), delete d.image),
10289
10308
  d.image_url &&
10290
10309
  !d.first_frame_image &&
10291
10310
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
@@ -10307,14 +10326,14 @@ async function Ze(e, t) {
10307
10326
  if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
10308
10327
  let P = O.default.resolve(g);
10309
10328
  if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
10310
- let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
10329
+ let I = new C(`Uploading local file ${O.default.basename(P)} to CDN...`);
10311
10330
  s || I.start();
10312
10331
  try {
10313
- let N = U.default.readFileSync(P),
10314
- q = await p.uploadAsset(N.toString('base64'));
10332
+ let V = U.default.readFileSync(P),
10333
+ q = await p.uploadAsset(V.toString('base64'));
10315
10334
  ((d[k] = q.url), s || I.succeed(`Uploaded ${O.default.basename(P)} to CDN`));
10316
- } catch (N) {
10317
- let q = N instanceof Error ? N.message : String(N);
10335
+ } catch (V) {
10336
+ let q = V instanceof Error ? V.message : String(V);
10318
10337
  (s
10319
10338
  ? process.stdout.write(
10320
10339
  JSON.stringify({ error: q }) +
@@ -10327,8 +10346,8 @@ async function Ze(e, t) {
10327
10346
  }
10328
10347
  }
10329
10348
  }
10330
- await tr(d, async (k) => {
10331
- let g = new $(`Uploading local file ${O.default.basename(k)} to CDN...`);
10349
+ await rr(d, async (k) => {
10350
+ let g = new C(`Uploading local file ${O.default.basename(k)} to CDN...`);
10332
10351
  s || g.start();
10333
10352
  try {
10334
10353
  let P = U.default.readFileSync(k),
@@ -10346,12 +10365,12 @@ async function Ze(e, t) {
10346
10365
  process.exit(1));
10347
10366
  }
10348
10367
  });
10349
- let y = new $(`Submitting task for ${r.bold(e)}...`);
10368
+ let y = new C(`Submitting task for ${r.bold(e)}...`);
10350
10369
  s || y.start();
10351
10370
  let f;
10352
10371
  try {
10353
10372
  if (l > 1) {
10354
- await ar(p, e, d, l, { isJson: s, isAsync: o });
10373
+ await sr(p, e, d, l, { isJson: s, isAsync: o });
10355
10374
  return;
10356
10375
  }
10357
10376
  f = await p.queueJob(e, d);
@@ -10389,12 +10408,12 @@ async function Ze(e, t) {
10389
10408
  `));
10390
10409
  return;
10391
10410
  }
10392
- let _e = Date.now(),
10393
- Pe = 1500;
10411
+ let xe = Date.now(),
10412
+ _e = 1500;
10394
10413
  for (; f.status === 'processing';) {
10395
- let k = Math.round((Date.now() - _e) / 1e3);
10414
+ let k = Math.round((Date.now() - xe) / 1e3);
10396
10415
  (s || y.update(`Rendering ${r.bold(e)} (${k}s elapsed)... [ID: ${f.request_id}]`),
10397
- await new Promise((g) => setTimeout(g, Pe)));
10416
+ await new Promise((g) => setTimeout(g, _e)));
10398
10417
  try {
10399
10418
  f = await p.getStatus(f.request_id);
10400
10419
  } catch (g) {
@@ -10436,7 +10455,7 @@ async function Ze(e, t) {
10436
10455
  process.stdout.write(` ${r.bold('Request ID:')} ${f.request_id}
10437
10456
  `),
10438
10457
  f.usage?.cost !== void 0 &&
10439
- process.stdout.write(` ${r.bold('Cost:')} ${Se(f.usage.cost)}
10458
+ process.stdout.write(` ${r.bold('Cost:')} ${Ke(f.usage.cost)}
10440
10459
  `),
10441
10460
  f.output && f.output.length > 0)
10442
10461
  ) {
@@ -10448,19 +10467,19 @@ ${r.bold('Outputs:')}
10448
10467
  for (let P = 0; P < f.output.length; P++) {
10449
10468
  let I = f.output[P];
10450
10469
  if (I.url) {
10451
- let N = I.layer?.name ? ` ${r.bold(I.layer.name)}` : '';
10470
+ let V = I.layer?.name ? ` ${r.bold(I.layer.name)}` : '';
10452
10471
  if (
10453
- (process.stdout.write(` [${I.type.toUpperCase()}]${N} ${r.cyan(r.underline(I.url))}
10472
+ (process.stdout.write(` [${I.type.toUpperCase()}]${V} ${r.cyan(r.underline(I.url))}
10454
10473
  `),
10455
10474
  u)
10456
10475
  ) {
10457
- let q = rr(u, g++, k),
10458
- pt = new $(`Downloading output to ${q}...`).start();
10476
+ let q = or(u, g++, k),
10477
+ ct = new C(`Downloading output to ${q}...`).start();
10459
10478
  try {
10460
10479
  (await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
10461
- pt.succeed(`Saved to ${r.bold(q)}`));
10462
- } catch (Ie) {
10463
- pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
10480
+ ct.succeed(`Saved to ${r.bold(q)}`));
10481
+ } catch (Pe) {
10482
+ ct.fail(`Failed to download: ${Pe instanceof Error ? Pe.message : Pe}`);
10464
10483
  }
10465
10484
  }
10466
10485
  } else
@@ -10473,9 +10492,9 @@ ${I.text}
10473
10492
  process.stdout.write(`
10474
10493
  `);
10475
10494
  }
10476
- var ci = T(require('node:readline'));
10477
- E();
10478
- async function nr(e) {
10495
+ var fi = T(require('node:readline'));
10496
+ $();
10497
+ async function lr(e) {
10479
10498
  try {
10480
10499
  return (await new M(e, w()).checkKey(), 'ok');
10481
10500
  } catch (t) {
@@ -10486,15 +10505,15 @@ async function nr(e) {
10486
10505
  return 'unchecked';
10487
10506
  }
10488
10507
  }
10489
- function sr(e) {
10490
- let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
10508
+ function dr(e) {
10509
+ let t = fi.default.createInterface({ input: process.stdin, output: process.stdout });
10491
10510
  return new Promise((i) => {
10492
10511
  t.question(e, (a) => {
10493
10512
  (t.close(), i(a.trim()));
10494
10513
  });
10495
10514
  });
10496
10515
  }
10497
- async function ae(e, t) {
10516
+ async function ie(e, t) {
10498
10517
  switch (e) {
10499
10518
  case 'login':
10500
10519
  case 'set-key': {
@@ -10506,22 +10525,22 @@ ${r.bold('Tein AI Authentication')}
10506
10525
  process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
10507
10526
 
10508
10527
  `),
10509
- (i = await sr('Enter your Tein API Key (sk_live_...): '))),
10528
+ (i = await dr('Enter your Tein API Key (sk_live_...): '))),
10510
10529
  !i.startsWith('sk_live_') &&
10511
10530
  !i.startsWith('sk_test_') &&
10512
10531
  (process.stderr
10513
10532
  .write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10514
10533
  `),
10515
10534
  process.exit(1)));
10516
- let a = await nr(i);
10535
+ let a = await lr(i);
10517
10536
  (a === 'invalid' &&
10518
10537
  (process.stderr
10519
10538
  .write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
10520
10539
  `),
10521
10540
  process.exit(1)),
10522
- Ke({ apiKey: i }),
10541
+ Me({ apiKey: i }),
10523
10542
  process.stdout.write(`
10524
- ${r.green('\u2713')} API key saved to ${r.dim(le())}
10543
+ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
10525
10544
  `),
10526
10545
  a === 'blocked'
10527
10546
  ? process.stdout
@@ -10544,9 +10563,9 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
10544
10563
  `);
10545
10564
  break;
10546
10565
  }
10547
- (Ke({ apiKey: '' }),
10566
+ (Me({ apiKey: '' }),
10548
10567
  process.stdout
10549
- .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(le())}
10568
+ .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(oe())}
10550
10569
  `));
10551
10570
  break;
10552
10571
  }
@@ -10558,7 +10577,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
10558
10577
  (process.stdout.write(`
10559
10578
  ${r.bold('Tein AI CLI Configuration')}
10560
10579
  `),
10561
- process.stdout.write(` Config file: ${r.dim(le())}
10580
+ process.stdout.write(` Config file: ${r.dim(oe())}
10562
10581
  `),
10563
10582
  process.stdout.write(` API URL: ${r.cyan(a)}
10564
10583
  `),
@@ -10582,16 +10601,16 @@ ${r.bold('Tein AI CLI Configuration')}
10582
10601
  }
10583
10602
  }
10584
10603
  }
10585
- E();
10604
+ $();
10586
10605
  function _(e) {
10587
10606
  return e !== 0 && Math.abs(e) < 0.01
10588
10607
  ? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
10589
10608
  : `$${e.toFixed(2)}`;
10590
10609
  }
10591
- function ui(e) {
10610
+ function gi(e) {
10592
10611
  return `${e} ${e === 1 ? 'request' : 'requests'}`;
10593
10612
  }
10594
- function or(e) {
10613
+ function pr(e) {
10595
10614
  let t = [
10596
10615
  ['Balance', _(e.balance)],
10597
10616
  ['Available to this key', _(e.available)],
@@ -10611,8 +10630,8 @@ function or(e) {
10611
10630
  `${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
10612
10631
  ]),
10613
10632
  t.push(
10614
- ['This month', `${_(e.usage.this_month.spend)} on ${ui(e.usage.this_month.requests)}`],
10615
- ['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${ui(e.usage.last_30_days.requests)}`],
10633
+ ['This month', `${_(e.usage.this_month.spend)} on ${gi(e.usage.this_month.requests)}`],
10634
+ ['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${gi(e.usage.last_30_days.requests)}`],
10616
10635
  [
10617
10636
  'Auto top up',
10618
10637
  e.auto_top_up.enabled
@@ -10625,7 +10644,7 @@ function or(e) {
10625
10644
  let a = Math.max(...t.map(([n]) => n.length));
10626
10645
  return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
10627
10646
  }
10628
- async function mi(e) {
10647
+ async function hi(e) {
10629
10648
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10630
10649
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
10631
10650
  a = !!e.json;
@@ -10669,13 +10688,13 @@ async function mi(e) {
10669
10688
  }
10670
10689
  process.stdout.write(`
10671
10690
  ${r.bold('Tein balance')}
10672
- ${or(n).join(`
10691
+ ${pr(n).join(`
10673
10692
  `)}
10674
10693
 
10675
10694
  `);
10676
10695
  }
10677
- E();
10678
- function fi(e) {
10696
+ $();
10697
+ function yi(e) {
10679
10698
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10680
10699
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
10681
10700
  return (
@@ -10689,7 +10708,7 @@ function fi(e) {
10689
10708
  new M(t, i)
10690
10709
  );
10691
10710
  }
10692
- function gi(e, t) {
10711
+ function bi(e, t) {
10693
10712
  let i = {};
10694
10713
  for (let a of t) {
10695
10714
  let n = e[a];
@@ -10697,7 +10716,7 @@ function gi(e, t) {
10697
10716
  }
10698
10717
  return i;
10699
10718
  }
10700
- async function hi(e, t) {
10719
+ async function ki(e, t) {
10701
10720
  try {
10702
10721
  return await t();
10703
10722
  } catch (i) {
@@ -10721,7 +10740,7 @@ async function hi(e, t) {
10721
10740
  process.exit(v));
10722
10741
  }
10723
10742
  }
10724
- function et(e) {
10743
+ function tt(e) {
10725
10744
  let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
10726
10745
  i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
10727
10746
  return e.map(
@@ -10732,7 +10751,7 @@ function et(e) {
10732
10751
  .trimEnd()}`,
10733
10752
  );
10734
10753
  }
10735
- function lr(e) {
10754
+ function cr(e) {
10736
10755
  let t = e.summary,
10737
10756
  i = [
10738
10757
  ` Window ${e.from.slice(0, 10)} to ${e.to.slice(0, 10)} (${e.range})${e.filters.model ? `, model ${e.filters.model}` : ''}${e.filters.channel ? `, channel ${e.filters.channel}` : ''}`,
@@ -10744,7 +10763,7 @@ function lr(e) {
10744
10763
  e.by_channel.length &&
10745
10764
  (i.push('', r.bold('By channel')),
10746
10765
  i.push(
10747
- ...et([
10766
+ ...tt([
10748
10767
  ['Channel', 'Spend', 'Requests'],
10749
10768
  ...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
10750
10769
  ]),
@@ -10752,7 +10771,7 @@ function lr(e) {
10752
10771
  e.by_model.length &&
10753
10772
  (i.push('', r.bold('By model')),
10754
10773
  i.push(
10755
- ...et([
10774
+ ...tt([
10756
10775
  ['Model', 'Spend', 'Requests', 'Failed'],
10757
10776
  ...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
10758
10777
  ]),
@@ -10760,10 +10779,10 @@ function lr(e) {
10760
10779
  i
10761
10780
  );
10762
10781
  }
10763
- async function yi(e) {
10782
+ async function wi(e) {
10764
10783
  let t = !!e.json,
10765
- i = fi(e),
10766
- a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
10784
+ i = yi(e),
10785
+ a = await ki(t, () => i.getUsage(bi(e, ['range', 'from', 'to', 'model', 'channel'])));
10767
10786
  if (t) {
10768
10787
  process.stdout.write(
10769
10788
  JSON.stringify(a, null, 2) +
@@ -10774,14 +10793,14 @@ async function yi(e) {
10774
10793
  }
10775
10794
  process.stdout.write(`
10776
10795
  ${r.bold('Tein usage')}
10777
- ${lr(a).join(`
10796
+ ${cr(a).join(`
10778
10797
  `)}
10779
10798
 
10780
10799
  `);
10781
10800
  }
10782
- function dr(e) {
10801
+ function ur(e) {
10783
10802
  return e.data.length
10784
- ? et([
10803
+ ? tt([
10785
10804
  ['When (UTC)', 'Amount', 'Balance after', 'What'],
10786
10805
  ...e.data.map((t) => [
10787
10806
  t.created_at.slice(0, 16).replace('T', ' '),
@@ -10792,10 +10811,10 @@ function dr(e) {
10792
10811
  ])
10793
10812
  : [' No transactions yet.'];
10794
10813
  }
10795
- async function bi(e) {
10814
+ async function xi(e) {
10796
10815
  let t = !!e.json,
10797
- i = fi(e),
10798
- a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
10816
+ i = yi(e),
10817
+ a = await ki(t, () => i.getTransactions(bi(e, ['limit', 'type', 'after'])));
10799
10818
  if (t) {
10800
10819
  process.stdout.write(
10801
10820
  JSON.stringify(a, null, 2) +
@@ -10811,18 +10830,18 @@ async function bi(e) {
10811
10830
  : '';
10812
10831
  process.stdout.write(`
10813
10832
  ${r.bold('Tein balance history')}
10814
- ${dr(a).join(`
10833
+ ${ur(a).join(`
10815
10834
  `)}${n}
10816
10835
 
10817
10836
  `);
10818
10837
  }
10819
- E();
10820
- Ce();
10821
- te();
10822
- var pr = 3e3;
10823
- async function ki(e) {
10838
+ $();
10839
+ Se();
10840
+ ee();
10841
+ var mr = 3e3;
10842
+ async function _i(e) {
10824
10843
  try {
10825
- let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
10844
+ let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(mr) });
10826
10845
  if (!t.ok) return;
10827
10846
  let i = await t.json(),
10828
10847
  a = {};
@@ -10830,18 +10849,18 @@ async function ki(e) {
10830
10849
  let s = String(n.modelSlug ?? '');
10831
10850
  J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
10832
10851
  }
10833
- ii(a);
10852
+ ni(a);
10834
10853
  } catch {}
10835
10854
  }
10836
- var cr = new Set(['video', 'image', 'text', 'audio', '3d']),
10837
- ur = { llm: 'text', chat: 'text', reasoning: 'text' };
10838
- async function wi(e, t) {
10839
- await ki(t);
10855
+ var fr = new Set(['video', 'image', 'text', 'audio', '3d']),
10856
+ gr = { llm: 'text', chat: 'text', reasoning: 'text' };
10857
+ async function Pi(e, t) {
10858
+ await _i(t);
10840
10859
  let i = D();
10841
10860
  if (e) {
10842
10861
  let s = e.toLowerCase(),
10843
- o = ur[s] ?? s;
10844
- i = cr.has(o)
10862
+ o = gr[s] ?? s;
10863
+ i = fr.has(o)
10845
10864
  ? i.filter((u) => u.category.toLowerCase() === o)
10846
10865
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
10847
10866
  }
@@ -10879,8 +10898,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
10879
10898
 
10880
10899
  `);
10881
10900
  }
10882
- async function xi(e, t) {
10883
- J.has(e) && (await ki(t));
10901
+ async function Ii(e, t) {
10902
+ J.has(e) && (await _i(t));
10884
10903
  let i = H(e);
10885
10904
  (i ||
10886
10905
  (process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -10960,10 +10979,10 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
10960
10979
 
10961
10980
  `);
10962
10981
  }
10963
- E();
10964
- tt();
10965
- var mr = 1e4,
10966
- at = {
10982
+ $();
10983
+ it();
10984
+ var hr = 1e4,
10985
+ rt = {
10967
10986
  price: '',
10968
10987
  creativeMode: 'Creative mode',
10969
10988
  priority: 'Priority',
@@ -10973,22 +10992,22 @@ var mr = 1e4,
10973
10992
  priorityDraft: 'Priority + Draft',
10974
10993
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
10975
10994
  },
10976
- fr = Object.keys(at),
10977
- gr = {
10995
+ yr = Object.keys(rt),
10996
+ br = {
10978
10997
  creativeMode: 'unfiltered',
10979
10998
  creativeModePriority: 'unfilteredPriority',
10980
10999
  creativeModeDraft: 'unfilteredDraft',
10981
11000
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
10982
11001
  };
10983
- function hr(e, t) {
10984
- let i = gr[t];
11002
+ function kr(e, t) {
11003
+ let i = br[t];
10985
11004
  return e[t] ?? (i ? e[i] : void 0);
10986
11005
  }
10987
- async function yr(e, t) {
10988
- let i = `${w(e)}${xe(t)}`,
11006
+ async function wr(e, t) {
11007
+ let i = `${w(e)}${we(t)}`,
10989
11008
  a;
10990
11009
  try {
10991
- a = await fetch(i, { signal: AbortSignal.timeout(mr) });
11010
+ a = await fetch(i, { signal: AbortSignal.timeout(hr) });
10992
11011
  } catch {
10993
11012
  throw new Error(`Could not reach ${i}`);
10994
11013
  }
@@ -11004,18 +11023,18 @@ async function yr(e, t) {
11004
11023
  }
11005
11024
  return n;
11006
11025
  }
11007
- function it(e) {
11026
+ function at(e) {
11008
11027
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
11009
11028
  [i, a = ''] = t.split('.');
11010
11029
  return `$${i}.${a.padEnd(2, '0')}`;
11011
11030
  }
11012
- function rt(e) {
11031
+ function nt(e) {
11013
11032
  if (!e || typeof e.starter != 'number') return null;
11014
11033
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
11015
11034
  i = typeof e.scale == 'number' ? e.scale : t;
11016
- return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
11035
+ return `Starter ${at(e.starter)} Plus ${at(t)} Scale ${at(i)}`;
11017
11036
  }
11018
- function br(e) {
11037
+ function xr(e) {
11019
11038
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
11020
11039
  let t = [];
11021
11040
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -11027,33 +11046,33 @@ function br(e) {
11027
11046
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
11028
11047
  );
11029
11048
  }
11030
- function kr(e, t) {
11031
- let i = br(e);
11032
- for (let a of fr) {
11033
- let n = rt(hr(e, a));
11049
+ function _r(e, t) {
11050
+ let i = xr(e);
11051
+ for (let a of yr) {
11052
+ let n = nt(kr(e, a));
11034
11053
  if (!n) continue;
11035
- let s = at[a] ? ` (${at[a]})` : '';
11054
+ let s = rt[a] ? ` (${rt[a]})` : '';
11036
11055
  t.push(` ${i}${s} ${n}`);
11037
11056
  }
11038
11057
  }
11039
- function wr(e, t) {
11058
+ function Pr(e, t) {
11040
11059
  let i = e.quality ? ` quality=${e.quality}` : '';
11041
11060
  t.push(
11042
11061
  ` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
11043
11062
  );
11044
- for (let n of e.variants ?? []) kr(n, t);
11063
+ for (let n of e.variants ?? []) _r(n, t);
11045
11064
  let a = e.addons;
11046
11065
  if (Array.isArray(a))
11047
11066
  for (let n of a) {
11048
11067
  if (!n || typeof n != 'object') continue;
11049
11068
  let s = n,
11050
11069
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
11051
- u = rt(s.price);
11070
+ u = nt(s.price);
11052
11071
  u && t.push(` ${o} (add-on) ${u}`);
11053
11072
  }
11054
11073
  t.push('');
11055
11074
  }
11056
- function xr(e) {
11075
+ function Ir(e) {
11057
11076
  let t = [],
11058
11077
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
11059
11078
  (t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
@@ -11075,7 +11094,7 @@ function xr(e) {
11075
11094
  });
11076
11095
  for (let l of s) {
11077
11096
  t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
11078
- for (let c of a.get(l) ?? []) wr(c, t);
11097
+ for (let c of a.get(l) ?? []) Pr(c, t);
11079
11098
  }
11080
11099
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
11081
11100
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -11092,7 +11111,7 @@ function xr(e) {
11092
11111
  t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
11093
11112
  for (let m of d) {
11094
11113
  let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
11095
- f = rt(m.prices);
11114
+ f = nt(m.prices);
11096
11115
  f && t.push(` ${y} ${f}`);
11097
11116
  }
11098
11117
  t.push('');
@@ -11105,10 +11124,10 @@ function xr(e) {
11105
11124
  `
11106
11125
  );
11107
11126
  }
11108
- async function _i(e) {
11127
+ async function vi(e) {
11109
11128
  let t;
11110
11129
  try {
11111
- t = await yr(e.apiUrl, e.model);
11130
+ t = await wr(e.apiUrl, e.model);
11112
11131
  } catch (i) {
11113
11132
  let a = i instanceof Error ? i.message : String(i);
11114
11133
  (process.stderr.write(`${r.red('Error:')} ${a}
@@ -11119,12 +11138,12 @@ async function _i(e) {
11119
11138
  e.json
11120
11139
  ? `${JSON.stringify(t, null, 2)}
11121
11140
  `
11122
- : xr(t),
11141
+ : Ir(t),
11123
11142
  );
11124
11143
  }
11125
- var Pi = T(require('node:path'));
11126
- E();
11127
- async function Ii(e, t) {
11144
+ var Ti = T(require('node:path'));
11145
+ $();
11146
+ async function Mi(e, t) {
11128
11147
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
11129
11148
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
11130
11149
  (i ||
@@ -11144,7 +11163,7 @@ async function Ii(e, t) {
11144
11163
  s = !!t.wait,
11145
11164
  o = typeof t.output == 'string' ? t.output : void 0,
11146
11165
  u = new M(i, a),
11147
- l = new $(`Checking status of ${r.bold(e)}...`);
11166
+ l = new C(`Checking status of ${r.bold(e)}...`);
11148
11167
  n || l.start();
11149
11168
  let c;
11150
11169
  try {
@@ -11217,9 +11236,9 @@ ${r.bold('Outputs:')}
11217
11236
  `),
11218
11237
  o)
11219
11238
  ) {
11220
- let p = new $(`Downloading output to ${o}...`).start();
11239
+ let p = new C(`Downloading output to ${o}...`).start();
11221
11240
  try {
11222
- (await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
11241
+ (await u.downloadOutput(d.url, Ti.default.resolve(process.cwd(), o)),
11223
11242
  p.succeed(`Saved to ${r.bold(o)}`));
11224
11243
  } catch (m) {
11225
11244
  p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -11234,10 +11253,10 @@ ${d.text}
11234
11253
  process.stdout.write(`
11235
11254
  `);
11236
11255
  }
11237
- var nt = T(require('node:fs')),
11238
- st = T(require('node:path'));
11239
- E();
11240
- async function vi(e, t = {}) {
11256
+ var st = T(require('node:fs')),
11257
+ ot = T(require('node:path'));
11258
+ $();
11259
+ async function Ki(e, t = {}) {
11241
11260
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
11242
11261
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
11243
11262
  n = !!t.json;
@@ -11254,15 +11273,15 @@ async function vi(e, t = {}) {
11254
11273
  process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
11255
11274
  `),
11256
11275
  process.exit(1)));
11257
- let s = st.default.resolve(e);
11258
- nt.default.existsSync(s) ||
11276
+ let s = ot.default.resolve(e);
11277
+ st.default.existsSync(s) ||
11259
11278
  (process.stderr.write(`${r.red('Error:')} File not found: ${s}
11260
11279
  `),
11261
11280
  process.exit(1));
11262
- let o = st.default.basename(s),
11263
- l = nt.default.readFileSync(s).toString('base64'),
11281
+ let o = ot.default.basename(s),
11282
+ l = st.default.readFileSync(s).toString('base64'),
11264
11283
  c = new M(i, a),
11265
- d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
11284
+ d = new C(`Uploading ${r.bold(o)} to Tein AI CDN...`);
11266
11285
  n || d.start();
11267
11286
  try {
11268
11287
  let p = await c.uploadAsset(l);
@@ -11301,10 +11320,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
11301
11320
  process.exit(m ? m.exitCode : v));
11302
11321
  }
11303
11322
  }
11304
- ne();
11305
- te();
11306
- De();
11307
- function Fi() {
11323
+ re();
11324
+ ee();
11325
+ Le();
11326
+ function Gi() {
11308
11327
  process.stdout.write(`
11309
11328
  ${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
11310
11329
 
@@ -11386,11 +11405,11 @@ ${r.bold('EXAMPLES:')}
11386
11405
 
11387
11406
  `);
11388
11407
  }
11389
- async function Fr() {
11408
+ async function Gr() {
11390
11409
  let e = process.argv.slice(2),
11391
- t = pi(e);
11410
+ t = mi(e);
11392
11411
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
11393
- Fi();
11412
+ Gi();
11394
11413
  return;
11395
11414
  }
11396
11415
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -11400,31 +11419,31 @@ async function Fr() {
11400
11419
  }
11401
11420
  switch (t.command) {
11402
11421
  case 'auth': {
11403
- await ae(t.subcommand, t.options.key);
11422
+ await ie(t.subcommand, t.options.key);
11404
11423
  break;
11405
11424
  }
11406
11425
  case 'login': {
11407
- await ae('login', t.options.key);
11426
+ await ie('login', t.options.key);
11408
11427
  break;
11409
11428
  }
11410
11429
  case 'logout': {
11411
- await ae('logout');
11430
+ await ie('logout');
11412
11431
  break;
11413
11432
  }
11414
11433
  case 'whoami': {
11415
- await ae('status');
11434
+ await ie('status');
11416
11435
  break;
11417
11436
  }
11418
11437
  case 'models':
11419
11438
  case 'list': {
11420
- await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11439
+ await Pi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11421
11440
  break;
11422
11441
  }
11423
11442
  case 'pricing':
11424
11443
  case 'prices': {
11425
11444
  let i = t.options.model,
11426
11445
  a = t.subcommand || (typeof i == 'string' ? i : void 0);
11427
- await _i({
11446
+ await vi({
11428
11447
  model: a,
11429
11448
  json: !!t.options.json,
11430
11449
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -11439,61 +11458,61 @@ async function Fr() {
11439
11458
  process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
11440
11459
  `),
11441
11460
  process.exit(1)),
11442
- await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11461
+ await Ii(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11443
11462
  break;
11444
11463
  }
11445
11464
  case 'upload': {
11446
11465
  let i = t.subcommand || '';
11447
- await vi(i, t.options);
11466
+ await Ki(i, t.options);
11448
11467
  break;
11449
11468
  }
11450
11469
  case 'run':
11451
11470
  case 'generate': {
11452
11471
  let i = t.subcommand || '';
11453
- await Ze(i, t.options);
11472
+ await et(i, t.options);
11454
11473
  break;
11455
11474
  }
11456
11475
  case 'status': {
11457
11476
  let i = t.subcommand || '';
11458
- await Ii(i, t.options);
11477
+ await Mi(i, t.options);
11459
11478
  break;
11460
11479
  }
11461
11480
  case 'balance': {
11462
- await mi(t.options);
11481
+ await hi(t.options);
11463
11482
  break;
11464
11483
  }
11465
11484
  case 'usage': {
11466
- await yi(t.options);
11485
+ await wi(t.options);
11467
11486
  break;
11468
11487
  }
11469
11488
  case 'transactions':
11470
11489
  case 'history': {
11471
- await bi(t.options);
11490
+ await xi(t.options);
11472
11491
  break;
11473
11492
  }
11474
11493
  case 'mcp': {
11475
- let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
11494
+ let { startStdioServer: i } = await Promise.resolve().then(() => (ji(), Bi));
11476
11495
  await i();
11477
11496
  break;
11478
11497
  }
11479
11498
  default: {
11480
11499
  if (t.command && !t.command.startsWith('-')) {
11481
11500
  (!H(t.command) &&
11482
- !fe[t.command] &&
11501
+ !me[t.command] &&
11483
11502
  (process.stderr.write(`
11484
11503
  ${r.red('Error:')} Unknown command or model "${t.command}".
11485
11504
  Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
11486
11505
  `),
11487
11506
  process.exit(v)),
11488
- await Ze(t.command, t.options));
11507
+ await et(t.command, t.options));
11489
11508
  return;
11490
11509
  }
11491
- Fi();
11510
+ Gi();
11492
11511
  break;
11493
11512
  }
11494
11513
  }
11495
11514
  }
11496
- Fr().catch((e) => {
11515
+ Gr().catch((e) => {
11497
11516
  (e instanceof b &&
11498
11517
  (process.stderr.write(`
11499
11518
  ${r.red('Error:')} ${K(e).join(`