@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.
- package/index.js +1532 -1008
- 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
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
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 (
|
|
14
|
-
throw ((r = [
|
|
13
|
+
} catch (a) {
|
|
14
|
+
throw ((r = [a]), a);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var r in t)
|
|
17
|
+
var ur = (e, t) => {
|
|
18
|
+
for (var r in t) be(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
mr = (e, t, r, a) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let
|
|
23
|
-
!
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
29
|
-
(r = e != null ?
|
|
30
|
-
|
|
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
|
|
32
|
+
function U() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
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
|
|
41
|
+
function we(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let r = { ...
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
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 ${
|
|
49
|
+
throw new Error(`Failed to save config to ${N}: ${t}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
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 =
|
|
56
|
+
let r = U();
|
|
57
57
|
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
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 =
|
|
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
|
|
67
|
+
return N;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
var E,
|
|
70
|
+
tt,
|
|
71
|
+
ke,
|
|
72
72
|
te,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
N,
|
|
74
|
+
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(te =
|
|
80
|
-
(
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var kr,
|
|
83
|
+
rt,
|
|
84
|
+
at,
|
|
85
|
+
it = y(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
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
|
|
93
|
-
|
|
92
|
+
var G,
|
|
93
|
+
Ie = y(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function ae(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var nt = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
|
-
var
|
|
104
|
-
|
|
103
|
+
var ie,
|
|
104
|
+
st = y(() => {
|
|
105
105
|
'use strict';
|
|
106
|
-
|
|
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
|
|
5559
|
-
|
|
5560
|
-
|
|
5845
|
+
var ot,
|
|
5846
|
+
ne,
|
|
5847
|
+
Pe = y(() => {
|
|
5561
5848
|
'use strict';
|
|
5562
|
-
((
|
|
5563
|
-
(
|
|
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
|
|
5888
|
+
function Ke(e, t) {
|
|
5602
5889
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5603
5890
|
}
|
|
5604
|
-
function
|
|
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
|
|
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
|
|
5621
|
-
|
|
5622
|
-
return
|
|
5907
|
+
let n = Ir(r, t),
|
|
5908
|
+
s = Te.get(Ke('seedance-2', n));
|
|
5909
|
+
return s ? s.slug : null;
|
|
5623
5910
|
}
|
|
5624
|
-
let
|
|
5625
|
-
return
|
|
5911
|
+
let a = se.get(r) ?? Te.get(Ke(r));
|
|
5912
|
+
return a ? a.slug : null;
|
|
5626
5913
|
}
|
|
5627
|
-
function
|
|
5628
|
-
return
|
|
5914
|
+
function vr(e, t) {
|
|
5915
|
+
return se.has(e) && !(_r.has(e) && t) ? e : Pr(e, t);
|
|
5629
5916
|
}
|
|
5630
|
-
function
|
|
5631
|
-
let r =
|
|
5632
|
-
return r ? (
|
|
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
|
|
5922
|
+
return pt;
|
|
5636
5923
|
}
|
|
5637
|
-
var
|
|
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
|
-
|
|
5928
|
+
se,
|
|
5929
|
+
Te,
|
|
5930
|
+
lt,
|
|
5931
|
+
xr,
|
|
5932
|
+
Me,
|
|
5933
|
+
_r,
|
|
5934
|
+
B = y(() => {
|
|
5648
5935
|
'use strict';
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
((
|
|
5653
|
-
...
|
|
5654
|
-
families:
|
|
5655
|
-
models:
|
|
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
|
-
(
|
|
5658
|
-
(
|
|
5659
|
-
(
|
|
5660
|
-
(
|
|
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
|
-
(
|
|
5663
|
-
(
|
|
5664
|
-
(
|
|
5665
|
-
for (let e of
|
|
5666
|
-
(
|
|
5667
|
-
for (let t of e.variants)
|
|
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
|
-
|
|
5670
|
-
for (let t of e.addons ?? [])
|
|
5671
|
-
|
|
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
|
|
5674
|
-
|
|
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
|
|
5967
|
+
function Se(e) {
|
|
5681
5968
|
if (e.endpoints?.length)
|
|
5682
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
5683
|
-
?
|
|
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
|
|
5687
|
-
|
|
5973
|
+
var dt,
|
|
5974
|
+
qe = y(() => {
|
|
5688
5975
|
'use strict';
|
|
5689
|
-
|
|
5690
|
-
|
|
5976
|
+
B();
|
|
5977
|
+
dt = 'dynamic';
|
|
5691
5978
|
});
|
|
5692
5979
|
var pe,
|
|
5693
|
-
|
|
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
|
|
5992
|
+
var ct = y(() => {
|
|
5706
5993
|
'use strict';
|
|
5707
5994
|
});
|
|
5708
|
-
function
|
|
5709
|
-
return typeof t == 'string' && (
|
|
5995
|
+
function ut(e, t) {
|
|
5996
|
+
return typeof t == 'string' && (Tr[e]?.includes(t) ?? !1);
|
|
5710
5997
|
}
|
|
5711
|
-
var
|
|
5712
|
-
|
|
5998
|
+
var Tr,
|
|
5999
|
+
mt = y(() => {
|
|
5713
6000
|
'use strict';
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
6001
|
+
B();
|
|
6002
|
+
qe();
|
|
6003
|
+
ct();
|
|
6004
|
+
Tr = {};
|
|
5718
6005
|
});
|
|
5719
|
-
function
|
|
5720
|
-
return e === 'nano-banana-pro' ?
|
|
6006
|
+
function ft(e) {
|
|
6007
|
+
return e === 'nano-banana-pro' ? Mr : Kr;
|
|
5721
6008
|
}
|
|
5722
|
-
var
|
|
5723
|
-
|
|
5724
|
-
|
|
6009
|
+
var Mr,
|
|
6010
|
+
Kr,
|
|
6011
|
+
gt = y(() => {
|
|
5725
6012
|
'use strict';
|
|
5726
|
-
((
|
|
5727
|
-
(
|
|
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
|
|
5746
|
-
|
|
6032
|
+
var ht,
|
|
6033
|
+
yt = y(() => {
|
|
5747
6034
|
'use strict';
|
|
5748
|
-
|
|
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
|
|
5763
|
-
|
|
6049
|
+
var bt,
|
|
6050
|
+
kt = y(() => {
|
|
5764
6051
|
'use strict';
|
|
5765
|
-
|
|
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
|
|
6121
|
+
function wt(e) {
|
|
5835
6122
|
return `$${e}`;
|
|
5836
6123
|
}
|
|
5837
|
-
function
|
|
5838
|
-
return
|
|
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
|
|
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
|
|
6193
|
+
function xt() {
|
|
5907
6194
|
return Object.fromEntries(
|
|
5908
|
-
|
|
5909
|
-
let t =
|
|
5910
|
-
r =
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
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:
|
|
6207
|
+
priceFormatted: n,
|
|
5921
6208
|
unit: '/M tokens',
|
|
5922
6209
|
primaryToolName: 'run_task',
|
|
5923
|
-
parameters:
|
|
6210
|
+
parameters: Sr(a),
|
|
5924
6211
|
};
|
|
5925
|
-
return [e.slug,
|
|
6212
|
+
return [e.slug, s];
|
|
5926
6213
|
}),
|
|
5927
6214
|
);
|
|
5928
6215
|
}
|
|
5929
|
-
var
|
|
6216
|
+
var It = y(() => {
|
|
5930
6217
|
'use strict';
|
|
5931
|
-
|
|
5932
|
-
|
|
6218
|
+
kt();
|
|
6219
|
+
B();
|
|
5933
6220
|
});
|
|
5934
|
-
var
|
|
6221
|
+
var H,
|
|
5935
6222
|
de,
|
|
5936
|
-
|
|
6223
|
+
Ee = y(() => {
|
|
5937
6224
|
'use strict';
|
|
5938
|
-
((
|
|
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
|
|
6240
|
+
function Er(e) {
|
|
5953
6241
|
if (e.kind === 'llm') {
|
|
5954
6242
|
let t = e.defaultEndpoint,
|
|
5955
|
-
r = (
|
|
6243
|
+
r = (s) =>
|
|
5956
6244
|
e.variants.find(
|
|
5957
6245
|
(o) =>
|
|
5958
|
-
o.component ===
|
|
6246
|
+
o.component === s &&
|
|
5959
6247
|
(!t || !o.endpoint || o.endpoint === t) &&
|
|
5960
6248
|
(!o.context || o.context === '0\u201332K'),
|
|
5961
6249
|
),
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
return
|
|
5965
|
-
? `${J(
|
|
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
|
|
5971
|
-
let r = t.filter((
|
|
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
|
|
5975
|
-
for (let t of
|
|
6262
|
+
function Mt(e) {
|
|
6263
|
+
for (let t of G) {
|
|
5976
6264
|
let r = ue[t],
|
|
5977
|
-
|
|
5978
|
-
r &&
|
|
6265
|
+
a = r ? Ar(r.unit, e[t] ?? []) : null;
|
|
6266
|
+
r && a && (r.priceFormatted = a);
|
|
5979
6267
|
}
|
|
5980
6268
|
}
|
|
5981
|
-
function
|
|
6269
|
+
function O(e, t) {
|
|
5982
6270
|
let r = e.axes?.resolution ?? [
|
|
5983
|
-
...new Set(e.variants.map((
|
|
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
|
|
6281
|
+
function Kt(e) {
|
|
5994
6282
|
if (!e.endpoints?.length) return null;
|
|
5995
|
-
let t = e.endpoints.filter((r) =>
|
|
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:
|
|
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
|
|
6009
|
-
if (e.unfiltered == null || t.some((
|
|
6010
|
-
let r =
|
|
6011
|
-
return [...t.filter((
|
|
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
|
|
6014
|
-
let r = e.filter((
|
|
6015
|
-
|
|
6016
|
-
return (
|
|
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
|
|
6306
|
+
function Pt(e, t = {}) {
|
|
6019
6307
|
return [
|
|
6020
6308
|
...e
|
|
6021
|
-
.filter((r) => !
|
|
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((
|
|
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
|
-
|
|
6043
|
-
|
|
6330
|
+
qt,
|
|
6331
|
+
$t,
|
|
6044
6332
|
];
|
|
6045
6333
|
}
|
|
6046
|
-
function
|
|
6334
|
+
function Oe(e, t) {
|
|
6047
6335
|
return [
|
|
6048
|
-
|
|
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
|
-
|
|
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
|
|
6076
|
-
let t =
|
|
6363
|
+
function Vr(e) {
|
|
6364
|
+
let t = Kt(e);
|
|
6077
6365
|
return [
|
|
6078
|
-
|
|
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
|
-
|
|
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. ${
|
|
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: [...
|
|
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
|
|
6431
|
+
function Nr(e) {
|
|
6144
6432
|
return [
|
|
6145
|
-
|
|
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: [...
|
|
6152
|
-
|
|
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
|
|
6178
|
-
let e =
|
|
6465
|
+
function jr() {
|
|
6466
|
+
let e = ht,
|
|
6179
6467
|
t = [];
|
|
6180
|
-
for (let r of
|
|
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
|
|
6203
|
-
return
|
|
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
|
|
6495
|
+
function Ve(e) {
|
|
6208
6496
|
return [
|
|
6209
|
-
|
|
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
|
|
6303
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6304
|
-
let t =
|
|
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
|
-
?
|
|
6595
|
+
? jr()
|
|
6308
6596
|
: e.slug === 'gemini-3.7-flash'
|
|
6309
|
-
?
|
|
6310
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6311
|
-
?
|
|
6312
|
-
:
|
|
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
|
|
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
|
-
|
|
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
|
|
6634
|
+
function Wr(e) {
|
|
6339
6635
|
let t = e.slug;
|
|
6340
|
-
if (
|
|
6341
|
-
if (e.kind === 'llm') return
|
|
6342
|
-
if (e.editVariants?.length) return
|
|
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
|
|
6641
|
+
return Ae(_t, t);
|
|
6346
6642
|
case 'seedance-2-5-lite':
|
|
6347
|
-
return
|
|
6643
|
+
return Pt(_t, { no4k: !0 });
|
|
6348
6644
|
case 'seedance-2':
|
|
6349
|
-
return
|
|
6645
|
+
return Ae(vt, t);
|
|
6350
6646
|
case 'seedance-2-lite':
|
|
6351
|
-
return
|
|
6647
|
+
return Pt(vt);
|
|
6352
6648
|
case 'seedance-2-mini':
|
|
6353
|
-
return
|
|
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
|
|
6653
|
+
return Nr(e);
|
|
6358
6654
|
case 'seedream-5-pro':
|
|
6359
6655
|
return [
|
|
6360
|
-
|
|
6656
|
+
M('Detailed description of the image to generate.'),
|
|
6361
6657
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
6362
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6399
|
-
|
|
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
|
|
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
|
|
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
|
|
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 [
|
|
6941
|
+
return [M('Prompt text.')];
|
|
6482
6942
|
}
|
|
6483
6943
|
}
|
|
6484
|
-
function
|
|
6944
|
+
function De(e, t = e.api.model) {
|
|
6485
6945
|
return {
|
|
6486
6946
|
slug: t,
|
|
6487
6947
|
name: e.name,
|
|
6488
|
-
category:
|
|
6489
|
-
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:
|
|
6952
|
+
priceFormatted: Er(e),
|
|
6493
6953
|
unit: e.unit,
|
|
6494
|
-
primaryToolName:
|
|
6495
|
-
parameters:
|
|
6954
|
+
primaryToolName: $r[e.kind],
|
|
6955
|
+
parameters: Dr(e, Wr(e)),
|
|
6496
6956
|
};
|
|
6497
6957
|
}
|
|
6498
|
-
function
|
|
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'] =
|
|
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 =
|
|
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] =
|
|
6972
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = De(t));
|
|
6513
6973
|
}
|
|
6514
|
-
Object.assign(e,
|
|
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
|
|
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
|
|
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
|
|
6525
|
-
if (
|
|
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' &&
|
|
6529
|
-
(t === 'max_completion_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
|
|
6996
|
+
function Tt(e) {
|
|
6533
6997
|
return e != null && e !== '';
|
|
6534
6998
|
}
|
|
6535
|
-
function
|
|
6999
|
+
function At(e, t) {
|
|
6536
7000
|
let r = { ...t };
|
|
6537
7001
|
if (e?.slug === 'seedance-2-5') {
|
|
6538
|
-
let
|
|
6539
|
-
for (let
|
|
6540
|
-
if (!
|
|
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
|
|
6543
|
-
|
|
6544
|
-
r[
|
|
6545
|
-
|
|
6546
|
-
(r[
|
|
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
|
|
7013
|
+
function R() {
|
|
6550
7014
|
return Object.values(ue);
|
|
6551
7015
|
}
|
|
6552
|
-
var
|
|
6553
|
-
Mr,
|
|
6554
|
-
Kr,
|
|
6555
|
-
q,
|
|
6556
|
-
vt,
|
|
7016
|
+
var qr,
|
|
6557
7017
|
$r,
|
|
6558
7018
|
Cr,
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
7019
|
+
M,
|
|
7020
|
+
St,
|
|
7021
|
+
Or,
|
|
7022
|
+
Rr,
|
|
7023
|
+
qt,
|
|
7024
|
+
$t,
|
|
7025
|
+
Le,
|
|
6564
7026
|
Lr,
|
|
6565
|
-
|
|
7027
|
+
Ur,
|
|
7028
|
+
Br,
|
|
7029
|
+
Fr,
|
|
7030
|
+
Hr,
|
|
6566
7031
|
ce,
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
7032
|
+
_t,
|
|
7033
|
+
Ct,
|
|
7034
|
+
Et,
|
|
7035
|
+
vt,
|
|
7036
|
+
Yr,
|
|
6572
7037
|
ue,
|
|
6573
|
-
|
|
6574
|
-
|
|
7038
|
+
Zr,
|
|
7039
|
+
W = y(() => {
|
|
6575
7040
|
'use strict';
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
Se();
|
|
6582
|
-
pt();
|
|
6583
|
-
ct();
|
|
6584
|
-
mt();
|
|
6585
|
-
bt();
|
|
7041
|
+
it();
|
|
7042
|
+
Ie();
|
|
7043
|
+
B();
|
|
7044
|
+
qe();
|
|
7045
|
+
Pe();
|
|
6586
7046
|
$e();
|
|
6587
|
-
(
|
|
6588
|
-
|
|
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
|
-
(
|
|
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
|
-
|
|
6601
|
-
((
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
6633
|
-
|
|
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
|
-
((
|
|
6643
|
-
|
|
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
|
-
(
|
|
6661
|
-
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
|
|
6984
|
-
|
|
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
|
-
(
|
|
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
|
-
|
|
7061
|
-
|
|
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 =
|
|
7077
|
-
|
|
7567
|
+
ue = Qr();
|
|
7568
|
+
Zr = ['draft_task_id', 'draft_generation_id'];
|
|
7078
7569
|
});
|
|
7079
|
-
function
|
|
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
|
|
7575
|
+
var Ue = y(() => {
|
|
7085
7576
|
'use strict';
|
|
7086
7577
|
});
|
|
7087
|
-
function
|
|
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
|
|
7091
|
-
let t = oe().filter((
|
|
7092
|
-
r = t.filter((
|
|
7093
|
-
|
|
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
|
-
? [`${
|
|
7587
|
+
? [`${Gt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7097
7588
|
: []),
|
|
7098
|
-
...(
|
|
7589
|
+
...(a.length ? [`Not available yet on ${Gt(a)}: ${de}.`] : []),
|
|
7099
7590
|
'The Acceptable Use Policy applies.',
|
|
7100
7591
|
].join(' ');
|
|
7101
7592
|
}
|
|
7102
|
-
function
|
|
7103
|
-
if (
|
|
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:
|
|
7598
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: wa } } };
|
|
7108
7599
|
}
|
|
7109
|
-
function
|
|
7600
|
+
function _a(e) {
|
|
7110
7601
|
let t = e.inputSchema.properties;
|
|
7111
7602
|
if (!t) return e;
|
|
7112
7603
|
let r = !1,
|
|
7113
|
-
|
|
7114
|
-
for (let [
|
|
7115
|
-
|
|
7116
|
-
? ((
|
|
7117
|
-
:
|
|
7118
|
-
? ((
|
|
7119
|
-
: (
|
|
7120
|
-
return r ? { ...e, inputSchema: { ...e.inputSchema, properties:
|
|
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
|
|
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
|
|
7668
|
+
function Ta(e, t) {
|
|
7178
7669
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
for (let o of e.parameters) ((
|
|
7182
|
-
let
|
|
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:
|
|
7185
|
-
...(
|
|
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:
|
|
7682
|
+
inputSchema: s,
|
|
7192
7683
|
};
|
|
7193
7684
|
}
|
|
7194
|
-
function
|
|
7195
|
-
let e =
|
|
7196
|
-
t =
|
|
7197
|
-
r =
|
|
7198
|
-
|
|
7199
|
-
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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 =
|
|
7450
|
-
return [
|
|
7956
|
+
p = Ka();
|
|
7957
|
+
return [n, s, o, u, l, p, c, Ia];
|
|
7451
7958
|
}
|
|
7452
|
-
function
|
|
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
|
|
7500
|
-
let e =
|
|
7501
|
-
t =
|
|
7502
|
-
return [...e, ...t].map(
|
|
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
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
8011
|
+
var wa,
|
|
8012
|
+
xa,
|
|
8013
|
+
Ia,
|
|
8014
|
+
Ht,
|
|
8015
|
+
Jt = y(() => {
|
|
7509
8016
|
'use strict';
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
((
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
|
|
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
|
|
7559
|
-
|
|
7560
|
-
forgetToolSchemas: () =>
|
|
7561
|
-
jsonRpcAnswer: () =>
|
|
7562
|
-
preprocessLocalFiles: () =>
|
|
7563
|
-
startStdioServer: () =>
|
|
8065
|
+
var ir = {};
|
|
8066
|
+
ur(ir, {
|
|
8067
|
+
forgetToolSchemas: () => Ea,
|
|
8068
|
+
jsonRpcAnswer: () => Xt,
|
|
8069
|
+
preprocessLocalFiles: () => rr,
|
|
8070
|
+
startStdioServer: () => ar,
|
|
7564
8071
|
});
|
|
7565
|
-
function
|
|
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
|
|
7571
|
-
let
|
|
7572
|
-
|
|
7573
|
-
|
|
8077
|
+
function Xt(e, t, r) {
|
|
8078
|
+
let a = e?.id,
|
|
8079
|
+
n = a == null,
|
|
8080
|
+
s = null;
|
|
7574
8081
|
try {
|
|
7575
|
-
|
|
8082
|
+
s = r ? JSON.parse(r) : null;
|
|
7576
8083
|
} catch {
|
|
7577
|
-
|
|
8084
|
+
s = null;
|
|
7578
8085
|
}
|
|
7579
|
-
if (
|
|
7580
|
-
if (
|
|
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 =
|
|
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:
|
|
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
|
|
8107
|
+
function qa() {
|
|
7601
8108
|
let e = process.argv.slice(2),
|
|
7602
8109
|
t = e.indexOf('--api-key');
|
|
7603
|
-
return
|
|
8110
|
+
return q(t >= 0 ? e[t + 1] : void 0);
|
|
7604
8111
|
}
|
|
7605
|
-
async function
|
|
7606
|
-
let
|
|
7607
|
-
if (!
|
|
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
|
|
7610
|
-
|
|
7611
|
-
o =
|
|
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:
|
|
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
|
|
7635
|
-
return
|
|
8141
|
+
function er(e) {
|
|
8142
|
+
return $a.has(j.default.extname(e).toLowerCase());
|
|
7636
8143
|
}
|
|
7637
|
-
function
|
|
8144
|
+
function tr(e) {
|
|
7638
8145
|
return new Error(
|
|
7639
|
-
`Tein uploads image, video and audio files only, and ${
|
|
8146
|
+
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
7640
8147
|
);
|
|
7641
8148
|
}
|
|
7642
|
-
function
|
|
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 =
|
|
7653
|
-
return
|
|
8159
|
+
let r = j.default.resolve(t);
|
|
8160
|
+
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
7654
8161
|
}
|
|
7655
|
-
function
|
|
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
|
-
|
|
8169
|
+
X.set(r.name, r.inputSchema);
|
|
7663
8170
|
}
|
|
7664
8171
|
}
|
|
7665
|
-
function
|
|
7666
|
-
(
|
|
8172
|
+
function Ea() {
|
|
8173
|
+
(X.clear(), (Je = 0));
|
|
7667
8174
|
}
|
|
7668
|
-
async function
|
|
7669
|
-
if (!(Date.now() -
|
|
7670
|
-
|
|
8175
|
+
async function Aa(e, t) {
|
|
8176
|
+
if (!(Date.now() - Je < 6e4)) {
|
|
8177
|
+
Je = Date.now();
|
|
7671
8178
|
try {
|
|
7672
|
-
let
|
|
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
|
-
|
|
8187
|
+
We(a.result?.tools);
|
|
7681
8188
|
} catch {}
|
|
7682
8189
|
}
|
|
7683
8190
|
}
|
|
7684
|
-
function
|
|
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
|
|
8198
|
+
async function Wt(e, t, r) {
|
|
7692
8199
|
if (typeof e != 'string') return e;
|
|
7693
|
-
let
|
|
7694
|
-
if (!
|
|
7695
|
-
if (!
|
|
7696
|
-
return (await
|
|
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
|
|
7699
|
-
(
|
|
7700
|
-
let
|
|
7701
|
-
if (!
|
|
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 (
|
|
8211
|
+
if (Oa(s[u]))
|
|
7705
8212
|
if (Array.isArray(l)) {
|
|
7706
8213
|
let c = [];
|
|
7707
|
-
for (let p of l) c.push(await
|
|
8214
|
+
for (let p of l) c.push(await Wt(p, r, a));
|
|
7708
8215
|
o[u] = c;
|
|
7709
|
-
} else o[u] = await
|
|
8216
|
+
} else o[u] = await Wt(l, r, a);
|
|
7710
8217
|
return o;
|
|
7711
8218
|
}
|
|
7712
|
-
function
|
|
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:
|
|
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
|
|
7754
|
-
if (
|
|
7755
|
-
|
|
7756
|
-
let e =
|
|
7757
|
-
t =
|
|
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
|
-
(
|
|
8266
|
+
(Qt.default
|
|
7760
8267
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
7761
|
-
.on('line', async (
|
|
7762
|
-
let
|
|
7763
|
-
if (
|
|
8268
|
+
.on('line', async (n) => {
|
|
8269
|
+
let s = n.trim();
|
|
8270
|
+
if (s)
|
|
7764
8271
|
try {
|
|
7765
|
-
let o = JSON.parse(
|
|
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(/\/+$/, '')}${
|
|
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 =
|
|
7819
|
-
if (
|
|
7820
|
-
if (!
|
|
7821
|
-
let m = await
|
|
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
|
-
|
|
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
|
`
|
|
7829
8336
|
: '',
|
|
7830
|
-
|
|
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${
|
|
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(
|
|
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
|
|
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 =
|
|
8415
|
+
p = Xt(o, l.status, c);
|
|
7909
8416
|
if (p === null) return;
|
|
7910
8417
|
if (p) {
|
|
7911
|
-
(o?.method === 'tools/list' &&
|
|
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 =
|
|
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
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
8450
|
+
var D,
|
|
8451
|
+
j,
|
|
8452
|
+
Qt,
|
|
8453
|
+
$a,
|
|
8454
|
+
X,
|
|
8455
|
+
Je,
|
|
8456
|
+
Yt,
|
|
8457
|
+
nr = y(() => {
|
|
7951
8458
|
'use strict';
|
|
7952
|
-
((
|
|
7953
|
-
(
|
|
7954
|
-
(
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
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
|
-
((
|
|
7985
|
-
|
|
8491
|
+
((X = new Map()), (Je = 0));
|
|
8492
|
+
Yt = !1;
|
|
7986
8493
|
require.main === module &&
|
|
7987
|
-
|
|
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
|
|
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) => (
|
|
8504
|
+
return (r) => (fr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
7998
8505
|
}
|
|
7999
|
-
var
|
|
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
|
-
|
|
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 =
|
|
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${
|
|
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${
|
|
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
|
|
8082
|
-
|
|
8083
|
-
var ee =
|
|
8084
|
-
|
|
8085
|
-
|
|
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
|
|
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
|
-
|
|
8095
|
-
|
|
8601
|
+
v = 1,
|
|
8602
|
+
hr = 3,
|
|
8096
8603
|
w = class extends Error {
|
|
8097
|
-
constructor(t, r,
|
|
8604
|
+
constructor(t, r, a, n = {}) {
|
|
8098
8605
|
(super(r),
|
|
8099
8606
|
(this.name = 'TeinApiError'),
|
|
8100
8607
|
(this.status = t),
|
|
8101
|
-
|
|
8102
|
-
(this.fields =
|
|
8608
|
+
a && (this.code = a),
|
|
8609
|
+
(this.fields = n));
|
|
8103
8610
|
}
|
|
8104
8611
|
get exitCode() {
|
|
8105
|
-
return this.code &&
|
|
8612
|
+
return this.code && gr.has(this.code) ? hr : v;
|
|
8106
8613
|
}
|
|
8107
8614
|
};
|
|
8108
|
-
function
|
|
8109
|
-
let
|
|
8110
|
-
if (!r || typeof r != 'object') return new w(e,
|
|
8111
|
-
let
|
|
8112
|
-
if (
|
|
8113
|
-
let p =
|
|
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 :
|
|
8622
|
+
return new w(e, typeof m == 'string' && m ? m : a, typeof d == 'string' ? d : void 0, h);
|
|
8116
8623
|
}
|
|
8117
|
-
let { error:
|
|
8118
|
-
c = (typeof
|
|
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
|
|
8628
|
+
function Qe(e) {
|
|
8122
8629
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8123
8630
|
}
|
|
8124
|
-
function
|
|
8631
|
+
function S(e) {
|
|
8125
8632
|
let t = [e.message],
|
|
8126
|
-
r =
|
|
8127
|
-
|
|
8128
|
-
(r ||
|
|
8129
|
-
t.push([r ? `Required: ${r}` : '',
|
|
8130
|
-
let
|
|
8131
|
-
typeof
|
|
8132
|
-
let
|
|
8133
|
-
return (typeof
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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,
|
|
8163
|
-
let
|
|
8669
|
+
async send(t, r, a) {
|
|
8670
|
+
let n = await fetch(`${this.baseUrl}${r}`, {
|
|
8164
8671
|
method: t,
|
|
8165
8672
|
headers: this.getHeaders(),
|
|
8166
|
-
...(
|
|
8673
|
+
...(a === void 0 ? {} : { body: JSON.stringify(a) }),
|
|
8167
8674
|
});
|
|
8168
|
-
if (!
|
|
8169
|
-
let
|
|
8675
|
+
if (!n.ok) {
|
|
8676
|
+
let s = null;
|
|
8170
8677
|
try {
|
|
8171
|
-
|
|
8678
|
+
s = await n.json();
|
|
8172
8679
|
} catch {}
|
|
8173
|
-
throw
|
|
8680
|
+
throw yr(n.status, n.statusText, s);
|
|
8174
8681
|
}
|
|
8175
|
-
return await
|
|
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((
|
|
8182
|
-
let
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
?
|
|
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 =
|
|
8694
|
+
o = Xe(a);
|
|
8188
8695
|
return {
|
|
8189
|
-
request_id:
|
|
8190
|
-
model:
|
|
8191
|
-
status:
|
|
8696
|
+
request_id: a.request_id || a.id || '',
|
|
8697
|
+
model: a.model,
|
|
8698
|
+
status: s,
|
|
8192
8699
|
...(o.length ? { output: o } : {}),
|
|
8193
|
-
error:
|
|
8194
|
-
...(
|
|
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
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
?
|
|
8707
|
+
let a = r.status,
|
|
8708
|
+
n =
|
|
8709
|
+
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
8710
|
+
? a
|
|
8204
8711
|
: 'processing',
|
|
8205
|
-
|
|
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:
|
|
8211
|
-
...(
|
|
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
|
|
8222
|
-
if (!
|
|
8223
|
-
let
|
|
8224
|
-
ee.default.existsSync(
|
|
8225
|
-
let
|
|
8226
|
-
return (await (0,
|
|
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
|
-
|
|
8230
|
-
function
|
|
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
|
-
|
|
8236
|
-
return
|
|
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
|
-
|
|
8239
|
-
var
|
|
8240
|
-
function
|
|
8241
|
-
for (let t of
|
|
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
|
|
8750
|
+
function ta(e) {
|
|
8244
8751
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8245
|
-
let t =
|
|
8246
|
-
return
|
|
8752
|
+
let t = $.default.resolve(e);
|
|
8753
|
+
return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
|
|
8247
8754
|
}
|
|
8248
|
-
async function
|
|
8249
|
-
for (let r of
|
|
8755
|
+
async function ra(e, t) {
|
|
8756
|
+
for (let r of Ot) {
|
|
8250
8757
|
if (!Array.isArray(e[r])) continue;
|
|
8251
|
-
let
|
|
8252
|
-
for (let
|
|
8253
|
-
if (typeof
|
|
8254
|
-
let
|
|
8255
|
-
|
|
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] =
|
|
8764
|
+
e[r] = a;
|
|
8258
8765
|
}
|
|
8259
8766
|
}
|
|
8260
|
-
var
|
|
8261
|
-
function
|
|
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 =
|
|
8771
|
+
r = Y.enterprise;
|
|
8265
8772
|
return (
|
|
8266
8773
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
8267
8774
|
(process.stderr
|
|
8268
|
-
.write(`${
|
|
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
|
|
8275
|
-
|
|
8276
|
-
process.stderr.write(`Starting ${
|
|
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
|
|
8279
|
-
Array.from({ length:
|
|
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
|
|
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 (!
|
|
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)), !
|
|
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 ${
|
|
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 (
|
|
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(` ${
|
|
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(`${
|
|
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(
|
|
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
|
|
8861
|
+
function Rt(e) {
|
|
8350
8862
|
let t = {},
|
|
8351
8863
|
r = new Set(),
|
|
8352
|
-
|
|
8353
|
-
for (let
|
|
8354
|
-
let
|
|
8355
|
-
if (
|
|
8356
|
-
let o =
|
|
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 (
|
|
8361
|
-
let u = e[
|
|
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
|
-
|
|
8881
|
+
n++);
|
|
8370
8882
|
} else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
|
|
8371
|
-
} else if (
|
|
8372
|
-
let o =
|
|
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
|
-
:
|
|
8388
|
-
? ((t[l] = e[
|
|
8899
|
+
: n + 1 < e.length && !e[n + 1].startsWith('-')
|
|
8900
|
+
? ((t[l] = e[n + 1]), n++)
|
|
8389
8901
|
: (t[l] = !0);
|
|
8390
|
-
} else
|
|
8902
|
+
} else a.push(s);
|
|
8391
8903
|
}
|
|
8392
|
-
return { command:
|
|
8904
|
+
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
|
|
8393
8905
|
}
|
|
8394
|
-
async function
|
|
8395
|
-
let r =
|
|
8396
|
-
|
|
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(`${
|
|
8910
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
8399
8911
|
`),
|
|
8400
8912
|
process.stderr
|
|
8401
|
-
.write(`Please run ${
|
|
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(`${
|
|
8917
|
+
(process.stderr.write(`${i.red('Error:')} Missing model slug.
|
|
8406
8918
|
`),
|
|
8407
|
-
process.stderr.write(`Usage: ${
|
|
8919
|
+
process.stderr.write(`Usage: ${i.cyan('tein run <model-slug> --prompt "..."')}
|
|
8408
8920
|
`),
|
|
8409
|
-
process.stderr.write(`Run ${
|
|
8921
|
+
process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
|
|
8410
8922
|
`),
|
|
8411
8923
|
process.exit(1)));
|
|
8412
|
-
let
|
|
8413
|
-
|
|
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 =
|
|
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 =
|
|
8426
|
-
(
|
|
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
|
|
8433
|
-
m = [
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
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
|
|
8443
|
-
|
|
8444
|
-
((p[
|
|
8445
|
-
} catch (
|
|
8446
|
-
let
|
|
8447
|
-
(
|
|
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:
|
|
8969
|
+
JSON.stringify({ error: C }) +
|
|
8450
8970
|
`
|
|
8451
8971
|
`,
|
|
8452
8972
|
)
|
|
8453
|
-
:
|
|
8973
|
+
: I.fail(`Upload failed: ${C}`),
|
|
8454
8974
|
process.exit(1));
|
|
8455
8975
|
}
|
|
8456
8976
|
}
|
|
8457
8977
|
}
|
|
8458
8978
|
}
|
|
8459
|
-
await
|
|
8460
|
-
let
|
|
8461
|
-
|
|
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
|
|
8464
|
-
|
|
8465
|
-
return (
|
|
8466
|
-
} catch (
|
|
8467
|
-
let
|
|
8468
|
-
(
|
|
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:
|
|
8990
|
+
JSON.stringify({ error: I }) +
|
|
8471
8991
|
`
|
|
8472
8992
|
`,
|
|
8473
8993
|
)
|
|
8474
|
-
:
|
|
8994
|
+
: g.fail(`Upload failed: ${I}`),
|
|
8475
8995
|
process.exit(1));
|
|
8476
8996
|
}
|
|
8477
8997
|
});
|
|
8478
|
-
let h = new
|
|
8479
|
-
|
|
8480
|
-
let
|
|
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
|
|
9003
|
+
await ia(d, e, p, l, { isJson: s, isAsync: o });
|
|
8484
9004
|
return;
|
|
8485
9005
|
}
|
|
8486
|
-
|
|
8487
|
-
} catch (
|
|
8488
|
-
let
|
|
8489
|
-
(
|
|
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
|
-
|
|
8493
|
-
? { error: { code:
|
|
8494
|
-
: { error: { code: null, message:
|
|
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
|
-
|
|
8503
|
-
?
|
|
9022
|
+
g
|
|
9023
|
+
? S(g).join(`
|
|
8504
9024
|
`)
|
|
8505
|
-
: `Failed to start generation: ${
|
|
9025
|
+
: `Failed to start generation: ${b instanceof Error ? b.message : b}`,
|
|
8506
9026
|
),
|
|
8507
|
-
process.exit(
|
|
9027
|
+
process.exit(g ? g.exitCode : v));
|
|
8508
9028
|
}
|
|
8509
9029
|
if (o) {
|
|
8510
|
-
|
|
9030
|
+
s
|
|
8511
9031
|
? process.stdout.write(
|
|
8512
|
-
JSON.stringify(
|
|
9032
|
+
JSON.stringify(f, null, 2) +
|
|
8513
9033
|
`
|
|
8514
9034
|
`,
|
|
8515
9035
|
)
|
|
8516
|
-
: (h.succeed(`Queued successfully! Request ID: ${
|
|
8517
|
-
process.stdout.write(`Check status anytime with: ${
|
|
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
|
|
8522
|
-
|
|
8523
|
-
for (;
|
|
8524
|
-
let
|
|
8525
|
-
(
|
|
8526
|
-
await new Promise((
|
|
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
|
-
|
|
8529
|
-
} catch (
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
(
|
|
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
|
-
|
|
9054
|
+
S(g).join(`
|
|
8535
9055
|
`),
|
|
8536
9056
|
),
|
|
8537
|
-
process.exit(
|
|
9057
|
+
process.exit(g.exitCode));
|
|
8538
9058
|
}
|
|
8539
9059
|
}
|
|
8540
9060
|
if (
|
|
8541
|
-
((
|
|
8542
|
-
(
|
|
9061
|
+
((f.status === 'failed' || f.status === 'expired' || f.status === 'cancelled') &&
|
|
9062
|
+
(s
|
|
8543
9063
|
? process.stdout.write(
|
|
8544
|
-
JSON.stringify(
|
|
9064
|
+
JSON.stringify(f, null, 2) +
|
|
8545
9065
|
`
|
|
8546
9066
|
`,
|
|
8547
9067
|
)
|
|
8548
|
-
: h.fail(`Generation ${
|
|
8549
|
-
process.exit(
|
|
8550
|
-
|
|
8551
|
-
|
|
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(
|
|
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(` ${
|
|
9083
|
+
process.stdout.write(` ${i.bold('Status:')} ${i.green('Succeeded')}
|
|
8564
9084
|
`),
|
|
8565
|
-
process.stdout.write(` ${
|
|
9085
|
+
process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
|
|
8566
9086
|
`),
|
|
8567
|
-
|
|
8568
|
-
process.stdout.write(` ${
|
|
9087
|
+
f.usage?.cost !== void 0 &&
|
|
9088
|
+
process.stdout.write(` ${i.bold('Cost:')} ${xe(f.usage.cost)}
|
|
8569
9089
|
`),
|
|
8570
|
-
|
|
9090
|
+
f.output && f.output.length > 0)
|
|
8571
9091
|
) {
|
|
8572
9092
|
process.stdout.write(`
|
|
8573
|
-
${
|
|
9093
|
+
${i.bold('Outputs:')}
|
|
8574
9094
|
`);
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
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(` [${
|
|
9102
|
+
(process.stdout.write(` [${I.type.toUpperCase()}]${L} ${i.cyan(i.underline(I.url))}
|
|
8580
9103
|
`),
|
|
8581
9104
|
u)
|
|
8582
9105
|
) {
|
|
8583
|
-
let
|
|
9106
|
+
let C = na(u, g++, b),
|
|
9107
|
+
Ye = new T(`Downloading output to ${C}...`).start();
|
|
8584
9108
|
try {
|
|
8585
|
-
(await d.downloadOutput(
|
|
8586
|
-
|
|
8587
|
-
} catch (
|
|
8588
|
-
|
|
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
|
-
|
|
9116
|
+
I.text &&
|
|
8593
9117
|
process.stdout.write(`
|
|
8594
|
-
${
|
|
9118
|
+
${I.text}
|
|
8595
9119
|
`);
|
|
8596
9120
|
}
|
|
8597
9121
|
}
|
|
8598
9122
|
process.stdout.write(`
|
|
8599
9123
|
`);
|
|
8600
9124
|
}
|
|
8601
|
-
var
|
|
8602
|
-
|
|
8603
|
-
async function
|
|
9125
|
+
var Dt = _(require('node:readline'));
|
|
9126
|
+
A();
|
|
9127
|
+
async function sa(e) {
|
|
8604
9128
|
try {
|
|
8605
|
-
return (await new
|
|
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
|
|
8615
|
-
let t =
|
|
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, (
|
|
8618
|
-
(t.close(), r(
|
|
9141
|
+
t.question(e, (a) => {
|
|
9142
|
+
(t.close(), r(a.trim()));
|
|
8619
9143
|
});
|
|
8620
9144
|
});
|
|
8621
9145
|
}
|
|
8622
|
-
async function
|
|
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
|
-
${
|
|
9153
|
+
${i.bold('Tein AI Authentication')}
|
|
8630
9154
|
`),
|
|
8631
|
-
process.stdout.write(`Get your API key at: ${
|
|
9155
|
+
process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
|
|
8632
9156
|
|
|
8633
9157
|
`),
|
|
8634
|
-
(r = await
|
|
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(`${
|
|
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
|
|
8642
|
-
(
|
|
9165
|
+
let a = await sa(r);
|
|
9166
|
+
(a === 'invalid' &&
|
|
8643
9167
|
(process.stderr
|
|
8644
|
-
.write(`${
|
|
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
|
-
|
|
9171
|
+
we({ apiKey: r }),
|
|
8648
9172
|
process.stdout.write(`
|
|
8649
|
-
${
|
|
9173
|
+
${i.green('\u2713')} API key saved to ${i.dim(re())}
|
|
8650
9174
|
`),
|
|
8651
|
-
|
|
9175
|
+
a === 'blocked'
|
|
8652
9176
|
? process.stdout
|
|
8653
|
-
.write(`${
|
|
9177
|
+
.write(`${i.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
|
|
8654
9178
|
`)
|
|
8655
|
-
:
|
|
9179
|
+
: a === 'unchecked' &&
|
|
8656
9180
|
process.stdout
|
|
8657
|
-
.write(`${
|
|
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: ${
|
|
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 (!
|
|
9190
|
+
if (!U().apiKey) {
|
|
8667
9191
|
process.stdout
|
|
8668
|
-
.write(`${
|
|
9192
|
+
.write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
|
|
8669
9193
|
`);
|
|
8670
9194
|
break;
|
|
8671
9195
|
}
|
|
8672
|
-
(
|
|
9196
|
+
(we({ apiKey: '' }),
|
|
8673
9197
|
process.stdout
|
|
8674
|
-
.write(`${
|
|
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 =
|
|
8680
|
-
|
|
8681
|
-
|
|
9203
|
+
let r = q(),
|
|
9204
|
+
a = P(),
|
|
9205
|
+
n = U();
|
|
8682
9206
|
if (
|
|
8683
9207
|
(process.stdout.write(`
|
|
8684
|
-
${
|
|
9208
|
+
${i.bold('Tein AI CLI Configuration')}
|
|
8685
9209
|
`),
|
|
8686
|
-
process.stdout.write(` Config file: ${
|
|
9210
|
+
process.stdout.write(` Config file: ${i.dim(re())}
|
|
8687
9211
|
`),
|
|
8688
|
-
process.stdout.write(` API URL: ${
|
|
9212
|
+
process.stdout.write(` API URL: ${i.cyan(a)}
|
|
8689
9213
|
`),
|
|
8690
9214
|
!r)
|
|
8691
9215
|
)
|
|
8692
|
-
(process.stdout.write(` API Key: ${
|
|
9216
|
+
(process.stdout.write(` API Key: ${i.red('Not configured')}
|
|
8693
9217
|
|
|
8694
9218
|
`),
|
|
8695
9219
|
process.stdout
|
|
8696
|
-
.write(`Run ${
|
|
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
|
|
9224
|
+
let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
|
|
8701
9225
|
process.stdout
|
|
8702
|
-
.write(` API 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
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
var
|
|
8714
|
-
async function
|
|
9234
|
+
A();
|
|
9235
|
+
Ie();
|
|
9236
|
+
W();
|
|
9237
|
+
var la = 3e3;
|
|
9238
|
+
async function Lt(e) {
|
|
8715
9239
|
try {
|
|
8716
|
-
let t = await fetch(`${
|
|
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
|
-
|
|
8720
|
-
for (let
|
|
8721
|
-
let
|
|
8722
|
-
|
|
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
|
-
|
|
9248
|
+
Mt(a);
|
|
8725
9249
|
} catch {}
|
|
8726
9250
|
}
|
|
8727
|
-
var
|
|
8728
|
-
|
|
8729
|
-
async function
|
|
8730
|
-
await
|
|
8731
|
-
let r =
|
|
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
|
|
8734
|
-
o =
|
|
8735
|
-
r =
|
|
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(
|
|
9261
|
+
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
8738
9262
|
}
|
|
8739
9263
|
(process.stdout.write(`
|
|
8740
|
-
${
|
|
9264
|
+
${i.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
8741
9265
|
`),
|
|
8742
9266
|
process.stdout
|
|
8743
|
-
.write(`${
|
|
9267
|
+
.write(`${i.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
|
|
8744
9268
|
|
|
8745
9269
|
`));
|
|
8746
|
-
let
|
|
8747
|
-
for (let
|
|
8748
|
-
let o =
|
|
8749
|
-
(
|
|
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
|
|
8752
|
-
for (let
|
|
8753
|
-
let o =
|
|
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(`${
|
|
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(` ${
|
|
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(`${
|
|
9293
|
+
.write(`${i.dim('Tip:')} Generate directly with ${i.cyan('tein run <model-slug> --prompt "..."')}
|
|
8770
9294
|
|
|
8771
9295
|
`);
|
|
8772
9296
|
}
|
|
8773
|
-
async function
|
|
8774
|
-
|
|
8775
|
-
let r =
|
|
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(`${
|
|
9301
|
+
(process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
8778
9302
|
`),
|
|
8779
|
-
process.stderr.write(`Run ${
|
|
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
|
-
${
|
|
9307
|
+
${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
|
|
8784
9308
|
`),
|
|
8785
|
-
process.stdout.write(` ${
|
|
9309
|
+
process.stdout.write(` ${i.gray(r.description)}
|
|
8786
9310
|
|
|
8787
9311
|
`),
|
|
8788
|
-
process.stdout.write(`${
|
|
9312
|
+
process.stdout.write(`${i.bold('Metadata:')}
|
|
8789
9313
|
`),
|
|
8790
|
-
process.stdout.write(` 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: ${
|
|
9320
|
+
process.stdout.write(` Pricing: ${i.green(r.priceFormatted)}
|
|
8797
9321
|
|
|
8798
9322
|
`),
|
|
8799
|
-
process.stdout.write(`${
|
|
9323
|
+
process.stdout.write(`${i.bold('Parameters:')}
|
|
8800
9324
|
`));
|
|
8801
|
-
for (let
|
|
8802
|
-
let
|
|
8803
|
-
|
|
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(` ${
|
|
9329
|
+
.write(` ${i.bold(`--${a.name.replace(/_/g, '-')}`)} ${i.yellow(`<${a.type}>`)} ${n}${s}
|
|
8806
9330
|
`),
|
|
8807
|
-
|
|
8808
|
-
process.stdout.write(` ${
|
|
9331
|
+
a.description &&
|
|
9332
|
+
process.stdout.write(` ${i.gray(a.description)}
|
|
8809
9333
|
`),
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
process.stdout.write(` Allowed values: ${
|
|
9334
|
+
a.options &&
|
|
9335
|
+
a.options.length > 0 &&
|
|
9336
|
+
process.stdout.write(` Allowed values: ${i.dim(a.options.join(', '))}
|
|
8813
9337
|
`),
|
|
8814
|
-
(
|
|
8815
|
-
process.stdout.write(` Range: ${
|
|
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((
|
|
9345
|
+
(r.parameters.some((a) => a.name === 'callback_url') ||
|
|
8822
9346
|
(process.stdout
|
|
8823
|
-
.write(` ${
|
|
9347
|
+
.write(` ${i.bold('--callback-url')} ${i.yellow('<string>')} ${i.dim('(optional)')}
|
|
8824
9348
|
`),
|
|
8825
9349
|
process.stdout
|
|
8826
|
-
.write(` ${
|
|
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(`${
|
|
9353
|
+
process.stdout.write(`${i.bold('Sample CLI Usage:')}
|
|
8830
9354
|
`),
|
|
8831
9355
|
r.category === 'Video')
|
|
8832
9356
|
)
|
|
8833
9357
|
process.stdout
|
|
8834
|
-
.write(` ${
|
|
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
|
|
9362
|
+
let a = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
|
|
8839
9363
|
process.stdout
|
|
8840
|
-
.write(` ${
|
|
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(` ${
|
|
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(` ${
|
|
9374
|
+
.write(` ${i.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
|
|
8851
9375
|
|
|
8852
9376
|
`);
|
|
8853
9377
|
}
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
var
|
|
8857
|
-
|
|
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
|
-
|
|
8868
|
-
|
|
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
|
|
8875
|
-
let r =
|
|
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
|
|
8879
|
-
let r = `${
|
|
8880
|
-
|
|
9402
|
+
async function ga(e, t) {
|
|
9403
|
+
let r = `${P(e)}${fe(t)}`,
|
|
9404
|
+
a;
|
|
8881
9405
|
try {
|
|
8882
|
-
|
|
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
|
|
8887
|
-
if (!
|
|
8888
|
-
let
|
|
8889
|
-
|
|
8890
|
-
?
|
|
8891
|
-
:
|
|
8892
|
-
?
|
|
8893
|
-
: `Pricing request failed (${
|
|
8894
|
-
throw new Error(
|
|
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
|
|
9420
|
+
return n;
|
|
8897
9421
|
}
|
|
8898
|
-
function
|
|
9422
|
+
function Be(e) {
|
|
8899
9423
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
8900
|
-
[r,
|
|
8901
|
-
return `$${r}.${
|
|
9424
|
+
[r, a = ''] = t.split('.');
|
|
9425
|
+
return `$${r}.${a.padEnd(2, '0')}`;
|
|
8902
9426
|
}
|
|
8903
|
-
function
|
|
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 ${
|
|
9431
|
+
return `Starter ${Be(e.starter)} Plus ${Be(t)} Scale ${Be(r)}`;
|
|
8908
9432
|
}
|
|
8909
|
-
function
|
|
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
|
|
8914
|
-
|
|
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
|
|
8922
|
-
let r =
|
|
8923
|
-
for (let
|
|
8924
|
-
let
|
|
8925
|
-
if (!
|
|
8926
|
-
let
|
|
8927
|
-
t.push(` ${r}${
|
|
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
|
|
9454
|
+
function ba(e, t) {
|
|
8931
9455
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
8932
9456
|
t.push(
|
|
8933
|
-
` ${
|
|
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
|
|
8936
|
-
let
|
|
8937
|
-
if (Array.isArray(
|
|
8938
|
-
for (let
|
|
8939
|
-
if (!
|
|
8940
|
-
let
|
|
8941
|
-
o = typeof
|
|
8942
|
-
u =
|
|
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
|
|
9471
|
+
function ka(e) {
|
|
8948
9472
|
let t = [],
|
|
8949
9473
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
8950
|
-
(t.push(`${
|
|
9474
|
+
(t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
|
|
8951
9475
|
t.push(
|
|
8952
|
-
`${
|
|
9476
|
+
`${i.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
|
|
8953
9477
|
),
|
|
8954
9478
|
t.push(''));
|
|
8955
|
-
let
|
|
9479
|
+
let a = new Map();
|
|
8956
9480
|
for (let l of e.board.models) {
|
|
8957
9481
|
let c = l.kind || 'other',
|
|
8958
|
-
p =
|
|
8959
|
-
(p.push(l),
|
|
9482
|
+
p = a.get(c) ?? [];
|
|
9483
|
+
(p.push(l), a.set(c, p));
|
|
8960
9484
|
}
|
|
8961
|
-
let
|
|
8962
|
-
|
|
8963
|
-
let p =
|
|
8964
|
-
d =
|
|
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
|
|
8968
|
-
t.push(`${
|
|
8969
|
-
for (let c of
|
|
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(`${
|
|
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(` ${
|
|
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
|
-
|
|
8987
|
-
|
|
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(`${
|
|
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
|
|
9523
|
+
async function Ut(e) {
|
|
9000
9524
|
let t;
|
|
9001
9525
|
try {
|
|
9002
|
-
t = await
|
|
9526
|
+
t = await ga(e.apiUrl, e.model);
|
|
9003
9527
|
} catch (r) {
|
|
9004
|
-
let
|
|
9005
|
-
(process.stderr.write(`${
|
|
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
|
-
:
|
|
9537
|
+
: ka(t),
|
|
9014
9538
|
);
|
|
9015
9539
|
}
|
|
9016
|
-
var
|
|
9017
|
-
|
|
9018
|
-
async function
|
|
9019
|
-
let r =
|
|
9020
|
-
|
|
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(`${
|
|
9546
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9023
9547
|
`),
|
|
9024
9548
|
process.stderr
|
|
9025
|
-
.write(`Please run ${
|
|
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(`${
|
|
9553
|
+
(process.stderr.write(`${i.red('Error:')} Missing request ID.
|
|
9030
9554
|
`),
|
|
9031
|
-
process.stderr.write(`Usage: ${
|
|
9555
|
+
process.stderr.write(`Usage: ${i.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
|
|
9032
9556
|
`),
|
|
9033
9557
|
process.exit(1)));
|
|
9034
|
-
let
|
|
9035
|
-
|
|
9558
|
+
let n = !!t.json,
|
|
9559
|
+
s = !!t.wait,
|
|
9036
9560
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
9037
|
-
u = new
|
|
9038
|
-
l = new
|
|
9039
|
-
|
|
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
|
-
(
|
|
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
|
-
|
|
9580
|
+
S(p).join(`
|
|
9057
9581
|
`),
|
|
9058
9582
|
),
|
|
9059
9583
|
process.exit(p.exitCode)),
|
|
9060
|
-
|
|
9061
|
-
process.exit(
|
|
9584
|
+
n || l.fail(p instanceof Error ? p.message : String(p)),
|
|
9585
|
+
process.exit(v));
|
|
9062
9586
|
}
|
|
9063
|
-
if (
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
|
|
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
|
-
${
|
|
9616
|
+
${i.bold('Model:')} ${c.model}
|
|
9093
9617
|
`),
|
|
9094
9618
|
process.stdout
|
|
9095
|
-
.write(` ${
|
|
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(` ${
|
|
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
|
-
${
|
|
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()}] ${
|
|
9631
|
+
(process.stdout.write(` [${p.type.toUpperCase()}] ${i.cyan(i.underline(p.url))}
|
|
9108
9632
|
`),
|
|
9109
9633
|
o)
|
|
9110
9634
|
) {
|
|
9111
|
-
let d = new
|
|
9635
|
+
let d = new T(`Downloading output to ${o}...`).start();
|
|
9112
9636
|
try {
|
|
9113
|
-
(await u.downloadOutput(p.url,
|
|
9114
|
-
d.succeed(`Saved to ${
|
|
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
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
async function
|
|
9132
|
-
let r =
|
|
9133
|
-
|
|
9134
|
-
|
|
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(`${
|
|
9660
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9137
9661
|
`),
|
|
9138
9662
|
process.stderr
|
|
9139
|
-
.write(`Please run ${
|
|
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(`${
|
|
9667
|
+
(process.stderr.write(`${i.red('Error:')} Missing file path.
|
|
9144
9668
|
`),
|
|
9145
|
-
process.stderr.write(`Usage: ${
|
|
9669
|
+
process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
|
|
9146
9670
|
`),
|
|
9147
9671
|
process.exit(1)));
|
|
9148
|
-
let
|
|
9149
|
-
|
|
9150
|
-
(process.stderr.write(`${
|
|
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 =
|
|
9154
|
-
l =
|
|
9155
|
-
c = new
|
|
9156
|
-
p = new
|
|
9157
|
-
|
|
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
|
-
|
|
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
|
-
${
|
|
9692
|
+
${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
9169
9693
|
`),
|
|
9170
|
-
process.stdout.write(`${
|
|
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
|
-
${
|
|
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
|
-
?
|
|
9704
|
+
? S(m).join(`
|
|
9181
9705
|
`)
|
|
9182
9706
|
: d instanceof Error
|
|
9183
9707
|
? d.message
|
|
9184
9708
|
: String(d);
|
|
9185
|
-
(
|
|
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 :
|
|
9716
|
+
process.exit(m ? m.exitCode : v));
|
|
9193
9717
|
}
|
|
9194
9718
|
}
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
function
|
|
9719
|
+
W();
|
|
9720
|
+
$e();
|
|
9721
|
+
function sr() {
|
|
9198
9722
|
process.stdout.write(`
|
|
9199
|
-
${
|
|
9723
|
+
${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9200
9724
|
|
|
9201
|
-
${
|
|
9202
|
-
${
|
|
9725
|
+
${i.bold('USAGE:')}
|
|
9726
|
+
${i.cyan('tein')} <command> [arguments] [options]
|
|
9203
9727
|
|
|
9204
|
-
${
|
|
9205
|
-
${
|
|
9206
|
-
${
|
|
9207
|
-
${
|
|
9208
|
-
${
|
|
9209
|
-
${
|
|
9210
|
-
${
|
|
9211
|
-
${
|
|
9212
|
-
${
|
|
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
|
-
${
|
|
9215
|
-
${
|
|
9216
|
-
${
|
|
9217
|
-
${
|
|
9218
|
-
${
|
|
9219
|
-
${
|
|
9220
|
-
${
|
|
9221
|
-
${
|
|
9222
|
-
${
|
|
9223
|
-
${
|
|
9224
|
-
${
|
|
9225
|
-
${
|
|
9226
|
-
${
|
|
9227
|
-
${
|
|
9228
|
-
${
|
|
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
|
-
${
|
|
9231
|
-
${
|
|
9232
|
-
${
|
|
9754
|
+
${i.bold('EXAMPLES:')}
|
|
9755
|
+
${i.dim('# 1. Authenticate with your Tein API key')}
|
|
9756
|
+
${i.cyan('tein auth login')}
|
|
9233
9757
|
|
|
9234
|
-
${
|
|
9235
|
-
${
|
|
9758
|
+
${i.dim('# 2. List all Video models')}
|
|
9759
|
+
${i.cyan('tein models video')}
|
|
9236
9760
|
|
|
9237
|
-
${
|
|
9238
|
-
${
|
|
9239
|
-
${
|
|
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
|
-
${
|
|
9242
|
-
${
|
|
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
|
-
${
|
|
9245
|
-
${
|
|
9246
|
-
${
|
|
9247
|
-
${
|
|
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
|
-
${
|
|
9250
|
-
${
|
|
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
|
-
${
|
|
9253
|
-
${
|
|
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
|
|
9781
|
+
async function Da() {
|
|
9258
9782
|
let e = process.argv.slice(2),
|
|
9259
|
-
t =
|
|
9783
|
+
t = Rt(e);
|
|
9260
9784
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
9261
|
-
|
|
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
|
|
9795
|
+
await Q(t.subcommand, t.options.key);
|
|
9272
9796
|
break;
|
|
9273
9797
|
}
|
|
9274
9798
|
case 'login': {
|
|
9275
|
-
await
|
|
9799
|
+
await Q('login', t.options.key);
|
|
9276
9800
|
break;
|
|
9277
9801
|
}
|
|
9278
9802
|
case 'logout': {
|
|
9279
|
-
await
|
|
9803
|
+
await Q('logout');
|
|
9280
9804
|
break;
|
|
9281
9805
|
}
|
|
9282
9806
|
case 'whoami': {
|
|
9283
|
-
await
|
|
9807
|
+
await Q('status');
|
|
9284
9808
|
break;
|
|
9285
9809
|
}
|
|
9286
9810
|
case 'models':
|
|
9287
9811
|
case 'list': {
|
|
9288
|
-
await
|
|
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
|
-
|
|
9295
|
-
await
|
|
9296
|
-
model:
|
|
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(`${
|
|
9829
|
+
(process.stderr.write(`${i.red('Error:')} Missing model slug.
|
|
9306
9830
|
`),
|
|
9307
|
-
process.stderr.write(`Usage: ${
|
|
9831
|
+
process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
|
|
9308
9832
|
`),
|
|
9309
9833
|
process.exit(1)),
|
|
9310
|
-
await
|
|
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
|
|
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
|
|
9845
|
+
await Ne(r, t.options);
|
|
9322
9846
|
break;
|
|
9323
9847
|
}
|
|
9324
9848
|
case 'status': {
|
|
9325
9849
|
let r = t.subcommand || '';
|
|
9326
|
-
await
|
|
9850
|
+
await Ft(r, t.options);
|
|
9327
9851
|
break;
|
|
9328
9852
|
}
|
|
9329
9853
|
case 'mcp': {
|
|
9330
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
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
|
-
(!
|
|
9860
|
+
(!F(t.command) &&
|
|
9337
9861
|
!pe[t.command] &&
|
|
9338
9862
|
(process.stderr.write(`
|
|
9339
|
-
${
|
|
9340
|
-
Run ${
|
|
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(
|
|
9343
|
-
await
|
|
9866
|
+
process.exit(v)),
|
|
9867
|
+
await Ne(t.command, t.options));
|
|
9344
9868
|
return;
|
|
9345
9869
|
}
|
|
9346
|
-
|
|
9870
|
+
sr();
|
|
9347
9871
|
break;
|
|
9348
9872
|
}
|
|
9349
9873
|
}
|
|
9350
9874
|
}
|
|
9351
|
-
|
|
9875
|
+
Da().catch((e) => {
|
|
9352
9876
|
(e instanceof w &&
|
|
9353
9877
|
(process.stderr.write(`
|
|
9354
|
-
${
|
|
9878
|
+
${i.red('Error:')} ${S(e).join(`
|
|
9355
9879
|
`)}
|
|
9356
9880
|
`),
|
|
9357
9881
|
process.exit(e.exitCode)),
|
|
9358
9882
|
process.stderr.write(`
|
|
9359
|
-
${
|
|
9883
|
+
${i.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
9360
9884
|
`),
|
|
9361
|
-
process.exit(
|
|
9885
|
+
process.exit(v));
|
|
9362
9886
|
});
|