@teinai/cli 1.1.19 → 1.1.21

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 +1532 -1008
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,109 +1,109 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var ir = Object.create;
4
- var he = Object.defineProperty;
5
- var ar = Object.getOwnPropertyDescriptor;
6
- var sr = Object.getOwnPropertyNames;
7
- var nr = Object.getPrototypeOf,
8
- or = Object.prototype.hasOwnProperty;
9
- var b = (e, t, r) => () => {
3
+ var or = Object.create;
4
+ var be = Object.defineProperty;
5
+ var lr = Object.getOwnPropertyDescriptor;
6
+ var pr = Object.getOwnPropertyNames;
7
+ var dr = Object.getPrototypeOf,
8
+ cr = Object.prototype.hasOwnProperty;
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 (i) {
14
- throw ((r = [i]), i);
13
+ } catch (a) {
14
+ throw ((r = [a]), a);
15
15
  }
16
16
  };
17
- var lr = (e, t) => {
18
- for (var r in t) he(e, r, { get: t[r], enumerable: !0 });
17
+ var ur = (e, t) => {
18
+ for (var r in t) be(e, r, { get: t[r], enumerable: !0 });
19
19
  },
20
- pr = (e, t, r, i) => {
20
+ mr = (e, t, r, a) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let s of sr(t))
23
- !or.call(e, s) &&
24
- s !== r &&
25
- he(e, s, { get: () => t[s], enumerable: !(i = ar(t, s)) || i.enumerable });
22
+ for (let n of pr(t))
23
+ !cr.call(e, n) &&
24
+ n !== r &&
25
+ be(e, n, { get: () => t[n], enumerable: !(a = lr(t, n)) || a.enumerable });
26
26
  return e;
27
27
  };
28
- var P = (e, t, r) => (
29
- (r = e != null ? ir(nr(e)) : {}),
30
- pr(t || !e || !e.__esModule ? he(r, 'default', { value: e, enumerable: !0 }) : r, e)
28
+ var _ = (e, t, r) => (
29
+ (r = e != null ? or(dr(e)) : {}),
30
+ mr(t || !e || !e.__esModule ? be(r, 'default', { value: e, enumerable: !0 }) : r, e)
31
31
  );
32
- function V() {
32
+ function U() {
33
33
  try {
34
- if ($.default.existsSync(L)) {
35
- let e = $.default.readFileSync(L, 'utf-8');
34
+ if (E.default.existsSync(N)) {
35
+ let e = E.default.readFileSync(N, 'utf-8');
36
36
  return JSON.parse(e);
37
37
  }
38
38
  } catch {}
39
39
  return {};
40
40
  }
41
- function be(e) {
41
+ function we(e) {
42
42
  try {
43
- $.default.existsSync(te) || $.default.mkdirSync(te, { recursive: !0, mode: 448 });
44
- let r = { ...V(), ...e };
45
- ($.default.writeFileSync(L, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
46
- $.default.chmodSync(te, 448),
47
- $.default.chmodSync(L, 384));
43
+ E.default.existsSync(te) || E.default.mkdirSync(te, { recursive: !0, mode: 448 });
44
+ let r = { ...U(), ...e };
45
+ (E.default.writeFileSync(N, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
46
+ E.default.chmodSync(te, 448),
47
+ E.default.chmodSync(N, 384));
48
48
  } catch (t) {
49
- throw new Error(`Failed to save config to ${L}: ${t}`);
49
+ throw new Error(`Failed to save config to ${N}: ${t}`);
50
50
  }
51
51
  }
52
- function S(e) {
52
+ function q(e) {
53
53
  if (e && e.trim()) return e.trim();
54
54
  let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
55
55
  if (t && t.trim()) return t.trim();
56
- let r = V();
56
+ let r = U();
57
57
  return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
58
58
  }
59
- function x(e) {
59
+ function P(e) {
60
60
  if (e && e.trim()) return e.trim().replace(/\/+$/, '');
61
61
  let t = process.env.TEIN_API_URL;
62
62
  if (t && t.trim()) return t.trim().replace(/\/+$/, '');
63
- let r = V();
63
+ let r = U();
64
64
  return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
65
65
  }
66
66
  function re() {
67
- return L;
67
+ return N;
68
68
  }
69
- var $,
70
- Qe,
71
- ye,
69
+ var E,
70
+ tt,
71
+ ke,
72
72
  te,
73
- L,
74
- C = b(() => {
73
+ N,
74
+ A = y(() => {
75
75
  'use strict';
76
- (($ = P(require('node:fs'))),
77
- (Qe = P(require('node:os'))),
78
- (ye = P(require('node:path'))),
79
- (te = ye.default.join(Qe.default.homedir(), '.tein')),
80
- (L = ye.default.join(te, 'config.json')));
76
+ ((E = _(require('node:fs'))),
77
+ (tt = _(require('node:os'))),
78
+ (ke = _(require('node:path'))),
79
+ (te = ke.default.join(tt.default.homedir(), '.tein')),
80
+ (N = ke.default.join(te, 'config.json')));
81
81
  });
82
- var gr,
83
- Xe,
84
- Ze,
85
- et = b(() => {
82
+ var kr,
83
+ rt,
84
+ at,
85
+ it = y(() => {
86
86
  'use strict';
87
- ((gr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
- (Xe = [...gr, 'auto']),
89
- (Ze =
87
+ ((kr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (rt = [...kr, 'auto']),
89
+ (at =
90
90
  '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.'));
91
91
  });
92
- var j,
93
- we = b(() => {
92
+ var G,
93
+ Ie = y(() => {
94
94
  'use strict';
95
- j = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
95
+ G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
96
96
  });
97
- function ie(e) {
97
+ function ae(e) {
98
98
  return !1;
99
99
  }
100
- var tt = b(() => {
100
+ var nt = y(() => {
101
101
  'use strict';
102
102
  });
103
- var ae,
104
- rt = b(() => {
103
+ var ie,
104
+ st = y(() => {
105
105
  'use strict';
106
- ae = {
106
+ ie = {
107
107
  source: 'TEIN Price Board',
108
108
  checked: '17 Sep 2026',
109
109
  generated: '2026-10-01',
@@ -134,12 +134,17 @@ var ae,
134
134
  'seedance-2-mini',
135
135
  ],
136
136
  },
137
- { slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro'] },
137
+ { slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro', 'seedream-5-5'] },
138
138
  { slug: 'seed', name: 'Seed', models: ['seed-audio-1-0', 'seed-2-1-turbo'] },
139
139
  { slug: 'wan', name: 'Wan', models: ['wan-3-0', 'wan-3-0-prime'] },
140
140
  { slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
141
141
  { slug: 'minimax', name: 'Hailuo', models: ['minimax-h3', 'minimax-h3-turbo'] },
142
142
  { slug: 'qwen', name: 'Qwen', models: ['qwen-3', 'qwen-3-pro'] },
143
+ {
144
+ slug: 'enhancor-skin-fix',
145
+ name: 'Enhancor Skin Fix',
146
+ models: ['enhancor-skin-fix-v4', 'enhancor-skin-fix-v3', 'enhancor-skin-fix-v1'],
147
+ },
143
148
  { slug: 'z-image', name: 'Z Image', models: ['z-image-pro'] },
144
149
  {
145
150
  slug: 'nano-banana',
@@ -1256,6 +1261,53 @@ var ae,
1256
1261
  axes: { resolution: ['1K', '2K'] },
1257
1262
  from: { variant: '1k' },
1258
1263
  },
1264
+ {
1265
+ slug: 'seedream-5-5',
1266
+ name: 'Seedream 5.5',
1267
+ family: 'seedream',
1268
+ vendor: 'ByteDance',
1269
+ desc: "ByteDance's newest image model: sharper realism and steadier multi-turn edits than 5.0 Pro, native transparent PNGs, and layer decomposition into a base image and up to 99 editable layers with typeset-text recognition. Creative mode available. Every input image is billed.",
1270
+ kind: 'image',
1271
+ unit: '/img',
1272
+ api: { model: 'seedream-5-5' },
1273
+ variants: [
1274
+ {
1275
+ id: '1k',
1276
+ price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
1277
+ label: '1K',
1278
+ resolution: '1K',
1279
+ unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
1280
+ },
1281
+ {
1282
+ id: '1.5k',
1283
+ price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
1284
+ label: '1.5K',
1285
+ resolution: '1.5K',
1286
+ unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
1287
+ },
1288
+ {
1289
+ id: '2k',
1290
+ price: { starter: 0.021, plus: 0.0199, scale: 0.0178 },
1291
+ label: '2K',
1292
+ resolution: '2K',
1293
+ unfiltered: { starter: 0.022, plus: 0.0208, scale: 0.0186 },
1294
+ },
1295
+ ],
1296
+ unfiltered: 0.05,
1297
+ priority: null,
1298
+ draft: null,
1299
+ addons: [
1300
+ {
1301
+ id: 'image-input',
1302
+ price: { starter: 0.0048, plus: 0.0045, scale: 0.004 },
1303
+ label: 'Each input image',
1304
+ unit: '/input image',
1305
+ unfiltered: { starter: 0.005, plus: 0.0047, scale: 0.0042 },
1306
+ },
1307
+ ],
1308
+ axes: { resolution: ['1K', '1.5K', '2K'] },
1309
+ from: { variant: '1k' },
1310
+ },
1259
1311
  {
1260
1312
  slug: 'seed-audio-1-0',
1261
1313
  name: 'Seed Audio 1.0',
@@ -4615,6 +4667,13 @@ var ae,
4615
4667
  endpoint: 'cheap',
4616
4668
  component: 'cache_write',
4617
4669
  },
4670
+ {
4671
+ id: 'cheap-cache_write_1h',
4672
+ price: { starter: 7.6, plus: 7.22, scale: 6.8378 },
4673
+ label: 'Cache write (1 hour)',
4674
+ endpoint: 'cheap',
4675
+ component: 'cache_write_1h',
4676
+ },
4618
4677
  {
4619
4678
  id: 'stable-input',
4620
4679
  price: { starter: 3.88, plus: 3.63, scale: 3.4191 },
@@ -4643,6 +4702,13 @@ var ae,
4643
4702
  endpoint: 'stable',
4644
4703
  component: 'cache_write',
4645
4704
  },
4705
+ {
4706
+ id: 'stable-cache_write_1h',
4707
+ price: { starter: 7.76, plus: 7.26, scale: 6.8382 },
4708
+ label: 'Cache write (1 hour)',
4709
+ endpoint: 'stable',
4710
+ component: 'cache_write_1h',
4711
+ },
4646
4712
  ],
4647
4713
  unfiltered: null,
4648
4714
  priority: null,
@@ -4692,6 +4758,13 @@ var ae,
4692
4758
  endpoint: 'cheap',
4693
4759
  component: 'cache_write',
4694
4760
  },
4761
+ {
4762
+ id: 'cheap-cache_write_1h',
4763
+ price: { starter: 3.8, plus: 3.61, scale: 3.4178 },
4764
+ label: 'Cache write (1 hour)',
4765
+ endpoint: 'cheap',
4766
+ component: 'cache_write_1h',
4767
+ },
4695
4768
  {
4696
4769
  id: 'stable-input',
4697
4770
  price: { starter: 1.94, plus: 1.81, scale: 1.709 },
@@ -4720,6 +4793,13 @@ var ae,
4720
4793
  endpoint: 'stable',
4721
4794
  component: 'cache_write',
4722
4795
  },
4796
+ {
4797
+ id: 'stable-cache_write_1h',
4798
+ price: { starter: 3.88, plus: 3.62, scale: 3.418 },
4799
+ label: 'Cache write (1 hour)',
4800
+ endpoint: 'stable',
4801
+ component: 'cache_write_1h',
4802
+ },
4723
4803
  ],
4724
4804
  unfiltered: null,
4725
4805
  priority: null,
@@ -4769,6 +4849,13 @@ var ae,
4769
4849
  endpoint: 'cheap',
4770
4850
  component: 'cache_write',
4771
4851
  },
4852
+ {
4853
+ id: 'cheap-cache_write_1h',
4854
+ price: { starter: 1.615, plus: 1.5342, scale: 1.3728 },
4855
+ label: 'Cache write (1 hour)',
4856
+ endpoint: 'cheap',
4857
+ component: 'cache_write_1h',
4858
+ },
4772
4859
  {
4773
4860
  id: 'stable-input',
4774
4861
  price: { starter: 0.8245, plus: 0.772, scale: 0.7009 },
@@ -4797,6 +4884,13 @@ var ae,
4797
4884
  endpoint: 'stable',
4798
4885
  component: 'cache_write',
4799
4886
  },
4887
+ {
4888
+ id: 'stable-cache_write_1h',
4889
+ price: { starter: 1.649, plus: 1.544, scale: 1.4018 },
4890
+ label: 'Cache write (1 hour)',
4891
+ endpoint: 'stable',
4892
+ component: 'cache_write_1h',
4893
+ },
4800
4894
  ],
4801
4895
  unfiltered: null,
4802
4896
  priority: null,
@@ -4846,6 +4940,13 @@ var ae,
4846
4940
  endpoint: 'cheap',
4847
4941
  component: 'cache_write',
4848
4942
  },
4943
+ {
4944
+ id: 'cheap-cache_write_1h',
4945
+ price: { starter: 7.6, plus: 7.22, scale: 6.46 },
4946
+ label: 'Cache write (1 hour)',
4947
+ endpoint: 'cheap',
4948
+ component: 'cache_write_1h',
4949
+ },
4849
4950
  {
4850
4951
  id: 'stable-input',
4851
4952
  price: { starter: 3.88, plus: 3.63, scale: 3.4191 },
@@ -4874,6 +4975,13 @@ var ae,
4874
4975
  endpoint: 'stable',
4875
4976
  component: 'cache_write',
4876
4977
  },
4978
+ {
4979
+ id: 'stable-cache_write_1h',
4980
+ price: { starter: 7.76, plus: 7.26, scale: 6.8382 },
4981
+ label: 'Cache write (1 hour)',
4982
+ endpoint: 'stable',
4983
+ component: 'cache_write_1h',
4984
+ },
4877
4985
  ],
4878
4986
  unfiltered: null,
4879
4987
  priority: null,
@@ -4923,6 +5031,13 @@ var ae,
4923
5031
  endpoint: 'cheap',
4924
5032
  component: 'cache_write',
4925
5033
  },
5034
+ {
5035
+ id: 'cheap-cache_write_1h',
5036
+ price: { starter: 3.8, plus: 3.61, scale: 3.23 },
5037
+ label: 'Cache write (1 hour)',
5038
+ endpoint: 'cheap',
5039
+ component: 'cache_write_1h',
5040
+ },
4926
5041
  {
4927
5042
  id: 'stable-input',
4928
5043
  price: { starter: 1.94, plus: 1.81, scale: 1.709 },
@@ -4951,6 +5066,13 @@ var ae,
4951
5066
  endpoint: 'stable',
4952
5067
  component: 'cache_write',
4953
5068
  },
5069
+ {
5070
+ id: 'stable-cache_write_1h',
5071
+ price: { starter: 3.88, plus: 3.62, scale: 3.418 },
5072
+ label: 'Cache write (1 hour)',
5073
+ endpoint: 'stable',
5074
+ component: 'cache_write_1h',
5075
+ },
4954
5076
  ],
4955
5077
  unfiltered: null,
4956
5078
  priority: null,
@@ -5138,6 +5260,13 @@ var ae,
5138
5260
  endpoint: 'cheap',
5139
5261
  component: 'cache_write',
5140
5262
  },
5263
+ {
5264
+ id: 'cheap-cache_write_1h',
5265
+ price: { starter: 1.615, plus: 1.5342, scale: 1.3728 },
5266
+ label: 'Cache write (1 hour)',
5267
+ endpoint: 'cheap',
5268
+ component: 'cache_write_1h',
5269
+ },
5141
5270
  {
5142
5271
  id: 'stable-input',
5143
5272
  price: { starter: 0.8245, plus: 0.772, scale: 0.7009 },
@@ -5166,6 +5295,13 @@ var ae,
5166
5295
  endpoint: 'stable',
5167
5296
  component: 'cache_write',
5168
5297
  },
5298
+ {
5299
+ id: 'stable-cache_write_1h',
5300
+ price: { starter: 1.649, plus: 1.544, scale: 1.4018 },
5301
+ label: 'Cache write (1 hour)',
5302
+ endpoint: 'stable',
5303
+ component: 'cache_write_1h',
5304
+ },
5169
5305
  ],
5170
5306
  unfiltered: null,
5171
5307
  priority: null,
@@ -5552,15 +5688,166 @@ var ae,
5552
5688
  draft: null,
5553
5689
  from: { variant: 'char' },
5554
5690
  },
5691
+ {
5692
+ slug: 'enhancor-skin-fix-v4',
5693
+ name: 'Enhancor Skin Fix V4',
5694
+ family: 'enhancor-skin-fix',
5695
+ vendor: 'Enhancor',
5696
+ desc: 'Enhancor Skin Fix V4: realistic skin with visible pores, at 4K Base, 4K Fast or 8K Ultra.',
5697
+ kind: 'image',
5698
+ unit: '/run',
5699
+ api: { model: 'enhancor-skin-fix-v4' },
5700
+ variants: [
5701
+ { id: 'base', price: { starter: 0.141, plus: 0.141, scale: 0.141 }, label: '4K Base' },
5702
+ { id: 'fast', price: { starter: 0.198, plus: 0.198, scale: 0.198 }, label: '4K Fast' },
5703
+ {
5704
+ id: 'ultra',
5705
+ price: { starter: 1.18236, plus: 1.18236, scale: 1.18236 },
5706
+ label: '8K Ultra',
5707
+ },
5708
+ ],
5709
+ unfiltered: null,
5710
+ priority: null,
5711
+ draft: null,
5712
+ axes: {},
5713
+ from: { variant: 'base' },
5714
+ },
5715
+ {
5716
+ slug: 'enhancor-skin-fix-v3',
5717
+ name: 'Enhancor Skin Fix V3',
5718
+ family: 'enhancor-skin-fix',
5719
+ vendor: 'Enhancor',
5720
+ desc: 'Enhancor Skin Fix V3: high fidelity skin realism, with an optional mask to fix one area.',
5721
+ kind: 'image',
5722
+ unit: '/run',
5723
+ api: { model: 'enhancor-skin-fix-v3' },
5724
+ variants: [
5725
+ {
5726
+ id: 'no-mask',
5727
+ price: { starter: 0.141, plus: 0.141, scale: 0.141 },
5728
+ label: 'Whole image',
5729
+ },
5730
+ {
5731
+ id: 'mask',
5732
+ price: { starter: 0.6036, plus: 0.6036, scale: 0.6036 },
5733
+ label: 'With a mask',
5734
+ },
5735
+ ],
5736
+ unfiltered: null,
5737
+ priority: null,
5738
+ draft: null,
5739
+ axes: {},
5740
+ from: { variant: 'no-mask' },
5741
+ },
5742
+ {
5743
+ slug: 'enhancor-skin-fix-v1',
5744
+ name: 'Enhancor Skin Fix V1',
5745
+ family: 'enhancor-skin-fix',
5746
+ vendor: 'Enhancor',
5747
+ desc: 'Enhancor Skin Fix V1: the classic skin fix, Standard priced by image size or Heavy for a stronger fix.',
5748
+ kind: 'image',
5749
+ unit: '/run',
5750
+ api: { model: 'enhancor-skin-fix-v1' },
5751
+ variants: [
5752
+ {
5753
+ id: 'standard-under-1mp',
5754
+ price: { starter: 0.12, plus: 0.12, scale: 0.12 },
5755
+ label: 'Standard, under 1 MP',
5756
+ },
5757
+ {
5758
+ id: 'standard-under-2mp',
5759
+ price: { starter: 0.3, plus: 0.3, scale: 0.3 },
5760
+ label: 'Standard, under 2 MP',
5761
+ },
5762
+ {
5763
+ id: 'standard-under-3mp',
5764
+ price: { starter: 0.336, plus: 0.336, scale: 0.336 },
5765
+ label: 'Standard, under 3 MP',
5766
+ },
5767
+ {
5768
+ id: 'standard-under-4mp',
5769
+ price: { starter: 0.348, plus: 0.348, scale: 0.348 },
5770
+ label: 'Standard, under 4 MP',
5771
+ },
5772
+ {
5773
+ id: 'standard-under-5mp',
5774
+ price: { starter: 0.432, plus: 0.432, scale: 0.432 },
5775
+ label: 'Standard, under 5 MP',
5776
+ },
5777
+ {
5778
+ id: 'standard-under-6mp',
5779
+ price: { starter: 0.54, plus: 0.54, scale: 0.54 },
5780
+ label: 'Standard, under 6 MP',
5781
+ },
5782
+ {
5783
+ id: 'standard-under-7mp',
5784
+ price: { starter: 0.72, plus: 0.72, scale: 0.72 },
5785
+ label: 'Standard, under 7 MP',
5786
+ },
5787
+ {
5788
+ id: 'standard-under-8mp',
5789
+ price: { starter: 0.9, plus: 0.9, scale: 0.9 },
5790
+ label: 'Standard, under 8 MP',
5791
+ },
5792
+ {
5793
+ id: 'standard-under-9mp',
5794
+ price: { starter: 0.96, plus: 0.96, scale: 0.96 },
5795
+ label: 'Standard, under 9 MP',
5796
+ },
5797
+ {
5798
+ id: 'standard-under-10mp',
5799
+ price: { starter: 1.14, plus: 1.14, scale: 1.14 },
5800
+ label: 'Standard, under 10 MP',
5801
+ },
5802
+ {
5803
+ id: 'standard-under-11mp',
5804
+ price: { starter: 1.296, plus: 1.296, scale: 1.296 },
5805
+ label: 'Standard, under 11 MP',
5806
+ },
5807
+ {
5808
+ id: 'standard-under-12mp',
5809
+ price: { starter: 1.44, plus: 1.44, scale: 1.44 },
5810
+ label: 'Standard, under 12 MP',
5811
+ },
5812
+ {
5813
+ id: 'standard-under-13mp',
5814
+ price: { starter: 1.62, plus: 1.62, scale: 1.62 },
5815
+ label: 'Standard, under 13 MP',
5816
+ },
5817
+ {
5818
+ id: 'standard-13mp-plus',
5819
+ price: { starter: 1.8, plus: 1.8, scale: 1.8 },
5820
+ label: 'Standard, 13 MP and up',
5821
+ },
5822
+ {
5823
+ id: 'heavy',
5824
+ price: { starter: 0.216, plus: 0.216, scale: 0.216 },
5825
+ label: 'Heavy, base',
5826
+ },
5827
+ ],
5828
+ unfiltered: null,
5829
+ priority: null,
5830
+ draft: null,
5831
+ addons: [
5832
+ {
5833
+ id: 'heavy-megapixel',
5834
+ price: { starter: 0.114, plus: 0.114, scale: 0.114 },
5835
+ label: 'Heavy, each megapixel',
5836
+ unit: '/MP',
5837
+ },
5838
+ ],
5839
+ axes: {},
5840
+ from: { variant: 'standard-under-1mp' },
5841
+ },
5555
5842
  ],
5556
5843
  };
5557
5844
  });
5558
- var it,
5559
- se,
5560
- xe = b(() => {
5845
+ var ot,
5846
+ ne,
5847
+ Pe = y(() => {
5561
5848
  'use strict';
5562
- ((it = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
5563
- (se = [
5849
+ ((ot = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
5850
+ (ne = [
5564
5851
  {
5565
5852
  slug: 'tein-video-upscaler',
5566
5853
  name: 'Tein Video Upscaler',
@@ -5598,10 +5885,10 @@ var it,
5598
5885
  },
5599
5886
  ]));
5600
5887
  });
5601
- function _e(e, t) {
5888
+ function Ke(e, t) {
5602
5889
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
5603
5890
  }
5604
- function br(e, t) {
5891
+ function Ir(e, t) {
5605
5892
  if (e === 'seedance-2-mini') return 'mini';
5606
5893
  if (e !== 'seedance-2') return;
5607
5894
  let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -5611,86 +5898,86 @@ function br(e, t) {
5611
5898
  ? 'fast'
5612
5899
  : 'standard';
5613
5900
  }
5614
- function kr(e, t) {
5901
+ function Pr(e, t) {
5615
5902
  let r = e
5616
5903
  .trim()
5617
5904
  .toLowerCase()
5618
5905
  .replace(/-(?:unfiltered|uncensored)$/, '');
5619
5906
  if (r === 'seedance-2' || r === 'seedance-2-mini') {
5620
- let s = br(r, t),
5621
- n = Te.get(_e('seedance-2', s));
5622
- return n ? n.slug : null;
5907
+ let n = Ir(r, t),
5908
+ s = Te.get(Ke('seedance-2', n));
5909
+ return s ? s.slug : null;
5623
5910
  }
5624
- let i = ne.get(r) ?? Te.get(_e(r));
5625
- return i ? i.slug : null;
5911
+ let a = se.get(r) ?? Te.get(Ke(r));
5912
+ return a ? a.slug : null;
5626
5913
  }
5627
- function xr(e, t) {
5628
- return ne.has(e) && !(wr.has(e) && t) ? e : kr(e, t);
5914
+ function vr(e, t) {
5915
+ return se.has(e) && !(_r.has(e) && t) ? e : Pr(e, t);
5629
5916
  }
5630
- function G(e, t) {
5631
- let r = xr(e, t);
5632
- return r ? (ne.get(r) ?? null) : null;
5917
+ function z(e, t) {
5918
+ let r = vr(e, t);
5919
+ return r ? (se.get(r) ?? null) : null;
5633
5920
  }
5634
5921
  function oe() {
5635
- return st;
5922
+ return pt;
5636
5923
  }
5637
- var Ie,
5638
- Pe,
5639
- st,
5640
- hr,
5641
- ne,
5642
- Te,
5643
- at,
5644
- yr,
5924
+ var _e,
5645
5925
  ve,
5926
+ pt,
5646
5927
  wr,
5647
- N = b(() => {
5928
+ se,
5929
+ Te,
5930
+ lt,
5931
+ xr,
5932
+ Me,
5933
+ _r,
5934
+ B = y(() => {
5648
5935
  'use strict';
5649
- tt();
5650
- rt();
5651
- xe();
5652
- ((Ie = {
5653
- ...ae,
5654
- families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !ie(t)) })),
5655
- models: ae.models.filter((e) => !ie(e.slug)),
5936
+ nt();
5937
+ st();
5938
+ Pe();
5939
+ ((_e = {
5940
+ ...ie,
5941
+ families: ie.families.map((e) => ({ ...e, models: e.models.filter((t) => !ae(t)) })),
5942
+ models: ie.models.filter((e) => !ae(e.slug)),
5656
5943
  }),
5657
- (Pe = se.filter((e) => !ie(e.slug))),
5658
- (st = [...Ie.models, ...Pe]),
5659
- (hr = Pe.length ? [...Ie.families, { ...it, models: Pe.map((e) => e.slug) }] : Ie.families),
5660
- (ne = new Map()),
5944
+ (ve = ne.filter((e) => !ae(e.slug))),
5945
+ (pt = [..._e.models, ...ve]),
5946
+ (wr = ve.length ? [..._e.families, { ...ot, models: ve.map((e) => e.slug) }] : _e.families),
5947
+ (se = new Map()),
5661
5948
  (Te = new Map()),
5662
- (at = new Map()),
5663
- (yr = new Map()),
5664
- (ve = new Map()));
5665
- for (let e of st) {
5666
- (ne.set(e.slug, e), Te.set(_e(e.api.model, e.api.quality), e));
5667
- for (let t of e.variants) at.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
5949
+ (lt = new Map()),
5950
+ (xr = new Map()),
5951
+ (Me = new Map()));
5952
+ for (let e of pt) {
5953
+ (se.set(e.slug, e), Te.set(Ke(e.api.model, e.api.quality), e));
5954
+ for (let t of e.variants) lt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
5668
5955
  for (let t of e.editVariants ?? [])
5669
- at.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
5670
- for (let t of e.addons ?? []) yr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
5671
- ve.set(e.slug, e.family);
5956
+ lt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
5957
+ for (let t of e.addons ?? []) xr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
5958
+ Me.set(e.slug, e.family);
5672
5959
  }
5673
- for (let e of hr) for (let t of e.models) ve.has(t) || ve.set(t, e.slug);
5674
- wr = new Set(['seedance-2']);
5960
+ for (let e of wr) for (let t of e.models) Me.has(t) || Me.set(t, e.slug);
5961
+ _r = new Set(['seedance-2']);
5675
5962
  });
5676
5963
  function le(e) {
5677
5964
  let t = e.from?.variant;
5678
5965
  return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
5679
5966
  }
5680
- function Me(e) {
5967
+ function Se(e) {
5681
5968
  if (e.endpoints?.length)
5682
- return e.editVariants?.length && e.endpoints.some((t) => t.id === nt)
5683
- ? nt
5969
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === dt)
5970
+ ? dt
5684
5971
  : (e.defaultEndpoint ?? e.endpoints[0].id);
5685
5972
  }
5686
- var nt,
5687
- Ke = b(() => {
5973
+ var dt,
5974
+ qe = y(() => {
5688
5975
  'use strict';
5689
- N();
5690
- nt = 'dynamic';
5976
+ B();
5977
+ dt = 'dynamic';
5691
5978
  });
5692
5979
  var pe,
5693
- Se = b(() => {
5980
+ $e = y(() => {
5694
5981
  'use strict';
5695
5982
  pe = {
5696
5983
  'gemini-3-8-flash': 'gemini-3.8-flash',
@@ -5702,29 +5989,29 @@ var pe,
5702
5989
  'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
5703
5990
  };
5704
5991
  });
5705
- var ot = b(() => {
5992
+ var ct = y(() => {
5706
5993
  'use strict';
5707
5994
  });
5708
- function lt(e, t) {
5709
- return typeof t == 'string' && (Ir[e]?.includes(t) ?? !1);
5995
+ function ut(e, t) {
5996
+ return typeof t == 'string' && (Tr[e]?.includes(t) ?? !1);
5710
5997
  }
5711
- var Ir,
5712
- pt = b(() => {
5998
+ var Tr,
5999
+ mt = y(() => {
5713
6000
  'use strict';
5714
- N();
5715
- Ke();
5716
- ot();
5717
- Ir = {};
6001
+ B();
6002
+ qe();
6003
+ ct();
6004
+ Tr = {};
5718
6005
  });
5719
- function dt(e) {
5720
- return e === 'nano-banana-pro' ? Pr : Tr;
6006
+ function ft(e) {
6007
+ return e === 'nano-banana-pro' ? Mr : Kr;
5721
6008
  }
5722
- var Pr,
5723
- Tr,
5724
- ct = b(() => {
6009
+ var Mr,
6010
+ Kr,
6011
+ gt = y(() => {
5725
6012
  'use strict';
5726
- ((Pr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
5727
- (Tr = [
6013
+ ((Mr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6014
+ (Kr = [
5728
6015
  'auto',
5729
6016
  '1:1',
5730
6017
  '1:4',
@@ -5742,10 +6029,10 @@ var Pr,
5742
6029
  '21:9',
5743
6030
  ]));
5744
6031
  });
5745
- var ut,
5746
- mt = b(() => {
6032
+ var ht,
6033
+ yt = y(() => {
5747
6034
  'use strict';
5748
- ut = [
6035
+ ht = [
5749
6036
  'prompt',
5750
6037
  'system',
5751
6038
  'messages',
@@ -5759,10 +6046,10 @@ var ut,
5759
6046
  'endpoint',
5760
6047
  ];
5761
6048
  });
5762
- var ft,
5763
- gt = b(() => {
6049
+ var bt,
6050
+ kt = y(() => {
5764
6051
  'use strict';
5765
- ft = [
6052
+ bt = [
5766
6053
  {
5767
6054
  slug: 'claude-fable-5-1',
5768
6055
  family: 'fable-5-1',
@@ -5831,13 +6118,13 @@ var ft,
5831
6118
  },
5832
6119
  ];
5833
6120
  });
5834
- function ht(e) {
6121
+ function wt(e) {
5835
6122
  return `$${e}`;
5836
6123
  }
5837
- function qe(e, t, r) {
5838
- return G(e)?.variants.find((s) => s.endpoint === t && s.component === r)?.price.starter ?? null;
6124
+ function Ce(e, t, r) {
6125
+ return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
5839
6126
  }
5840
- function vr(e) {
6127
+ function Sr(e) {
5841
6128
  return [
5842
6129
  {
5843
6130
  name: 'prompt',
@@ -5903,43 +6190,44 @@ function vr(e) {
5903
6190
  },
5904
6191
  ];
5905
6192
  }
5906
- function yt() {
6193
+ function xt() {
5907
6194
  return Object.fromEntries(
5908
- ft.map((e) => {
5909
- let t = qe(e.slug, 'cheap', 'input'),
5910
- r = qe(e.slug, 'cheap', 'output'),
5911
- i = qe(e.slug, 'stable', 'input') != null,
5912
- s = t != null && r != null ? `${ht(t)}/M in \xB7 ${ht(r)}/M out` : '',
5913
- n = {
6195
+ bt.map((e) => {
6196
+ let t = Ce(e.slug, 'cheap', 'input'),
6197
+ r = Ce(e.slug, 'cheap', 'output'),
6198
+ a = Ce(e.slug, 'stable', 'input') != null,
6199
+ n = t != null && r != null ? `${wt(t)}/M in \xB7 ${wt(r)}/M out` : '',
6200
+ s = {
5914
6201
  slug: e.slug,
5915
6202
  name: e.name,
5916
6203
  category: 'Text',
5917
6204
  kind: 'Reasoning (LLM)',
5918
6205
  vendor: 'Anthropic',
5919
6206
  description: e.description,
5920
- priceFormatted: s,
6207
+ priceFormatted: n,
5921
6208
  unit: '/M tokens',
5922
6209
  primaryToolName: 'run_task',
5923
- parameters: vr(i),
6210
+ parameters: Sr(a),
5924
6211
  };
5925
- return [e.slug, n];
6212
+ return [e.slug, s];
5926
6213
  }),
5927
6214
  );
5928
6215
  }
5929
- var bt = b(() => {
6216
+ var It = y(() => {
5930
6217
  'use strict';
5931
- gt();
5932
- N();
6218
+ kt();
6219
+ B();
5933
6220
  });
5934
- var z,
6221
+ var H,
5935
6222
  de,
5936
- $e = b(() => {
6223
+ Ee = y(() => {
5937
6224
  'use strict';
5938
- ((z = [
6225
+ ((H = [
5939
6226
  'seedance-2-5',
5940
6227
  'seedance-2',
5941
6228
  'seedance-2-mini',
5942
6229
  'seedream-5-pro',
6230
+ 'seedream-5-5',
5943
6231
  'wan-3-0',
5944
6232
  'z-image-pro',
5945
6233
  ]),
@@ -5949,38 +6237,38 @@ var z,
5949
6237
  function J(e) {
5950
6238
  return `$${Number(e.toFixed(5))}`;
5951
6239
  }
5952
- function Sr(e) {
6240
+ function Er(e) {
5953
6241
  if (e.kind === 'llm') {
5954
6242
  let t = e.defaultEndpoint,
5955
- r = (n) =>
6243
+ r = (s) =>
5956
6244
  e.variants.find(
5957
6245
  (o) =>
5958
- o.component === n &&
6246
+ o.component === s &&
5959
6247
  (!t || !o.endpoint || o.endpoint === t) &&
5960
6248
  (!o.context || o.context === '0\u201332K'),
5961
6249
  ),
5962
- i = r('input'),
5963
- s = r('output');
5964
- return i && s
5965
- ? `${J(i.price.starter)}/M in \xB7 ${J(s.price.starter)}/M out`
6250
+ a = r('input'),
6251
+ n = r('output');
6252
+ return a && n
6253
+ ? `${J(a.price.starter)}/M in \xB7 ${J(n.price.starter)}/M out`
5966
6254
  : `from ${J(le(e).price.starter)}/M tokens`;
5967
6255
  }
5968
6256
  return `from ${J(le(e).price.starter)}${e.unit}`;
5969
6257
  }
5970
- function qr(e, t) {
5971
- let r = t.filter((i) => Number.isFinite(i) && i > 0);
6258
+ function Ar(e, t) {
6259
+ let r = t.filter((a) => Number.isFinite(a) && a > 0);
5972
6260
  return r.length ? `from ${J(Math.min(...r))}${e}` : null;
5973
6261
  }
5974
- function Pt(e) {
5975
- for (let t of j) {
6262
+ function Mt(e) {
6263
+ for (let t of G) {
5976
6264
  let r = ue[t],
5977
- i = r ? qr(r.unit, e[t] ?? []) : null;
5978
- r && i && (r.priceFormatted = i);
6265
+ a = r ? Ar(r.unit, e[t] ?? []) : null;
6266
+ r && a && (r.priceFormatted = a);
5979
6267
  }
5980
6268
  }
5981
- function R(e, t) {
6269
+ function O(e, t) {
5982
6270
  let r = e.axes?.resolution ?? [
5983
- ...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
6271
+ ...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
5984
6272
  ];
5985
6273
  return {
5986
6274
  name: 'resolution',
@@ -5990,13 +6278,13 @@ function R(e, t) {
5990
6278
  ...(t ? { description: t } : {}),
5991
6279
  };
5992
6280
  }
5993
- function Tt(e) {
6281
+ function Kt(e) {
5994
6282
  if (!e.endpoints?.length) return null;
5995
- let t = e.endpoints.filter((r) => lt(e.slug, r.id));
6283
+ let t = e.endpoints.filter((r) => ut(e.slug, r.id));
5996
6284
  return {
5997
6285
  name: 'endpoint',
5998
6286
  type: 'select',
5999
- default: Me(e),
6287
+ default: Se(e),
6000
6288
  options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
6001
6289
  description:
6002
6290
  (e.slug === 'gemini-3.1-pro-preview'
@@ -6005,20 +6293,20 @@ function Tt(e) {
6005
6293
  (t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
6006
6294
  };
6007
6295
  }
6008
- function Er(e, t) {
6009
- if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
6010
- let r = z.includes(e.api.model);
6011
- return [...t.filter((i) => !Oe.has(i.name)), r ? vt : $r];
6296
+ function Dr(e, t) {
6297
+ if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
6298
+ let r = H.includes(e.api.model);
6299
+ return [...t.filter((a) => !Le.has(a.name)), r ? St : Or];
6012
6300
  }
6013
- function Ce(e, t) {
6014
- let r = e.filter((s) => !Oe.has(s.name)),
6015
- i = [vt, Cr];
6016
- return (i.push(_t, Mt), [...r, ...i]);
6301
+ function Ae(e, t) {
6302
+ let r = e.filter((n) => !Le.has(n.name)),
6303
+ a = [St, Rr];
6304
+ return (a.push(qt, $t), [...r, ...a]);
6017
6305
  }
6018
- function kt(e, t = {}) {
6306
+ function Pt(e, t = {}) {
6019
6307
  return [
6020
6308
  ...e
6021
- .filter((r) => !Ar.has(r.name) && !Oe.has(r.name))
6309
+ .filter((r) => !Lr.has(r.name) && !Le.has(r.name))
6022
6310
  .map((r) =>
6023
6311
  r.name === 'prompt'
6024
6312
  ? { ...r, required: !0 }
@@ -6026,7 +6314,7 @@ function kt(e, t = {}) {
6026
6314
  ? {
6027
6315
  ...r,
6028
6316
  ...(t.no4k && r.options
6029
- ? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
6317
+ ? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
6030
6318
  : {}),
6031
6319
  description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
6032
6320
  }
@@ -6039,13 +6327,13 @@ function kt(e, t = {}) {
6039
6327
  options: ['standard'],
6040
6328
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
6041
6329
  },
6042
- _t,
6043
- Mt,
6330
+ qt,
6331
+ $t,
6044
6332
  ];
6045
6333
  }
6046
- function Ee(e, t) {
6334
+ function Oe(e, t) {
6047
6335
  return [
6048
- q('Text prompt describing the video.'),
6336
+ M('Text prompt describing the video.'),
6049
6337
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
6050
6338
  {
6051
6339
  name: 'duration',
@@ -6055,7 +6343,7 @@ function Ee(e, t) {
6055
6343
  max: t.maxSec,
6056
6344
  description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
6057
6345
  },
6058
- R(e),
6346
+ O(e),
6059
6347
  { name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
6060
6348
  ...t.references.map((r) =>
6061
6349
  r.endsWith('s')
@@ -6072,10 +6360,10 @@ function Ee(e, t) {
6072
6360
  ),
6073
6361
  ];
6074
6362
  }
6075
- function Or(e) {
6076
- let t = Tt(e);
6363
+ function Vr(e) {
6364
+ let t = Kt(e);
6077
6365
  return [
6078
- q('Image prompt text. Supports complex composition and text instructions.'),
6366
+ M('Image prompt text. Supports complex composition and text instructions.'),
6079
6367
  ...(t ? [t] : []),
6080
6368
  {
6081
6369
  name: 'quality',
@@ -6083,17 +6371,17 @@ function Or(e) {
6083
6371
  default: 'low',
6084
6372
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
6085
6373
  },
6086
- R(
6374
+ O(
6087
6375
  e,
6088
6376
  e.slug === 'gpt-image-2'
6089
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ze}`
6377
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${at}`
6090
6378
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
6091
6379
  ),
6092
6380
  {
6093
6381
  name: 'aspect_ratio',
6094
6382
  type: 'select',
6095
6383
  default: 'auto',
6096
- options: [...Xe],
6384
+ options: [...rt],
6097
6385
  description:
6098
6386
  "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.",
6099
6387
  },
@@ -6140,16 +6428,16 @@ function Or(e) {
6140
6428
  },
6141
6429
  ];
6142
6430
  }
6143
- function Rr(e) {
6431
+ function Nr(e) {
6144
6432
  return [
6145
- q('Image prompt text.'),
6433
+ M('Image prompt text.'),
6146
6434
  {
6147
6435
  name: 'input_images',
6148
6436
  type: 'string[]',
6149
6437
  description: 'Images to edit or use as reference (up to 14).',
6150
6438
  },
6151
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...dt(e.slug)] },
6152
- R(e),
6439
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...ft(e.slug)] },
6440
+ O(e),
6153
6441
  {
6154
6442
  name: 'n',
6155
6443
  type: 'slider',
@@ -6174,10 +6462,10 @@ function Rr(e) {
6174
6462
  },
6175
6463
  ];
6176
6464
  }
6177
- function Nr() {
6178
- let e = ut,
6465
+ function jr() {
6466
+ let e = ht,
6179
6467
  t = [];
6180
- for (let r of Re(!0))
6468
+ for (let r of Ve(!0))
6181
6469
  e.includes(r.name) &&
6182
6470
  (t.push({
6183
6471
  ...r,
@@ -6199,14 +6487,14 @@ function Nr() {
6199
6487
  }));
6200
6488
  return t;
6201
6489
  }
6202
- function Ur() {
6203
- return Re(!0).map((e) =>
6490
+ function Gr() {
6491
+ return Ve(!0).map((e) =>
6204
6492
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
6205
6493
  );
6206
6494
  }
6207
- function Re(e) {
6495
+ function Ve(e) {
6208
6496
  return [
6209
- q('The user message or task.'),
6497
+ M('The user message or task.'),
6210
6498
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
6211
6499
  {
6212
6500
  name: 'messages',
@@ -6299,21 +6587,29 @@ function Re(e) {
6299
6587
  },
6300
6588
  ];
6301
6589
  }
6302
- function Br(e) {
6303
- if (e.slug === 'seed-2-1-turbo') return Lr;
6304
- let t = Tt(e);
6590
+ function zr(e) {
6591
+ if (e.slug === 'seed-2-1-turbo') return Br;
6592
+ let t = Kt(e);
6305
6593
  return [
6306
6594
  ...(e.slug === 'gemini-3.1-pro-preview'
6307
- ? Nr()
6595
+ ? jr()
6308
6596
  : e.slug === 'gemini-3.7-flash'
6309
- ? Ur()
6310
- : e.slug === 'gpt-6-astra' || Vr.includes(e.slug)
6311
- ? Re(e.slug !== 'gpt-6-astra')
6312
- : Dr),
6597
+ ? Gr()
6598
+ : e.slug === 'gpt-6-astra' || Fr.includes(e.slug)
6599
+ ? Ve(e.slug !== 'gpt-6-astra')
6600
+ : Ur),
6313
6601
  ...(t ? [t] : []),
6314
6602
  ];
6315
6603
  }
6316
- function Fr(e) {
6604
+ function Re() {
6605
+ return {
6606
+ name: 'image',
6607
+ type: 'string',
6608
+ required: !0,
6609
+ description: 'The photo to fix: one JPEG or PNG URL.',
6610
+ };
6611
+ }
6612
+ function Jr(e) {
6317
6613
  return [
6318
6614
  {
6319
6615
  name: 'video_url',
@@ -6322,7 +6618,7 @@ function Fr(e) {
6322
6618
  description:
6323
6619
  'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
6324
6620
  },
6325
- R(
6621
+ O(
6326
6622
  e,
6327
6623
  'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
6328
6624
  ),
@@ -6335,31 +6631,31 @@ function Fr(e) {
6335
6631
  },
6336
6632
  ];
6337
6633
  }
6338
- function jr(e) {
6634
+ function Wr(e) {
6339
6635
  let t = e.slug;
6340
- if (se.some((r) => r.slug === t)) return Fr(e);
6341
- if (e.kind === 'llm') return Br(e);
6342
- if (e.editVariants?.length) return Or(e);
6636
+ if (ne.some((r) => r.slug === t)) return Jr(e);
6637
+ if (e.kind === 'llm') return zr(e);
6638
+ if (e.editVariants?.length) return Vr(e);
6343
6639
  switch (t) {
6344
6640
  case 'seedance-2-5':
6345
- return Ce(wt, t);
6641
+ return Ae(_t, t);
6346
6642
  case 'seedance-2-5-lite':
6347
- return kt(wt, { no4k: !0 });
6643
+ return Pt(_t, { no4k: !0 });
6348
6644
  case 'seedance-2':
6349
- return Ce(xt, t);
6645
+ return Ae(vt, t);
6350
6646
  case 'seedance-2-lite':
6351
- return kt(xt);
6647
+ return Pt(vt);
6352
6648
  case 'seedance-2-mini':
6353
- return Ce(Gr, t);
6649
+ return Ae(Yr, t);
6354
6650
  case 'nano-banana-2':
6355
6651
  case 'nano-banana-2.1':
6356
6652
  case 'nano-banana-pro':
6357
- return Rr(e);
6653
+ return Nr(e);
6358
6654
  case 'seedream-5-pro':
6359
6655
  return [
6360
- q('Detailed description of the image to generate.'),
6656
+ M('Detailed description of the image to generate.'),
6361
6657
  { name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
6362
- R(e),
6658
+ O(e),
6363
6659
  {
6364
6660
  name: 'aspect_ratio',
6365
6661
  type: 'select',
@@ -6368,16 +6664,72 @@ function jr(e) {
6368
6664
  },
6369
6665
  { name: 'output_format', type: 'select', default: 'jpeg', options: ['jpeg', 'png'] },
6370
6666
  ];
6667
+ case 'seedream-5-5':
6668
+ return [
6669
+ {
6670
+ name: 'mode',
6671
+ type: 'select',
6672
+ default: 'text_to_image',
6673
+ options: ['text_to_image', 'image_to_image', 'layer_decomposition'],
6674
+ description:
6675
+ '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).',
6676
+ },
6677
+ M(
6678
+ '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").',
6679
+ ),
6680
+ {
6681
+ name: 'images',
6682
+ type: 'string[]',
6683
+ description:
6684
+ 'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
6685
+ },
6686
+ O(
6687
+ e,
6688
+ '1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
6689
+ ),
6690
+ {
6691
+ name: 'aspect_ratio',
6692
+ type: 'select',
6693
+ default: '1:1',
6694
+ options: ['1:1', '4:3', '3:4', '16:9', '9:16', '3:2', '2:3', '21:9', 'adaptive'],
6695
+ description: 'Not used by layer_decomposition. adaptive lets the prompt pick the shape.',
6696
+ },
6697
+ {
6698
+ name: 'background',
6699
+ type: 'select',
6700
+ default: 'auto',
6701
+ options: ['auto', 'transparent', 'opaque'],
6702
+ description:
6703
+ 'transparent makes a PNG with an alpha channel (needs output_format png). auto decides from the prompt. Not used by layer_decomposition.',
6704
+ },
6705
+ { name: 'output_format', type: 'select', default: 'png', options: ['png', 'jpeg'] },
6706
+ {
6707
+ name: 'max_layers',
6708
+ type: 'slider',
6709
+ default: 30,
6710
+ min: 2,
6711
+ max: 100,
6712
+ description:
6713
+ 'layer_decomposition only: most images to return, the base image included. Held for this many; you pay for the layers made.',
6714
+ },
6715
+ {
6716
+ name: 'text_recognition',
6717
+ type: 'boolean',
6718
+ default: !1,
6719
+ description:
6720
+ 'layer_decomposition only: return the text, lines, font and style of each typeset text layer (layer.text_recognition).',
6721
+ },
6722
+ ];
6371
6723
  case 'qwen-3':
6372
6724
  case 'qwen-3-pro':
6373
6725
  return [
6374
- q('Image prompt text; dense layouts and multilingual text work well.'),
6726
+ M('Image prompt text; dense layouts and multilingual text work well.'),
6375
6727
  {
6376
6728
  name: 'images',
6377
6729
  type: 'string[]',
6378
6730
  description: 'Up to 3 reference images, each billed at the published add-on price.',
6379
6731
  },
6380
- R(e),
6732
+ O(e),
6381
6733
  {
6382
6734
  name: 'aspect_ratio',
6383
6735
  type: 'select',
@@ -6395,8 +6747,8 @@ function jr(e) {
6395
6747
  ];
6396
6748
  case 'z-image-pro':
6397
6749
  return [
6398
- q('Image prompt text: subject, scene, style, composition and lighting.'),
6399
- R(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
6750
+ M('Image prompt text: subject, scene, style, composition and lighting.'),
6751
+ O(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
6400
6752
  {
6401
6753
  name: 'aspect_ratio',
6402
6754
  type: 'select',
@@ -6447,9 +6799,117 @@ function jr(e) {
6447
6799
  },
6448
6800
  { name: 'watermark', type: 'json', description: 'aigc_watermark and aigc_metadata.' },
6449
6801
  ];
6802
+ case 'enhancor-skin-fix-v1':
6803
+ return [
6804
+ Re(),
6805
+ {
6806
+ name: 'mode',
6807
+ type: 'select',
6808
+ default: 'standard',
6809
+ options: ['standard', 'heavy'],
6810
+ description:
6811
+ 'Standard is priced by image size. Heavy is a stronger fix, priced per megapixel.',
6812
+ },
6813
+ {
6814
+ name: 'skin_realism_level',
6815
+ type: 'slider',
6816
+ default: 1.7,
6817
+ min: 0,
6818
+ max: 5,
6819
+ description: 'How strong the skin realism is.',
6820
+ },
6821
+ {
6822
+ name: 'skin_refinement_level',
6823
+ type: 'slider',
6824
+ default: 30,
6825
+ min: 0,
6826
+ max: 100,
6827
+ description: 'How much the skin is refined. Standard only.',
6828
+ },
6829
+ {
6830
+ name: 'portrait_depth',
6831
+ type: 'slider',
6832
+ default: 0.2,
6833
+ min: 0.2,
6834
+ max: 0.4,
6835
+ description: 'Portrait depth. Heavy only.',
6836
+ },
6837
+ ...Hr,
6838
+ ];
6839
+ case 'enhancor-skin-fix-v3':
6840
+ return [
6841
+ Re(),
6842
+ {
6843
+ name: 'mask_image',
6844
+ type: 'string',
6845
+ description: 'Optional mask of the area to fix: one URL.',
6846
+ },
6847
+ {
6848
+ name: 'skin_refinement_level',
6849
+ type: 'slider',
6850
+ default: 30,
6851
+ min: 0,
6852
+ max: 100,
6853
+ description: 'How much the skin is refined. Needs mask_image.',
6854
+ },
6855
+ {
6856
+ name: 'skin_realism_level',
6857
+ type: 'slider',
6858
+ default: 0.1,
6859
+ min: 0,
6860
+ max: 3,
6861
+ description: 'How strong the skin realism is. Needs mask_image.',
6862
+ },
6863
+ {
6864
+ name: 'output_resolution',
6865
+ type: 'slider',
6866
+ default: 2048,
6867
+ min: 1024,
6868
+ max: 3072,
6869
+ description: 'Output size in pixels. Needs mask_image.',
6870
+ },
6871
+ {
6872
+ name: 'enhancement_type',
6873
+ type: 'select',
6874
+ default: 'face',
6875
+ options: ['face', 'body'],
6876
+ description: 'The part to fix. Needs mask_image.',
6877
+ },
6878
+ ];
6879
+ case 'enhancor-skin-fix-v4':
6880
+ return [
6881
+ Re(),
6882
+ {
6883
+ name: 'mode',
6884
+ type: 'select',
6885
+ default: 'base',
6886
+ options: ['base', 'fast', 'ultra'],
6887
+ description: 'Base is 4K, Fast is a faster 4K, Ultra is 8K.',
6888
+ },
6889
+ {
6890
+ name: 'enhancement_strength',
6891
+ type: 'select',
6892
+ default: 'realistic',
6893
+ options: ['subtle', 'realistic', 'pimple', 'freckle'],
6894
+ description: 'The look of the fix. Fast and Ultra only.',
6895
+ },
6896
+ {
6897
+ name: 'fix_lighting',
6898
+ type: 'boolean',
6899
+ default: !1,
6900
+ description: 'Also fixes the lighting. Needs enhancement_strength realistic.',
6901
+ },
6902
+ {
6903
+ name: 'freckle_intensity',
6904
+ type: 'select',
6905
+ default: '50',
6906
+ options: ['0', '50', '100'],
6907
+ description: 'How many freckles. Needs enhancement_strength freckle.',
6908
+ },
6909
+ ];
6450
6910
  case 'wan-3-0':
6451
6911
  case 'wan-3-0-prime':
6452
- return Ee(e, {
6912
+ return Oe(e, {
6453
6913
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
6454
6914
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
6455
6915
  minSec: 2,
@@ -6459,7 +6919,7 @@ function jr(e) {
6459
6919
  });
6460
6920
  case 'happy-horse-1-1':
6461
6921
  case 'happy-horse-1-0':
6462
- return Ee(e, {
6922
+ return Oe(e, {
6463
6923
  modes:
6464
6924
  t === 'happy-horse-1-0'
6465
6925
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -6470,7 +6930,7 @@ function jr(e) {
6470
6930
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
6471
6931
  });
6472
6932
  case 'minimax-h3':
6473
- return Ee(e, {
6933
+ return Oe(e, {
6474
6934
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
6475
6935
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
6476
6936
  minSec: 4,
@@ -6478,159 +6938,164 @@ function jr(e) {
6478
6938
  references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
6479
6939
  });
6480
6940
  default:
6481
- return [q('Prompt text.')];
6941
+ return [M('Prompt text.')];
6482
6942
  }
6483
6943
  }
6484
- function Ae(e, t = e.api.model) {
6944
+ function De(e, t = e.api.model) {
6485
6945
  return {
6486
6946
  slug: t,
6487
6947
  name: e.name,
6488
- category: _r[e.kind],
6489
- kind: Kr[e.kind],
6948
+ category: qr[e.kind],
6949
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Cr[e.kind],
6490
6950
  vendor: e.vendor ?? '',
6491
6951
  description: e.desc ?? e.name,
6492
- priceFormatted: Sr(e),
6952
+ priceFormatted: Er(e),
6493
6953
  unit: e.unit,
6494
- primaryToolName: Mr[e.kind],
6495
- parameters: Er(e, jr(e)),
6954
+ primaryToolName: $r[e.kind],
6955
+ parameters: Dr(e, Wr(e)),
6496
6956
  };
6497
6957
  }
6498
- function zr() {
6958
+ function Qr() {
6499
6959
  let e = {};
6500
6960
  for (let t of oe())
6501
6961
  if (t.slug !== 'seedance-2-fast') {
6502
6962
  if (t.slug === 'seedance-2-mini') {
6503
- e['seedance-2-mini'] = Ae(t, 'seedance-2-mini');
6963
+ e['seedance-2-mini'] = De(t, 'seedance-2-mini');
6504
6964
  continue;
6505
6965
  }
6506
6966
  if (t.slug === 'seedance-2') {
6507
- let r = Ae(t);
6967
+ let r = De(t);
6508
6968
  ((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
6509
6969
  (e['seedance-2'] = r));
6510
6970
  continue;
6511
6971
  }
6512
- t.slug.startsWith('claude-') || (e[t.api.model] = Ae(t));
6972
+ t.slug.startsWith('claude-') || (e[t.api.model] = De(t));
6513
6973
  }
6514
- Object.assign(e, yt());
6974
+ Object.assign(e, xt());
6515
6975
  for (let [t, r] of Object.entries(pe))
6516
6976
  e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
6517
6977
  return e;
6518
6978
  }
6519
- function U(e) {
6979
+ function me(e) {
6980
+ return !!e?.parameters.some((t) => t.name === 'image');
6981
+ }
6982
+ function F(e) {
6520
6983
  return ue[e] ?? null;
6521
6984
  }
6522
- function Jr(e, t, r) {
6985
+ function Xr(e, t, r) {
6986
+ if (e.startsWith('enhancor-skin-fix-')) return !1;
6523
6987
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
6524
- let i = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
6525
- if (i(r.mode) === 'edit' || i(r.omni_reference_task_type) === 'edit') return !1;
6988
+ let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
6989
+ if (a(r.mode) === 'edit' || a(r.omni_reference_task_type) === 'edit') return !1;
6526
6990
  }
6527
6991
  return !(
6528
- (t === 'max_tokens' && It(r.max_completion_tokens)) ||
6529
- (t === 'max_completion_tokens' && It(r.max_tokens))
6992
+ (t === 'max_tokens' && Tt(r.max_completion_tokens)) ||
6993
+ (t === 'max_completion_tokens' && Tt(r.max_tokens))
6530
6994
  );
6531
6995
  }
6532
- function It(e) {
6996
+ function Tt(e) {
6533
6997
  return e != null && e !== '';
6534
6998
  }
6535
- function qt(e, t) {
6999
+ function At(e, t) {
6536
7000
  let r = { ...t };
6537
7001
  if (e?.slug === 'seedance-2-5') {
6538
- let i = (s) => typeof s != 'string' || !s.trim();
6539
- for (let s of Hr) (i(r.finalize) && !i(r[s]) && (r.finalize = r[s]), delete r[s]);
6540
- if (!i(r.finalize)) return r;
7002
+ let a = (n) => typeof n != 'string' || !n.trim();
7003
+ for (let n of Zr) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
7004
+ if (!a(r.finalize)) return r;
6541
7005
  }
6542
- for (let i of e?.parameters ?? [])
6543
- i.default !== void 0 &&
6544
- r[i.name] === void 0 &&
6545
- Jr(e.slug, i.name, t) &&
6546
- (r[i.name] = i.default);
7006
+ for (let a of e?.parameters ?? [])
7007
+ a.default !== void 0 &&
7008
+ r[a.name] === void 0 &&
7009
+ Xr(e.slug, a.name, t) &&
7010
+ (r[a.name] = a.default);
6547
7011
  return r;
6548
7012
  }
6549
- function E() {
7013
+ function R() {
6550
7014
  return Object.values(ue);
6551
7015
  }
6552
- var _r,
6553
- Mr,
6554
- Kr,
6555
- q,
6556
- vt,
7016
+ var qr,
6557
7017
  $r,
6558
7018
  Cr,
6559
- _t,
6560
- Mt,
6561
- Oe,
6562
- Ar,
6563
- Dr,
7019
+ M,
7020
+ St,
7021
+ Or,
7022
+ Rr,
7023
+ qt,
7024
+ $t,
7025
+ Le,
6564
7026
  Lr,
6565
- Vr,
7027
+ Ur,
7028
+ Br,
7029
+ Fr,
7030
+ Hr,
6566
7031
  ce,
6567
- wt,
6568
- Kt,
6569
- St,
6570
- xt,
6571
- Gr,
7032
+ _t,
7033
+ Ct,
7034
+ Et,
7035
+ vt,
7036
+ Yr,
6572
7037
  ue,
6573
- Hr,
6574
- H = b(() => {
7038
+ Zr,
7039
+ W = y(() => {
6575
7040
  'use strict';
6576
- et();
6577
- we();
6578
- N();
6579
- Ke();
6580
- xe();
6581
- Se();
6582
- pt();
6583
- ct();
6584
- mt();
6585
- bt();
7041
+ it();
7042
+ Ie();
7043
+ B();
7044
+ qe();
7045
+ Pe();
6586
7046
  $e();
6587
- ((_r = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
6588
- (Mr = {
7047
+ mt();
7048
+ gt();
7049
+ yt();
7050
+ It();
7051
+ Ee();
7052
+ ((qr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
7053
+ ($r = {
6589
7054
  video: 'generate_video',
6590
7055
  image: 'generate_image',
6591
7056
  audio: 'generate_audio',
6592
7057
  llm: 'run_task',
6593
7058
  }),
6594
- (Kr = {
7059
+ (Cr = {
6595
7060
  video: 'Text-to-Video',
6596
7061
  image: 'Text-to-Image',
6597
7062
  audio: 'Text-to-Audio',
6598
7063
  llm: 'Reasoning (LLM)',
6599
7064
  }));
6600
- q = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
6601
- ((vt = {
7065
+ M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
7066
+ ((St = {
6602
7067
  name: 'creative_mode',
6603
7068
  type: 'boolean',
6604
7069
  default: !1,
6605
7070
  description:
6606
7071
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
6607
7072
  }),
6608
- ($r = {
7073
+ (Or = {
6609
7074
  name: 'creative_mode',
6610
7075
  type: 'boolean',
6611
7076
  default: !1,
6612
7077
  description: `Not available yet on this model: ${de}.`,
6613
7078
  }),
6614
- (Cr = {
7079
+ (Rr = {
6615
7080
  name: 'priority',
6616
7081
  type: 'boolean',
6617
7082
  default: !1,
6618
7083
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
6619
7084
  }),
6620
- (_t = {
7085
+ (qt = {
6621
7086
  name: 'reference_roles',
6622
7087
  type: 'json',
6623
7088
  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).`,
6624
7089
  }),
6625
- (Mt = {
7090
+ ($t = {
6626
7091
  name: 'auto_fit_images',
6627
7092
  type: 'boolean',
6628
7093
  default: !1,
6629
7094
  description:
6630
7095
  '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.',
6631
7096
  }),
6632
- (Oe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
6633
- Ar = new Set([
7097
+ (Le = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
7098
+ Lr = new Set([
6634
7099
  'quality',
6635
7100
  'bitrate_mode',
6636
7101
  'draft',
@@ -6639,8 +7104,8 @@ var _r,
6639
7104
  'draft_generation_id',
6640
7105
  'pass_faces',
6641
7106
  ]);
6642
- ((Dr = [
6643
- q('The user message or task.'),
7107
+ ((Ur = [
7108
+ M('The user message or task.'),
6644
7109
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
6645
7110
  {
6646
7111
  name: 'messages',
@@ -6657,8 +7122,8 @@ var _r,
6657
7122
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
6658
7123
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
6659
7124
  ]),
6660
- (Lr = [
6661
- q('The user message or task.'),
7125
+ (Br = [
7126
+ M('The user message or task.'),
6662
7127
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
6663
7128
  {
6664
7129
  name: 'messages',
@@ -6739,9 +7204,35 @@ var _r,
6739
7204
  description: 'Video frames read a second.',
6740
7205
  },
6741
7206
  ]),
6742
- (Vr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
7207
+ (Fr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
7208
+ Hr = Object.entries({
7209
+ background: !1,
7210
+ skin: !1,
7211
+ nose: !1,
7212
+ eye_g: !1,
7213
+ r_eye: !0,
7214
+ l_eye: !0,
7215
+ r_brow: !1,
7216
+ l_brow: !1,
7217
+ r_ear: !1,
7218
+ l_ear: !1,
7219
+ mouth: !0,
7220
+ u_lip: !0,
7221
+ l_lip: !0,
7222
+ hair: !1,
7223
+ hat: !1,
7224
+ ear_r: !1,
7225
+ neck_l: !1,
7226
+ neck: !1,
7227
+ cloth: !1,
7228
+ }).map(([e, t]) => ({
7229
+ name: e,
7230
+ type: 'boolean',
7231
+ default: t,
7232
+ description: 'Keep this part out of the fix. Standard only.',
7233
+ }));
6743
7234
  ((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
6744
- (wt = [
7235
+ (_t = [
6745
7236
  {
6746
7237
  name: 'prompt',
6747
7238
  type: 'string',
@@ -6890,19 +7381,19 @@ var _r,
6890
7381
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
6891
7382
  },
6892
7383
  ]),
6893
- (Kt = {
7384
+ (Ct = {
6894
7385
  name: 'images',
6895
7386
  type: 'string[]',
6896
7387
  description:
6897
7388
  '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.',
6898
7389
  }),
6899
- (St = {
7390
+ (Et = {
6900
7391
  name: 'audios',
6901
7392
  type: 'string[]',
6902
7393
  description:
6903
7394
  '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.',
6904
7395
  }),
6905
- (xt = [
7396
+ (vt = [
6906
7397
  {
6907
7398
  name: 'prompt',
6908
7399
  type: 'string',
@@ -6980,8 +7471,8 @@ var _r,
6980
7471
  description:
6981
7472
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
6982
7473
  },
6983
- Kt,
6984
- St,
7474
+ Ct,
7475
+ Et,
6985
7476
  {
6986
7477
  name: 'first_frame_image',
6987
7478
  type: 'string',
@@ -7002,7 +7493,7 @@ var _r,
7002
7493
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7003
7494
  },
7004
7495
  ]),
7005
- (Gr = [
7496
+ (Yr = [
7006
7497
  {
7007
7498
  name: 'prompt',
7008
7499
  type: 'string',
@@ -7057,8 +7548,8 @@ var _r,
7057
7548
  description:
7058
7549
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
7059
7550
  },
7060
- Kt,
7061
- St,
7551
+ Ct,
7552
+ Et,
7062
7553
  {
7063
7554
  name: 'first_frame_image',
7064
7555
  type: 'string',
@@ -7073,53 +7564,53 @@ var _r,
7073
7564
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7074
7565
  },
7075
7566
  ]));
7076
- ue = zr();
7077
- Hr = ['draft_task_id', 'draft_generation_id'];
7567
+ ue = Qr();
7568
+ Zr = ['draft_task_id', 'draft_generation_id'];
7078
7569
  });
7079
- function me(e) {
7570
+ function fe(e) {
7080
7571
  let t = '/v1/pricing/models',
7081
7572
  r = e?.trim();
7082
7573
  return r ? `${t}?model=${encodeURIComponent(r)}` : t;
7083
7574
  }
7084
- var Le = b(() => {
7575
+ var Ue = y(() => {
7085
7576
  'use strict';
7086
7577
  });
7087
- function Ut(e) {
7578
+ function Gt(e) {
7088
7579
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
7089
7580
  }
7090
- function Bt(e) {
7091
- let t = oe().filter((n) => n.kind === e && n.unfiltered != null),
7092
- r = t.filter((n) => z.includes(n.api.model)).map((n) => n.name),
7093
- i = t.filter((n) => !z.includes(n.api.model)).map((n) => n.name);
7581
+ function zt(e) {
7582
+ let t = oe().filter((s) => s.kind === e && s.unfiltered != null),
7583
+ r = t.filter((s) => H.includes(s.api.model)).map((s) => s.name),
7584
+ a = t.filter((s) => !H.includes(s.api.model)).map((s) => s.name);
7094
7585
  return [
7095
7586
  ...(r.length
7096
- ? [`${Ut(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
7587
+ ? [`${Gt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
7097
7588
  : []),
7098
- ...(i.length ? [`Not available yet on ${Ut(i)}: ${de}.`] : []),
7589
+ ...(a.length ? [`Not available yet on ${Gt(a)}: ${de}.`] : []),
7099
7590
  'The Acceptable Use Policy applies.',
7100
7591
  ].join(' ');
7101
7592
  }
7102
- function yi(e) {
7103
- if (gi.has(e.name)) return e;
7593
+ function Pa(e) {
7594
+ if (xa.has(e.name)) return e;
7104
7595
  let t = e.inputSchema.properties;
7105
7596
  return !t || t.callback_url
7106
7597
  ? e
7107
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: fi } } };
7598
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: wa } } };
7108
7599
  }
7109
- function bi(e) {
7600
+ function _a(e) {
7110
7601
  let t = e.inputSchema.properties;
7111
7602
  if (!t) return e;
7112
7603
  let r = !1,
7113
- i = {};
7114
- for (let [s, n] of Object.entries(t))
7115
- Ft.has(s) && n.type === 'string' && !n.format
7116
- ? ((i[s] = { ...n, format: 'uri' }), (r = !0))
7117
- : Ft.has(s) && n.type === 'array' && n.items?.type === 'string' && !n.items.format
7118
- ? ((i[s] = { ...n, items: { ...n.items, format: 'uri' } }), (r = !0))
7119
- : (i[s] = n);
7120
- return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
7604
+ a = {};
7605
+ for (let [n, s] of Object.entries(t))
7606
+ Ht.has(n) && s.type === 'string' && !s.format
7607
+ ? ((a[n] = { ...s, format: 'uri' }), (r = !0))
7608
+ : Ht.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
7609
+ ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
7610
+ : (a[n] = s);
7611
+ return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
7121
7612
  }
7122
- function ki(e) {
7613
+ function va(e) {
7123
7614
  switch (e.type) {
7124
7615
  case 'string':
7125
7616
  return {
@@ -7174,32 +7665,32 @@ function ki(e) {
7174
7665
  return { type: 'string', description: e.description };
7175
7666
  }
7176
7667
  }
7177
- function wi(e, t) {
7668
+ function Ta(e, t) {
7178
7669
  let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
7179
- i = {},
7180
- s = [];
7181
- for (let o of e.parameters) ((i[o.name] = ki(o)), o.required && s.push(o.name));
7182
- let n = {
7670
+ a = {},
7671
+ n = [];
7672
+ for (let o of e.parameters) ((a[o.name] = va(o)), o.required && n.push(o.name));
7673
+ let s = {
7183
7674
  type: 'object',
7184
- properties: i,
7185
- ...(s.length > 0 ? { required: s } : {}),
7675
+ properties: a,
7676
+ ...(n.length > 0 ? { required: n } : {}),
7186
7677
  additionalProperties: !0,
7187
7678
  };
7188
7679
  return {
7189
7680
  name: r,
7190
7681
  description: `[Tein AI - ${e.name} (${e.category})] ${e.description} (Pricing: ${e.priceFormatted})`,
7191
- inputSchema: n,
7682
+ inputSchema: s,
7192
7683
  };
7193
7684
  }
7194
- function xi() {
7195
- let e = E().filter((d) => d.category === 'Image'),
7196
- t = E().filter((d) => d.category === 'Video'),
7197
- r = E().filter((d) => d.category === 'Text'),
7198
- i = E().filter((d) => d.category === 'Audio'),
7199
- s = {
7685
+ function Ma() {
7686
+ let e = R().filter((d) => d.category === 'Image' && !me(d)),
7687
+ t = R().filter((d) => d.category === 'Video'),
7688
+ r = R().filter((d) => d.category === 'Text'),
7689
+ a = R().filter((d) => d.category === 'Audio'),
7690
+ n = {
7200
7691
  name: 'generate_image',
7201
7692
  description:
7202
- 'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
7693
+ 'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.5 and 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
7203
7694
  inputSchema: {
7204
7695
  type: 'object',
7205
7696
  properties: {
@@ -7287,13 +7778,13 @@ function xi() {
7287
7778
  maximum: 2147483647,
7288
7779
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
7289
7780
  },
7290
- creative_mode: { type: 'boolean', default: !1, description: Bt('image') },
7781
+ creative_mode: { type: 'boolean', default: !1, description: zt('image') },
7291
7782
  },
7292
7783
  required: ['prompt'],
7293
7784
  additionalProperties: !0,
7294
7785
  },
7295
7786
  },
7296
- n = {
7787
+ s = {
7297
7788
  name: 'generate_video',
7298
7789
  description:
7299
7790
  'Generate video with Tein AI video models (Seedance 2.5, Seedance 2.0 with quality standard, fast or mini, Wan 3.0, HappyHorse, Hailuo 3). Seedance and Wan take creative_mode; Seedance takes priority.',
@@ -7324,7 +7815,7 @@ function xi() {
7324
7815
  default: '480p',
7325
7816
  description: 'Video resolution (the lowest price is the default; see each model tool).',
7326
7817
  },
7327
- creative_mode: { type: 'boolean', default: !1, description: Bt('video') },
7818
+ creative_mode: { type: 'boolean', default: !1, description: zt('video') },
7328
7819
  priority: {
7329
7820
  type: 'boolean',
7330
7821
  default: !1,
@@ -7415,16 +7906,32 @@ function xi() {
7415
7906
  },
7416
7907
  l = {
7417
7908
  name: 'generate_mesh',
7418
- description: 'Split an image into layers with Seedream 5.0 Pro (layer decomposition).',
7909
+ description:
7910
+ 'Split an image into layers (layer decomposition): Seedream 5.0 Pro by default, or model seedream-5-5 for up to 100 transparent layers billed per layer made, with optional typeset-text recognition.',
7419
7911
  inputSchema: {
7420
7912
  type: 'object',
7421
7913
  properties: {
7914
+ model: {
7915
+ type: 'string',
7916
+ enum: ['seedream-5-pro', 'seedream-5-5'],
7917
+ description: 'seedream-5-pro (default) or seedream-5-5.',
7918
+ },
7422
7919
  prompt: { type: 'string', description: 'What to separate into layers.' },
7423
7920
  images: {
7424
7921
  type: 'array',
7425
7922
  items: { type: 'string' },
7426
7923
  description: 'The image to decompose (jpeg or png).',
7427
7924
  },
7925
+ max_layers: {
7926
+ type: 'number',
7927
+ description:
7928
+ 'seedream-5-5 only: most images to return, the base image included (2-100, default 30). You pay for the layers made.',
7929
+ },
7930
+ text_recognition: {
7931
+ type: 'boolean',
7932
+ description:
7933
+ 'seedream-5-5 only: return the text and style of each typeset text layer (layer.text_recognition).',
7934
+ },
7428
7935
  },
7429
7936
  required: ['prompt'],
7430
7937
  additionalProperties: !0,
@@ -7446,10 +7953,10 @@ function xi() {
7446
7953
  additionalProperties: !0,
7447
7954
  },
7448
7955
  },
7449
- p = Ii();
7450
- return [s, n, o, u, l, p, c, hi];
7956
+ p = Ka();
7957
+ return [n, s, o, u, l, p, c, Ia];
7451
7958
  }
7452
- function Ii() {
7959
+ function Ka() {
7453
7960
  return {
7454
7961
  name: 'upload_asset',
7455
7962
  description:
@@ -7496,26 +8003,26 @@ function Ii() {
7496
8003
  },
7497
8004
  };
7498
8005
  }
7499
- function je() {
7500
- let e = xi(),
7501
- t = E().map((r) => wi(r));
7502
- return [...e, ...t].map(yi).map(bi);
8006
+ function He() {
8007
+ let e = Ma(),
8008
+ t = R().map((r) => Ta(r));
8009
+ return [...e, ...t].map(Pa).map(_a);
7503
8010
  }
7504
- var fi,
7505
- gi,
7506
- hi,
7507
- Ft,
7508
- jt = b(() => {
8011
+ var wa,
8012
+ xa,
8013
+ Ia,
8014
+ Ht,
8015
+ Jt = y(() => {
7509
8016
  'use strict';
7510
- N();
7511
- $e();
7512
- H();
7513
- ((fi = {
8017
+ B();
8018
+ Ee();
8019
+ W();
8020
+ ((wa = {
7514
8021
  type: 'string',
7515
8022
  description:
7516
8023
  '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.',
7517
8024
  }),
7518
- (gi = new Set([
8025
+ (xa = new Set([
7519
8026
  'upload_asset',
7520
8027
  'upload_media',
7521
8028
  'upload_image',
@@ -7523,7 +8030,7 @@ var fi,
7523
8030
  'check_status',
7524
8031
  'get_pricing',
7525
8032
  ])),
7526
- (hi = {
8033
+ (Ia = {
7527
8034
  name: 'get_pricing',
7528
8035
  description:
7529
8036
  'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
@@ -7538,7 +8045,7 @@ var fi,
7538
8045
  additionalProperties: !1,
7539
8046
  },
7540
8047
  }));
7541
- Ft = new Set([
8048
+ Ht = new Set([
7542
8049
  'image',
7543
8050
  'images',
7544
8051
  'image_url',
@@ -7555,31 +8062,31 @@ var fi,
7555
8062
  'lipsyncing_audio',
7556
8063
  ]);
7557
8064
  });
7558
- var er = {};
7559
- lr(er, {
7560
- forgetToolSchemas: () => Mi,
7561
- jsonRpcAnswer: () => Ht,
7562
- preprocessLocalFiles: () => Xt,
7563
- startStdioServer: () => Zt,
8065
+ var ir = {};
8066
+ ur(ir, {
8067
+ forgetToolSchemas: () => Ea,
8068
+ jsonRpcAnswer: () => Xt,
8069
+ preprocessLocalFiles: () => rr,
8070
+ startStdioServer: () => ar,
7564
8071
  });
7565
- function Pi(e) {
8072
+ function Sa(e) {
7566
8073
  let t = (r) =>
7567
8074
  !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
7568
8075
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
7569
8076
  }
7570
- function Ht(e, t, r) {
7571
- let i = e?.id,
7572
- s = i == null,
7573
- n = null;
8077
+ function Xt(e, t, r) {
8078
+ let a = e?.id,
8079
+ n = a == null,
8080
+ s = null;
7574
8081
  try {
7575
- n = r ? JSON.parse(r) : null;
8082
+ s = r ? JSON.parse(r) : null;
7576
8083
  } catch {
7577
- n = null;
8084
+ s = null;
7578
8085
  }
7579
- if (n !== null && Pi(n)) return s ? null : n;
7580
- if (s) return null;
8086
+ if (s !== null && Sa(s)) return n ? null : s;
8087
+ if (n) return null;
7581
8088
  if (!r && t >= 200 && t < 300) return;
7582
- let o = n?.error,
8089
+ let o = s?.error,
7583
8090
  u =
7584
8091
  typeof o == 'string'
7585
8092
  ? o
@@ -7589,7 +8096,7 @@ function Ht(e, t, r) {
7589
8096
  l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
7590
8097
  return {
7591
8098
  jsonrpc: '2.0',
7592
- id: i,
8099
+ id: a,
7593
8100
  error: {
7594
8101
  code: t === 401 ? -32001 : -32603,
7595
8102
  message: u,
@@ -7597,23 +8104,23 @@ function Ht(e, t, r) {
7597
8104
  },
7598
8105
  };
7599
8106
  }
7600
- function Ti() {
8107
+ function qa() {
7601
8108
  let e = process.argv.slice(2),
7602
8109
  t = e.indexOf('--api-key');
7603
- return S(t >= 0 ? e[t + 1] : void 0);
8110
+ return q(t >= 0 ? e[t + 1] : void 0);
7604
8111
  }
7605
- async function Wt(e, t, r) {
7606
- let i = B.default.resolve(e);
7607
- if (!O.default.existsSync(i) || !O.default.statSync(i).isFile())
8112
+ async function Zt(e, t, r) {
8113
+ let a = j.default.resolve(e);
8114
+ if (!D.default.existsSync(a) || !D.default.statSync(a).isFile())
7608
8115
  throw new Error(`File not found: ${e}`);
7609
- let s = O.default.readFileSync(i),
7610
- n = s.toString('base64'),
7611
- o = s.length,
8116
+ let n = D.default.readFileSync(a),
8117
+ s = n.toString('base64'),
8118
+ o = n.length,
7612
8119
  u = `${r.replace(/\/$/, '')}/v1/upload`,
7613
8120
  l = await fetch(u, {
7614
8121
  method: 'POST',
7615
8122
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
7616
- body: JSON.stringify({ data: n }),
8123
+ body: JSON.stringify({ data: s }),
7617
8124
  });
7618
8125
  if (!l.ok) {
7619
8126
  let p = `Upload failed (HTTP ${l.status})`;
@@ -7631,15 +8138,15 @@ async function Wt(e, t, r) {
7631
8138
  mimeType: c.mime_type || c.mimeType || 'image/png',
7632
8139
  };
7633
8140
  }
7634
- function Yt(e) {
7635
- return vi.has(B.default.extname(e).toLowerCase());
8141
+ function er(e) {
8142
+ return $a.has(j.default.extname(e).toLowerCase());
7636
8143
  }
7637
- function Qt(e) {
8144
+ function tr(e) {
7638
8145
  return new Error(
7639
- `Tein uploads image, video and audio files only, and ${B.default.basename(e)} is not one.`,
8146
+ `Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
7640
8147
  );
7641
8148
  }
7642
- function _i(e) {
8149
+ function Ca(e) {
7643
8150
  let t = e.trim();
7644
8151
  if (
7645
8152
  !t ||
@@ -7649,27 +8156,27 @@ function _i(e) {
7649
8156
  `)
7650
8157
  )
7651
8158
  return null;
7652
- let r = B.default.resolve(t);
7653
- return O.default.existsSync(r) && O.default.statSync(r).isFile() ? r : null;
8159
+ let r = j.default.resolve(t);
8160
+ return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
7654
8161
  }
7655
- function ze(e) {
8162
+ function We(e) {
7656
8163
  if (Array.isArray(e))
7657
8164
  for (let t of e) {
7658
8165
  let r = t;
7659
8166
  typeof r.name == 'string' &&
7660
8167
  r.inputSchema &&
7661
8168
  typeof r.inputSchema == 'object' &&
7662
- Q.set(r.name, r.inputSchema);
8169
+ X.set(r.name, r.inputSchema);
7663
8170
  }
7664
8171
  }
7665
- function Mi() {
7666
- (Q.clear(), (Ge = 0));
8172
+ function Ea() {
8173
+ (X.clear(), (Je = 0));
7667
8174
  }
7668
- async function Ki(e, t) {
7669
- if (!(Date.now() - Ge < 6e4)) {
7670
- Ge = Date.now();
8175
+ async function Aa(e, t) {
8176
+ if (!(Date.now() - Je < 6e4)) {
8177
+ Je = Date.now();
7671
8178
  try {
7672
- let i = await (
8179
+ let a = await (
7673
8180
  await fetch(e, {
7674
8181
  method: 'POST',
7675
8182
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
@@ -7677,39 +8184,39 @@ async function Ki(e, t) {
7677
8184
  signal: AbortSignal.timeout(1e4),
7678
8185
  })
7679
8186
  ).json();
7680
- ze(i.result?.tools);
8187
+ We(a.result?.tools);
7681
8188
  } catch {}
7682
8189
  }
7683
8190
  }
7684
- function Si(e) {
8191
+ function Oa(e) {
7685
8192
  return e
7686
8193
  ? e.type === 'string'
7687
8194
  ? e.format === 'uri'
7688
8195
  : e.type === 'array' && e.items?.format === 'uri'
7689
8196
  : !1;
7690
8197
  }
7691
- async function Gt(e, t, r) {
8198
+ async function Wt(e, t, r) {
7692
8199
  if (typeof e != 'string') return e;
7693
- let i = _i(e);
7694
- if (!i) return e;
7695
- if (!Yt(i)) throw Qt(i);
7696
- return (await Wt(i, t, r)).url;
8200
+ let a = Ca(e);
8201
+ if (!a) return e;
8202
+ if (!er(a)) throw tr(a);
8203
+ return (await Zt(a, t, r)).url;
7697
8204
  }
7698
- async function Xt(e, t, r, i, s) {
7699
- (Q.size === 0 && ze(je()), Q.has(e) || (await Ki(s, r)));
7700
- let n = Q.get(e)?.properties;
7701
- if (!n) return t;
8205
+ async function rr(e, t, r, a, n) {
8206
+ (X.size === 0 && We(He()), X.has(e) || (await Aa(n, r)));
8207
+ let s = X.get(e)?.properties;
8208
+ if (!s) return t;
7702
8209
  let o = { ...t };
7703
8210
  for (let [u, l] of Object.entries(t))
7704
- if (Si(n[u]))
8211
+ if (Oa(s[u]))
7705
8212
  if (Array.isArray(l)) {
7706
8213
  let c = [];
7707
- for (let p of l) c.push(await Gt(p, r, i));
8214
+ for (let p of l) c.push(await Wt(p, r, a));
7708
8215
  o[u] = c;
7709
- } else o[u] = await Gt(l, r, i);
8216
+ } else o[u] = await Wt(l, r, a);
7710
8217
  return o;
7711
8218
  }
7712
- function qi(e) {
8219
+ function Ra(e) {
7713
8220
  let t = e.id ?? null;
7714
8221
  switch (e.method) {
7715
8222
  case 'initialize':
@@ -7727,7 +8234,7 @@ function qi(e) {
7727
8234
  case 'ping':
7728
8235
  return { jsonrpc: '2.0', id: t, result: {} };
7729
8236
  case 'tools/list':
7730
- return { jsonrpc: '2.0', id: t, result: { tools: je() } };
8237
+ return { jsonrpc: '2.0', id: t, result: { tools: He() } };
7731
8238
  case 'tools/call':
7732
8239
  return {
7733
8240
  jsonrpc: '2.0',
@@ -7750,25 +8257,25 @@ function qi(e) {
7750
8257
  };
7751
8258
  }
7752
8259
  }
7753
- async function Zt() {
7754
- if (zt) return;
7755
- zt = !0;
7756
- let e = Ti(),
7757
- t = x(),
8260
+ async function ar() {
8261
+ if (Yt) return;
8262
+ Yt = !0;
8263
+ let e = qa(),
8264
+ t = P(),
7758
8265
  r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
7759
- (Jt.default
8266
+ (Qt.default
7760
8267
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
7761
- .on('line', async (s) => {
7762
- let n = s.trim();
7763
- if (n)
8268
+ .on('line', async (n) => {
8269
+ let s = n.trim();
8270
+ if (s)
7764
8271
  try {
7765
- let o = JSON.parse(n);
8272
+ let o = JSON.parse(s);
7766
8273
  if (o && o.method === 'tools/call' && o.params) {
7767
8274
  let l = o.params.name,
7768
8275
  c = o.params.arguments || {};
7769
8276
  if (l === 'get_pricing') {
7770
8277
  let p = typeof c.model == 'string' ? c.model.trim() : '',
7771
- d = `${t.replace(/\/+$/, '')}${me(p)}`;
8278
+ d = `${t.replace(/\/+$/, '')}${fe(p)}`;
7772
8279
  try {
7773
8280
  let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
7774
8281
  h = await m.text();
@@ -7815,19 +8322,19 @@ async function Zt() {
7815
8322
  !p.startsWith('data:')
7816
8323
  )
7817
8324
  try {
7818
- let d = B.default.resolve(p.trim());
7819
- if (O.default.existsSync(d) && O.default.statSync(d).isFile() && e) {
7820
- if (!Yt(d)) throw Qt(d);
7821
- let m = await Wt(d, e, t),
8325
+ let d = j.default.resolve(p.trim());
8326
+ if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
8327
+ if (!er(d)) throw tr(d);
8328
+ let m = await Zt(d, e, t),
7822
8329
  h = (m.sizeBytes / 1024).toFixed(1),
7823
- fe =
8330
+ ge =
7824
8331
  m.mimeType.startsWith('image/') ||
7825
8332
  /\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
7826
8333
  ? `
7827
8334
 
7828
8335
  ![Uploaded Asset](${m.url})`
7829
8336
  : '',
7830
- ge = {
8337
+ he = {
7831
8338
  jsonrpc: '2.0',
7832
8339
  id: o.id,
7833
8340
  result: {
@@ -7838,7 +8345,7 @@ async function Zt() {
7838
8345
 
7839
8346
  - **URL:** ${m.url}
7840
8347
  - **Type:** \`${m.mimeType}\`
7841
- - **Size:** ${h} KB${fe}
8348
+ - **Size:** ${h} KB${ge}
7842
8349
 
7843
8350
  Pass this URL to any Tein generation tool.`,
7844
8351
  },
@@ -7847,7 +8354,7 @@ Pass this URL to any Tein generation tool.`,
7847
8354
  },
7848
8355
  };
7849
8356
  process.stdout.write(
7850
- JSON.stringify(ge) +
8357
+ JSON.stringify(he) +
7851
8358
  `
7852
8359
  `,
7853
8360
  );
@@ -7874,7 +8381,7 @@ Pass this URL to any Tein generation tool.`,
7874
8381
  }
7875
8382
  if (e)
7876
8383
  try {
7877
- o.params.arguments = await Xt(String(l), c, e, t, r);
8384
+ o.params.arguments = await rr(String(l), c, e, t, r);
7878
8385
  } catch (p) {
7879
8386
  let d = p instanceof Error ? p.message : String(p);
7880
8387
  process.stdout.write(
@@ -7905,10 +8412,10 @@ Pass this URL to any Tein generation tool.`,
7905
8412
  body: JSON.stringify(o),
7906
8413
  }),
7907
8414
  c = await l.text(),
7908
- p = Ht(o, l.status, c);
8415
+ p = Xt(o, l.status, c);
7909
8416
  if (p === null) return;
7910
8417
  if (p) {
7911
- (o?.method === 'tools/list' && ze(p.result?.tools),
8418
+ (o?.method === 'tools/list' && We(p.result?.tools),
7912
8419
  process.stdout.write(
7913
8420
  JSON.stringify(p) +
7914
8421
  `
@@ -7917,7 +8424,7 @@ Pass this URL to any Tein generation tool.`,
7917
8424
  return;
7918
8425
  }
7919
8426
  } catch {}
7920
- let u = qi(o);
8427
+ let u = Ra(o);
7921
8428
  u !== null &&
7922
8429
  process.stdout.write(
7923
8430
  JSON.stringify(u) +
@@ -7940,22 +8447,22 @@ Pass this URL to any Tein generation tool.`,
7940
8447
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
7941
8448
  `));
7942
8449
  }
7943
- var O,
7944
- B,
7945
- Jt,
7946
- vi,
7947
- Q,
7948
- Ge,
7949
- zt,
7950
- tr = b(() => {
8450
+ var D,
8451
+ j,
8452
+ Qt,
8453
+ $a,
8454
+ X,
8455
+ Je,
8456
+ Yt,
8457
+ nr = y(() => {
7951
8458
  'use strict';
7952
- ((O = P(require('node:fs'))),
7953
- (B = P(require('node:path'))),
7954
- (Jt = P(require('node:readline'))));
7955
- Le();
7956
- jt();
7957
- C();
7958
- vi = new Set([
8459
+ ((D = _(require('node:fs'))),
8460
+ (j = _(require('node:path'))),
8461
+ (Qt = _(require('node:readline'))));
8462
+ Ue();
8463
+ Jt();
8464
+ A();
8465
+ $a = new Set([
7959
8466
  '.png',
7960
8467
  '.jpg',
7961
8468
  '.jpeg',
@@ -7981,22 +8488,22 @@ var O,
7981
8488
  '.flac',
7982
8489
  '.opus',
7983
8490
  ]);
7984
- ((Q = new Map()), (Ge = 0));
7985
- zt = !1;
8491
+ ((X = new Map()), (Je = 0));
8492
+ Yt = !1;
7986
8493
  require.main === module &&
7987
- Zt().catch((e) => {
8494
+ ar().catch((e) => {
7988
8495
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
7989
8496
  `),
7990
8497
  process.exit(1));
7991
8498
  });
7992
8499
  });
7993
- var dr =
8500
+ var fr =
7994
8501
  !process.env.NO_COLOR &&
7995
8502
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
7996
8503
  function k(e, t) {
7997
- return (r) => (dr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
8504
+ return (r) => (fr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
7998
8505
  }
7999
- var a = {
8506
+ var i = {
8000
8507
  bold: k(1, 22),
8001
8508
  dim: k(2, 22),
8002
8509
  italic: k(3, 23),
@@ -8016,7 +8523,7 @@ var a = {
8016
8523
  bgCyan: k(46, 49),
8017
8524
  bgGreen: k(42, 49),
8018
8525
  },
8019
- _ = class {
8526
+ T = class {
8020
8527
  constructor(t = '') {
8021
8528
  this.frames = [
8022
8529
  '\u280B',
@@ -8040,7 +8547,7 @@ var a = {
8040
8547
  process.stdout.isTTY
8041
8548
  ? (this.stop(),
8042
8549
  (this.timer = setInterval(() => {
8043
- let r = a.cyan(this.frames[this.current]);
8550
+ let r = i.cyan(this.frames[this.current]);
8044
8551
  (process.stdout.write(`\r${r} ${this.text} `),
8045
8552
  (this.current = (this.current + 1) % this.frames.length));
8046
8553
  }, 80)),
@@ -8057,7 +8564,7 @@ var a = {
8057
8564
  this.stop();
8058
8565
  let r = t || this.text;
8059
8566
  process.stdout.isTTY
8060
- ? process.stdout.write(`\r${a.green('\u2713')} ${r}
8567
+ ? process.stdout.write(`\r${i.green('\u2713')} ${r}
8061
8568
  `)
8062
8569
  : process.stdout.write(`[\u2713] ${r}
8063
8570
  `);
@@ -8066,7 +8573,7 @@ var a = {
8066
8573
  this.stop();
8067
8574
  let r = t || this.text;
8068
8575
  process.stdout.isTTY
8069
- ? process.stdout.write(`\r${a.red('\u2717')} ${r}
8576
+ ? process.stdout.write(`\r${i.red('\u2717')} ${r}
8070
8577
  `)
8071
8578
  : process.stdout.write(`[\u2717] ${r}
8072
8579
  `);
@@ -8078,76 +8585,76 @@ var a = {
8078
8585
  process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
8079
8586
  }
8080
8587
  };
8081
- var D = P(require('node:fs')),
8082
- A = P(require('node:path'));
8083
- var ee = P(require('node:fs')),
8084
- We = P(require('node:path')),
8085
- Ye = require('node:stream/promises');
8588
+ var V = _(require('node:fs')),
8589
+ $ = _(require('node:path'));
8590
+ var ee = _(require('node:fs')),
8591
+ Ze = _(require('node:path')),
8592
+ et = require('node:stream/promises');
8086
8593
  var Z = '1.1.7';
8087
- var cr = new Set([
8594
+ var gr = new Set([
8088
8595
  'account_suspended',
8089
8596
  'account_terminated',
8090
8597
  'creative_mode_restricted',
8091
8598
  'unfiltered_restricted',
8092
8599
  'workspace_paused',
8093
8600
  ]),
8094
- T = 1,
8095
- ur = 3,
8601
+ v = 1,
8602
+ hr = 3,
8096
8603
  w = class extends Error {
8097
- constructor(t, r, i, s = {}) {
8604
+ constructor(t, r, a, n = {}) {
8098
8605
  (super(r),
8099
8606
  (this.name = 'TeinApiError'),
8100
8607
  (this.status = t),
8101
- i && (this.code = i),
8102
- (this.fields = s));
8608
+ a && (this.code = a),
8609
+ (this.fields = n));
8103
8610
  }
8104
8611
  get exitCode() {
8105
- return this.code && cr.has(this.code) ? ur : T;
8612
+ return this.code && gr.has(this.code) ? hr : v;
8106
8613
  }
8107
8614
  };
8108
- function mr(e, t, r) {
8109
- let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
8110
- if (!r || typeof r != 'object') return new w(e, i);
8111
- let s = r;
8112
- if (s.error && typeof s.error == 'object' && !Array.isArray(s.error)) {
8113
- let p = s.error,
8615
+ function yr(e, t, r) {
8616
+ let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
8617
+ if (!r || typeof r != 'object') return new w(e, a);
8618
+ let n = r;
8619
+ if (n.error && typeof n.error == 'object' && !Array.isArray(n.error)) {
8620
+ let p = n.error,
8114
8621
  { code: d, message: m, ...h } = p;
8115
- return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
8622
+ return new w(e, typeof m == 'string' && m ? m : a, typeof d == 'string' ? d : void 0, h);
8116
8623
  }
8117
- let { error: n, code: o, message: u, ...l } = s,
8118
- c = (typeof n == 'string' && n) || (typeof u == 'string' && u) || i;
8624
+ let { error: s, code: o, message: u, ...l } = n,
8625
+ c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
8119
8626
  return new w(e, c, typeof o == 'string' ? o : void 0, l);
8120
8627
  }
8121
- function Je(e) {
8628
+ function Qe(e) {
8122
8629
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
8123
8630
  }
8124
- function K(e) {
8631
+ function S(e) {
8125
8632
  let t = [e.message],
8126
- r = Je(e.fields.required),
8127
- i = Je(e.fields.balance);
8128
- (r || i) &&
8129
- t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
8130
- let s = e.fields.org_name ?? e.fields.orgName;
8131
- typeof s == 'string' && s && t.push(`Workspace: ${s}`);
8132
- let n = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
8133
- return (typeof n == 'string' && n && t.push(n), e.code && t.push(`(${e.code})`), t);
8633
+ r = Qe(e.fields.required),
8634
+ a = Qe(e.fields.balance);
8635
+ (r || a) &&
8636
+ t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
8637
+ let n = e.fields.org_name ?? e.fields.orgName;
8638
+ typeof n == 'string' && n && t.push(`Workspace: ${n}`);
8639
+ let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
8640
+ return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
8134
8641
  }
8135
- function fr(e) {
8642
+ function br(e) {
8136
8643
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
8137
8644
  ? 'video'
8138
8645
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
8139
8646
  ? 'audio'
8140
8647
  : 'image';
8141
8648
  }
8142
- function He(e) {
8649
+ function Xe(e) {
8143
8650
  let t = [];
8144
8651
  for (let r of e.data ?? [])
8145
8652
  typeof r.message?.content == 'string'
8146
8653
  ? t.push({ type: 'text', text: r.message.content })
8147
- : r.url && t.push({ type: fr(r.url), url: r.url });
8654
+ : r.url && t.push({ type: br(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
8148
8655
  return t;
8149
8656
  }
8150
- var M = class {
8657
+ var K = class {
8151
8658
  constructor(t, r) {
8152
8659
  ((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
8153
8660
  }
@@ -8159,56 +8666,56 @@ var M = class {
8159
8666
  'X-Tein-Client': 'cli',
8160
8667
  };
8161
8668
  }
8162
- async send(t, r, i) {
8163
- let s = await fetch(`${this.baseUrl}${r}`, {
8669
+ async send(t, r, a) {
8670
+ let n = await fetch(`${this.baseUrl}${r}`, {
8164
8671
  method: t,
8165
8672
  headers: this.getHeaders(),
8166
- ...(i === void 0 ? {} : { body: JSON.stringify(i) }),
8673
+ ...(a === void 0 ? {} : { body: JSON.stringify(a) }),
8167
8674
  });
8168
- if (!s.ok) {
8169
- let n = null;
8675
+ if (!n.ok) {
8676
+ let s = null;
8170
8677
  try {
8171
- n = await s.json();
8678
+ s = await n.json();
8172
8679
  } catch {}
8173
- throw mr(s.status, s.statusText, n);
8680
+ throw yr(n.status, n.statusText, s);
8174
8681
  }
8175
- return await s.json();
8682
+ return await n.json();
8176
8683
  }
8177
8684
  async checkKey() {
8178
8685
  await this.send('GET', '/v1/jobs?limit=1');
8179
8686
  }
8180
8687
  queueJob(t, r) {
8181
- return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
8182
- let s = i.status,
8183
- n =
8184
- s === 'succeeded' || s === 'failed' || s === 'expired' || s === 'cancelled'
8185
- ? s
8688
+ return this.send('POST', '/v1/generate', { model: t, ...r }).then((a) => {
8689
+ let n = a.status,
8690
+ s =
8691
+ n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
8692
+ ? n
8186
8693
  : 'processing',
8187
- o = He(i);
8694
+ o = Xe(a);
8188
8695
  return {
8189
- request_id: i.request_id || i.id || '',
8190
- model: i.model,
8191
- status: n,
8696
+ request_id: a.request_id || a.id || '',
8697
+ model: a.model,
8698
+ status: s,
8192
8699
  ...(o.length ? { output: o } : {}),
8193
- error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
8194
- ...(i.usage ? { usage: i.usage } : {}),
8700
+ error: a.error && typeof a.error.message == 'string' ? a.error.message : null,
8701
+ ...(a.usage ? { usage: a.usage } : {}),
8195
8702
  };
8196
8703
  });
8197
8704
  }
8198
8705
  getStatus(t) {
8199
8706
  return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
8200
- let i = r.status,
8201
- s =
8202
- i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
8203
- ? i
8707
+ let a = r.status,
8708
+ n =
8709
+ a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
8710
+ ? a
8204
8711
  : 'processing',
8205
- n = He(r),
8712
+ s = Xe(r),
8206
8713
  o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
8207
8714
  return {
8208
8715
  request_id: r.id || t,
8209
8716
  model: r.model,
8210
- status: s,
8211
- ...(n.length ? { output: n } : {}),
8717
+ status: n,
8718
+ ...(s.length ? { output: s } : {}),
8212
8719
  error: o,
8213
8720
  ...(r.usage ? { usage: r.usage } : {}),
8214
8721
  };
@@ -8218,65 +8725,65 @@ var M = class {
8218
8725
  return this.send('POST', '/v1/upload', { data: t });
8219
8726
  }
8220
8727
  async downloadOutput(t, r) {
8221
- let i = await fetch(t);
8222
- if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
8223
- let s = We.default.dirname(r);
8224
- ee.default.existsSync(s) || ee.default.mkdirSync(s, { recursive: !0 });
8225
- let n = ee.default.createWriteStream(r);
8226
- return (await (0, Ye.pipeline)(i.body, n), r);
8728
+ let a = await fetch(t);
8729
+ if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
8730
+ let n = Ze.default.dirname(r);
8731
+ ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
8732
+ let s = ee.default.createWriteStream(r);
8733
+ return (await (0, et.pipeline)(a.body, s), r);
8227
8734
  }
8228
8735
  };
8229
- C();
8230
- function ke(e) {
8736
+ A();
8737
+ function xe(e) {
8231
8738
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
8232
8739
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
8233
8740
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
8234
8741
  r = 10 ** t,
8235
- i = Math.round(Number((e * r).toFixed(6))) / r;
8236
- return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
8742
+ a = Math.round(Number((e * r).toFixed(6))) / r;
8743
+ return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
8237
8744
  }
8238
- H();
8239
- var $t = ['images', 'input_images', 'videos', 'audios'];
8240
- function Wr(e) {
8241
- for (let t of $t) typeof e[t] == 'string' && (e[t] = [e[t]]);
8745
+ W();
8746
+ var Ot = ['images', 'input_images', 'videos', 'audios'];
8747
+ function ea(e) {
8748
+ for (let t of Ot) typeof e[t] == 'string' && (e[t] = [e[t]]);
8242
8749
  }
8243
- function Yr(e) {
8750
+ function ta(e) {
8244
8751
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
8245
- let t = A.default.resolve(e);
8246
- return D.default.existsSync(t) && D.default.statSync(t).isFile() ? t : null;
8752
+ let t = $.default.resolve(e);
8753
+ return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
8247
8754
  }
8248
- async function Qr(e, t) {
8249
- for (let r of $t) {
8755
+ async function ra(e, t) {
8756
+ for (let r of Ot) {
8250
8757
  if (!Array.isArray(e[r])) continue;
8251
- let i = [];
8252
- for (let s of e[r]) {
8253
- if (typeof s != 'string') continue;
8254
- let n = Yr(s);
8255
- i.push(n ? await t(n) : s);
8758
+ let a = [];
8759
+ for (let n of e[r]) {
8760
+ if (typeof n != 'string') continue;
8761
+ let s = ta(n);
8762
+ a.push(s ? await t(s) : n);
8256
8763
  }
8257
- e[r] = i;
8764
+ e[r] = a;
8258
8765
  }
8259
8766
  }
8260
- var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
8261
- function Xr(e) {
8767
+ var Y = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
8768
+ function aa(e) {
8262
8769
  if (e.count === void 0 || e.count === !0) return 1;
8263
8770
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
8264
- r = W.enterprise;
8771
+ r = Y.enterprise;
8265
8772
  return (
8266
8773
  (!Number.isInteger(t) || t < 1 || t > r) &&
8267
8774
  (process.stderr
8268
- .write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${W.starter}, Plus ${W.plus}, Scale ${W.scale}, Enterprise ${W.enterprise} at once, including polling.
8775
+ .write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Y.starter}, Plus ${Y.plus}, Scale ${Y.scale}, Enterprise ${Y.enterprise} at once, including polling.
8269
8776
  `),
8270
8777
  process.exit(1)),
8271
8778
  t
8272
8779
  );
8273
8780
  }
8274
- async function Zr(e, t, r, i, s) {
8275
- s.isJson ||
8276
- process.stderr.write(`Starting ${i} ${t} jobs together...
8781
+ async function ia(e, t, r, a, n) {
8782
+ n.isJson ||
8783
+ process.stderr.write(`Starting ${a} ${t} jobs together...
8277
8784
  `);
8278
- let n = await Promise.all(
8279
- Array.from({ length: i }, async () => {
8785
+ let s = await Promise.all(
8786
+ Array.from({ length: a }, async () => {
8280
8787
  try {
8281
8788
  return { job: await e.queueJob(t, r) };
8282
8789
  } catch (l) {
@@ -8286,7 +8793,7 @@ async function Zr(e, t, r, i, s) {
8286
8793
  ),
8287
8794
  o = [],
8288
8795
  u = [];
8289
- for (let l of n)
8796
+ for (let l of s)
8290
8797
  'job' in l && l.job
8291
8798
  ? o.push(l.job)
8292
8799
  : 'err' in l &&
@@ -8295,13 +8802,13 @@ async function Zr(e, t, r, i, s) {
8295
8802
  ? l.err
8296
8803
  : new w(0, l.err instanceof Error ? l.err.message : String(l.err)),
8297
8804
  );
8298
- if (!s.isAsync) {
8805
+ if (!n.isAsync) {
8299
8806
  let l = Date.now(),
8300
8807
  c = o.filter((p) => p.status === 'processing' && p.request_id);
8301
8808
  for (; c.length;) {
8302
- if ((await new Promise((d) => setTimeout(d, 2e3)), !s.isJson)) {
8809
+ if ((await new Promise((d) => setTimeout(d, 2e3)), !n.isJson)) {
8303
8810
  let d = Math.round((Date.now() - l) / 1e3);
8304
- process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
8811
+ process.stderr.write(`Waiting on ${c.length} of ${a} (${d}s)...
8305
8812
  `);
8306
8813
  }
8307
8814
  let p = await Promise.all(
@@ -8320,7 +8827,7 @@ async function Zr(e, t, r, i, s) {
8320
8827
  c = o.filter((d) => d.status === 'processing' && d.request_id);
8321
8828
  }
8322
8829
  }
8323
- if (s.isJson)
8830
+ if (n.isJson)
8324
8831
  process.stdout.write(
8325
8832
  JSON.stringify(
8326
8833
  { jobs: o, errors: u.map((l) => ({ code: l.code ?? null, message: l.message })) },
@@ -8333,32 +8840,37 @@ async function Zr(e, t, r, i, s) {
8333
8840
  else {
8334
8841
  for (let l of o)
8335
8842
  (process.stdout.write(`${l.request_id} ${l.status}`),
8336
- l.usage?.cost !== void 0 && process.stdout.write(` ${ke(l.usage.cost)}`),
8843
+ l.usage?.cost !== void 0 && process.stdout.write(` ${xe(l.usage.cost)}`),
8337
8844
  l.error && process.stdout.write(` ${l.error}`),
8338
8845
  process.stdout.write(`
8339
8846
  `));
8340
8847
  for (let l of u)
8341
- process.stderr.write(`${K(l).join(`
8848
+ process.stderr.write(`${S(l).join(`
8342
8849
  `)}
8343
8850
  `);
8344
8851
  }
8345
8852
  (u.length ||
8346
8853
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
8347
- process.exit(T);
8854
+ process.exit(v);
8855
+ }
8856
+ function na(e, t, r) {
8857
+ if (r <= 1) return e;
8858
+ let a = $.default.extname(e);
8859
+ return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
8348
8860
  }
8349
- function Ct(e) {
8861
+ function Rt(e) {
8350
8862
  let t = {},
8351
8863
  r = new Set(),
8352
- i = [];
8353
- for (let s = 0; s < e.length; s++) {
8354
- let n = e[s];
8355
- if (n.startsWith('--')) {
8356
- let o = n.slice(2);
8864
+ a = [];
8865
+ for (let n = 0; n < e.length; n++) {
8866
+ let s = e[n];
8867
+ if (s.startsWith('--')) {
8868
+ let o = s.slice(2);
8357
8869
  if (o.includes('=')) {
8358
8870
  let [u, l] = o.split('=', 2);
8359
8871
  t[u.replace(/-/g, '_')] = l;
8360
- } else if (s + 1 < e.length && !e[s + 1].startsWith('-')) {
8361
- let u = e[s + 1];
8872
+ } else if (n + 1 < e.length && !e[n + 1].startsWith('-')) {
8873
+ let u = e[n + 1];
8362
8874
  (u === 'true'
8363
8875
  ? (t[o.replace(/-/g, '_')] = !0)
8364
8876
  : u === 'false'
@@ -8366,10 +8878,10 @@ function Ct(e) {
8366
8878
  : /^-?\d+(\.\d+)?$/.test(u)
8367
8879
  ? (t[o.replace(/-/g, '_')] = Number(u))
8368
8880
  : (t[o.replace(/-/g, '_')] = u),
8369
- s++);
8881
+ n++);
8370
8882
  } else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
8371
- } else if (n.startsWith('-') && n.length === 2) {
8372
- let o = n[1],
8883
+ } else if (s.startsWith('-') && s.length === 2) {
8884
+ let o = s[1],
8373
8885
  l =
8374
8886
  {
8375
8887
  p: 'prompt',
@@ -8384,36 +8896,36 @@ function Ct(e) {
8384
8896
  }[o] || o;
8385
8897
  o === 'j' || o === 'h' || o === 'v'
8386
8898
  ? ((t[l] = !0), r.add(l))
8387
- : s + 1 < e.length && !e[s + 1].startsWith('-')
8388
- ? ((t[l] = e[s + 1]), s++)
8899
+ : n + 1 < e.length && !e[n + 1].startsWith('-')
8900
+ ? ((t[l] = e[n + 1]), n++)
8389
8901
  : (t[l] = !0);
8390
- } else i.push(n);
8902
+ } else a.push(s);
8391
8903
  }
8392
- return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
8904
+ return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
8393
8905
  }
8394
- async function De(e, t) {
8395
- let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
8396
- i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
8906
+ async function Ne(e, t) {
8907
+ let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
8908
+ a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
8397
8909
  (r ||
8398
- (process.stderr.write(`${a.red('Error:')} Authentication required.
8910
+ (process.stderr.write(`${i.red('Error:')} Authentication required.
8399
8911
  `),
8400
8912
  process.stderr
8401
- .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
8913
+ .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
8402
8914
  `),
8403
8915
  process.exit(1)),
8404
8916
  e ||
8405
- (process.stderr.write(`${a.red('Error:')} Missing model slug.
8917
+ (process.stderr.write(`${i.red('Error:')} Missing model slug.
8406
8918
  `),
8407
- process.stderr.write(`Usage: ${a.cyan('tein run <model-slug> --prompt "..."')}
8919
+ process.stderr.write(`Usage: ${i.cyan('tein run <model-slug> --prompt "..."')}
8408
8920
  `),
8409
- process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
8921
+ process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
8410
8922
  `),
8411
8923
  process.exit(1)));
8412
- let s = U(e),
8413
- n = !!t.json,
8924
+ let n = F(e),
8925
+ s = !!t.json,
8414
8926
  o = !!(t.async || t.no_wait),
8415
8927
  u = typeof t.output == 'string' ? t.output : void 0,
8416
- l = Xr(t),
8928
+ l = aa(t),
8417
8929
  c = { ...t };
8418
8930
  (delete c.json,
8419
8931
  delete c.async,
@@ -8422,76 +8934,84 @@ async function De(e, t) {
8422
8934
  delete c.api_key,
8423
8935
  delete c.api_url,
8424
8936
  delete c.count);
8425
- let p = qt(s, c);
8426
- (Wr(p),
8427
- typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
8937
+ let p = At(n, c);
8938
+ (ea(p),
8939
+ typeof p.image == 'string' && !p.images && !me(n) && ((p.images = [p.image]), delete p.image),
8428
8940
  p.image_url &&
8429
8941
  !p.first_frame_image &&
8430
8942
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
8431
8943
  (p.first_frame_image = p.image_url));
8432
- let d = new M(r, i),
8433
- m = ['image', 'first_frame_image', 'last_frame_image', 'lipsyncing_audio', 'audio', 'video'];
8434
- for (let y of m) {
8435
- let f = p[y];
8436
- if (typeof f == 'string' && !f.startsWith('http://') && !f.startsWith('https://')) {
8437
- let I = A.default.resolve(f);
8438
- if (D.default.existsSync(I) && D.default.statSync(I).isFile()) {
8439
- let v = new _(`Uploading local file ${A.default.basename(I)} to CDN...`);
8440
- n || v.start();
8944
+ let d = new K(r, a),
8945
+ m = [
8946
+ 'image',
8947
+ 'mask_image',
8948
+ 'first_frame_image',
8949
+ 'last_frame_image',
8950
+ 'lipsyncing_audio',
8951
+ 'audio',
8952
+ 'video',
8953
+ ];
8954
+ for (let b of m) {
8955
+ let g = p[b];
8956
+ if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
8957
+ let x = $.default.resolve(g);
8958
+ if (V.default.existsSync(x) && V.default.statSync(x).isFile()) {
8959
+ let I = new T(`Uploading local file ${$.default.basename(x)} to CDN...`);
8960
+ s || I.start();
8441
8961
  try {
8442
- let F = D.default.readFileSync(I),
8443
- X = await d.uploadAsset(F.toString('base64'));
8444
- ((p[y] = X.url), n || v.succeed(`Uploaded ${A.default.basename(I)} to CDN`));
8445
- } catch (F) {
8446
- let X = F instanceof Error ? F.message : String(F);
8447
- (n
8962
+ let L = V.default.readFileSync(x),
8963
+ C = await d.uploadAsset(L.toString('base64'));
8964
+ ((p[b] = C.url), s || I.succeed(`Uploaded ${$.default.basename(x)} to CDN`));
8965
+ } catch (L) {
8966
+ let C = L instanceof Error ? L.message : String(L);
8967
+ (s
8448
8968
  ? process.stdout.write(
8449
- JSON.stringify({ error: X }) +
8969
+ JSON.stringify({ error: C }) +
8450
8970
  `
8451
8971
  `,
8452
8972
  )
8453
- : v.fail(`Upload failed: ${X}`),
8973
+ : I.fail(`Upload failed: ${C}`),
8454
8974
  process.exit(1));
8455
8975
  }
8456
8976
  }
8457
8977
  }
8458
8978
  }
8459
- await Qr(p, async (y) => {
8460
- let f = new _(`Uploading local file ${A.default.basename(y)} to CDN...`);
8461
- n || f.start();
8979
+ await ra(p, async (b) => {
8980
+ let g = new T(`Uploading local file ${$.default.basename(b)} to CDN...`);
8981
+ s || g.start();
8462
8982
  try {
8463
- let I = D.default.readFileSync(y),
8464
- v = await d.uploadAsset(I.toString('base64'));
8465
- return (n || f.succeed(`Uploaded ${A.default.basename(y)} to CDN`), v.url);
8466
- } catch (I) {
8467
- let v = I instanceof Error ? I.message : String(I);
8468
- (n
8983
+ let x = V.default.readFileSync(b),
8984
+ I = await d.uploadAsset(x.toString('base64'));
8985
+ return (s || g.succeed(`Uploaded ${$.default.basename(b)} to CDN`), I.url);
8986
+ } catch (x) {
8987
+ let I = x instanceof Error ? x.message : String(x);
8988
+ (s
8469
8989
  ? process.stdout.write(
8470
- JSON.stringify({ error: v }) +
8990
+ JSON.stringify({ error: I }) +
8471
8991
  `
8472
8992
  `,
8473
8993
  )
8474
- : f.fail(`Upload failed: ${v}`),
8994
+ : g.fail(`Upload failed: ${I}`),
8475
8995
  process.exit(1));
8476
8996
  }
8477
8997
  });
8478
- let h = new _(`Submitting task for ${a.bold(e)}...`);
8479
- n || h.start();
8480
- let g;
8998
+ let h = new T(`Submitting task for ${i.bold(e)}...`);
8999
+ s || h.start();
9000
+ let f;
8481
9001
  try {
8482
9002
  if (l > 1) {
8483
- await Zr(d, e, p, l, { isJson: n, isAsync: o });
9003
+ await ia(d, e, p, l, { isJson: s, isAsync: o });
8484
9004
  return;
8485
9005
  }
8486
- g = await d.queueJob(e, p);
8487
- } catch (y) {
8488
- let f = y instanceof w ? y : null;
8489
- (n
9006
+ f = await d.queueJob(e, p);
9007
+ } catch (b) {
9008
+ let g = b instanceof w ? b : null;
9009
+ (s
8490
9010
  ? process.stdout.write(
8491
9011
  JSON.stringify(
8492
- f
8493
- ? { error: { code: f.code ?? null, message: f.message, ...f.fields } }
8494
- : { error: { code: null, message: y instanceof Error ? y.message : String(y) } },
9012
+ g
9013
+ ? { error: { code: g.code ?? null, message: g.message, ...g.fields } }
9014
+ : { error: { code: null, message: b instanceof Error ? b.message : String(b) } },
8495
9015
  null,
8496
9016
  2,
8497
9017
  ) +
@@ -8499,59 +9019,59 @@ async function De(e, t) {
8499
9019
  `,
8500
9020
  )
8501
9021
  : h.fail(
8502
- f
8503
- ? K(f).join(`
9022
+ g
9023
+ ? S(g).join(`
8504
9024
  `)
8505
- : `Failed to start generation: ${y instanceof Error ? y.message : y}`,
9025
+ : `Failed to start generation: ${b instanceof Error ? b.message : b}`,
8506
9026
  ),
8507
- process.exit(f ? f.exitCode : T));
9027
+ process.exit(g ? g.exitCode : v));
8508
9028
  }
8509
9029
  if (o) {
8510
- n
9030
+ s
8511
9031
  ? process.stdout.write(
8512
- JSON.stringify(g, null, 2) +
9032
+ JSON.stringify(f, null, 2) +
8513
9033
  `
8514
9034
  `,
8515
9035
  )
8516
- : (h.succeed(`Queued successfully! Request ID: ${a.bold(g.request_id)}`),
8517
- process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${g.request_id}`)}
9036
+ : (h.succeed(`Queued successfully! Request ID: ${i.bold(f.request_id)}`),
9037
+ process.stdout.write(`Check status anytime with: ${i.cyan(`tein status ${f.request_id}`)}
8518
9038
  `));
8519
9039
  return;
8520
9040
  }
8521
- let fe = Date.now(),
8522
- ge = 1500;
8523
- for (; g.status === 'processing';) {
8524
- let y = Math.round((Date.now() - fe) / 1e3);
8525
- (n || h.update(`Rendering ${a.bold(e)} (${y}s elapsed)... [ID: ${g.request_id}]`),
8526
- await new Promise((f) => setTimeout(f, ge)));
9041
+ let ge = Date.now(),
9042
+ he = 1500;
9043
+ for (; f.status === 'processing';) {
9044
+ let b = Math.round((Date.now() - ge) / 1e3);
9045
+ (s || h.update(`Rendering ${i.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
9046
+ await new Promise((g) => setTimeout(g, he)));
8527
9047
  try {
8528
- g = await d.getStatus(g.request_id);
8529
- } catch (f) {
8530
- f instanceof w &&
8531
- f.exitCode !== T &&
8532
- (n ||
9048
+ f = await d.getStatus(f.request_id);
9049
+ } catch (g) {
9050
+ g instanceof w &&
9051
+ g.exitCode !== v &&
9052
+ (s ||
8533
9053
  h.fail(
8534
- K(f).join(`
9054
+ S(g).join(`
8535
9055
  `),
8536
9056
  ),
8537
- process.exit(f.exitCode));
9057
+ process.exit(g.exitCode));
8538
9058
  }
8539
9059
  }
8540
9060
  if (
8541
- ((g.status === 'failed' || g.status === 'expired' || g.status === 'cancelled') &&
8542
- (n
9061
+ ((f.status === 'failed' || f.status === 'expired' || f.status === 'cancelled') &&
9062
+ (s
8543
9063
  ? process.stdout.write(
8544
- JSON.stringify(g, null, 2) +
9064
+ JSON.stringify(f, null, 2) +
8545
9065
  `
8546
9066
  `,
8547
9067
  )
8548
- : h.fail(`Generation ${g.status}: ${g.error || 'Something failed on our side.'}`),
8549
- process.exit(T)),
8550
- n || h.succeed(`Generation completed for ${a.bold(s?.name || e)}!`),
8551
- n)
9068
+ : h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
9069
+ process.exit(v)),
9070
+ s || h.succeed(`Generation completed for ${i.bold(n?.name || e)}!`),
9071
+ s)
8552
9072
  ) {
8553
9073
  process.stdout.write(
8554
- JSON.stringify(g, null, 2) +
9074
+ JSON.stringify(f, null, 2) +
8555
9075
  `
8556
9076
  `,
8557
9077
  );
@@ -8560,49 +9080,53 @@ async function De(e, t) {
8560
9080
  if (
8561
9081
  (process.stdout.write(`
8562
9082
  `),
8563
- process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
9083
+ process.stdout.write(` ${i.bold('Status:')} ${i.green('Succeeded')}
8564
9084
  `),
8565
- process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
9085
+ process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
8566
9086
  `),
8567
- g.usage?.cost !== void 0 &&
8568
- process.stdout.write(` ${a.bold('Cost:')} ${ke(g.usage.cost)}
9087
+ f.usage?.cost !== void 0 &&
9088
+ process.stdout.write(` ${i.bold('Cost:')} ${xe(f.usage.cost)}
8569
9089
  `),
8570
- g.output && g.output.length > 0)
9090
+ f.output && f.output.length > 0)
8571
9091
  ) {
8572
9092
  process.stdout.write(`
8573
- ${a.bold('Outputs:')}
9093
+ ${i.bold('Outputs:')}
8574
9094
  `);
8575
- for (let y = 0; y < g.output.length; y++) {
8576
- let f = g.output[y];
8577
- if (f.url) {
9095
+ let b = f.output.filter((x) => x.url).length,
9096
+ g = 0;
9097
+ for (let x = 0; x < f.output.length; x++) {
9098
+ let I = f.output[x];
9099
+ if (I.url) {
9100
+ let L = I.layer?.name ? ` ${i.bold(I.layer.name)}` : '';
8578
9101
  if (
8579
- (process.stdout.write(` [${f.type.toUpperCase()}] ${a.cyan(a.underline(f.url))}
9102
+ (process.stdout.write(` [${I.type.toUpperCase()}]${L} ${i.cyan(i.underline(I.url))}
8580
9103
  `),
8581
9104
  u)
8582
9105
  ) {
8583
- let I = new _(`Downloading output to ${u}...`).start();
9106
+ let C = na(u, g++, b),
9107
+ Ye = new T(`Downloading output to ${C}...`).start();
8584
9108
  try {
8585
- (await d.downloadOutput(f.url, A.default.resolve(process.cwd(), u)),
8586
- I.succeed(`Saved to ${a.bold(u)}`));
8587
- } catch (v) {
8588
- I.fail(`Failed to download: ${v instanceof Error ? v.message : v}`);
9109
+ (await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
9110
+ Ye.succeed(`Saved to ${i.bold(C)}`));
9111
+ } catch (ye) {
9112
+ Ye.fail(`Failed to download: ${ye instanceof Error ? ye.message : ye}`);
8589
9113
  }
8590
9114
  }
8591
9115
  } else
8592
- f.text &&
9116
+ I.text &&
8593
9117
  process.stdout.write(`
8594
- ${f.text}
9118
+ ${I.text}
8595
9119
  `);
8596
9120
  }
8597
9121
  }
8598
9122
  process.stdout.write(`
8599
9123
  `);
8600
9124
  }
8601
- var Et = P(require('node:readline'));
8602
- C();
8603
- async function ei(e) {
9125
+ var Dt = _(require('node:readline'));
9126
+ A();
9127
+ async function sa(e) {
8604
9128
  try {
8605
- return (await new M(e, x()).checkKey(), 'ok');
9129
+ return (await new K(e, P()).checkKey(), 'ok');
8606
9130
  } catch (t) {
8607
9131
  if (t instanceof w) {
8608
9132
  if (t.status === 401) return 'invalid';
@@ -8611,95 +9135,95 @@ async function ei(e) {
8611
9135
  return 'unchecked';
8612
9136
  }
8613
9137
  }
8614
- function ti(e) {
8615
- let t = Et.default.createInterface({ input: process.stdin, output: process.stdout });
9138
+ function oa(e) {
9139
+ let t = Dt.default.createInterface({ input: process.stdin, output: process.stdout });
8616
9140
  return new Promise((r) => {
8617
- t.question(e, (i) => {
8618
- (t.close(), r(i.trim()));
9141
+ t.question(e, (a) => {
9142
+ (t.close(), r(a.trim()));
8619
9143
  });
8620
9144
  });
8621
9145
  }
8622
- async function Y(e, t) {
9146
+ async function Q(e, t) {
8623
9147
  switch (e) {
8624
9148
  case 'login':
8625
9149
  case 'set-key': {
8626
9150
  let r = t?.trim() || '';
8627
9151
  (r ||
8628
9152
  (process.stdout.write(`
8629
- ${a.bold('Tein AI Authentication')}
9153
+ ${i.bold('Tein AI Authentication')}
8630
9154
  `),
8631
- process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
9155
+ process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
8632
9156
 
8633
9157
  `),
8634
- (r = await ti('Enter your Tein API Key (sk_live_...): '))),
9158
+ (r = await oa('Enter your Tein API Key (sk_live_...): '))),
8635
9159
  !r.startsWith('sk_live_') &&
8636
9160
  !r.startsWith('sk_test_') &&
8637
9161
  (process.stderr
8638
- .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
9162
+ .write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
8639
9163
  `),
8640
9164
  process.exit(1)));
8641
- let i = await ei(r);
8642
- (i === 'invalid' &&
9165
+ let a = await sa(r);
9166
+ (a === 'invalid' &&
8643
9167
  (process.stderr
8644
- .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
9168
+ .write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
8645
9169
  `),
8646
9170
  process.exit(1)),
8647
- be({ apiKey: r }),
9171
+ we({ apiKey: r }),
8648
9172
  process.stdout.write(`
8649
- ${a.green('\u2713')} API key saved to ${a.dim(re())}
9173
+ ${i.green('\u2713')} API key saved to ${i.dim(re())}
8650
9174
  `),
8651
- i === 'blocked'
9175
+ a === 'blocked'
8652
9176
  ? process.stdout
8653
- .write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
9177
+ .write(`${i.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
8654
9178
  `)
8655
- : i === 'unchecked' &&
9179
+ : a === 'unchecked' &&
8656
9180
  process.stdout
8657
- .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.
9181
+ .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.
8658
9182
  `),
8659
9183
  process.stdout
8660
- .write(`You can now run models directly using: ${a.cyan('tein run <model-slug> --prompt "..."')}
9184
+ .write(`You can now run models directly using: ${i.cyan('tein run <model-slug> --prompt "..."')}
8661
9185
 
8662
9186
  `));
8663
9187
  break;
8664
9188
  }
8665
9189
  case 'logout': {
8666
- if (!V().apiKey) {
9190
+ if (!U().apiKey) {
8667
9191
  process.stdout
8668
- .write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
9192
+ .write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
8669
9193
  `);
8670
9194
  break;
8671
9195
  }
8672
- (be({ apiKey: '' }),
9196
+ (we({ apiKey: '' }),
8673
9197
  process.stdout
8674
- .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(re())}
9198
+ .write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(re())}
8675
9199
  `));
8676
9200
  break;
8677
9201
  }
8678
9202
  default: {
8679
- let r = S(),
8680
- i = x(),
8681
- s = V();
9203
+ let r = q(),
9204
+ a = P(),
9205
+ n = U();
8682
9206
  if (
8683
9207
  (process.stdout.write(`
8684
- ${a.bold('Tein AI CLI Configuration')}
9208
+ ${i.bold('Tein AI CLI Configuration')}
8685
9209
  `),
8686
- process.stdout.write(` Config file: ${a.dim(re())}
9210
+ process.stdout.write(` Config file: ${i.dim(re())}
8687
9211
  `),
8688
- process.stdout.write(` API URL: ${a.cyan(i)}
9212
+ process.stdout.write(` API URL: ${i.cyan(a)}
8689
9213
  `),
8690
9214
  !r)
8691
9215
  )
8692
- (process.stdout.write(` API Key: ${a.red('Not configured')}
9216
+ (process.stdout.write(` API Key: ${i.red('Not configured')}
8693
9217
 
8694
9218
  `),
8695
9219
  process.stdout
8696
- .write(`Run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9220
+ .write(`Run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
8697
9221
 
8698
9222
  `));
8699
9223
  else {
8700
- let n = `${r.slice(0, 10)}...${r.slice(-4)}`;
9224
+ let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
8701
9225
  process.stdout
8702
- .write(` API Key: ${a.green(n)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
9226
+ .write(` API Key: ${i.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
8703
9227
 
8704
9228
  `);
8705
9229
  }
@@ -8707,58 +9231,58 @@ ${a.bold('Tein AI CLI Configuration')}
8707
9231
  }
8708
9232
  }
8709
9233
  }
8710
- C();
8711
- we();
8712
- H();
8713
- var ri = 3e3;
8714
- async function At(e) {
9234
+ A();
9235
+ Ie();
9236
+ W();
9237
+ var la = 3e3;
9238
+ async function Lt(e) {
8715
9239
  try {
8716
- let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(ri) });
9240
+ let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(la) });
8717
9241
  if (!t.ok) return;
8718
9242
  let r = await t.json(),
8719
- i = {};
8720
- for (let s of r.configs ?? []) {
8721
- let n = String(s.modelSlug ?? '');
8722
- j.has(n) && (i[n] ??= []).push(Number(s.starterPrice));
9243
+ a = {};
9244
+ for (let n of r.configs ?? []) {
9245
+ let s = String(n.modelSlug ?? '');
9246
+ G.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
8723
9247
  }
8724
- Pt(i);
9248
+ Mt(a);
8725
9249
  } catch {}
8726
9250
  }
8727
- var ii = new Set(['video', 'image', 'text', 'audio', '3d']),
8728
- ai = { llm: 'text', chat: 'text', reasoning: 'text' };
8729
- async function Ot(e, t) {
8730
- await At(t);
8731
- let r = E();
9251
+ var pa = new Set(['video', 'image', 'text', 'audio', '3d']),
9252
+ da = { llm: 'text', chat: 'text', reasoning: 'text' };
9253
+ async function Vt(e, t) {
9254
+ await Lt(t);
9255
+ let r = R();
8732
9256
  if (e) {
8733
- let n = e.toLowerCase(),
8734
- o = ai[n] ?? n;
8735
- r = ii.has(o)
9257
+ let s = e.toLowerCase(),
9258
+ o = da[s] ?? s;
9259
+ r = pa.has(o)
8736
9260
  ? r.filter((u) => u.category.toLowerCase() === o)
8737
- : r.filter((u) => u.kind.toLowerCase().includes(n) || u.slug.toLowerCase().includes(n));
9261
+ : r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
8738
9262
  }
8739
9263
  (process.stdout.write(`
8740
- ${a.bold('Tein AI Models Catalog')} (${r.length} available)
9264
+ ${i.bold('Tein AI Models Catalog')} (${r.length} available)
8741
9265
  `),
8742
9266
  process.stdout
8743
- .write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
9267
+ .write(`${i.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
8744
9268
 
8745
9269
  `));
8746
- let i = {};
8747
- for (let n of r) {
8748
- let o = n.category;
8749
- (i[o] || (i[o] = []), i[o].push(n));
9270
+ let a = {};
9271
+ for (let s of r) {
9272
+ let o = s.category;
9273
+ (a[o] || (a[o] = []), a[o].push(s));
8750
9274
  }
8751
- let s = ['Video', 'Image', 'Text', 'Audio', '3D'];
8752
- for (let n of s) {
8753
- let o = i[n];
9275
+ let n = ['Video', 'Image', 'Text', 'Audio', '3D'];
9276
+ for (let s of n) {
9277
+ let o = a[s];
8754
9278
  if (!(!o || o.length === 0)) {
8755
- process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${n} Models \u2500\u2500`))}
9279
+ process.stdout.write(`${i.bold(i.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
8756
9280
  `);
8757
9281
  for (let u of o) {
8758
9282
  let l = u.slug.padEnd(24),
8759
9283
  c = u.name.padEnd(22),
8760
9284
  p = u.priceFormatted.padEnd(22);
8761
- process.stdout.write(` ${a.bold(l)} ${a.gray(c)} ${a.green(p)} ${a.dim(u.vendor)}
9285
+ process.stdout.write(` ${i.bold(l)} ${i.gray(c)} ${i.green(p)} ${i.dim(u.vendor)}
8762
9286
  `);
8763
9287
  }
8764
9288
  process.stdout.write(`
@@ -8766,95 +9290,95 @@ ${a.bold('Tein AI Models Catalog')} (${r.length} available)
8766
9290
  }
8767
9291
  }
8768
9292
  process.stdout
8769
- .write(`${a.dim('Tip:')} Generate directly with ${a.cyan('tein run <model-slug> --prompt "..."')}
9293
+ .write(`${i.dim('Tip:')} Generate directly with ${i.cyan('tein run <model-slug> --prompt "..."')}
8770
9294
 
8771
9295
  `);
8772
9296
  }
8773
- async function Rt(e, t) {
8774
- j.has(e) && (await At(t));
8775
- let r = U(e);
9297
+ async function Nt(e, t) {
9298
+ G.has(e) && (await Lt(t));
9299
+ let r = F(e);
8776
9300
  (r ||
8777
- (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
9301
+ (process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
8778
9302
  `),
8779
- process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
9303
+ process.stderr.write(`Run ${i.cyan('tein models')} to see all available model slugs.
8780
9304
  `),
8781
9305
  process.exit(1)),
8782
9306
  process.stdout.write(`
8783
- ${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
9307
+ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
8784
9308
  `),
8785
- process.stdout.write(` ${a.gray(r.description)}
9309
+ process.stdout.write(` ${i.gray(r.description)}
8786
9310
 
8787
9311
  `),
8788
- process.stdout.write(`${a.bold('Metadata:')}
9312
+ process.stdout.write(`${i.bold('Metadata:')}
8789
9313
  `),
8790
- process.stdout.write(` Category: ${a.yellow(r.category)}
9314
+ process.stdout.write(` Category: ${i.yellow(r.category)}
8791
9315
  `),
8792
9316
  process.stdout.write(` Kind: ${r.kind}
8793
9317
  `),
8794
9318
  process.stdout.write(` Vendor: ${r.vendor}
8795
9319
  `),
8796
- process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
9320
+ process.stdout.write(` Pricing: ${i.green(r.priceFormatted)}
8797
9321
 
8798
9322
  `),
8799
- process.stdout.write(`${a.bold('Parameters:')}
9323
+ process.stdout.write(`${i.bold('Parameters:')}
8800
9324
  `));
8801
- for (let i of r.parameters) {
8802
- let s = i.required ? a.red('(required)') : a.dim('(optional)'),
8803
- n = i.default !== void 0 ? a.dim(` [default: ${i.default}]`) : '';
9325
+ for (let a of r.parameters) {
9326
+ let n = a.required ? i.red('(required)') : i.dim('(optional)'),
9327
+ s = a.default !== void 0 ? i.dim(` [default: ${a.default}]`) : '';
8804
9328
  (process.stdout
8805
- .write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${s}${n}
9329
+ .write(` ${i.bold(`--${a.name.replace(/_/g, '-')}`)} ${i.yellow(`<${a.type}>`)} ${n}${s}
8806
9330
  `),
8807
- i.description &&
8808
- process.stdout.write(` ${a.gray(i.description)}
9331
+ a.description &&
9332
+ process.stdout.write(` ${i.gray(a.description)}
8809
9333
  `),
8810
- i.options &&
8811
- i.options.length > 0 &&
8812
- process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
9334
+ a.options &&
9335
+ a.options.length > 0 &&
9336
+ process.stdout.write(` Allowed values: ${i.dim(a.options.join(', '))}
8813
9337
  `),
8814
- (i.min !== void 0 || i.max !== void 0) &&
8815
- process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
9338
+ (a.min !== void 0 || a.max !== void 0) &&
9339
+ process.stdout.write(` Range: ${a.min ?? ''} to ${a.max ?? ''}
8816
9340
  `),
8817
9341
  process.stdout.write(`
8818
9342
  `));
8819
9343
  }
8820
9344
  if (
8821
- (r.parameters.some((i) => i.name === 'callback_url') ||
9345
+ (r.parameters.some((a) => a.name === 'callback_url') ||
8822
9346
  (process.stdout
8823
- .write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
9347
+ .write(` ${i.bold('--callback-url')} ${i.yellow('<string>')} ${i.dim('(optional)')}
8824
9348
  `),
8825
9349
  process.stdout
8826
- .write(` ${a.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
9350
+ .write(` ${i.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
8827
9351
 
8828
9352
  `)),
8829
- process.stdout.write(`${a.bold('Sample CLI Usage:')}
9353
+ process.stdout.write(`${i.bold('Sample CLI Usage:')}
8830
9354
  `),
8831
9355
  r.category === 'Video')
8832
9356
  )
8833
9357
  process.stdout
8834
- .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
9358
+ .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
8835
9359
 
8836
9360
  `);
8837
9361
  else if (r.category === 'Image') {
8838
- let i = r.parameters.some((s) => s.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
9362
+ let a = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
8839
9363
  process.stdout
8840
- .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
9364
+ .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${a} -o output.png`)}
8841
9365
 
8842
9366
  `);
8843
9367
  } else
8844
9368
  r.category === 'Audio'
8845
9369
  ? process.stdout
8846
- .write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
9370
+ .write(` ${i.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
8847
9371
 
8848
9372
  `)
8849
9373
  : process.stdout
8850
- .write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
9374
+ .write(` ${i.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
8851
9375
 
8852
9376
  `);
8853
9377
  }
8854
- C();
8855
- Le();
8856
- var si = 1e4,
8857
- Ne = {
9378
+ A();
9379
+ Ue();
9380
+ var ca = 1e4,
9381
+ Fe = {
8858
9382
  price: '',
8859
9383
  creativeMode: 'Creative mode',
8860
9384
  priority: 'Priority',
@@ -8864,114 +9388,114 @@ var si = 1e4,
8864
9388
  priorityDraft: 'Priority + Draft',
8865
9389
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
8866
9390
  },
8867
- ni = Object.keys(Ne),
8868
- oi = {
9391
+ ua = Object.keys(Fe),
9392
+ ma = {
8869
9393
  creativeMode: 'unfiltered',
8870
9394
  creativeModePriority: 'unfilteredPriority',
8871
9395
  creativeModeDraft: 'unfilteredDraft',
8872
9396
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
8873
9397
  };
8874
- function li(e, t) {
8875
- let r = oi[t];
9398
+ function fa(e, t) {
9399
+ let r = ma[t];
8876
9400
  return e[t] ?? (r ? e[r] : void 0);
8877
9401
  }
8878
- async function pi(e, t) {
8879
- let r = `${x(e)}${me(t)}`,
8880
- i;
9402
+ async function ga(e, t) {
9403
+ let r = `${P(e)}${fe(t)}`,
9404
+ a;
8881
9405
  try {
8882
- i = await fetch(r, { signal: AbortSignal.timeout(si) });
9406
+ a = await fetch(r, { signal: AbortSignal.timeout(ca) });
8883
9407
  } catch {
8884
9408
  throw new Error(`Could not reach ${r}`);
8885
9409
  }
8886
- let s = await i.json().catch(() => null);
8887
- if (!i.ok || !s || s.object !== 'list' || !s.board) {
8888
- let n =
8889
- s && typeof s.error == 'string'
8890
- ? s.error
8891
- : s && typeof s.error == 'object' && s.error?.message
8892
- ? s.error.message
8893
- : `Pricing request failed (${i.status})`;
8894
- throw new Error(n);
9410
+ let n = await a.json().catch(() => null);
9411
+ if (!a.ok || !n || n.object !== 'list' || !n.board) {
9412
+ let s =
9413
+ n && typeof n.error == 'string'
9414
+ ? n.error
9415
+ : n && typeof n.error == 'object' && n.error?.message
9416
+ ? n.error.message
9417
+ : `Pricing request failed (${a.status})`;
9418
+ throw new Error(s);
8895
9419
  }
8896
- return s;
9420
+ return n;
8897
9421
  }
8898
- function Ve(e) {
9422
+ function Be(e) {
8899
9423
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
8900
- [r, i = ''] = t.split('.');
8901
- return `$${r}.${i.padEnd(2, '0')}`;
9424
+ [r, a = ''] = t.split('.');
9425
+ return `$${r}.${a.padEnd(2, '0')}`;
8902
9426
  }
8903
- function Ue(e) {
9427
+ function je(e) {
8904
9428
  if (!e || typeof e.starter != 'number') return null;
8905
9429
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
8906
9430
  r = typeof e.scale == 'number' ? e.scale : t;
8907
- return `Starter ${Ve(e.starter)} Plus ${Ve(t)} Scale ${Ve(r)}`;
9431
+ return `Starter ${Be(e.starter)} Plus ${Be(t)} Scale ${Be(r)}`;
8908
9432
  }
8909
- function di(e) {
9433
+ function ha(e) {
8910
9434
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
8911
9435
  let t = [];
8912
9436
  for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
8913
- let i = e[r];
8914
- i != null && i !== '' && t.push(String(i));
9437
+ let a = e[r];
9438
+ a != null && a !== '' && t.push(String(a));
8915
9439
  }
8916
9440
  return (
8917
9441
  e.withVideo === !0 && t.push('with video'),
8918
9442
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
8919
9443
  );
8920
9444
  }
8921
- function ci(e, t) {
8922
- let r = di(e);
8923
- for (let i of ni) {
8924
- let s = Ue(li(e, i));
8925
- if (!s) continue;
8926
- let n = Ne[i] ? ` (${Ne[i]})` : '';
8927
- t.push(` ${r}${n} ${s}`);
9445
+ function ya(e, t) {
9446
+ let r = ha(e);
9447
+ for (let a of ua) {
9448
+ let n = je(fa(e, a));
9449
+ if (!n) continue;
9450
+ let s = Fe[a] ? ` (${Fe[a]})` : '';
9451
+ t.push(` ${r}${s} ${n}`);
8928
9452
  }
8929
9453
  }
8930
- function ui(e, t) {
9454
+ function ba(e, t) {
8931
9455
  let r = e.quality ? ` quality=${e.quality}` : '';
8932
9456
  t.push(
8933
- ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
9457
+ ` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
8934
9458
  );
8935
- for (let s of e.variants ?? []) ci(s, t);
8936
- let i = e.addons;
8937
- if (Array.isArray(i))
8938
- for (let s of i) {
8939
- if (!s || typeof s != 'object') continue;
8940
- let n = s,
8941
- o = typeof n.label == 'string' ? n.label : String(n.id ?? 'add-on'),
8942
- u = Ue(n.price);
9459
+ for (let n of e.variants ?? []) ya(n, t);
9460
+ let a = e.addons;
9461
+ if (Array.isArray(a))
9462
+ for (let n of a) {
9463
+ if (!n || typeof n != 'object') continue;
9464
+ let s = n,
9465
+ o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
9466
+ u = je(s.price);
8943
9467
  u && t.push(` ${o} (add-on) ${u}`);
8944
9468
  }
8945
9469
  t.push('');
8946
9470
  }
8947
- function mi(e) {
9471
+ function ka(e) {
8948
9472
  let t = [],
8949
9473
  r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
8950
- (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
9474
+ (t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
8951
9475
  t.push(
8952
- `${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
9476
+ `${i.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
8953
9477
  ),
8954
9478
  t.push(''));
8955
- let i = new Map();
9479
+ let a = new Map();
8956
9480
  for (let l of e.board.models) {
8957
9481
  let c = l.kind || 'other',
8958
- p = i.get(c) ?? [];
8959
- (p.push(l), i.set(c, p));
9482
+ p = a.get(c) ?? [];
9483
+ (p.push(l), a.set(c, p));
8960
9484
  }
8961
- let s = ['video', 'image', 'audio', 'llm', 'text', '3d'],
8962
- n = [...i.keys()].sort((l, c) => {
8963
- let p = s.indexOf(l),
8964
- d = s.indexOf(c);
9485
+ let n = ['video', 'image', 'audio', 'llm', 'text', '3d'],
9486
+ s = [...a.keys()].sort((l, c) => {
9487
+ let p = n.indexOf(l),
9488
+ d = n.indexOf(c);
8965
9489
  return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
8966
9490
  });
8967
- for (let l of n) {
8968
- t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
8969
- for (let c of i.get(l) ?? []) ui(c, t);
9491
+ for (let l of s) {
9492
+ t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
9493
+ for (let c of a.get(l) ?? []) ba(c, t);
8970
9494
  }
8971
9495
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
8972
9496
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
8973
9497
  if (u.length) {
8974
- t.push(`${a.bold(a.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
9498
+ t.push(`${i.bold(i.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
8975
9499
  let l = new Map();
8976
9500
  for (let c of u) {
8977
9501
  let p = String(c.modelSlug ?? ''),
@@ -8980,29 +9504,29 @@ function mi(e) {
8980
9504
  }
8981
9505
  for (let [c, p] of l) {
8982
9506
  let d = String(p[0]?.modelName ?? c);
8983
- t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
9507
+ t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
8984
9508
  for (let m of p) {
8985
9509
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
8986
- g = Ue(m.prices);
8987
- g && t.push(` ${h} ${g}`);
9510
+ f = je(m.prices);
9511
+ f && t.push(` ${h} ${f}`);
8988
9512
  }
8989
9513
  t.push('');
8990
9514
  }
8991
9515
  }
8992
9516
  return (
8993
- t.push(`${a.dim('JSON:')} ${a.cyan('tein pricing --json')}`),
9517
+ t.push(`${i.dim('JSON:')} ${i.cyan('tein pricing --json')}`),
8994
9518
  `${t.join(`
8995
9519
  `)}
8996
9520
  `
8997
9521
  );
8998
9522
  }
8999
- async function Dt(e) {
9523
+ async function Ut(e) {
9000
9524
  let t;
9001
9525
  try {
9002
- t = await pi(e.apiUrl, e.model);
9526
+ t = await ga(e.apiUrl, e.model);
9003
9527
  } catch (r) {
9004
- let i = r instanceof Error ? r.message : String(r);
9005
- (process.stderr.write(`${a.red('Error:')} ${i}
9528
+ let a = r instanceof Error ? r.message : String(r);
9529
+ (process.stderr.write(`${i.red('Error:')} ${a}
9006
9530
  `),
9007
9531
  process.exit(1));
9008
9532
  }
@@ -9010,39 +9534,39 @@ async function Dt(e) {
9010
9534
  e.json
9011
9535
  ? `${JSON.stringify(t, null, 2)}
9012
9536
  `
9013
- : mi(t),
9537
+ : ka(t),
9014
9538
  );
9015
9539
  }
9016
- var Lt = P(require('node:path'));
9017
- C();
9018
- async function Vt(e, t) {
9019
- let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
9020
- i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
9540
+ var Bt = _(require('node:path'));
9541
+ A();
9542
+ async function Ft(e, t) {
9543
+ let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
9544
+ a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
9021
9545
  (r ||
9022
- (process.stderr.write(`${a.red('Error:')} Authentication required.
9546
+ (process.stderr.write(`${i.red('Error:')} Authentication required.
9023
9547
  `),
9024
9548
  process.stderr
9025
- .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9549
+ .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
9026
9550
  `),
9027
9551
  process.exit(1)),
9028
9552
  e ||
9029
- (process.stderr.write(`${a.red('Error:')} Missing request ID.
9553
+ (process.stderr.write(`${i.red('Error:')} Missing request ID.
9030
9554
  `),
9031
- process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
9555
+ process.stderr.write(`Usage: ${i.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
9032
9556
  `),
9033
9557
  process.exit(1)));
9034
- let s = !!t.json,
9035
- n = !!t.wait,
9558
+ let n = !!t.json,
9559
+ s = !!t.wait,
9036
9560
  o = typeof t.output == 'string' ? t.output : void 0,
9037
- u = new M(r, i),
9038
- l = new _(`Checking status of ${a.bold(e)}...`);
9039
- s || l.start();
9561
+ u = new K(r, a),
9562
+ l = new T(`Checking status of ${i.bold(e)}...`);
9563
+ n || l.start();
9040
9564
  let c;
9041
9565
  try {
9042
9566
  c = await u.getStatus(e);
9043
9567
  } catch (p) {
9044
9568
  (p instanceof w &&
9045
- (s
9569
+ (n
9046
9570
  ? process.stdout.write(
9047
9571
  JSON.stringify(
9048
9572
  { error: { code: p.code ?? null, message: p.message, ...p.fields } },
@@ -9053,18 +9577,18 @@ async function Vt(e, t) {
9053
9577
  `,
9054
9578
  )
9055
9579
  : l.fail(
9056
- K(p).join(`
9580
+ S(p).join(`
9057
9581
  `),
9058
9582
  ),
9059
9583
  process.exit(p.exitCode)),
9060
- s || l.fail(p instanceof Error ? p.message : String(p)),
9061
- process.exit(T));
9584
+ n || l.fail(p instanceof Error ? p.message : String(p)),
9585
+ process.exit(v));
9062
9586
  }
9063
- if (n && c.status === 'processing') {
9587
+ if (s && c.status === 'processing') {
9064
9588
  let p = Date.now();
9065
9589
  for (; c.status === 'processing';) {
9066
9590
  let d = Math.round((Date.now() - p) / 1e3);
9067
- (s || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
9591
+ (n || l.update(`Waiting for ${i.bold(c.model)} (${d}s elapsed)...`),
9068
9592
  await new Promise((m) => setTimeout(m, 1500)));
9069
9593
  try {
9070
9594
  c = await u.getStatus(e);
@@ -9072,13 +9596,13 @@ async function Vt(e, t) {
9072
9596
  }
9073
9597
  }
9074
9598
  if (
9075
- (s ||
9599
+ (n ||
9076
9600
  (c.status === 'succeeded'
9077
9601
  ? l.succeed('Task completed!')
9078
9602
  : c.status === 'failed' || c.status === 'expired' || c.status === 'cancelled'
9079
9603
  ? l.fail(`Task ${c.status}: ${c.error || 'Something failed on our side.'}`)
9080
9604
  : l.stop()),
9081
- s)
9605
+ n)
9082
9606
  ) {
9083
9607
  process.stdout.write(
9084
9608
  JSON.stringify(c, null, 2) +
@@ -9089,29 +9613,29 @@ async function Vt(e, t) {
9089
9613
  }
9090
9614
  if (
9091
9615
  (process.stdout.write(`
9092
- ${a.bold('Model:')} ${c.model}
9616
+ ${i.bold('Model:')} ${c.model}
9093
9617
  `),
9094
9618
  process.stdout
9095
- .write(` ${a.bold('Status:')} ${c.status === 'succeeded' ? a.green(c.status) : c.status === 'processing' ? a.yellow(c.status) : a.red(c.status)}
9619
+ .write(` ${i.bold('Status:')} ${c.status === 'succeeded' ? i.green(c.status) : c.status === 'processing' ? i.yellow(c.status) : i.red(c.status)}
9096
9620
  `),
9097
- process.stdout.write(` ${a.bold('Request ID:')} ${c.request_id}
9621
+ process.stdout.write(` ${i.bold('Request ID:')} ${c.request_id}
9098
9622
  `),
9099
9623
  c.output && c.output.length > 0)
9100
9624
  ) {
9101
9625
  process.stdout.write(`
9102
- ${a.bold('Outputs:')}
9626
+ ${i.bold('Outputs:')}
9103
9627
  `);
9104
9628
  for (let p of c.output)
9105
9629
  if (p.url) {
9106
9630
  if (
9107
- (process.stdout.write(` [${p.type.toUpperCase()}] ${a.cyan(a.underline(p.url))}
9631
+ (process.stdout.write(` [${p.type.toUpperCase()}] ${i.cyan(i.underline(p.url))}
9108
9632
  `),
9109
9633
  o)
9110
9634
  ) {
9111
- let d = new _(`Downloading output to ${o}...`).start();
9635
+ let d = new T(`Downloading output to ${o}...`).start();
9112
9636
  try {
9113
- (await u.downloadOutput(p.url, Lt.default.resolve(process.cwd(), o)),
9114
- d.succeed(`Saved to ${a.bold(o)}`));
9637
+ (await u.downloadOutput(p.url, Bt.default.resolve(process.cwd(), o)),
9638
+ d.succeed(`Saved to ${i.bold(o)}`));
9115
9639
  } catch (m) {
9116
9640
  d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
9117
9641
  }
@@ -9125,39 +9649,39 @@ ${p.text}
9125
9649
  process.stdout.write(`
9126
9650
  `);
9127
9651
  }
9128
- var Be = P(require('node:fs')),
9129
- Fe = P(require('node:path'));
9130
- C();
9131
- async function Nt(e, t = {}) {
9132
- let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
9133
- i = x(typeof t.api_url == 'string' ? t.api_url : void 0),
9134
- s = !!t.json;
9652
+ var Ge = _(require('node:fs')),
9653
+ ze = _(require('node:path'));
9654
+ A();
9655
+ async function jt(e, t = {}) {
9656
+ let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
9657
+ a = P(typeof t.api_url == 'string' ? t.api_url : void 0),
9658
+ n = !!t.json;
9135
9659
  (r ||
9136
- (process.stderr.write(`${a.red('Error:')} Authentication required.
9660
+ (process.stderr.write(`${i.red('Error:')} Authentication required.
9137
9661
  `),
9138
9662
  process.stderr
9139
- .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9663
+ .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
9140
9664
  `),
9141
9665
  process.exit(1)),
9142
9666
  e ||
9143
- (process.stderr.write(`${a.red('Error:')} Missing file path.
9667
+ (process.stderr.write(`${i.red('Error:')} Missing file path.
9144
9668
  `),
9145
- process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
9669
+ process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
9146
9670
  `),
9147
9671
  process.exit(1)));
9148
- let n = Fe.default.resolve(e);
9149
- Be.default.existsSync(n) ||
9150
- (process.stderr.write(`${a.red('Error:')} File not found: ${n}
9672
+ let s = ze.default.resolve(e);
9673
+ Ge.default.existsSync(s) ||
9674
+ (process.stderr.write(`${i.red('Error:')} File not found: ${s}
9151
9675
  `),
9152
9676
  process.exit(1));
9153
- let o = Fe.default.basename(n),
9154
- l = Be.default.readFileSync(n).toString('base64'),
9155
- c = new M(r, i),
9156
- p = new _(`Uploading ${a.bold(o)} to Tein AI CDN...`);
9157
- s || p.start();
9677
+ let o = ze.default.basename(s),
9678
+ l = Ge.default.readFileSync(s).toString('base64'),
9679
+ c = new K(r, a),
9680
+ p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
9681
+ n || p.start();
9158
9682
  try {
9159
9683
  let d = await c.uploadAsset(l);
9160
- s
9684
+ n
9161
9685
  ? process.stdout.write(
9162
9686
  JSON.stringify(d, null, 2) +
9163
9687
  `
@@ -9165,100 +9689,100 @@ async function Nt(e, t = {}) {
9165
9689
  )
9166
9690
  : (p.succeed('Upload successful!'),
9167
9691
  process.stdout.write(`
9168
- ${a.bold('CDN URL:')} ${a.green(d.url)}
9692
+ ${i.bold('CDN URL:')} ${i.green(d.url)}
9169
9693
  `),
9170
- process.stdout.write(`${a.dim(`Key: ${d.key}`)}
9694
+ process.stdout.write(`${i.dim(`Key: ${d.key}`)}
9171
9695
 
9172
9696
  `),
9173
9697
  process.stdout.write(`Use this CDN URL directly in your CLI runs:
9174
- ${a.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
9698
+ ${i.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
9175
9699
 
9176
9700
  `));
9177
9701
  } catch (d) {
9178
9702
  let m = d instanceof w ? d : null,
9179
9703
  h = m
9180
- ? K(m).join(`
9704
+ ? S(m).join(`
9181
9705
  `)
9182
9706
  : d instanceof Error
9183
9707
  ? d.message
9184
9708
  : String(d);
9185
- (s
9709
+ (n
9186
9710
  ? process.stdout.write(
9187
9711
  JSON.stringify({ error: { code: m?.code ?? null, message: m?.message ?? h } }, null, 2) +
9188
9712
  `
9189
9713
  `,
9190
9714
  )
9191
9715
  : p.fail(`Upload failed: ${h}`),
9192
- process.exit(m ? m.exitCode : T));
9716
+ process.exit(m ? m.exitCode : v));
9193
9717
  }
9194
9718
  }
9195
- H();
9196
- Se();
9197
- function rr() {
9719
+ W();
9720
+ $e();
9721
+ function sr() {
9198
9722
  process.stdout.write(`
9199
- ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
9723
+ ${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
9200
9724
 
9201
- ${a.bold('USAGE:')}
9202
- ${a.cyan('tein')} <command> [arguments] [options]
9725
+ ${i.bold('USAGE:')}
9726
+ ${i.cyan('tein')} <command> [arguments] [options]
9203
9727
 
9204
- ${a.bold('COMMANDS:')}
9205
- ${a.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
9206
- ${a.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
9207
- ${a.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
9208
- ${a.bold('info')} <model-slug> View parameter schemas, pricing, and options
9209
- ${a.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
9210
- ${a.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
9211
- ${a.bold('status')} <request-id> [options] Check generation progress and retrieve output files
9212
- ${a.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
9728
+ ${i.bold('COMMANDS:')}
9729
+ ${i.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
9730
+ ${i.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
9731
+ ${i.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
9732
+ ${i.bold('info')} <model-slug> View parameter schemas, pricing, and options
9733
+ ${i.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
9734
+ ${i.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
9735
+ ${i.bold('status')} <request-id> [options] Check generation progress and retrieve output files
9736
+ ${i.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
9213
9737
 
9214
- ${a.bold('GENERATION OPTIONS (for `tein run`):')}
9215
- ${a.cyan('-p, --prompt')} <text> Text prompt for generation ${a.red('(required)')}
9216
- ${a.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
9217
- ${a.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
9218
- ${a.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
9219
- ${a.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
9220
- ${a.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
9221
- ${a.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
9222
- ${a.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
9223
- ${a.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
9224
- ${a.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
9225
- ${a.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
9226
- ${a.cyan('--async, --no-wait')} Queue task and return request ID immediately
9227
- ${a.cyan('--json')} Output response in raw JSON format
9228
- ${a.cyan('--api-key')} <key> Override API key for this request
9738
+ ${i.bold('GENERATION OPTIONS (for `tein run`):')}
9739
+ ${i.cyan('-p, --prompt')} <text> Text prompt for generation ${i.red('(required)')}
9740
+ ${i.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
9741
+ ${i.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
9742
+ ${i.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
9743
+ ${i.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
9744
+ ${i.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
9745
+ ${i.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
9746
+ ${i.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
9747
+ ${i.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
9748
+ ${i.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
9749
+ ${i.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
9750
+ ${i.cyan('--async, --no-wait')} Queue task and return request ID immediately
9751
+ ${i.cyan('--json')} Output response in raw JSON format
9752
+ ${i.cyan('--api-key')} <key> Override API key for this request
9229
9753
 
9230
- ${a.bold('EXAMPLES:')}
9231
- ${a.dim('# 1. Authenticate with your Tein API key')}
9232
- ${a.cyan('tein auth login')}
9754
+ ${i.bold('EXAMPLES:')}
9755
+ ${i.dim('# 1. Authenticate with your Tein API key')}
9756
+ ${i.cyan('tein auth login')}
9233
9757
 
9234
- ${a.dim('# 2. List all Video models')}
9235
- ${a.cyan('tein models video')}
9758
+ ${i.dim('# 2. List all Video models')}
9759
+ ${i.cyan('tein models video')}
9236
9760
 
9237
- ${a.dim('# 3. Every published price, or one model as JSON')}
9238
- ${a.cyan('tein pricing')}
9239
- ${a.cyan('tein pricing seedance-2-5 --json')}
9761
+ ${i.dim('# 3. Every published price, or one model as JSON')}
9762
+ ${i.cyan('tein pricing')}
9763
+ ${i.cyan('tein pricing seedance-2-5 --json')}
9240
9764
 
9241
- ${a.dim('# 4. Generate a high-quality 2K image and download it')}
9242
- ${a.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
9765
+ ${i.dim('# 4. Generate a high-quality 2K image and download it')}
9766
+ ${i.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
9243
9767
 
9244
- ${a.dim('# 5. Generate a video using Seedance 2.5 with audio')}
9245
- ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
9246
- ${a.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
9247
- ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
9768
+ ${i.dim('# 5. Generate a video using Seedance 2.5 with audio')}
9769
+ ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
9770
+ ${i.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
9771
+ ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
9248
9772
 
9249
- ${a.dim('# 6. Generate speech with Seed Audio 1.0')}
9250
- ${a.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
9773
+ ${i.dim('# 6. Generate speech with Seed Audio 1.0')}
9774
+ ${i.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
9251
9775
 
9252
- ${a.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
9253
- ${a.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
9776
+ ${i.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
9777
+ ${i.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
9254
9778
 
9255
9779
  `);
9256
9780
  }
9257
- async function $i() {
9781
+ async function Da() {
9258
9782
  let e = process.argv.slice(2),
9259
- t = Ct(e);
9783
+ t = Rt(e);
9260
9784
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
9261
- rr();
9785
+ sr();
9262
9786
  return;
9263
9787
  }
9264
9788
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -9268,32 +9792,32 @@ async function $i() {
9268
9792
  }
9269
9793
  switch (t.command) {
9270
9794
  case 'auth': {
9271
- await Y(t.subcommand, t.options.key);
9795
+ await Q(t.subcommand, t.options.key);
9272
9796
  break;
9273
9797
  }
9274
9798
  case 'login': {
9275
- await Y('login', t.options.key);
9799
+ await Q('login', t.options.key);
9276
9800
  break;
9277
9801
  }
9278
9802
  case 'logout': {
9279
- await Y('logout');
9803
+ await Q('logout');
9280
9804
  break;
9281
9805
  }
9282
9806
  case 'whoami': {
9283
- await Y('status');
9807
+ await Q('status');
9284
9808
  break;
9285
9809
  }
9286
9810
  case 'models':
9287
9811
  case 'list': {
9288
- await Ot(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
9812
+ await Vt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
9289
9813
  break;
9290
9814
  }
9291
9815
  case 'pricing':
9292
9816
  case 'prices': {
9293
9817
  let r = t.options.model,
9294
- i = t.subcommand || (typeof r == 'string' ? r : void 0);
9295
- await Dt({
9296
- model: i,
9818
+ a = t.subcommand || (typeof r == 'string' ? r : void 0);
9819
+ await Ut({
9820
+ model: a,
9297
9821
  json: !!t.options.json,
9298
9822
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
9299
9823
  });
@@ -9302,61 +9826,61 @@ async function $i() {
9302
9826
  case 'info':
9303
9827
  case 'show': {
9304
9828
  (t.subcommand ||
9305
- (process.stderr.write(`${a.red('Error:')} Missing model slug.
9829
+ (process.stderr.write(`${i.red('Error:')} Missing model slug.
9306
9830
  `),
9307
- process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
9831
+ process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
9308
9832
  `),
9309
9833
  process.exit(1)),
9310
- await Rt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
9834
+ await Nt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
9311
9835
  break;
9312
9836
  }
9313
9837
  case 'upload': {
9314
9838
  let r = t.subcommand || '';
9315
- await Nt(r, t.options);
9839
+ await jt(r, t.options);
9316
9840
  break;
9317
9841
  }
9318
9842
  case 'run':
9319
9843
  case 'generate': {
9320
9844
  let r = t.subcommand || '';
9321
- await De(r, t.options);
9845
+ await Ne(r, t.options);
9322
9846
  break;
9323
9847
  }
9324
9848
  case 'status': {
9325
9849
  let r = t.subcommand || '';
9326
- await Vt(r, t.options);
9850
+ await Ft(r, t.options);
9327
9851
  break;
9328
9852
  }
9329
9853
  case 'mcp': {
9330
- let { startStdioServer: r } = await Promise.resolve().then(() => (tr(), er));
9854
+ let { startStdioServer: r } = await Promise.resolve().then(() => (nr(), ir));
9331
9855
  await r();
9332
9856
  break;
9333
9857
  }
9334
9858
  default: {
9335
9859
  if (t.command && !t.command.startsWith('-')) {
9336
- (!U(t.command) &&
9860
+ (!F(t.command) &&
9337
9861
  !pe[t.command] &&
9338
9862
  (process.stderr.write(`
9339
- ${a.red('Error:')} Unknown command or model "${t.command}".
9340
- Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
9863
+ ${i.red('Error:')} Unknown command or model "${t.command}".
9864
+ Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
9341
9865
  `),
9342
- process.exit(T)),
9343
- await De(t.command, t.options));
9866
+ process.exit(v)),
9867
+ await Ne(t.command, t.options));
9344
9868
  return;
9345
9869
  }
9346
- rr();
9870
+ sr();
9347
9871
  break;
9348
9872
  }
9349
9873
  }
9350
9874
  }
9351
- $i().catch((e) => {
9875
+ Da().catch((e) => {
9352
9876
  (e instanceof w &&
9353
9877
  (process.stderr.write(`
9354
- ${a.red('Error:')} ${K(e).join(`
9878
+ ${i.red('Error:')} ${S(e).join(`
9355
9879
  `)}
9356
9880
  `),
9357
9881
  process.exit(e.exitCode)),
9358
9882
  process.stderr.write(`
9359
- ${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
9883
+ ${i.red('Fatal error:')} ${e instanceof Error ? e.message : e}
9360
9884
  `),
9361
- process.exit(T));
9885
+ process.exit(v));
9362
9886
  });