@teinai/cli 1.1.35 → 1.1.37

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 +656 -620
  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 Ni = Object.create;
3
+ var Bi = Object.create;
4
4
  var ve = Object.defineProperty;
5
- var Ui = Object.getOwnPropertyDescriptor;
6
- var Fi = Object.getOwnPropertyNames;
7
- var Bi = Object.getPrototypeOf,
8
- ji = Object.prototype.hasOwnProperty;
5
+ var ji = Object.getOwnPropertyDescriptor;
6
+ var Gi = Object.getOwnPropertyNames;
7
+ var Hi = Object.getPrototypeOf,
8
+ zi = 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 Gi = (e, t) => {
17
+ var Ji = (e, t) => {
18
18
  for (var i in t) ve(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- Hi = (e, t, i, a) => {
20
+ Wi = (e, t, i, a) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of Fi(t))
23
- !ji.call(e, n) &&
22
+ for (let n of Gi(t))
23
+ !zi.call(e, n) &&
24
24
  n !== i &&
25
- ve(e, n, { get: () => t[n], enumerable: !(a = Ui(t, n)) || a.enumerable });
25
+ ve(e, n, { get: () => t[n], enumerable: !(a = ji(t, n)) || a.enumerable });
26
26
  return e;
27
27
  };
28
28
  var T = (e, t, i) => (
29
- (i = e != null ? Ni(Bi(e)) : {}),
30
- Hi(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
29
+ (i = e != null ? Bi(Hi(e)) : {}),
30
+ Wi(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
- function Wi(e) {
32
+ function Qi(e) {
33
33
  for (let t of e)
34
34
  try {
35
- let i = JSON.parse(pt.default.readFileSync(t, 'utf8'));
35
+ let i = JSON.parse(ct.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 Ji;
39
+ return Xi;
40
40
  }
41
- function Yi() {
41
+ function Zi() {
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 pt,
48
+ var ct,
49
49
  Te,
50
- Ji,
50
+ Xi,
51
51
  F,
52
- re = h(() => {
52
+ ne = h(() => {
53
53
  'use strict';
54
- ((pt = T(require('node:fs'))), (Te = T(require('node:path'))), (Ji = '0.0.0-dev'));
55
- F = Wi(Yi());
54
+ ((ct = T(require('node:fs'))), (Te = T(require('node:path'))), (Xi = '0.0.0-dev'));
55
+ F = Qi(Zi());
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(se) || R.default.mkdirSync(se, { recursive: !0, mode: 448 });
68
+ R.default.existsSync(oe) || R.default.mkdirSync(oe, { 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(se, 448),
71
+ R.default.chmodSync(oe, 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,30 +88,30 @@ 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 oe() {
91
+ function le() {
92
92
  return B;
93
93
  }
94
94
  var R,
95
- gt,
95
+ ht,
96
96
  Me,
97
- se,
97
+ oe,
98
98
  B,
99
99
  E = h(() => {
100
100
  'use strict';
101
101
  ((R = T(require('node:fs'))),
102
- (gt = T(require('node:os'))),
102
+ (ht = T(require('node:os'))),
103
103
  (Me = T(require('node:path'))),
104
- (se = Me.default.join(gt.default.homedir(), '.tein')),
105
- (B = Me.default.join(se, 'config.json')));
104
+ (oe = Me.default.join(ht.default.homedir(), '.tein')),
105
+ (B = Me.default.join(oe, 'config.json')));
106
106
  });
107
- var ta,
108
- ht,
107
+ var ra,
109
108
  yt,
110
- bt = h(() => {
109
+ bt,
110
+ kt = h(() => {
111
111
  'use strict';
112
- ((ta = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
- (ht = [...ta, 'auto']),
114
- (yt =
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 =
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,
@@ -119,14 +119,14 @@ var J,
119
119
  'use strict';
120
120
  J = new Set([]);
121
121
  });
122
- function le(e) {
122
+ function W(e) {
123
123
  return !1;
124
124
  }
125
- var kt = h(() => {
125
+ var wt = h(() => {
126
126
  'use strict';
127
127
  });
128
128
  var de,
129
- wt = h(() => {
129
+ xt = h(() => {
130
130
  'use strict';
131
131
  de = {
132
132
  source: 'TEIN Price Board',
@@ -6198,8 +6198,13 @@ var de,
6198
6198
  ],
6199
6199
  };
6200
6200
  });
6201
+ var _t,
6202
+ Pt = h(() => {
6203
+ 'use strict';
6204
+ _t = [];
6205
+ });
6201
6206
  var pe,
6202
- xt,
6207
+ It,
6203
6208
  $e = h(() => {
6204
6209
  'use strict';
6205
6210
  ((pe = [
@@ -6277,12 +6282,12 @@ var pe,
6277
6282
  from: { variant: 'swap' },
6278
6283
  },
6279
6284
  ]),
6280
- (xt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6285
+ (It = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6281
6286
  });
6282
- function qe(e, t) {
6287
+ function Oe(e, t) {
6283
6288
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
6284
6289
  }
6285
- function ra(e, t) {
6290
+ function oa(e, t) {
6286
6291
  if (e === 'seedance-2-mini') return 'mini';
6287
6292
  if (e !== 'seedance-2') return;
6288
6293
  let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -6292,91 +6297,98 @@ function ra(e, t) {
6292
6297
  ? 'fast'
6293
6298
  : 'standard';
6294
6299
  }
6295
- function na(e, t) {
6300
+ function la(e, t) {
6296
6301
  let i = e
6297
6302
  .trim()
6298
6303
  .toLowerCase()
6299
6304
  .replace(/-(?:unfiltered|uncensored)$/, '');
6300
6305
  if (i === 'seedance-2' || i === 'seedance-2-mini') {
6301
- let n = ra(i, t),
6302
- s = Ee.get(qe('seedance-2', n));
6306
+ let n = oa(i, t),
6307
+ s = Ee.get(Oe('seedance-2', n));
6303
6308
  return s ? s.slug : null;
6304
6309
  }
6305
- let a = ce.get(i) ?? Ee.get(qe(i));
6310
+ let a = ce.get(i) ?? Ee.get(Oe(i));
6306
6311
  return a ? a.slug : null;
6307
6312
  }
6308
- function oa(e, t) {
6309
- return ce.has(e) && !(sa.has(e) && t) ? e : na(e, t);
6313
+ function pa(e, t) {
6314
+ return ce.has(e) && !(da.has(e) && t) ? e : la(e, t);
6310
6315
  }
6311
- function W(e, t) {
6312
- let i = oa(e, t);
6316
+ function Y(e, t) {
6317
+ let i = pa(e, t);
6313
6318
  return i ? (ce.get(i) ?? null) : null;
6314
6319
  }
6315
6320
  function ue() {
6316
- return vt;
6321
+ return Kt;
6317
6322
  }
6318
- var Pt,
6319
- It,
6320
- vt,
6321
- ia,
6323
+ var qe,
6324
+ Tt,
6325
+ Mt,
6326
+ Kt,
6327
+ na,
6322
6328
  ce,
6323
6329
  Ee,
6324
- _t,
6325
- aa,
6326
- Ae,
6330
+ vt,
6327
6331
  sa,
6332
+ Ae,
6333
+ da,
6328
6334
  G = h(() => {
6329
6335
  'use strict';
6330
- kt();
6331
6336
  wt();
6337
+ xt();
6338
+ Pt();
6332
6339
  $e();
6333
- ((Pt = {
6340
+ ((qe = {
6334
6341
  ...de,
6335
- families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !le(t)) })),
6336
- models: de.models.filter((e) => !le(e.slug)),
6342
+ families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
6343
+ models: de.models.filter((e) => !W(e.slug)),
6337
6344
  }),
6338
- (It = pe.filter((e) => !le(e.slug))),
6339
- (vt = [...Pt.models, ...It]),
6340
- (ia = [
6341
- ...Pt.families,
6342
- ...xt
6343
- .map((e) => ({ ...e, models: It.filter((t) => t.family === e.slug).map((t) => t.slug) }))
6344
- .filter((e) => e.models.length > 0),
6345
+ (Tt = pe.filter((e) => !W(e.slug))),
6346
+ (Mt = _t.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
6347
+ (Kt = [...qe.models, ...Mt, ...Tt]),
6348
+ (na = [
6349
+ ...qe.families.map((e) => {
6350
+ let t = Mt.filter((i) => i.family === e.slug).map((i) => i.slug);
6351
+ return t.length ? { ...e, models: [...e.models, ...t] } : e;
6352
+ }),
6353
+ ...It.map((e) => ({
6354
+ ...e,
6355
+ models: Tt.filter((t) => t.family === e.slug).map((t) => t.slug),
6356
+ })).filter((e) => e.models.length > 0),
6345
6357
  ]),
6346
6358
  (ce = new Map()),
6347
6359
  (Ee = new Map()),
6348
- (_t = new Map()),
6349
- (aa = new Map()),
6360
+ (vt = new Map()),
6361
+ (sa = new Map()),
6350
6362
  (Ae = new Map()));
6351
- for (let e of vt) {
6352
- (ce.set(e.slug, e), Ee.set(qe(e.api.model, e.api.quality), e));
6353
- for (let t of e.variants) _t.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6363
+ for (let e of Kt) {
6364
+ (ce.set(e.slug, e), Ee.set(Oe(e.api.model, e.api.quality), e));
6365
+ for (let t of e.variants) vt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6354
6366
  for (let t of e.editVariants ?? [])
6355
- _t.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6356
- for (let t of e.addons ?? []) aa.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6367
+ vt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6368
+ for (let t of e.addons ?? []) sa.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6357
6369
  Ae.set(e.slug, e.family);
6358
6370
  }
6359
- for (let e of ia) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
6360
- sa = new Set(['seedance-2']);
6371
+ for (let e of na) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
6372
+ da = new Set(['seedance-2']);
6361
6373
  });
6362
6374
  function me(e) {
6363
6375
  let t = e.from?.variant;
6364
6376
  return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
6365
6377
  }
6366
- function Oe(e) {
6378
+ function Re(e) {
6367
6379
  if (e.endpoints?.length)
6368
- return e.editVariants?.length && e.endpoints.some((t) => t.id === Tt)
6369
- ? Tt
6380
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === St)
6381
+ ? St
6370
6382
  : (e.defaultEndpoint ?? e.endpoints[0].id);
6371
6383
  }
6372
- var Tt,
6373
- Re = h(() => {
6384
+ var St,
6385
+ Le = h(() => {
6374
6386
  'use strict';
6375
6387
  G();
6376
- Tt = 'dynamic';
6388
+ St = 'dynamic';
6377
6389
  });
6378
6390
  var fe,
6379
- Le = h(() => {
6391
+ De = h(() => {
6380
6392
  'use strict';
6381
6393
  fe = {
6382
6394
  'gemini-3-8-flash': 'gemini-3.8-flash',
@@ -6388,29 +6400,29 @@ var fe,
6388
6400
  'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
6389
6401
  };
6390
6402
  });
6391
- var Mt = h(() => {
6403
+ var Ct = h(() => {
6392
6404
  'use strict';
6393
6405
  });
6394
- function Kt(e, t) {
6395
- return typeof t == 'string' && (la[e]?.includes(t) ?? !1);
6406
+ function $t(e, t) {
6407
+ return typeof t == 'string' && (ca[e]?.includes(t) ?? !1);
6396
6408
  }
6397
- var la,
6398
- St = h(() => {
6409
+ var ca,
6410
+ Et = h(() => {
6399
6411
  'use strict';
6400
6412
  G();
6401
- Re();
6402
- Mt();
6403
- la = {};
6413
+ Le();
6414
+ Ct();
6415
+ ca = {};
6404
6416
  });
6405
- function Ct(e) {
6406
- return e === 'nano-banana-pro' ? da : pa;
6417
+ function At(e) {
6418
+ return e === 'nano-banana-pro' ? ua : ma;
6407
6419
  }
6408
- var da,
6409
- pa,
6410
- $t = h(() => {
6420
+ var ua,
6421
+ ma,
6422
+ Ot = h(() => {
6411
6423
  'use strict';
6412
- ((da = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6413
- (pa = [
6424
+ ((ua = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6425
+ (ma = [
6414
6426
  'auto',
6415
6427
  '1:1',
6416
6428
  '1:4',
@@ -6428,10 +6440,10 @@ var da,
6428
6440
  '21:9',
6429
6441
  ]));
6430
6442
  });
6431
- var Et,
6432
- At = h(() => {
6443
+ var qt,
6444
+ Rt = h(() => {
6433
6445
  'use strict';
6434
- Et = [
6446
+ qt = [
6435
6447
  'prompt',
6436
6448
  'system',
6437
6449
  'messages',
@@ -6445,10 +6457,10 @@ var Et,
6445
6457
  'endpoint',
6446
6458
  ];
6447
6459
  });
6448
- var qt,
6449
- Ot = h(() => {
6460
+ var Lt,
6461
+ Dt = h(() => {
6450
6462
  'use strict';
6451
- qt = [
6463
+ Lt = [
6452
6464
  {
6453
6465
  slug: 'claude-fable-5-1',
6454
6466
  family: 'fable-5-1',
@@ -6517,13 +6529,13 @@ var qt,
6517
6529
  },
6518
6530
  ];
6519
6531
  });
6520
- function Rt(e) {
6532
+ function Vt(e) {
6521
6533
  return `$${e}`;
6522
6534
  }
6523
- function De(e, t, i) {
6524
- return W(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
6535
+ function Ve(e, t, i) {
6536
+ return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
6525
6537
  }
6526
- function ca(e) {
6538
+ function fa(e) {
6527
6539
  return [
6528
6540
  {
6529
6541
  name: 'prompt',
@@ -6589,13 +6601,13 @@ function ca(e) {
6589
6601
  },
6590
6602
  ];
6591
6603
  }
6592
- function Lt() {
6604
+ function Nt() {
6593
6605
  return Object.fromEntries(
6594
- qt.map((e) => {
6595
- let t = De(e.slug, 'cheap', 'input'),
6596
- i = De(e.slug, 'cheap', 'output'),
6597
- a = De(e.slug, 'stable', 'input') != null,
6598
- n = t != null && i != null ? `${Rt(t)}/M in \xB7 ${Rt(i)}/M out` : '',
6606
+ Lt.map((e) => {
6607
+ let t = Ve(e.slug, 'cheap', 'input'),
6608
+ i = Ve(e.slug, 'cheap', 'output'),
6609
+ a = Ve(e.slug, 'stable', 'input') != null,
6610
+ n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
6599
6611
  s = {
6600
6612
  slug: e.slug,
6601
6613
  name: e.name,
@@ -6606,50 +6618,50 @@ function Lt() {
6606
6618
  priceFormatted: n,
6607
6619
  unit: '/M tokens',
6608
6620
  primaryToolName: 'run_task',
6609
- parameters: ca(a),
6621
+ parameters: fa(a),
6610
6622
  };
6611
6623
  return [e.slug, s];
6612
6624
  }),
6613
6625
  );
6614
6626
  }
6615
- var Dt = h(() => {
6627
+ var Ut = h(() => {
6616
6628
  'use strict';
6617
- Ot();
6629
+ Dt();
6618
6630
  G();
6619
6631
  });
6620
6632
  function ge(e) {
6621
- return e ? ma.get(e) : void 0;
6633
+ return e ? ha.get(e) : void 0;
6622
6634
  }
6623
- function Ft(e, t) {
6635
+ function Gt(e, t) {
6624
6636
  return !e.aspects?.length || e.sourceFramedModes?.includes(t)
6625
6637
  ? null
6626
6638
  : e.adaptiveModes?.includes(t)
6627
6639
  ? [...e.aspects, 'adaptive']
6628
6640
  : [...e.aspects];
6629
6641
  }
6630
- function Bt(e, t, i) {
6642
+ function Ht(e, t, i) {
6631
6643
  return e.modes.includes('motion_control')
6632
6644
  ? t === 'motion_control'
6633
- ? !ga.includes(i)
6634
- : !fa.includes(i)
6645
+ ? !ba.includes(i)
6646
+ : !ya.includes(i)
6635
6647
  : !0;
6636
6648
  }
6637
- var Vt,
6638
- ua,
6639
- Nt,
6640
- bn,
6641
- ma,
6642
- Ut,
6643
- Ve,
6644
- kn,
6645
- Ne,
6646
- fa,
6649
+ var Ft,
6647
6650
  ga,
6648
- Ue = h(() => {
6651
+ Bt,
6652
+ In,
6653
+ ha,
6654
+ jt,
6655
+ Ne,
6656
+ vn,
6657
+ Ue,
6658
+ ya,
6659
+ ba,
6660
+ Fe = h(() => {
6649
6661
  'use strict';
6650
- ((Vt = ['16:9', '9:16', '1:1', '21:9']),
6651
- (ua = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6652
- (Nt = [
6662
+ ((Ft = ['16:9', '9:16', '1:1', '21:9']),
6663
+ (ga = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6664
+ (Bt = [
6653
6665
  {
6654
6666
  slug: 'kling-v4',
6655
6667
  kind: 'video',
@@ -6657,7 +6669,7 @@ var Vt,
6657
6669
  promptMax: 26e3,
6658
6670
  duration: { min: 3, max: 30, default: 5 },
6659
6671
  heights: { '720p': 720, '1080p': 1080 },
6660
- aspects: Vt,
6672
+ aspects: Ft,
6661
6673
  sourceFramedModes: ['image_to_video'],
6662
6674
  adaptiveModes: ['multi_reference'],
6663
6675
  fps: 24,
@@ -6681,7 +6693,7 @@ var Vt,
6681
6693
  promptMax: 26e3,
6682
6694
  duration: { min: 3, max: 20, default: 5 },
6683
6695
  heights: { '720p': 720 },
6684
- aspects: [...Vt, '4:3', '3:4'],
6696
+ aspects: [...Ft, '4:3', '3:4'],
6685
6697
  sourceFramedModes: ['image_to_video'],
6686
6698
  adaptiveModes: ['multi_reference'],
6687
6699
  fps: 24,
@@ -6721,7 +6733,7 @@ var Vt,
6721
6733
  promptMax: 65535,
6722
6734
  duration: { min: 5, max: 15, default: 5 },
6723
6735
  heights: { '480p': 480, '768p': 768 },
6724
- aspects: ua,
6736
+ aspects: ga,
6725
6737
  fps: 24,
6726
6738
  audio: 'free',
6727
6739
  seed: !0,
@@ -6796,10 +6808,10 @@ var Vt,
6796
6808
  seed: !0,
6797
6809
  },
6798
6810
  ]),
6799
- (bn = Nt.map((e) => e.slug)),
6800
- (ma = new Map(Nt.map((e) => [e.slug, e]))));
6801
- ((Ut = 'EXAVITQu4vr4xnSDxMaL'),
6802
- (Ve = {
6811
+ (In = Bt.map((e) => e.slug)),
6812
+ (ha = new Map(Bt.map((e) => [e.slug, e]))));
6813
+ ((jt = 'EXAVITQu4vr4xnSDxMaL'),
6814
+ (Ne = {
6803
6815
  hpp4J3VqNfWAUOO0d1Us: 'Bella',
6804
6816
  CwhRBWXzGAHq8TQ4Fs17: 'Roger',
6805
6817
  EXAVITQu4vr4xnSDxMaL: 'Sarah',
@@ -6821,8 +6833,8 @@ var Vt,
6821
6833
  pqHfZKP75CvOlQylNhV4: 'Bill',
6822
6834
  pNInz6obpgDQGcFmaJgB: 'Adam',
6823
6835
  }),
6824
- (kn = Object.keys(Ve)),
6825
- (Ne = [
6836
+ (vn = Object.keys(Ne)),
6837
+ (Ue = [
6826
6838
  'mp3_44100_128',
6827
6839
  'mp3_22050_32',
6828
6840
  'mp3_24000_48',
@@ -6836,8 +6848,8 @@ var Vt,
6836
6848
  'opus_48000_128',
6837
6849
  'opus_48000_192',
6838
6850
  ]));
6839
- ((fa = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6840
- (ga = [
6851
+ ((ya = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6852
+ (ba = [
6841
6853
  'duration',
6842
6854
  'aspect_ratio',
6843
6855
  'generate_audio',
@@ -6849,7 +6861,7 @@ var Vt,
6849
6861
  'audios',
6850
6862
  ]));
6851
6863
  });
6852
- function ya() {
6864
+ function wa() {
6853
6865
  return [
6854
6866
  {
6855
6867
  name: 'image_url',
@@ -6877,7 +6889,7 @@ function ya() {
6877
6889
  },
6878
6890
  ];
6879
6891
  }
6880
- function ba(e) {
6892
+ function xa(e) {
6881
6893
  let t = e.duration,
6882
6894
  i = Object.keys(e.heights),
6883
6895
  a = e.sourceFramedModes?.length
@@ -6970,7 +6982,7 @@ function ba(e) {
6970
6982
  }
6971
6983
  return o;
6972
6984
  }
6973
- function ka(e) {
6985
+ function _a(e) {
6974
6986
  let t = Object.keys(e.sizes);
6975
6987
  return [
6976
6988
  {
@@ -6987,13 +6999,13 @@ function ka(e) {
6987
6999
  },
6988
7000
  ];
6989
7001
  }
6990
- function xa() {
7002
+ function Ia() {
6991
7003
  return [
6992
7004
  {
6993
7005
  name: 'voice_id',
6994
7006
  type: 'string',
6995
- default: Ut,
6996
- description: `text_to_speech: the ElevenLabs voice id, one of: ${wa}.`,
7007
+ default: jt,
7008
+ description: `text_to_speech: the ElevenLabs voice id, one of: ${Pa}.`,
6997
7009
  },
6998
7010
  {
6999
7011
  name: 'turns',
@@ -7001,7 +7013,7 @@ function xa() {
7001
7013
  description:
7002
7014
  'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
7003
7015
  },
7004
- { name: 'output_format', type: 'select', default: Ne[0], options: [...Ne] },
7016
+ { name: 'output_format', type: 'select', default: Ue[0], options: [...Ue] },
7005
7017
  { name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
7006
7018
  {
7007
7019
  name: 'similarity_boost',
@@ -7012,7 +7024,7 @@ function xa() {
7012
7024
  },
7013
7025
  ];
7014
7026
  }
7015
- function jt(e) {
7027
+ function zt(e) {
7016
7028
  let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
7017
7029
  i = [
7018
7030
  {
@@ -7027,26 +7039,26 @@ function jt(e) {
7027
7039
  required: !0,
7028
7040
  ...(e.modeRequired ? {} : { default: e.modes[0] }),
7029
7041
  options: [...e.modes],
7030
- description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ha[a]).join(' ')}`,
7042
+ description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ka[a]).join(' ')}`,
7031
7043
  },
7032
7044
  ];
7033
7045
  return (
7034
- e.kind === 'video' ? i.push(...ba(e)) : e.kind === 'image' ? i.push(...ka(e)) : i.push(...xa()),
7035
- e.modes.includes('motion_control') && i.push(...ya()),
7046
+ e.kind === 'video' ? i.push(...xa(e)) : e.kind === 'image' ? i.push(..._a(e)) : i.push(...Ia()),
7047
+ e.modes.includes('motion_control') && i.push(...wa()),
7036
7048
  e.seed &&
7037
7049
  i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
7038
7050
  i
7039
7051
  );
7040
7052
  }
7041
7053
  var L,
7042
- ha,
7043
- wa,
7044
- Gt = h(() => {
7054
+ ka,
7055
+ Pa,
7056
+ Jt = h(() => {
7045
7057
  'use strict';
7046
- Ue();
7058
+ Fe();
7047
7059
  ((L =
7048
7060
  '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.'),
7049
- (ha = {
7061
+ (ka = {
7050
7062
  text_to_video: 'text_to_video: from the prompt alone.',
7051
7063
  image_to_video: 'image_to_video: a start image in first_frame_image.',
7052
7064
  first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
@@ -7058,34 +7070,34 @@ var L,
7058
7070
  motion_control:
7059
7071
  'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
7060
7072
  }));
7061
- wa = Object.entries(Ve)
7073
+ Pa = Object.entries(Ne)
7062
7074
  .map(([e, t]) => `${e} (${t})`)
7063
7075
  .join(', ');
7064
7076
  });
7065
7077
  var he,
7066
- Ht,
7067
- Y,
7068
- zt,
7069
- Pn,
7070
- In,
7071
- vn,
7072
- Tn,
7073
- Jt = h(() => {
7078
+ Wt,
7079
+ X,
7080
+ Yt,
7081
+ Sn,
7082
+ Cn,
7083
+ $n,
7084
+ En,
7085
+ Xt = h(() => {
7074
7086
  'use strict';
7075
7087
  ((he = 'enhancor-ultrafine'),
7076
- (Ht = 'Enhancor Ultrafine'),
7077
- (Y = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7078
- (zt = 2),
7079
- (Pn = 24 * 1024 * 1024),
7080
- (In = 4096 * 4096),
7081
- (vn = 30 * 6e4),
7082
- (Tn = 120 * 6e4));
7088
+ (Wt = 'Enhancor Ultrafine'),
7089
+ (X = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7090
+ (Yt = 2),
7091
+ (Sn = 24 * 1024 * 1024),
7092
+ (Cn = 4096 * 4096),
7093
+ ($n = 30 * 6e4),
7094
+ (En = 120 * 6e4));
7083
7095
  });
7084
- var X,
7096
+ var Q,
7085
7097
  ye,
7086
- Fe = h(() => {
7098
+ Be = h(() => {
7087
7099
  'use strict';
7088
- ((X = [
7100
+ ((Q = [
7089
7101
  'seedance-2-5',
7090
7102
  'seedance-2-5-flash',
7091
7103
  'seedance-2',
@@ -7100,10 +7112,10 @@ var X,
7100
7112
  (ye =
7101
7113
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
7102
7114
  });
7103
- function Q(e) {
7115
+ function Z(e) {
7104
7116
  return `$${Number(e.toFixed(5))}`;
7105
7117
  }
7106
- function Ia(e) {
7118
+ function Ma(e) {
7107
7119
  if (e.kind === 'llm') {
7108
7120
  let t = e.defaultEndpoint,
7109
7121
  i = (s) =>
@@ -7116,19 +7128,19 @@ function Ia(e) {
7116
7128
  a = i('input'),
7117
7129
  n = i('output');
7118
7130
  return a && n
7119
- ? `${Q(a.price.starter)}/M in \xB7 ${Q(n.price.starter)}/M out`
7120
- : `from ${Q(me(e).price.starter)}/M tokens`;
7131
+ ? `${Z(a.price.starter)}/M in \xB7 ${Z(n.price.starter)}/M out`
7132
+ : `from ${Z(me(e).price.starter)}/M tokens`;
7121
7133
  }
7122
- return `from ${Q(me(e).price.starter)}${e.unit}`;
7134
+ return `from ${Z(me(e).price.starter)}${e.unit}`;
7123
7135
  }
7124
- function va(e, t) {
7136
+ function Ka(e, t) {
7125
7137
  let i = t.filter((a) => Number.isFinite(a) && a > 0);
7126
- return i.length ? `from ${Q(Math.min(...i))}${e}` : null;
7138
+ return i.length ? `from ${Z(Math.min(...i))}${e}` : null;
7127
7139
  }
7128
- function Zt(e) {
7140
+ function ii(e) {
7129
7141
  for (let t of J) {
7130
7142
  let i = ke[t],
7131
- a = i ? va(i.unit, e[t] ?? []) : null;
7143
+ a = i ? Ka(i.unit, e[t] ?? []) : null;
7132
7144
  i && a && (i.priceFormatted = a);
7133
7145
  }
7134
7146
  }
@@ -7144,13 +7156,13 @@ function A(e, t) {
7144
7156
  ...(t ? { description: t } : {}),
7145
7157
  };
7146
7158
  }
7147
- function ei(e) {
7159
+ function ai(e) {
7148
7160
  if (!e.endpoints?.length) return null;
7149
- let t = e.endpoints.filter((i) => Kt(e.slug, i.id));
7161
+ let t = e.endpoints.filter((i) => $t(e.slug, i.id));
7150
7162
  return {
7151
7163
  name: 'endpoint',
7152
7164
  type: 'select',
7153
- default: Oe(e),
7165
+ default: Re(e),
7154
7166
  options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
7155
7167
  description:
7156
7168
  (e.slug === 'gemini-3.1-pro-preview'
@@ -7159,20 +7171,20 @@ function ei(e) {
7159
7171
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
7160
7172
  };
7161
7173
  }
7162
- function Ma(e, t) {
7174
+ function Ca(e, t) {
7163
7175
  if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
7164
- let i = X.includes(e.api.model);
7165
- return [...t.filter((a) => !be.has(a.name)), i ? Je : Ta];
7176
+ let i = Q.includes(e.api.model);
7177
+ return [...t.filter((a) => !be.has(a.name)), i ? We : Sa];
7166
7178
  }
7167
- function Be(e, t) {
7179
+ function je(e, t) {
7168
7180
  let i = e.filter((n) => !be.has(n.name)),
7169
- a = [Je, ti];
7170
- return (a.push(We, Ye), [...i, ...a]);
7181
+ a = [We, ri];
7182
+ return (a.push(Ye, Xe), [...i, ...a]);
7171
7183
  }
7172
- function $a(e) {
7184
+ function Oa(e) {
7173
7185
  return [
7174
7186
  ...e
7175
- .filter((t) => !Sa.has(t.name) && !be.has(t.name))
7187
+ .filter((t) => !Ea.has(t.name) && !be.has(t.name))
7176
7188
  .map((t) => {
7177
7189
  if (t.name === 'resolution')
7178
7190
  return {
@@ -7184,30 +7196,30 @@ function $a(e) {
7184
7196
  ),
7185
7197
  }
7186
7198
  : {}),
7187
- description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Z}`,
7199
+ description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${ee}`,
7188
7200
  };
7189
- let i = Ca[t.name];
7201
+ let i = Aa[t.name];
7190
7202
  return i && typeof t.description == 'string'
7191
7203
  ? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
7192
7204
  : t;
7193
7205
  }),
7194
- Je,
7195
- ti,
7196
7206
  We,
7207
+ ri,
7197
7208
  Ye,
7209
+ Xe,
7198
7210
  ];
7199
7211
  }
7200
- function ii(e) {
7212
+ function ni(e) {
7201
7213
  return (
7202
7214
  e.startsWith('seedance-2-5-') &&
7203
7215
  e !== 'seedance-2-5-lite' &&
7204
7216
  !/-(creative-mode|unfiltered|uncensored)$/.test(e)
7205
7217
  );
7206
7218
  }
7207
- function Wt(e, t = {}) {
7219
+ function Qt(e, t = {}) {
7208
7220
  return [
7209
7221
  ...e
7210
- .filter((i) => !Ka.has(i.name) && !be.has(i.name))
7222
+ .filter((i) => !$a.has(i.name) && !be.has(i.name))
7211
7223
  .map((i) =>
7212
7224
  i.name === 'prompt'
7213
7225
  ? { ...i, required: !0 }
@@ -7217,7 +7229,7 @@ function Wt(e, t = {}) {
7217
7229
  ...(t.no4k && i.options
7218
7230
  ? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
7219
7231
  : {}),
7220
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Z}`,
7232
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ee}`,
7221
7233
  }
7222
7234
  : i,
7223
7235
  ),
@@ -7228,11 +7240,11 @@ function Wt(e, t = {}) {
7228
7240
  options: ['standard'],
7229
7241
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
7230
7242
  },
7231
- We,
7232
7243
  Ye,
7244
+ Xe,
7233
7245
  ];
7234
7246
  }
7235
- function je(e, t) {
7247
+ function Ge(e, t) {
7236
7248
  return [
7237
7249
  C('Text prompt describing the video.'),
7238
7250
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
@@ -7261,8 +7273,8 @@ function je(e, t) {
7261
7273
  ),
7262
7274
  ];
7263
7275
  }
7264
- function Ea(e) {
7265
- let t = ei(e);
7276
+ function qa(e) {
7277
+ let t = ai(e);
7266
7278
  return [
7267
7279
  C('Image prompt text. Supports complex composition and text instructions.'),
7268
7280
  ...(t ? [t] : []),
@@ -7275,14 +7287,14 @@ function Ea(e) {
7275
7287
  A(
7276
7288
  e,
7277
7289
  e.slug === 'gpt-image-2'
7278
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${yt}`
7290
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${bt}`
7279
7291
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
7280
7292
  ),
7281
7293
  {
7282
7294
  name: 'aspect_ratio',
7283
7295
  type: 'select',
7284
7296
  default: 'auto',
7285
- options: [...ht],
7297
+ options: [...yt],
7286
7298
  description:
7287
7299
  "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.",
7288
7300
  },
@@ -7329,7 +7341,7 @@ function Ea(e) {
7329
7341
  },
7330
7342
  ];
7331
7343
  }
7332
- function Aa(e) {
7344
+ function Ra(e) {
7333
7345
  return [
7334
7346
  C('Image prompt text.'),
7335
7347
  {
@@ -7337,7 +7349,7 @@ function Aa(e) {
7337
7349
  type: 'string[]',
7338
7350
  description: 'Images to edit or use as reference (up to 14).',
7339
7351
  },
7340
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Ct(e.slug)] },
7352
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...At(e.slug)] },
7341
7353
  A(e),
7342
7354
  {
7343
7355
  name: 'n',
@@ -7363,10 +7375,10 @@ function Aa(e) {
7363
7375
  },
7364
7376
  ];
7365
7377
  }
7366
- function La() {
7367
- let e = Et,
7378
+ function Na() {
7379
+ let e = qt,
7368
7380
  t = [];
7369
- for (let i of Xe(!0))
7381
+ for (let i of Qe(!0))
7370
7382
  e.includes(i.name) &&
7371
7383
  (t.push({
7372
7384
  ...i,
@@ -7388,12 +7400,12 @@ function La() {
7388
7400
  }));
7389
7401
  return t;
7390
7402
  }
7391
- function Da() {
7392
- return Xe(!0).map((e) =>
7403
+ function Ua() {
7404
+ return Qe(!0).map((e) =>
7393
7405
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
7394
7406
  );
7395
7407
  }
7396
- function Xe(e) {
7408
+ function Qe(e) {
7397
7409
  return [
7398
7410
  C('The user message or task.'),
7399
7411
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -7488,21 +7500,21 @@ function Xe(e) {
7488
7500
  },
7489
7501
  ];
7490
7502
  }
7491
- function Va(e) {
7492
- if (e.slug === 'seed-2-1-turbo') return Oa;
7493
- let t = ei(e);
7503
+ function Fa(e) {
7504
+ if (e.slug === 'seed-2-1-turbo') return Da;
7505
+ let t = ai(e);
7494
7506
  return [
7495
7507
  ...(e.slug === 'gemini-3.1-pro-preview'
7496
- ? La()
7508
+ ? Na()
7497
7509
  : e.slug === 'gemini-3.7-flash'
7498
- ? Da()
7499
- : e.slug === 'gpt-6-astra' || Ra.includes(e.slug)
7500
- ? Xe(e.slug !== 'gpt-6-astra')
7501
- : qa),
7510
+ ? Ua()
7511
+ : e.slug === 'gpt-6-astra' || Va.includes(e.slug)
7512
+ ? Qe(e.slug !== 'gpt-6-astra')
7513
+ : La),
7502
7514
  ...(t ? [t] : []),
7503
7515
  ];
7504
7516
  }
7505
- function Ge() {
7517
+ function He() {
7506
7518
  return {
7507
7519
  name: 'image',
7508
7520
  type: 'string',
@@ -7510,7 +7522,7 @@ function Ge() {
7510
7522
  description: 'The photo to fix: one JPEG or PNG URL.',
7511
7523
  };
7512
7524
  }
7513
- function Ua(e) {
7525
+ function ja(e) {
7514
7526
  return [
7515
7527
  {
7516
7528
  name: 'video_url',
@@ -7532,7 +7544,7 @@ function Ua(e) {
7532
7544
  },
7533
7545
  ];
7534
7546
  }
7535
- function Fa() {
7547
+ function Ga() {
7536
7548
  return [
7537
7549
  {
7538
7550
  name: 'mode',
@@ -7603,30 +7615,30 @@ function Fa() {
7603
7615
  },
7604
7616
  ];
7605
7617
  }
7606
- function Ba(e) {
7618
+ function Ha(e) {
7607
7619
  let t = e.slug;
7608
- if (e.family === 'tein-labs' && e.kind === 'image') return Fa();
7609
- if (pe.some((a) => a.slug === t)) return Ua(e);
7610
- if (e.kind === 'llm') return Va(e);
7611
- if (e.editVariants?.length) return Ea(e);
7620
+ if (e.family === 'tein-labs' && e.kind === 'image') return Ga();
7621
+ if (pe.some((a) => a.slug === t)) return ja(e);
7622
+ if (e.kind === 'llm') return Fa(e);
7623
+ if (e.editVariants?.length) return qa(e);
7612
7624
  let i = ge(t);
7613
- if (i) return jt(i);
7614
- if (ii(t)) return $a(He);
7625
+ if (i) return zt(i);
7626
+ if (ni(t)) return Oa(ze);
7615
7627
  switch (t) {
7616
7628
  case 'seedance-2-5':
7617
- return Be(He, t);
7629
+ return je(ze, t);
7618
7630
  case 'seedance-2-5-lite':
7619
- return Wt(He, { no4k: !0 });
7631
+ return Qt(ze, { no4k: !0 });
7620
7632
  case 'seedance-2':
7621
- return Be(Yt, t);
7633
+ return je(Zt, t);
7622
7634
  case 'seedance-2-lite':
7623
- return Wt(Yt);
7635
+ return Qt(Zt);
7624
7636
  case 'seedance-2-mini':
7625
- return Be(ja, t);
7637
+ return je(za, t);
7626
7638
  case 'nano-banana-2':
7627
7639
  case 'nano-banana-2.1':
7628
7640
  case 'nano-banana-pro':
7629
- return Aa(e);
7641
+ return Ra(e);
7630
7642
  case 'seedream-5-pro':
7631
7643
  return [
7632
7644
  C('Detailed description of the image to generate.'),
@@ -7860,7 +7872,7 @@ function Ba(e) {
7860
7872
  ];
7861
7873
  case 'enhancor-skin-fix-v1':
7862
7874
  return [
7863
- Ge(),
7875
+ He(),
7864
7876
  {
7865
7877
  name: 'mode',
7866
7878
  type: 'select',
@@ -7893,11 +7905,11 @@ function Ba(e) {
7893
7905
  max: 0.4,
7894
7906
  description: 'Portrait depth. Heavy only.',
7895
7907
  },
7896
- ...Na,
7908
+ ...Ba,
7897
7909
  ];
7898
7910
  case 'enhancor-skin-fix-v3':
7899
7911
  return [
7900
- Ge(),
7912
+ He(),
7901
7913
  {
7902
7914
  name: 'mask_image',
7903
7915
  type: 'string',
@@ -7937,7 +7949,7 @@ function Ba(e) {
7937
7949
  ];
7938
7950
  case 'enhancor-skin-fix-v4':
7939
7951
  return [
7940
- Ge(),
7952
+ He(),
7941
7953
  {
7942
7954
  name: 'mode',
7943
7955
  type: 'select',
@@ -7968,7 +7980,7 @@ function Ba(e) {
7968
7980
  ];
7969
7981
  case 'wan-3-0':
7970
7982
  case 'wan-3-0-prime':
7971
- return je(e, {
7983
+ return Ge(e, {
7972
7984
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
7973
7985
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
7974
7986
  minSec: 2,
@@ -7978,7 +7990,7 @@ function Ba(e) {
7978
7990
  });
7979
7991
  case 'happy-horse-1-1':
7980
7992
  case 'happy-horse-1-0':
7981
- return je(e, {
7993
+ return Ge(e, {
7982
7994
  modes:
7983
7995
  t === 'happy-horse-1-0'
7984
7996
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -7989,7 +8001,7 @@ function Ba(e) {
7989
8001
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
7990
8002
  });
7991
8003
  case 'minimax-h3':
7992
- return je(e, {
8004
+ return Ge(e, {
7993
8005
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
7994
8006
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
7995
8007
  minSec: 4,
@@ -8000,10 +8012,33 @@ function Ba(e) {
8000
8012
  return [C('Prompt text.')];
8001
8013
  }
8002
8014
  }
8003
- function Ga() {
8015
+ function Ja() {
8016
+ let e = (t, i) => ({
8017
+ name: t,
8018
+ type: 'slider',
8019
+ default: 50,
8020
+ min: 0,
8021
+ max: 100,
8022
+ step: 1,
8023
+ description: `${i} 0 to 100. 50 is the default look.`,
8024
+ });
8025
+ return [
8026
+ e('skin_strength', 'Strength: how much the skin is repainted. Only with skin_fix on.'),
8027
+ e('skin_texture', 'Texture: how much fine pore detail is added. Only with skin_fix on.'),
8028
+ e(
8029
+ 'grain',
8030
+ 'Grain: fine noise over the photo. Works in Fast and Full, with or without skin_fix.',
8031
+ ),
8032
+ e(
8033
+ 'sharpness',
8034
+ 'Sharpness: how crisp the edges are. Works in Fast and Full, with or without skin_fix.',
8035
+ ),
8036
+ ];
8037
+ }
8038
+ function Wa() {
8004
8039
  return {
8005
8040
  slug: he,
8006
- name: Ht,
8041
+ name: Wt,
8007
8042
  category: 'Image',
8008
8043
  kind: 'Image-to-Image',
8009
8044
  vendor: 'Enhancor',
@@ -8011,7 +8046,7 @@ function Ga() {
8011
8046
  '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).',
8012
8047
  priceFormatted: '',
8013
8048
  unit: '/img',
8014
- primaryToolName: Qt.image,
8049
+ primaryToolName: ti.image,
8015
8050
  parameters: [
8016
8051
  {
8017
8052
  name: 'image',
@@ -8037,44 +8072,45 @@ function Ga() {
8037
8072
  {
8038
8073
  name: 'scale',
8039
8074
  type: 'select',
8040
- default: String(zt),
8041
- options: Y.noSkin.map(String),
8042
- description: `Full only. ${Y.skin.join(', ')} with skin_fix on; also ${Y.noSkin.filter((e) => !Y.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
8075
+ default: String(Yt),
8076
+ options: X.noSkin.map(String),
8077
+ 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.`,
8043
8078
  },
8079
+ ...Ja(),
8044
8080
  ],
8045
8081
  };
8046
8082
  }
8047
- function ze(e, t = e.api.model) {
8083
+ function Je(e, t = e.api.model) {
8048
8084
  return {
8049
8085
  slug: t,
8050
8086
  name: e.name,
8051
- category: _a[e.kind],
8052
- kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Pa[e.kind],
8087
+ category: va[e.kind],
8088
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Ta[e.kind],
8053
8089
  vendor: e.vendor ?? '',
8054
8090
  description: e.desc ?? e.name,
8055
- priceFormatted: Ia(e),
8091
+ priceFormatted: Ma(e),
8056
8092
  unit: e.unit,
8057
- primaryToolName: Qt[e.kind],
8058
- parameters: Ma(e, Ba(e)),
8093
+ primaryToolName: ti[e.kind],
8094
+ parameters: Ca(e, Ha(e)),
8059
8095
  };
8060
8096
  }
8061
- function Ha() {
8097
+ function Ya() {
8062
8098
  let e = {};
8063
8099
  for (let t of ue())
8064
8100
  if (t.slug !== 'seedance-2-fast') {
8065
8101
  if (t.slug === 'seedance-2-mini') {
8066
- e['seedance-2-mini'] = ze(t, 'seedance-2-mini');
8102
+ e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
8067
8103
  continue;
8068
8104
  }
8069
8105
  if (t.slug === 'seedance-2') {
8070
- let i = ze(t);
8106
+ let i = Je(t);
8071
8107
  ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
8072
8108
  (e['seedance-2'] = i));
8073
8109
  continue;
8074
8110
  }
8075
- t.slug.startsWith('claude-') || (e[t.api.model] = ze(t));
8111
+ t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
8076
8112
  }
8077
- (Object.assign(e, Lt()), (e[he] = Ga()));
8113
+ (Object.assign(e, Nt()), (e[he] = Wa()));
8078
8114
  for (let [t, i] of Object.entries(fe))
8079
8115
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
8080
8116
  return e;
@@ -8085,15 +8121,15 @@ function we(e) {
8085
8121
  function H(e) {
8086
8122
  return ke[e] ?? null;
8087
8123
  }
8088
- function za(e, t, i) {
8124
+ function Xa(e, t, i) {
8089
8125
  if (e.startsWith('enhancor-skin-fix-') || e === he) return !1;
8090
- if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ii(e)) && t === 'duration') {
8126
+ if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ni(e)) && t === 'duration') {
8091
8127
  let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
8092
8128
  if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
8093
8129
  }
8094
8130
  if (
8095
- (t === 'max_tokens' && Xt(i.max_completion_tokens)) ||
8096
- (t === 'max_completion_tokens' && Xt(i.max_tokens))
8131
+ (t === 'max_tokens' && ei(i.max_completion_tokens)) ||
8132
+ (t === 'max_completion_tokens' && ei(i.max_tokens))
8097
8133
  )
8098
8134
  return !1;
8099
8135
  if (t === 'aspect_ratio') {
@@ -8101,124 +8137,124 @@ function za(e, t, i) {
8101
8137
  if (n) {
8102
8138
  let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8103
8139
  o = s ? s.replace(/-/g, '_') : n.modes[0];
8104
- if (n.modes.includes(o) && !Ft(n, o)) return !1;
8140
+ if (n.modes.includes(o) && !Gt(n, o)) return !1;
8105
8141
  }
8106
8142
  }
8107
8143
  let a = ge(e);
8108
8144
  if (a) {
8109
8145
  let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
8110
8146
  s = n ? n.replace(/-/g, '_') : a.modes[0];
8111
- if (a.modes.includes(s) && !Bt(a, s, t)) return !1;
8147
+ if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
8112
8148
  }
8113
8149
  return !0;
8114
8150
  }
8115
- function Xt(e) {
8151
+ function ei(e) {
8116
8152
  return e != null && e !== '';
8117
8153
  }
8118
- function ni(e, t) {
8154
+ function li(e, t) {
8119
8155
  let i = { ...t };
8120
8156
  if (e?.slug === 'seedance-2-5') {
8121
8157
  let a = (n) => typeof n != 'string' || !n.trim();
8122
- for (let n of Ja) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
8158
+ for (let n of Qa) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
8123
8159
  if (!a(i.finalize)) return i;
8124
8160
  }
8125
8161
  for (let a of e?.parameters ?? [])
8126
8162
  a.default !== void 0 &&
8127
8163
  i[a.name] === void 0 &&
8128
- za(e.slug, a.name, t) &&
8164
+ Xa(e.slug, a.name, t) &&
8129
8165
  (i[a.name] = a.default);
8130
8166
  return i;
8131
8167
  }
8132
8168
  function D() {
8133
8169
  return Object.values(ke);
8134
8170
  }
8135
- var _a,
8136
- Qt,
8137
- Pa,
8138
- C,
8139
- Je,
8140
- Ta,
8171
+ var va,
8141
8172
  ti,
8173
+ Ta,
8174
+ C,
8142
8175
  We,
8143
- Ye,
8144
- be,
8145
- Ka,
8146
8176
  Sa,
8147
- Ca,
8148
- qa,
8149
- Oa,
8150
- Ra,
8151
- Na,
8152
- Z,
8153
- He,
8154
- ai,
8155
8177
  ri,
8156
- Yt,
8157
- ja,
8178
+ Ye,
8179
+ Xe,
8180
+ be,
8181
+ $a,
8182
+ Ea,
8183
+ Aa,
8184
+ La,
8185
+ Da,
8186
+ Va,
8187
+ Ba,
8188
+ ee,
8189
+ ze,
8190
+ si,
8191
+ oi,
8192
+ Zt,
8193
+ za,
8158
8194
  ke,
8159
- Ja,
8160
- ee = h(() => {
8195
+ Qa,
8196
+ te = h(() => {
8161
8197
  'use strict';
8162
- bt();
8198
+ kt();
8163
8199
  Ce();
8164
8200
  G();
8165
- Re();
8166
- $e();
8167
8201
  Le();
8168
- St();
8169
- $t();
8170
- At();
8171
- Dt();
8172
- Ue();
8173
- Gt();
8174
- Jt();
8202
+ $e();
8203
+ De();
8204
+ Et();
8205
+ Ot();
8206
+ Rt();
8207
+ Ut();
8175
8208
  Fe();
8176
- ((_a = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8177
- (Qt = {
8209
+ Jt();
8210
+ Xt();
8211
+ Be();
8212
+ ((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8213
+ (ti = {
8178
8214
  video: 'generate_video',
8179
8215
  image: 'generate_image',
8180
8216
  audio: 'generate_audio',
8181
8217
  llm: 'run_task',
8182
8218
  }),
8183
- (Pa = {
8219
+ (Ta = {
8184
8220
  video: 'Text-to-Video',
8185
8221
  image: 'Text-to-Image',
8186
8222
  audio: 'Text-to-Audio',
8187
8223
  llm: 'Reasoning (LLM)',
8188
8224
  }));
8189
8225
  C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8190
- ((Je = {
8226
+ ((We = {
8191
8227
  name: 'creative_mode',
8192
8228
  type: 'boolean',
8193
8229
  default: !1,
8194
8230
  description:
8195
8231
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
8196
8232
  }),
8197
- (Ta = {
8233
+ (Sa = {
8198
8234
  name: 'creative_mode',
8199
8235
  type: 'boolean',
8200
8236
  default: !1,
8201
8237
  description: `Not available yet on this model: ${ye}.`,
8202
8238
  }),
8203
- (ti = {
8239
+ (ri = {
8204
8240
  name: 'priority',
8205
8241
  type: 'boolean',
8206
8242
  default: !1,
8207
8243
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
8208
8244
  }),
8209
- (We = {
8245
+ (Ye = {
8210
8246
  name: 'reference_roles',
8211
8247
  type: 'json',
8212
8248
  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).`,
8213
8249
  }),
8214
- (Ye = {
8250
+ (Xe = {
8215
8251
  name: 'auto_fit_images',
8216
8252
  type: 'boolean',
8217
8253
  description:
8218
8254
  '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.',
8219
8255
  }),
8220
8256
  (be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8221
- ((Ka = new Set([
8257
+ (($a = new Set([
8222
8258
  'quality',
8223
8259
  'bitrate_mode',
8224
8260
  'draft',
@@ -8227,7 +8263,7 @@ var _a,
8227
8263
  'draft_generation_id',
8228
8264
  'pass_faces',
8229
8265
  ])),
8230
- (Sa = new Set([
8266
+ (Ea = new Set([
8231
8267
  'quality',
8232
8268
  'bitrate_mode',
8233
8269
  'draft',
@@ -8235,12 +8271,12 @@ var _a,
8235
8271
  'draft_task_id',
8236
8272
  'draft_generation_id',
8237
8273
  ])),
8238
- (Ca = {
8274
+ (Aa = {
8239
8275
  images: 'up to 10',
8240
8276
  videos: 'up to 5; combined duration < 30s',
8241
8277
  audios: 'up to 5; combined duration < 30s',
8242
8278
  }));
8243
- ((qa = [
8279
+ ((La = [
8244
8280
  C('The user message or task.'),
8245
8281
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8246
8282
  {
@@ -8258,7 +8294,7 @@ var _a,
8258
8294
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
8259
8295
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
8260
8296
  ]),
8261
- (Oa = [
8297
+ (Da = [
8262
8298
  C('The user message or task.'),
8263
8299
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8264
8300
  {
@@ -8340,8 +8376,8 @@ var _a,
8340
8376
  description: 'Video frames read a second.',
8341
8377
  },
8342
8378
  ]),
8343
- (Ra = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8344
- Na = Object.entries({
8379
+ (Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8380
+ Ba = Object.entries({
8345
8381
  background: !1,
8346
8382
  skin: !1,
8347
8383
  nose: !1,
@@ -8367,8 +8403,8 @@ var _a,
8367
8403
  default: t,
8368
8404
  description: 'Keep this part out of the fix. Standard only.',
8369
8405
  }));
8370
- ((Z = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8371
- (He = [
8406
+ ((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8407
+ (ze = [
8372
8408
  {
8373
8409
  name: 'prompt',
8374
8410
  type: 'string',
@@ -8406,7 +8442,7 @@ var _a,
8406
8442
  type: 'select',
8407
8443
  default: '480p',
8408
8444
  options: ['480p', '720p', '1080p', '4k'],
8409
- 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}`,
8445
+ 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}`,
8410
8446
  },
8411
8447
  {
8412
8448
  name: 'aspect_ratio',
@@ -8517,19 +8553,19 @@ var _a,
8517
8553
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8518
8554
  },
8519
8555
  ]),
8520
- (ai = {
8556
+ (si = {
8521
8557
  name: 'images',
8522
8558
  type: 'string[]',
8523
8559
  description:
8524
8560
  '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.',
8525
8561
  }),
8526
- (ri = {
8562
+ (oi = {
8527
8563
  name: 'audios',
8528
8564
  type: 'string[]',
8529
8565
  description:
8530
8566
  '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.',
8531
8567
  }),
8532
- (Yt = [
8568
+ (Zt = [
8533
8569
  {
8534
8570
  name: 'prompt',
8535
8571
  type: 'string',
@@ -8573,7 +8609,7 @@ var _a,
8573
8609
  type: 'select',
8574
8610
  default: '480p',
8575
8611
  options: ['480p', '720p', '1080p', '4k'],
8576
- description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Z}`,
8612
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ee}`,
8577
8613
  },
8578
8614
  {
8579
8615
  name: 'bitrate_mode',
@@ -8607,8 +8643,8 @@ var _a,
8607
8643
  description:
8608
8644
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8609
8645
  },
8610
- ai,
8611
- ri,
8646
+ si,
8647
+ oi,
8612
8648
  {
8613
8649
  name: 'first_frame_image',
8614
8650
  type: 'string',
@@ -8629,7 +8665,7 @@ var _a,
8629
8665
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8630
8666
  },
8631
8667
  ]),
8632
- (ja = [
8668
+ (za = [
8633
8669
  {
8634
8670
  name: 'prompt',
8635
8671
  type: 'string',
@@ -8650,7 +8686,7 @@ var _a,
8650
8686
  type: 'select',
8651
8687
  default: '480p',
8652
8688
  options: ['480p', '720p'],
8653
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Z}`,
8689
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ee}`,
8654
8690
  },
8655
8691
  {
8656
8692
  name: 'bitrate_mode',
@@ -8684,8 +8720,8 @@ var _a,
8684
8720
  description:
8685
8721
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8686
8722
  },
8687
- ai,
8688
- ri,
8723
+ si,
8724
+ oi,
8689
8725
  {
8690
8726
  name: 'first_frame_image',
8691
8727
  type: 'string',
@@ -8700,53 +8736,53 @@ var _a,
8700
8736
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8701
8737
  },
8702
8738
  ]));
8703
- ke = Ha();
8704
- Ja = ['draft_task_id', 'draft_generation_id'];
8739
+ ke = Ya();
8740
+ Qa = ['draft_task_id', 'draft_generation_id'];
8705
8741
  });
8706
8742
  function xe(e) {
8707
8743
  let t = '/v1/pricing/models',
8708
8744
  i = e?.trim();
8709
8745
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
8710
8746
  }
8711
- var et = h(() => {
8747
+ var tt = h(() => {
8712
8748
  'use strict';
8713
8749
  });
8714
- function Pi(e) {
8750
+ function Ti(e) {
8715
8751
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
8716
8752
  }
8717
- function Ii(e) {
8753
+ function Mi(e) {
8718
8754
  let t = ue().filter((s) => s.kind === e && s.unfiltered != null),
8719
- i = t.filter((s) => X.includes(s.api.model)).map((s) => s.name),
8720
- a = t.filter((s) => !X.includes(s.api.model)).map((s) => s.name);
8755
+ i = t.filter((s) => Q.includes(s.api.model)).map((s) => s.name),
8756
+ a = t.filter((s) => !Q.includes(s.api.model)).map((s) => s.name);
8721
8757
  return [
8722
8758
  ...(i.length
8723
- ? [`${Pi(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8759
+ ? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
8724
8760
  : []),
8725
- ...(a.length ? [`Not available yet on ${Pi(a)}: ${ye}.`] : []),
8761
+ ...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
8726
8762
  'The Acceptable Use Policy applies.',
8727
8763
  ].join(' ');
8728
8764
  }
8729
- function Ir(e) {
8730
- if (kr.has(e.name)) return e;
8765
+ function Kr(e) {
8766
+ if (Pr.has(e.name)) return e;
8731
8767
  let t = e.inputSchema.properties;
8732
8768
  return !t || t.callback_url
8733
8769
  ? e
8734
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: br } } };
8770
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
8735
8771
  }
8736
- function vr(e) {
8772
+ function Sr(e) {
8737
8773
  let t = e.inputSchema.properties;
8738
8774
  if (!t) return e;
8739
8775
  let i = !1,
8740
8776
  a = {};
8741
8777
  for (let [n, s] of Object.entries(t))
8742
- vi.has(n) && s.type === 'string' && !s.format
8778
+ Ki.has(n) && s.type === 'string' && !s.format
8743
8779
  ? ((a[n] = { ...s, format: 'uri' }), (i = !0))
8744
- : vi.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8780
+ : Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8745
8781
  ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
8746
8782
  : (a[n] = s);
8747
8783
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
8748
8784
  }
8749
- function Tr(e) {
8785
+ function Cr(e) {
8750
8786
  switch (e.type) {
8751
8787
  case 'string':
8752
8788
  return {
@@ -8801,11 +8837,11 @@ function Tr(e) {
8801
8837
  return { type: 'string', description: e.description };
8802
8838
  }
8803
8839
  }
8804
- function Mr(e, t) {
8840
+ function $r(e, t) {
8805
8841
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
8806
8842
  a = {},
8807
8843
  n = [];
8808
- for (let o of e.parameters) ((a[o.name] = Tr(o)), o.required && n.push(o.name));
8844
+ for (let o of e.parameters) ((a[o.name] = Cr(o)), o.required && n.push(o.name));
8809
8845
  let s = {
8810
8846
  type: 'object',
8811
8847
  properties: a,
@@ -8818,7 +8854,7 @@ function Mr(e, t) {
8818
8854
  inputSchema: s,
8819
8855
  };
8820
8856
  }
8821
- function Kr() {
8857
+ function Er() {
8822
8858
  let e = D().filter((p) => p.category === 'Image' && !we(p)),
8823
8859
  t = D().filter((p) => p.category === 'Video'),
8824
8860
  i = D().filter((p) => p.category === 'Text'),
@@ -8909,7 +8945,7 @@ function Kr() {
8909
8945
  maximum: 2147483647,
8910
8946
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
8911
8947
  },
8912
- creative_mode: { type: 'boolean', description: Ii('image') },
8948
+ creative_mode: { type: 'boolean', description: Mi('image') },
8913
8949
  },
8914
8950
  required: ['prompt'],
8915
8951
  additionalProperties: !0,
@@ -8946,7 +8982,7 @@ function Kr() {
8946
8982
  description:
8947
8983
  "Video resolution, where the model takes it (see each model tool). Left out: the model's own default, its lowest price.",
8948
8984
  },
8949
- creative_mode: { type: 'boolean', description: Ii('video') },
8985
+ creative_mode: { type: 'boolean', description: Mi('video') },
8950
8986
  priority: {
8951
8987
  type: 'boolean',
8952
8988
  description:
@@ -9082,10 +9118,10 @@ function Kr() {
9082
9118
  additionalProperties: !0,
9083
9119
  },
9084
9120
  },
9085
- d = Sr();
9086
- return [n, s, o, u, l, d, c, wr, ...Ti];
9121
+ d = Ar();
9122
+ return [n, s, o, u, l, d, c, Ir, ...Si];
9087
9123
  }
9088
- function Sr() {
9124
+ function Ar() {
9089
9125
  return {
9090
9126
  name: 'upload_asset',
9091
9127
  description:
@@ -9132,31 +9168,31 @@ function Sr() {
9132
9168
  },
9133
9169
  };
9134
9170
  }
9135
- function st() {
9136
- let e = Kr(),
9137
- t = D().map((i) => Mr(i));
9138
- return [...e, ...t].map(Ir).map(vr);
9171
+ function ot() {
9172
+ let e = Er(),
9173
+ t = D().map((i) => $r(i));
9174
+ return [...e, ...t].map(Kr).map(Sr);
9139
9175
  }
9140
- var br,
9141
- kr,
9142
- wr,
9143
- xr,
9144
- _r,
9176
+ var _r,
9145
9177
  Pr,
9146
- Ti,
9147
- Cs,
9148
- vi,
9149
- Mi = h(() => {
9178
+ Ir,
9179
+ vr,
9180
+ Tr,
9181
+ Mr,
9182
+ Si,
9183
+ Rs,
9184
+ Ki,
9185
+ Ci = h(() => {
9150
9186
  'use strict';
9151
9187
  G();
9152
- Fe();
9153
- ee();
9154
- ((br = {
9188
+ Be();
9189
+ te();
9190
+ ((_r = {
9155
9191
  type: 'string',
9156
9192
  description:
9157
9193
  '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.',
9158
9194
  }),
9159
- (kr = new Set([
9195
+ (Pr = new Set([
9160
9196
  'upload_asset',
9161
9197
  'upload_media',
9162
9198
  'upload_image',
@@ -9167,7 +9203,7 @@ var br,
9167
9203
  'get_usage',
9168
9204
  'get_balance_history',
9169
9205
  ])),
9170
- (wr = {
9206
+ (Ir = {
9171
9207
  name: 'get_pricing',
9172
9208
  description:
9173
9209
  '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.',
@@ -9182,13 +9218,13 @@ var br,
9182
9218
  additionalProperties: !1,
9183
9219
  },
9184
9220
  }),
9185
- (xr = {
9221
+ (vr = {
9186
9222
  name: 'get_balance',
9187
9223
  description:
9188
9224
  "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.",
9189
9225
  inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
9190
9226
  }),
9191
- (_r = {
9227
+ (Tr = {
9192
9228
  name: 'get_usage',
9193
9229
  description:
9194
9230
  "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.",
@@ -9219,7 +9255,7 @@ var br,
9219
9255
  additionalProperties: !1,
9220
9256
  },
9221
9257
  }),
9222
- (Pr = {
9258
+ (Mr = {
9223
9259
  name: 'get_balance_history',
9224
9260
  description:
9225
9261
  "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.",
@@ -9237,9 +9273,9 @@ var br,
9237
9273
  additionalProperties: !1,
9238
9274
  },
9239
9275
  }),
9240
- (Ti = [xr, _r, Pr]),
9241
- (Cs = new Set(Ti.map((e) => e.name))));
9242
- vi = new Set([
9276
+ (Si = [vr, Tr, Mr]),
9277
+ (Rs = new Set(Si.map((e) => e.name))));
9278
+ Ki = new Set([
9243
9279
  'image',
9244
9280
  'images',
9245
9281
  'image_url',
@@ -9256,19 +9292,19 @@ var br,
9256
9292
  'lipsyncing_audio',
9257
9293
  ]);
9258
9294
  });
9259
- var Li = {};
9260
- Gi(Li, {
9261
- forgetToolSchemas: () => qr,
9262
- jsonRpcAnswer: () => $i,
9263
- preprocessLocalFiles: () => Oi,
9264
- startStdioServer: () => Ri,
9295
+ var Ni = {};
9296
+ Ji(Ni, {
9297
+ forgetToolSchemas: () => Dr,
9298
+ jsonRpcAnswer: () => Oi,
9299
+ preprocessLocalFiles: () => Di,
9300
+ startStdioServer: () => Vi,
9265
9301
  });
9266
- function Cr(e) {
9302
+ function Or(e) {
9267
9303
  let t = (i) =>
9268
9304
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
9269
9305
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
9270
9306
  }
9271
- function $i(e, t, i) {
9307
+ function Oi(e, t, i) {
9272
9308
  let a = e?.id,
9273
9309
  n = a == null,
9274
9310
  s = null;
@@ -9277,7 +9313,7 @@ function $i(e, t, i) {
9277
9313
  } catch {
9278
9314
  s = null;
9279
9315
  }
9280
- if (s !== null && Cr(s)) return n ? null : s;
9316
+ if (s !== null && Or(s)) return n ? null : s;
9281
9317
  if (n) return null;
9282
9318
  if (!i && t >= 200 && t < 300) return;
9283
9319
  let o = s?.error,
@@ -9298,12 +9334,12 @@ function $i(e, t, i) {
9298
9334
  },
9299
9335
  };
9300
9336
  }
9301
- function $r() {
9337
+ function qr() {
9302
9338
  let e = process.argv.slice(2),
9303
9339
  t = e.indexOf('--api-key');
9304
9340
  return S(t >= 0 ? e[t + 1] : void 0);
9305
9341
  }
9306
- async function Ei(e, t, i) {
9342
+ async function qi(e, t, i) {
9307
9343
  let a = z.default.resolve(e);
9308
9344
  if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
9309
9345
  throw new Error(`File not found: ${e}`);
@@ -9332,15 +9368,15 @@ async function Ei(e, t, i) {
9332
9368
  mimeType: c.mime_type || c.mimeType || 'image/png',
9333
9369
  };
9334
9370
  }
9335
- function Ai(e) {
9336
- return Er.has(z.default.extname(e).toLowerCase());
9371
+ function Ri(e) {
9372
+ return Rr.has(z.default.extname(e).toLowerCase());
9337
9373
  }
9338
- function qi(e) {
9374
+ function Li(e) {
9339
9375
  return new Error(
9340
9376
  `Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
9341
9377
  );
9342
9378
  }
9343
- function Ar(e) {
9379
+ function Lr(e) {
9344
9380
  let t = e.trim();
9345
9381
  if (
9346
9382
  !t ||
@@ -9353,22 +9389,22 @@ function Ar(e) {
9353
9389
  let i = z.default.resolve(t);
9354
9390
  return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
9355
9391
  }
9356
- function lt(e) {
9392
+ function dt(e) {
9357
9393
  if (Array.isArray(e))
9358
9394
  for (let t of e) {
9359
9395
  let i = t;
9360
9396
  typeof i.name == 'string' &&
9361
9397
  i.inputSchema &&
9362
9398
  typeof i.inputSchema == 'object' &&
9363
- ae.set(i.name, i.inputSchema);
9399
+ re.set(i.name, i.inputSchema);
9364
9400
  }
9365
9401
  }
9366
- function qr() {
9367
- (ae.clear(), (ot = 0));
9402
+ function Dr() {
9403
+ (re.clear(), (lt = 0));
9368
9404
  }
9369
- async function Or(e, t) {
9370
- if (!(Date.now() - ot < 6e4)) {
9371
- ot = Date.now();
9405
+ async function Vr(e, t) {
9406
+ if (!(Date.now() - lt < 6e4)) {
9407
+ lt = Date.now();
9372
9408
  try {
9373
9409
  let a = await (
9374
9410
  await fetch(e, {
@@ -9378,39 +9414,39 @@ async function Or(e, t) {
9378
9414
  signal: AbortSignal.timeout(1e4),
9379
9415
  })
9380
9416
  ).json();
9381
- lt(a.result?.tools);
9417
+ dt(a.result?.tools);
9382
9418
  } catch {}
9383
9419
  }
9384
9420
  }
9385
- function Rr(e) {
9421
+ function Nr(e) {
9386
9422
  return e
9387
9423
  ? e.type === 'string'
9388
9424
  ? e.format === 'uri'
9389
9425
  : e.type === 'array' && e.items?.format === 'uri'
9390
9426
  : !1;
9391
9427
  }
9392
- async function Ki(e, t, i) {
9428
+ async function $i(e, t, i) {
9393
9429
  if (typeof e != 'string') return e;
9394
- let a = Ar(e);
9430
+ let a = Lr(e);
9395
9431
  if (!a) return e;
9396
- if (!Ai(a)) throw qi(a);
9397
- return (await Ei(a, t, i)).url;
9432
+ if (!Ri(a)) throw Li(a);
9433
+ return (await qi(a, t, i)).url;
9398
9434
  }
9399
- async function Oi(e, t, i, a, n) {
9400
- (ae.size === 0 && lt(st()), ae.has(e) || (await Or(n, i)));
9401
- let s = ae.get(e)?.properties;
9435
+ async function Di(e, t, i, a, n) {
9436
+ (re.size === 0 && dt(ot()), re.has(e) || (await Vr(n, i)));
9437
+ let s = re.get(e)?.properties;
9402
9438
  if (!s) return t;
9403
9439
  let o = { ...t };
9404
9440
  for (let [u, l] of Object.entries(t))
9405
- if (Rr(s[u]))
9441
+ if (Nr(s[u]))
9406
9442
  if (Array.isArray(l)) {
9407
9443
  let c = [];
9408
- for (let d of l) c.push(await Ki(d, i, a));
9444
+ for (let d of l) c.push(await $i(d, i, a));
9409
9445
  o[u] = c;
9410
- } else o[u] = await Ki(l, i, a);
9446
+ } else o[u] = await $i(l, i, a);
9411
9447
  return o;
9412
9448
  }
9413
- function Lr(e) {
9449
+ function Ur(e) {
9414
9450
  let t = e.id ?? null;
9415
9451
  switch (e.method) {
9416
9452
  case 'initialize':
@@ -9428,7 +9464,7 @@ function Lr(e) {
9428
9464
  case 'ping':
9429
9465
  return { jsonrpc: '2.0', id: t, result: {} };
9430
9466
  case 'tools/list':
9431
- return { jsonrpc: '2.0', id: t, result: { tools: st() } };
9467
+ return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
9432
9468
  case 'tools/call':
9433
9469
  return {
9434
9470
  jsonrpc: '2.0',
@@ -9451,13 +9487,13 @@ function Lr(e) {
9451
9487
  };
9452
9488
  }
9453
9489
  }
9454
- async function Ri() {
9455
- if (Si) return;
9456
- Si = !0;
9457
- let e = $r(),
9490
+ async function Vi() {
9491
+ if (Ei) return;
9492
+ Ei = !0;
9493
+ let e = qr(),
9458
9494
  t = w(),
9459
9495
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
9460
- (Ci.default
9496
+ (Ai.default
9461
9497
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
9462
9498
  .on('line', async (n) => {
9463
9499
  let s = n.trim();
@@ -9518,8 +9554,8 @@ async function Ri() {
9518
9554
  try {
9519
9555
  let p = z.default.resolve(d.trim());
9520
9556
  if (V.default.existsSync(p) && V.default.statSync(p).isFile() && e) {
9521
- if (!Ai(p)) throw qi(p);
9522
- let m = await Ei(p, e, t),
9557
+ if (!Ri(p)) throw Li(p);
9558
+ let m = await qi(p, e, t),
9523
9559
  y = (m.sizeBytes / 1024).toFixed(1),
9524
9560
  _e =
9525
9561
  m.mimeType.startsWith('image/') ||
@@ -9575,7 +9611,7 @@ Pass this URL to any Tein generation tool.`,
9575
9611
  }
9576
9612
  if (e)
9577
9613
  try {
9578
- o.params.arguments = await Oi(String(l), c, e, t, i);
9614
+ o.params.arguments = await Di(String(l), c, e, t, i);
9579
9615
  } catch (d) {
9580
9616
  let p = d instanceof Error ? d.message : String(d);
9581
9617
  process.stdout.write(
@@ -9606,10 +9642,10 @@ Pass this URL to any Tein generation tool.`,
9606
9642
  body: JSON.stringify(o),
9607
9643
  }),
9608
9644
  c = await l.text(),
9609
- d = $i(o, l.status, c);
9645
+ d = Oi(o, l.status, c);
9610
9646
  if (d === null) return;
9611
9647
  if (d) {
9612
- (o?.method === 'tools/list' && lt(d.result?.tools),
9648
+ (o?.method === 'tools/list' && dt(d.result?.tools),
9613
9649
  process.stdout.write(
9614
9650
  JSON.stringify(d) +
9615
9651
  `
@@ -9618,7 +9654,7 @@ Pass this URL to any Tein generation tool.`,
9618
9654
  return;
9619
9655
  }
9620
9656
  } catch {}
9621
- let u = Lr(o);
9657
+ let u = Ur(o);
9622
9658
  u !== null &&
9623
9659
  process.stdout.write(
9624
9660
  JSON.stringify(u) +
@@ -9643,21 +9679,21 @@ Pass this URL to any Tein generation tool.`,
9643
9679
  }
9644
9680
  var V,
9645
9681
  z,
9646
- Ci,
9647
- Er,
9648
- ae,
9649
- ot,
9650
- Si,
9651
- Di = h(() => {
9682
+ Ai,
9683
+ Rr,
9684
+ re,
9685
+ lt,
9686
+ Ei,
9687
+ Ui = h(() => {
9652
9688
  'use strict';
9653
9689
  ((V = T(require('node:fs'))),
9654
9690
  (z = T(require('node:path'))),
9655
- (Ci = T(require('node:readline'))));
9656
- et();
9657
- Mi();
9691
+ (Ai = T(require('node:readline'))));
9692
+ tt();
9693
+ Ci();
9658
9694
  E();
9659
- re();
9660
- Er = new Set([
9695
+ ne();
9696
+ Rr = new Set([
9661
9697
  '.png',
9662
9698
  '.jpg',
9663
9699
  '.jpeg',
@@ -9683,20 +9719,20 @@ var V,
9683
9719
  '.flac',
9684
9720
  '.opus',
9685
9721
  ]);
9686
- ((ae = new Map()), (ot = 0));
9687
- Si = !1;
9722
+ ((re = new Map()), (lt = 0));
9723
+ Ei = !1;
9688
9724
  require.main === module &&
9689
- Ri().catch((e) => {
9725
+ Vi().catch((e) => {
9690
9726
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
9691
9727
  `),
9692
9728
  process.exit(1));
9693
9729
  });
9694
9730
  });
9695
- var zi =
9731
+ var Yi =
9696
9732
  !process.env.NO_COLOR &&
9697
9733
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
9698
9734
  function x(e, t) {
9699
- return (i) => (zi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9735
+ return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
9700
9736
  }
9701
9737
  var r = {
9702
9738
  bold: x(1, 22),
@@ -9781,12 +9817,12 @@ var r = {
9781
9817
  }
9782
9818
  };
9783
9819
  var U = T(require('node:fs')),
9784
- q = T(require('node:path'));
9785
- var ne = T(require('node:fs')),
9786
- mt = T(require('node:path')),
9787
- ft = require('node:stream/promises');
9788
- re();
9789
- var Xi = new Set([
9820
+ O = T(require('node:path'));
9821
+ var se = T(require('node:fs')),
9822
+ ft = T(require('node:path')),
9823
+ gt = require('node:stream/promises');
9824
+ ne();
9825
+ var ea = new Set([
9790
9826
  'account_suspended',
9791
9827
  'account_terminated',
9792
9828
  'creative_mode_restricted',
@@ -9794,7 +9830,7 @@ var Xi = new Set([
9794
9830
  'workspace_paused',
9795
9831
  ]),
9796
9832
  v = 1,
9797
- Qi = 3,
9833
+ ta = 3,
9798
9834
  b = class extends Error {
9799
9835
  constructor(t, i, a, n = {}) {
9800
9836
  (super(i),
@@ -9804,10 +9840,10 @@ var Xi = new Set([
9804
9840
  (this.fields = n));
9805
9841
  }
9806
9842
  get exitCode() {
9807
- return this.code && Xi.has(this.code) ? Qi : v;
9843
+ return this.code && ea.has(this.code) ? ta : v;
9808
9844
  }
9809
9845
  };
9810
- function Zi(e, t, i) {
9846
+ function ia(e, t, i) {
9811
9847
  let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
9812
9848
  if (!i || typeof i != 'object') return new b(e, a);
9813
9849
  let n = i;
@@ -9820,13 +9856,13 @@ function Zi(e, t, i) {
9820
9856
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
9821
9857
  return new b(e, c, typeof o == 'string' ? o : void 0, l);
9822
9858
  }
9823
- function ct(e) {
9859
+ function ut(e) {
9824
9860
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
9825
9861
  }
9826
9862
  function K(e) {
9827
9863
  let t = [e.message],
9828
- i = ct(e.fields.required),
9829
- a = ct(e.fields.balance);
9864
+ i = ut(e.fields.required),
9865
+ a = ut(e.fields.balance);
9830
9866
  (i || a) &&
9831
9867
  t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
9832
9868
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -9834,19 +9870,19 @@ function K(e) {
9834
9870
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
9835
9871
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
9836
9872
  }
9837
- function ea(e) {
9873
+ function aa(e) {
9838
9874
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
9839
9875
  ? 'video'
9840
9876
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
9841
9877
  ? 'audio'
9842
9878
  : 'image';
9843
9879
  }
9844
- function ut(e) {
9880
+ function mt(e) {
9845
9881
  let t = [];
9846
9882
  for (let i of e.data ?? [])
9847
9883
  typeof i.message?.content == 'string'
9848
9884
  ? t.push({ type: 'text', text: i.message.content })
9849
- : i.url && t.push({ type: ea(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
9885
+ : i.url && t.push({ type: aa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
9850
9886
  return t;
9851
9887
  }
9852
9888
  var M = class {
@@ -9872,7 +9908,7 @@ var M = class {
9872
9908
  try {
9873
9909
  s = await n.json();
9874
9910
  } catch {}
9875
- throw Zi(n.status, n.statusText, s);
9911
+ throw ia(n.status, n.statusText, s);
9876
9912
  }
9877
9913
  return await n.json();
9878
9914
  }
@@ -9886,7 +9922,7 @@ var M = class {
9886
9922
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
9887
9923
  ? n
9888
9924
  : 'processing',
9889
- o = ut(a);
9925
+ o = mt(a);
9890
9926
  return {
9891
9927
  request_id: a.request_id || a.id || '',
9892
9928
  model: a.model,
@@ -9904,7 +9940,7 @@ var M = class {
9904
9940
  a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
9905
9941
  ? a
9906
9942
  : 'processing',
9907
- s = ut(i),
9943
+ s = mt(i),
9908
9944
  o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
9909
9945
  return {
9910
9946
  request_id: i.id || t,
@@ -9933,10 +9969,10 @@ var M = class {
9933
9969
  async downloadOutput(t, i) {
9934
9970
  let a = await fetch(t);
9935
9971
  if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
9936
- let n = mt.default.dirname(i);
9937
- ne.default.existsSync(n) || ne.default.mkdirSync(n, { recursive: !0 });
9938
- let s = ne.default.createWriteStream(i);
9939
- return (await (0, ft.pipeline)(a.body, s), i);
9972
+ let n = ft.default.dirname(i);
9973
+ se.default.existsSync(n) || se.default.mkdirSync(n, { recursive: !0 });
9974
+ let s = se.default.createWriteStream(i);
9975
+ return (await (0, gt.pipeline)(a.body, s), i);
9940
9976
  }
9941
9977
  };
9942
9978
  E();
@@ -9948,43 +9984,43 @@ function Se(e) {
9948
9984
  a = Math.round(Number((e * i).toFixed(6))) / i;
9949
9985
  return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
9950
9986
  }
9951
- ee();
9952
- var si = ['images', 'input_images', 'videos', 'audios'];
9953
- function Wa(e) {
9954
- for (let t of si) typeof e[t] == 'string' && (e[t] = [e[t]]);
9987
+ te();
9988
+ var di = ['images', 'input_images', 'videos', 'audios'];
9989
+ function Za(e) {
9990
+ for (let t of di) typeof e[t] == 'string' && (e[t] = [e[t]]);
9955
9991
  }
9956
- function Ya(e) {
9992
+ function er(e) {
9957
9993
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
9958
- let t = q.default.resolve(e);
9994
+ let t = O.default.resolve(e);
9959
9995
  return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
9960
9996
  }
9961
- async function Xa(e, t) {
9962
- for (let i of si) {
9997
+ async function tr(e, t) {
9998
+ for (let i of di) {
9963
9999
  if (!Array.isArray(e[i])) continue;
9964
10000
  let a = [];
9965
10001
  for (let n of e[i]) {
9966
10002
  if (typeof n != 'string') continue;
9967
- let s = Ya(n);
10003
+ let s = er(n);
9968
10004
  a.push(s ? await t(s) : n);
9969
10005
  }
9970
10006
  e[i] = a;
9971
10007
  }
9972
10008
  }
9973
- var te = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
9974
- function Qa(e) {
10009
+ var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10010
+ function ir(e) {
9975
10011
  if (e.count === void 0 || e.count === !0) return 1;
9976
10012
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
9977
- i = te.enterprise;
10013
+ i = ie.enterprise;
9978
10014
  return (
9979
10015
  (!Number.isInteger(t) || t < 1 || t > i) &&
9980
10016
  (process.stderr
9981
- .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.
10017
+ .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.
9982
10018
  `),
9983
10019
  process.exit(1)),
9984
10020
  t
9985
10021
  );
9986
10022
  }
9987
- async function Za(e, t, i, a, n) {
10023
+ async function ar(e, t, i, a, n) {
9988
10024
  n.isJson ||
9989
10025
  process.stderr.write(`Starting ${a} ${t} jobs together...
9990
10026
  `);
@@ -10059,12 +10095,12 @@ async function Za(e, t, i, a, n) {
10059
10095
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
10060
10096
  process.exit(v);
10061
10097
  }
10062
- function er(e, t, i) {
10098
+ function rr(e, t, i) {
10063
10099
  if (i <= 1) return e;
10064
- let a = q.default.extname(e);
10100
+ let a = O.default.extname(e);
10065
10101
  return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
10066
10102
  }
10067
- function oi(e) {
10103
+ function pi(e) {
10068
10104
  let t = {},
10069
10105
  i = new Set(),
10070
10106
  a = [];
@@ -10109,7 +10145,7 @@ function oi(e) {
10109
10145
  }
10110
10146
  return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
10111
10147
  }
10112
- async function Qe(e, t) {
10148
+ async function Ze(e, t) {
10113
10149
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
10114
10150
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
10115
10151
  (i ||
@@ -10131,7 +10167,7 @@ async function Qe(e, t) {
10131
10167
  s = !!t.json,
10132
10168
  o = !!(t.async || t.no_wait),
10133
10169
  u = typeof t.output == 'string' ? t.output : void 0,
10134
- l = Qa(t),
10170
+ l = ir(t),
10135
10171
  c = { ...t };
10136
10172
  (delete c.json,
10137
10173
  delete c.async,
@@ -10140,8 +10176,8 @@ async function Qe(e, t) {
10140
10176
  delete c.api_key,
10141
10177
  delete c.api_url,
10142
10178
  delete c.count);
10143
- let d = ni(n, c);
10144
- (Wa(d),
10179
+ let d = li(n, c);
10180
+ (Za(d),
10145
10181
  typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
10146
10182
  d.image_url &&
10147
10183
  !d.first_frame_image &&
@@ -10162,35 +10198,35 @@ async function Qe(e, t) {
10162
10198
  for (let k of m) {
10163
10199
  let g = d[k];
10164
10200
  if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
10165
- let P = q.default.resolve(g);
10201
+ let P = O.default.resolve(g);
10166
10202
  if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
10167
- let I = new $(`Uploading local file ${q.default.basename(P)} to CDN...`);
10203
+ let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
10168
10204
  s || I.start();
10169
10205
  try {
10170
10206
  let N = U.default.readFileSync(P),
10171
- O = await p.uploadAsset(N.toString('base64'));
10172
- ((d[k] = O.url), s || I.succeed(`Uploaded ${q.default.basename(P)} to CDN`));
10207
+ q = await p.uploadAsset(N.toString('base64'));
10208
+ ((d[k] = q.url), s || I.succeed(`Uploaded ${O.default.basename(P)} to CDN`));
10173
10209
  } catch (N) {
10174
- let O = N instanceof Error ? N.message : String(N);
10210
+ let q = N instanceof Error ? N.message : String(N);
10175
10211
  (s
10176
10212
  ? process.stdout.write(
10177
- JSON.stringify({ error: O }) +
10213
+ JSON.stringify({ error: q }) +
10178
10214
  `
10179
10215
  `,
10180
10216
  )
10181
- : I.fail(`Upload failed: ${O}`),
10217
+ : I.fail(`Upload failed: ${q}`),
10182
10218
  process.exit(1));
10183
10219
  }
10184
10220
  }
10185
10221
  }
10186
10222
  }
10187
- await Xa(d, async (k) => {
10188
- let g = new $(`Uploading local file ${q.default.basename(k)} to CDN...`);
10223
+ await tr(d, async (k) => {
10224
+ let g = new $(`Uploading local file ${O.default.basename(k)} to CDN...`);
10189
10225
  s || g.start();
10190
10226
  try {
10191
10227
  let P = U.default.readFileSync(k),
10192
10228
  I = await p.uploadAsset(P.toString('base64'));
10193
- return (s || g.succeed(`Uploaded ${q.default.basename(k)} to CDN`), I.url);
10229
+ return (s || g.succeed(`Uploaded ${O.default.basename(k)} to CDN`), I.url);
10194
10230
  } catch (P) {
10195
10231
  let I = P instanceof Error ? P.message : String(P);
10196
10232
  (s
@@ -10208,7 +10244,7 @@ async function Qe(e, t) {
10208
10244
  let f;
10209
10245
  try {
10210
10246
  if (l > 1) {
10211
- await Za(p, e, d, l, { isJson: s, isAsync: o });
10247
+ await ar(p, e, d, l, { isJson: s, isAsync: o });
10212
10248
  return;
10213
10249
  }
10214
10250
  f = await p.queueJob(e, d);
@@ -10311,13 +10347,13 @@ ${r.bold('Outputs:')}
10311
10347
  `),
10312
10348
  u)
10313
10349
  ) {
10314
- let O = er(u, g++, k),
10315
- dt = new $(`Downloading output to ${O}...`).start();
10350
+ let q = rr(u, g++, k),
10351
+ pt = new $(`Downloading output to ${q}...`).start();
10316
10352
  try {
10317
- (await p.downloadOutput(I.url, q.default.resolve(process.cwd(), O)),
10318
- dt.succeed(`Saved to ${r.bold(O)}`));
10353
+ (await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
10354
+ pt.succeed(`Saved to ${r.bold(q)}`));
10319
10355
  } catch (Ie) {
10320
- dt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
10356
+ pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
10321
10357
  }
10322
10358
  }
10323
10359
  } else
@@ -10330,9 +10366,9 @@ ${I.text}
10330
10366
  process.stdout.write(`
10331
10367
  `);
10332
10368
  }
10333
- var li = T(require('node:readline'));
10369
+ var ci = T(require('node:readline'));
10334
10370
  E();
10335
- async function tr(e) {
10371
+ async function nr(e) {
10336
10372
  try {
10337
10373
  return (await new M(e, w()).checkKey(), 'ok');
10338
10374
  } catch (t) {
@@ -10343,15 +10379,15 @@ async function tr(e) {
10343
10379
  return 'unchecked';
10344
10380
  }
10345
10381
  }
10346
- function ir(e) {
10347
- let t = li.default.createInterface({ input: process.stdin, output: process.stdout });
10382
+ function sr(e) {
10383
+ let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
10348
10384
  return new Promise((i) => {
10349
10385
  t.question(e, (a) => {
10350
10386
  (t.close(), i(a.trim()));
10351
10387
  });
10352
10388
  });
10353
10389
  }
10354
- async function ie(e, t) {
10390
+ async function ae(e, t) {
10355
10391
  switch (e) {
10356
10392
  case 'login':
10357
10393
  case 'set-key': {
@@ -10363,14 +10399,14 @@ ${r.bold('Tein AI Authentication')}
10363
10399
  process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
10364
10400
 
10365
10401
  `),
10366
- (i = await ir('Enter your Tein API Key (sk_live_...): '))),
10402
+ (i = await sr('Enter your Tein API Key (sk_live_...): '))),
10367
10403
  !i.startsWith('sk_live_') &&
10368
10404
  !i.startsWith('sk_test_') &&
10369
10405
  (process.stderr
10370
10406
  .write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10371
10407
  `),
10372
10408
  process.exit(1)));
10373
- let a = await tr(i);
10409
+ let a = await nr(i);
10374
10410
  (a === 'invalid' &&
10375
10411
  (process.stderr
10376
10412
  .write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
@@ -10378,7 +10414,7 @@ ${r.bold('Tein AI Authentication')}
10378
10414
  process.exit(1)),
10379
10415
  Ke({ apiKey: i }),
10380
10416
  process.stdout.write(`
10381
- ${r.green('\u2713')} API key saved to ${r.dim(oe())}
10417
+ ${r.green('\u2713')} API key saved to ${r.dim(le())}
10382
10418
  `),
10383
10419
  a === 'blocked'
10384
10420
  ? process.stdout
@@ -10403,7 +10439,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
10403
10439
  }
10404
10440
  (Ke({ apiKey: '' }),
10405
10441
  process.stdout
10406
- .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(oe())}
10442
+ .write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(le())}
10407
10443
  `));
10408
10444
  break;
10409
10445
  }
@@ -10415,7 +10451,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
10415
10451
  (process.stdout.write(`
10416
10452
  ${r.bold('Tein AI CLI Configuration')}
10417
10453
  `),
10418
- process.stdout.write(` Config file: ${r.dim(oe())}
10454
+ process.stdout.write(` Config file: ${r.dim(le())}
10419
10455
  `),
10420
10456
  process.stdout.write(` API URL: ${r.cyan(a)}
10421
10457
  `),
@@ -10445,10 +10481,10 @@ function _(e) {
10445
10481
  ? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
10446
10482
  : `$${e.toFixed(2)}`;
10447
10483
  }
10448
- function di(e) {
10484
+ function ui(e) {
10449
10485
  return `${e} ${e === 1 ? 'request' : 'requests'}`;
10450
10486
  }
10451
- function ar(e) {
10487
+ function or(e) {
10452
10488
  let t = [
10453
10489
  ['Balance', _(e.balance)],
10454
10490
  ['Available to this key', _(e.available)],
@@ -10468,8 +10504,8 @@ function ar(e) {
10468
10504
  `${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
10469
10505
  ]),
10470
10506
  t.push(
10471
- ['This month', `${_(e.usage.this_month.spend)} on ${di(e.usage.this_month.requests)}`],
10472
- ['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${di(e.usage.last_30_days.requests)}`],
10507
+ ['This month', `${_(e.usage.this_month.spend)} on ${ui(e.usage.this_month.requests)}`],
10508
+ ['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${ui(e.usage.last_30_days.requests)}`],
10473
10509
  [
10474
10510
  'Auto top up',
10475
10511
  e.auto_top_up.enabled
@@ -10482,7 +10518,7 @@ function ar(e) {
10482
10518
  let a = Math.max(...t.map(([n]) => n.length));
10483
10519
  return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
10484
10520
  }
10485
- async function pi(e) {
10521
+ async function mi(e) {
10486
10522
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10487
10523
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
10488
10524
  a = !!e.json;
@@ -10526,13 +10562,13 @@ async function pi(e) {
10526
10562
  }
10527
10563
  process.stdout.write(`
10528
10564
  ${r.bold('Tein balance')}
10529
- ${ar(n).join(`
10565
+ ${or(n).join(`
10530
10566
  `)}
10531
10567
 
10532
10568
  `);
10533
10569
  }
10534
10570
  E();
10535
- function ci(e) {
10571
+ function fi(e) {
10536
10572
  let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
10537
10573
  i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
10538
10574
  return (
@@ -10546,7 +10582,7 @@ function ci(e) {
10546
10582
  new M(t, i)
10547
10583
  );
10548
10584
  }
10549
- function ui(e, t) {
10585
+ function gi(e, t) {
10550
10586
  let i = {};
10551
10587
  for (let a of t) {
10552
10588
  let n = e[a];
@@ -10554,7 +10590,7 @@ function ui(e, t) {
10554
10590
  }
10555
10591
  return i;
10556
10592
  }
10557
- async function mi(e, t) {
10593
+ async function hi(e, t) {
10558
10594
  try {
10559
10595
  return await t();
10560
10596
  } catch (i) {
@@ -10578,7 +10614,7 @@ async function mi(e, t) {
10578
10614
  process.exit(v));
10579
10615
  }
10580
10616
  }
10581
- function Ze(e) {
10617
+ function et(e) {
10582
10618
  let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
10583
10619
  i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
10584
10620
  return e.map(
@@ -10589,7 +10625,7 @@ function Ze(e) {
10589
10625
  .trimEnd()}`,
10590
10626
  );
10591
10627
  }
10592
- function rr(e) {
10628
+ function lr(e) {
10593
10629
  let t = e.summary,
10594
10630
  i = [
10595
10631
  ` 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}` : ''}`,
@@ -10601,7 +10637,7 @@ function rr(e) {
10601
10637
  e.by_channel.length &&
10602
10638
  (i.push('', r.bold('By channel')),
10603
10639
  i.push(
10604
- ...Ze([
10640
+ ...et([
10605
10641
  ['Channel', 'Spend', 'Requests'],
10606
10642
  ...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
10607
10643
  ]),
@@ -10609,7 +10645,7 @@ function rr(e) {
10609
10645
  e.by_model.length &&
10610
10646
  (i.push('', r.bold('By model')),
10611
10647
  i.push(
10612
- ...Ze([
10648
+ ...et([
10613
10649
  ['Model', 'Spend', 'Requests', 'Failed'],
10614
10650
  ...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
10615
10651
  ]),
@@ -10617,10 +10653,10 @@ function rr(e) {
10617
10653
  i
10618
10654
  );
10619
10655
  }
10620
- async function fi(e) {
10656
+ async function yi(e) {
10621
10657
  let t = !!e.json,
10622
- i = ci(e),
10623
- a = await mi(t, () => i.getUsage(ui(e, ['range', 'from', 'to', 'model', 'channel'])));
10658
+ i = fi(e),
10659
+ a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
10624
10660
  if (t) {
10625
10661
  process.stdout.write(
10626
10662
  JSON.stringify(a, null, 2) +
@@ -10631,14 +10667,14 @@ async function fi(e) {
10631
10667
  }
10632
10668
  process.stdout.write(`
10633
10669
  ${r.bold('Tein usage')}
10634
- ${rr(a).join(`
10670
+ ${lr(a).join(`
10635
10671
  `)}
10636
10672
 
10637
10673
  `);
10638
10674
  }
10639
- function nr(e) {
10675
+ function dr(e) {
10640
10676
  return e.data.length
10641
- ? Ze([
10677
+ ? et([
10642
10678
  ['When (UTC)', 'Amount', 'Balance after', 'What'],
10643
10679
  ...e.data.map((t) => [
10644
10680
  t.created_at.slice(0, 16).replace('T', ' '),
@@ -10649,10 +10685,10 @@ function nr(e) {
10649
10685
  ])
10650
10686
  : [' No transactions yet.'];
10651
10687
  }
10652
- async function gi(e) {
10688
+ async function bi(e) {
10653
10689
  let t = !!e.json,
10654
- i = ci(e),
10655
- a = await mi(t, () => i.getTransactions(ui(e, ['limit', 'type', 'after'])));
10690
+ i = fi(e),
10691
+ a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
10656
10692
  if (t) {
10657
10693
  process.stdout.write(
10658
10694
  JSON.stringify(a, null, 2) +
@@ -10668,18 +10704,18 @@ async function gi(e) {
10668
10704
  : '';
10669
10705
  process.stdout.write(`
10670
10706
  ${r.bold('Tein balance history')}
10671
- ${nr(a).join(`
10707
+ ${dr(a).join(`
10672
10708
  `)}${n}
10673
10709
 
10674
10710
  `);
10675
10711
  }
10676
10712
  E();
10677
10713
  Ce();
10678
- ee();
10679
- var sr = 3e3;
10680
- async function hi(e) {
10714
+ te();
10715
+ var pr = 3e3;
10716
+ async function ki(e) {
10681
10717
  try {
10682
- let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(sr) });
10718
+ let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
10683
10719
  if (!t.ok) return;
10684
10720
  let i = await t.json(),
10685
10721
  a = {};
@@ -10687,18 +10723,18 @@ async function hi(e) {
10687
10723
  let s = String(n.modelSlug ?? '');
10688
10724
  J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
10689
10725
  }
10690
- Zt(a);
10726
+ ii(a);
10691
10727
  } catch {}
10692
10728
  }
10693
- var or = new Set(['video', 'image', 'text', 'audio', '3d']),
10694
- lr = { llm: 'text', chat: 'text', reasoning: 'text' };
10695
- async function yi(e, t) {
10696
- await hi(t);
10729
+ var cr = new Set(['video', 'image', 'text', 'audio', '3d']),
10730
+ ur = { llm: 'text', chat: 'text', reasoning: 'text' };
10731
+ async function wi(e, t) {
10732
+ await ki(t);
10697
10733
  let i = D();
10698
10734
  if (e) {
10699
10735
  let s = e.toLowerCase(),
10700
- o = lr[s] ?? s;
10701
- i = or.has(o)
10736
+ o = ur[s] ?? s;
10737
+ i = cr.has(o)
10702
10738
  ? i.filter((u) => u.category.toLowerCase() === o)
10703
10739
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
10704
10740
  }
@@ -10736,8 +10772,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
10736
10772
 
10737
10773
  `);
10738
10774
  }
10739
- async function bi(e, t) {
10740
- J.has(e) && (await hi(t));
10775
+ async function xi(e, t) {
10776
+ J.has(e) && (await ki(t));
10741
10777
  let i = H(e);
10742
10778
  (i ||
10743
10779
  (process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -10818,9 +10854,9 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
10818
10854
  `);
10819
10855
  }
10820
10856
  E();
10821
- et();
10822
- var dr = 1e4,
10823
- it = {
10857
+ tt();
10858
+ var mr = 1e4,
10859
+ at = {
10824
10860
  price: '',
10825
10861
  creativeMode: 'Creative mode',
10826
10862
  priority: 'Priority',
@@ -10830,22 +10866,22 @@ var dr = 1e4,
10830
10866
  priorityDraft: 'Priority + Draft',
10831
10867
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
10832
10868
  },
10833
- pr = Object.keys(it),
10834
- cr = {
10869
+ fr = Object.keys(at),
10870
+ gr = {
10835
10871
  creativeMode: 'unfiltered',
10836
10872
  creativeModePriority: 'unfilteredPriority',
10837
10873
  creativeModeDraft: 'unfilteredDraft',
10838
10874
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
10839
10875
  };
10840
- function ur(e, t) {
10841
- let i = cr[t];
10876
+ function hr(e, t) {
10877
+ let i = gr[t];
10842
10878
  return e[t] ?? (i ? e[i] : void 0);
10843
10879
  }
10844
- async function mr(e, t) {
10880
+ async function yr(e, t) {
10845
10881
  let i = `${w(e)}${xe(t)}`,
10846
10882
  a;
10847
10883
  try {
10848
- a = await fetch(i, { signal: AbortSignal.timeout(dr) });
10884
+ a = await fetch(i, { signal: AbortSignal.timeout(mr) });
10849
10885
  } catch {
10850
10886
  throw new Error(`Could not reach ${i}`);
10851
10887
  }
@@ -10861,18 +10897,18 @@ async function mr(e, t) {
10861
10897
  }
10862
10898
  return n;
10863
10899
  }
10864
- function tt(e) {
10900
+ function it(e) {
10865
10901
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
10866
10902
  [i, a = ''] = t.split('.');
10867
10903
  return `$${i}.${a.padEnd(2, '0')}`;
10868
10904
  }
10869
- function at(e) {
10905
+ function rt(e) {
10870
10906
  if (!e || typeof e.starter != 'number') return null;
10871
10907
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
10872
10908
  i = typeof e.scale == 'number' ? e.scale : t;
10873
- return `Starter ${tt(e.starter)} Plus ${tt(t)} Scale ${tt(i)}`;
10909
+ return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
10874
10910
  }
10875
- function fr(e) {
10911
+ function br(e) {
10876
10912
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
10877
10913
  let t = [];
10878
10914
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -10884,33 +10920,33 @@ function fr(e) {
10884
10920
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
10885
10921
  );
10886
10922
  }
10887
- function gr(e, t) {
10888
- let i = fr(e);
10889
- for (let a of pr) {
10890
- let n = at(ur(e, a));
10923
+ function kr(e, t) {
10924
+ let i = br(e);
10925
+ for (let a of fr) {
10926
+ let n = rt(hr(e, a));
10891
10927
  if (!n) continue;
10892
- let s = it[a] ? ` (${it[a]})` : '';
10928
+ let s = at[a] ? ` (${at[a]})` : '';
10893
10929
  t.push(` ${i}${s} ${n}`);
10894
10930
  }
10895
10931
  }
10896
- function hr(e, t) {
10932
+ function wr(e, t) {
10897
10933
  let i = e.quality ? ` quality=${e.quality}` : '';
10898
10934
  t.push(
10899
10935
  ` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
10900
10936
  );
10901
- for (let n of e.variants ?? []) gr(n, t);
10937
+ for (let n of e.variants ?? []) kr(n, t);
10902
10938
  let a = e.addons;
10903
10939
  if (Array.isArray(a))
10904
10940
  for (let n of a) {
10905
10941
  if (!n || typeof n != 'object') continue;
10906
10942
  let s = n,
10907
10943
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
10908
- u = at(s.price);
10944
+ u = rt(s.price);
10909
10945
  u && t.push(` ${o} (add-on) ${u}`);
10910
10946
  }
10911
10947
  t.push('');
10912
10948
  }
10913
- function yr(e) {
10949
+ function xr(e) {
10914
10950
  let t = [],
10915
10951
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
10916
10952
  (t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
@@ -10932,7 +10968,7 @@ function yr(e) {
10932
10968
  });
10933
10969
  for (let l of s) {
10934
10970
  t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
10935
- for (let c of a.get(l) ?? []) hr(c, t);
10971
+ for (let c of a.get(l) ?? []) wr(c, t);
10936
10972
  }
10937
10973
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
10938
10974
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -10949,7 +10985,7 @@ function yr(e) {
10949
10985
  t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
10950
10986
  for (let m of d) {
10951
10987
  let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
10952
- f = at(m.prices);
10988
+ f = rt(m.prices);
10953
10989
  f && t.push(` ${y} ${f}`);
10954
10990
  }
10955
10991
  t.push('');
@@ -10962,10 +10998,10 @@ function yr(e) {
10962
10998
  `
10963
10999
  );
10964
11000
  }
10965
- async function ki(e) {
11001
+ async function _i(e) {
10966
11002
  let t;
10967
11003
  try {
10968
- t = await mr(e.apiUrl, e.model);
11004
+ t = await yr(e.apiUrl, e.model);
10969
11005
  } catch (i) {
10970
11006
  let a = i instanceof Error ? i.message : String(i);
10971
11007
  (process.stderr.write(`${r.red('Error:')} ${a}
@@ -10976,12 +11012,12 @@ async function ki(e) {
10976
11012
  e.json
10977
11013
  ? `${JSON.stringify(t, null, 2)}
10978
11014
  `
10979
- : yr(t),
11015
+ : xr(t),
10980
11016
  );
10981
11017
  }
10982
- var wi = T(require('node:path'));
11018
+ var Pi = T(require('node:path'));
10983
11019
  E();
10984
- async function xi(e, t) {
11020
+ async function Ii(e, t) {
10985
11021
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
10986
11022
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
10987
11023
  (i ||
@@ -11076,7 +11112,7 @@ ${r.bold('Outputs:')}
11076
11112
  ) {
11077
11113
  let p = new $(`Downloading output to ${o}...`).start();
11078
11114
  try {
11079
- (await u.downloadOutput(d.url, wi.default.resolve(process.cwd(), o)),
11115
+ (await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
11080
11116
  p.succeed(`Saved to ${r.bold(o)}`));
11081
11117
  } catch (m) {
11082
11118
  p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -11091,10 +11127,10 @@ ${d.text}
11091
11127
  process.stdout.write(`
11092
11128
  `);
11093
11129
  }
11094
- var rt = T(require('node:fs')),
11095
- nt = T(require('node:path'));
11130
+ var nt = T(require('node:fs')),
11131
+ st = T(require('node:path'));
11096
11132
  E();
11097
- async function _i(e, t = {}) {
11133
+ async function vi(e, t = {}) {
11098
11134
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
11099
11135
  a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
11100
11136
  n = !!t.json;
@@ -11111,13 +11147,13 @@ async function _i(e, t = {}) {
11111
11147
  process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
11112
11148
  `),
11113
11149
  process.exit(1)));
11114
- let s = nt.default.resolve(e);
11115
- rt.default.existsSync(s) ||
11150
+ let s = st.default.resolve(e);
11151
+ nt.default.existsSync(s) ||
11116
11152
  (process.stderr.write(`${r.red('Error:')} File not found: ${s}
11117
11153
  `),
11118
11154
  process.exit(1));
11119
- let o = nt.default.basename(s),
11120
- l = rt.default.readFileSync(s).toString('base64'),
11155
+ let o = st.default.basename(s),
11156
+ l = nt.default.readFileSync(s).toString('base64'),
11121
11157
  c = new M(i, a),
11122
11158
  d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
11123
11159
  n || d.start();
@@ -11158,10 +11194,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
11158
11194
  process.exit(m ? m.exitCode : v));
11159
11195
  }
11160
11196
  }
11161
- re();
11162
- ee();
11163
- Le();
11164
- function Vi() {
11197
+ ne();
11198
+ te();
11199
+ De();
11200
+ function Fi() {
11165
11201
  process.stdout.write(`
11166
11202
  ${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
11167
11203
 
@@ -11243,11 +11279,11 @@ ${r.bold('EXAMPLES:')}
11243
11279
 
11244
11280
  `);
11245
11281
  }
11246
- async function Dr() {
11282
+ async function Fr() {
11247
11283
  let e = process.argv.slice(2),
11248
- t = oi(e);
11284
+ t = pi(e);
11249
11285
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
11250
- Vi();
11286
+ Fi();
11251
11287
  return;
11252
11288
  }
11253
11289
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -11257,31 +11293,31 @@ async function Dr() {
11257
11293
  }
11258
11294
  switch (t.command) {
11259
11295
  case 'auth': {
11260
- await ie(t.subcommand, t.options.key);
11296
+ await ae(t.subcommand, t.options.key);
11261
11297
  break;
11262
11298
  }
11263
11299
  case 'login': {
11264
- await ie('login', t.options.key);
11300
+ await ae('login', t.options.key);
11265
11301
  break;
11266
11302
  }
11267
11303
  case 'logout': {
11268
- await ie('logout');
11304
+ await ae('logout');
11269
11305
  break;
11270
11306
  }
11271
11307
  case 'whoami': {
11272
- await ie('status');
11308
+ await ae('status');
11273
11309
  break;
11274
11310
  }
11275
11311
  case 'models':
11276
11312
  case 'list': {
11277
- await yi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11313
+ await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11278
11314
  break;
11279
11315
  }
11280
11316
  case 'pricing':
11281
11317
  case 'prices': {
11282
11318
  let i = t.options.model,
11283
11319
  a = t.subcommand || (typeof i == 'string' ? i : void 0);
11284
- await ki({
11320
+ await _i({
11285
11321
  model: a,
11286
11322
  json: !!t.options.json,
11287
11323
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -11296,40 +11332,40 @@ async function Dr() {
11296
11332
  process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
11297
11333
  `),
11298
11334
  process.exit(1)),
11299
- await bi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11335
+ await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11300
11336
  break;
11301
11337
  }
11302
11338
  case 'upload': {
11303
11339
  let i = t.subcommand || '';
11304
- await _i(i, t.options);
11340
+ await vi(i, t.options);
11305
11341
  break;
11306
11342
  }
11307
11343
  case 'run':
11308
11344
  case 'generate': {
11309
11345
  let i = t.subcommand || '';
11310
- await Qe(i, t.options);
11346
+ await Ze(i, t.options);
11311
11347
  break;
11312
11348
  }
11313
11349
  case 'status': {
11314
11350
  let i = t.subcommand || '';
11315
- await xi(i, t.options);
11351
+ await Ii(i, t.options);
11316
11352
  break;
11317
11353
  }
11318
11354
  case 'balance': {
11319
- await pi(t.options);
11355
+ await mi(t.options);
11320
11356
  break;
11321
11357
  }
11322
11358
  case 'usage': {
11323
- await fi(t.options);
11359
+ await yi(t.options);
11324
11360
  break;
11325
11361
  }
11326
11362
  case 'transactions':
11327
11363
  case 'history': {
11328
- await gi(t.options);
11364
+ await bi(t.options);
11329
11365
  break;
11330
11366
  }
11331
11367
  case 'mcp': {
11332
- let { startStdioServer: i } = await Promise.resolve().then(() => (Di(), Li));
11368
+ let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
11333
11369
  await i();
11334
11370
  break;
11335
11371
  }
@@ -11342,15 +11378,15 @@ ${r.red('Error:')} Unknown command or model "${t.command}".
11342
11378
  Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
11343
11379
  `),
11344
11380
  process.exit(v)),
11345
- await Qe(t.command, t.options));
11381
+ await Ze(t.command, t.options));
11346
11382
  return;
11347
11383
  }
11348
- Vi();
11384
+ Fi();
11349
11385
  break;
11350
11386
  }
11351
11387
  }
11352
11388
  }
11353
- Dr().catch((e) => {
11389
+ Fr().catch((e) => {
11354
11390
  (e instanceof b &&
11355
11391
  (process.stderr.write(`
11356
11392
  ${r.red('Error:')} ${K(e).join(`