@teinai/cli 1.1.41 → 1.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1311 -1147
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,58 +1,58 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var mi = Object.create;
4
- var Se = Object.defineProperty;
5
- var fi = Object.getOwnPropertyDescriptor;
6
- var gi = Object.getOwnPropertyNames;
7
- var hi = Object.getPrototypeOf,
8
- yi = Object.prototype.hasOwnProperty;
3
+ var wi = Object.create;
4
+ var Ke = Object.defineProperty;
5
+ var xi = Object.getOwnPropertyDescriptor;
6
+ var ki = Object.getOwnPropertyNames;
7
+ var _i = Object.getPrototypeOf,
8
+ Pi = Object.prototype.hasOwnProperty;
9
9
  var y = (e, t, r) => () => {
10
10
  if (r) throw r[0];
11
11
  try {
12
12
  return (e && (t = e((e = 0))), t);
13
- } catch (a) {
14
- throw ((r = [a]), a);
13
+ } catch (i) {
14
+ throw ((r = [i]), i);
15
15
  }
16
16
  };
17
- var bi = (e, t) => {
18
- for (var r in t) Se(e, r, { get: t[r], enumerable: !0 });
17
+ var Ii = (e, t) => {
18
+ for (var r in t) Ke(e, r, { get: t[r], enumerable: !0 });
19
19
  },
20
- wi = (e, t, r, a) => {
20
+ vi = (e, t, r, i) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of gi(t))
23
- !yi.call(e, n) &&
22
+ for (let n of ki(t))
23
+ !Pi.call(e, n) &&
24
24
  n !== r &&
25
- Se(e, n, { get: () => t[n], enumerable: !(a = fi(t, n)) || a.enumerable });
25
+ Ke(e, n, { get: () => t[n], enumerable: !(i = xi(t, n)) || i.enumerable });
26
26
  return e;
27
27
  };
28
28
  var M = (e, t, r) => (
29
- (r = e != null ? mi(hi(e)) : {}),
30
- wi(t || !e || !e.__esModule ? Se(r, 'default', { value: e, enumerable: !0 }) : r, e)
29
+ (r = e != null ? wi(_i(e)) : {}),
30
+ vi(t || !e || !e.__esModule ? Ke(r, 'default', { value: e, enumerable: !0 }) : r, e)
31
31
  );
32
- function _i(e) {
32
+ function Si(e) {
33
33
  for (let t of e)
34
34
  try {
35
- let r = JSON.parse(bt.default.readFileSync(t, 'utf8'));
35
+ let r = JSON.parse(kt.default.readFileSync(t, 'utf8'));
36
36
  if (r.name === '@teinai/cli' && typeof r.version == 'string' && r.version.trim())
37
37
  return r.version.trim();
38
38
  } catch {}
39
- return ki;
39
+ return Mi;
40
40
  }
41
- function Pi() {
41
+ function Ki() {
42
42
  let e = typeof __dirname == 'string' ? __dirname : process.cwd();
43
43
  return [
44
- Ke.default.join(e, 'package.json'),
45
- Ke.default.join(e, '..', '..', 'cli-package', 'package.json'),
44
+ Ee.default.join(e, 'package.json'),
45
+ Ee.default.join(e, '..', '..', 'cli-package', 'package.json'),
46
46
  ];
47
47
  }
48
- var bt,
49
- Ke,
50
- ki,
48
+ var kt,
49
+ Ee,
50
+ Mi,
51
51
  z,
52
52
  oe = y(() => {
53
53
  'use strict';
54
- ((bt = M(require('node:fs'))), (Ke = M(require('node:path'))), (ki = '0.0.0-dev'));
55
- z = _i(Pi());
54
+ ((kt = M(require('node:fs'))), (Ee = M(require('node:path'))), (Mi = '0.0.0-dev'));
55
+ z = Si(Ki());
56
56
  });
57
57
  function J() {
58
58
  try {
@@ -63,12 +63,12 @@ function J() {
63
63
  } catch {}
64
64
  return {};
65
65
  }
66
- function $e(e) {
66
+ function Ce(e) {
67
67
  try {
68
- L.default.existsSync(de) || L.default.mkdirSync(de, { recursive: !0, mode: 448 });
68
+ L.default.existsSync(pe) || L.default.mkdirSync(pe, { recursive: !0, mode: 448 });
69
69
  let r = { ...J(), ...e };
70
70
  (L.default.writeFileSync(W, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
71
- L.default.chmodSync(de, 448),
71
+ L.default.chmodSync(pe, 448),
72
72
  L.default.chmodSync(W, 384));
73
73
  } catch (t) {
74
74
  throw new Error(`Failed to save config to ${W}: ${t}`);
@@ -88,45 +88,45 @@ function x(e) {
88
88
  let r = J();
89
89
  return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
90
90
  }
91
- function pe() {
91
+ function de() {
92
92
  return W;
93
93
  }
94
94
  var L,
95
- Pt,
96
- Ee,
97
- de,
95
+ Tt,
96
+ $e,
97
+ pe,
98
98
  W,
99
- A = y(() => {
99
+ R = y(() => {
100
100
  'use strict';
101
101
  ((L = M(require('node:fs'))),
102
- (Pt = M(require('node:os'))),
103
- (Ee = M(require('node:path'))),
104
- (de = Ee.default.join(Pt.default.homedir(), '.tein')),
105
- (W = Ee.default.join(de, 'config.json')));
102
+ (Tt = M(require('node:os'))),
103
+ ($e = M(require('node:path'))),
104
+ (pe = $e.default.join(Tt.default.homedir(), '.tein')),
105
+ (W = $e.default.join(pe, 'config.json')));
106
106
  });
107
- var Si,
108
- It,
109
- vt,
110
- Tt = y(() => {
107
+ var Ri,
108
+ Mt,
109
+ St,
110
+ Kt = y(() => {
111
111
  'use strict';
112
- ((Si = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
- (It = [...Si, 'auto']),
114
- (vt =
112
+ ((Ri = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
113
+ (Mt = [...Ri, 'auto']),
114
+ (St =
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 ce,
118
- Ae = y(() => {
118
+ Re = y(() => {
119
119
  'use strict';
120
120
  ce = new Set([]);
121
121
  });
122
122
  function Z(e) {
123
123
  return !1;
124
124
  }
125
- var Mt = y(() => {
125
+ var Et = y(() => {
126
126
  'use strict';
127
127
  });
128
128
  var ue,
129
- St = y(() => {
129
+ $t = y(() => {
130
130
  'use strict';
131
131
  ue = {
132
132
  source: 'TEIN Price Board',
@@ -217,6 +217,7 @@ var ue,
217
217
  ],
218
218
  },
219
219
  { slug: 'gemini-omni', name: 'Gemini Omni', models: ['gemini-omni-1.2-flash'] },
220
+ { slug: 'magi', name: 'MAGI', models: ['magi-2'] },
220
221
  { slug: 'kling', name: 'Kling', models: ['kling-v4', 'kling-v4-flash', 'kling-v3-video'] },
221
222
  { slug: 'ltx', name: 'LTX', models: ['ltx-2.3-pro'] },
222
223
  { slug: 'vidu', name: 'Vidu', models: ['vidu-q4-preview'] },
@@ -5775,6 +5776,51 @@ var ue,
5775
5776
  axes: { resolution: ['360p', '720p', '1080p', '4k'] },
5776
5777
  from: { variant: '720p' },
5777
5778
  },
5779
+ {
5780
+ slug: 'magi-2',
5781
+ name: 'MAGI-2',
5782
+ family: 'magi',
5783
+ vendor: 'Sand AI',
5784
+ desc: "Sand AI's MAGI-2: video with optional native sound from text, a start frame (with an optional end frame), or images, videos and audio clips as references.",
5785
+ kind: 'video',
5786
+ unit: '/sec',
5787
+ api: { model: 'magi-2' },
5788
+ variants: [
5789
+ {
5790
+ id: '720p',
5791
+ price: { starter: 0.048, plus: 0.0456, scale: 0.0432 },
5792
+ label: '720p',
5793
+ resolution: '720p',
5794
+ withVideo: !1,
5795
+ },
5796
+ {
5797
+ id: '720p-with-video',
5798
+ price: { starter: 0.029, plus: 0.0275, scale: 0.0261 },
5799
+ label: '720p \xB7 with reference video',
5800
+ resolution: '720p',
5801
+ withVideo: !0,
5802
+ },
5803
+ {
5804
+ id: '1080p',
5805
+ price: { starter: 0.089, plus: 0.089, scale: 0.089 },
5806
+ label: '1080p',
5807
+ resolution: '1080p',
5808
+ withVideo: !1,
5809
+ },
5810
+ {
5811
+ id: '1080p-with-video',
5812
+ price: { starter: 0.089, plus: 0.089, scale: 0.089 },
5813
+ label: '1080p \xB7 with reference video',
5814
+ resolution: '1080p',
5815
+ withVideo: !0,
5816
+ },
5817
+ ],
5818
+ unfiltered: null,
5819
+ priority: null,
5820
+ draft: null,
5821
+ axes: { resolution: ['720p', '1080p'] },
5822
+ from: { variant: '720p' },
5823
+ },
5778
5824
  {
5779
5825
  slug: 'kling-v4',
5780
5826
  name: 'Kling Video 4.0',
@@ -6257,14 +6303,14 @@ var ue,
6257
6303
  ],
6258
6304
  };
6259
6305
  });
6260
- var Kt,
6261
- Et = y(() => {
6306
+ var Ct,
6307
+ At = y(() => {
6262
6308
  'use strict';
6263
- Kt = [];
6309
+ Ct = [];
6264
6310
  });
6265
6311
  var me,
6266
- $t,
6267
- Re = y(() => {
6312
+ Rt,
6313
+ Oe = y(() => {
6268
6314
  'use strict';
6269
6315
  ((me = [
6270
6316
  {
@@ -6341,12 +6387,12 @@ var me,
6341
6387
  from: { variant: 'swap' },
6342
6388
  },
6343
6389
  ]),
6344
- ($t = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6390
+ (Rt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6345
6391
  });
6346
- function Le(e, t) {
6392
+ function De(e, t) {
6347
6393
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
6348
6394
  }
6349
- function Ei(e, t) {
6395
+ function qi(e, t) {
6350
6396
  if (e === 'seedance-2-mini') return 'mini';
6351
6397
  if (e !== 'seedance-2') return;
6352
6398
  let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -6356,103 +6402,104 @@ function Ei(e, t) {
6356
6402
  ? 'fast'
6357
6403
  : 'standard';
6358
6404
  }
6359
- function $i(e, t) {
6405
+ function Li(e, t) {
6360
6406
  let r = e
6361
6407
  .trim()
6362
6408
  .toLowerCase()
6363
6409
  .replace(/-(?:unfiltered|uncensored)$/, '');
6364
6410
  if (r === 'seedance-2' || r === 'seedance-2-mini') {
6365
- let n = Ei(r, t),
6366
- s = Oe.get(Le('seedance-2', n));
6411
+ let n = qi(r, t),
6412
+ s = qe.get(De('seedance-2', n));
6367
6413
  return s ? s.slug : null;
6368
6414
  }
6369
- let a = fe.get(r) ?? Oe.get(Le(r));
6370
- return a ? a.slug : null;
6415
+ let i = fe.get(r) ?? qe.get(De(r));
6416
+ return i ? i.slug : null;
6371
6417
  }
6372
- function Ai(e, t) {
6373
- return fe.has(e) && !(Ci.has(e) && t) ? e : $i(e, t);
6418
+ function Ni(e, t) {
6419
+ return fe.has(e) && !(Di.has(e) && t) ? e : Li(e, t);
6374
6420
  }
6375
6421
  function B(e, t) {
6376
- let r = Ai(e, t);
6422
+ let r = Ni(e, t);
6377
6423
  return r ? (fe.get(r) ?? null) : null;
6378
6424
  }
6379
- function Lt(e, t) {
6425
+ function Vt(e, t) {
6380
6426
  return `${e}/addon/${t}`;
6381
6427
  }
6382
- function Dt(e) {
6383
- return qt.get(e) ?? null;
6428
+ function Ut(e) {
6429
+ return Nt.get(e) ?? null;
6384
6430
  }
6385
6431
  function ge() {
6386
- return Ot;
6432
+ return Dt;
6387
6433
  }
6388
- var De,
6389
- At,
6390
- Rt,
6391
- Ot,
6392
- Ki,
6393
- fe,
6394
- Oe,
6395
- Ct,
6434
+ var Ne,
6396
6435
  qt,
6436
+ Lt,
6437
+ Dt,
6438
+ Oi,
6439
+ fe,
6397
6440
  qe,
6398
- Ci,
6441
+ Ot,
6442
+ Nt,
6443
+ Le,
6444
+ Di,
6399
6445
  j = y(() => {
6400
6446
  'use strict';
6401
- Mt();
6402
- St();
6403
6447
  Et();
6404
- Re();
6405
- ((De = {
6448
+ $t();
6449
+ At();
6450
+ Oe();
6451
+ ((Ne = {
6406
6452
  ...ue,
6407
6453
  families: ue.families.map((e) => ({ ...e, models: e.models.filter((t) => !Z(t)) })),
6408
6454
  models: ue.models.filter((e) => !Z(e.slug)),
6409
6455
  }),
6410
- (At = me.filter((e) => !Z(e.slug))),
6411
- (Rt = Kt.filter((e) => !Z(e.slug) && !De.models.some((t) => t.slug === e.slug))),
6412
- (Ot = [...De.models, ...Rt, ...At]),
6413
- (Ki = [
6414
- ...De.families.map((e) => {
6415
- let t = Rt.filter((r) => r.family === e.slug).map((r) => r.slug);
6456
+ (qt = me.filter((e) => !Z(e.slug))),
6457
+ (Lt = Ct.filter((e) => !Z(e.slug) && !Ne.models.some((t) => t.slug === e.slug))),
6458
+ (Dt = [...Ne.models, ...Lt, ...qt]),
6459
+ (Oi = [
6460
+ ...Ne.families.map((e) => {
6461
+ let t = Lt.filter((r) => r.family === e.slug).map((r) => r.slug);
6416
6462
  return t.length ? { ...e, models: [...e.models, ...t] } : e;
6417
6463
  }),
6418
- ...$t
6419
- .map((e) => ({ ...e, models: At.filter((t) => t.family === e.slug).map((t) => t.slug) }))
6420
- .filter((e) => e.models.length > 0),
6464
+ ...Rt.map((e) => ({
6465
+ ...e,
6466
+ models: qt.filter((t) => t.family === e.slug).map((t) => t.slug),
6467
+ })).filter((e) => e.models.length > 0),
6421
6468
  ]),
6422
6469
  (fe = new Map()),
6423
- (Oe = new Map()),
6424
- (Ct = new Map()),
6425
- (qt = new Map()),
6426
- (qe = new Map()));
6427
- for (let e of Ot) {
6428
- (fe.set(e.slug, e), Oe.set(Le(e.api.model, e.api.quality), e));
6429
- for (let t of e.variants) Ct.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6470
+ (qe = new Map()),
6471
+ (Ot = new Map()),
6472
+ (Nt = new Map()),
6473
+ (Le = new Map()));
6474
+ for (let e of Dt) {
6475
+ (fe.set(e.slug, e), qe.set(De(e.api.model, e.api.quality), e));
6476
+ for (let t of e.variants) Ot.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6430
6477
  for (let t of e.editVariants ?? [])
6431
- Ct.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6432
- for (let t of e.addons ?? []) qt.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6433
- qe.set(e.slug, e.family);
6478
+ Ot.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6479
+ for (let t of e.addons ?? []) Nt.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6480
+ Le.set(e.slug, e.family);
6434
6481
  }
6435
- for (let e of Ki) for (let t of e.models) qe.has(t) || qe.set(t, e.slug);
6436
- Ci = new Set(['seedance-2']);
6482
+ for (let e of Oi) for (let t of e.models) Le.has(t) || Le.set(t, e.slug);
6483
+ Di = new Set(['seedance-2']);
6437
6484
  });
6438
6485
  function he(e) {
6439
6486
  let t = e.from?.variant;
6440
6487
  return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
6441
6488
  }
6442
- function Ne(e) {
6489
+ function Ve(e) {
6443
6490
  if (e.endpoints?.length)
6444
- return e.editVariants?.length && e.endpoints.some((t) => t.id === Nt)
6445
- ? Nt
6491
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === Ft)
6492
+ ? Ft
6446
6493
  : (e.defaultEndpoint ?? e.endpoints[0].id);
6447
6494
  }
6448
- var Nt,
6495
+ var Ft,
6449
6496
  Ue = y(() => {
6450
6497
  'use strict';
6451
6498
  j();
6452
- Nt = 'dynamic';
6499
+ Ft = 'dynamic';
6453
6500
  });
6454
- function qi(e) {
6455
- return Lt(e, Ri);
6501
+ function Fi(e) {
6502
+ return Vt(e, Vi);
6456
6503
  }
6457
6504
  function ye(e) {
6458
6505
  let t = e.toFixed(5).replace(/0+$/, '');
@@ -6461,43 +6508,43 @@ function ye(e) {
6461
6508
  (t.split('.')[1] ?? '').length < 2 ? `$${e.toFixed(2)}` : `$${t}`
6462
6509
  );
6463
6510
  }
6464
- function Ve(e) {
6511
+ function Fe(e) {
6465
6512
  return e.starter === e.plus && e.plus === e.scale
6466
6513
  ? `${ye(e.starter)} on every plan`
6467
6514
  : `${ye(e.starter)} on Starter, ${ye(e.plus)} on Plus, ${ye(e.scale)} on Scale`;
6468
6515
  }
6469
- function Ut(e) {
6516
+ function Bt(e) {
6470
6517
  let t = [],
6471
- r = Oi[e],
6472
- a = r != null ? Dt(qi(e)) : null;
6473
- if (a && r != null) {
6518
+ r = Ui[e],
6519
+ i = r != null ? Ut(Fi(e)) : null;
6520
+ if (i && r != null) {
6474
6521
  let n =
6475
- a.addon.unfiltered && Ve(a.addon.unfiltered) === Ve(a.addon.price)
6522
+ i.addon.unfiltered && Fe(i.addon.unfiltered) === Fe(i.addon.price)
6476
6523
  ? ', Creative mode included'
6477
6524
  : '';
6478
- t.push(`Each reference image after the ${Di[r] ?? `${r}th`} adds ${Ve(a.addon.price)}${n}.`);
6525
+ t.push(`Each reference image after the ${ji[r] ?? `${r}th`} adds ${Fe(i.addon.price)}${n}.`);
6479
6526
  }
6480
6527
  return (
6481
- Li.has(e) &&
6528
+ Bi.has(e) &&
6482
6529
  t.push(
6483
6530
  'With reference videos (multiple references mode), their seconds are billed with the output, at the same price per second (a 5 s video with a 10 s reference video bills 15 s).',
6484
6531
  ),
6485
6532
  t
6486
6533
  );
6487
6534
  }
6488
- var Ri,
6489
- Oi,
6490
- Li,
6491
- Di,
6492
- Vt = y(() => {
6535
+ var Vi,
6536
+ Ui,
6537
+ Bi,
6538
+ ji,
6539
+ jt = y(() => {
6493
6540
  'use strict';
6494
6541
  j();
6495
- ((Ri = 'extra-image-input'), (Oi = { 'seedream-5-pro': 1, 'minimax-h3': 5 }));
6496
- Li = new Set(['minimax-h3']);
6497
- Di = { 1: 'first', 5: '5th' };
6542
+ ((Vi = 'extra-image-input'), (Ui = { 'seedream-5-pro': 1, 'minimax-h3': 5 }));
6543
+ Bi = new Set(['minimax-h3']);
6544
+ ji = { 1: 'first', 5: '5th' };
6498
6545
  });
6499
6546
  var be,
6500
- Fe = y(() => {
6547
+ Be = y(() => {
6501
6548
  'use strict';
6502
6549
  be = {
6503
6550
  'gemini-3-8-flash': 'gemini-3.8-flash',
@@ -6509,29 +6556,29 @@ var be,
6509
6556
  'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
6510
6557
  };
6511
6558
  });
6512
- var Ft = y(() => {
6559
+ var Gt = y(() => {
6513
6560
  'use strict';
6514
6561
  });
6515
- function Bt(e, t) {
6516
- return typeof t == 'string' && (Ni[e]?.includes(t) ?? !1);
6562
+ function Ht(e, t) {
6563
+ return typeof t == 'string' && (Gi[e]?.includes(t) ?? !1);
6517
6564
  }
6518
- var Ni,
6519
- jt = y(() => {
6565
+ var Gi,
6566
+ zt = y(() => {
6520
6567
  'use strict';
6521
6568
  j();
6522
6569
  Ue();
6523
- Ft();
6524
- Ni = {};
6570
+ Gt();
6571
+ Gi = {};
6525
6572
  });
6526
- function Gt(e) {
6527
- return e === 'nano-banana-pro' ? Ui : Vi;
6573
+ function Wt(e) {
6574
+ return e === 'nano-banana-pro' ? Hi : zi;
6528
6575
  }
6529
- var Ui,
6530
- Vi,
6531
- Ht = y(() => {
6576
+ var Hi,
6577
+ zi,
6578
+ Jt = y(() => {
6532
6579
  'use strict';
6533
- ((Ui = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6534
- (Vi = [
6580
+ ((Hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6581
+ (zi = [
6535
6582
  'auto',
6536
6583
  '1:1',
6537
6584
  '1:4',
@@ -6549,10 +6596,10 @@ var Ui,
6549
6596
  '21:9',
6550
6597
  ]));
6551
6598
  });
6552
- var zt,
6553
- Wt = y(() => {
6599
+ var Yt,
6600
+ Xt = y(() => {
6554
6601
  'use strict';
6555
- zt = [
6602
+ Yt = [
6556
6603
  'prompt',
6557
6604
  'system',
6558
6605
  'messages',
@@ -6566,10 +6613,10 @@ var zt,
6566
6613
  'endpoint',
6567
6614
  ];
6568
6615
  });
6569
- var Jt,
6570
- Yt = y(() => {
6616
+ var Qt,
6617
+ Zt = y(() => {
6571
6618
  'use strict';
6572
- Jt = [
6619
+ Qt = [
6573
6620
  {
6574
6621
  slug: 'claude-fable-5-1',
6575
6622
  family: 'fable-5-1',
@@ -6638,13 +6685,13 @@ var Jt,
6638
6685
  },
6639
6686
  ];
6640
6687
  });
6641
- function Xt(e) {
6688
+ function er(e) {
6642
6689
  return `$${e}`;
6643
6690
  }
6644
- function Be(e, t, r) {
6691
+ function je(e, t, r) {
6645
6692
  return B(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
6646
6693
  }
6647
- function Fi(e) {
6694
+ function Wi(e) {
6648
6695
  return [
6649
6696
  {
6650
6697
  name: 'prompt',
@@ -6710,17 +6757,17 @@ function Fi(e) {
6710
6757
  },
6711
6758
  ];
6712
6759
  }
6713
- function Qt(e) {
6714
- let t = Be(e, 'cheap', 'input'),
6715
- r = Be(e, 'cheap', 'output');
6716
- return t != null && r != null ? `${Xt(t)}/M in \xB7 ${Xt(r)}/M out` : '';
6760
+ function tr(e) {
6761
+ let t = je(e, 'cheap', 'input'),
6762
+ r = je(e, 'cheap', 'output');
6763
+ return t != null && r != null ? `${er(t)}/M in \xB7 ${er(r)}/M out` : '';
6717
6764
  }
6718
- function Zt() {
6765
+ function rr() {
6719
6766
  return Object.fromEntries(
6720
- Jt.map((e) => {
6721
- let t = Be(e.slug, 'stable', 'input') != null,
6722
- r = Qt(e.slug),
6723
- a = {
6767
+ Qt.map((e) => {
6768
+ let t = je(e.slug, 'stable', 'input') != null,
6769
+ r = tr(e.slug),
6770
+ i = {
6724
6771
  slug: e.slug,
6725
6772
  name: e.name,
6726
6773
  category: 'Text',
@@ -6730,50 +6777,50 @@ function Zt() {
6730
6777
  priceFormatted: r,
6731
6778
  unit: '/M tokens',
6732
6779
  primaryToolName: 'run_task',
6733
- parameters: Fi(t),
6780
+ parameters: Wi(t),
6734
6781
  };
6735
- return [e.slug, a];
6782
+ return [e.slug, i];
6736
6783
  }),
6737
6784
  );
6738
6785
  }
6739
- var er = y(() => {
6786
+ var ir = y(() => {
6740
6787
  'use strict';
6741
- Yt();
6788
+ Zt();
6742
6789
  j();
6743
6790
  });
6744
6791
  function we(e) {
6745
- return e ? ji.get(e) : void 0;
6792
+ return e ? Yi.get(e) : void 0;
6746
6793
  }
6747
- function ar(e, t) {
6794
+ function or(e, t) {
6748
6795
  return !e.aspects?.length || e.sourceFramedModes?.includes(t)
6749
6796
  ? null
6750
6797
  : e.adaptiveModes?.includes(t)
6751
6798
  ? [...e.aspects, 'adaptive']
6752
6799
  : [...e.aspects];
6753
6800
  }
6754
- function nr(e, t, r) {
6801
+ function lr(e, t, r) {
6755
6802
  return e.modes.includes('motion_control')
6756
6803
  ? t === 'motion_control'
6757
- ? !Hi.includes(r)
6758
- : !Gi.includes(r)
6804
+ ? !Qi.includes(r)
6805
+ : !Xi.includes(r)
6759
6806
  : !0;
6760
6807
  }
6761
- var tr,
6762
- Bi,
6763
- rr,
6764
- ns,
6765
- ji,
6766
- ir,
6767
- je,
6768
- ss,
6808
+ var ar,
6809
+ Ji,
6810
+ nr,
6811
+ ms,
6812
+ Yi,
6813
+ sr,
6769
6814
  Ge,
6770
- Gi,
6771
- Hi,
6772
- He = y(() => {
6815
+ fs,
6816
+ He,
6817
+ Xi,
6818
+ Qi,
6819
+ ze = y(() => {
6773
6820
  'use strict';
6774
- ((tr = ['16:9', '9:16', '1:1', '21:9']),
6775
- (Bi = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6776
- (rr = [
6821
+ ((ar = ['16:9', '9:16', '1:1', '21:9']),
6822
+ (Ji = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6823
+ (nr = [
6777
6824
  {
6778
6825
  slug: 'kling-v4',
6779
6826
  kind: 'video',
@@ -6781,7 +6828,7 @@ var tr,
6781
6828
  promptMax: 26e3,
6782
6829
  duration: { min: 3, max: 30, default: 5 },
6783
6830
  heights: { '720p': 720, '1080p': 1080 },
6784
- aspects: tr,
6831
+ aspects: ar,
6785
6832
  sourceFramedModes: ['image_to_video'],
6786
6833
  adaptiveModes: ['multi_reference'],
6787
6834
  fps: 24,
@@ -6805,7 +6852,7 @@ var tr,
6805
6852
  promptMax: 26e3,
6806
6853
  duration: { min: 3, max: 20, default: 5 },
6807
6854
  heights: { '720p': 720 },
6808
- aspects: [...tr, '4:3', '3:4'],
6855
+ aspects: [...ar, '4:3', '3:4'],
6809
6856
  sourceFramedModes: ['image_to_video'],
6810
6857
  adaptiveModes: ['multi_reference'],
6811
6858
  fps: 24,
@@ -6845,7 +6892,7 @@ var tr,
6845
6892
  promptMax: 65535,
6846
6893
  duration: { min: 5, max: 15, default: 5 },
6847
6894
  heights: { '480p': 480, '768p': 768 },
6848
- aspects: Bi,
6895
+ aspects: Ji,
6849
6896
  fps: 24,
6850
6897
  audio: 'free',
6851
6898
  seed: !0,
@@ -6920,10 +6967,10 @@ var tr,
6920
6967
  seed: !0,
6921
6968
  },
6922
6969
  ]),
6923
- (ns = rr.map((e) => e.slug)),
6924
- (ji = new Map(rr.map((e) => [e.slug, e]))));
6925
- ((ir = 'EXAVITQu4vr4xnSDxMaL'),
6926
- (je = {
6970
+ (ms = nr.map((e) => e.slug)),
6971
+ (Yi = new Map(nr.map((e) => [e.slug, e]))));
6972
+ ((sr = 'EXAVITQu4vr4xnSDxMaL'),
6973
+ (Ge = {
6927
6974
  hpp4J3VqNfWAUOO0d1Us: 'Bella',
6928
6975
  CwhRBWXzGAHq8TQ4Fs17: 'Roger',
6929
6976
  EXAVITQu4vr4xnSDxMaL: 'Sarah',
@@ -6945,8 +6992,8 @@ var tr,
6945
6992
  pqHfZKP75CvOlQylNhV4: 'Bill',
6946
6993
  pNInz6obpgDQGcFmaJgB: 'Adam',
6947
6994
  }),
6948
- (ss = Object.keys(je)),
6949
- (Ge = [
6995
+ (fs = Object.keys(Ge)),
6996
+ (He = [
6950
6997
  'mp3_44100_128',
6951
6998
  'mp3_22050_32',
6952
6999
  'mp3_24000_48',
@@ -6960,8 +7007,8 @@ var tr,
6960
7007
  'opus_48000_128',
6961
7008
  'opus_48000_192',
6962
7009
  ]));
6963
- ((Gi = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6964
- (Hi = [
7010
+ ((Xi = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
7011
+ (Qi = [
6965
7012
  'duration',
6966
7013
  'aspect_ratio',
6967
7014
  'generate_audio',
@@ -6973,7 +7020,7 @@ var tr,
6973
7020
  'audios',
6974
7021
  ]));
6975
7022
  });
6976
- function Wi() {
7023
+ function ea() {
6977
7024
  return [
6978
7025
  {
6979
7026
  name: 'image_url',
@@ -7001,10 +7048,10 @@ function Wi() {
7001
7048
  },
7002
7049
  ];
7003
7050
  }
7004
- function Ji(e) {
7051
+ function ta(e) {
7005
7052
  let t = e.duration,
7006
7053
  r = Object.keys(e.heights),
7007
- a = e.sourceFramedModes?.length
7054
+ i = e.sourceFramedModes?.length
7008
7055
  ? ` Not taken by ${e.sourceFramedModes.join(', ')}: the source image sets the frame.`
7009
7056
  : '',
7010
7057
  n = e.modeRequired ? void 0 : e.modes[0],
@@ -7031,7 +7078,7 @@ function Ji(e) {
7031
7078
  type: 'select',
7032
7079
  ...(s ? {} : { default: e.aspects[0] }),
7033
7080
  options: [...e.aspects, ...(e.adaptiveModes?.length ? ['adaptive'] : [])],
7034
- description: `The frame.${e.adaptiveModes?.length ? ` adaptive: ${e.adaptiveModes.join(', ')} only.` : ''}${a}`,
7081
+ description: `The frame.${e.adaptiveModes?.length ? ` adaptive: ${e.adaptiveModes.join(', ')} only.` : ''}${i}`,
7035
7082
  },
7036
7083
  ];
7037
7084
  if (
@@ -7069,32 +7116,32 @@ function Ji(e) {
7069
7116
  }),
7070
7117
  e.reference?.maxVideos)
7071
7118
  ) {
7072
- let d = e.reference,
7119
+ let p = e.reference,
7073
7120
  l = e.videoInputBilling
7074
7121
  ? ` Billed as input plus output seconds${e.videoInputBilling.minOutputMultiple > 1 ? `, at least ${e.videoInputBilling.minOutputMultiple}x the output` : ''}.`
7075
7122
  : '';
7076
7123
  o.push({
7077
7124
  name: 'videos',
7078
7125
  type: 'string[]',
7079
- description: `multi_reference: up to ${d.maxVideos} reference videos${d.videoClipMinSeconds ? `, each longer than ${d.videoClipMinSeconds} s` : ''}${d.videoSides ? `, ${d.videoSides.min} to ${d.videoSides.max} px tall and wide` : ''}${d.maxVideoSeconds ? `, ${d.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${l} ${D}`,
7126
+ description: `multi_reference: up to ${p.maxVideos} reference videos${p.videoClipMinSeconds ? `, each longer than ${p.videoClipMinSeconds} s` : ''}${p.videoSides ? `, ${p.videoSides.min} to ${p.videoSides.max} px tall and wide` : ''}${p.maxVideoSeconds ? `, ${p.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${l} ${D}`,
7080
7127
  });
7081
7128
  }
7082
7129
  if (e.reference?.maxAudios) {
7083
- let d = e.reference,
7084
- l = d.audioClipSeconds
7085
- ? `, each ${d.audioClipSeconds.min} to ${d.audioClipSeconds.max} s`
7086
- : d.maxAudioSeconds
7087
- ? `, ${d.maxAudioSeconds} s in all`
7130
+ let p = e.reference,
7131
+ l = p.audioClipSeconds
7132
+ ? `, each ${p.audioClipSeconds.min} to ${p.audioClipSeconds.max} s`
7133
+ : p.maxAudioSeconds
7134
+ ? `, ${p.maxAudioSeconds} s in all`
7088
7135
  : '';
7089
7136
  o.push({
7090
7137
  name: 'audios',
7091
7138
  type: 'string[]',
7092
- description: `multi_reference: up to ${d.maxAudios} reference audios${l}, with at least one image or video. ${D}`,
7139
+ description: `multi_reference: up to ${p.maxAudios} reference audios${l}, with at least one image or video. ${D}`,
7093
7140
  });
7094
7141
  }
7095
7142
  return o;
7096
7143
  }
7097
- function Yi(e) {
7144
+ function ra(e) {
7098
7145
  let t = Object.keys(e.sizes);
7099
7146
  return [
7100
7147
  {
@@ -7111,13 +7158,13 @@ function Yi(e) {
7111
7158
  },
7112
7159
  ];
7113
7160
  }
7114
- function Qi() {
7161
+ function aa() {
7115
7162
  return [
7116
7163
  {
7117
7164
  name: 'voice_id',
7118
7165
  type: 'string',
7119
- default: ir,
7120
- description: `text_to_speech: the ElevenLabs voice id, one of: ${Xi}.`,
7166
+ default: sr,
7167
+ description: `text_to_speech: the ElevenLabs voice id, one of: ${ia}.`,
7121
7168
  },
7122
7169
  {
7123
7170
  name: 'turns',
@@ -7125,7 +7172,7 @@ function Qi() {
7125
7172
  description:
7126
7173
  '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.',
7127
7174
  },
7128
- { name: 'output_format', type: 'select', default: Ge[0], options: [...Ge] },
7175
+ { name: 'output_format', type: 'select', default: He[0], options: [...He] },
7129
7176
  { name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
7130
7177
  {
7131
7178
  name: 'similarity_boost',
@@ -7136,7 +7183,7 @@ function Qi() {
7136
7183
  },
7137
7184
  ];
7138
7185
  }
7139
- function sr(e) {
7186
+ function pr(e) {
7140
7187
  let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
7141
7188
  r = [
7142
7189
  {
@@ -7151,26 +7198,26 @@ function sr(e) {
7151
7198
  required: !0,
7152
7199
  ...(e.modeRequired ? {} : { default: e.modes[0] }),
7153
7200
  options: [...e.modes],
7154
- description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => zi[a]).join(' ')}`,
7201
+ description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((i) => Zi[i]).join(' ')}`,
7155
7202
  },
7156
7203
  ];
7157
7204
  return (
7158
- e.kind === 'video' ? r.push(...Ji(e)) : e.kind === 'image' ? r.push(...Yi(e)) : r.push(...Qi()),
7159
- e.modes.includes('motion_control') && r.push(...Wi()),
7205
+ e.kind === 'video' ? r.push(...ta(e)) : e.kind === 'image' ? r.push(...ra(e)) : r.push(...aa()),
7206
+ e.modes.includes('motion_control') && r.push(...ea()),
7160
7207
  e.seed &&
7161
7208
  r.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
7162
7209
  r
7163
7210
  );
7164
7211
  }
7165
7212
  var D,
7166
- zi,
7167
- Xi,
7168
- or = y(() => {
7213
+ Zi,
7214
+ ia,
7215
+ dr = y(() => {
7169
7216
  'use strict';
7170
- He();
7217
+ ze();
7171
7218
  ((D =
7172
7219
  '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.'),
7173
- (zi = {
7220
+ (Zi = {
7174
7221
  text_to_video: 'text_to_video: from the prompt alone.',
7175
7222
  image_to_video: 'image_to_video: a start image in first_frame_image.',
7176
7223
  first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
@@ -7182,44 +7229,44 @@ var D,
7182
7229
  motion_control:
7183
7230
  'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
7184
7231
  }));
7185
- Xi = Object.entries(je)
7232
+ ia = Object.entries(Ge)
7186
7233
  .map(([e, t]) => `${e} (${t})`)
7187
7234
  .join(', ');
7188
7235
  });
7189
- function pr(e) {
7236
+ function mr(e) {
7190
7237
  return e === xe || e === ke;
7191
7238
  }
7192
7239
  var xe,
7193
- lr,
7194
- ke,
7195
- dr,
7196
- ze,
7197
7240
  cr,
7198
- ps,
7199
- cs,
7200
- us,
7201
- ms,
7202
- ur = y(() => {
7241
+ ke,
7242
+ ur,
7243
+ We,
7244
+ fr,
7245
+ bs,
7246
+ ws,
7247
+ xs,
7248
+ ks,
7249
+ gr = y(() => {
7203
7250
  'use strict';
7204
7251
  ((xe = 'enhancor-ultrafine'),
7205
- (lr = 'Enhancor Ultrafine'),
7252
+ (cr = 'Enhancor Ultrafine'),
7206
7253
  (ke = 'enhancor-deblur'),
7207
- (dr = 'Enhancor Deblur'));
7208
- ((ze = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7209
- (cr = 2),
7210
- (ps = 24 * 1024 * 1024),
7211
- (cs = 4096 * 4096),
7212
- (us = 30 * 6e4),
7213
- (ms = 120 * 6e4));
7254
+ (ur = 'Enhancor Deblur'));
7255
+ ((We = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7256
+ (fr = 2),
7257
+ (bs = 24 * 1024 * 1024),
7258
+ (ws = 4096 * 4096),
7259
+ (xs = 30 * 6e4),
7260
+ (ks = 120 * 6e4));
7214
7261
  });
7215
- var Zi,
7216
- mr,
7217
- ea,
7218
- We,
7219
- fr = y(() => {
7262
+ var na,
7263
+ hr,
7264
+ sa,
7265
+ Je,
7266
+ yr = y(() => {
7220
7267
  'use strict';
7221
- ((Zi = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
7222
- (mr = {
7268
+ ((na = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
7269
+ (hr = {
7223
7270
  natural: 'Natural',
7224
7271
  pores: 'Pores',
7225
7272
  freckles: 'Freckles',
@@ -7228,12 +7275,12 @@ var Zi,
7228
7275
  glow: 'Glow',
7229
7276
  unblur: 'Unblur',
7230
7277
  }),
7231
- (ea = 'unblur'),
7232
- (We = Zi.filter((e) => e !== ea)));
7278
+ (sa = 'unblur'),
7279
+ (Je = na.filter((e) => e !== sa)));
7233
7280
  });
7234
7281
  var ee,
7235
7282
  _e,
7236
- Je = y(() => {
7283
+ Ye = y(() => {
7237
7284
  'use strict';
7238
7285
  ((ee = [
7239
7286
  'seedance-2-5',
@@ -7250,10 +7297,34 @@ var ee,
7250
7297
  (_e =
7251
7298
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
7252
7299
  });
7300
+ function oa(e) {
7301
+ return br.includes(e);
7302
+ }
7303
+ function Pe(e = process.env) {
7304
+ let t = String(e.IMAGE_PRIORITY_MODELS ?? ''),
7305
+ r = new Set(
7306
+ t
7307
+ .split(',')
7308
+ .map((i) => i.trim().toLowerCase())
7309
+ .filter(Boolean),
7310
+ );
7311
+ return br.filter((i) => r.has(i));
7312
+ }
7313
+ function wr(e, t = process.env) {
7314
+ return oa(e) && Pe(t).includes(e);
7315
+ }
7316
+ function xr(e) {
7317
+ return e === 'nano-banana-pro' ? 'Nano Banana Pro' : 'Nano Banana 2.1';
7318
+ }
7319
+ var br,
7320
+ Xe = y(() => {
7321
+ 'use strict';
7322
+ br = ['nano-banana-2.1', 'nano-banana-pro'];
7323
+ });
7253
7324
  function te(e) {
7254
7325
  return `$${Number(e.toFixed(5))}`;
7255
7326
  }
7256
- function tt(e) {
7327
+ function it(e) {
7257
7328
  if (e.kind === 'llm') {
7258
7329
  let t = e.defaultEndpoint,
7259
7330
  r = (s) =>
@@ -7263,28 +7334,28 @@ function tt(e) {
7263
7334
  (!t || !o.endpoint || o.endpoint === t) &&
7264
7335
  (!o.context || o.context === '0\u201332K'),
7265
7336
  ),
7266
- a = r('input'),
7337
+ i = r('input'),
7267
7338
  n = r('output');
7268
- return a && n
7269
- ? `${te(a.price.starter)}/M in \xB7 ${te(n.price.starter)}/M out`
7339
+ return i && n
7340
+ ? `${te(i.price.starter)}/M in \xB7 ${te(n.price.starter)}/M out`
7270
7341
  : `from ${te(he(e).price.starter)}/M tokens`;
7271
7342
  }
7272
7343
  return `from ${te(he(e).price.starter)}${e.unit}`;
7273
7344
  }
7274
- function ia(e, t) {
7275
- let r = t.filter((a) => Number.isFinite(a) && a > 0);
7345
+ function da(e, t) {
7346
+ let r = t.filter((i) => Number.isFinite(i) && i > 0);
7276
7347
  return r.length ? `from ${te(Math.min(...r))}${e}` : null;
7277
7348
  }
7278
- function br(e) {
7349
+ function Ir(e) {
7279
7350
  for (let t of ce) {
7280
7351
  let r = Y[t],
7281
- a = r ? ia(r.unit, e[t] ?? []) : null;
7282
- r && a && (r.priceFormatted = a);
7352
+ i = r ? da(r.unit, e[t] ?? []) : null;
7353
+ r && i && (r.priceFormatted = i);
7283
7354
  }
7284
7355
  }
7285
- function R(e, t) {
7356
+ function A(e, t) {
7286
7357
  let r = e.axes?.resolution ?? [
7287
- ...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
7358
+ ...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
7288
7359
  ];
7289
7360
  return {
7290
7361
  name: 'resolution',
@@ -7294,13 +7365,13 @@ function R(e, t) {
7294
7365
  ...(t ? { description: t } : {}),
7295
7366
  };
7296
7367
  }
7297
- function wr(e) {
7368
+ function vr(e) {
7298
7369
  if (!e.endpoints?.length) return null;
7299
- let t = e.endpoints.filter((r) => Bt(e.slug, r.id));
7370
+ let t = e.endpoints.filter((r) => Ht(e.slug, r.id));
7300
7371
  return {
7301
7372
  name: 'endpoint',
7302
7373
  type: 'select',
7303
- default: Ne(e),
7374
+ default: Ve(e),
7304
7375
  options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
7305
7376
  description:
7306
7377
  (e.slug === 'gemini-3.1-pro-preview'
@@ -7309,55 +7380,55 @@ function wr(e) {
7309
7380
  (t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
7310
7381
  };
7311
7382
  }
7312
- function na(e, t) {
7313
- if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
7383
+ function ua(e, t) {
7384
+ if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
7314
7385
  let r = ee.includes(e.api.model);
7315
- return [...t.filter((a) => !Pe.has(a.name)), r ? it : aa];
7386
+ return [...t.filter((i) => !Ie.has(i.name)), r ? nt : ca];
7316
7387
  }
7317
- function Ye(e, t) {
7318
- let r = e.filter((n) => !Pe.has(n.name)),
7319
- a = [it, xr];
7320
- return (a.push(at, nt), [...r, ...a]);
7388
+ function Qe(e, t) {
7389
+ let r = e.filter((n) => !Ie.has(n.name)),
7390
+ i = [nt, Tr];
7391
+ return (i.push(st, ot), [...r, ...i]);
7321
7392
  }
7322
- function da(e) {
7393
+ function ha(e) {
7323
7394
  return [
7324
7395
  ...e
7325
- .filter((t) => !oa.has(t.name) && !Pe.has(t.name))
7396
+ .filter((t) => !fa.has(t.name) && !Ie.has(t.name))
7326
7397
  .map((t) => {
7327
7398
  if (t.name === 'resolution')
7328
7399
  return {
7329
7400
  ...t,
7330
7401
  ...(t.options
7331
7402
  ? {
7332
- options: t.options.filter((a) =>
7333
- ['480p', '720p'].includes(String(a).toLowerCase()),
7403
+ options: t.options.filter((i) =>
7404
+ ['480p', '720p'].includes(String(i).toLowerCase()),
7334
7405
  ),
7335
7406
  }
7336
7407
  : {}),
7337
7408
  description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${re}`,
7338
7409
  };
7339
- let r = la[t.name];
7410
+ let r = ga[t.name];
7340
7411
  return r && typeof t.description == 'string'
7341
7412
  ? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
7342
7413
  : t;
7343
7414
  }),
7344
- it,
7345
- xr,
7346
- at,
7347
7415
  nt,
7416
+ Tr,
7417
+ st,
7418
+ ot,
7348
7419
  ];
7349
7420
  }
7350
- function kr(e) {
7421
+ function Mr(e) {
7351
7422
  return (
7352
7423
  e.startsWith('seedance-2-5-') &&
7353
7424
  e !== 'seedance-2-5-lite' &&
7354
7425
  !/-(creative-mode|unfiltered|uncensored)$/.test(e)
7355
7426
  );
7356
7427
  }
7357
- function gr(e, t = {}) {
7428
+ function kr(e, t = {}) {
7358
7429
  return [
7359
7430
  ...e
7360
- .filter((r) => !sa.has(r.name) && !Pe.has(r.name))
7431
+ .filter((r) => !ma.has(r.name) && !Ie.has(r.name))
7361
7432
  .map((r) =>
7362
7433
  r.name === 'prompt'
7363
7434
  ? { ...r, required: !0 }
@@ -7365,7 +7436,7 @@ function gr(e, t = {}) {
7365
7436
  ? {
7366
7437
  ...r,
7367
7438
  ...(t.no4k && r.options
7368
- ? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
7439
+ ? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
7369
7440
  : {}),
7370
7441
  description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${re}`,
7371
7442
  }
@@ -7378,13 +7449,13 @@ function gr(e, t = {}) {
7378
7449
  options: ['standard'],
7379
7450
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
7380
7451
  },
7381
- at,
7382
- nt,
7452
+ st,
7453
+ ot,
7383
7454
  ];
7384
7455
  }
7385
- function Xe(e, t) {
7456
+ function Ze(e, t) {
7386
7457
  return [
7387
- E('Text prompt describing the video.'),
7458
+ S('Text prompt describing the video.'),
7388
7459
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
7389
7460
  {
7390
7461
  name: 'duration',
@@ -7394,7 +7465,7 @@ function Xe(e, t) {
7394
7465
  max: t.maxSec,
7395
7466
  description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
7396
7467
  },
7397
- R(e),
7468
+ A(e),
7398
7469
  { name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
7399
7470
  ...t.references.map((r) =>
7400
7471
  r.endsWith('s')
@@ -7411,15 +7482,15 @@ function Xe(e, t) {
7411
7482
  ),
7412
7483
  ];
7413
7484
  }
7414
- function pa(e, t) {
7485
+ function ya(e, t) {
7415
7486
  return e.map((r) =>
7416
7487
  t[r.name] ? { ...r, description: `${r.description ?? ''} ${t[r.name]}`.trim() } : r,
7417
7488
  );
7418
7489
  }
7419
- function ca(e) {
7420
- let t = wr(e);
7490
+ function ba(e) {
7491
+ let t = vr(e);
7421
7492
  return [
7422
- E('Image prompt text. Supports complex composition and text instructions.'),
7493
+ S('Image prompt text. Supports complex composition and text instructions.'),
7423
7494
  ...(t ? [t] : []),
7424
7495
  {
7425
7496
  name: 'quality',
@@ -7427,17 +7498,17 @@ function ca(e) {
7427
7498
  default: 'low',
7428
7499
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
7429
7500
  },
7430
- R(
7501
+ A(
7431
7502
  e,
7432
7503
  e.slug === 'gpt-image-2'
7433
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${vt}`
7504
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${St}`
7434
7505
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
7435
7506
  ),
7436
7507
  {
7437
7508
  name: 'aspect_ratio',
7438
7509
  type: 'select',
7439
7510
  default: 'auto',
7440
- options: [...It],
7511
+ options: [...Mt],
7441
7512
  description:
7442
7513
  "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.",
7443
7514
  },
@@ -7484,16 +7555,16 @@ function ca(e) {
7484
7555
  },
7485
7556
  ];
7486
7557
  }
7487
- function ua(e) {
7558
+ function wa(e) {
7488
7559
  return [
7489
- E('Image prompt text.'),
7560
+ S('Image prompt text.'),
7490
7561
  {
7491
7562
  name: 'input_images',
7492
7563
  type: 'string[]',
7493
7564
  description: 'Images to edit or use as reference (up to 14).',
7494
7565
  },
7495
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Gt(e.slug)] },
7496
- R(e),
7566
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Wt(e.slug)] },
7567
+ A(e),
7497
7568
  {
7498
7569
  name: 'n',
7499
7570
  type: 'slider',
@@ -7518,10 +7589,10 @@ function ua(e) {
7518
7589
  },
7519
7590
  ];
7520
7591
  }
7521
- function ha() {
7522
- let e = zt,
7592
+ function Pa() {
7593
+ let e = Yt,
7523
7594
  t = [];
7524
- for (let r of st(!0))
7595
+ for (let r of lt(!0))
7525
7596
  e.includes(r.name) &&
7526
7597
  (t.push({
7527
7598
  ...r,
@@ -7543,14 +7614,14 @@ function ha() {
7543
7614
  }));
7544
7615
  return t;
7545
7616
  }
7546
- function ya() {
7547
- return st(!0).map((e) =>
7617
+ function Ia() {
7618
+ return lt(!0).map((e) =>
7548
7619
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
7549
7620
  );
7550
7621
  }
7551
- function st(e) {
7622
+ function lt(e) {
7552
7623
  return [
7553
- E('The user message or task.'),
7624
+ S('The user message or task.'),
7554
7625
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
7555
7626
  {
7556
7627
  name: 'messages',
@@ -7643,21 +7714,21 @@ function st(e) {
7643
7714
  },
7644
7715
  ];
7645
7716
  }
7646
- function ba(e) {
7647
- if (e.slug === 'seed-2-1-turbo') return fa;
7648
- let t = wr(e);
7717
+ function va(e) {
7718
+ if (e.slug === 'seed-2-1-turbo') return ka;
7719
+ let t = vr(e);
7649
7720
  return [
7650
7721
  ...(e.slug === 'gemini-3.1-pro-preview'
7651
- ? ha()
7722
+ ? Pa()
7652
7723
  : e.slug === 'gemini-3.7-flash'
7653
- ? ya()
7654
- : e.slug === 'gpt-6-astra' || ga.includes(e.slug)
7655
- ? st(e.slug !== 'gpt-6-astra')
7656
- : ma),
7724
+ ? Ia()
7725
+ : e.slug === 'gpt-6-astra' || _a.includes(e.slug)
7726
+ ? lt(e.slug !== 'gpt-6-astra')
7727
+ : xa),
7657
7728
  ...(t ? [t] : []),
7658
7729
  ];
7659
7730
  }
7660
- function Qe() {
7731
+ function et() {
7661
7732
  return {
7662
7733
  name: 'image',
7663
7734
  type: 'string',
@@ -7665,7 +7736,7 @@ function Qe() {
7665
7736
  description: 'The photo to fix: one JPEG or PNG URL.',
7666
7737
  };
7667
7738
  }
7668
- function xa(e) {
7739
+ function Ma(e) {
7669
7740
  return [
7670
7741
  {
7671
7742
  name: 'video_url',
@@ -7674,7 +7745,7 @@ function xa(e) {
7674
7745
  description:
7675
7746
  'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
7676
7747
  },
7677
- R(
7748
+ A(
7678
7749
  e,
7679
7750
  'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
7680
7751
  ),
@@ -7687,7 +7758,7 @@ function xa(e) {
7687
7758
  },
7688
7759
  ];
7689
7760
  }
7690
- function ka() {
7761
+ function Sa() {
7691
7762
  return [
7692
7763
  {
7693
7764
  name: 'mode',
@@ -7758,40 +7829,40 @@ function ka() {
7758
7829
  },
7759
7830
  ];
7760
7831
  }
7761
- function _a(e) {
7832
+ function Ka(e) {
7762
7833
  let t = e.slug;
7763
- if (e.family === 'tein-labs' && e.kind === 'image') return ka();
7764
- if (me.some((a) => a.slug === t)) return xa(e);
7765
- if (e.kind === 'llm') return ba(e);
7766
- if (e.editVariants?.length) return ca(e);
7834
+ if (e.family === 'tein-labs' && e.kind === 'image') return Sa();
7835
+ if (me.some((i) => i.slug === t)) return Ma(e);
7836
+ if (e.kind === 'llm') return va(e);
7837
+ if (e.editVariants?.length) return ba(e);
7767
7838
  let r = we(t);
7768
- if (r) return sr(r);
7769
- if (kr(t)) return da(Ze);
7839
+ if (r) return pr(r);
7840
+ if (Mr(t)) return ha(tt);
7770
7841
  switch (t) {
7771
7842
  case 'seedance-2-5':
7772
- return Ye(Ze, t);
7843
+ return Qe(tt, t);
7773
7844
  case 'seedance-2-5-lite':
7774
- return gr(Ze, { no4k: !0 });
7845
+ return kr(tt, { no4k: !0 });
7775
7846
  case 'seedance-2':
7776
- return Ye(hr, t);
7847
+ return Qe(_r, t);
7777
7848
  case 'seedance-2-lite':
7778
- return gr(hr);
7849
+ return kr(_r);
7779
7850
  case 'seedance-2-mini':
7780
- return Ye(Pa, t);
7851
+ return Qe(Ea, t);
7781
7852
  case 'nano-banana-2':
7782
7853
  case 'nano-banana-2.1':
7783
7854
  case 'nano-banana-pro':
7784
- return ua(e);
7855
+ return wa(e);
7785
7856
  case 'seedream-5-pro':
7786
7857
  return [
7787
- E('Detailed description of the image to generate.'),
7858
+ S('Detailed description of the image to generate.'),
7788
7859
  {
7789
7860
  name: 'images',
7790
7861
  type: 'string[]',
7791
7862
  description:
7792
7863
  'Reference images. The first is free; each one after it adds the extra reference image charge (see the price).',
7793
7864
  },
7794
- R(e),
7865
+ A(e),
7795
7866
  {
7796
7867
  name: 'aspect_ratio',
7797
7868
  type: 'select',
@@ -7803,14 +7874,14 @@ function _a(e) {
7803
7874
  case 'minimax-h3-image':
7804
7875
  case 'minimax-h3-image-highspeed':
7805
7876
  return [
7806
- E('What to make, or how to change the reference images.'),
7877
+ S('What to make, or how to change the reference images.'),
7807
7878
  {
7808
7879
  name: 'images',
7809
7880
  type: 'string[]',
7810
7881
  description:
7811
7882
  'Reference images to edit or combine (up to 16). Leave empty for text to image. Each reference image is billed.',
7812
7883
  },
7813
- { ...R(e, '1K, 2K or 4K (about 16 megapixels).'), default: '2K' },
7884
+ { ...A(e, '1K, 2K or 4K (about 16 megapixels).'), default: '2K' },
7814
7885
  {
7815
7886
  name: 'aspect_ratio',
7816
7887
  type: 'select',
@@ -7849,7 +7920,7 @@ function _a(e) {
7849
7920
  description:
7850
7921
  'text_to_image, image_to_image (up to 10 reference images) or layer_decomposition (split one image into a base image and editable transparent layers).',
7851
7922
  },
7852
- E(
7923
+ S(
7853
7924
  'What to make or change. Optional for layer_decomposition, where it can say how to split the image (for example "keep the logo as one layer").',
7854
7925
  ),
7855
7926
  {
@@ -7858,7 +7929,7 @@ function _a(e) {
7858
7929
  description:
7859
7930
  'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
7860
7931
  },
7861
- R(
7932
+ A(
7862
7933
  e,
7863
7934
  '1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
7864
7935
  ),
@@ -7898,13 +7969,13 @@ function _a(e) {
7898
7969
  case 'qwen-3':
7899
7970
  case 'qwen-3-pro':
7900
7971
  return [
7901
- E('Image prompt text; dense layouts and multilingual text work well.'),
7972
+ S('Image prompt text; dense layouts and multilingual text work well.'),
7902
7973
  {
7903
7974
  name: 'images',
7904
7975
  type: 'string[]',
7905
7976
  description: 'Up to 3 reference images, each billed at the published add-on price.',
7906
7977
  },
7907
- R(e),
7978
+ A(e),
7908
7979
  {
7909
7980
  name: 'aspect_ratio',
7910
7981
  type: 'select',
@@ -7922,8 +7993,8 @@ function _a(e) {
7922
7993
  ];
7923
7994
  case 'z-image-pro':
7924
7995
  return [
7925
- E('Image prompt text: subject, scene, style, composition and lighting.'),
7926
- R(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
7996
+ S('Image prompt text: subject, scene, style, composition and lighting.'),
7997
+ A(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
7927
7998
  {
7928
7999
  name: 'aspect_ratio',
7929
8000
  type: 'select',
@@ -7954,7 +8025,7 @@ function _a(e) {
7954
8025
  ];
7955
8026
  case 'wan-2-5-image':
7956
8027
  return [
7957
- E('Image prompt, or for an edit the change to make (up to 2000 characters).'),
8028
+ S('Image prompt, or for an edit the change to make (up to 2000 characters).'),
7958
8029
  {
7959
8030
  name: 'images',
7960
8031
  type: 'string[]',
@@ -8020,7 +8091,7 @@ function _a(e) {
8020
8091
  ];
8021
8092
  case 'enhancor-skin-fix-v1':
8022
8093
  return [
8023
- Qe(),
8094
+ et(),
8024
8095
  {
8025
8096
  name: 'mode',
8026
8097
  type: 'select',
@@ -8053,11 +8124,11 @@ function _a(e) {
8053
8124
  max: 0.4,
8054
8125
  description: 'Portrait depth. Heavy only.',
8055
8126
  },
8056
- ...wa,
8127
+ ...Ta,
8057
8128
  ];
8058
8129
  case 'enhancor-skin-fix-v3':
8059
8130
  return [
8060
- Qe(),
8131
+ et(),
8061
8132
  {
8062
8133
  name: 'mask_image',
8063
8134
  type: 'string',
@@ -8097,7 +8168,7 @@ function _a(e) {
8097
8168
  ];
8098
8169
  case 'enhancor-skin-fix-v4':
8099
8170
  return [
8100
- Qe(),
8171
+ et(),
8101
8172
  {
8102
8173
  name: 'mode',
8103
8174
  type: 'select',
@@ -8128,7 +8199,7 @@ function _a(e) {
8128
8199
  ];
8129
8200
  case 'wan-3-0':
8130
8201
  case 'wan-3-0-prime':
8131
- return Xe(e, {
8202
+ return Ze(e, {
8132
8203
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8133
8204
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
8134
8205
  minSec: 2,
@@ -8138,7 +8209,7 @@ function _a(e) {
8138
8209
  });
8139
8210
  case 'happy-horse-1-1':
8140
8211
  case 'happy-horse-1-0':
8141
- return Xe(e, {
8212
+ return Ze(e, {
8142
8213
  modes:
8143
8214
  t === 'happy-horse-1-0'
8144
8215
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -8150,7 +8221,7 @@ function _a(e) {
8150
8221
  });
8151
8222
  case 'gemini-omni-1.2-flash':
8152
8223
  return [
8153
- E(
8224
+ S(
8154
8225
  'Describe the video and its sound (dialogue, effects, music), or for video_edit / video_extend the change or what happens next (up to 20000 characters).',
8155
8226
  ),
8156
8227
  {
@@ -8176,7 +8247,7 @@ function _a(e) {
8176
8247
  description:
8177
8248
  'Video length in seconds (3 to 15). With a last frame 3 to 10; for video_extend the seconds added (3 to 10). Not taken by video_edit, which bills the input video length.',
8178
8249
  },
8179
- { ...R(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
8250
+ { ...A(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
8180
8251
  {
8181
8252
  name: 'aspect_ratio',
8182
8253
  type: 'select',
@@ -8208,9 +8279,74 @@ function _a(e) {
8208
8279
  'video_edit / video_extend: the video to change (MP4, MOV or WebM, with a video track): 3 to 15 s for video_edit, 15 s or less for video_extend. A public http(s) URL or data URI.',
8209
8280
  },
8210
8281
  ];
8282
+ case 'magi-2':
8283
+ return [
8284
+ S(
8285
+ 'Describe the video, the camera and its sound; for multi_reference say what each reference is for (up to 15000 characters).',
8286
+ ),
8287
+ {
8288
+ name: 'mode',
8289
+ type: 'select',
8290
+ required: !0,
8291
+ options: ['text_to_video', 'image_to_video', 'multi_reference'],
8292
+ description:
8293
+ 'text_to_video; image_to_video (first_frame_image, optional last_frame_image); multi_reference (images, videos and/or audios).',
8294
+ },
8295
+ {
8296
+ name: 'duration',
8297
+ type: 'slider',
8298
+ default: 5,
8299
+ min: 4,
8300
+ max: 30,
8301
+ description: 'Video length in whole seconds: 4 to 15 at 720p, 4 to 30 at 1080p.',
8302
+ },
8303
+ { ...A(e, 'Sound is the same price on or off.'), default: '720p' },
8304
+ {
8305
+ name: 'aspect_ratio',
8306
+ type: 'select',
8307
+ options: ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9'],
8308
+ description:
8309
+ 'text_to_video and multi_reference (left out: 16:9). image_to_video: leave it out to follow the start image (21:9 not taken); a ratio that differs from the image crops it.',
8310
+ },
8311
+ {
8312
+ name: 'generate_audio',
8313
+ type: 'boolean',
8314
+ default: !0,
8315
+ description: 'Generate sound with the video (same price either way).',
8316
+ },
8317
+ {
8318
+ name: 'first_frame_image',
8319
+ type: 'string',
8320
+ description:
8321
+ 'image_to_video: the start frame (JPEG, PNG or WebP), as a public http(s) URL or data URI. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
8322
+ },
8323
+ {
8324
+ name: 'last_frame_image',
8325
+ type: 'string',
8326
+ description: 'image_to_video: an optional end frame.',
8327
+ },
8328
+ {
8329
+ name: 'images',
8330
+ type: 'string[]',
8331
+ description:
8332
+ 'multi_reference: reference images (up to 9 at 720p, 10 at 1080p). Public http(s) URLs or data URIs.',
8333
+ },
8334
+ {
8335
+ name: 'videos',
8336
+ type: 'string[]',
8337
+ description:
8338
+ 'multi_reference: reference videos, MP4 or MOV (up to 3 at 720p, 2-15 s each and 15 s in all; up to 5 at 1080p, 2-30 s each and 30 s in all). At 720p a reference video bills its own seconds too.',
8339
+ },
8340
+ {
8341
+ name: 'audios',
8342
+ type: 'string[]',
8343
+ description:
8344
+ 'multi_reference: reference audio, MP3 or WAV (up to 3 at 720p with an image or video; up to 5 at 1080p, where audio alone works).',
8345
+ },
8346
+ ];
8211
8347
  case 'minimax-h3':
8212
- return pa(
8213
- Xe(e, {
8348
+ return ya(
8349
+ Ze(e, {
8214
8350
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
8215
8351
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
8216
8352
  minSec: 4,
@@ -8225,10 +8361,10 @@ function _a(e) {
8225
8361
  },
8226
8362
  );
8227
8363
  default:
8228
- return [E('Prompt text.')];
8364
+ return [S('Prompt text.')];
8229
8365
  }
8230
8366
  }
8231
- function Ir() {
8367
+ function Er() {
8232
8368
  let e = (t, r) => ({
8233
8369
  name: t,
8234
8370
  type: 'slider',
@@ -8249,7 +8385,7 @@ function Ir() {
8249
8385
  ),
8250
8386
  ];
8251
8387
  }
8252
- function vr(e) {
8388
+ function $r(e) {
8253
8389
  return {
8254
8390
  name: 'image',
8255
8391
  type: 'string',
@@ -8257,10 +8393,10 @@ function vr(e) {
8257
8393
  description: `The photo to ${e}: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.`,
8258
8394
  };
8259
8395
  }
8260
- function Ia() {
8396
+ function $a() {
8261
8397
  return {
8262
8398
  slug: xe,
8263
- name: lr,
8399
+ name: cr,
8264
8400
  category: 'Image',
8265
8401
  kind: 'Image-to-Image',
8266
8402
  vendor: 'Enhancor',
@@ -8268,14 +8404,14 @@ function Ia() {
8268
8404
  'Upscales a photo, with an optional skin preset that gives AI or smooth skin real texture first (Natural, Pores, Freckles, More freckles, Blemish, Glow). Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). For a blurry photo use Enhancor Deblur (enhancor-deblur).',
8269
8405
  priceFormatted: '',
8270
8406
  unit: '/img',
8271
- primaryToolName: rt.image,
8407
+ primaryToolName: at.image,
8272
8408
  parameters: [
8273
- vr('upscale'),
8409
+ $r('upscale'),
8274
8410
  {
8275
8411
  name: 'preset',
8276
8412
  type: 'select',
8277
- options: [...We],
8278
- description: `Skin preset, run before the upscale: ${We.map((e) => `${e} (${mr[e]})`).join(', ')}. Seedream 5.5 redraws the skin at about the photo's own size and shape, keeping the person, the background and any text; that picture is brought back to the photo's size and upscaled, so the output is still the photo times the scale. Priced at the skin rate. Leave it out for a plain upscale.`,
8413
+ options: [...Je],
8414
+ description: `Skin preset, run before the upscale: ${Je.map((e) => `${e} (${hr[e]})`).join(', ')}. Seedream 5.5 redraws the skin at about the photo's own size and shape, keeping the person, the background and any text; that picture is brought back to the photo's size and upscaled, so the output is still the photo times the scale. Priced at the skin rate. Leave it out for a plain upscale.`,
8279
8415
  },
8280
8416
  {
8281
8417
  name: 'skin_fix',
@@ -8283,16 +8419,16 @@ function Ia() {
8283
8419
  default: !1,
8284
8420
  description: 'Same as preset natural. Off by default.',
8285
8421
  },
8286
- Tr,
8287
- Mr,
8288
- ...Ir(),
8422
+ Cr,
8423
+ Ar,
8424
+ ...Er(),
8289
8425
  ],
8290
8426
  };
8291
8427
  }
8292
- function va() {
8428
+ function Ca() {
8293
8429
  return {
8294
8430
  slug: ke,
8295
- name: dr,
8431
+ name: ur,
8296
8432
  category: 'Image',
8297
8433
  kind: 'Image-to-Image',
8298
8434
  vendor: 'Enhancor',
@@ -8300,82 +8436,92 @@ function va() {
8300
8436
  'Sharpens a blurry or soft photo and upscales it: Seedream 5.5 unblurs the photo at about its own size and shape, keeping the same person, face, freckles and moles, then that picture is upscaled. Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). No prompt.',
8301
8437
  priceFormatted: '',
8302
8438
  unit: '/img',
8303
- primaryToolName: rt.image,
8304
- parameters: [vr('deblur'), Tr, Mr, ...Ir()],
8439
+ primaryToolName: at.image,
8440
+ parameters: [$r('deblur'), Cr, Ar, ...Er()],
8305
8441
  };
8306
8442
  }
8307
- function et(e, t = e.api.model) {
8308
- let r = Ut(e.slug);
8443
+ function rt(e, t = e.api.model) {
8444
+ let r = Bt(e.slug);
8309
8445
  return {
8310
8446
  slug: t,
8311
8447
  name: e.name,
8312
- category: ta[e.kind],
8313
- kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : ra[e.kind],
8448
+ category: la[e.kind],
8449
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : pa[e.kind],
8314
8450
  vendor: e.vendor ?? '',
8315
8451
  description: e.desc ?? e.name,
8316
- priceFormatted: tt(e),
8452
+ priceFormatted: it(e),
8317
8453
  ...(r.length ? { priceNotes: r } : {}),
8318
8454
  unit: e.unit,
8319
- primaryToolName: rt[e.kind],
8320
- parameters: na(e, _a(e)),
8455
+ primaryToolName: at[e.kind],
8456
+ parameters: ua(e, Ka(e)),
8321
8457
  };
8322
8458
  }
8323
- function Ta() {
8459
+ function Aa() {
8324
8460
  let e = {};
8325
8461
  for (let t of ge())
8326
8462
  if (t.slug !== 'seedance-2-fast') {
8327
8463
  if (t.slug === 'seedance-2-mini') {
8328
- e['seedance-2-mini'] = et(t, 'seedance-2-mini');
8464
+ e['seedance-2-mini'] = rt(t, 'seedance-2-mini');
8329
8465
  continue;
8330
8466
  }
8331
8467
  if (t.slug === 'seedance-2') {
8332
- let r = et(t);
8468
+ let r = rt(t);
8333
8469
  ((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
8334
- (r.priceFormatted = Ma(t)),
8470
+ (r.priceFormatted = Ra(t)),
8335
8471
  (e['seedance-2'] = r));
8336
8472
  continue;
8337
8473
  }
8338
- t.slug.startsWith('claude-') || (e[t.api.model] = et(t));
8474
+ t.slug.startsWith('claude-') || (e[t.api.model] = rt(t));
8339
8475
  }
8340
- (Object.assign(e, Zt()), (e[xe] = Ia()), (e[ke] = va()));
8476
+ (Object.assign(e, rr()), (e[xe] = $a()), (e[ke] = Ca()));
8341
8477
  for (let [t, r] of Object.entries(be))
8342
8478
  e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
8343
8479
  return e;
8344
8480
  }
8345
- function Ma(e = B('seedance-2')) {
8481
+ function Ra(e = B('seedance-2')) {
8346
8482
  let t = B('seedance-2-fast'),
8347
- r = e ? tt(e) : '';
8483
+ r = e ? it(e) : '';
8348
8484
  if (!t) return r;
8349
- let a = `Fast ${tt(t)}`;
8350
- return r ? `${r} \xB7 ${a}` : a;
8485
+ let i = `Fast ${it(t)}`;
8486
+ return r ? `${r} \xB7 ${i}` : i;
8351
8487
  }
8352
- function Sr(e) {
8488
+ function Rr(e) {
8353
8489
  if (!(!e || typeof e != 'object' || Array.isArray(e)))
8354
8490
  for (let [t, r] of Object.entries(e)) {
8355
- let a = Object.prototype.hasOwnProperty.call(Y, t) ? Y[t] : null;
8356
- a && typeof r == 'string' && r.trim() && (a.priceFormatted = r.trim());
8491
+ let i = Object.prototype.hasOwnProperty.call(Y, t) ? Y[t] : null;
8492
+ i && typeof r == 'string' && r.trim() && (i.priceFormatted = r.trim());
8357
8493
  }
8358
8494
  }
8359
- function Ie(e) {
8495
+ function ve(e) {
8360
8496
  return !!e?.parameters.some((t) => t.name === 'image');
8361
8497
  }
8362
8498
  function G(e) {
8363
- return Y[e] ?? null;
8499
+ let t = Y[e];
8500
+ return t ? Or(t) : null;
8501
+ }
8502
+ function Or(e) {
8503
+ return !wr(e.slug) || e.parameters.some((t) => t.name === 'priority')
8504
+ ? e
8505
+ : { ...e, parameters: [...e.parameters, Oa] };
8364
8506
  }
8365
- function Sa(e, t, r) {
8507
+ function qa(e, t, r) {
8366
8508
  if (
8367
8509
  e.startsWith('enhancor-skin-fix-') ||
8368
- pr(e) ||
8369
- (e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
8510
+ mr(e) ||
8511
+ (e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration')) ||
8512
+ (e === 'magi-2' &&
8513
+ t === 'aspect_ratio' &&
8514
+ (typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '').replace(/-/g, '_') ===
8515
+ 'image_to_video')
8370
8516
  )
8371
8517
  return !1;
8372
- if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || kr(e)) && t === 'duration') {
8518
+ if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Mr(e)) && t === 'duration') {
8373
8519
  let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
8374
8520
  if (n(r.mode) === 'edit' || n(r.omni_reference_task_type) === 'edit') return !1;
8375
8521
  }
8376
8522
  if (
8377
- (t === 'max_tokens' && yr(r.max_completion_tokens)) ||
8378
- (t === 'max_completion_tokens' && yr(r.max_tokens))
8523
+ (t === 'max_tokens' && Pr(r.max_completion_tokens)) ||
8524
+ (t === 'max_completion_tokens' && Pr(r.max_tokens))
8379
8525
  )
8380
8526
  return !1;
8381
8527
  if (t === 'aspect_ratio') {
@@ -8383,128 +8529,130 @@ function Sa(e, t, r) {
8383
8529
  if (n) {
8384
8530
  let s = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
8385
8531
  o = s ? s.replace(/-/g, '_') : n.modes[0];
8386
- if (n.modes.includes(o) && !ar(n, o)) return !1;
8532
+ if (n.modes.includes(o) && !or(n, o)) return !1;
8387
8533
  }
8388
8534
  }
8389
- let a = we(e);
8390
- if (a) {
8535
+ let i = we(e);
8536
+ if (i) {
8391
8537
  let n = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
8392
- s = n ? n.replace(/-/g, '_') : a.modes[0];
8393
- if (a.modes.includes(s) && !nr(a, s, t)) return !1;
8538
+ s = n ? n.replace(/-/g, '_') : i.modes[0];
8539
+ if (i.modes.includes(s) && !lr(i, s, t)) return !1;
8394
8540
  }
8395
8541
  return !0;
8396
8542
  }
8397
- function yr(e) {
8543
+ function Pr(e) {
8398
8544
  return e != null && e !== '';
8399
8545
  }
8400
- function Kr(e, t) {
8546
+ function qr(e, t) {
8401
8547
  let r = { ...t };
8402
8548
  if (e?.slug === 'seedance-2-5') {
8403
- let a = (n) => typeof n != 'string' || !n.trim();
8404
- for (let n of Ka) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
8405
- if (!a(r.finalize)) return r;
8549
+ let i = (n) => typeof n != 'string' || !n.trim();
8550
+ for (let n of La) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
8551
+ if (!i(r.finalize)) return r;
8406
8552
  }
8407
- for (let a of e?.parameters ?? [])
8408
- a.default !== void 0 &&
8409
- r[a.name] === void 0 &&
8410
- Sa(e.slug, a.name, t) &&
8411
- (r[a.name] = a.default);
8553
+ for (let i of e?.parameters ?? [])
8554
+ i.default !== void 0 &&
8555
+ r[i.name] === void 0 &&
8556
+ qa(e.slug, i.name, t) &&
8557
+ (r[i.name] = i.default);
8412
8558
  return r;
8413
8559
  }
8414
8560
  function N() {
8415
- return Object.values(Y);
8416
- }
8417
- var ta,
8418
- rt,
8419
- ra,
8420
- E,
8421
- it,
8422
- aa,
8423
- xr,
8561
+ return Object.values(Y).map(Or);
8562
+ }
8563
+ var la,
8424
8564
  at,
8565
+ pa,
8566
+ S,
8425
8567
  nt,
8426
- Pe,
8427
- sa,
8428
- oa,
8429
- la,
8568
+ ca,
8569
+ Tr,
8570
+ st,
8571
+ ot,
8572
+ Ie,
8430
8573
  ma,
8431
8574
  fa,
8432
8575
  ga,
8433
- wa,
8576
+ xa,
8577
+ ka,
8578
+ _a,
8579
+ Ta,
8434
8580
  re,
8435
- Ze,
8581
+ tt,
8582
+ Sr,
8583
+ Kr,
8436
8584
  _r,
8437
- Pr,
8438
- hr,
8439
- Pa,
8440
- Tr,
8441
- Mr,
8585
+ Ea,
8586
+ Cr,
8587
+ Ar,
8442
8588
  Y,
8443
- Ka,
8589
+ Oa,
8590
+ La,
8444
8591
  ie = y(() => {
8445
8592
  'use strict';
8446
- Tt();
8447
- Ae();
8593
+ Kt();
8594
+ Re();
8448
8595
  j();
8449
8596
  Ue();
8450
- Vt();
8451
- Re();
8452
- Fe();
8453
8597
  jt();
8454
- Ht();
8455
- Wt();
8456
- er();
8457
- He();
8458
- or();
8459
- ur();
8460
- fr();
8461
- Je();
8462
- ((ta = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8463
- (rt = {
8598
+ Oe();
8599
+ Be();
8600
+ zt();
8601
+ Jt();
8602
+ Xt();
8603
+ ir();
8604
+ ze();
8605
+ dr();
8606
+ gr();
8607
+ yr();
8608
+ Ye();
8609
+ Xe();
8610
+ ((la = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
8611
+ (at = {
8464
8612
  video: 'generate_video',
8465
8613
  image: 'generate_image',
8466
8614
  audio: 'generate_audio',
8467
8615
  llm: 'run_task',
8468
8616
  }),
8469
- (ra = {
8617
+ (pa = {
8470
8618
  video: 'Text-to-Video',
8471
8619
  image: 'Text-to-Image',
8472
8620
  audio: 'Text-to-Audio',
8473
8621
  llm: 'Reasoning (LLM)',
8474
8622
  }));
8475
- E = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8476
- ((it = {
8623
+ S = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
8624
+ ((nt = {
8477
8625
  name: 'creative_mode',
8478
8626
  type: 'boolean',
8479
8627
  default: !1,
8480
8628
  description:
8481
8629
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
8482
8630
  }),
8483
- (aa = {
8631
+ (ca = {
8484
8632
  name: 'creative_mode',
8485
8633
  type: 'boolean',
8486
8634
  default: !1,
8487
8635
  description: `Not available yet on this model: ${_e}.`,
8488
8636
  }),
8489
- (xr = {
8637
+ (Tr = {
8490
8638
  name: 'priority',
8491
8639
  type: 'boolean',
8492
8640
  default: !1,
8493
8641
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
8494
8642
  }),
8495
- (at = {
8643
+ (st = {
8496
8644
  name: 'reference_roles',
8497
8645
  type: 'json',
8498
8646
  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).`,
8499
8647
  }),
8500
- (nt = {
8648
+ (ot = {
8501
8649
  name: 'auto_fit_images',
8502
8650
  type: 'boolean',
8503
8651
  description:
8504
8652
  '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.',
8505
8653
  }),
8506
- (Pe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8507
- ((sa = new Set([
8654
+ (Ie = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
8655
+ ((ma = new Set([
8508
8656
  'quality',
8509
8657
  'bitrate_mode',
8510
8658
  'draft',
@@ -8513,7 +8661,7 @@ var ta,
8513
8661
  'draft_generation_id',
8514
8662
  'pass_faces',
8515
8663
  ])),
8516
- (oa = new Set([
8664
+ (fa = new Set([
8517
8665
  'quality',
8518
8666
  'bitrate_mode',
8519
8667
  'draft',
@@ -8521,13 +8669,13 @@ var ta,
8521
8669
  'draft_task_id',
8522
8670
  'draft_generation_id',
8523
8671
  ])),
8524
- (la = {
8672
+ (ga = {
8525
8673
  images: 'up to 10',
8526
8674
  videos: 'up to 5; combined duration < 30s',
8527
8675
  audios: 'up to 5; combined duration < 30s',
8528
8676
  }));
8529
- ((ma = [
8530
- E('The user message or task.'),
8677
+ ((xa = [
8678
+ S('The user message or task.'),
8531
8679
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8532
8680
  {
8533
8681
  name: 'messages',
@@ -8544,8 +8692,8 @@ var ta,
8544
8692
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
8545
8693
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
8546
8694
  ]),
8547
- (fa = [
8548
- E('The user message or task.'),
8695
+ (ka = [
8696
+ S('The user message or task.'),
8549
8697
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
8550
8698
  {
8551
8699
  name: 'messages',
@@ -8626,8 +8774,8 @@ var ta,
8626
8774
  description: 'Video frames read a second.',
8627
8775
  },
8628
8776
  ]),
8629
- (ga = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8630
- wa = Object.entries({
8777
+ (_a = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8778
+ Ta = Object.entries({
8631
8779
  background: !1,
8632
8780
  skin: !1,
8633
8781
  nose: !1,
@@ -8654,7 +8802,7 @@ var ta,
8654
8802
  description: 'Keep this part out of the fix. Standard only.',
8655
8803
  }));
8656
8804
  ((re = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8657
- (Ze = [
8805
+ (tt = [
8658
8806
  {
8659
8807
  name: 'prompt',
8660
8808
  type: 'string',
@@ -8803,19 +8951,19 @@ var ta,
8803
8951
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8804
8952
  },
8805
8953
  ]),
8806
- (_r = {
8954
+ (Sr = {
8807
8955
  name: 'images',
8808
8956
  type: 'string[]',
8809
8957
  description:
8810
8958
  '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.',
8811
8959
  }),
8812
- (Pr = {
8960
+ (Kr = {
8813
8961
  name: 'audios',
8814
8962
  type: 'string[]',
8815
8963
  description:
8816
8964
  '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.',
8817
8965
  }),
8818
- (hr = [
8966
+ (_r = [
8819
8967
  {
8820
8968
  name: 'prompt',
8821
8969
  type: 'string',
@@ -8893,8 +9041,8 @@ var ta,
8893
9041
  description:
8894
9042
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8895
9043
  },
8896
- _r,
8897
- Pr,
9044
+ Sr,
9045
+ Kr,
8898
9046
  {
8899
9047
  name: 'first_frame_image',
8900
9048
  type: 'string',
@@ -8915,7 +9063,7 @@ var ta,
8915
9063
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8916
9064
  },
8917
9065
  ]),
8918
- (Pa = [
9066
+ (Ea = [
8919
9067
  {
8920
9068
  name: 'prompt',
8921
9069
  type: 'string',
@@ -8970,8 +9118,8 @@ var ta,
8970
9118
  description:
8971
9119
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
8972
9120
  },
8973
- _r,
8974
- Pr,
9121
+ Sr,
9122
+ Kr,
8975
9123
  {
8976
9124
  name: 'first_frame_image',
8977
9125
  type: 'string',
@@ -8986,7 +9134,7 @@ var ta,
8986
9134
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
8987
9135
  },
8988
9136
  ]));
8989
- ((Tr = {
9137
+ ((Cr = {
8990
9138
  name: 'mode',
8991
9139
  type: 'select',
8992
9140
  default: 'full',
@@ -8994,60 +9142,67 @@ var ta,
8994
9142
  description:
8995
9143
  'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum: the first 10 MP at one rate, every MP past 10 at a lower one (get_pricing).',
8996
9144
  }),
8997
- (Mr = {
9145
+ (Ar = {
8998
9146
  name: 'scale',
8999
9147
  type: 'select',
9000
- default: String(cr),
9001
- options: ze.noSkin.map(String),
9002
- description: `Full only: ${ze.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
9148
+ default: String(fr),
9149
+ options: We.noSkin.map(String),
9150
+ description: `Full only: ${We.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
9003
9151
  }));
9004
- Y = Ta();
9005
- Ka = ['draft_task_id', 'draft_generation_id'];
9152
+ Y = Aa();
9153
+ Oa = {
9154
+ name: 'priority',
9155
+ type: 'boolean',
9156
+ default: !1,
9157
+ description:
9158
+ "Sent straight to Google's own API, skipping the shared queue, at Google's price + 10% (per output image and per input image, the same on every plan). If Google can not serve it, the request fails and nothing is charged.",
9159
+ };
9160
+ La = ['draft_task_id', 'draft_generation_id'];
9006
9161
  });
9007
- function ve(e) {
9162
+ function Te(e) {
9008
9163
  let t = '/v1/pricing/models',
9009
9164
  r = e?.trim();
9010
9165
  return r ? `${t}?model=${encodeURIComponent(r)}` : t;
9011
9166
  }
9012
- var dt = y(() => {
9167
+ var ct = y(() => {
9013
9168
  'use strict';
9014
9169
  });
9015
- function Yr(e) {
9170
+ function ht(e) {
9016
9171
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
9017
9172
  }
9018
- function Xr(e) {
9173
+ function ii(e) {
9019
9174
  let t = ge().filter((s) => s.kind === e && s.unfiltered != null),
9020
9175
  r = t.filter((s) => ee.includes(s.api.model)).map((s) => s.name),
9021
- a = t.filter((s) => !ee.includes(s.api.model)).map((s) => s.name);
9176
+ i = t.filter((s) => !ee.includes(s.api.model)).map((s) => s.name);
9022
9177
  return [
9023
9178
  ...(r.length
9024
- ? [`${Yr(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
9179
+ ? [`${ht(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
9025
9180
  : []),
9026
- ...(a.length ? [`Not available yet on ${Yr(a)}: ${_e}.`] : []),
9181
+ ...(i.length ? [`Not available yet on ${ht(i)}: ${_e}.`] : []),
9027
9182
  'The Acceptable Use Policy applies.',
9028
9183
  ].join(' ');
9029
9184
  }
9030
- function ln(e) {
9031
- if (rn.has(e.name)) return e;
9185
+ function hn(e) {
9186
+ if (cn.has(e.name)) return e;
9032
9187
  let t = e.inputSchema.properties;
9033
9188
  return !t || t.callback_url
9034
9189
  ? e
9035
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: tn } } };
9190
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: dn } } };
9036
9191
  }
9037
- function dn(e) {
9192
+ function yn(e) {
9038
9193
  let t = e.inputSchema.properties;
9039
9194
  if (!t) return e;
9040
9195
  let r = !1,
9041
- a = {};
9196
+ i = {};
9042
9197
  for (let [n, s] of Object.entries(t))
9043
- Qr.has(n) && s.type === 'string' && !s.format
9044
- ? ((a[n] = { ...s, format: 'uri' }), (r = !0))
9045
- : Qr.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
9046
- ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
9047
- : (a[n] = s);
9048
- return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
9049
- }
9050
- function pn(e) {
9198
+ ai.has(n) && s.type === 'string' && !s.format
9199
+ ? ((i[n] = { ...s, format: 'uri' }), (r = !0))
9200
+ : ai.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
9201
+ ? ((i[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
9202
+ : (i[n] = s);
9203
+ return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
9204
+ }
9205
+ function bn(e) {
9051
9206
  switch (e.type) {
9052
9207
  case 'string':
9053
9208
  return {
@@ -9102,14 +9257,14 @@ function pn(e) {
9102
9257
  return { type: 'string', description: e.description };
9103
9258
  }
9104
9259
  }
9105
- function cn(e, t) {
9260
+ function wn(e, t) {
9106
9261
  let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
9107
- a = {},
9262
+ i = {},
9108
9263
  n = [];
9109
- for (let o of e.parameters) ((a[o.name] = pn(o)), o.required && n.push(o.name));
9264
+ for (let o of e.parameters) ((i[o.name] = bn(o)), o.required && n.push(o.name));
9110
9265
  let s = {
9111
9266
  type: 'object',
9112
- properties: a,
9267
+ properties: i,
9113
9268
  ...(n.length > 0 ? { required: n } : {}),
9114
9269
  additionalProperties: !0,
9115
9270
  };
@@ -9119,11 +9274,11 @@ function cn(e, t) {
9119
9274
  inputSchema: s,
9120
9275
  };
9121
9276
  }
9122
- function un() {
9123
- let e = N().filter((u) => u.category === 'Image' && !Ie(u)),
9277
+ function xn() {
9278
+ let e = N().filter((u) => u.category === 'Image' && !ve(u)),
9124
9279
  t = N().filter((u) => u.category === 'Video'),
9125
9280
  r = N().filter((u) => u.category === 'Text'),
9126
- a = N().filter((u) => u.category === 'Audio'),
9281
+ i = N().filter((u) => u.category === 'Audio'),
9127
9282
  n = {
9128
9283
  name: 'generate_image',
9129
9284
  description:
@@ -9210,7 +9365,15 @@ function un() {
9210
9365
  maximum: 2147483647,
9211
9366
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
9212
9367
  },
9213
- creative_mode: { type: 'boolean', description: Xr('image') },
9368
+ creative_mode: { type: 'boolean', description: ii('image') },
9369
+ ...(Pe().length
9370
+ ? {
9371
+ priority: {
9372
+ type: 'boolean',
9373
+ description: `${ht(Pe().map(xr))} only: sent straight to Google's own API, skipping the shared queue, at Google's price + 10% (per output image and per input image, the same on every plan). If Google can not serve it, the request fails and nothing is charged.`,
9374
+ },
9375
+ }
9376
+ : {}),
9214
9377
  },
9215
9378
  required: ['prompt'],
9216
9379
  additionalProperties: !0,
@@ -9247,7 +9410,7 @@ function un() {
9247
9410
  description:
9248
9411
  "Video resolution, where the model takes it (see each model tool). Left out: the model's own default, which that model's tool shows.",
9249
9412
  },
9250
- creative_mode: { type: 'boolean', description: Xr('video') },
9413
+ creative_mode: { type: 'boolean', description: ii('video') },
9251
9414
  priority: {
9252
9415
  type: 'boolean',
9253
9416
  description:
@@ -9303,7 +9466,7 @@ function un() {
9303
9466
  additionalProperties: !0,
9304
9467
  },
9305
9468
  },
9306
- d = {
9469
+ p = {
9307
9470
  name: 'run_task',
9308
9471
  description:
9309
9472
  'Run a reasoning, analysis or code task on a Tein AI language model (Claude, GPT-6 Astra, Gemini, Dola-Seed). Billed per token at the published price.',
@@ -9383,10 +9546,10 @@ function un() {
9383
9546
  additionalProperties: !0,
9384
9547
  },
9385
9548
  },
9386
- p = mn();
9387
- return [n, s, o, d, l, p, c, an, ...Zr];
9549
+ d = kn();
9550
+ return [n, s, o, p, l, d, c, un, ...ni];
9388
9551
  }
9389
- function mn() {
9552
+ function kn() {
9390
9553
  return {
9391
9554
  name: 'upload_asset',
9392
9555
  description:
@@ -9433,31 +9596,32 @@ function mn() {
9433
9596
  },
9434
9597
  };
9435
9598
  }
9436
- function ft() {
9437
- let e = un(),
9438
- t = N().map((r) => cn(r));
9439
- return [...e, ...t].map(ln).map(dn);
9440
- }
9441
- var tn,
9442
- rn,
9443
- an,
9444
- nn,
9445
- sn,
9446
- on,
9447
- Zr,
9448
- _o,
9449
- Qr,
9450
- ei = y(() => {
9599
+ function yt() {
9600
+ let e = xn(),
9601
+ t = N().map((r) => wn(r));
9602
+ return [...e, ...t].map(hn).map(yn);
9603
+ }
9604
+ var dn,
9605
+ cn,
9606
+ un,
9607
+ mn,
9608
+ fn,
9609
+ gn,
9610
+ ni,
9611
+ Ao,
9612
+ ai,
9613
+ si = y(() => {
9451
9614
  'use strict';
9452
9615
  j();
9453
- Je();
9616
+ Xe();
9617
+ Ye();
9454
9618
  ie();
9455
- ((tn = {
9619
+ ((dn = {
9456
9620
  type: 'string',
9457
9621
  description:
9458
9622
  '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.',
9459
9623
  }),
9460
- (rn = new Set([
9624
+ (cn = new Set([
9461
9625
  'upload_asset',
9462
9626
  'upload_media',
9463
9627
  'upload_image',
@@ -9468,7 +9632,7 @@ var tn,
9468
9632
  'get_usage',
9469
9633
  'get_balance_history',
9470
9634
  ])),
9471
- (an = {
9635
+ (un = {
9472
9636
  name: 'get_pricing',
9473
9637
  description:
9474
9638
  '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. price_texts has the current "from" price of each model. No API key is required; with one, your_prices lists the prices your workspace pays (Your price) next to the published price of each row on its price list. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
@@ -9483,13 +9647,13 @@ var tn,
9483
9647
  additionalProperties: !1,
9484
9648
  },
9485
9649
  }),
9486
- (nn = {
9650
+ (mn = {
9487
9651
  name: 'get_balance',
9488
9652
  description:
9489
9653
  "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.",
9490
9654
  inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
9491
9655
  }),
9492
- (sn = {
9656
+ (fn = {
9493
9657
  name: 'get_usage',
9494
9658
  description:
9495
9659
  "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.",
@@ -9520,7 +9684,7 @@ var tn,
9520
9684
  additionalProperties: !1,
9521
9685
  },
9522
9686
  }),
9523
- (on = {
9687
+ (gn = {
9524
9688
  name: 'get_balance_history',
9525
9689
  description:
9526
9690
  "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.",
@@ -9538,9 +9702,9 @@ var tn,
9538
9702
  additionalProperties: !1,
9539
9703
  },
9540
9704
  }),
9541
- (Zr = [nn, sn, on]),
9542
- (_o = new Set(Zr.map((e) => e.name))));
9543
- Qr = new Set([
9705
+ (ni = [mn, fn, gn]),
9706
+ (Ao = new Set(ni.map((e) => e.name))));
9707
+ ai = new Set([
9544
9708
  'image',
9545
9709
  'images',
9546
9710
  'image_url',
@@ -9557,32 +9721,32 @@ var tn,
9557
9721
  'lipsyncing_audio',
9558
9722
  ]);
9559
9723
  });
9560
- var pi = {};
9561
- bi(pi, {
9562
- forgetToolSchemas: () => bn,
9563
- jsonRpcAnswer: () => ai,
9564
- preprocessLocalFiles: () => li,
9565
- startStdioServer: () => di,
9724
+ var hi = {};
9725
+ Ii(hi, {
9726
+ forgetToolSchemas: () => Tn,
9727
+ jsonRpcAnswer: () => di,
9728
+ preprocessLocalFiles: () => fi,
9729
+ startStdioServer: () => gi,
9566
9730
  });
9567
- function fn(e) {
9731
+ function _n(e) {
9568
9732
  let t = (r) =>
9569
9733
  !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
9570
9734
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
9571
9735
  }
9572
- function ai(e, t, r) {
9573
- let a = e?.id,
9574
- n = a == null,
9736
+ function di(e, t, r) {
9737
+ let i = e?.id,
9738
+ n = i == null,
9575
9739
  s = null;
9576
9740
  try {
9577
9741
  s = r ? JSON.parse(r) : null;
9578
9742
  } catch {
9579
9743
  s = null;
9580
9744
  }
9581
- if (s !== null && fn(s)) return n ? null : s;
9745
+ if (s !== null && _n(s)) return n ? null : s;
9582
9746
  if (n) return null;
9583
9747
  if (!r && t >= 200 && t < 300) return;
9584
9748
  let o = s?.error,
9585
- d =
9749
+ p =
9586
9750
  typeof o == 'string'
9587
9751
  ? o
9588
9752
  : o && typeof o == 'object' && typeof o.message == 'string'
@@ -9591,39 +9755,39 @@ function ai(e, t, r) {
9591
9755
  l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
9592
9756
  return {
9593
9757
  jsonrpc: '2.0',
9594
- id: a,
9758
+ id: i,
9595
9759
  error: {
9596
9760
  code: t === 401 ? -32001 : -32603,
9597
- message: d,
9761
+ message: p,
9598
9762
  data: { status: t, ...(l ? { code: l } : {}) },
9599
9763
  },
9600
9764
  };
9601
9765
  }
9602
- function gn() {
9766
+ function Pn() {
9603
9767
  let e = process.argv.slice(2),
9604
9768
  t = e.indexOf('--api-key');
9605
9769
  return _(t >= 0 ? e[t + 1] : void 0);
9606
9770
  }
9607
- async function ni(e, t, r) {
9608
- let a = Q.default.resolve(e);
9609
- if (!U.default.existsSync(a) || !U.default.statSync(a).isFile())
9771
+ async function ci(e, t, r) {
9772
+ let i = Q.default.resolve(e);
9773
+ if (!V.default.existsSync(i) || !V.default.statSync(i).isFile())
9610
9774
  throw new Error(`File not found: ${e}`);
9611
- let n = U.default.readFileSync(a),
9775
+ let n = V.default.readFileSync(i),
9612
9776
  s = n.toString('base64'),
9613
9777
  o = n.length,
9614
- d = `${r.replace(/\/$/, '')}/v1/upload`,
9615
- l = await fetch(d, {
9778
+ p = `${r.replace(/\/$/, '')}/v1/upload`,
9779
+ l = await fetch(p, {
9616
9780
  method: 'POST',
9617
9781
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
9618
9782
  body: JSON.stringify({ data: s }),
9619
9783
  });
9620
9784
  if (!l.ok) {
9621
- let p = `Upload failed (HTTP ${l.status})`;
9785
+ let d = `Upload failed (HTTP ${l.status})`;
9622
9786
  try {
9623
9787
  let u = await l.json();
9624
- p = (typeof u.error == 'string' ? u.error : u.error?.message) || u.message || p;
9788
+ d = (typeof u.error == 'string' ? u.error : u.error?.message) || u.message || d;
9625
9789
  } catch {}
9626
- throw new Error(p);
9790
+ throw new Error(d);
9627
9791
  }
9628
9792
  let c = await l.json();
9629
9793
  return {
@@ -9633,15 +9797,15 @@ async function ni(e, t, r) {
9633
9797
  mimeType: c.mime_type || c.mimeType || 'image/png',
9634
9798
  };
9635
9799
  }
9636
- function si(e) {
9637
- return hn.has(Q.default.extname(e).toLowerCase());
9800
+ function ui(e) {
9801
+ return In.has(Q.default.extname(e).toLowerCase());
9638
9802
  }
9639
- function oi(e) {
9803
+ function mi(e) {
9640
9804
  return new Error(
9641
9805
  `Tein uploads image, video and audio files only, and ${Q.default.basename(e)} is not one.`,
9642
9806
  );
9643
9807
  }
9644
- function yn(e) {
9808
+ function vn(e) {
9645
9809
  let t = e.trim();
9646
9810
  if (
9647
9811
  !t ||
@@ -9652,9 +9816,9 @@ function yn(e) {
9652
9816
  )
9653
9817
  return null;
9654
9818
  let r = Q.default.resolve(t);
9655
- return U.default.existsSync(r) && U.default.statSync(r).isFile() ? r : null;
9819
+ return V.default.existsSync(r) && V.default.statSync(r).isFile() ? r : null;
9656
9820
  }
9657
- function ht(e) {
9821
+ function wt(e) {
9658
9822
  if (Array.isArray(e))
9659
9823
  for (let t of e) {
9660
9824
  let r = t;
@@ -9664,14 +9828,14 @@ function ht(e) {
9664
9828
  se.set(r.name, r.inputSchema);
9665
9829
  }
9666
9830
  }
9667
- function bn() {
9668
- (se.clear(), (gt = 0));
9831
+ function Tn() {
9832
+ (se.clear(), (bt = 0));
9669
9833
  }
9670
- async function wn(e, t) {
9671
- if (!(Date.now() - gt < 6e4)) {
9672
- gt = Date.now();
9834
+ async function Mn(e, t) {
9835
+ if (!(Date.now() - bt < 6e4)) {
9836
+ bt = Date.now();
9673
9837
  try {
9674
- let a = await (
9838
+ let i = await (
9675
9839
  await fetch(e, {
9676
9840
  method: 'POST',
9677
9841
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
@@ -9679,39 +9843,39 @@ async function wn(e, t) {
9679
9843
  signal: AbortSignal.timeout(1e4),
9680
9844
  })
9681
9845
  ).json();
9682
- ht(a.result?.tools);
9846
+ wt(i.result?.tools);
9683
9847
  } catch {}
9684
9848
  }
9685
9849
  }
9686
- function xn(e) {
9850
+ function Sn(e) {
9687
9851
  return e
9688
9852
  ? e.type === 'string'
9689
9853
  ? e.format === 'uri'
9690
9854
  : e.type === 'array' && e.items?.format === 'uri'
9691
9855
  : !1;
9692
9856
  }
9693
- async function ti(e, t, r) {
9857
+ async function oi(e, t, r) {
9694
9858
  if (typeof e != 'string') return e;
9695
- let a = yn(e);
9696
- if (!a) return e;
9697
- if (!si(a)) throw oi(a);
9698
- return (await ni(a, t, r)).url;
9859
+ let i = vn(e);
9860
+ if (!i) return e;
9861
+ if (!ui(i)) throw mi(i);
9862
+ return (await ci(i, t, r)).url;
9699
9863
  }
9700
- async function li(e, t, r, a, n) {
9701
- (se.size === 0 && ht(ft()), se.has(e) || (await wn(n, r)));
9864
+ async function fi(e, t, r, i, n) {
9865
+ (se.size === 0 && wt(yt()), se.has(e) || (await Mn(n, r)));
9702
9866
  let s = se.get(e)?.properties;
9703
9867
  if (!s) return t;
9704
9868
  let o = { ...t };
9705
- for (let [d, l] of Object.entries(t))
9706
- if (xn(s[d]))
9869
+ for (let [p, l] of Object.entries(t))
9870
+ if (Sn(s[p]))
9707
9871
  if (Array.isArray(l)) {
9708
9872
  let c = [];
9709
- for (let p of l) c.push(await ti(p, r, a));
9710
- o[d] = c;
9711
- } else o[d] = await ti(l, r, a);
9873
+ for (let d of l) c.push(await oi(d, r, i));
9874
+ o[p] = c;
9875
+ } else o[p] = await oi(l, r, i);
9712
9876
  return o;
9713
9877
  }
9714
- function kn(e) {
9878
+ function Kn(e) {
9715
9879
  let t = e.id ?? null;
9716
9880
  switch (e.method) {
9717
9881
  case 'initialize':
@@ -9729,7 +9893,7 @@ function kn(e) {
9729
9893
  case 'ping':
9730
9894
  return { jsonrpc: '2.0', id: t, result: {} };
9731
9895
  case 'tools/list':
9732
- return { jsonrpc: '2.0', id: t, result: { tools: ft() } };
9896
+ return { jsonrpc: '2.0', id: t, result: { tools: yt() } };
9733
9897
  case 'tools/call':
9734
9898
  return {
9735
9899
  jsonrpc: '2.0',
@@ -9752,13 +9916,13 @@ function kn(e) {
9752
9916
  };
9753
9917
  }
9754
9918
  }
9755
- async function di() {
9756
- if (ri) return;
9757
- ri = !0;
9758
- let e = gn(),
9919
+ async function gi() {
9920
+ if (li) return;
9921
+ li = !0;
9922
+ let e = Pn(),
9759
9923
  t = x(),
9760
9924
  r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
9761
- (ii.default
9925
+ (pi.default
9762
9926
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
9763
9927
  .on('line', async (n) => {
9764
9928
  let s = n.trim();
@@ -9769,8 +9933,8 @@ async function di() {
9769
9933
  let l = o.params.name,
9770
9934
  c = o.params.arguments || {};
9771
9935
  if (l === 'get_pricing') {
9772
- let p = typeof c.model == 'string' ? c.model.trim() : '',
9773
- u = `${t.replace(/\/+$/, '')}${ve(p)}`;
9936
+ let d = typeof c.model == 'string' ? c.model.trim() : '',
9937
+ u = `${t.replace(/\/+$/, '')}${Te(d)}`;
9774
9938
  try {
9775
9939
  let m = await fetch(u, {
9776
9940
  signal: AbortSignal.timeout(1e4),
@@ -9812,18 +9976,18 @@ async function di() {
9812
9976
  return;
9813
9977
  }
9814
9978
  if (l === 'upload_asset' || l === 'upload_media' || l === 'upload_image') {
9815
- let p = c.path || c.filepath || c.file_path || c.file || c.data;
9979
+ let d = c.path || c.filepath || c.file_path || c.file || c.data;
9816
9980
  if (
9817
- typeof p == 'string' &&
9818
- !p.startsWith('http://') &&
9819
- !p.startsWith('https://') &&
9820
- !p.startsWith('data:')
9981
+ typeof d == 'string' &&
9982
+ !d.startsWith('http://') &&
9983
+ !d.startsWith('https://') &&
9984
+ !d.startsWith('data:')
9821
9985
  )
9822
9986
  try {
9823
- let u = Q.default.resolve(p.trim());
9824
- if (U.default.existsSync(u) && U.default.statSync(u).isFile() && e) {
9825
- if (!si(u)) throw oi(u);
9826
- let m = await ni(u, e, t),
9987
+ let u = Q.default.resolve(d.trim());
9988
+ if (V.default.existsSync(u) && V.default.statSync(u).isFile() && e) {
9989
+ if (!ui(u)) throw mi(u);
9990
+ let m = await ci(u, e, t),
9827
9991
  g = (m.sizeBytes / 1024).toFixed(1),
9828
9992
  C =
9829
9993
  m.mimeType.startsWith('image/') ||
@@ -9832,7 +9996,7 @@ async function di() {
9832
9996
 
9833
9997
  ![Uploaded Asset](${m.url})`
9834
9998
  : '',
9835
- V = {
9999
+ U = {
9836
10000
  jsonrpc: '2.0',
9837
10001
  id: o.id,
9838
10002
  result: {
@@ -9852,7 +10016,7 @@ Pass this URL to any Tein generation tool.`,
9852
10016
  },
9853
10017
  };
9854
10018
  process.stdout.write(
9855
- JSON.stringify(V) +
10019
+ JSON.stringify(U) +
9856
10020
  `
9857
10021
  `,
9858
10022
  );
@@ -9879,9 +10043,9 @@ Pass this URL to any Tein generation tool.`,
9879
10043
  }
9880
10044
  if (e)
9881
10045
  try {
9882
- o.params.arguments = await li(String(l), c, e, t, r);
9883
- } catch (p) {
9884
- let u = p instanceof Error ? p.message : String(p);
10046
+ o.params.arguments = await fi(String(l), c, e, t, r);
10047
+ } catch (d) {
10048
+ let u = d instanceof Error ? d.message : String(d);
9885
10049
  process.stdout.write(
9886
10050
  JSON.stringify({
9887
10051
  jsonrpc: '2.0',
@@ -9910,32 +10074,32 @@ Pass this URL to any Tein generation tool.`,
9910
10074
  body: JSON.stringify(o),
9911
10075
  }),
9912
10076
  c = await l.text(),
9913
- p = ai(o, l.status, c);
9914
- if (p === null) return;
9915
- if (p) {
9916
- (o?.method === 'tools/list' && ht(p.result?.tools),
10077
+ d = di(o, l.status, c);
10078
+ if (d === null) return;
10079
+ if (d) {
10080
+ (o?.method === 'tools/list' && wt(d.result?.tools),
9917
10081
  process.stdout.write(
9918
- JSON.stringify(p) +
10082
+ JSON.stringify(d) +
9919
10083
  `
9920
10084
  `,
9921
10085
  ));
9922
10086
  return;
9923
10087
  }
9924
10088
  } catch {}
9925
- let d = kn(o);
9926
- d !== null &&
10089
+ let p = Kn(o);
10090
+ p !== null &&
9927
10091
  process.stdout.write(
9928
- JSON.stringify(d) +
10092
+ JSON.stringify(p) +
9929
10093
  `
9930
10094
  `,
9931
10095
  );
9932
10096
  } catch (o) {
9933
- let d = o instanceof Error ? o.message : String(o);
10097
+ let p = o instanceof Error ? o.message : String(o);
9934
10098
  process.stdout.write(
9935
10099
  JSON.stringify({
9936
10100
  jsonrpc: '2.0',
9937
10101
  id: null,
9938
- error: { code: -32700, message: `Parse error: ${d}` },
10102
+ error: { code: -32700, message: `Parse error: ${p}` },
9939
10103
  }) +
9940
10104
  `
9941
10105
  `,
@@ -9945,23 +10109,23 @@ Pass this URL to any Tein generation tool.`,
9945
10109
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
9946
10110
  `));
9947
10111
  }
9948
- var U,
10112
+ var V,
9949
10113
  Q,
9950
- ii,
9951
- hn,
10114
+ pi,
10115
+ In,
9952
10116
  se,
9953
- gt,
9954
- ri,
9955
- ci = y(() => {
10117
+ bt,
10118
+ li,
10119
+ yi = y(() => {
9956
10120
  'use strict';
9957
- ((U = M(require('node:fs'))),
10121
+ ((V = M(require('node:fs'))),
9958
10122
  (Q = M(require('node:path'))),
9959
- (ii = M(require('node:readline'))));
9960
- dt();
9961
- ei();
9962
- A();
10123
+ (pi = M(require('node:readline'))));
10124
+ ct();
10125
+ si();
10126
+ R();
9963
10127
  oe();
9964
- hn = new Set([
10128
+ In = new Set([
9965
10129
  '.png',
9966
10130
  '.jpg',
9967
10131
  '.jpeg',
@@ -9987,22 +10151,22 @@ var U,
9987
10151
  '.flac',
9988
10152
  '.opus',
9989
10153
  ]);
9990
- ((se = new Map()), (gt = 0));
9991
- ri = !1;
10154
+ ((se = new Map()), (bt = 0));
10155
+ li = !1;
9992
10156
  require.main === module &&
9993
- di().catch((e) => {
10157
+ gi().catch((e) => {
9994
10158
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
9995
10159
  `),
9996
10160
  process.exit(1));
9997
10161
  });
9998
10162
  });
9999
- var xi =
10163
+ var Ti =
10000
10164
  !process.env.NO_COLOR &&
10001
10165
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
10002
10166
  function k(e, t) {
10003
- return (r) => (xi ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
10167
+ return (r) => (Ti ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
10004
10168
  }
10005
- var i = {
10169
+ var a = {
10006
10170
  bold: k(1, 22),
10007
10171
  dim: k(2, 22),
10008
10172
  italic: k(3, 23),
@@ -10046,7 +10210,7 @@ var i = {
10046
10210
  process.stdout.isTTY
10047
10211
  ? (this.stop(),
10048
10212
  (this.timer = setInterval(() => {
10049
- let r = i.cyan(this.frames[this.current]);
10213
+ let r = a.cyan(this.frames[this.current]);
10050
10214
  (process.stdout.write(`\r${r} ${this.text} `),
10051
10215
  (this.current = (this.current + 1) % this.frames.length));
10052
10216
  }, 80)),
@@ -10063,7 +10227,7 @@ var i = {
10063
10227
  this.stop();
10064
10228
  let r = t || this.text;
10065
10229
  process.stdout.isTTY
10066
- ? process.stdout.write(`\r${i.green('\u2713')} ${r}
10230
+ ? process.stdout.write(`\r${a.green('\u2713')} ${r}
10067
10231
  `)
10068
10232
  : process.stdout.write(`[\u2713] ${r}
10069
10233
  `);
@@ -10072,7 +10236,7 @@ var i = {
10072
10236
  this.stop();
10073
10237
  let r = t || this.text;
10074
10238
  process.stdout.isTTY
10075
- ? process.stdout.write(`\r${i.red('\u2717')} ${r}
10239
+ ? process.stdout.write(`\r${a.red('\u2717')} ${r}
10076
10240
  `)
10077
10241
  : process.stdout.write(`[\u2717] ${r}
10078
10242
  `);
@@ -10087,10 +10251,10 @@ var i = {
10087
10251
  var H = M(require('node:fs')),
10088
10252
  O = M(require('node:path'));
10089
10253
  var le = M(require('node:fs')),
10090
- kt = M(require('node:path')),
10091
- _t = require('node:stream/promises');
10254
+ It = M(require('node:path')),
10255
+ vt = require('node:stream/promises');
10092
10256
  oe();
10093
- var Ii = new Set([
10257
+ var Ei = new Set([
10094
10258
  'account_suspended',
10095
10259
  'account_terminated',
10096
10260
  'creative_mode_restricted',
@@ -10098,62 +10262,62 @@ var Ii = new Set([
10098
10262
  'workspace_paused',
10099
10263
  ]),
10100
10264
  T = 1,
10101
- vi = 3,
10265
+ $i = 3,
10102
10266
  b = class extends Error {
10103
- constructor(t, r, a, n = {}) {
10267
+ constructor(t, r, i, n = {}) {
10104
10268
  (super(r),
10105
10269
  (this.name = 'TeinApiError'),
10106
10270
  (this.status = t),
10107
- a && (this.code = a),
10271
+ i && (this.code = i),
10108
10272
  (this.fields = n));
10109
10273
  }
10110
10274
  get exitCode() {
10111
- return this.code && Ii.has(this.code) ? vi : T;
10275
+ return this.code && Ei.has(this.code) ? $i : T;
10112
10276
  }
10113
10277
  };
10114
- function Ti(e, t, r) {
10115
- let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
10116
- if (!r || typeof r != 'object') return new b(e, a);
10278
+ function Ci(e, t, r) {
10279
+ let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
10280
+ if (!r || typeof r != 'object') return new b(e, i);
10117
10281
  let n = r;
10118
10282
  if (n.error && typeof n.error == 'object' && !Array.isArray(n.error)) {
10119
- let p = n.error,
10120
- { code: u, message: m, ...g } = p;
10121
- return new b(e, typeof m == 'string' && m ? m : a, typeof u == 'string' ? u : void 0, g);
10283
+ let d = n.error,
10284
+ { code: u, message: m, ...g } = d;
10285
+ return new b(e, typeof m == 'string' && m ? m : i, typeof u == 'string' ? u : void 0, g);
10122
10286
  }
10123
- let { error: s, code: o, message: d, ...l } = n,
10124
- c = (typeof s == 'string' && s) || (typeof d == 'string' && d) || a;
10287
+ let { error: s, code: o, message: p, ...l } = n,
10288
+ c = (typeof s == 'string' && s) || (typeof p == 'string' && p) || i;
10125
10289
  return new b(e, c, typeof o == 'string' ? o : void 0, l);
10126
10290
  }
10127
- function wt(e) {
10291
+ function _t(e) {
10128
10292
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
10129
10293
  }
10130
- function K(e) {
10294
+ function E(e) {
10131
10295
  let t = [e.message],
10132
- r = wt(e.fields.required),
10133
- a = wt(e.fields.balance);
10134
- (r || a) &&
10135
- t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
10296
+ r = _t(e.fields.required),
10297
+ i = _t(e.fields.balance);
10298
+ (r || i) &&
10299
+ t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
10136
10300
  let n = e.fields.org_name ?? e.fields.orgName;
10137
10301
  typeof n == 'string' && n && t.push(`Workspace: ${n}`);
10138
10302
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
10139
10303
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
10140
10304
  }
10141
- function Mi(e) {
10305
+ function Ai(e) {
10142
10306
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
10143
10307
  ? 'video'
10144
10308
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
10145
10309
  ? 'audio'
10146
10310
  : 'image';
10147
10311
  }
10148
- function xt(e) {
10312
+ function Pt(e) {
10149
10313
  let t = [];
10150
10314
  for (let r of e.data ?? [])
10151
10315
  typeof r.message?.content == 'string'
10152
10316
  ? t.push({ type: 'text', text: r.message.content })
10153
- : r.url && t.push({ type: Mi(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
10317
+ : r.url && t.push({ type: Ai(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
10154
10318
  return t;
10155
10319
  }
10156
- var S = class {
10320
+ var K = class {
10157
10321
  constructor(t, r) {
10158
10322
  ((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
10159
10323
  }
@@ -10165,18 +10329,18 @@ var S = class {
10165
10329
  'X-Tein-Client': 'cli',
10166
10330
  };
10167
10331
  }
10168
- async send(t, r, a) {
10332
+ async send(t, r, i) {
10169
10333
  let n = await fetch(`${this.baseUrl}${r}`, {
10170
10334
  method: t,
10171
10335
  headers: this.getHeaders(),
10172
- ...(a === void 0 ? {} : { body: JSON.stringify(a) }),
10336
+ ...(i === void 0 ? {} : { body: JSON.stringify(i) }),
10173
10337
  });
10174
10338
  if (!n.ok) {
10175
10339
  let s = null;
10176
10340
  try {
10177
10341
  s = await n.json();
10178
10342
  } catch {}
10179
- throw Ti(n.status, n.statusText, s);
10343
+ throw Ci(n.status, n.statusText, s);
10180
10344
  }
10181
10345
  return await n.json();
10182
10346
  }
@@ -10184,31 +10348,31 @@ var S = class {
10184
10348
  await this.send('GET', '/v1/jobs?limit=1');
10185
10349
  }
10186
10350
  queueJob(t, r) {
10187
- return this.send('POST', '/v1/generate', { model: t, ...r }).then((a) => {
10188
- let n = a.status,
10351
+ return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
10352
+ let n = i.status,
10189
10353
  s =
10190
10354
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
10191
10355
  ? n
10192
10356
  : 'processing',
10193
- o = xt(a);
10357
+ o = Pt(i);
10194
10358
  return {
10195
- request_id: a.request_id || a.id || '',
10196
- model: a.model,
10359
+ request_id: i.request_id || i.id || '',
10360
+ model: i.model,
10197
10361
  status: s,
10198
10362
  ...(o.length ? { output: o } : {}),
10199
- error: a.error && typeof a.error.message == 'string' ? a.error.message : null,
10200
- ...(a.usage ? { usage: a.usage } : {}),
10363
+ error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
10364
+ ...(i.usage ? { usage: i.usage } : {}),
10201
10365
  };
10202
10366
  });
10203
10367
  }
10204
10368
  getStatus(t) {
10205
10369
  return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
10206
- let a = r.status,
10370
+ let i = r.status,
10207
10371
  n =
10208
- a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
10209
- ? a
10372
+ i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
10373
+ ? i
10210
10374
  : 'processing',
10211
- s = xt(r),
10375
+ s = Pt(r),
10212
10376
  o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
10213
10377
  return {
10214
10378
  request_id: r.id || t,
@@ -10235,65 +10399,65 @@ var S = class {
10235
10399
  return this.send('POST', '/v1/upload', { data: t });
10236
10400
  }
10237
10401
  async downloadOutput(t, r) {
10238
- let a = await fetch(t);
10239
- if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
10240
- let n = kt.default.dirname(r);
10402
+ let i = await fetch(t);
10403
+ if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
10404
+ let n = It.default.dirname(r);
10241
10405
  le.default.existsSync(n) || le.default.mkdirSync(n, { recursive: !0 });
10242
10406
  let s = le.default.createWriteStream(r);
10243
- return (await (0, _t.pipeline)(a.body, s), r);
10407
+ return (await (0, vt.pipeline)(i.body, s), r);
10244
10408
  }
10245
10409
  };
10246
- A();
10247
- function Ce(e) {
10410
+ R();
10411
+ function Ae(e) {
10248
10412
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
10249
10413
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
10250
10414
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
10251
10415
  r = 10 ** t,
10252
- a = Math.round(Number((e * r).toFixed(6))) / r;
10253
- return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
10416
+ i = Math.round(Number((e * r).toFixed(6))) / r;
10417
+ return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
10254
10418
  }
10255
10419
  ie();
10256
- var Er = ['images', 'input_images', 'videos', 'audios'];
10257
- function Ea(e) {
10258
- for (let t of Er) typeof e[t] == 'string' && (e[t] = [e[t]]);
10420
+ var Lr = ['images', 'input_images', 'videos', 'audios'];
10421
+ function Da(e) {
10422
+ for (let t of Lr) typeof e[t] == 'string' && (e[t] = [e[t]]);
10259
10423
  }
10260
- function $a(e) {
10424
+ function Na(e) {
10261
10425
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
10262
10426
  let t = O.default.resolve(e);
10263
10427
  return H.default.existsSync(t) && H.default.statSync(t).isFile() ? t : null;
10264
10428
  }
10265
- async function Ca(e, t) {
10266
- for (let r of Er) {
10429
+ async function Va(e, t) {
10430
+ for (let r of Lr) {
10267
10431
  if (!Array.isArray(e[r])) continue;
10268
- let a = [];
10432
+ let i = [];
10269
10433
  for (let n of e[r]) {
10270
10434
  if (typeof n != 'string') continue;
10271
- let s = $a(n);
10272
- a.push(s ? await t(s) : n);
10435
+ let s = Na(n);
10436
+ i.push(s ? await t(s) : n);
10273
10437
  }
10274
- e[r] = a;
10438
+ e[r] = i;
10275
10439
  }
10276
10440
  }
10277
10441
  var ae = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10278
- function Aa(e) {
10442
+ function Ua(e) {
10279
10443
  if (e.count === void 0 || e.count === !0) return 1;
10280
10444
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
10281
10445
  r = ae.enterprise;
10282
10446
  return (
10283
10447
  (!Number.isInteger(t) || t < 1 || t > r) &&
10284
10448
  (process.stderr
10285
- .write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${ae.starter}, Plus ${ae.plus}, Scale ${ae.scale}, Enterprise ${ae.enterprise} at once, including polling.
10449
+ .write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${ae.starter}, Plus ${ae.plus}, Scale ${ae.scale}, Enterprise ${ae.enterprise} at once, including polling.
10286
10450
  `),
10287
10451
  process.exit(1)),
10288
10452
  t
10289
10453
  );
10290
10454
  }
10291
- async function Ra(e, t, r, a, n) {
10455
+ async function Fa(e, t, r, i, n) {
10292
10456
  n.isJson ||
10293
- process.stderr.write(`Starting ${a} ${t} jobs together...
10457
+ process.stderr.write(`Starting ${i} ${t} jobs together...
10294
10458
  `);
10295
10459
  let s = await Promise.all(
10296
- Array.from({ length: a }, async () => {
10460
+ Array.from({ length: i }, async () => {
10297
10461
  try {
10298
10462
  return { job: await e.queueJob(t, r) };
10299
10463
  } catch (l) {
@@ -10302,26 +10466,26 @@ async function Ra(e, t, r, a, n) {
10302
10466
  }),
10303
10467
  ),
10304
10468
  o = [],
10305
- d = [];
10469
+ p = [];
10306
10470
  for (let l of s)
10307
10471
  'job' in l && l.job
10308
10472
  ? o.push(l.job)
10309
10473
  : 'err' in l &&
10310
- d.push(
10474
+ p.push(
10311
10475
  l.err instanceof b
10312
10476
  ? l.err
10313
10477
  : new b(0, l.err instanceof Error ? l.err.message : String(l.err)),
10314
10478
  );
10315
10479
  if (!n.isAsync) {
10316
10480
  let l = Date.now(),
10317
- c = o.filter((p) => p.status === 'processing' && p.request_id);
10481
+ c = o.filter((d) => d.status === 'processing' && d.request_id);
10318
10482
  for (; c.length;) {
10319
10483
  if ((await new Promise((u) => setTimeout(u, 2e3)), !n.isJson)) {
10320
10484
  let u = Math.round((Date.now() - l) / 1e3);
10321
- process.stderr.write(`Waiting on ${c.length} of ${a} (${u}s)...
10485
+ process.stderr.write(`Waiting on ${c.length} of ${i} (${u}s)...
10322
10486
  `);
10323
10487
  }
10324
- let p = await Promise.all(
10488
+ let d = await Promise.all(
10325
10489
  c.map(async (u) => {
10326
10490
  try {
10327
10491
  return await e.getStatus(u.request_id);
@@ -10330,7 +10494,7 @@ async function Ra(e, t, r, a, n) {
10330
10494
  }
10331
10495
  }),
10332
10496
  );
10333
- for (let u of p) {
10497
+ for (let u of d) {
10334
10498
  let m = o.findIndex((g) => g.request_id === u.request_id);
10335
10499
  m >= 0 && (o[m] = u);
10336
10500
  }
@@ -10340,7 +10504,7 @@ async function Ra(e, t, r, a, n) {
10340
10504
  if (n.isJson)
10341
10505
  process.stdout.write(
10342
10506
  JSON.stringify(
10343
- { jobs: o, errors: d.map((l) => ({ code: l.code ?? null, message: l.message })) },
10507
+ { jobs: o, errors: p.map((l) => ({ code: l.code ?? null, message: l.message })) },
10344
10508
  null,
10345
10509
  2,
10346
10510
  ) +
@@ -10351,46 +10515,46 @@ async function Ra(e, t, r, a, n) {
10351
10515
  for (let l of o) {
10352
10516
  if ((process.stdout.write(`${l.request_id} ${l.status}`), l.usage?.cost !== void 0)) {
10353
10517
  let c = l.usage.estimated ? ' (estimated)' : '';
10354
- process.stdout.write(` ${Ce(l.usage.cost)}${c}`);
10518
+ process.stdout.write(` ${Ae(l.usage.cost)}${c}`);
10355
10519
  }
10356
10520
  (l.error && process.stdout.write(` ${l.error}`),
10357
10521
  process.stdout.write(`
10358
10522
  `));
10359
10523
  }
10360
- for (let l of d)
10361
- process.stderr.write(`${K(l).join(`
10524
+ for (let l of p)
10525
+ process.stderr.write(`${E(l).join(`
10362
10526
  `)}
10363
10527
  `);
10364
10528
  }
10365
- (d.length ||
10529
+ (p.length ||
10366
10530
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
10367
10531
  process.exit(T);
10368
10532
  }
10369
- function Oa(e, t, r) {
10533
+ function Ba(e, t, r) {
10370
10534
  if (r <= 1) return e;
10371
- let a = O.default.extname(e);
10372
- return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
10535
+ let i = O.default.extname(e);
10536
+ return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
10373
10537
  }
10374
- function $r(e) {
10538
+ function Dr(e) {
10375
10539
  let t = {},
10376
10540
  r = new Set(),
10377
- a = [];
10541
+ i = [];
10378
10542
  for (let n = 0; n < e.length; n++) {
10379
10543
  let s = e[n];
10380
10544
  if (s.startsWith('--')) {
10381
10545
  let o = s.slice(2);
10382
10546
  if (o.includes('=')) {
10383
- let [d, l] = o.split('=', 2);
10384
- t[d.replace(/-/g, '_')] = l;
10547
+ let [p, l] = o.split('=', 2);
10548
+ t[p.replace(/-/g, '_')] = l;
10385
10549
  } else if (n + 1 < e.length && !e[n + 1].startsWith('-')) {
10386
- let d = e[n + 1];
10387
- (d === 'true'
10550
+ let p = e[n + 1];
10551
+ (p === 'true'
10388
10552
  ? (t[o.replace(/-/g, '_')] = !0)
10389
- : d === 'false'
10553
+ : p === 'false'
10390
10554
  ? (t[o.replace(/-/g, '_')] = !1)
10391
- : /^-?\d+(\.\d+)?$/.test(d)
10392
- ? (t[o.replace(/-/g, '_')] = Number(d))
10393
- : (t[o.replace(/-/g, '_')] = d),
10555
+ : /^-?\d+(\.\d+)?$/.test(p)
10556
+ ? (t[o.replace(/-/g, '_')] = Number(p))
10557
+ : (t[o.replace(/-/g, '_')] = p),
10394
10558
  n++);
10395
10559
  } else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
10396
10560
  } else if (s.startsWith('-') && s.length === 2) {
@@ -10412,33 +10576,33 @@ function $r(e) {
10412
10576
  : n + 1 < e.length && !e[n + 1].startsWith('-')
10413
10577
  ? ((t[l] = e[n + 1]), n++)
10414
10578
  : (t[l] = !0);
10415
- } else a.push(s);
10579
+ } else i.push(s);
10416
10580
  }
10417
- return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
10581
+ return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
10418
10582
  }
10419
- async function ot(e, t) {
10583
+ async function pt(e, t) {
10420
10584
  let r = _(typeof t.api_key == 'string' ? t.api_key : void 0),
10421
- a = x(typeof t.api_url == 'string' ? t.api_url : void 0);
10585
+ i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
10422
10586
  (r ||
10423
- (process.stderr.write(`${i.red('Error:')} Authentication required.
10587
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
10424
10588
  `),
10425
10589
  process.stderr
10426
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10590
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
10427
10591
  `),
10428
10592
  process.exit(1)),
10429
10593
  e ||
10430
- (process.stderr.write(`${i.red('Error:')} Missing model slug.
10594
+ (process.stderr.write(`${a.red('Error:')} Missing model slug.
10431
10595
  `),
10432
- process.stderr.write(`Usage: ${i.cyan('tein run <model-slug> --prompt "..."')}
10596
+ process.stderr.write(`Usage: ${a.cyan('tein run <model-slug> --prompt "..."')}
10433
10597
  `),
10434
- process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
10598
+ process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
10435
10599
  `),
10436
10600
  process.exit(1)));
10437
10601
  let n = G(e),
10438
10602
  s = !!t.json,
10439
10603
  o = !!(t.async || t.no_wait),
10440
- d = typeof t.output == 'string' ? t.output : void 0,
10441
- l = Aa(t),
10604
+ p = typeof t.output == 'string' ? t.output : void 0,
10605
+ l = Ua(t),
10442
10606
  c = { ...t };
10443
10607
  (delete c.json,
10444
10608
  delete c.async,
@@ -10447,14 +10611,14 @@ async function ot(e, t) {
10447
10611
  delete c.api_key,
10448
10612
  delete c.api_url,
10449
10613
  delete c.count);
10450
- let p = Kr(n, c);
10451
- (Ea(p),
10452
- typeof p.image == 'string' && !p.images && !Ie(n) && ((p.images = [p.image]), delete p.image),
10453
- p.image_url &&
10454
- !p.first_frame_image &&
10614
+ let d = qr(n, c);
10615
+ (Da(d),
10616
+ typeof d.image == 'string' && !d.images && !ve(n) && ((d.images = [d.image]), delete d.image),
10617
+ d.image_url &&
10618
+ !d.first_frame_image &&
10455
10619
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
10456
- (p.first_frame_image = p.image_url));
10457
- let u = new S(r, a),
10620
+ (d.first_frame_image = d.image_url));
10621
+ let u = new K(r, i),
10458
10622
  m = [
10459
10623
  'image',
10460
10624
  'mask_image',
@@ -10467,7 +10631,7 @@ async function ot(e, t) {
10467
10631
  'video_url',
10468
10632
  ];
10469
10633
  for (let w of m) {
10470
- let h = p[w];
10634
+ let h = d[w];
10471
10635
  if (typeof h == 'string' && !h.startsWith('http://') && !h.startsWith('https://')) {
10472
10636
  let I = O.default.resolve(h);
10473
10637
  if (H.default.existsSync(I) && H.default.statSync(I).isFile()) {
@@ -10476,7 +10640,7 @@ async function ot(e, t) {
10476
10640
  try {
10477
10641
  let F = H.default.readFileSync(I),
10478
10642
  q = await u.uploadAsset(F.toString('base64'));
10479
- ((p[w] = q.url), s || v.succeed(`Uploaded ${O.default.basename(I)} to CDN`));
10643
+ ((d[w] = q.url), s || v.succeed(`Uploaded ${O.default.basename(I)} to CDN`));
10480
10644
  } catch (F) {
10481
10645
  let q = F instanceof Error ? F.message : String(F);
10482
10646
  (s
@@ -10491,7 +10655,7 @@ async function ot(e, t) {
10491
10655
  }
10492
10656
  }
10493
10657
  }
10494
- await Ca(p, async (w) => {
10658
+ await Va(d, async (w) => {
10495
10659
  let h = new $(`Uploading local file ${O.default.basename(w)} to CDN...`);
10496
10660
  s || h.start();
10497
10661
  try {
@@ -10510,15 +10674,15 @@ async function ot(e, t) {
10510
10674
  process.exit(1));
10511
10675
  }
10512
10676
  });
10513
- let g = new $(`Submitting task for ${i.bold(e)}...`);
10677
+ let g = new $(`Submitting task for ${a.bold(e)}...`);
10514
10678
  s || g.start();
10515
10679
  let f;
10516
10680
  try {
10517
10681
  if (l > 1) {
10518
- await Ra(u, e, p, l, { isJson: s, isAsync: o });
10682
+ await Fa(u, e, d, l, { isJson: s, isAsync: o });
10519
10683
  return;
10520
10684
  }
10521
- f = await u.queueJob(e, p);
10685
+ f = await u.queueJob(e, d);
10522
10686
  } catch (w) {
10523
10687
  let h = w instanceof b ? w : null;
10524
10688
  (s
@@ -10535,7 +10699,7 @@ async function ot(e, t) {
10535
10699
  )
10536
10700
  : g.fail(
10537
10701
  h
10538
- ? K(h).join(`
10702
+ ? E(h).join(`
10539
10703
  `)
10540
10704
  : `Failed to start generation: ${w instanceof Error ? w.message : w}`,
10541
10705
  ),
@@ -10548,17 +10712,17 @@ async function ot(e, t) {
10548
10712
  `
10549
10713
  `,
10550
10714
  )
10551
- : (g.succeed(`Queued successfully! Request ID: ${i.bold(f.request_id)}`),
10552
- process.stdout.write(`Check status anytime with: ${i.cyan(`tein status ${f.request_id}`)}
10715
+ : (g.succeed(`Queued successfully! Request ID: ${a.bold(f.request_id)}`),
10716
+ process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${f.request_id}`)}
10553
10717
  `));
10554
10718
  return;
10555
10719
  }
10556
10720
  let C = Date.now(),
10557
- V = 1500;
10721
+ U = 1500;
10558
10722
  for (; f.status === 'processing';) {
10559
10723
  let w = Math.round((Date.now() - C) / 1e3);
10560
- (s || g.update(`Rendering ${i.bold(e)} (${w}s elapsed)... [ID: ${f.request_id}]`),
10561
- await new Promise((h) => setTimeout(h, V)));
10724
+ (s || g.update(`Rendering ${a.bold(e)} (${w}s elapsed)... [ID: ${f.request_id}]`),
10725
+ await new Promise((h) => setTimeout(h, U)));
10562
10726
  try {
10563
10727
  f = await u.getStatus(f.request_id);
10564
10728
  } catch (h) {
@@ -10566,7 +10730,7 @@ async function ot(e, t) {
10566
10730
  h.exitCode !== T &&
10567
10731
  (s ||
10568
10732
  g.fail(
10569
- K(h).join(`
10733
+ E(h).join(`
10570
10734
  `),
10571
10735
  ),
10572
10736
  process.exit(h.exitCode));
@@ -10582,7 +10746,7 @@ async function ot(e, t) {
10582
10746
  )
10583
10747
  : g.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
10584
10748
  process.exit(T)),
10585
- s || g.succeed(`Generation completed for ${i.bold(n?.name || e)}!`),
10749
+ s || g.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
10586
10750
  s)
10587
10751
  ) {
10588
10752
  process.stdout.write(
@@ -10595,36 +10759,36 @@ async function ot(e, t) {
10595
10759
  if (
10596
10760
  (process.stdout.write(`
10597
10761
  `),
10598
- process.stdout.write(` ${i.bold('Status:')} ${i.green('Succeeded')}
10762
+ process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
10599
10763
  `),
10600
- process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
10764
+ process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
10601
10765
  `),
10602
10766
  f.usage?.cost !== void 0 &&
10603
- process.stdout.write(` ${i.bold('Cost:')} ${Ce(f.usage.cost)}
10767
+ process.stdout.write(` ${a.bold('Cost:')} ${Ae(f.usage.cost)}
10604
10768
  `),
10605
10769
  f.output && f.output.length > 0)
10606
10770
  ) {
10607
10771
  process.stdout.write(`
10608
- ${i.bold('Outputs:')}
10772
+ ${a.bold('Outputs:')}
10609
10773
  `);
10610
10774
  let w = f.output.filter((I) => I.url).length,
10611
10775
  h = 0;
10612
10776
  for (let I = 0; I < f.output.length; I++) {
10613
10777
  let v = f.output[I];
10614
10778
  if (v.url) {
10615
- let F = v.layer?.name ? ` ${i.bold(v.layer.name)}` : '';
10779
+ let F = v.layer?.name ? ` ${a.bold(v.layer.name)}` : '';
10616
10780
  if (
10617
- (process.stdout.write(` [${v.type.toUpperCase()}]${F} ${i.cyan(i.underline(v.url))}
10781
+ (process.stdout.write(` [${v.type.toUpperCase()}]${F} ${a.cyan(a.underline(v.url))}
10618
10782
  `),
10619
- d)
10783
+ p)
10620
10784
  ) {
10621
- let q = Oa(d, h++, w),
10622
- yt = new $(`Downloading output to ${q}...`).start();
10785
+ let q = Ba(p, h++, w),
10786
+ xt = new $(`Downloading output to ${q}...`).start();
10623
10787
  try {
10624
10788
  (await u.downloadOutput(v.url, O.default.resolve(process.cwd(), q)),
10625
- yt.succeed(`Saved to ${i.bold(q)}`));
10626
- } catch (Me) {
10627
- yt.fail(`Failed to download: ${Me instanceof Error ? Me.message : Me}`);
10789
+ xt.succeed(`Saved to ${a.bold(q)}`));
10790
+ } catch (Se) {
10791
+ xt.fail(`Failed to download: ${Se instanceof Error ? Se.message : Se}`);
10628
10792
  }
10629
10793
  }
10630
10794
  } else
@@ -10637,11 +10801,11 @@ ${v.text}
10637
10801
  process.stdout.write(`
10638
10802
  `);
10639
10803
  }
10640
- var Cr = M(require('node:readline'));
10641
- A();
10642
- async function qa(e) {
10804
+ var Nr = M(require('node:readline'));
10805
+ R();
10806
+ async function ja(e) {
10643
10807
  try {
10644
- return (await new S(e, x()).checkKey(), 'ok');
10808
+ return (await new K(e, x()).checkKey(), 'ok');
10645
10809
  } catch (t) {
10646
10810
  if (t instanceof b) {
10647
10811
  if (t.status === 401) return 'invalid';
@@ -10650,11 +10814,11 @@ async function qa(e) {
10650
10814
  return 'unchecked';
10651
10815
  }
10652
10816
  }
10653
- function La(e) {
10654
- let t = Cr.default.createInterface({ input: process.stdin, output: process.stdout });
10817
+ function Ga(e) {
10818
+ let t = Nr.default.createInterface({ input: process.stdin, output: process.stdout });
10655
10819
  return new Promise((r) => {
10656
- t.question(e, (a) => {
10657
- (t.close(), r(a.trim()));
10820
+ t.question(e, (i) => {
10821
+ (t.close(), r(i.trim()));
10658
10822
  });
10659
10823
  });
10660
10824
  }
@@ -10665,38 +10829,38 @@ async function ne(e, t) {
10665
10829
  let r = t?.trim() || '';
10666
10830
  (r ||
10667
10831
  (process.stdout.write(`
10668
- ${i.bold('Tein AI Authentication')}
10832
+ ${a.bold('Tein AI Authentication')}
10669
10833
  `),
10670
- process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
10834
+ process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
10671
10835
 
10672
10836
  `),
10673
- (r = await La('Enter your Tein API Key (sk_live_...): '))),
10837
+ (r = await Ga('Enter your Tein API Key (sk_live_...): '))),
10674
10838
  !r.startsWith('sk_live_') &&
10675
10839
  !r.startsWith('sk_test_') &&
10676
10840
  (process.stderr
10677
- .write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10841
+ .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10678
10842
  `),
10679
10843
  process.exit(1)));
10680
- let a = await qa(r);
10681
- (a === 'invalid' &&
10844
+ let i = await ja(r);
10845
+ (i === 'invalid' &&
10682
10846
  (process.stderr
10683
- .write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
10847
+ .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
10684
10848
  `),
10685
10849
  process.exit(1)),
10686
- $e({ apiKey: r }),
10850
+ Ce({ apiKey: r }),
10687
10851
  process.stdout.write(`
10688
- ${i.green('\u2713')} API key saved to ${i.dim(pe())}
10852
+ ${a.green('\u2713')} API key saved to ${a.dim(de())}
10689
10853
  `),
10690
- a === 'blocked'
10854
+ i === 'blocked'
10691
10855
  ? process.stdout
10692
- .write(`${i.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
10856
+ .write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
10693
10857
  `)
10694
- : a === 'unchecked' &&
10858
+ : i === 'unchecked' &&
10695
10859
  process.stdout
10696
- .write(`${i.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${i.cyan('tein auth set-key')} again once you are online to check it.
10860
+ .write(`${a.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${a.cyan('tein auth set-key')} again once you are online to check it.
10697
10861
  `),
10698
10862
  process.stdout
10699
- .write(`You can now run models directly using: ${i.cyan('tein run <model-slug> --prompt "..."')}
10863
+ .write(`You can now run models directly using: ${a.cyan('tein run <model-slug> --prompt "..."')}
10700
10864
 
10701
10865
  `));
10702
10866
  break;
@@ -10704,41 +10868,41 @@ ${i.green('\u2713')} API key saved to ${i.dim(pe())}
10704
10868
  case 'logout': {
10705
10869
  if (!J().apiKey) {
10706
10870
  process.stdout
10707
- .write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
10871
+ .write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
10708
10872
  `);
10709
10873
  break;
10710
10874
  }
10711
- ($e({ apiKey: '' }),
10875
+ (Ce({ apiKey: '' }),
10712
10876
  process.stdout
10713
- .write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(pe())}
10877
+ .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(de())}
10714
10878
  `));
10715
10879
  break;
10716
10880
  }
10717
10881
  default: {
10718
10882
  let r = _(),
10719
- a = x(),
10883
+ i = x(),
10720
10884
  n = J();
10721
10885
  if (
10722
10886
  (process.stdout.write(`
10723
- ${i.bold('Tein AI CLI Configuration')}
10887
+ ${a.bold('Tein AI CLI Configuration')}
10724
10888
  `),
10725
- process.stdout.write(` Config file: ${i.dim(pe())}
10889
+ process.stdout.write(` Config file: ${a.dim(de())}
10726
10890
  `),
10727
- process.stdout.write(` API URL: ${i.cyan(a)}
10891
+ process.stdout.write(` API URL: ${a.cyan(i)}
10728
10892
  `),
10729
10893
  !r)
10730
10894
  )
10731
- (process.stdout.write(` API Key: ${i.red('Not configured')}
10895
+ (process.stdout.write(` API Key: ${a.red('Not configured')}
10732
10896
 
10733
10897
  `),
10734
10898
  process.stdout
10735
- .write(`Run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10899
+ .write(`Run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
10736
10900
 
10737
10901
  `));
10738
10902
  else {
10739
10903
  let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
10740
10904
  process.stdout
10741
- .write(` API Key: ${i.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
10905
+ .write(` API Key: ${a.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
10742
10906
 
10743
10907
  `);
10744
10908
  }
@@ -10746,16 +10910,16 @@ ${i.bold('Tein AI CLI Configuration')}
10746
10910
  }
10747
10911
  }
10748
10912
  }
10749
- A();
10913
+ R();
10750
10914
  function P(e) {
10751
10915
  return e !== 0 && Math.abs(e) < 0.01
10752
10916
  ? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
10753
10917
  : `$${e.toFixed(2)}`;
10754
10918
  }
10755
- function Ar(e) {
10919
+ function Vr(e) {
10756
10920
  return `${e} ${e === 1 ? 'request' : 'requests'}`;
10757
10921
  }
10758
- function Da(e) {
10922
+ function Ha(e) {
10759
10923
  let t = [
10760
10924
  ['Balance', P(e.balance)],
10761
10925
  ['Available to this key', P(e.available)],
@@ -10775,8 +10939,8 @@ function Da(e) {
10775
10939
  `${P(r.remaining)} left of ${P(r.amount)}${r.resets_at ? `, resets ${r.resets_at.slice(0, 10)}` : ''}`,
10776
10940
  ]),
10777
10941
  t.push(
10778
- ['This month', `${P(e.usage.this_month.spend)} on ${Ar(e.usage.this_month.requests)}`],
10779
- ['Last 30 days', `${P(e.usage.last_30_days.spend)} on ${Ar(e.usage.last_30_days.requests)}`],
10942
+ ['This month', `${P(e.usage.this_month.spend)} on ${Vr(e.usage.this_month.requests)}`],
10943
+ ['Last 30 days', `${P(e.usage.last_30_days.spend)} on ${Vr(e.usage.last_30_days.requests)}`],
10780
10944
  [
10781
10945
  'Auto top up',
10782
10946
  e.auto_top_up.enabled
@@ -10786,26 +10950,26 @@ function Da(e) {
10786
10950
  ['Workspace', `${e.workspace.name} (${e.workspace.plan.name})`],
10787
10951
  ['Key', `${e.key.name} (${e.key.env})`],
10788
10952
  ));
10789
- let a = Math.max(...t.map(([n]) => n.length));
10790
- return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
10953
+ let i = Math.max(...t.map(([n]) => n.length));
10954
+ return t.map(([n, s]) => ` ${n.padEnd(i)} ${s}`);
10791
10955
  }
10792
- async function Rr(e) {
10956
+ async function Ur(e) {
10793
10957
  let t = _(typeof e.api_key == 'string' ? e.api_key : void 0),
10794
10958
  r = x(typeof e.api_url == 'string' ? e.api_url : void 0),
10795
- a = !!e.json;
10959
+ i = !!e.json;
10796
10960
  t ||
10797
- (process.stderr.write(`${i.red('Error:')} Authentication required.
10961
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
10798
10962
  `),
10799
10963
  process.stderr
10800
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10964
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
10801
10965
  `),
10802
10966
  process.exit(1));
10803
10967
  let n;
10804
10968
  try {
10805
- n = await new S(t, r).getBalance();
10969
+ n = await new K(t, r).getBalance();
10806
10970
  } catch (s) {
10807
10971
  (s instanceof b &&
10808
- (a
10972
+ (i
10809
10973
  ? process.stdout.write(
10810
10974
  JSON.stringify(
10811
10975
  { error: { code: s.code ?? null, message: s.message, ...s.fields } },
@@ -10815,15 +10979,15 @@ async function Rr(e) {
10815
10979
  `
10816
10980
  `,
10817
10981
  )
10818
- : process.stderr.write(`${i.red('Error:')} ${K(s).join(`
10982
+ : process.stderr.write(`${a.red('Error:')} ${E(s).join(`
10819
10983
  `)}
10820
10984
  `),
10821
10985
  process.exit(s.exitCode)),
10822
- process.stderr.write(`${i.red('Error:')} ${s instanceof Error ? s.message : String(s)}
10986
+ process.stderr.write(`${a.red('Error:')} ${s instanceof Error ? s.message : String(s)}
10823
10987
  `),
10824
10988
  process.exit(T));
10825
10989
  }
10826
- if (a) {
10990
+ if (i) {
10827
10991
  process.stdout.write(
10828
10992
  JSON.stringify(n, null, 2) +
10829
10993
  `
@@ -10832,36 +10996,36 @@ async function Rr(e) {
10832
10996
  return;
10833
10997
  }
10834
10998
  process.stdout.write(`
10835
- ${i.bold('Tein balance')}
10836
- ${Da(n).join(`
10999
+ ${a.bold('Tein balance')}
11000
+ ${Ha(n).join(`
10837
11001
  `)}
10838
11002
 
10839
11003
  `);
10840
11004
  }
10841
- A();
10842
- function Or(e) {
11005
+ R();
11006
+ function Fr(e) {
10843
11007
  let t = _(typeof e.api_key == 'string' ? e.api_key : void 0),
10844
11008
  r = x(typeof e.api_url == 'string' ? e.api_url : void 0);
10845
11009
  return (
10846
11010
  t ||
10847
- (process.stderr.write(`${i.red('Error:')} Authentication required.
11011
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
10848
11012
  `),
10849
11013
  process.stderr
10850
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
11014
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
10851
11015
  `),
10852
11016
  process.exit(1)),
10853
- new S(t, r)
11017
+ new K(t, r)
10854
11018
  );
10855
11019
  }
10856
- function qr(e, t) {
11020
+ function Br(e, t) {
10857
11021
  let r = {};
10858
- for (let a of t) {
10859
- let n = e[a];
10860
- (typeof n == 'string' || typeof n == 'number') && (r[a] = String(n));
11022
+ for (let i of t) {
11023
+ let n = e[i];
11024
+ (typeof n == 'string' || typeof n == 'number') && (r[i] = String(n));
10861
11025
  }
10862
11026
  return r;
10863
11027
  }
10864
- async function Lr(e, t) {
11028
+ async function jr(e, t) {
10865
11029
  try {
10866
11030
  return await t();
10867
11031
  } catch (r) {
@@ -10876,27 +11040,27 @@ async function Lr(e, t) {
10876
11040
  `
10877
11041
  `,
10878
11042
  )
10879
- : process.stderr.write(`${i.red('Error:')} ${K(r).join(`
11043
+ : process.stderr.write(`${a.red('Error:')} ${E(r).join(`
10880
11044
  `)}
10881
11045
  `),
10882
11046
  process.exit(r.exitCode)),
10883
- process.stderr.write(`${i.red('Error:')} ${r instanceof Error ? r.message : String(r)}
11047
+ process.stderr.write(`${a.red('Error:')} ${r instanceof Error ? r.message : String(r)}
10884
11048
  `),
10885
11049
  process.exit(T));
10886
11050
  }
10887
11051
  }
10888
- function lt(e) {
10889
- let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
10890
- r = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
11052
+ function dt(e) {
11053
+ let t = e[0].map((i, n) => Math.max(...e.map((s) => s[n].length))),
11054
+ r = (i) => e.slice(1).every((n) => /^[-+$\d]/.test(n[i]));
10891
11055
  return e.map(
10892
- (a) =>
10893
- ` ${a
11056
+ (i) =>
11057
+ ` ${i
10894
11058
  .map((n, s) => (s > 0 && r(s) ? n.padStart(t[s]) : n.padEnd(t[s])))
10895
11059
  .join(' ')
10896
11060
  .trimEnd()}`,
10897
11061
  );
10898
11062
  }
10899
- function Na(e) {
11063
+ function za(e) {
10900
11064
  let t = e.summary,
10901
11065
  r = [
10902
11066
  ` 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}` : ''}`,
@@ -10906,46 +11070,46 @@ function Na(e) {
10906
11070
  ];
10907
11071
  return (
10908
11072
  e.by_channel.length &&
10909
- (r.push('', i.bold('By channel')),
11073
+ (r.push('', a.bold('By channel')),
10910
11074
  r.push(
10911
- ...lt([
11075
+ ...dt([
10912
11076
  ['Channel', 'Spend', 'Requests'],
10913
- ...e.by_channel.map((a) => [a.channel, P(a.spend), String(a.requests)]),
11077
+ ...e.by_channel.map((i) => [i.channel, P(i.spend), String(i.requests)]),
10914
11078
  ]),
10915
11079
  )),
10916
11080
  e.by_model.length &&
10917
- (r.push('', i.bold('By model')),
11081
+ (r.push('', a.bold('By model')),
10918
11082
  r.push(
10919
- ...lt([
11083
+ ...dt([
10920
11084
  ['Model', 'Spend', 'Requests', 'Failed'],
10921
- ...e.by_model.map((a) => [a.name, P(a.spend), String(a.requests), String(a.failed)]),
11085
+ ...e.by_model.map((i) => [i.name, P(i.spend), String(i.requests), String(i.failed)]),
10922
11086
  ]),
10923
11087
  )),
10924
11088
  r
10925
11089
  );
10926
11090
  }
10927
- async function Dr(e) {
11091
+ async function Gr(e) {
10928
11092
  let t = !!e.json,
10929
- r = Or(e),
10930
- a = await Lr(t, () => r.getUsage(qr(e, ['range', 'from', 'to', 'model', 'channel'])));
11093
+ r = Fr(e),
11094
+ i = await jr(t, () => r.getUsage(Br(e, ['range', 'from', 'to', 'model', 'channel'])));
10931
11095
  if (t) {
10932
11096
  process.stdout.write(
10933
- JSON.stringify(a, null, 2) +
11097
+ JSON.stringify(i, null, 2) +
10934
11098
  `
10935
11099
  `,
10936
11100
  );
10937
11101
  return;
10938
11102
  }
10939
11103
  process.stdout.write(`
10940
- ${i.bold('Tein usage')}
10941
- ${Na(a).join(`
11104
+ ${a.bold('Tein usage')}
11105
+ ${za(i).join(`
10942
11106
  `)}
10943
11107
 
10944
11108
  `);
10945
11109
  }
10946
- function Ua(e) {
11110
+ function Wa(e) {
10947
11111
  return e.data.length
10948
- ? lt([
11112
+ ? dt([
10949
11113
  ['When (UTC)', 'Amount', 'Balance after', 'What'],
10950
11114
  ...e.data.map((t) => [
10951
11115
  t.created_at.slice(0, 16).replace('T', ' '),
@@ -10956,37 +11120,37 @@ function Ua(e) {
10956
11120
  ])
10957
11121
  : [' No transactions yet.'];
10958
11122
  }
10959
- async function Nr(e) {
11123
+ async function Hr(e) {
10960
11124
  let t = !!e.json,
10961
- r = Or(e),
10962
- a = await Lr(t, () => r.getTransactions(qr(e, ['limit', 'type', 'after'])));
11125
+ r = Fr(e),
11126
+ i = await jr(t, () => r.getTransactions(Br(e, ['limit', 'type', 'after'])));
10963
11127
  if (t) {
10964
11128
  process.stdout.write(
10965
- JSON.stringify(a, null, 2) +
11129
+ JSON.stringify(i, null, 2) +
10966
11130
  `
10967
11131
  `,
10968
11132
  );
10969
11133
  return;
10970
11134
  }
10971
11135
  let n =
10972
- a.has_more && a.next_cursor
11136
+ i.has_more && i.next_cursor
10973
11137
  ? `
10974
- More: tein transactions --after ${a.next_cursor}`
11138
+ More: tein transactions --after ${i.next_cursor}`
10975
11139
  : '';
10976
11140
  process.stdout.write(`
10977
- ${i.bold('Tein balance history')}
10978
- ${Ua(a).join(`
11141
+ ${a.bold('Tein balance history')}
11142
+ ${Wa(i).join(`
10979
11143
  `)}${n}
10980
11144
 
10981
11145
  `);
10982
11146
  }
10983
- A();
10984
- Ae();
11147
+ R();
11148
+ Re();
10985
11149
  ie();
10986
- A();
10987
- dt();
10988
- var Va = 1e4,
10989
- Ur = {
11150
+ R();
11151
+ ct();
11152
+ var Ja = 1e4,
11153
+ zr = {
10990
11154
  price: '',
10991
11155
  creativeMode: 'Creative mode',
10992
11156
  priority: 'Priority',
@@ -10996,27 +11160,27 @@ var Va = 1e4,
10996
11160
  priorityDraft: 'Priority + Draft',
10997
11161
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
10998
11162
  },
10999
- Fa = Object.keys(Ur),
11000
- Ba = {
11163
+ Ya = Object.keys(zr),
11164
+ Xa = {
11001
11165
  creativeMode: 'unfiltered',
11002
11166
  creativeModePriority: 'unfilteredPriority',
11003
11167
  creativeModeDraft: 'unfilteredDraft',
11004
11168
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
11005
11169
  };
11006
- function ja(e, t) {
11007
- let r = Ba[t];
11170
+ function Qa(e, t) {
11171
+ let r = Xa[t];
11008
11172
  return e[t] ?? (r ? e[r] : void 0);
11009
11173
  }
11010
- async function Ga(e, t, r = _()) {
11011
- let a = `${x(e)}${ve(t)}`,
11174
+ async function Za(e, t, r = _()) {
11175
+ let i = `${x(e)}${Te(t)}`,
11012
11176
  n;
11013
11177
  try {
11014
- n = await fetch(a, {
11015
- signal: AbortSignal.timeout(Va),
11178
+ n = await fetch(i, {
11179
+ signal: AbortSignal.timeout(Ja),
11016
11180
  ...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
11017
11181
  });
11018
11182
  } catch {
11019
- throw new Error(`Could not reach ${a}`);
11183
+ throw new Error(`Could not reach ${i}`);
11020
11184
  }
11021
11185
  let s = await n.json().catch(() => null);
11022
11186
  if (!n.ok || !s || s.object !== 'list' || !s.board) {
@@ -11030,95 +11194,95 @@ async function Ga(e, t, r = _()) {
11030
11194
  }
11031
11195
  return s;
11032
11196
  }
11033
- function Te(e) {
11197
+ function Me(e) {
11034
11198
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
11035
- [r, a = ''] = t.split('.');
11036
- return `$${r}.${a.padEnd(2, '0')}`;
11199
+ [r, i = ''] = t.split('.');
11200
+ return `$${r}.${i.padEnd(2, '0')}`;
11037
11201
  }
11038
11202
  function X(e) {
11039
11203
  if (!e || typeof e.starter != 'number') return null;
11040
11204
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
11041
11205
  r = typeof e.scale == 'number' ? e.scale : t;
11042
- return `Starter ${Te(e.starter)} Plus ${Te(t)} Scale ${Te(r)}`;
11206
+ return `Starter ${Me(e.starter)} Plus ${Me(t)} Scale ${Me(r)}`;
11043
11207
  }
11044
- function Vr(e) {
11045
- let t = Ur[e];
11208
+ function Wr(e) {
11209
+ let t = zr[e];
11046
11210
  return t ? ` (${t})` : '';
11047
11211
  }
11048
- function pt(e) {
11212
+ function ut(e) {
11049
11213
  let t = X(e.price) ?? '',
11050
- r = e.public ? ` ${i.dim(`(published Starter ${Te(e.public.starter)})`)}` : '';
11051
- return `${e.label}${Vr(e.table)} ${t}${r}`;
11214
+ r = e.public ? ` ${a.dim(`(published Starter ${Me(e.public.starter)})`)}` : '';
11215
+ return `${e.label}${Wr(e.table)} ${t}${r}`;
11052
11216
  }
11053
- function ct(e, t, r, a = !1) {
11054
- return `${e}|${a ? 'edit/' : ''}${t}|${r}`;
11217
+ function mt(e, t, r, i = !1) {
11218
+ return `${e}|${i ? 'edit/' : ''}${t}|${r}`;
11055
11219
  }
11056
- function Ha(e) {
11220
+ function en(e) {
11057
11221
  let t = new Map();
11058
11222
  for (let r of e ?? []) {
11059
- let a = r.addon ? `addon/${r.addon}` : (r.variant ?? '');
11060
- t.set(ct(r.slug, a, r.table, r.edit === !0), r);
11223
+ let i = r.addon ? `addon/${r.addon}` : (r.variant ?? '');
11224
+ t.set(mt(r.slug, i, r.table, r.edit === !0), r);
11061
11225
  }
11062
11226
  return t;
11063
11227
  }
11064
- function za(e) {
11228
+ function tn(e) {
11065
11229
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
11066
11230
  let t = [];
11067
11231
  for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
11068
- let a = e[r];
11069
- a != null && a !== '' && t.push(String(a));
11232
+ let i = e[r];
11233
+ i != null && i !== '' && t.push(String(i));
11070
11234
  }
11071
11235
  return (
11072
11236
  e.withVideo === !0 && t.push('with video'),
11073
11237
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
11074
11238
  );
11075
11239
  }
11076
- function Wa(e, t, r, a, n) {
11077
- let s = za(t);
11078
- for (let o of Fa) {
11079
- let d = X(ja(t, o));
11080
- if (!d) continue;
11081
- let l = Vr(o);
11082
- r.push(` ${s}${l} ${d}`);
11083
- let c = a.get(ct(e, String(t.id ?? ''), o));
11084
- c && (n.add(c), r.push(` ${i.yellow('Your price')} ${X(c.price) ?? ''}`));
11240
+ function rn(e, t, r, i, n) {
11241
+ let s = tn(t);
11242
+ for (let o of Ya) {
11243
+ let p = X(Qa(t, o));
11244
+ if (!p) continue;
11245
+ let l = Wr(o);
11246
+ r.push(` ${s}${l} ${p}`);
11247
+ let c = i.get(mt(e, String(t.id ?? ''), o));
11248
+ c && (n.add(c), r.push(` ${a.yellow('Your price')} ${X(c.price) ?? ''}`));
11085
11249
  }
11086
11250
  }
11087
- function Ja(e, t, r, a) {
11251
+ function an(e, t, r, i) {
11088
11252
  let n = e.quality ? ` quality=${e.quality}` : '';
11089
11253
  t.push(
11090
- ` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${n}`)}`,
11254
+ ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${n}`)}`,
11091
11255
  );
11092
- for (let o of e.variants ?? []) Wa(e.slug, o, t, r, a);
11256
+ for (let o of e.variants ?? []) rn(e.slug, o, t, r, i);
11093
11257
  let s = e.addons;
11094
11258
  if (Array.isArray(s))
11095
11259
  for (let o of s) {
11096
11260
  if (!o || typeof o != 'object') continue;
11097
- let d = o,
11098
- l = typeof d.label == 'string' ? d.label : String(d.id ?? 'add-on'),
11099
- c = X(d.price);
11261
+ let p = o,
11262
+ l = typeof p.label == 'string' ? p.label : String(p.id ?? 'add-on'),
11263
+ c = X(p.price);
11100
11264
  c && t.push(` ${l} (add-on) ${c}`);
11101
- let p = r.get(ct(e.slug, `addon/${String(d.id ?? '')}`, 'price'));
11102
- c && p && (a.add(p), t.push(` ${i.yellow('Your price')} ${X(p.price) ?? ''}`));
11265
+ let d = r.get(mt(e.slug, `addon/${String(p.id ?? '')}`, 'price'));
11266
+ c && d && (i.add(d), t.push(` ${a.yellow('Your price')} ${X(d.price) ?? ''}`));
11103
11267
  }
11104
11268
  for (let o of Array.isArray(e.notes) ? e.notes : [])
11105
- typeof o == 'string' && o.trim() && t.push(` ${i.dim(o.trim())}`);
11269
+ typeof o == 'string' && o.trim() && t.push(` ${a.dim(o.trim())}`);
11106
11270
  t.push('');
11107
11271
  }
11108
- function Ya(e) {
11272
+ function nn(e) {
11109
11273
  let t = [],
11110
11274
  r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
11111
- (t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
11275
+ (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
11112
11276
  t.push(
11113
- `${i.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
11277
+ `${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
11114
11278
  ));
11115
- let a = e.your_prices?.rows ?? [];
11116
- (a.length &&
11279
+ let i = e.your_prices?.rows ?? [];
11280
+ (i.length &&
11117
11281
  t.push(
11118
- `${i.yellow('Your price')} ${i.dim('rows are the prices your workspace pays instead of the published ones.')}`,
11282
+ `${a.yellow('Your price')} ${a.dim('rows are the prices your workspace pays instead of the published ones.')}`,
11119
11283
  ),
11120
11284
  t.push(''));
11121
- let n = Ha(a),
11285
+ let n = en(i),
11122
11286
  s = new Set(),
11123
11287
  o = new Map();
11124
11288
  for (let m of e.board.models) {
@@ -11126,28 +11290,28 @@ function Ya(e) {
11126
11290
  f = o.get(g) ?? [];
11127
11291
  (f.push(m), o.set(g, f));
11128
11292
  }
11129
- let d = ['video', 'image', 'audio', 'llm', 'text', '3d'],
11293
+ let p = ['video', 'image', 'audio', 'llm', 'text', '3d'],
11130
11294
  l = [...o.keys()].sort((m, g) => {
11131
- let f = d.indexOf(m),
11132
- C = d.indexOf(g);
11295
+ let f = p.indexOf(m),
11296
+ C = p.indexOf(g);
11133
11297
  return (f === -1 ? 99 : f) - (C === -1 ? 99 : C);
11134
11298
  });
11135
11299
  for (let m of l) {
11136
- t.push(`${i.bold(i.cyan(`\u2500\u2500 ${m} \u2500\u2500`))}`);
11137
- for (let g of o.get(m) ?? []) Ja(g, t, n, s);
11300
+ t.push(`${a.bold(a.cyan(`\u2500\u2500 ${m} \u2500\u2500`))}`);
11301
+ for (let g of o.get(m) ?? []) an(g, t, n, s);
11138
11302
  }
11139
- let c = a.filter((m) => !s.has(m));
11303
+ let c = i.filter((m) => !s.has(m));
11140
11304
  if (c.length) {
11141
- t.push(`${i.bold(i.cyan('\u2500\u2500 your prices \u2500\u2500'))}`);
11305
+ t.push(`${a.bold(a.cyan('\u2500\u2500 your prices \u2500\u2500'))}`);
11142
11306
  for (let m of c)
11143
- (t.push(` ${i.bold(m.slug.padEnd(26))} ${i.gray(m.name)} ${i.dim(m.unit)}`),
11144
- t.push(` ${i.yellow('Your price')} ${pt(m)}`));
11307
+ (t.push(` ${a.bold(m.slug.padEnd(26))} ${a.gray(m.name)} ${a.dim(m.unit)}`),
11308
+ t.push(` ${a.yellow('Your price')} ${ut(m)}`));
11145
11309
  t.push('');
11146
11310
  }
11147
- let p = new Set(e.board.models.map((m) => m.slug.toLowerCase())),
11148
- u = (e.configs ?? []).filter((m) => !p.has(String(m.modelSlug ?? '').toLowerCase()));
11311
+ let d = new Set(e.board.models.map((m) => m.slug.toLowerCase())),
11312
+ u = (e.configs ?? []).filter((m) => !d.has(String(m.modelSlug ?? '').toLowerCase()));
11149
11313
  if (u.length) {
11150
- t.push(`${i.bold(i.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
11314
+ t.push(`${a.bold(a.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
11151
11315
  let m = new Map();
11152
11316
  for (let g of u) {
11153
11317
  let f = String(g.modelSlug ?? ''),
@@ -11156,29 +11320,29 @@ function Ya(e) {
11156
11320
  }
11157
11321
  for (let [g, f] of m) {
11158
11322
  let C = String(f[0]?.modelName ?? g);
11159
- t.push(` ${i.bold(g.padEnd(26))} ${i.gray(C)}`);
11160
- for (let V of f) {
11161
- let w = String(V.displayLabel ?? V.billingUnit ?? 'price'),
11162
- h = X(V.prices);
11323
+ t.push(` ${a.bold(g.padEnd(26))} ${a.gray(C)}`);
11324
+ for (let U of f) {
11325
+ let w = String(U.displayLabel ?? U.billingUnit ?? 'price'),
11326
+ h = X(U.prices);
11163
11327
  h && t.push(` ${w} ${h}`);
11164
11328
  }
11165
11329
  t.push('');
11166
11330
  }
11167
11331
  }
11168
11332
  return (
11169
- t.push(`${i.dim('JSON:')} ${i.cyan('tein pricing --json')}`),
11333
+ t.push(`${a.dim('JSON:')} ${a.cyan('tein pricing --json')}`),
11170
11334
  `${t.join(`
11171
11335
  `)}
11172
11336
  `
11173
11337
  );
11174
11338
  }
11175
- async function Fr(e) {
11339
+ async function Jr(e) {
11176
11340
  let t;
11177
11341
  try {
11178
- t = await Ga(e.apiUrl, e.model);
11342
+ t = await Za(e.apiUrl, e.model);
11179
11343
  } catch (r) {
11180
- let a = r instanceof Error ? r.message : String(r);
11181
- (process.stderr.write(`${i.red('Error:')} ${a}
11344
+ let i = r instanceof Error ? r.message : String(r);
11345
+ (process.stderr.write(`${a.red('Error:')} ${i}
11182
11346
  `),
11183
11347
  process.exit(1));
11184
11348
  }
@@ -11186,73 +11350,73 @@ async function Fr(e) {
11186
11350
  e.json
11187
11351
  ? `${JSON.stringify(t, null, 2)}
11188
11352
  `
11189
- : Ya(t),
11353
+ : nn(t),
11190
11354
  );
11191
11355
  }
11192
- var Xa = 3e3;
11193
- async function Br(e, t) {
11356
+ var sn = 3e3;
11357
+ async function Yr(e, t) {
11194
11358
  let r = t ?? _();
11195
11359
  try {
11196
- let a = await fetch(`${x(e)}/v1/pricing`, {
11197
- signal: AbortSignal.timeout(Xa),
11360
+ let i = await fetch(`${x(e)}/v1/pricing`, {
11361
+ signal: AbortSignal.timeout(sn),
11198
11362
  ...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
11199
11363
  });
11200
- if (!a.ok) return { live: !1, yourPrices: null };
11201
- let n = await a.json(),
11364
+ if (!i.ok) return { live: !1, yourPrices: null };
11365
+ let n = await i.json(),
11202
11366
  s = {};
11203
- for (let d of n.configs ?? []) {
11204
- let l = String(d.modelSlug ?? '');
11205
- ce.has(l) && (s[l] ??= []).push(Number(d.starterPrice));
11367
+ for (let p of n.configs ?? []) {
11368
+ let l = String(p.modelSlug ?? '');
11369
+ ce.has(l) && (s[l] ??= []).push(Number(p.starterPrice));
11206
11370
  }
11207
- (br(s), Sr(n.price_texts));
11371
+ (Ir(s), Rr(n.price_texts));
11208
11372
  let o = n.your_prices?.rows;
11209
11373
  return { live: !0, yourPrices: Array.isArray(o) ? o : null };
11210
11374
  } catch {
11211
11375
  return { live: !1, yourPrices: null };
11212
11376
  }
11213
11377
  }
11214
- function Qa(e) {
11378
+ function on(e) {
11215
11379
  return G(e.slug) ? e.slug : e.model;
11216
11380
  }
11217
- function jr(e, t) {
11218
- return (t ?? []).filter((r) => r && Qa(r) === e);
11381
+ function Xr(e, t) {
11382
+ return (t ?? []).filter((r) => r && on(r) === e);
11219
11383
  }
11220
- var Za = new Set(['video', 'image', 'text', 'audio', '3d']),
11221
- en = { llm: 'text', chat: 'text', reasoning: 'text' };
11222
- async function Gr(e, t) {
11223
- let r = await Br(t),
11224
- a = N();
11384
+ var ln = new Set(['video', 'image', 'text', 'audio', '3d']),
11385
+ pn = { llm: 'text', chat: 'text', reasoning: 'text' };
11386
+ async function Qr(e, t) {
11387
+ let r = await Yr(t),
11388
+ i = N();
11225
11389
  if (e) {
11226
11390
  let o = e.toLowerCase(),
11227
- d = en[o] ?? o;
11228
- a = Za.has(d)
11229
- ? a.filter((l) => l.category.toLowerCase() === d)
11230
- : a.filter((l) => l.kind.toLowerCase().includes(o) || l.slug.toLowerCase().includes(o));
11391
+ p = pn[o] ?? o;
11392
+ i = ln.has(p)
11393
+ ? i.filter((l) => l.category.toLowerCase() === p)
11394
+ : i.filter((l) => l.kind.toLowerCase().includes(o) || l.slug.toLowerCase().includes(o));
11231
11395
  }
11232
11396
  (process.stdout.write(`
11233
- ${i.bold('Tein AI Models Catalog')} (${a.length} available)
11397
+ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
11234
11398
  `),
11235
11399
  process.stdout
11236
- .write(`${i.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
11400
+ .write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
11237
11401
 
11238
11402
  `));
11239
11403
  let n = {};
11240
- for (let o of a) {
11241
- let d = o.category;
11242
- (n[d] || (n[d] = []), n[d].push(o));
11404
+ for (let o of i) {
11405
+ let p = o.category;
11406
+ (n[p] || (n[p] = []), n[p].push(o));
11243
11407
  }
11244
11408
  let s = ['Video', 'Image', 'Text', 'Audio', '3D'];
11245
11409
  for (let o of s) {
11246
- let d = n[o];
11247
- if (!(!d || d.length === 0)) {
11248
- process.stdout.write(`${i.bold(i.cyan(`\u2500\u2500 ${o} Models \u2500\u2500`))}
11410
+ let p = n[o];
11411
+ if (!(!p || p.length === 0)) {
11412
+ process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${o} Models \u2500\u2500`))}
11249
11413
  `);
11250
- for (let l of d) {
11414
+ for (let l of p) {
11251
11415
  let c = l.slug.padEnd(24),
11252
- p = l.name.padEnd(22),
11416
+ d = l.name.padEnd(22),
11253
11417
  u = l.priceFormatted.padEnd(22),
11254
- m = jr(l.slug, r.yourPrices).length ? ` ${i.yellow('Your price')}` : '';
11255
- process.stdout.write(` ${i.bold(c)} ${i.gray(p)} ${i.green(u)} ${i.dim(l.vendor)}${m}
11418
+ m = Xr(l.slug, r.yourPrices).length ? ` ${a.yellow('Your price')}` : '';
11419
+ process.stdout.write(` ${a.bold(c)} ${a.gray(d)} ${a.green(u)} ${a.dim(l.vendor)}${m}
11256
11420
  `);
11257
11421
  }
11258
11422
  process.stdout.write(`
@@ -11261,69 +11425,69 @@ ${i.bold('Tein AI Models Catalog')} (${a.length} available)
11261
11425
  }
11262
11426
  (r.yourPrices?.length &&
11263
11427
  process.stdout
11264
- .write(`${i.yellow('Your price:')} your workspace has its own prices on these models. See ${i.cyan('tein info <model-slug>')} or ${i.cyan('tein pricing <model-slug>')}.
11428
+ .write(`${a.yellow('Your price:')} your workspace has its own prices on these models. See ${a.cyan('tein info <model-slug>')} or ${a.cyan('tein pricing <model-slug>')}.
11265
11429
  `),
11266
11430
  r.live ||
11267
11431
  process.stdout
11268
- .write(`${i.dim('Prices could not be checked online; showing the prices this CLI was built with.')}
11432
+ .write(`${a.dim('Prices could not be checked online; showing the prices this CLI was built with.')}
11269
11433
  `),
11270
11434
  process.stdout
11271
- .write(`${i.dim('Tip:')} Generate directly with ${i.cyan('tein run <model-slug> --prompt "..."')}
11435
+ .write(`${a.dim('Tip:')} Generate directly with ${a.cyan('tein run <model-slug> --prompt "..."')}
11272
11436
 
11273
11437
  `));
11274
11438
  }
11275
- async function Hr(e, t) {
11439
+ async function Zr(e, t) {
11276
11440
  let r = G(e);
11277
11441
  r ||
11278
- (process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
11442
+ (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
11279
11443
  `),
11280
- process.stderr.write(`Run ${i.cyan('tein models')} to see all available model slugs.
11444
+ process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
11281
11445
  `),
11282
11446
  process.exit(1));
11283
- let a = await Br(t);
11447
+ let i = await Yr(t);
11284
11448
  (process.stdout.write(`
11285
- ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
11449
+ ${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
11286
11450
  `),
11287
- process.stdout.write(` ${i.gray(r.description)}
11451
+ process.stdout.write(` ${a.gray(r.description)}
11288
11452
 
11289
11453
  `),
11290
- process.stdout.write(`${i.bold('Metadata:')}
11454
+ process.stdout.write(`${a.bold('Metadata:')}
11291
11455
  `),
11292
- process.stdout.write(` Category: ${i.yellow(r.category)}
11456
+ process.stdout.write(` Category: ${a.yellow(r.category)}
11293
11457
  `),
11294
11458
  process.stdout.write(` Kind: ${r.kind}
11295
11459
  `),
11296
11460
  process.stdout.write(` Vendor: ${r.vendor}
11297
11461
  `),
11298
- process.stdout.write(` Pricing: ${i.green(r.priceFormatted)}
11462
+ process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
11299
11463
  `));
11300
11464
  for (let n of r.priceNotes ?? [])
11301
- process.stdout.write(` ${i.dim(n)}
11465
+ process.stdout.write(` ${a.dim(n)}
11302
11466
  `);
11303
- for (let n of jr(r.slug, a.yourPrices)) {
11467
+ for (let n of Xr(r.slug, i.yourPrices)) {
11304
11468
  let s = n.slug === r.slug ? n : { ...n, label: `${n.name} \xB7 ${n.label}` };
11305
- process.stdout.write(` ${i.yellow('Your price:')} ${pt(s)}
11469
+ process.stdout.write(` ${a.yellow('Your price:')} ${ut(s)}
11306
11470
  `);
11307
11471
  }
11308
- (a.live ||
11309
- process.stdout.write(` ${i.dim('(the price this CLI was built with: offline)')}
11472
+ (i.live ||
11473
+ process.stdout.write(` ${a.dim('(the price this CLI was built with: offline)')}
11310
11474
  `),
11311
11475
  process.stdout.write(`
11312
11476
  `),
11313
- process.stdout.write(`${i.bold('Parameters:')}
11477
+ process.stdout.write(`${a.bold('Parameters:')}
11314
11478
  `));
11315
11479
  for (let n of r.parameters) {
11316
- let s = n.required ? i.red('(required)') : i.dim('(optional)'),
11317
- o = n.default !== void 0 ? i.dim(` [default: ${n.default}]`) : '';
11480
+ let s = n.required ? a.red('(required)') : a.dim('(optional)'),
11481
+ o = n.default !== void 0 ? a.dim(` [default: ${n.default}]`) : '';
11318
11482
  (process.stdout
11319
- .write(` ${i.bold(`--${n.name.replace(/_/g, '-')}`)} ${i.yellow(`<${n.type}>`)} ${s}${o}
11483
+ .write(` ${a.bold(`--${n.name.replace(/_/g, '-')}`)} ${a.yellow(`<${n.type}>`)} ${s}${o}
11320
11484
  `),
11321
11485
  n.description &&
11322
- process.stdout.write(` ${i.gray(n.description)}
11486
+ process.stdout.write(` ${a.gray(n.description)}
11323
11487
  `),
11324
11488
  n.options &&
11325
11489
  n.options.length > 0 &&
11326
- process.stdout.write(` Allowed values: ${i.dim(n.options.join(', '))}
11490
+ process.stdout.write(` Allowed values: ${a.dim(n.options.join(', '))}
11327
11491
  `),
11328
11492
  (n.min !== void 0 || n.max !== void 0) &&
11329
11493
  process.stdout.write(` Range: ${n.min ?? ''} to ${n.max ?? ''}
@@ -11334,70 +11498,70 @@ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
11334
11498
  if (
11335
11499
  (r.parameters.some((n) => n.name === 'callback_url') ||
11336
11500
  (process.stdout
11337
- .write(` ${i.bold('--callback-url')} ${i.yellow('<string>')} ${i.dim('(optional)')}
11501
+ .write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
11338
11502
  `),
11339
11503
  process.stdout
11340
- .write(` ${i.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
11504
+ .write(` ${a.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
11341
11505
 
11342
11506
  `)),
11343
- process.stdout.write(`${i.bold('Sample CLI Usage:')}
11507
+ process.stdout.write(`${a.bold('Sample CLI Usage:')}
11344
11508
  `),
11345
11509
  r.category === 'Video')
11346
11510
  )
11347
11511
  process.stdout
11348
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
11512
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
11349
11513
 
11350
11514
  `);
11351
11515
  else if (r.category === 'Image') {
11352
11516
  let n = r.parameters.some((s) => s.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
11353
11517
  process.stdout
11354
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${n} -o output.png`)}
11518
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${n} -o output.png`)}
11355
11519
 
11356
11520
  `);
11357
11521
  } else
11358
11522
  r.category === 'Audio'
11359
11523
  ? process.stdout
11360
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
11524
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
11361
11525
 
11362
11526
  `)
11363
11527
  : process.stdout
11364
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
11528
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
11365
11529
 
11366
11530
  `);
11367
11531
  }
11368
- var zr = M(require('node:path'));
11369
- A();
11370
- async function Wr(e, t) {
11532
+ var ei = M(require('node:path'));
11533
+ R();
11534
+ async function ti(e, t) {
11371
11535
  let r = _(typeof t.api_key == 'string' ? t.api_key : void 0),
11372
- a = x(typeof t.api_url == 'string' ? t.api_url : void 0);
11536
+ i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
11373
11537
  (r ||
11374
- (process.stderr.write(`${i.red('Error:')} Authentication required.
11538
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
11375
11539
  `),
11376
11540
  process.stderr
11377
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
11541
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
11378
11542
  `),
11379
11543
  process.exit(1)),
11380
11544
  e ||
11381
- (process.stderr.write(`${i.red('Error:')} Missing request ID.
11545
+ (process.stderr.write(`${a.red('Error:')} Missing request ID.
11382
11546
  `),
11383
- process.stderr.write(`Usage: ${i.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
11547
+ process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
11384
11548
  `),
11385
11549
  process.exit(1)));
11386
11550
  let n = !!t.json,
11387
11551
  s = !!t.wait,
11388
11552
  o = typeof t.output == 'string' ? t.output : void 0,
11389
- d = new S(r, a),
11390
- l = new $(`Checking status of ${i.bold(e)}...`);
11553
+ p = new K(r, i),
11554
+ l = new $(`Checking status of ${a.bold(e)}...`);
11391
11555
  n || l.start();
11392
11556
  let c;
11393
11557
  try {
11394
- c = await d.getStatus(e);
11395
- } catch (p) {
11396
- (p instanceof b &&
11558
+ c = await p.getStatus(e);
11559
+ } catch (d) {
11560
+ (d instanceof b &&
11397
11561
  (n
11398
11562
  ? process.stdout.write(
11399
11563
  JSON.stringify(
11400
- { error: { code: p.code ?? null, message: p.message, ...p.fields } },
11564
+ { error: { code: d.code ?? null, message: d.message, ...d.fields } },
11401
11565
  null,
11402
11566
  2,
11403
11567
  ) +
@@ -11405,21 +11569,21 @@ async function Wr(e, t) {
11405
11569
  `,
11406
11570
  )
11407
11571
  : l.fail(
11408
- K(p).join(`
11572
+ E(d).join(`
11409
11573
  `),
11410
11574
  ),
11411
- process.exit(p.exitCode)),
11412
- n || l.fail(p instanceof Error ? p.message : String(p)),
11575
+ process.exit(d.exitCode)),
11576
+ n || l.fail(d instanceof Error ? d.message : String(d)),
11413
11577
  process.exit(T));
11414
11578
  }
11415
11579
  if (s && c.status === 'processing') {
11416
- let p = Date.now();
11580
+ let d = Date.now();
11417
11581
  for (; c.status === 'processing';) {
11418
- let u = Math.round((Date.now() - p) / 1e3);
11419
- (n || l.update(`Waiting for ${i.bold(c.model)} (${u}s elapsed)...`),
11582
+ let u = Math.round((Date.now() - d) / 1e3);
11583
+ (n || l.update(`Waiting for ${a.bold(c.model)} (${u}s elapsed)...`),
11420
11584
  await new Promise((m) => setTimeout(m, 1500)));
11421
11585
  try {
11422
- c = await d.getStatus(e);
11586
+ c = await p.getStatus(e);
11423
11587
  } catch {}
11424
11588
  }
11425
11589
  }
@@ -11441,72 +11605,72 @@ async function Wr(e, t) {
11441
11605
  }
11442
11606
  if (
11443
11607
  (process.stdout.write(`
11444
- ${i.bold('Model:')} ${c.model}
11608
+ ${a.bold('Model:')} ${c.model}
11445
11609
  `),
11446
11610
  process.stdout
11447
- .write(` ${i.bold('Status:')} ${c.status === 'succeeded' ? i.green(c.status) : c.status === 'processing' ? i.yellow(c.status) : i.red(c.status)}
11611
+ .write(` ${a.bold('Status:')} ${c.status === 'succeeded' ? a.green(c.status) : c.status === 'processing' ? a.yellow(c.status) : a.red(c.status)}
11448
11612
  `),
11449
- process.stdout.write(` ${i.bold('Request ID:')} ${c.request_id}
11613
+ process.stdout.write(` ${a.bold('Request ID:')} ${c.request_id}
11450
11614
  `),
11451
11615
  c.output && c.output.length > 0)
11452
11616
  ) {
11453
11617
  process.stdout.write(`
11454
- ${i.bold('Outputs:')}
11618
+ ${a.bold('Outputs:')}
11455
11619
  `);
11456
- for (let p of c.output)
11457
- if (p.url) {
11620
+ for (let d of c.output)
11621
+ if (d.url) {
11458
11622
  if (
11459
- (process.stdout.write(` [${p.type.toUpperCase()}] ${i.cyan(i.underline(p.url))}
11623
+ (process.stdout.write(` [${d.type.toUpperCase()}] ${a.cyan(a.underline(d.url))}
11460
11624
  `),
11461
11625
  o)
11462
11626
  ) {
11463
11627
  let u = new $(`Downloading output to ${o}...`).start();
11464
11628
  try {
11465
- (await d.downloadOutput(p.url, zr.default.resolve(process.cwd(), o)),
11466
- u.succeed(`Saved to ${i.bold(o)}`));
11629
+ (await p.downloadOutput(d.url, ei.default.resolve(process.cwd(), o)),
11630
+ u.succeed(`Saved to ${a.bold(o)}`));
11467
11631
  } catch (m) {
11468
11632
  u.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
11469
11633
  }
11470
11634
  }
11471
11635
  } else
11472
- p.text &&
11636
+ d.text &&
11473
11637
  process.stdout.write(`
11474
- ${p.text}
11638
+ ${d.text}
11475
11639
  `);
11476
11640
  }
11477
11641
  process.stdout.write(`
11478
11642
  `);
11479
11643
  }
11480
- var ut = M(require('node:fs')),
11481
- mt = M(require('node:path'));
11482
- A();
11483
- async function Jr(e, t = {}) {
11644
+ var ft = M(require('node:fs')),
11645
+ gt = M(require('node:path'));
11646
+ R();
11647
+ async function ri(e, t = {}) {
11484
11648
  let r = _(typeof t.api_key == 'string' ? t.api_key : void 0),
11485
- a = x(typeof t.api_url == 'string' ? t.api_url : void 0),
11649
+ i = x(typeof t.api_url == 'string' ? t.api_url : void 0),
11486
11650
  n = !!t.json;
11487
11651
  (r ||
11488
- (process.stderr.write(`${i.red('Error:')} Authentication required.
11652
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
11489
11653
  `),
11490
11654
  process.stderr
11491
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
11655
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
11492
11656
  `),
11493
11657
  process.exit(1)),
11494
11658
  e ||
11495
- (process.stderr.write(`${i.red('Error:')} Missing file path.
11659
+ (process.stderr.write(`${a.red('Error:')} Missing file path.
11496
11660
  `),
11497
- process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
11661
+ process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
11498
11662
  `),
11499
11663
  process.exit(1)));
11500
- let s = mt.default.resolve(e);
11501
- ut.default.existsSync(s) ||
11502
- (process.stderr.write(`${i.red('Error:')} File not found: ${s}
11664
+ let s = gt.default.resolve(e);
11665
+ ft.default.existsSync(s) ||
11666
+ (process.stderr.write(`${a.red('Error:')} File not found: ${s}
11503
11667
  `),
11504
11668
  process.exit(1));
11505
- let o = mt.default.basename(s),
11506
- l = ut.default.readFileSync(s).toString('base64'),
11507
- c = new S(r, a),
11508
- p = new $(`Uploading ${i.bold(o)} to Tein AI CDN...`);
11509
- n || p.start();
11669
+ let o = gt.default.basename(s),
11670
+ l = ft.default.readFileSync(s).toString('base64'),
11671
+ c = new K(r, i),
11672
+ d = new $(`Uploading ${a.bold(o)} to Tein AI CDN...`);
11673
+ n || d.start();
11510
11674
  try {
11511
11675
  let u = await c.uploadAsset(l);
11512
11676
  n
@@ -11515,21 +11679,21 @@ async function Jr(e, t = {}) {
11515
11679
  `
11516
11680
  `,
11517
11681
  )
11518
- : (p.succeed('Upload successful!'),
11682
+ : (d.succeed('Upload successful!'),
11519
11683
  process.stdout.write(`
11520
- ${i.bold('CDN URL:')} ${i.green(u.url)}
11684
+ ${a.bold('CDN URL:')} ${a.green(u.url)}
11521
11685
  `),
11522
- process.stdout.write(`${i.dim(`Key: ${u.key}`)}
11686
+ process.stdout.write(`${a.dim(`Key: ${u.key}`)}
11523
11687
 
11524
11688
  `),
11525
11689
  process.stdout.write(`Use this CDN URL directly in your CLI runs:
11526
- ${i.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${u.url}"`)}
11690
+ ${a.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${u.url}"`)}
11527
11691
 
11528
11692
  `));
11529
11693
  } catch (u) {
11530
11694
  let m = u instanceof b ? u : null,
11531
11695
  g = m
11532
- ? K(m).join(`
11696
+ ? E(m).join(`
11533
11697
  `)
11534
11698
  : u instanceof Error
11535
11699
  ? u.message
@@ -11540,100 +11704,100 @@ ${i.bold('CDN URL:')} ${i.green(u.url)}
11540
11704
  `
11541
11705
  `,
11542
11706
  )
11543
- : p.fail(`Upload failed: ${g}`),
11707
+ : d.fail(`Upload failed: ${g}`),
11544
11708
  process.exit(m ? m.exitCode : T));
11545
11709
  }
11546
11710
  }
11547
11711
  oe();
11548
11712
  ie();
11549
- Fe();
11550
- function ui() {
11713
+ Be();
11714
+ function bi() {
11551
11715
  process.stdout.write(`
11552
- ${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
11716
+ ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
11553
11717
 
11554
- ${i.bold('USAGE:')}
11555
- ${i.cyan('tein')} <command> [arguments] [options]
11718
+ ${a.bold('USAGE:')}
11719
+ ${a.cyan('tein')} <command> [arguments] [options]
11556
11720
 
11557
- ${i.bold('COMMANDS:')}
11558
- ${i.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
11559
- ${i.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
11560
- ${i.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
11561
- ${i.bold('info')} <model-slug> View parameter schemas, pricing, and options
11562
- ${i.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
11563
- ${i.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
11564
- ${i.bold('status')} <request-id> [options] Check generation progress and retrieve output files
11565
- ${i.bold('balance')} [--json] Workspace balance, this key's limit and usage
11566
- ${i.bold('usage')} [options] [--json] Spend by model, channel, key and time (Usage page)
11567
- ${i.bold('transactions')} [options] [--json] Balance history: top ups, charges, refunds (alias: history)
11568
- ${i.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
11569
- ${i.bold('--version')}, ${i.bold('-v')} Print the installed CLI version
11721
+ ${a.bold('COMMANDS:')}
11722
+ ${a.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
11723
+ ${a.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
11724
+ ${a.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
11725
+ ${a.bold('info')} <model-slug> View parameter schemas, pricing, and options
11726
+ ${a.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
11727
+ ${a.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
11728
+ ${a.bold('status')} <request-id> [options] Check generation progress and retrieve output files
11729
+ ${a.bold('balance')} [--json] Workspace balance, this key's limit and usage
11730
+ ${a.bold('usage')} [options] [--json] Spend by model, channel, key and time (Usage page)
11731
+ ${a.bold('transactions')} [options] [--json] Balance history: top ups, charges, refunds (alias: history)
11732
+ ${a.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
11733
+ ${a.bold('--version')}, ${a.bold('-v')} Print the installed CLI version
11570
11734
 
11571
- ${i.bold('ACCOUNT OPTIONS (read only, nothing is charged; the same JSON as GET /v1/balance, /v1/usage, /v1/balance/transactions):')}
11572
- ${i.cyan('--range')} hour|day|week|month|custom tein usage: the row size, over a fixed period ending now:
11735
+ ${a.bold('ACCOUNT OPTIONS (read only, nothing is charged; the same JSON as GET /v1/balance, /v1/usage, /v1/balance/transactions):')}
11736
+ ${a.cyan('--range')} hour|day|week|month|custom tein usage: the row size, over a fixed period ending now:
11573
11737
  hour = last 24 h, day = last 30 days (default),
11574
11738
  week = last 12 weeks, month = last 12 months
11575
- ${i.cyan('--from, --to')} <YYYY-MM-DD> tein usage --range custom: first and last day (UTC), at most 366 days
11576
- ${i.cyan('--model')} <model-id> tein usage: only this model
11577
- ${i.cyan('--channel')} website|api|mcp|cli tein usage: only runs started there
11578
- ${i.cyan('--limit')} <1-100> tein transactions: rows per page (default 50)
11579
- ${i.cyan('--type')} <types> tein transactions: e.g. usage,refund or topup,auto_topup
11580
- ${i.cyan('--after')} <cursor> tein transactions: the next page (printed under each page)
11581
- ${i.cyan('--json')} Print the API's JSON as is
11739
+ ${a.cyan('--from, --to')} <YYYY-MM-DD> tein usage --range custom: first and last day (UTC), at most 366 days
11740
+ ${a.cyan('--model')} <model-id> tein usage: only this model
11741
+ ${a.cyan('--channel')} website|api|mcp|cli tein usage: only runs started there
11742
+ ${a.cyan('--limit')} <1-100> tein transactions: rows per page (default 50)
11743
+ ${a.cyan('--type')} <types> tein transactions: e.g. usage,refund or topup,auto_topup
11744
+ ${a.cyan('--after')} <cursor> tein transactions: the next page (printed under each page)
11745
+ ${a.cyan('--json')} Print the API's JSON as is
11582
11746
 
11583
- ${i.bold('GENERATION OPTIONS (for `tein run`):')}
11584
- ${i.cyan('-p, --prompt')} <text> Text prompt for generation ${i.red('(required)')}
11585
- ${i.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
11586
- ${i.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
11587
- ${i.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
11588
- ${i.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
11589
- ${i.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
11590
- ${i.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
11591
- ${i.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
11592
- ${i.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
11593
- ${i.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
11594
- ${i.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
11595
- ${i.cyan('--async, --no-wait')} Queue task and return request ID immediately
11596
- ${i.cyan('--json')} Output response in raw JSON format
11597
- ${i.cyan('--api-key')} <key> Override API key for this request
11747
+ ${a.bold('GENERATION OPTIONS (for `tein run`):')}
11748
+ ${a.cyan('-p, --prompt')} <text> Text prompt for generation ${a.red('(required)')}
11749
+ ${a.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
11750
+ ${a.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
11751
+ ${a.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
11752
+ ${a.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
11753
+ ${a.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
11754
+ ${a.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
11755
+ ${a.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
11756
+ ${a.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
11757
+ ${a.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
11758
+ ${a.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
11759
+ ${a.cyan('--async, --no-wait')} Queue task and return request ID immediately
11760
+ ${a.cyan('--json')} Output response in raw JSON format
11761
+ ${a.cyan('--api-key')} <key> Override API key for this request
11598
11762
 
11599
- ${i.bold('EXAMPLES:')}
11600
- ${i.dim('# 1. Authenticate with your Tein API key')}
11601
- ${i.cyan('tein auth login')}
11763
+ ${a.bold('EXAMPLES:')}
11764
+ ${a.dim('# 1. Authenticate with your Tein API key')}
11765
+ ${a.cyan('tein auth login')}
11602
11766
 
11603
- ${i.dim('# 2. List all Video models')}
11604
- ${i.cyan('tein models video')}
11767
+ ${a.dim('# 2. List all Video models')}
11768
+ ${a.cyan('tein models video')}
11605
11769
 
11606
- ${i.dim('# 3. Every published price, or one model as JSON')}
11607
- ${i.cyan('tein pricing')}
11608
- ${i.cyan('tein pricing seedance-2-5 --json')}
11770
+ ${a.dim('# 3. Every published price, or one model as JSON')}
11771
+ ${a.cyan('tein pricing')}
11772
+ ${a.cyan('tein pricing seedance-2-5 --json')}
11609
11773
 
11610
- ${i.dim('# 4. Generate a high-quality 2K image and download it')}
11611
- ${i.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
11774
+ ${a.dim('# 4. Generate a high-quality 2K image and download it')}
11775
+ ${a.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
11612
11776
 
11613
- ${i.dim('# 5. Generate a video using Seedance 2.5 with audio')}
11614
- ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
11615
- ${i.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
11616
- ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
11777
+ ${a.dim('# 5. Generate a video using Seedance 2.5 with audio')}
11778
+ ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
11779
+ ${a.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
11780
+ ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
11617
11781
 
11618
- ${i.dim('# 6. Generate speech with Seed Audio 1.0')}
11619
- ${i.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
11782
+ ${a.dim('# 6. Generate speech with Seed Audio 1.0')}
11783
+ ${a.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
11620
11784
 
11621
- ${i.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
11622
- ${i.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
11785
+ ${a.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
11786
+ ${a.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
11623
11787
 
11624
- ${i.dim('# 8. Balance, API usage week by week, a custom period as JSON, the latest charges')}
11625
- ${i.cyan('tein balance')}
11626
- ${i.cyan('tein usage --range week --channel api')}
11627
- ${i.cyan('tein usage --range custom --from 2026-11-01 --to 2026-11-19 --json')}
11628
- ${i.cyan('tein transactions --limit 20 --type usage,refund')}
11788
+ ${a.dim('# 8. Balance, API usage week by week, a custom period as JSON, the latest charges')}
11789
+ ${a.cyan('tein balance')}
11790
+ ${a.cyan('tein usage --range week --channel api')}
11791
+ ${a.cyan('tein usage --range custom --from 2026-11-01 --to 2026-11-19 --json')}
11792
+ ${a.cyan('tein transactions --limit 20 --type usage,refund')}
11629
11793
 
11630
11794
  `);
11631
11795
  }
11632
- async function _n() {
11796
+ async function En() {
11633
11797
  let e = process.argv.slice(2),
11634
- t = $r(e);
11798
+ t = Dr(e);
11635
11799
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
11636
- ui();
11800
+ bi();
11637
11801
  return;
11638
11802
  }
11639
11803
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -11660,15 +11824,15 @@ async function _n() {
11660
11824
  }
11661
11825
  case 'models':
11662
11826
  case 'list': {
11663
- await Gr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11827
+ await Qr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
11664
11828
  break;
11665
11829
  }
11666
11830
  case 'pricing':
11667
11831
  case 'prices': {
11668
11832
  let r = t.options.model,
11669
- a = t.subcommand || (typeof r == 'string' ? r : void 0);
11670
- await Fr({
11671
- model: a,
11833
+ i = t.subcommand || (typeof r == 'string' ? r : void 0);
11834
+ await Jr({
11835
+ model: i,
11672
11836
  json: !!t.options.json,
11673
11837
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
11674
11838
  });
@@ -11677,45 +11841,45 @@ async function _n() {
11677
11841
  case 'info':
11678
11842
  case 'show': {
11679
11843
  (t.subcommand ||
11680
- (process.stderr.write(`${i.red('Error:')} Missing model slug.
11844
+ (process.stderr.write(`${a.red('Error:')} Missing model slug.
11681
11845
  `),
11682
- process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
11846
+ process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
11683
11847
  `),
11684
11848
  process.exit(1)),
11685
- await Hr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11849
+ await Zr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
11686
11850
  break;
11687
11851
  }
11688
11852
  case 'upload': {
11689
11853
  let r = t.subcommand || '';
11690
- await Jr(r, t.options);
11854
+ await ri(r, t.options);
11691
11855
  break;
11692
11856
  }
11693
11857
  case 'run':
11694
11858
  case 'generate': {
11695
11859
  let r = t.subcommand || '';
11696
- await ot(r, t.options);
11860
+ await pt(r, t.options);
11697
11861
  break;
11698
11862
  }
11699
11863
  case 'status': {
11700
11864
  let r = t.subcommand || '';
11701
- await Wr(r, t.options);
11865
+ await ti(r, t.options);
11702
11866
  break;
11703
11867
  }
11704
11868
  case 'balance': {
11705
- await Rr(t.options);
11869
+ await Ur(t.options);
11706
11870
  break;
11707
11871
  }
11708
11872
  case 'usage': {
11709
- await Dr(t.options);
11873
+ await Gr(t.options);
11710
11874
  break;
11711
11875
  }
11712
11876
  case 'transactions':
11713
11877
  case 'history': {
11714
- await Nr(t.options);
11878
+ await Hr(t.options);
11715
11879
  break;
11716
11880
  }
11717
11881
  case 'mcp': {
11718
- let { startStdioServer: r } = await Promise.resolve().then(() => (ci(), pi));
11882
+ let { startStdioServer: r } = await Promise.resolve().then(() => (yi(), hi));
11719
11883
  await r();
11720
11884
  break;
11721
11885
  }
@@ -11724,27 +11888,27 @@ async function _n() {
11724
11888
  (!G(t.command) &&
11725
11889
  !be[t.command] &&
11726
11890
  (process.stderr.write(`
11727
- ${i.red('Error:')} Unknown command or model "${t.command}".
11728
- Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
11891
+ ${a.red('Error:')} Unknown command or model "${t.command}".
11892
+ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
11729
11893
  `),
11730
11894
  process.exit(T)),
11731
- await ot(t.command, t.options));
11895
+ await pt(t.command, t.options));
11732
11896
  return;
11733
11897
  }
11734
- ui();
11898
+ bi();
11735
11899
  break;
11736
11900
  }
11737
11901
  }
11738
11902
  }
11739
- _n().catch((e) => {
11903
+ En().catch((e) => {
11740
11904
  (e instanceof b &&
11741
11905
  (process.stderr.write(`
11742
- ${i.red('Error:')} ${K(e).join(`
11906
+ ${a.red('Error:')} ${E(e).join(`
11743
11907
  `)}
11744
11908
  `),
11745
11909
  process.exit(e.exitCode)),
11746
11910
  process.stderr.write(`
11747
- ${i.red('Fatal error:')} ${e instanceof Error ? e.message : e}
11911
+ ${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
11748
11912
  `),
11749
11913
  process.exit(T));
11750
11914
  });