@teinai/cli 1.1.38 → 1.1.40

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 +752 -700
  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;
3
+ var Zi = Object.create;
4
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;
5
+ var ea = Object.getOwnPropertyDescriptor;
6
+ var ta = Object.getOwnPropertyNames;
7
+ var ia = Object.getPrototypeOf,
8
+ aa = 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) => {
17
+ var ra = (e, t) => {
18
18
  for (var i in t) ve(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- Wi = (e, t, i, a) => {
20
+ na = (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 ta(t))
23
+ !aa.call(e, n) &&
24
24
  n !== i &&
25
- ve(e, n, { get: () => t[n], enumerable: !(a = ji(t, n)) || a.enumerable });
25
+ ve(e, n, { get: () => t[n], enumerable: !(a = ea(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 ? Zi(ia(e)) : {}),
30
+ na(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
- function Qi(e) {
32
+ function la(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(ft.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 oa;
40
40
  }
41
- function Zi() {
41
+ function da() {
42
42
  let e = typeof __dirname == 'string' ? __dirname : process.cwd();
43
43
  return [
44
44
  Te.default.join(e, 'package.json'),
45
45
  Te.default.join(e, '..', '..', 'cli-package', 'package.json'),
46
46
  ];
47
47
  }
48
- var ct,
48
+ var ft,
49
49
  Te,
50
- Xi,
50
+ oa,
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
+ ((ft = T(require('node:fs'))), (Te = T(require('node:path'))), (oa = '0.0.0-dev'));
55
+ F = la(da());
56
56
  });
57
57
  function j() {
58
58
  try {
@@ -65,10 +65,10 @@ function j() {
65
65
  }
66
66
  function Ke(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,
95
+ kt,
96
96
  Me,
97
- oe,
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'))),
102
+ (kt = T(require('node:os'))),
103
103
  (Me = T(require('node:path'))),
104
- (oe = Me.default.join(ht.default.homedir(), '.tein')),
105
- (B = Me.default.join(oe, 'config.json')));
104
+ (se = Me.default.join(kt.default.homedir(), '.tein')),
105
+ (B = Me.default.join(se, 'config.json')));
106
106
  });
107
- var ra,
108
- yt,
109
- bt,
110
- kt = h(() => {
107
+ var fa,
108
+ wt,
109
+ xt,
110
+ _t = 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
+ ((fa = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
+ (wt = [...fa, 'auto']),
114
+ (xt =
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
+ Ee = 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 Pt = h(() => {
126
126
  'use strict';
127
127
  });
128
- var de,
129
- xt = h(() => {
128
+ var le,
129
+ It = 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 vt,
6244
+ Tt = h(() => {
6245
6245
  'use strict';
6246
- _t = [];
6246
+ vt = [];
6247
6247
  });
6248
- var pe,
6249
- It,
6250
- $e = h(() => {
6248
+ var de,
6249
+ Mt,
6250
+ Ce = 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
+ (Mt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6328
6328
  });
6329
6329
  function Oe(e, t) {
6330
6330
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
6331
6331
  }
6332
- function oa(e, t) {
6332
+ function ya(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,100 @@ function oa(e, t) {
6339
6339
  ? 'fast'
6340
6340
  : 'standard';
6341
6341
  }
6342
- function la(e, t) {
6342
+ function ba(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 = ya(i, t),
6349
+ s = $e.get(Oe('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) ?? $e.get(Oe(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 wa(e, t) {
6356
+ return pe.has(e) && !(ka.has(e) && t) ? e : ba(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 = wa(e, t);
6360
+ return i ? (pe.get(i) ?? null) : null;
6361
6361
  }
6362
- function ue() {
6363
- return Kt;
6362
+ function ce() {
6363
+ return Ct;
6364
6364
  }
6365
6365
  var qe,
6366
- Tt,
6367
- Mt,
6366
+ St,
6367
+ Et,
6368
+ Ct,
6369
+ ga,
6370
+ pe,
6371
+ $e,
6368
6372
  Kt,
6369
- na,
6370
- ce,
6371
- Ee,
6372
- vt,
6373
- sa,
6373
+ ha,
6374
6374
  Ae,
6375
- da,
6375
+ ka,
6376
6376
  G = h(() => {
6377
6377
  'use strict';
6378
- wt();
6379
- xt();
6380
6378
  Pt();
6381
- $e();
6379
+ It();
6380
+ Tt();
6381
+ Ce();
6382
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)),
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 = [
6387
+ (St = de.filter((e) => !W(e.slug))),
6388
+ (Et = vt.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
6389
+ (Ct = [...qe.models, ...Et, ...St]),
6390
+ (ga = [
6391
6391
  ...qe.families.map((e) => {
6392
- let t = Mt.filter((i) => i.family === e.slug).map((i) => i.slug);
6392
+ let t = Et.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) => ({
6395
+ ...Mt.map((e) => ({
6396
6396
  ...e,
6397
- models: Tt.filter((t) => t.family === e.slug).map((t) => t.slug),
6397
+ models: St.filter((t) => t.family === e.slug).map((t) => t.slug),
6398
6398
  })).filter((e) => e.models.length > 0),
6399
6399
  ]),
6400
- (ce = new Map()),
6401
- (Ee = new Map()),
6402
- (vt = new Map()),
6403
- (sa = new Map()),
6400
+ (pe = new Map()),
6401
+ ($e = new Map()),
6402
+ (Kt = new Map()),
6403
+ (ha = new Map()),
6404
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 });
6405
+ for (let e of Ct) {
6406
+ (pe.set(e.slug, e), $e.set(Oe(e.api.model, e.api.quality), e));
6407
+ for (let t of e.variants) Kt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6408
6408
  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 });
6409
+ Kt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6410
+ for (let t of e.addons ?? []) ha.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6411
6411
  Ae.set(e.slug, e.family);
6412
6412
  }
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']);
6413
+ for (let e of ga) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
6414
+ ka = new Set(['seedance-2']);
6415
6415
  });
6416
- function me(e) {
6416
+ function ue(e) {
6417
6417
  let t = e.from?.variant;
6418
6418
  return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
6419
6419
  }
6420
6420
  function Re(e) {
6421
6421
  if (e.endpoints?.length)
6422
- return e.editVariants?.length && e.endpoints.some((t) => t.id === St)
6423
- ? St
6422
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === $t)
6423
+ ? $t
6424
6424
  : (e.defaultEndpoint ?? e.endpoints[0].id);
6425
6425
  }
6426
- var St,
6426
+ var $t,
6427
6427
  Le = h(() => {
6428
6428
  'use strict';
6429
6429
  G();
6430
- St = 'dynamic';
6430
+ $t = 'dynamic';
6431
6431
  });
6432
- var fe,
6432
+ var me,
6433
6433
  De = h(() => {
6434
6434
  'use strict';
6435
- fe = {
6435
+ me = {
6436
6436
  'gemini-3-8-flash': 'gemini-3.8-flash',
6437
6437
  'gemini-3-7-flash': 'gemini-3.7-flash',
6438
6438
  'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
@@ -6442,29 +6442,29 @@ var fe,
6442
6442
  'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
6443
6443
  };
6444
6444
  });
6445
- var Ct = h(() => {
6445
+ var At = h(() => {
6446
6446
  'use strict';
6447
6447
  });
6448
- function $t(e, t) {
6449
- return typeof t == 'string' && (ca[e]?.includes(t) ?? !1);
6448
+ function Ot(e, t) {
6449
+ return typeof t == 'string' && (xa[e]?.includes(t) ?? !1);
6450
6450
  }
6451
- var ca,
6452
- Et = h(() => {
6451
+ var xa,
6452
+ qt = h(() => {
6453
6453
  'use strict';
6454
6454
  G();
6455
6455
  Le();
6456
- Ct();
6457
- ca = {};
6456
+ At();
6457
+ xa = {};
6458
6458
  });
6459
- function At(e) {
6460
- return e === 'nano-banana-pro' ? ua : ma;
6459
+ function Rt(e) {
6460
+ return e === 'nano-banana-pro' ? _a : Pa;
6461
6461
  }
6462
- var ua,
6463
- ma,
6464
- Ot = h(() => {
6462
+ var _a,
6463
+ Pa,
6464
+ Lt = h(() => {
6465
6465
  '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 = [
6466
+ ((_a = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6467
+ (Pa = [
6468
6468
  'auto',
6469
6469
  '1:1',
6470
6470
  '1:4',
@@ -6482,10 +6482,10 @@ var ua,
6482
6482
  '21:9',
6483
6483
  ]));
6484
6484
  });
6485
- var qt,
6486
- Rt = h(() => {
6485
+ var Dt,
6486
+ Nt = h(() => {
6487
6487
  'use strict';
6488
- qt = [
6488
+ Dt = [
6489
6489
  'prompt',
6490
6490
  'system',
6491
6491
  'messages',
@@ -6499,10 +6499,10 @@ var qt,
6499
6499
  'endpoint',
6500
6500
  ];
6501
6501
  });
6502
- var Lt,
6503
- Dt = h(() => {
6502
+ var Vt,
6503
+ Ut = h(() => {
6504
6504
  'use strict';
6505
- Lt = [
6505
+ Vt = [
6506
6506
  {
6507
6507
  slug: 'claude-fable-5-1',
6508
6508
  family: 'fable-5-1',
@@ -6571,13 +6571,13 @@ var Lt,
6571
6571
  },
6572
6572
  ];
6573
6573
  });
6574
- function Vt(e) {
6574
+ function Ft(e) {
6575
6575
  return `$${e}`;
6576
6576
  }
6577
- function Ve(e, t, i) {
6577
+ function Ne(e, t, i) {
6578
6578
  return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
6579
6579
  }
6580
- function fa(e) {
6580
+ function Ia(e) {
6581
6581
  return [
6582
6582
  {
6583
6583
  name: 'prompt',
@@ -6643,13 +6643,13 @@ function fa(e) {
6643
6643
  },
6644
6644
  ];
6645
6645
  }
6646
- function Nt() {
6646
+ function Bt() {
6647
6647
  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,
6652
- n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
6648
+ Vt.map((e) => {
6649
+ let t = Ne(e.slug, 'cheap', 'input'),
6650
+ i = Ne(e.slug, 'cheap', 'output'),
6651
+ a = Ne(e.slug, 'stable', 'input') != null,
6652
+ n = t != null && i != null ? `${Ft(t)}/M in \xB7 ${Ft(i)}/M out` : '',
6653
6653
  s = {
6654
6654
  slug: e.slug,
6655
6655
  name: e.name,
@@ -6660,50 +6660,50 @@ function Nt() {
6660
6660
  priceFormatted: n,
6661
6661
  unit: '/M tokens',
6662
6662
  primaryToolName: 'run_task',
6663
- parameters: fa(a),
6663
+ parameters: Ia(a),
6664
6664
  };
6665
6665
  return [e.slug, s];
6666
6666
  }),
6667
6667
  );
6668
6668
  }
6669
- var Ut = h(() => {
6669
+ var jt = h(() => {
6670
6670
  'use strict';
6671
- Dt();
6671
+ Ut();
6672
6672
  G();
6673
6673
  });
6674
- function ge(e) {
6675
- return e ? ha.get(e) : void 0;
6674
+ function fe(e) {
6675
+ return e ? Ta.get(e) : void 0;
6676
6676
  }
6677
- function Gt(e, t) {
6677
+ function Jt(e, t) {
6678
6678
  return !e.aspects?.length || e.sourceFramedModes?.includes(t)
6679
6679
  ? null
6680
6680
  : e.adaptiveModes?.includes(t)
6681
6681
  ? [...e.aspects, 'adaptive']
6682
6682
  : [...e.aspects];
6683
6683
  }
6684
- function Ht(e, t, i) {
6684
+ function Wt(e, t, i) {
6685
6685
  return e.modes.includes('motion_control')
6686
6686
  ? t === 'motion_control'
6687
- ? !ba.includes(i)
6688
- : !ya.includes(i)
6687
+ ? !Ka.includes(i)
6688
+ : !Ma.includes(i)
6689
6689
  : !0;
6690
6690
  }
6691
- var Ft,
6692
- ga,
6693
- Bt,
6694
- In,
6695
- ha,
6696
- jt,
6697
- Ne,
6698
- vn,
6691
+ var Gt,
6692
+ va,
6693
+ Ht,
6694
+ Rn,
6695
+ Ta,
6696
+ zt,
6697
+ Ve,
6698
+ Ln,
6699
6699
  Ue,
6700
- ya,
6701
- ba,
6700
+ Ma,
6701
+ Ka,
6702
6702
  Fe = h(() => {
6703
6703
  '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 = [
6704
+ ((Gt = ['16:9', '9:16', '1:1', '21:9']),
6705
+ (va = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6706
+ (Ht = [
6707
6707
  {
6708
6708
  slug: 'kling-v4',
6709
6709
  kind: 'video',
@@ -6711,7 +6711,7 @@ var Ft,
6711
6711
  promptMax: 26e3,
6712
6712
  duration: { min: 3, max: 30, default: 5 },
6713
6713
  heights: { '720p': 720, '1080p': 1080 },
6714
- aspects: Ft,
6714
+ aspects: Gt,
6715
6715
  sourceFramedModes: ['image_to_video'],
6716
6716
  adaptiveModes: ['multi_reference'],
6717
6717
  fps: 24,
@@ -6735,7 +6735,7 @@ var Ft,
6735
6735
  promptMax: 26e3,
6736
6736
  duration: { min: 3, max: 20, default: 5 },
6737
6737
  heights: { '720p': 720 },
6738
- aspects: [...Ft, '4:3', '3:4'],
6738
+ aspects: [...Gt, '4:3', '3:4'],
6739
6739
  sourceFramedModes: ['image_to_video'],
6740
6740
  adaptiveModes: ['multi_reference'],
6741
6741
  fps: 24,
@@ -6775,7 +6775,7 @@ var Ft,
6775
6775
  promptMax: 65535,
6776
6776
  duration: { min: 5, max: 15, default: 5 },
6777
6777
  heights: { '480p': 480, '768p': 768 },
6778
- aspects: ga,
6778
+ aspects: va,
6779
6779
  fps: 24,
6780
6780
  audio: 'free',
6781
6781
  seed: !0,
@@ -6850,10 +6850,10 @@ var Ft,
6850
6850
  seed: !0,
6851
6851
  },
6852
6852
  ]),
6853
- (In = Bt.map((e) => e.slug)),
6854
- (ha = new Map(Bt.map((e) => [e.slug, e]))));
6855
- ((jt = 'EXAVITQu4vr4xnSDxMaL'),
6856
- (Ne = {
6853
+ (Rn = Ht.map((e) => e.slug)),
6854
+ (Ta = new Map(Ht.map((e) => [e.slug, e]))));
6855
+ ((zt = 'EXAVITQu4vr4xnSDxMaL'),
6856
+ (Ve = {
6857
6857
  hpp4J3VqNfWAUOO0d1Us: 'Bella',
6858
6858
  CwhRBWXzGAHq8TQ4Fs17: 'Roger',
6859
6859
  EXAVITQu4vr4xnSDxMaL: 'Sarah',
@@ -6875,7 +6875,7 @@ var Ft,
6875
6875
  pqHfZKP75CvOlQylNhV4: 'Bill',
6876
6876
  pNInz6obpgDQGcFmaJgB: 'Adam',
6877
6877
  }),
6878
- (vn = Object.keys(Ne)),
6878
+ (Ln = Object.keys(Ve)),
6879
6879
  (Ue = [
6880
6880
  'mp3_44100_128',
6881
6881
  'mp3_22050_32',
@@ -6890,8 +6890,8 @@ var Ft,
6890
6890
  'opus_48000_128',
6891
6891
  'opus_48000_192',
6892
6892
  ]));
6893
- ((ya = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6894
- (ba = [
6893
+ ((Ma = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6894
+ (Ka = [
6895
6895
  'duration',
6896
6896
  'aspect_ratio',
6897
6897
  'generate_audio',
@@ -6903,7 +6903,7 @@ var Ft,
6903
6903
  'audios',
6904
6904
  ]));
6905
6905
  });
6906
- function wa() {
6906
+ function Ea() {
6907
6907
  return [
6908
6908
  {
6909
6909
  name: 'image_url',
@@ -6931,7 +6931,7 @@ function wa() {
6931
6931
  },
6932
6932
  ];
6933
6933
  }
6934
- function xa(e) {
6934
+ function Ca(e) {
6935
6935
  let t = e.duration,
6936
6936
  i = Object.keys(e.heights),
6937
6937
  a = e.sourceFramedModes?.length
@@ -7024,7 +7024,7 @@ function xa(e) {
7024
7024
  }
7025
7025
  return o;
7026
7026
  }
7027
- function _a(e) {
7027
+ function $a(e) {
7028
7028
  let t = Object.keys(e.sizes);
7029
7029
  return [
7030
7030
  {
@@ -7041,13 +7041,13 @@ function _a(e) {
7041
7041
  },
7042
7042
  ];
7043
7043
  }
7044
- function Ia() {
7044
+ function Oa() {
7045
7045
  return [
7046
7046
  {
7047
7047
  name: 'voice_id',
7048
7048
  type: 'string',
7049
- default: jt,
7050
- description: `text_to_speech: the ElevenLabs voice id, one of: ${Pa}.`,
7049
+ default: zt,
7050
+ description: `text_to_speech: the ElevenLabs voice id, one of: ${Aa}.`,
7051
7051
  },
7052
7052
  {
7053
7053
  name: 'turns',
@@ -7066,7 +7066,7 @@ function Ia() {
7066
7066
  },
7067
7067
  ];
7068
7068
  }
7069
- function zt(e) {
7069
+ function Yt(e) {
7070
7070
  let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
7071
7071
  i = [
7072
7072
  {
@@ -7081,26 +7081,26 @@ function zt(e) {
7081
7081
  required: !0,
7082
7082
  ...(e.modeRequired ? {} : { default: e.modes[0] }),
7083
7083
  options: [...e.modes],
7084
- description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ka[a]).join(' ')}`,
7084
+ description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => Sa[a]).join(' ')}`,
7085
7085
  },
7086
7086
  ];
7087
7087
  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()),
7088
+ e.kind === 'video' ? i.push(...Ca(e)) : e.kind === 'image' ? i.push(...$a(e)) : i.push(...Oa()),
7089
+ e.modes.includes('motion_control') && i.push(...Ea()),
7090
7090
  e.seed &&
7091
7091
  i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
7092
7092
  i
7093
7093
  );
7094
7094
  }
7095
7095
  var L,
7096
- ka,
7097
- Pa,
7098
- Jt = h(() => {
7096
+ Sa,
7097
+ Aa,
7098
+ Xt = h(() => {
7099
7099
  'use strict';
7100
7100
  Fe();
7101
7101
  ((L =
7102
7102
  '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 = {
7103
+ (Sa = {
7104
7104
  text_to_video: 'text_to_video: from the prompt alone.',
7105
7105
  image_to_video: 'image_to_video: a start image in first_frame_image.',
7106
7106
  first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
@@ -7112,34 +7112,60 @@ var L,
7112
7112
  motion_control:
7113
7113
  'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
7114
7114
  }));
7115
- Pa = Object.entries(Ne)
7115
+ Aa = Object.entries(Ve)
7116
7116
  .map(([e, t]) => `${e} (${t})`)
7117
7117
  .join(', ');
7118
7118
  });
7119
- var he,
7120
- Wt,
7121
- X,
7122
- Yt,
7123
- Sn,
7124
- Cn,
7125
- $n,
7126
- En,
7127
- Xt = h(() => {
7119
+ function ei(e) {
7120
+ return e === ge || e === he;
7121
+ }
7122
+ var ge,
7123
+ Qt,
7124
+ he,
7125
+ Zt,
7126
+ Be,
7127
+ ti,
7128
+ Un,
7129
+ Fn,
7130
+ Bn,
7131
+ jn,
7132
+ ii = h(() => {
7133
+ 'use strict';
7134
+ ((ge = 'enhancor-ultrafine'),
7135
+ (Qt = 'Enhancor Ultrafine'),
7136
+ (he = 'enhancor-deblur'),
7137
+ (Zt = 'Enhancor Deblur'));
7138
+ ((Be = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7139
+ (ti = 2),
7140
+ (Un = 24 * 1024 * 1024),
7141
+ (Fn = 4096 * 4096),
7142
+ (Bn = 30 * 6e4),
7143
+ (jn = 120 * 6e4));
7144
+ });
7145
+ var qa,
7146
+ ai,
7147
+ Ra,
7148
+ je,
7149
+ ri = h(() => {
7128
7150
  '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));
7151
+ ((qa = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
7152
+ (ai = {
7153
+ natural: 'Natural',
7154
+ pores: 'Pores',
7155
+ freckles: 'Freckles',
7156
+ more_freckles: 'More freckles',
7157
+ blemish: 'Blemish',
7158
+ glow: 'Glow',
7159
+ unblur: 'Unblur',
7160
+ }),
7161
+ (Ra = 'unblur'),
7162
+ (je = qa.filter((e) => e !== Ra)));
7137
7163
  });
7138
- var Q,
7164
+ var X,
7139
7165
  ye,
7140
- Be = h(() => {
7166
+ Ge = h(() => {
7141
7167
  'use strict';
7142
- ((Q = [
7168
+ ((X = [
7143
7169
  'seedance-2-5',
7144
7170
  'seedance-2-5-flash',
7145
7171
  'seedance-2',
@@ -7154,10 +7180,10 @@ var Q,
7154
7180
  (ye =
7155
7181
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
7156
7182
  });
7157
- function Z(e) {
7183
+ function Q(e) {
7158
7184
  return `$${Number(e.toFixed(5))}`;
7159
7185
  }
7160
- function Ma(e) {
7186
+ function Na(e) {
7161
7187
  if (e.kind === 'llm') {
7162
7188
  let t = e.defaultEndpoint,
7163
7189
  i = (s) =>
@@ -7170,19 +7196,19 @@ function Ma(e) {
7170
7196
  a = i('input'),
7171
7197
  n = i('output');
7172
7198
  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`;
7199
+ ? `${Q(a.price.starter)}/M in \xB7 ${Q(n.price.starter)}/M out`
7200
+ : `from ${Q(ue(e).price.starter)}/M tokens`;
7175
7201
  }
7176
- return `from ${Z(me(e).price.starter)}${e.unit}`;
7202
+ return `from ${Q(ue(e).price.starter)}${e.unit}`;
7177
7203
  }
7178
- function Ka(e, t) {
7204
+ function Va(e, t) {
7179
7205
  let i = t.filter((a) => Number.isFinite(a) && a > 0);
7180
- return i.length ? `from ${Z(Math.min(...i))}${e}` : null;
7206
+ return i.length ? `from ${Q(Math.min(...i))}${e}` : null;
7181
7207
  }
7182
- function ii(e) {
7208
+ function li(e) {
7183
7209
  for (let t of J) {
7184
7210
  let i = ke[t],
7185
- a = i ? Ka(i.unit, e[t] ?? []) : null;
7211
+ a = i ? Va(i.unit, e[t] ?? []) : null;
7186
7212
  i && a && (i.priceFormatted = a);
7187
7213
  }
7188
7214
  }
@@ -7193,14 +7219,14 @@ function A(e, t) {
7193
7219
  return {
7194
7220
  name: 'resolution',
7195
7221
  type: 'select',
7196
- default: me(e).resolution ?? i[0],
7222
+ default: ue(e).resolution ?? i[0],
7197
7223
  options: i,
7198
7224
  ...(t ? { description: t } : {}),
7199
7225
  };
7200
7226
  }
7201
- function ai(e) {
7227
+ function di(e) {
7202
7228
  if (!e.endpoints?.length) return null;
7203
- let t = e.endpoints.filter((i) => $t(e.slug, i.id));
7229
+ let t = e.endpoints.filter((i) => Ot(e.slug, i.id));
7204
7230
  return {
7205
7231
  name: 'endpoint',
7206
7232
  type: 'select',
@@ -7213,20 +7239,20 @@ function ai(e) {
7213
7239
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
7214
7240
  };
7215
7241
  }
7216
- function Ca(e, t) {
7242
+ function Fa(e, t) {
7217
7243
  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];
7244
+ let i = X.includes(e.api.model);
7245
+ return [...t.filter((a) => !be.has(a.name)), i ? Qe : Ua];
7220
7246
  }
7221
- function je(e, t) {
7247
+ function He(e, t) {
7222
7248
  let i = e.filter((n) => !be.has(n.name)),
7223
- a = [We, ri];
7224
- return (a.push(Ye, Xe), [...i, ...a]);
7249
+ a = [Qe, pi];
7250
+ return (a.push(Ze, et), [...i, ...a]);
7225
7251
  }
7226
- function Oa(e) {
7252
+ function Ha(e) {
7227
7253
  return [
7228
7254
  ...e
7229
- .filter((t) => !Ea.has(t.name) && !be.has(t.name))
7255
+ .filter((t) => !ja.has(t.name) && !be.has(t.name))
7230
7256
  .map((t) => {
7231
7257
  if (t.name === 'resolution')
7232
7258
  return {
@@ -7238,30 +7264,30 @@ function Oa(e) {
7238
7264
  ),
7239
7265
  }
7240
7266
  : {}),
7241
- description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${ee}`,
7267
+ description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Z}`,
7242
7268
  };
7243
- let i = Aa[t.name];
7269
+ let i = Ga[t.name];
7244
7270
  return i && typeof t.description == 'string'
7245
7271
  ? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
7246
7272
  : t;
7247
7273
  }),
7248
- We,
7249
- ri,
7250
- Ye,
7251
- Xe,
7274
+ Qe,
7275
+ pi,
7276
+ Ze,
7277
+ et,
7252
7278
  ];
7253
7279
  }
7254
- function ni(e) {
7280
+ function ci(e) {
7255
7281
  return (
7256
7282
  e.startsWith('seedance-2-5-') &&
7257
7283
  e !== 'seedance-2-5-lite' &&
7258
7284
  !/-(creative-mode|unfiltered|uncensored)$/.test(e)
7259
7285
  );
7260
7286
  }
7261
- function Qt(e, t = {}) {
7287
+ function ni(e, t = {}) {
7262
7288
  return [
7263
7289
  ...e
7264
- .filter((i) => !$a.has(i.name) && !be.has(i.name))
7290
+ .filter((i) => !Ba.has(i.name) && !be.has(i.name))
7265
7291
  .map((i) =>
7266
7292
  i.name === 'prompt'
7267
7293
  ? { ...i, required: !0 }
@@ -7271,7 +7297,7 @@ function Qt(e, t = {}) {
7271
7297
  ...(t.no4k && i.options
7272
7298
  ? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
7273
7299
  : {}),
7274
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ee}`,
7300
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Z}`,
7275
7301
  }
7276
7302
  : i,
7277
7303
  ),
@@ -7282,13 +7308,13 @@ function Qt(e, t = {}) {
7282
7308
  options: ['standard'],
7283
7309
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
7284
7310
  },
7285
- Ye,
7286
- Xe,
7311
+ Ze,
7312
+ et,
7287
7313
  ];
7288
7314
  }
7289
- function Ge(e, t) {
7315
+ function ze(e, t) {
7290
7316
  return [
7291
- C('Text prompt describing the video.'),
7317
+ E('Text prompt describing the video.'),
7292
7318
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
7293
7319
  {
7294
7320
  name: 'duration',
@@ -7315,10 +7341,10 @@ function Ge(e, t) {
7315
7341
  ),
7316
7342
  ];
7317
7343
  }
7318
- function qa(e) {
7319
- let t = ai(e);
7344
+ function za(e) {
7345
+ let t = di(e);
7320
7346
  return [
7321
- C('Image prompt text. Supports complex composition and text instructions.'),
7347
+ E('Image prompt text. Supports complex composition and text instructions.'),
7322
7348
  ...(t ? [t] : []),
7323
7349
  {
7324
7350
  name: 'quality',
@@ -7329,14 +7355,14 @@ function qa(e) {
7329
7355
  A(
7330
7356
  e,
7331
7357
  e.slug === 'gpt-image-2'
7332
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${bt}`
7358
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${xt}`
7333
7359
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
7334
7360
  ),
7335
7361
  {
7336
7362
  name: 'aspect_ratio',
7337
7363
  type: 'select',
7338
7364
  default: 'auto',
7339
- options: [...yt],
7365
+ options: [...wt],
7340
7366
  description:
7341
7367
  "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
7368
  },
@@ -7383,15 +7409,15 @@ function qa(e) {
7383
7409
  },
7384
7410
  ];
7385
7411
  }
7386
- function Ra(e) {
7412
+ function Ja(e) {
7387
7413
  return [
7388
- C('Image prompt text.'),
7414
+ E('Image prompt text.'),
7389
7415
  {
7390
7416
  name: 'input_images',
7391
7417
  type: 'string[]',
7392
7418
  description: 'Images to edit or use as reference (up to 14).',
7393
7419
  },
7394
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...At(e.slug)] },
7420
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Rt(e.slug)] },
7395
7421
  A(e),
7396
7422
  {
7397
7423
  name: 'n',
@@ -7417,10 +7443,10 @@ function Ra(e) {
7417
7443
  },
7418
7444
  ];
7419
7445
  }
7420
- function Na() {
7421
- let e = qt,
7446
+ function Qa() {
7447
+ let e = Dt,
7422
7448
  t = [];
7423
- for (let i of Qe(!0))
7449
+ for (let i of tt(!0))
7424
7450
  e.includes(i.name) &&
7425
7451
  (t.push({
7426
7452
  ...i,
@@ -7442,14 +7468,14 @@ function Na() {
7442
7468
  }));
7443
7469
  return t;
7444
7470
  }
7445
- function Ua() {
7446
- return Qe(!0).map((e) =>
7471
+ function Za() {
7472
+ return tt(!0).map((e) =>
7447
7473
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
7448
7474
  );
7449
7475
  }
7450
- function Qe(e) {
7476
+ function tt(e) {
7451
7477
  return [
7452
- C('The user message or task.'),
7478
+ E('The user message or task.'),
7453
7479
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
7454
7480
  {
7455
7481
  name: 'messages',
@@ -7542,21 +7568,21 @@ function Qe(e) {
7542
7568
  },
7543
7569
  ];
7544
7570
  }
7545
- function Fa(e) {
7546
- if (e.slug === 'seed-2-1-turbo') return Da;
7547
- let t = ai(e);
7571
+ function er(e) {
7572
+ if (e.slug === 'seed-2-1-turbo') return Ya;
7573
+ let t = di(e);
7548
7574
  return [
7549
7575
  ...(e.slug === 'gemini-3.1-pro-preview'
7550
- ? Na()
7576
+ ? Qa()
7551
7577
  : 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),
7578
+ ? Za()
7579
+ : e.slug === 'gpt-6-astra' || Xa.includes(e.slug)
7580
+ ? tt(e.slug !== 'gpt-6-astra')
7581
+ : Wa),
7556
7582
  ...(t ? [t] : []),
7557
7583
  ];
7558
7584
  }
7559
- function He() {
7585
+ function Je() {
7560
7586
  return {
7561
7587
  name: 'image',
7562
7588
  type: 'string',
@@ -7564,7 +7590,7 @@ function He() {
7564
7590
  description: 'The photo to fix: one JPEG or PNG URL.',
7565
7591
  };
7566
7592
  }
7567
- function ja(e) {
7593
+ function ir(e) {
7568
7594
  return [
7569
7595
  {
7570
7596
  name: 'video_url',
@@ -7586,7 +7612,7 @@ function ja(e) {
7586
7612
  },
7587
7613
  ];
7588
7614
  }
7589
- function Ga() {
7615
+ function ar() {
7590
7616
  return [
7591
7617
  {
7592
7618
  name: 'mode',
@@ -7657,33 +7683,33 @@ function Ga() {
7657
7683
  },
7658
7684
  ];
7659
7685
  }
7660
- function Ha(e) {
7686
+ function rr(e) {
7661
7687
  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);
7688
+ if (e.family === 'tein-labs' && e.kind === 'image') return ar();
7689
+ if (de.some((a) => a.slug === t)) return ir(e);
7690
+ if (e.kind === 'llm') return er(e);
7691
+ if (e.editVariants?.length) return za(e);
7692
+ let i = fe(t);
7693
+ if (i) return Yt(i);
7694
+ if (ci(t)) return Ha(We);
7669
7695
  switch (t) {
7670
7696
  case 'seedance-2-5':
7671
- return je(ze, t);
7697
+ return He(We, t);
7672
7698
  case 'seedance-2-5-lite':
7673
- return Qt(ze, { no4k: !0 });
7699
+ return ni(We, { no4k: !0 });
7674
7700
  case 'seedance-2':
7675
- return je(Zt, t);
7701
+ return He(si, t);
7676
7702
  case 'seedance-2-lite':
7677
- return Qt(Zt);
7703
+ return ni(si);
7678
7704
  case 'seedance-2-mini':
7679
- return je(za, t);
7705
+ return He(nr, t);
7680
7706
  case 'nano-banana-2':
7681
7707
  case 'nano-banana-2.1':
7682
7708
  case 'nano-banana-pro':
7683
- return Ra(e);
7709
+ return Ja(e);
7684
7710
  case 'seedream-5-pro':
7685
7711
  return [
7686
- C('Detailed description of the image to generate.'),
7712
+ E('Detailed description of the image to generate.'),
7687
7713
  { name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
7688
7714
  A(e),
7689
7715
  {
@@ -7697,7 +7723,7 @@ function Ha(e) {
7697
7723
  case 'minimax-h3-image':
7698
7724
  case 'minimax-h3-image-highspeed':
7699
7725
  return [
7700
- C('What to make, or how to change the reference images.'),
7726
+ E('What to make, or how to change the reference images.'),
7701
7727
  {
7702
7728
  name: 'images',
7703
7729
  type: 'string[]',
@@ -7743,7 +7769,7 @@ function Ha(e) {
7743
7769
  description:
7744
7770
  '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
7771
  },
7746
- C(
7772
+ E(
7747
7773
  '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
7774
  ),
7749
7775
  {
@@ -7792,7 +7818,7 @@ function Ha(e) {
7792
7818
  case 'qwen-3':
7793
7819
  case 'qwen-3-pro':
7794
7820
  return [
7795
- C('Image prompt text; dense layouts and multilingual text work well.'),
7821
+ E('Image prompt text; dense layouts and multilingual text work well.'),
7796
7822
  {
7797
7823
  name: 'images',
7798
7824
  type: 'string[]',
@@ -7816,7 +7842,7 @@ function Ha(e) {
7816
7842
  ];
7817
7843
  case 'z-image-pro':
7818
7844
  return [
7819
- C('Image prompt text: subject, scene, style, composition and lighting.'),
7845
+ E('Image prompt text: subject, scene, style, composition and lighting.'),
7820
7846
  A(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
7821
7847
  {
7822
7848
  name: 'aspect_ratio',
@@ -7848,7 +7874,7 @@ function Ha(e) {
7848
7874
  ];
7849
7875
  case 'wan-2-5-image':
7850
7876
  return [
7851
- C('Image prompt, or for an edit the change to make (up to 2000 characters).'),
7877
+ E('Image prompt, or for an edit the change to make (up to 2000 characters).'),
7852
7878
  {
7853
7879
  name: 'images',
7854
7880
  type: 'string[]',
@@ -7914,7 +7940,7 @@ function Ha(e) {
7914
7940
  ];
7915
7941
  case 'enhancor-skin-fix-v1':
7916
7942
  return [
7917
- He(),
7943
+ Je(),
7918
7944
  {
7919
7945
  name: 'mode',
7920
7946
  type: 'select',
@@ -7947,11 +7973,11 @@ function Ha(e) {
7947
7973
  max: 0.4,
7948
7974
  description: 'Portrait depth. Heavy only.',
7949
7975
  },
7950
- ...Ba,
7976
+ ...tr,
7951
7977
  ];
7952
7978
  case 'enhancor-skin-fix-v3':
7953
7979
  return [
7954
- He(),
7980
+ Je(),
7955
7981
  {
7956
7982
  name: 'mask_image',
7957
7983
  type: 'string',
@@ -7991,7 +8017,7 @@ function Ha(e) {
7991
8017
  ];
7992
8018
  case 'enhancor-skin-fix-v4':
7993
8019
  return [
7994
- He(),
8020
+ Je(),
7995
8021
  {
7996
8022
  name: 'mode',
7997
8023
  type: 'select',
@@ -8022,7 +8048,7 @@ function Ha(e) {
8022
8048
  ];
8023
8049
  case 'wan-3-0':
8024
8050
  case 'wan-3-0-prime':
8025
- return Ge(e, {
8051
+ return ze(e, {
8026
8052
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8027
8053
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
8028
8054
  minSec: 2,
@@ -8032,7 +8058,7 @@ function Ha(e) {
8032
8058
  });
8033
8059
  case 'happy-horse-1-1':
8034
8060
  case 'happy-horse-1-0':
8035
- return Ge(e, {
8061
+ return ze(e, {
8036
8062
  modes:
8037
8063
  t === 'happy-horse-1-0'
8038
8064
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -8044,7 +8070,7 @@ function Ha(e) {
8044
8070
  });
8045
8071
  case 'gemini-omni-1.2-flash':
8046
8072
  return [
8047
- C(
8073
+ E(
8048
8074
  '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
8075
  ),
8050
8076
  {
@@ -8103,7 +8129,7 @@ function Ha(e) {
8103
8129
  },
8104
8130
  ];
8105
8131
  case 'minimax-h3':
8106
- return Ge(e, {
8132
+ return ze(e, {
8107
8133
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8108
8134
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
8109
8135
  minSec: 4,
@@ -8111,10 +8137,10 @@ function Ha(e) {
8111
8137
  references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
8112
8138
  });
8113
8139
  default:
8114
- return [C('Prompt text.')];
8140
+ return [E('Prompt text.')];
8115
8141
  }
8116
8142
  }
8117
- function Ja() {
8143
+ function fi() {
8118
8144
  let e = (t, i) => ({
8119
8145
  name: t,
8120
8146
  type: 'slider',
@@ -8125,95 +8151,103 @@ function Ja() {
8125
8151
  description: `${i} 0 to 100. 50 is the default look.`,
8126
8152
  });
8127
8153
  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
8154
  e(
8131
8155
  'grain',
8132
- 'Grain: fine noise over the photo. Works in Fast and Full, with or without skin_fix.',
8156
+ 'Grain: fine noise over the photo. Works in Fast and Full, with or without a preset.',
8133
8157
  ),
8134
8158
  e(
8135
8159
  'sharpness',
8136
- 'Sharpness: how crisp the edges are. Works in Fast and Full, with or without skin_fix.',
8160
+ 'Sharpness: how crisp the edges are. Works in Fast and Full, with or without a preset.',
8137
8161
  ),
8138
8162
  ];
8139
8163
  }
8140
- function Wa() {
8164
+ function gi(e) {
8141
8165
  return {
8142
- slug: he,
8143
- name: Wt,
8166
+ name: 'image',
8167
+ type: 'string',
8168
+ required: !0,
8169
+ description: `The photo to ${e}: 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.`,
8170
+ };
8171
+ }
8172
+ function sr() {
8173
+ return {
8174
+ slug: ge,
8175
+ name: Qt,
8144
8176
  category: 'Image',
8145
8177
  kind: 'Image-to-Image',
8146
8178
  vendor: 'Enhancor',
8147
8179
  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).',
8180
+ 'Upscales a photo, with an optional skin preset that gives AI or smooth skin real texture first (Natural, Pores, Freckles, More freckles, Blemish, Glow). Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). For a blurry photo use Enhancor Deblur (enhancor-deblur).',
8149
8181
  priceFormatted: '',
8150
8182
  unit: '/img',
8151
- primaryToolName: ti.image,
8183
+ primaryToolName: Xe.image,
8152
8184
  parameters: [
8185
+ gi('upscale'),
8153
8186
  {
8154
- name: 'image',
8155
- type: 'string',
8156
- required: !0,
8157
- description:
8158
- "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.",
8187
+ name: 'preset',
8188
+ type: 'select',
8189
+ options: [...je],
8190
+ description: `Skin preset, run before the upscale: ${je.map((e) => `${e} (${ai[e]})`).join(', ')}. Seedream 5.5 redraws the skin at about the photo's own size and shape, keeping the person, the background and any text; that picture is brought back to the photo's size and upscaled, so the output is still the photo times the scale. Priced at the skin rate. Leave it out for a plain upscale.`,
8159
8191
  },
8160
8192
  {
8161
8193
  name: 'skin_fix',
8162
8194
  type: 'boolean',
8163
8195
  default: !1,
8164
- description: 'Also fixes the skin. Off by default.',
8165
- },
8166
- {
8167
- name: 'mode',
8168
- type: 'select',
8169
- default: 'full',
8170
- options: ['full', 'fast'],
8171
- description:
8172
- 'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum.',
8173
- },
8174
- {
8175
- name: 'scale',
8176
- 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.`,
8196
+ description: 'Same as preset natural. Off by default.',
8180
8197
  },
8181
- ...Ja(),
8198
+ hi,
8199
+ yi,
8200
+ ...fi(),
8182
8201
  ],
8183
8202
  };
8184
8203
  }
8185
- function Je(e, t = e.api.model) {
8204
+ function or() {
8205
+ return {
8206
+ slug: he,
8207
+ name: Zt,
8208
+ category: 'Image',
8209
+ kind: 'Image-to-Image',
8210
+ vendor: 'Enhancor',
8211
+ description:
8212
+ 'Sharpens a blurry or soft photo and upscales it: Seedream 5.5 unblurs the photo at about its own size and shape, keeping the same person, face, freckles and moles, then that picture is upscaled. Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). No prompt.',
8213
+ priceFormatted: '',
8214
+ unit: '/img',
8215
+ primaryToolName: Xe.image,
8216
+ parameters: [gi('deblur'), hi, yi, ...fi()],
8217
+ };
8218
+ }
8219
+ function Ye(e, t = e.api.model) {
8186
8220
  return {
8187
8221
  slug: t,
8188
8222
  name: e.name,
8189
- category: va[e.kind],
8190
- kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Ta[e.kind],
8223
+ category: La[e.kind],
8224
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Da[e.kind],
8191
8225
  vendor: e.vendor ?? '',
8192
8226
  description: e.desc ?? e.name,
8193
- priceFormatted: Ma(e),
8227
+ priceFormatted: Na(e),
8194
8228
  unit: e.unit,
8195
- primaryToolName: ti[e.kind],
8196
- parameters: Ca(e, Ha(e)),
8229
+ primaryToolName: Xe[e.kind],
8230
+ parameters: Fa(e, rr(e)),
8197
8231
  };
8198
8232
  }
8199
- function Ya() {
8233
+ function lr() {
8200
8234
  let e = {};
8201
- for (let t of ue())
8235
+ for (let t of ce())
8202
8236
  if (t.slug !== 'seedance-2-fast') {
8203
8237
  if (t.slug === 'seedance-2-mini') {
8204
- e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
8238
+ e['seedance-2-mini'] = Ye(t, 'seedance-2-mini');
8205
8239
  continue;
8206
8240
  }
8207
8241
  if (t.slug === 'seedance-2') {
8208
- let i = Je(t);
8242
+ let i = Ye(t);
8209
8243
  ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
8210
8244
  (e['seedance-2'] = i));
8211
8245
  continue;
8212
8246
  }
8213
- t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
8247
+ t.slug.startsWith('claude-') || (e[t.api.model] = Ye(t));
8214
8248
  }
8215
- (Object.assign(e, Nt()), (e[he] = Wa()));
8216
- for (let [t, i] of Object.entries(fe))
8249
+ (Object.assign(e, Bt()), (e[ge] = sr()), (e[he] = or()));
8250
+ for (let [t, i] of Object.entries(me))
8217
8251
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
8218
8252
  return e;
8219
8253
  }
@@ -8223,145 +8257,148 @@ function we(e) {
8223
8257
  function H(e) {
8224
8258
  return ke[e] ?? null;
8225
8259
  }
8226
- function Xa(e, t, i) {
8260
+ function dr(e, t, i) {
8227
8261
  if (
8228
8262
  e.startsWith('enhancor-skin-fix-') ||
8229
- e === he ||
8263
+ ei(e) ||
8230
8264
  (e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
8231
8265
  )
8232
8266
  return !1;
8233
- if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ni(e)) && t === 'duration') {
8267
+ if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ci(e)) && t === 'duration') {
8234
8268
  let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
8235
8269
  if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
8236
8270
  }
8237
8271
  if (
8238
- (t === 'max_tokens' && ei(i.max_completion_tokens)) ||
8239
- (t === 'max_completion_tokens' && ei(i.max_tokens))
8272
+ (t === 'max_tokens' && oi(i.max_completion_tokens)) ||
8273
+ (t === 'max_completion_tokens' && oi(i.max_tokens))
8240
8274
  )
8241
8275
  return !1;
8242
8276
  if (t === 'aspect_ratio') {
8243
- let n = ge(e);
8277
+ let n = fe(e);
8244
8278
  if (n) {
8245
8279
  let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8246
8280
  o = s ? s.replace(/-/g, '_') : n.modes[0];
8247
- if (n.modes.includes(o) && !Gt(n, o)) return !1;
8281
+ if (n.modes.includes(o) && !Jt(n, o)) return !1;
8248
8282
  }
8249
8283
  }
8250
- let a = ge(e);
8284
+ let a = fe(e);
8251
8285
  if (a) {
8252
8286
  let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8253
8287
  s = n ? n.replace(/-/g, '_') : a.modes[0];
8254
- if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
8288
+ if (a.modes.includes(s) && !Wt(a, s, t)) return !1;
8255
8289
  }
8256
8290
  return !0;
8257
8291
  }
8258
- function ei(e) {
8292
+ function oi(e) {
8259
8293
  return e != null && e !== '';
8260
8294
  }
8261
- function li(e, t) {
8295
+ function bi(e, t) {
8262
8296
  let i = { ...t };
8263
8297
  if (e?.slug === 'seedance-2-5') {
8264
8298
  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]);
8299
+ for (let n of pr) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
8266
8300
  if (!a(i.finalize)) return i;
8267
8301
  }
8268
8302
  for (let a of e?.parameters ?? [])
8269
8303
  a.default !== void 0 &&
8270
8304
  i[a.name] === void 0 &&
8271
- Xa(e.slug, a.name, t) &&
8305
+ dr(e.slug, a.name, t) &&
8272
8306
  (i[a.name] = a.default);
8273
8307
  return i;
8274
8308
  }
8275
8309
  function D() {
8276
8310
  return Object.values(ke);
8277
8311
  }
8278
- var va,
8279
- ti,
8280
- Ta,
8281
- C,
8282
- We,
8283
- Sa,
8284
- ri,
8285
- Ye,
8312
+ var La,
8286
8313
  Xe,
8287
- be,
8288
- $a,
8289
- Ea,
8290
- Aa,
8291
- La,
8292
8314
  Da,
8293
- Va,
8315
+ E,
8316
+ Qe,
8317
+ Ua,
8318
+ pi,
8319
+ Ze,
8320
+ et,
8321
+ be,
8294
8322
  Ba,
8295
- ee,
8296
- ze,
8323
+ ja,
8324
+ Ga,
8325
+ Wa,
8326
+ Ya,
8327
+ Xa,
8328
+ tr,
8329
+ Z,
8330
+ We,
8331
+ ui,
8332
+ mi,
8297
8333
  si,
8298
- oi,
8299
- Zt,
8300
- za,
8334
+ nr,
8335
+ hi,
8336
+ yi,
8301
8337
  ke,
8302
- Qa,
8303
- te = h(() => {
8338
+ pr,
8339
+ ee = h(() => {
8304
8340
  'use strict';
8305
- kt();
8306
- Ce();
8341
+ _t();
8342
+ Ee();
8307
8343
  G();
8308
8344
  Le();
8309
- $e();
8345
+ Ce();
8310
8346
  De();
8311
- Et();
8312
- Ot();
8313
- Rt();
8314
- Ut();
8347
+ qt();
8348
+ Lt();
8349
+ Nt();
8350
+ jt();
8315
8351
  Fe();
8316
- Jt();
8317
8352
  Xt();
8318
- Be();
8319
- ((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8320
- (ti = {
8353
+ ii();
8354
+ ri();
8355
+ Ge();
8356
+ ((La = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8357
+ (Xe = {
8321
8358
  video: 'generate_video',
8322
8359
  image: 'generate_image',
8323
8360
  audio: 'generate_audio',
8324
8361
  llm: 'run_task',
8325
8362
  }),
8326
- (Ta = {
8363
+ (Da = {
8327
8364
  video: 'Text-to-Video',
8328
8365
  image: 'Text-to-Image',
8329
8366
  audio: 'Text-to-Audio',
8330
8367
  llm: 'Reasoning (LLM)',
8331
8368
  }));
8332
- C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8333
- ((We = {
8369
+ E = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8370
+ ((Qe = {
8334
8371
  name: 'creative_mode',
8335
8372
  type: 'boolean',
8336
8373
  default: !1,
8337
8374
  description:
8338
8375
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
8339
8376
  }),
8340
- (Sa = {
8377
+ (Ua = {
8341
8378
  name: 'creative_mode',
8342
8379
  type: 'boolean',
8343
8380
  default: !1,
8344
8381
  description: `Not available yet on this model: ${ye}.`,
8345
8382
  }),
8346
- (ri = {
8383
+ (pi = {
8347
8384
  name: 'priority',
8348
8385
  type: 'boolean',
8349
8386
  default: !1,
8350
8387
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
8351
8388
  }),
8352
- (Ye = {
8389
+ (Ze = {
8353
8390
  name: 'reference_roles',
8354
8391
  type: 'json',
8355
8392
  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
8393
  }),
8357
- (Xe = {
8394
+ (et = {
8358
8395
  name: 'auto_fit_images',
8359
8396
  type: 'boolean',
8360
8397
  description:
8361
8398
  '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
8399
  }),
8363
8400
  (be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8364
- (($a = new Set([
8401
+ ((Ba = new Set([
8365
8402
  'quality',
8366
8403
  'bitrate_mode',
8367
8404
  'draft',
@@ -8370,7 +8407,7 @@ var va,
8370
8407
  'draft_generation_id',
8371
8408
  'pass_faces',
8372
8409
  ])),
8373
- (Ea = new Set([
8410
+ (ja = new Set([
8374
8411
  'quality',
8375
8412
  'bitrate_mode',
8376
8413
  'draft',
@@ -8378,13 +8415,13 @@ var va,
8378
8415
  'draft_task_id',
8379
8416
  'draft_generation_id',
8380
8417
  ])),
8381
- (Aa = {
8418
+ (Ga = {
8382
8419
  images: 'up to 10',
8383
8420
  videos: 'up to 5; combined duration < 30s',
8384
8421
  audios: 'up to 5; combined duration < 30s',
8385
8422
  }));
8386
- ((La = [
8387
- C('The user message or task.'),
8423
+ ((Wa = [
8424
+ E('The user message or task.'),
8388
8425
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8389
8426
  {
8390
8427
  name: 'messages',
@@ -8401,8 +8438,8 @@ var va,
8401
8438
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
8402
8439
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
8403
8440
  ]),
8404
- (Da = [
8405
- C('The user message or task.'),
8441
+ (Ya = [
8442
+ E('The user message or task.'),
8406
8443
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8407
8444
  {
8408
8445
  name: 'messages',
@@ -8483,8 +8520,8 @@ var va,
8483
8520
  description: 'Video frames read a second.',
8484
8521
  },
8485
8522
  ]),
8486
- (Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8487
- Ba = Object.entries({
8523
+ (Xa = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8524
+ tr = Object.entries({
8488
8525
  background: !1,
8489
8526
  skin: !1,
8490
8527
  nose: !1,
@@ -8510,8 +8547,8 @@ var va,
8510
8547
  default: t,
8511
8548
  description: 'Keep this part out of the fix. Standard only.',
8512
8549
  }));
8513
- ((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8514
- (ze = [
8550
+ ((Z = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8551
+ (We = [
8515
8552
  {
8516
8553
  name: 'prompt',
8517
8554
  type: 'string',
@@ -8549,7 +8586,7 @@ var va,
8549
8586
  type: 'select',
8550
8587
  default: '480p',
8551
8588
  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}`,
8589
+ 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
8590
  },
8554
8591
  {
8555
8592
  name: 'aspect_ratio',
@@ -8660,19 +8697,19 @@ var va,
8660
8697
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8661
8698
  },
8662
8699
  ]),
8663
- (si = {
8700
+ (ui = {
8664
8701
  name: 'images',
8665
8702
  type: 'string[]',
8666
8703
  description:
8667
8704
  '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
8705
  }),
8669
- (oi = {
8706
+ (mi = {
8670
8707
  name: 'audios',
8671
8708
  type: 'string[]',
8672
8709
  description:
8673
8710
  '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
8711
  }),
8675
- (Zt = [
8712
+ (si = [
8676
8713
  {
8677
8714
  name: 'prompt',
8678
8715
  type: 'string',
@@ -8716,7 +8753,7 @@ var va,
8716
8753
  type: 'select',
8717
8754
  default: '480p',
8718
8755
  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}`,
8756
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Z}`,
8720
8757
  },
8721
8758
  {
8722
8759
  name: 'bitrate_mode',
@@ -8750,8 +8787,8 @@ var va,
8750
8787
  description:
8751
8788
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8752
8789
  },
8753
- si,
8754
- oi,
8790
+ ui,
8791
+ mi,
8755
8792
  {
8756
8793
  name: 'first_frame_image',
8757
8794
  type: 'string',
@@ -8772,7 +8809,7 @@ var va,
8772
8809
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8773
8810
  },
8774
8811
  ]),
8775
- (za = [
8812
+ (nr = [
8776
8813
  {
8777
8814
  name: 'prompt',
8778
8815
  type: 'string',
@@ -8793,7 +8830,7 @@ var va,
8793
8830
  type: 'select',
8794
8831
  default: '480p',
8795
8832
  options: ['480p', '720p'],
8796
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ee}`,
8833
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Z}`,
8797
8834
  },
8798
8835
  {
8799
8836
  name: 'bitrate_mode',
@@ -8827,8 +8864,8 @@ var va,
8827
8864
  description:
8828
8865
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8829
8866
  },
8830
- si,
8831
- oi,
8867
+ ui,
8868
+ mi,
8832
8869
  {
8833
8870
  name: 'first_frame_image',
8834
8871
  type: 'string',
@@ -8843,53 +8880,68 @@ var va,
8843
8880
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8844
8881
  },
8845
8882
  ]));
8846
- ke = Ya();
8847
- Qa = ['draft_task_id', 'draft_generation_id'];
8883
+ ((hi = {
8884
+ name: 'mode',
8885
+ type: 'select',
8886
+ default: 'full',
8887
+ options: ['full', 'fast'],
8888
+ description:
8889
+ 'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum: the first 10 MP at one rate, every MP past 10 at a lower one (get_pricing).',
8890
+ }),
8891
+ (yi = {
8892
+ name: 'scale',
8893
+ type: 'select',
8894
+ default: String(ti),
8895
+ options: Be.noSkin.map(String),
8896
+ description: `Full only: ${Be.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
8897
+ }));
8898
+ ke = lr();
8899
+ pr = ['draft_task_id', 'draft_generation_id'];
8848
8900
  });
8849
8901
  function xe(e) {
8850
8902
  let t = '/v1/pricing/models',
8851
8903
  i = e?.trim();
8852
8904
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
8853
8905
  }
8854
- var tt = h(() => {
8906
+ var rt = h(() => {
8855
8907
  'use strict';
8856
8908
  });
8857
- function Ti(e) {
8909
+ function Ri(e) {
8858
8910
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
8859
8911
  }
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);
8912
+ function Li(e) {
8913
+ let t = ce().filter((s) => s.kind === e && s.unfiltered != null),
8914
+ i = t.filter((s) => X.includes(s.api.model)).map((s) => s.name),
8915
+ a = t.filter((s) => !X.includes(s.api.model)).map((s) => s.name);
8864
8916
  return [
8865
8917
  ...(i.length
8866
- ? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8918
+ ? [`${Ri(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8867
8919
  : []),
8868
- ...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
8920
+ ...(a.length ? [`Not available yet on ${Ri(a)}: ${ye}.`] : []),
8869
8921
  'The Acceptable Use Policy applies.',
8870
8922
  ].join(' ');
8871
8923
  }
8872
- function Kr(e) {
8873
- if (Pr.has(e.name)) return e;
8924
+ function Vr(e) {
8925
+ if (qr.has(e.name)) return e;
8874
8926
  let t = e.inputSchema.properties;
8875
8927
  return !t || t.callback_url
8876
8928
  ? e
8877
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
8929
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: Or } } };
8878
8930
  }
8879
- function Sr(e) {
8931
+ function Ur(e) {
8880
8932
  let t = e.inputSchema.properties;
8881
8933
  if (!t) return e;
8882
8934
  let i = !1,
8883
8935
  a = {};
8884
8936
  for (let [n, s] of Object.entries(t))
8885
- Ki.has(n) && s.type === 'string' && !s.format
8937
+ Di.has(n) && s.type === 'string' && !s.format
8886
8938
  ? ((a[n] = { ...s, format: 'uri' }), (i = !0))
8887
- : Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8939
+ : Di.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8888
8940
  ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
8889
8941
  : (a[n] = s);
8890
8942
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
8891
8943
  }
8892
- function Cr(e) {
8944
+ function Fr(e) {
8893
8945
  switch (e.type) {
8894
8946
  case 'string':
8895
8947
  return {
@@ -8944,11 +8996,11 @@ function Cr(e) {
8944
8996
  return { type: 'string', description: e.description };
8945
8997
  }
8946
8998
  }
8947
- function $r(e, t) {
8999
+ function Br(e, t) {
8948
9000
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
8949
9001
  a = {},
8950
9002
  n = [];
8951
- for (let o of e.parameters) ((a[o.name] = Cr(o)), o.required && n.push(o.name));
9003
+ for (let o of e.parameters) ((a[o.name] = Fr(o)), o.required && n.push(o.name));
8952
9004
  let s = {
8953
9005
  type: 'object',
8954
9006
  properties: a,
@@ -8961,7 +9013,7 @@ function $r(e, t) {
8961
9013
  inputSchema: s,
8962
9014
  };
8963
9015
  }
8964
- function Er() {
9016
+ function jr() {
8965
9017
  let e = D().filter((p) => p.category === 'Image' && !we(p)),
8966
9018
  t = D().filter((p) => p.category === 'Video'),
8967
9019
  i = D().filter((p) => p.category === 'Text'),
@@ -9052,7 +9104,7 @@ function Er() {
9052
9104
  maximum: 2147483647,
9053
9105
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
9054
9106
  },
9055
- creative_mode: { type: 'boolean', description: Mi('image') },
9107
+ creative_mode: { type: 'boolean', description: Li('image') },
9056
9108
  },
9057
9109
  required: ['prompt'],
9058
9110
  additionalProperties: !0,
@@ -9089,7 +9141,7 @@ function Er() {
9089
9141
  description:
9090
9142
  "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
9143
  },
9092
- creative_mode: { type: 'boolean', description: Mi('video') },
9144
+ creative_mode: { type: 'boolean', description: Li('video') },
9093
9145
  priority: {
9094
9146
  type: 'boolean',
9095
9147
  description:
@@ -9225,10 +9277,10 @@ function Er() {
9225
9277
  additionalProperties: !0,
9226
9278
  },
9227
9279
  },
9228
- d = Ar();
9229
- return [n, s, o, u, l, d, c, Ir, ...Si];
9280
+ d = Gr();
9281
+ return [n, s, o, u, l, d, c, Rr, ...Ni];
9230
9282
  }
9231
- function Ar() {
9283
+ function Gr() {
9232
9284
  return {
9233
9285
  name: 'upload_asset',
9234
9286
  description:
@@ -9275,31 +9327,31 @@ function Ar() {
9275
9327
  },
9276
9328
  };
9277
9329
  }
9278
- function ot() {
9279
- let e = Er(),
9280
- t = D().map((i) => $r(i));
9281
- return [...e, ...t].map(Kr).map(Sr);
9282
- }
9283
- var _r,
9284
- Pr,
9285
- Ir,
9286
- vr,
9287
- Tr,
9288
- Mr,
9289
- Si,
9290
- Rs,
9291
- Ki,
9292
- Ci = h(() => {
9330
+ function pt() {
9331
+ let e = jr(),
9332
+ t = D().map((i) => Br(i));
9333
+ return [...e, ...t].map(Vr).map(Ur);
9334
+ }
9335
+ var Or,
9336
+ qr,
9337
+ Rr,
9338
+ Lr,
9339
+ Dr,
9340
+ Nr,
9341
+ Ni,
9342
+ Ys,
9343
+ Di,
9344
+ Vi = h(() => {
9293
9345
  'use strict';
9294
9346
  G();
9295
- Be();
9296
- te();
9297
- ((_r = {
9347
+ Ge();
9348
+ ee();
9349
+ ((Or = {
9298
9350
  type: 'string',
9299
9351
  description:
9300
9352
  '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
9353
  }),
9302
- (Pr = new Set([
9354
+ (qr = new Set([
9303
9355
  'upload_asset',
9304
9356
  'upload_media',
9305
9357
  'upload_image',
@@ -9310,7 +9362,7 @@ var _r,
9310
9362
  'get_usage',
9311
9363
  'get_balance_history',
9312
9364
  ])),
9313
- (Ir = {
9365
+ (Rr = {
9314
9366
  name: 'get_pricing',
9315
9367
  description:
9316
9368
  '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 +9377,13 @@ var _r,
9325
9377
  additionalProperties: !1,
9326
9378
  },
9327
9379
  }),
9328
- (vr = {
9380
+ (Lr = {
9329
9381
  name: 'get_balance',
9330
9382
  description:
9331
9383
  "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
9384
  inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
9333
9385
  }),
9334
- (Tr = {
9386
+ (Dr = {
9335
9387
  name: 'get_usage',
9336
9388
  description:
9337
9389
  "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 +9414,7 @@ var _r,
9362
9414
  additionalProperties: !1,
9363
9415
  },
9364
9416
  }),
9365
- (Mr = {
9417
+ (Nr = {
9366
9418
  name: 'get_balance_history',
9367
9419
  description:
9368
9420
  "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 +9432,9 @@ var _r,
9380
9432
  additionalProperties: !1,
9381
9433
  },
9382
9434
  }),
9383
- (Si = [vr, Tr, Mr]),
9384
- (Rs = new Set(Si.map((e) => e.name))));
9385
- Ki = new Set([
9435
+ (Ni = [Lr, Dr, Nr]),
9436
+ (Ys = new Set(Ni.map((e) => e.name))));
9437
+ Di = new Set([
9386
9438
  'image',
9387
9439
  'images',
9388
9440
  'image_url',
@@ -9399,19 +9451,19 @@ var _r,
9399
9451
  'lipsyncing_audio',
9400
9452
  ]);
9401
9453
  });
9402
- var Ni = {};
9403
- Ji(Ni, {
9404
- forgetToolSchemas: () => Dr,
9405
- jsonRpcAnswer: () => Oi,
9406
- preprocessLocalFiles: () => Di,
9407
- startStdioServer: () => Vi,
9454
+ var Yi = {};
9455
+ ra(Yi, {
9456
+ forgetToolSchemas: () => Yr,
9457
+ jsonRpcAnswer: () => ji,
9458
+ preprocessLocalFiles: () => Ji,
9459
+ startStdioServer: () => Wi,
9408
9460
  });
9409
- function Or(e) {
9461
+ function Hr(e) {
9410
9462
  let t = (i) =>
9411
9463
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
9412
9464
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
9413
9465
  }
9414
- function Oi(e, t, i) {
9466
+ function ji(e, t, i) {
9415
9467
  let a = e?.id,
9416
9468
  n = a == null,
9417
9469
  s = null;
@@ -9420,7 +9472,7 @@ function Oi(e, t, i) {
9420
9472
  } catch {
9421
9473
  s = null;
9422
9474
  }
9423
- if (s !== null && Or(s)) return n ? null : s;
9475
+ if (s !== null && Hr(s)) return n ? null : s;
9424
9476
  if (n) return null;
9425
9477
  if (!i && t >= 200 && t < 300) return;
9426
9478
  let o = s?.error,
@@ -9441,16 +9493,16 @@ function Oi(e, t, i) {
9441
9493
  },
9442
9494
  };
9443
9495
  }
9444
- function qr() {
9496
+ function zr() {
9445
9497
  let e = process.argv.slice(2),
9446
9498
  t = e.indexOf('--api-key');
9447
9499
  return S(t >= 0 ? e[t + 1] : void 0);
9448
9500
  }
9449
- async function qi(e, t, i) {
9501
+ async function Gi(e, t, i) {
9450
9502
  let a = z.default.resolve(e);
9451
- if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
9503
+ if (!N.default.existsSync(a) || !N.default.statSync(a).isFile())
9452
9504
  throw new Error(`File not found: ${e}`);
9453
- let n = V.default.readFileSync(a),
9505
+ let n = N.default.readFileSync(a),
9454
9506
  s = n.toString('base64'),
9455
9507
  o = n.length,
9456
9508
  u = `${i.replace(/\/$/, '')}/v1/upload`,
@@ -9475,15 +9527,15 @@ async function qi(e, t, i) {
9475
9527
  mimeType: c.mime_type || c.mimeType || 'image/png',
9476
9528
  };
9477
9529
  }
9478
- function Ri(e) {
9479
- return Rr.has(z.default.extname(e).toLowerCase());
9530
+ function Hi(e) {
9531
+ return Jr.has(z.default.extname(e).toLowerCase());
9480
9532
  }
9481
- function Li(e) {
9533
+ function zi(e) {
9482
9534
  return new Error(
9483
9535
  `Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
9484
9536
  );
9485
9537
  }
9486
- function Lr(e) {
9538
+ function Wr(e) {
9487
9539
  let t = e.trim();
9488
9540
  if (
9489
9541
  !t ||
@@ -9494,24 +9546,24 @@ function Lr(e) {
9494
9546
  )
9495
9547
  return null;
9496
9548
  let i = z.default.resolve(t);
9497
- return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
9549
+ return N.default.existsSync(i) && N.default.statSync(i).isFile() ? i : null;
9498
9550
  }
9499
- function dt(e) {
9551
+ function ut(e) {
9500
9552
  if (Array.isArray(e))
9501
9553
  for (let t of e) {
9502
9554
  let i = t;
9503
9555
  typeof i.name == 'string' &&
9504
9556
  i.inputSchema &&
9505
9557
  typeof i.inputSchema == 'object' &&
9506
- re.set(i.name, i.inputSchema);
9558
+ ae.set(i.name, i.inputSchema);
9507
9559
  }
9508
9560
  }
9509
- function Dr() {
9510
- (re.clear(), (lt = 0));
9561
+ function Yr() {
9562
+ (ae.clear(), (ct = 0));
9511
9563
  }
9512
- async function Vr(e, t) {
9513
- if (!(Date.now() - lt < 6e4)) {
9514
- lt = Date.now();
9564
+ async function Xr(e, t) {
9565
+ if (!(Date.now() - ct < 6e4)) {
9566
+ ct = Date.now();
9515
9567
  try {
9516
9568
  let a = await (
9517
9569
  await fetch(e, {
@@ -9521,39 +9573,39 @@ async function Vr(e, t) {
9521
9573
  signal: AbortSignal.timeout(1e4),
9522
9574
  })
9523
9575
  ).json();
9524
- dt(a.result?.tools);
9576
+ ut(a.result?.tools);
9525
9577
  } catch {}
9526
9578
  }
9527
9579
  }
9528
- function Nr(e) {
9580
+ function Qr(e) {
9529
9581
  return e
9530
9582
  ? e.type === 'string'
9531
9583
  ? e.format === 'uri'
9532
9584
  : e.type === 'array' && e.items?.format === 'uri'
9533
9585
  : !1;
9534
9586
  }
9535
- async function $i(e, t, i) {
9587
+ async function Ui(e, t, i) {
9536
9588
  if (typeof e != 'string') return e;
9537
- let a = Lr(e);
9589
+ let a = Wr(e);
9538
9590
  if (!a) return e;
9539
- if (!Ri(a)) throw Li(a);
9540
- return (await qi(a, t, i)).url;
9591
+ if (!Hi(a)) throw zi(a);
9592
+ return (await Gi(a, t, i)).url;
9541
9593
  }
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;
9594
+ async function Ji(e, t, i, a, n) {
9595
+ (ae.size === 0 && ut(pt()), ae.has(e) || (await Xr(n, i)));
9596
+ let s = ae.get(e)?.properties;
9545
9597
  if (!s) return t;
9546
9598
  let o = { ...t };
9547
9599
  for (let [u, l] of Object.entries(t))
9548
- if (Nr(s[u]))
9600
+ if (Qr(s[u]))
9549
9601
  if (Array.isArray(l)) {
9550
9602
  let c = [];
9551
- for (let d of l) c.push(await $i(d, i, a));
9603
+ for (let d of l) c.push(await Ui(d, i, a));
9552
9604
  o[u] = c;
9553
- } else o[u] = await $i(l, i, a);
9605
+ } else o[u] = await Ui(l, i, a);
9554
9606
  return o;
9555
9607
  }
9556
- function Ur(e) {
9608
+ function Zr(e) {
9557
9609
  let t = e.id ?? null;
9558
9610
  switch (e.method) {
9559
9611
  case 'initialize':
@@ -9571,7 +9623,7 @@ function Ur(e) {
9571
9623
  case 'ping':
9572
9624
  return { jsonrpc: '2.0', id: t, result: {} };
9573
9625
  case 'tools/list':
9574
- return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
9626
+ return { jsonrpc: '2.0', id: t, result: { tools: pt() } };
9575
9627
  case 'tools/call':
9576
9628
  return {
9577
9629
  jsonrpc: '2.0',
@@ -9594,13 +9646,13 @@ function Ur(e) {
9594
9646
  };
9595
9647
  }
9596
9648
  }
9597
- async function Vi() {
9598
- if (Ei) return;
9599
- Ei = !0;
9600
- let e = qr(),
9649
+ async function Wi() {
9650
+ if (Fi) return;
9651
+ Fi = !0;
9652
+ let e = zr(),
9601
9653
  t = w(),
9602
9654
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
9603
- (Ai.default
9655
+ (Bi.default
9604
9656
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
9605
9657
  .on('line', async (n) => {
9606
9658
  let s = n.trim();
@@ -9660,9 +9712,9 @@ async function Vi() {
9660
9712
  )
9661
9713
  try {
9662
9714
  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),
9715
+ if (N.default.existsSync(p) && N.default.statSync(p).isFile() && e) {
9716
+ if (!Hi(p)) throw zi(p);
9717
+ let m = await Gi(p, e, t),
9666
9718
  y = (m.sizeBytes / 1024).toFixed(1),
9667
9719
  _e =
9668
9720
  m.mimeType.startsWith('image/') ||
@@ -9718,7 +9770,7 @@ Pass this URL to any Tein generation tool.`,
9718
9770
  }
9719
9771
  if (e)
9720
9772
  try {
9721
- o.params.arguments = await Di(String(l), c, e, t, i);
9773
+ o.params.arguments = await Ji(String(l), c, e, t, i);
9722
9774
  } catch (d) {
9723
9775
  let p = d instanceof Error ? d.message : String(d);
9724
9776
  process.stdout.write(
@@ -9749,10 +9801,10 @@ Pass this URL to any Tein generation tool.`,
9749
9801
  body: JSON.stringify(o),
9750
9802
  }),
9751
9803
  c = await l.text(),
9752
- d = Oi(o, l.status, c);
9804
+ d = ji(o, l.status, c);
9753
9805
  if (d === null) return;
9754
9806
  if (d) {
9755
- (o?.method === 'tools/list' && dt(d.result?.tools),
9807
+ (o?.method === 'tools/list' && ut(d.result?.tools),
9756
9808
  process.stdout.write(
9757
9809
  JSON.stringify(d) +
9758
9810
  `
@@ -9761,7 +9813,7 @@ Pass this URL to any Tein generation tool.`,
9761
9813
  return;
9762
9814
  }
9763
9815
  } catch {}
9764
- let u = Ur(o);
9816
+ let u = Zr(o);
9765
9817
  u !== null &&
9766
9818
  process.stdout.write(
9767
9819
  JSON.stringify(u) +
@@ -9784,23 +9836,23 @@ Pass this URL to any Tein generation tool.`,
9784
9836
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
9785
9837
  `));
9786
9838
  }
9787
- var V,
9839
+ var N,
9788
9840
  z,
9789
- Ai,
9790
- Rr,
9791
- re,
9792
- lt,
9793
- Ei,
9794
- Ui = h(() => {
9841
+ Bi,
9842
+ Jr,
9843
+ ae,
9844
+ ct,
9845
+ Fi,
9846
+ Xi = h(() => {
9795
9847
  'use strict';
9796
- ((V = T(require('node:fs'))),
9848
+ ((N = T(require('node:fs'))),
9797
9849
  (z = T(require('node:path'))),
9798
- (Ai = T(require('node:readline'))));
9799
- tt();
9800
- Ci();
9801
- E();
9802
- ne();
9803
- Rr = new Set([
9850
+ (Bi = T(require('node:readline'))));
9851
+ rt();
9852
+ Vi();
9853
+ $();
9854
+ re();
9855
+ Jr = new Set([
9804
9856
  '.png',
9805
9857
  '.jpg',
9806
9858
  '.jpeg',
@@ -9826,20 +9878,20 @@ var V,
9826
9878
  '.flac',
9827
9879
  '.opus',
9828
9880
  ]);
9829
- ((re = new Map()), (lt = 0));
9830
- Ei = !1;
9881
+ ((ae = new Map()), (ct = 0));
9882
+ Fi = !1;
9831
9883
  require.main === module &&
9832
- Vi().catch((e) => {
9884
+ Wi().catch((e) => {
9833
9885
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
9834
9886
  `),
9835
9887
  process.exit(1));
9836
9888
  });
9837
9889
  });
9838
- var Yi =
9890
+ var sa =
9839
9891
  !process.env.NO_COLOR &&
9840
9892
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
9841
9893
  function x(e, t) {
9842
- return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9894
+ return (i) => (sa ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9843
9895
  }
9844
9896
  var r = {
9845
9897
  bold: x(1, 22),
@@ -9861,7 +9913,7 @@ var r = {
9861
9913
  bgCyan: x(46, 49),
9862
9914
  bgGreen: x(42, 49),
9863
9915
  },
9864
- $ = class {
9916
+ C = class {
9865
9917
  constructor(t = '') {
9866
9918
  this.frames = [
9867
9919
  '\u280B',
@@ -9925,11 +9977,11 @@ var r = {
9925
9977
  };
9926
9978
  var U = T(require('node:fs')),
9927
9979
  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([
9980
+ var ne = T(require('node:fs')),
9981
+ yt = T(require('node:path')),
9982
+ bt = require('node:stream/promises');
9983
+ re();
9984
+ var pa = new Set([
9933
9985
  'account_suspended',
9934
9986
  'account_terminated',
9935
9987
  'creative_mode_restricted',
@@ -9937,7 +9989,7 @@ var ea = new Set([
9937
9989
  'workspace_paused',
9938
9990
  ]),
9939
9991
  v = 1,
9940
- ta = 3,
9992
+ ca = 3,
9941
9993
  b = class extends Error {
9942
9994
  constructor(t, i, a, n = {}) {
9943
9995
  (super(i),
@@ -9947,10 +9999,10 @@ var ea = new Set([
9947
9999
  (this.fields = n));
9948
10000
  }
9949
10001
  get exitCode() {
9950
- return this.code && ea.has(this.code) ? ta : v;
10002
+ return this.code && pa.has(this.code) ? ca : v;
9951
10003
  }
9952
10004
  };
9953
- function ia(e, t, i) {
10005
+ function ua(e, t, i) {
9954
10006
  let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
9955
10007
  if (!i || typeof i != 'object') return new b(e, a);
9956
10008
  let n = i;
@@ -9963,13 +10015,13 @@ function ia(e, t, i) {
9963
10015
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
9964
10016
  return new b(e, c, typeof o == 'string' ? o : void 0, l);
9965
10017
  }
9966
- function ut(e) {
10018
+ function gt(e) {
9967
10019
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
9968
10020
  }
9969
10021
  function K(e) {
9970
10022
  let t = [e.message],
9971
- i = ut(e.fields.required),
9972
- a = ut(e.fields.balance);
10023
+ i = gt(e.fields.required),
10024
+ a = gt(e.fields.balance);
9973
10025
  (i || a) &&
9974
10026
  t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
9975
10027
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -9977,19 +10029,19 @@ function K(e) {
9977
10029
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
9978
10030
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
9979
10031
  }
9980
- function aa(e) {
10032
+ function ma(e) {
9981
10033
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
9982
10034
  ? 'video'
9983
10035
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
9984
10036
  ? 'audio'
9985
10037
  : 'image';
9986
10038
  }
9987
- function mt(e) {
10039
+ function ht(e) {
9988
10040
  let t = [];
9989
10041
  for (let i of e.data ?? [])
9990
10042
  typeof i.message?.content == 'string'
9991
10043
  ? 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 } : {}) });
10044
+ : i.url && t.push({ type: ma(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
9993
10045
  return t;
9994
10046
  }
9995
10047
  var M = class {
@@ -10015,7 +10067,7 @@ var M = class {
10015
10067
  try {
10016
10068
  s = await n.json();
10017
10069
  } catch {}
10018
- throw ia(n.status, n.statusText, s);
10070
+ throw ua(n.status, n.statusText, s);
10019
10071
  }
10020
10072
  return await n.json();
10021
10073
  }
@@ -10029,7 +10081,7 @@ var M = class {
10029
10081
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
10030
10082
  ? n
10031
10083
  : 'processing',
10032
- o = mt(a);
10084
+ o = ht(a);
10033
10085
  return {
10034
10086
  request_id: a.request_id || a.id || '',
10035
10087
  model: a.model,
@@ -10047,7 +10099,7 @@ var M = class {
10047
10099
  a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
10048
10100
  ? a
10049
10101
  : 'processing',
10050
- s = mt(i),
10102
+ s = ht(i),
10051
10103
  o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
10052
10104
  return {
10053
10105
  request_id: i.id || t,
@@ -10076,13 +10128,13 @@ var M = class {
10076
10128
  async downloadOutput(t, i) {
10077
10129
  let a = await fetch(t);
10078
10130
  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);
10131
+ let n = yt.default.dirname(i);
10132
+ ne.default.existsSync(n) || ne.default.mkdirSync(n, { recursive: !0 });
10133
+ let s = ne.default.createWriteStream(i);
10134
+ return (await (0, bt.pipeline)(a.body, s), i);
10083
10135
  }
10084
10136
  };
10085
- E();
10137
+ $();
10086
10138
  function Se(e) {
10087
10139
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
10088
10140
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
@@ -10091,43 +10143,43 @@ function Se(e) {
10091
10143
  a = Math.round(Number((e * i).toFixed(6))) / i;
10092
10144
  return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
10093
10145
  }
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]]);
10146
+ ee();
10147
+ var ki = ['images', 'input_images', 'videos', 'audios'];
10148
+ function cr(e) {
10149
+ for (let t of ki) typeof e[t] == 'string' && (e[t] = [e[t]]);
10098
10150
  }
10099
- function er(e) {
10151
+ function ur(e) {
10100
10152
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
10101
10153
  let t = O.default.resolve(e);
10102
10154
  return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
10103
10155
  }
10104
- async function tr(e, t) {
10105
- for (let i of di) {
10156
+ async function mr(e, t) {
10157
+ for (let i of ki) {
10106
10158
  if (!Array.isArray(e[i])) continue;
10107
10159
  let a = [];
10108
10160
  for (let n of e[i]) {
10109
10161
  if (typeof n != 'string') continue;
10110
- let s = er(n);
10162
+ let s = ur(n);
10111
10163
  a.push(s ? await t(s) : n);
10112
10164
  }
10113
10165
  e[i] = a;
10114
10166
  }
10115
10167
  }
10116
- var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10117
- function ir(e) {
10168
+ var te = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10169
+ function fr(e) {
10118
10170
  if (e.count === void 0 || e.count === !0) return 1;
10119
10171
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
10120
- i = ie.enterprise;
10172
+ i = te.enterprise;
10121
10173
  return (
10122
10174
  (!Number.isInteger(t) || t < 1 || t > i) &&
10123
10175
  (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.
10176
+ .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
10177
  `),
10126
10178
  process.exit(1)),
10127
10179
  t
10128
10180
  );
10129
10181
  }
10130
- async function ar(e, t, i, a, n) {
10182
+ async function gr(e, t, i, a, n) {
10131
10183
  n.isJson ||
10132
10184
  process.stderr.write(`Starting ${a} ${t} jobs together...
10133
10185
  `);
@@ -10202,12 +10254,12 @@ async function ar(e, t, i, a, n) {
10202
10254
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
10203
10255
  process.exit(v);
10204
10256
  }
10205
- function rr(e, t, i) {
10257
+ function hr(e, t, i) {
10206
10258
  if (i <= 1) return e;
10207
10259
  let a = O.default.extname(e);
10208
10260
  return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
10209
10261
  }
10210
- function pi(e) {
10262
+ function wi(e) {
10211
10263
  let t = {},
10212
10264
  i = new Set(),
10213
10265
  a = [];
@@ -10252,7 +10304,7 @@ function pi(e) {
10252
10304
  }
10253
10305
  return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
10254
10306
  }
10255
- async function Ze(e, t) {
10307
+ async function it(e, t) {
10256
10308
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
10257
10309
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
10258
10310
  (i ||
@@ -10274,7 +10326,7 @@ async function Ze(e, t) {
10274
10326
  s = !!t.json,
10275
10327
  o = !!(t.async || t.no_wait),
10276
10328
  u = typeof t.output == 'string' ? t.output : void 0,
10277
- l = ir(t),
10329
+ l = fr(t),
10278
10330
  c = { ...t };
10279
10331
  (delete c.json,
10280
10332
  delete c.async,
@@ -10283,8 +10335,8 @@ async function Ze(e, t) {
10283
10335
  delete c.api_key,
10284
10336
  delete c.api_url,
10285
10337
  delete c.count);
10286
- let d = li(n, c);
10287
- (Za(d),
10338
+ let d = bi(n, c);
10339
+ (cr(d),
10288
10340
  typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
10289
10341
  d.image_url &&
10290
10342
  !d.first_frame_image &&
@@ -10307,14 +10359,14 @@ async function Ze(e, t) {
10307
10359
  if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
10308
10360
  let P = O.default.resolve(g);
10309
10361
  if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
10310
- let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
10362
+ let I = new C(`Uploading local file ${O.default.basename(P)} to CDN...`);
10311
10363
  s || I.start();
10312
10364
  try {
10313
- let N = U.default.readFileSync(P),
10314
- q = await p.uploadAsset(N.toString('base64'));
10365
+ let V = U.default.readFileSync(P),
10366
+ q = await p.uploadAsset(V.toString('base64'));
10315
10367
  ((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);
10368
+ } catch (V) {
10369
+ let q = V instanceof Error ? V.message : String(V);
10318
10370
  (s
10319
10371
  ? process.stdout.write(
10320
10372
  JSON.stringify({ error: q }) +
@@ -10327,8 +10379,8 @@ async function Ze(e, t) {
10327
10379
  }
10328
10380
  }
10329
10381
  }
10330
- await tr(d, async (k) => {
10331
- let g = new $(`Uploading local file ${O.default.basename(k)} to CDN...`);
10382
+ await mr(d, async (k) => {
10383
+ let g = new C(`Uploading local file ${O.default.basename(k)} to CDN...`);
10332
10384
  s || g.start();
10333
10385
  try {
10334
10386
  let P = U.default.readFileSync(k),
@@ -10346,12 +10398,12 @@ async function Ze(e, t) {
10346
10398
  process.exit(1));
10347
10399
  }
10348
10400
  });
10349
- let y = new $(`Submitting task for ${r.bold(e)}...`);
10401
+ let y = new C(`Submitting task for ${r.bold(e)}...`);
10350
10402
  s || y.start();
10351
10403
  let f;
10352
10404
  try {
10353
10405
  if (l > 1) {
10354
- await ar(p, e, d, l, { isJson: s, isAsync: o });
10406
+ await gr(p, e, d, l, { isJson: s, isAsync: o });
10355
10407
  return;
10356
10408
  }
10357
10409
  f = await p.queueJob(e, d);
@@ -10448,19 +10500,19 @@ ${r.bold('Outputs:')}
10448
10500
  for (let P = 0; P < f.output.length; P++) {
10449
10501
  let I = f.output[P];
10450
10502
  if (I.url) {
10451
- let N = I.layer?.name ? ` ${r.bold(I.layer.name)}` : '';
10503
+ let V = I.layer?.name ? ` ${r.bold(I.layer.name)}` : '';
10452
10504
  if (
10453
- (process.stdout.write(` [${I.type.toUpperCase()}]${N} ${r.cyan(r.underline(I.url))}
10505
+ (process.stdout.write(` [${I.type.toUpperCase()}]${V} ${r.cyan(r.underline(I.url))}
10454
10506
  `),
10455
10507
  u)
10456
10508
  ) {
10457
- let q = rr(u, g++, k),
10458
- pt = new $(`Downloading output to ${q}...`).start();
10509
+ let q = hr(u, g++, k),
10510
+ mt = new C(`Downloading output to ${q}...`).start();
10459
10511
  try {
10460
10512
  (await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
10461
- pt.succeed(`Saved to ${r.bold(q)}`));
10513
+ mt.succeed(`Saved to ${r.bold(q)}`));
10462
10514
  } catch (Ie) {
10463
- pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
10515
+ mt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
10464
10516
  }
10465
10517
  }
10466
10518
  } else
@@ -10473,9 +10525,9 @@ ${I.text}
10473
10525
  process.stdout.write(`
10474
10526
  `);
10475
10527
  }
10476
- var ci = T(require('node:readline'));
10477
- E();
10478
- async function nr(e) {
10528
+ var xi = T(require('node:readline'));
10529
+ $();
10530
+ async function yr(e) {
10479
10531
  try {
10480
10532
  return (await new M(e, w()).checkKey(), 'ok');
10481
10533
  } catch (t) {
@@ -10486,15 +10538,15 @@ async function nr(e) {
10486
10538
  return 'unchecked';
10487
10539
  }
10488
10540
  }
10489
- function sr(e) {
10490
- let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
10541
+ function br(e) {
10542
+ let t = xi.default.createInterface({ input: process.stdin, output: process.stdout });
10491
10543
  return new Promise((i) => {
10492
10544
  t.question(e, (a) => {
10493
10545
  (t.close(), i(a.trim()));
10494
10546
  });
10495
10547
  });
10496
10548
  }
10497
- async function ae(e, t) {
10549
+ async function ie(e, t) {
10498
10550
  switch (e) {
10499
10551
  case 'login':
10500
10552
  case 'set-key': {
@@ -10506,14 +10558,14 @@ ${r.bold('Tein AI Authentication')}
10506
10558
  process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
10507
10559
 
10508
10560
  `),
10509
- (i = await sr('Enter your Tein API Key (sk_live_...): '))),
10561
+ (i = await br('Enter your Tein API Key (sk_live_...): '))),
10510
10562
  !i.startsWith('sk_live_') &&
10511
10563
  !i.startsWith('sk_test_') &&
10512
10564
  (process.stderr
10513
10565
  .write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10514
10566
  `),
10515
10567
  process.exit(1)));
10516
- let a = await nr(i);
10568
+ let a = await yr(i);
10517
10569
  (a === 'invalid' &&
10518
10570
  (process.stderr
10519
10571
  .write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
@@ -10521,7 +10573,7 @@ ${r.bold('Tein AI Authentication')}
10521
10573
  process.exit(1)),
10522
10574
  Ke({ apiKey: i }),
10523
10575
  process.stdout.write(`
10524
- ${r.green('\u2713')} API key saved to ${r.dim(le())}
10576
+ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
10525
10577
  `),
10526
10578
  a === 'blocked'
10527
10579
  ? process.stdout
@@ -10546,7 +10598,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
10546
10598
  }
10547
10599
  (Ke({ apiKey: '' }),
10548
10600
  process.stdout
10549
- .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(le())}
10601
+ .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(oe())}
10550
10602
  `));
10551
10603
  break;
10552
10604
  }
@@ -10558,7 +10610,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
10558
10610
  (process.stdout.write(`
10559
10611
  ${r.bold('Tein AI CLI Configuration')}
10560
10612
  `),
10561
- process.stdout.write(` Config file: ${r.dim(le())}
10613
+ process.stdout.write(` Config file: ${r.dim(oe())}
10562
10614
  `),
10563
10615
  process.stdout.write(` API URL: ${r.cyan(a)}
10564
10616
  `),
@@ -10582,16 +10634,16 @@ ${r.bold('Tein AI CLI Configuration')}
10582
10634
  }
10583
10635
  }
10584
10636
  }
10585
- E();
10637
+ $();
10586
10638
  function _(e) {
10587
10639
  return e !== 0 && Math.abs(e) < 0.01
10588
10640
  ? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
10589
10641
  : `$${e.toFixed(2)}`;
10590
10642
  }
10591
- function ui(e) {
10643
+ function _i(e) {
10592
10644
  return `${e} ${e === 1 ? 'request' : 'requests'}`;
10593
10645
  }
10594
- function or(e) {
10646
+ function kr(e) {
10595
10647
  let t = [
10596
10648
  ['Balance', _(e.balance)],
10597
10649
  ['Available to this key', _(e.available)],
@@ -10611,8 +10663,8 @@ function or(e) {
10611
10663
  `${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
10612
10664
  ]),
10613
10665
  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)}`],
10666
+ ['This month', `${_(e.usage.this_month.spend)} on ${_i(e.usage.this_month.requests)}`],
10667
+ ['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${_i(e.usage.last_30_days.requests)}`],
10616
10668
  [
10617
10669
  'Auto top up',
10618
10670
  e.auto_top_up.enabled
@@ -10625,7 +10677,7 @@ function or(e) {
10625
10677
  let a = Math.max(...t.map(([n]) => n.length));
10626
10678
  return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
10627
10679
  }
10628
- async function mi(e) {
10680
+ async function Pi(e) {
10629
10681
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10630
10682
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
10631
10683
  a = !!e.json;
@@ -10669,13 +10721,13 @@ async function mi(e) {
10669
10721
  }
10670
10722
  process.stdout.write(`
10671
10723
  ${r.bold('Tein balance')}
10672
- ${or(n).join(`
10724
+ ${kr(n).join(`
10673
10725
  `)}
10674
10726
 
10675
10727
  `);
10676
10728
  }
10677
- E();
10678
- function fi(e) {
10729
+ $();
10730
+ function Ii(e) {
10679
10731
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10680
10732
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
10681
10733
  return (
@@ -10689,7 +10741,7 @@ function fi(e) {
10689
10741
  new M(t, i)
10690
10742
  );
10691
10743
  }
10692
- function gi(e, t) {
10744
+ function vi(e, t) {
10693
10745
  let i = {};
10694
10746
  for (let a of t) {
10695
10747
  let n = e[a];
@@ -10697,7 +10749,7 @@ function gi(e, t) {
10697
10749
  }
10698
10750
  return i;
10699
10751
  }
10700
- async function hi(e, t) {
10752
+ async function Ti(e, t) {
10701
10753
  try {
10702
10754
  return await t();
10703
10755
  } catch (i) {
@@ -10721,7 +10773,7 @@ async function hi(e, t) {
10721
10773
  process.exit(v));
10722
10774
  }
10723
10775
  }
10724
- function et(e) {
10776
+ function at(e) {
10725
10777
  let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
10726
10778
  i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
10727
10779
  return e.map(
@@ -10732,7 +10784,7 @@ function et(e) {
10732
10784
  .trimEnd()}`,
10733
10785
  );
10734
10786
  }
10735
- function lr(e) {
10787
+ function wr(e) {
10736
10788
  let t = e.summary,
10737
10789
  i = [
10738
10790
  ` 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 +10796,7 @@ function lr(e) {
10744
10796
  e.by_channel.length &&
10745
10797
  (i.push('', r.bold('By channel')),
10746
10798
  i.push(
10747
- ...et([
10799
+ ...at([
10748
10800
  ['Channel', 'Spend', 'Requests'],
10749
10801
  ...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
10750
10802
  ]),
@@ -10752,7 +10804,7 @@ function lr(e) {
10752
10804
  e.by_model.length &&
10753
10805
  (i.push('', r.bold('By model')),
10754
10806
  i.push(
10755
- ...et([
10807
+ ...at([
10756
10808
  ['Model', 'Spend', 'Requests', 'Failed'],
10757
10809
  ...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
10758
10810
  ]),
@@ -10760,10 +10812,10 @@ function lr(e) {
10760
10812
  i
10761
10813
  );
10762
10814
  }
10763
- async function yi(e) {
10815
+ async function Mi(e) {
10764
10816
  let t = !!e.json,
10765
- i = fi(e),
10766
- a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
10817
+ i = Ii(e),
10818
+ a = await Ti(t, () => i.getUsage(vi(e, ['range', 'from', 'to', 'model', 'channel'])));
10767
10819
  if (t) {
10768
10820
  process.stdout.write(
10769
10821
  JSON.stringify(a, null, 2) +
@@ -10774,14 +10826,14 @@ async function yi(e) {
10774
10826
  }
10775
10827
  process.stdout.write(`
10776
10828
  ${r.bold('Tein usage')}
10777
- ${lr(a).join(`
10829
+ ${wr(a).join(`
10778
10830
  `)}
10779
10831
 
10780
10832
  `);
10781
10833
  }
10782
- function dr(e) {
10834
+ function xr(e) {
10783
10835
  return e.data.length
10784
- ? et([
10836
+ ? at([
10785
10837
  ['When (UTC)', 'Amount', 'Balance after', 'What'],
10786
10838
  ...e.data.map((t) => [
10787
10839
  t.created_at.slice(0, 16).replace('T', ' '),
@@ -10792,10 +10844,10 @@ function dr(e) {
10792
10844
  ])
10793
10845
  : [' No transactions yet.'];
10794
10846
  }
10795
- async function bi(e) {
10847
+ async function Ki(e) {
10796
10848
  let t = !!e.json,
10797
- i = fi(e),
10798
- a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
10849
+ i = Ii(e),
10850
+ a = await Ti(t, () => i.getTransactions(vi(e, ['limit', 'type', 'after'])));
10799
10851
  if (t) {
10800
10852
  process.stdout.write(
10801
10853
  JSON.stringify(a, null, 2) +
@@ -10811,18 +10863,18 @@ async function bi(e) {
10811
10863
  : '';
10812
10864
  process.stdout.write(`
10813
10865
  ${r.bold('Tein balance history')}
10814
- ${dr(a).join(`
10866
+ ${xr(a).join(`
10815
10867
  `)}${n}
10816
10868
 
10817
10869
  `);
10818
10870
  }
10819
- E();
10820
- Ce();
10821
- te();
10822
- var pr = 3e3;
10823
- async function ki(e) {
10871
+ $();
10872
+ Ee();
10873
+ ee();
10874
+ var _r = 3e3;
10875
+ async function Si(e) {
10824
10876
  try {
10825
- let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
10877
+ let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(_r) });
10826
10878
  if (!t.ok) return;
10827
10879
  let i = await t.json(),
10828
10880
  a = {};
@@ -10830,18 +10882,18 @@ async function ki(e) {
10830
10882
  let s = String(n.modelSlug ?? '');
10831
10883
  J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
10832
10884
  }
10833
- ii(a);
10885
+ li(a);
10834
10886
  } catch {}
10835
10887
  }
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);
10888
+ var Pr = new Set(['video', 'image', 'text', 'audio', '3d']),
10889
+ Ir = { llm: 'text', chat: 'text', reasoning: 'text' };
10890
+ async function Ei(e, t) {
10891
+ await Si(t);
10840
10892
  let i = D();
10841
10893
  if (e) {
10842
10894
  let s = e.toLowerCase(),
10843
- o = ur[s] ?? s;
10844
- i = cr.has(o)
10895
+ o = Ir[s] ?? s;
10896
+ i = Pr.has(o)
10845
10897
  ? i.filter((u) => u.category.toLowerCase() === o)
10846
10898
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
10847
10899
  }
@@ -10879,8 +10931,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
10879
10931
 
10880
10932
  `);
10881
10933
  }
10882
- async function xi(e, t) {
10883
- J.has(e) && (await ki(t));
10934
+ async function Ci(e, t) {
10935
+ J.has(e) && (await Si(t));
10884
10936
  let i = H(e);
10885
10937
  (i ||
10886
10938
  (process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -10960,10 +11012,10 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
10960
11012
 
10961
11013
  `);
10962
11014
  }
10963
- E();
10964
- tt();
10965
- var mr = 1e4,
10966
- at = {
11015
+ $();
11016
+ rt();
11017
+ var vr = 1e4,
11018
+ st = {
10967
11019
  price: '',
10968
11020
  creativeMode: 'Creative mode',
10969
11021
  priority: 'Priority',
@@ -10973,22 +11025,22 @@ var mr = 1e4,
10973
11025
  priorityDraft: 'Priority + Draft',
10974
11026
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
10975
11027
  },
10976
- fr = Object.keys(at),
10977
- gr = {
11028
+ Tr = Object.keys(st),
11029
+ Mr = {
10978
11030
  creativeMode: 'unfiltered',
10979
11031
  creativeModePriority: 'unfilteredPriority',
10980
11032
  creativeModeDraft: 'unfilteredDraft',
10981
11033
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
10982
11034
  };
10983
- function hr(e, t) {
10984
- let i = gr[t];
11035
+ function Kr(e, t) {
11036
+ let i = Mr[t];
10985
11037
  return e[t] ?? (i ? e[i] : void 0);
10986
11038
  }
10987
- async function yr(e, t) {
11039
+ async function Sr(e, t) {
10988
11040
  let i = `${w(e)}${xe(t)}`,
10989
11041
  a;
10990
11042
  try {
10991
- a = await fetch(i, { signal: AbortSignal.timeout(mr) });
11043
+ a = await fetch(i, { signal: AbortSignal.timeout(vr) });
10992
11044
  } catch {
10993
11045
  throw new Error(`Could not reach ${i}`);
10994
11046
  }
@@ -11004,18 +11056,18 @@ async function yr(e, t) {
11004
11056
  }
11005
11057
  return n;
11006
11058
  }
11007
- function it(e) {
11059
+ function nt(e) {
11008
11060
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
11009
11061
  [i, a = ''] = t.split('.');
11010
11062
  return `$${i}.${a.padEnd(2, '0')}`;
11011
11063
  }
11012
- function rt(e) {
11064
+ function ot(e) {
11013
11065
  if (!e || typeof e.starter != 'number') return null;
11014
11066
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
11015
11067
  i = typeof e.scale == 'number' ? e.scale : t;
11016
- return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
11068
+ return `Starter ${nt(e.starter)} Plus ${nt(t)} Scale ${nt(i)}`;
11017
11069
  }
11018
- function br(e) {
11070
+ function Er(e) {
11019
11071
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
11020
11072
  let t = [];
11021
11073
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -11027,33 +11079,33 @@ function br(e) {
11027
11079
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
11028
11080
  );
11029
11081
  }
11030
- function kr(e, t) {
11031
- let i = br(e);
11032
- for (let a of fr) {
11033
- let n = rt(hr(e, a));
11082
+ function Cr(e, t) {
11083
+ let i = Er(e);
11084
+ for (let a of Tr) {
11085
+ let n = ot(Kr(e, a));
11034
11086
  if (!n) continue;
11035
- let s = at[a] ? ` (${at[a]})` : '';
11087
+ let s = st[a] ? ` (${st[a]})` : '';
11036
11088
  t.push(` ${i}${s} ${n}`);
11037
11089
  }
11038
11090
  }
11039
- function wr(e, t) {
11091
+ function $r(e, t) {
11040
11092
  let i = e.quality ? ` quality=${e.quality}` : '';
11041
11093
  t.push(
11042
11094
  ` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
11043
11095
  );
11044
- for (let n of e.variants ?? []) kr(n, t);
11096
+ for (let n of e.variants ?? []) Cr(n, t);
11045
11097
  let a = e.addons;
11046
11098
  if (Array.isArray(a))
11047
11099
  for (let n of a) {
11048
11100
  if (!n || typeof n != 'object') continue;
11049
11101
  let s = n,
11050
11102
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
11051
- u = rt(s.price);
11103
+ u = ot(s.price);
11052
11104
  u && t.push(` ${o} (add-on) ${u}`);
11053
11105
  }
11054
11106
  t.push('');
11055
11107
  }
11056
- function xr(e) {
11108
+ function Ar(e) {
11057
11109
  let t = [],
11058
11110
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
11059
11111
  (t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
@@ -11075,7 +11127,7 @@ function xr(e) {
11075
11127
  });
11076
11128
  for (let l of s) {
11077
11129
  t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
11078
- for (let c of a.get(l) ?? []) wr(c, t);
11130
+ for (let c of a.get(l) ?? []) $r(c, t);
11079
11131
  }
11080
11132
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
11081
11133
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -11092,7 +11144,7 @@ function xr(e) {
11092
11144
  t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
11093
11145
  for (let m of d) {
11094
11146
  let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
11095
- f = rt(m.prices);
11147
+ f = ot(m.prices);
11096
11148
  f && t.push(` ${y} ${f}`);
11097
11149
  }
11098
11150
  t.push('');
@@ -11105,10 +11157,10 @@ function xr(e) {
11105
11157
  `
11106
11158
  );
11107
11159
  }
11108
- async function _i(e) {
11160
+ async function $i(e) {
11109
11161
  let t;
11110
11162
  try {
11111
- t = await yr(e.apiUrl, e.model);
11163
+ t = await Sr(e.apiUrl, e.model);
11112
11164
  } catch (i) {
11113
11165
  let a = i instanceof Error ? i.message : String(i);
11114
11166
  (process.stderr.write(`${r.red('Error:')} ${a}
@@ -11119,12 +11171,12 @@ async function _i(e) {
11119
11171
  e.json
11120
11172
  ? `${JSON.stringify(t, null, 2)}
11121
11173
  `
11122
- : xr(t),
11174
+ : Ar(t),
11123
11175
  );
11124
11176
  }
11125
- var Pi = T(require('node:path'));
11126
- E();
11127
- async function Ii(e, t) {
11177
+ var Ai = T(require('node:path'));
11178
+ $();
11179
+ async function Oi(e, t) {
11128
11180
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
11129
11181
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
11130
11182
  (i ||
@@ -11144,7 +11196,7 @@ async function Ii(e, t) {
11144
11196
  s = !!t.wait,
11145
11197
  o = typeof t.output == 'string' ? t.output : void 0,
11146
11198
  u = new M(i, a),
11147
- l = new $(`Checking status of ${r.bold(e)}...`);
11199
+ l = new C(`Checking status of ${r.bold(e)}...`);
11148
11200
  n || l.start();
11149
11201
  let c;
11150
11202
  try {
@@ -11217,9 +11269,9 @@ ${r.bold('Outputs:')}
11217
11269
  `),
11218
11270
  o)
11219
11271
  ) {
11220
- let p = new $(`Downloading output to ${o}...`).start();
11272
+ let p = new C(`Downloading output to ${o}...`).start();
11221
11273
  try {
11222
- (await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
11274
+ (await u.downloadOutput(d.url, Ai.default.resolve(process.cwd(), o)),
11223
11275
  p.succeed(`Saved to ${r.bold(o)}`));
11224
11276
  } catch (m) {
11225
11277
  p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -11234,10 +11286,10 @@ ${d.text}
11234
11286
  process.stdout.write(`
11235
11287
  `);
11236
11288
  }
11237
- var nt = T(require('node:fs')),
11238
- st = T(require('node:path'));
11239
- E();
11240
- async function vi(e, t = {}) {
11289
+ var lt = T(require('node:fs')),
11290
+ dt = T(require('node:path'));
11291
+ $();
11292
+ async function qi(e, t = {}) {
11241
11293
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
11242
11294
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
11243
11295
  n = !!t.json;
@@ -11254,15 +11306,15 @@ async function vi(e, t = {}) {
11254
11306
  process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
11255
11307
  `),
11256
11308
  process.exit(1)));
11257
- let s = st.default.resolve(e);
11258
- nt.default.existsSync(s) ||
11309
+ let s = dt.default.resolve(e);
11310
+ lt.default.existsSync(s) ||
11259
11311
  (process.stderr.write(`${r.red('Error:')} File not found: ${s}
11260
11312
  `),
11261
11313
  process.exit(1));
11262
- let o = st.default.basename(s),
11263
- l = nt.default.readFileSync(s).toString('base64'),
11314
+ let o = dt.default.basename(s),
11315
+ l = lt.default.readFileSync(s).toString('base64'),
11264
11316
  c = new M(i, a),
11265
- d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
11317
+ d = new C(`Uploading ${r.bold(o)} to Tein AI CDN...`);
11266
11318
  n || d.start();
11267
11319
  try {
11268
11320
  let p = await c.uploadAsset(l);
@@ -11301,10 +11353,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
11301
11353
  process.exit(m ? m.exitCode : v));
11302
11354
  }
11303
11355
  }
11304
- ne();
11305
- te();
11356
+ re();
11357
+ ee();
11306
11358
  De();
11307
- function Fi() {
11359
+ function Qi() {
11308
11360
  process.stdout.write(`
11309
11361
  ${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
11310
11362
 
@@ -11386,11 +11438,11 @@ ${r.bold('EXAMPLES:')}
11386
11438
 
11387
11439
  `);
11388
11440
  }
11389
- async function Fr() {
11441
+ async function en() {
11390
11442
  let e = process.argv.slice(2),
11391
- t = pi(e);
11443
+ t = wi(e);
11392
11444
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
11393
- Fi();
11445
+ Qi();
11394
11446
  return;
11395
11447
  }
11396
11448
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -11400,31 +11452,31 @@ async function Fr() {
11400
11452
  }
11401
11453
  switch (t.command) {
11402
11454
  case 'auth': {
11403
- await ae(t.subcommand, t.options.key);
11455
+ await ie(t.subcommand, t.options.key);
11404
11456
  break;
11405
11457
  }
11406
11458
  case 'login': {
11407
- await ae('login', t.options.key);
11459
+ await ie('login', t.options.key);
11408
11460
  break;
11409
11461
  }
11410
11462
  case 'logout': {
11411
- await ae('logout');
11463
+ await ie('logout');
11412
11464
  break;
11413
11465
  }
11414
11466
  case 'whoami': {
11415
- await ae('status');
11467
+ await ie('status');
11416
11468
  break;
11417
11469
  }
11418
11470
  case 'models':
11419
11471
  case 'list': {
11420
- await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11472
+ await Ei(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11421
11473
  break;
11422
11474
  }
11423
11475
  case 'pricing':
11424
11476
  case 'prices': {
11425
11477
  let i = t.options.model,
11426
11478
  a = t.subcommand || (typeof i == 'string' ? i : void 0);
11427
- await _i({
11479
+ await $i({
11428
11480
  model: a,
11429
11481
  json: !!t.options.json,
11430
11482
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -11439,61 +11491,61 @@ async function Fr() {
11439
11491
  process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
11440
11492
  `),
11441
11493
  process.exit(1)),
11442
- await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11494
+ await Ci(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11443
11495
  break;
11444
11496
  }
11445
11497
  case 'upload': {
11446
11498
  let i = t.subcommand || '';
11447
- await vi(i, t.options);
11499
+ await qi(i, t.options);
11448
11500
  break;
11449
11501
  }
11450
11502
  case 'run':
11451
11503
  case 'generate': {
11452
11504
  let i = t.subcommand || '';
11453
- await Ze(i, t.options);
11505
+ await it(i, t.options);
11454
11506
  break;
11455
11507
  }
11456
11508
  case 'status': {
11457
11509
  let i = t.subcommand || '';
11458
- await Ii(i, t.options);
11510
+ await Oi(i, t.options);
11459
11511
  break;
11460
11512
  }
11461
11513
  case 'balance': {
11462
- await mi(t.options);
11514
+ await Pi(t.options);
11463
11515
  break;
11464
11516
  }
11465
11517
  case 'usage': {
11466
- await yi(t.options);
11518
+ await Mi(t.options);
11467
11519
  break;
11468
11520
  }
11469
11521
  case 'transactions':
11470
11522
  case 'history': {
11471
- await bi(t.options);
11523
+ await Ki(t.options);
11472
11524
  break;
11473
11525
  }
11474
11526
  case 'mcp': {
11475
- let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
11527
+ let { startStdioServer: i } = await Promise.resolve().then(() => (Xi(), Yi));
11476
11528
  await i();
11477
11529
  break;
11478
11530
  }
11479
11531
  default: {
11480
11532
  if (t.command && !t.command.startsWith('-')) {
11481
11533
  (!H(t.command) &&
11482
- !fe[t.command] &&
11534
+ !me[t.command] &&
11483
11535
  (process.stderr.write(`
11484
11536
  ${r.red('Error:')} Unknown command or model "${t.command}".
11485
11537
  Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
11486
11538
  `),
11487
11539
  process.exit(v)),
11488
- await Ze(t.command, t.options));
11540
+ await it(t.command, t.options));
11489
11541
  return;
11490
11542
  }
11491
- Fi();
11543
+ Qi();
11492
11544
  break;
11493
11545
  }
11494
11546
  }
11495
11547
  }
11496
- Fr().catch((e) => {
11548
+ en().catch((e) => {
11497
11549
  (e instanceof b &&
11498
11550
  (process.stderr.write(`
11499
11551
  ${r.red('Error:')} ${K(e).join(`