@teinai/cli 1.1.20 → 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 +1256 -861
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
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
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
32
|
function U() {
|
|
33
33
|
try {
|
|
@@ -38,7 +38,7 @@ function U() {
|
|
|
38
38
|
} catch {}
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function we(e) {
|
|
42
42
|
try {
|
|
43
43
|
E.default.existsSync(te) || E.default.mkdirSync(te, { recursive: !0, mode: 448 });
|
|
44
44
|
let r = { ...U(), ...e };
|
|
@@ -67,43 +67,43 @@ function re() {
|
|
|
67
67
|
return N;
|
|
68
68
|
}
|
|
69
69
|
var E,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
tt,
|
|
71
|
+
ke,
|
|
72
72
|
te,
|
|
73
73
|
N,
|
|
74
74
|
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((E =
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(te =
|
|
80
|
-
(N =
|
|
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
92
|
var G,
|
|
93
|
-
|
|
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',
|
|
@@ -140,6 +140,11 @@ var ae,
|
|
|
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',
|
|
@@ -4662,6 +4667,13 @@ var ae,
|
|
|
4662
4667
|
endpoint: 'cheap',
|
|
4663
4668
|
component: 'cache_write',
|
|
4664
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
|
+
},
|
|
4665
4677
|
{
|
|
4666
4678
|
id: 'stable-input',
|
|
4667
4679
|
price: { starter: 3.88, plus: 3.63, scale: 3.4191 },
|
|
@@ -4690,6 +4702,13 @@ var ae,
|
|
|
4690
4702
|
endpoint: 'stable',
|
|
4691
4703
|
component: 'cache_write',
|
|
4692
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
|
+
},
|
|
4693
4712
|
],
|
|
4694
4713
|
unfiltered: null,
|
|
4695
4714
|
priority: null,
|
|
@@ -4739,6 +4758,13 @@ var ae,
|
|
|
4739
4758
|
endpoint: 'cheap',
|
|
4740
4759
|
component: 'cache_write',
|
|
4741
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
|
+
},
|
|
4742
4768
|
{
|
|
4743
4769
|
id: 'stable-input',
|
|
4744
4770
|
price: { starter: 1.94, plus: 1.81, scale: 1.709 },
|
|
@@ -4767,6 +4793,13 @@ var ae,
|
|
|
4767
4793
|
endpoint: 'stable',
|
|
4768
4794
|
component: 'cache_write',
|
|
4769
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
|
+
},
|
|
4770
4803
|
],
|
|
4771
4804
|
unfiltered: null,
|
|
4772
4805
|
priority: null,
|
|
@@ -4816,6 +4849,13 @@ var ae,
|
|
|
4816
4849
|
endpoint: 'cheap',
|
|
4817
4850
|
component: 'cache_write',
|
|
4818
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
|
+
},
|
|
4819
4859
|
{
|
|
4820
4860
|
id: 'stable-input',
|
|
4821
4861
|
price: { starter: 0.8245, plus: 0.772, scale: 0.7009 },
|
|
@@ -4844,6 +4884,13 @@ var ae,
|
|
|
4844
4884
|
endpoint: 'stable',
|
|
4845
4885
|
component: 'cache_write',
|
|
4846
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
|
+
},
|
|
4847
4894
|
],
|
|
4848
4895
|
unfiltered: null,
|
|
4849
4896
|
priority: null,
|
|
@@ -4893,6 +4940,13 @@ var ae,
|
|
|
4893
4940
|
endpoint: 'cheap',
|
|
4894
4941
|
component: 'cache_write',
|
|
4895
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
|
+
},
|
|
4896
4950
|
{
|
|
4897
4951
|
id: 'stable-input',
|
|
4898
4952
|
price: { starter: 3.88, plus: 3.63, scale: 3.4191 },
|
|
@@ -4921,6 +4975,13 @@ var ae,
|
|
|
4921
4975
|
endpoint: 'stable',
|
|
4922
4976
|
component: 'cache_write',
|
|
4923
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
|
+
},
|
|
4924
4985
|
],
|
|
4925
4986
|
unfiltered: null,
|
|
4926
4987
|
priority: null,
|
|
@@ -4970,6 +5031,13 @@ var ae,
|
|
|
4970
5031
|
endpoint: 'cheap',
|
|
4971
5032
|
component: 'cache_write',
|
|
4972
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
|
+
},
|
|
4973
5041
|
{
|
|
4974
5042
|
id: 'stable-input',
|
|
4975
5043
|
price: { starter: 1.94, plus: 1.81, scale: 1.709 },
|
|
@@ -4998,6 +5066,13 @@ var ae,
|
|
|
4998
5066
|
endpoint: 'stable',
|
|
4999
5067
|
component: 'cache_write',
|
|
5000
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
|
+
},
|
|
5001
5076
|
],
|
|
5002
5077
|
unfiltered: null,
|
|
5003
5078
|
priority: null,
|
|
@@ -5185,6 +5260,13 @@ var ae,
|
|
|
5185
5260
|
endpoint: 'cheap',
|
|
5186
5261
|
component: 'cache_write',
|
|
5187
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
|
+
},
|
|
5188
5270
|
{
|
|
5189
5271
|
id: 'stable-input',
|
|
5190
5272
|
price: { starter: 0.8245, plus: 0.772, scale: 0.7009 },
|
|
@@ -5213,6 +5295,13 @@ var ae,
|
|
|
5213
5295
|
endpoint: 'stable',
|
|
5214
5296
|
component: 'cache_write',
|
|
5215
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
|
+
},
|
|
5216
5305
|
],
|
|
5217
5306
|
unfiltered: null,
|
|
5218
5307
|
priority: null,
|
|
@@ -5599,15 +5688,166 @@ var ae,
|
|
|
5599
5688
|
draft: null,
|
|
5600
5689
|
from: { variant: 'char' },
|
|
5601
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
|
+
},
|
|
5602
5842
|
],
|
|
5603
5843
|
};
|
|
5604
5844
|
});
|
|
5605
|
-
var
|
|
5606
|
-
|
|
5607
|
-
|
|
5845
|
+
var ot,
|
|
5846
|
+
ne,
|
|
5847
|
+
Pe = y(() => {
|
|
5608
5848
|
'use strict';
|
|
5609
|
-
((
|
|
5610
|
-
(
|
|
5849
|
+
((ot = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
|
|
5850
|
+
(ne = [
|
|
5611
5851
|
{
|
|
5612
5852
|
slug: 'tein-video-upscaler',
|
|
5613
5853
|
name: 'Tein Video Upscaler',
|
|
@@ -5645,10 +5885,10 @@ var st,
|
|
|
5645
5885
|
},
|
|
5646
5886
|
]));
|
|
5647
5887
|
});
|
|
5648
|
-
function
|
|
5888
|
+
function Ke(e, t) {
|
|
5649
5889
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5650
5890
|
}
|
|
5651
|
-
function
|
|
5891
|
+
function Ir(e, t) {
|
|
5652
5892
|
if (e === 'seedance-2-mini') return 'mini';
|
|
5653
5893
|
if (e !== 'seedance-2') return;
|
|
5654
5894
|
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -5658,86 +5898,86 @@ function wr(e, t) {
|
|
|
5658
5898
|
? 'fast'
|
|
5659
5899
|
: 'standard';
|
|
5660
5900
|
}
|
|
5661
|
-
function
|
|
5901
|
+
function Pr(e, t) {
|
|
5662
5902
|
let r = e
|
|
5663
5903
|
.trim()
|
|
5664
5904
|
.toLowerCase()
|
|
5665
5905
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5666
5906
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5667
|
-
let
|
|
5668
|
-
|
|
5669
|
-
return
|
|
5907
|
+
let n = Ir(r, t),
|
|
5908
|
+
s = Te.get(Ke('seedance-2', n));
|
|
5909
|
+
return s ? s.slug : null;
|
|
5670
5910
|
}
|
|
5671
|
-
let
|
|
5672
|
-
return
|
|
5911
|
+
let a = se.get(r) ?? Te.get(Ke(r));
|
|
5912
|
+
return a ? a.slug : null;
|
|
5673
5913
|
}
|
|
5674
|
-
function
|
|
5675
|
-
return
|
|
5914
|
+
function vr(e, t) {
|
|
5915
|
+
return se.has(e) && !(_r.has(e) && t) ? e : Pr(e, t);
|
|
5676
5916
|
}
|
|
5677
5917
|
function z(e, t) {
|
|
5678
|
-
let r =
|
|
5679
|
-
return r ? (
|
|
5918
|
+
let r = vr(e, t);
|
|
5919
|
+
return r ? (se.get(r) ?? null) : null;
|
|
5680
5920
|
}
|
|
5681
5921
|
function oe() {
|
|
5682
|
-
return
|
|
5922
|
+
return pt;
|
|
5683
5923
|
}
|
|
5684
|
-
var
|
|
5685
|
-
Te,
|
|
5686
|
-
ot,
|
|
5687
|
-
br,
|
|
5688
|
-
ne,
|
|
5924
|
+
var _e,
|
|
5689
5925
|
ve,
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5926
|
+
pt,
|
|
5927
|
+
wr,
|
|
5928
|
+
se,
|
|
5929
|
+
Te,
|
|
5930
|
+
lt,
|
|
5931
|
+
xr,
|
|
5932
|
+
Me,
|
|
5933
|
+
_r,
|
|
5694
5934
|
B = y(() => {
|
|
5695
5935
|
'use strict';
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
((
|
|
5700
|
-
...
|
|
5701
|
-
families:
|
|
5702
|
-
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)),
|
|
5703
5943
|
}),
|
|
5704
|
-
(
|
|
5705
|
-
(
|
|
5706
|
-
(
|
|
5707
|
-
(
|
|
5708
|
-
(
|
|
5709
|
-
(
|
|
5710
|
-
(
|
|
5711
|
-
(
|
|
5712
|
-
for (let e of
|
|
5713
|
-
(
|
|
5714
|
-
for (let t of e.variants)
|
|
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()),
|
|
5948
|
+
(Te = new Map()),
|
|
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 });
|
|
5715
5955
|
for (let t of e.editVariants ?? [])
|
|
5716
|
-
|
|
5717
|
-
for (let t of e.addons ?? [])
|
|
5718
|
-
|
|
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);
|
|
5719
5959
|
}
|
|
5720
|
-
for (let e of
|
|
5721
|
-
|
|
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']);
|
|
5722
5962
|
});
|
|
5723
5963
|
function le(e) {
|
|
5724
5964
|
let t = e.from?.variant;
|
|
5725
5965
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
5726
5966
|
}
|
|
5727
|
-
function
|
|
5967
|
+
function Se(e) {
|
|
5728
5968
|
if (e.endpoints?.length)
|
|
5729
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
5730
|
-
?
|
|
5969
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === dt)
|
|
5970
|
+
? dt
|
|
5731
5971
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
5732
5972
|
}
|
|
5733
|
-
var
|
|
5734
|
-
|
|
5973
|
+
var dt,
|
|
5974
|
+
qe = y(() => {
|
|
5735
5975
|
'use strict';
|
|
5736
5976
|
B();
|
|
5737
|
-
|
|
5977
|
+
dt = 'dynamic';
|
|
5738
5978
|
});
|
|
5739
5979
|
var pe,
|
|
5740
|
-
|
|
5980
|
+
$e = y(() => {
|
|
5741
5981
|
'use strict';
|
|
5742
5982
|
pe = {
|
|
5743
5983
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -5749,29 +5989,29 @@ var pe,
|
|
|
5749
5989
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
5750
5990
|
};
|
|
5751
5991
|
});
|
|
5752
|
-
var
|
|
5992
|
+
var ct = y(() => {
|
|
5753
5993
|
'use strict';
|
|
5754
5994
|
});
|
|
5755
|
-
function
|
|
5995
|
+
function ut(e, t) {
|
|
5756
5996
|
return typeof t == 'string' && (Tr[e]?.includes(t) ?? !1);
|
|
5757
5997
|
}
|
|
5758
5998
|
var Tr,
|
|
5759
|
-
|
|
5999
|
+
mt = y(() => {
|
|
5760
6000
|
'use strict';
|
|
5761
6001
|
B();
|
|
5762
|
-
|
|
5763
|
-
|
|
6002
|
+
qe();
|
|
6003
|
+
ct();
|
|
5764
6004
|
Tr = {};
|
|
5765
6005
|
});
|
|
5766
|
-
function
|
|
5767
|
-
return e === 'nano-banana-pro' ?
|
|
6006
|
+
function ft(e) {
|
|
6007
|
+
return e === 'nano-banana-pro' ? Mr : Kr;
|
|
5768
6008
|
}
|
|
5769
|
-
var
|
|
5770
|
-
|
|
5771
|
-
|
|
6009
|
+
var Mr,
|
|
6010
|
+
Kr,
|
|
6011
|
+
gt = y(() => {
|
|
5772
6012
|
'use strict';
|
|
5773
|
-
((
|
|
5774
|
-
(
|
|
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 = [
|
|
5775
6015
|
'auto',
|
|
5776
6016
|
'1:1',
|
|
5777
6017
|
'1:4',
|
|
@@ -5789,10 +6029,10 @@ var vr,
|
|
|
5789
6029
|
'21:9',
|
|
5790
6030
|
]));
|
|
5791
6031
|
});
|
|
5792
|
-
var
|
|
5793
|
-
|
|
6032
|
+
var ht,
|
|
6033
|
+
yt = y(() => {
|
|
5794
6034
|
'use strict';
|
|
5795
|
-
|
|
6035
|
+
ht = [
|
|
5796
6036
|
'prompt',
|
|
5797
6037
|
'system',
|
|
5798
6038
|
'messages',
|
|
@@ -5806,10 +6046,10 @@ var ft,
|
|
|
5806
6046
|
'endpoint',
|
|
5807
6047
|
];
|
|
5808
6048
|
});
|
|
5809
|
-
var
|
|
5810
|
-
|
|
6049
|
+
var bt,
|
|
6050
|
+
kt = y(() => {
|
|
5811
6051
|
'use strict';
|
|
5812
|
-
|
|
6052
|
+
bt = [
|
|
5813
6053
|
{
|
|
5814
6054
|
slug: 'claude-fable-5-1',
|
|
5815
6055
|
family: 'fable-5-1',
|
|
@@ -5878,13 +6118,13 @@ var ht,
|
|
|
5878
6118
|
},
|
|
5879
6119
|
];
|
|
5880
6120
|
});
|
|
5881
|
-
function
|
|
6121
|
+
function wt(e) {
|
|
5882
6122
|
return `$${e}`;
|
|
5883
6123
|
}
|
|
5884
|
-
function
|
|
5885
|
-
return z(e)?.variants.find((
|
|
6124
|
+
function Ce(e, t, r) {
|
|
6125
|
+
return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
5886
6126
|
}
|
|
5887
|
-
function
|
|
6127
|
+
function Sr(e) {
|
|
5888
6128
|
return [
|
|
5889
6129
|
{
|
|
5890
6130
|
name: 'prompt',
|
|
@@ -5950,39 +6190,39 @@ function Mr(e) {
|
|
|
5950
6190
|
},
|
|
5951
6191
|
];
|
|
5952
6192
|
}
|
|
5953
|
-
function
|
|
6193
|
+
function xt() {
|
|
5954
6194
|
return Object.fromEntries(
|
|
5955
|
-
|
|
5956
|
-
let t =
|
|
5957
|
-
r =
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
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 = {
|
|
5961
6201
|
slug: e.slug,
|
|
5962
6202
|
name: e.name,
|
|
5963
6203
|
category: 'Text',
|
|
5964
6204
|
kind: 'Reasoning (LLM)',
|
|
5965
6205
|
vendor: 'Anthropic',
|
|
5966
6206
|
description: e.description,
|
|
5967
|
-
priceFormatted:
|
|
6207
|
+
priceFormatted: n,
|
|
5968
6208
|
unit: '/M tokens',
|
|
5969
6209
|
primaryToolName: 'run_task',
|
|
5970
|
-
parameters:
|
|
6210
|
+
parameters: Sr(a),
|
|
5971
6211
|
};
|
|
5972
|
-
return [e.slug,
|
|
6212
|
+
return [e.slug, s];
|
|
5973
6213
|
}),
|
|
5974
6214
|
);
|
|
5975
6215
|
}
|
|
5976
|
-
var
|
|
6216
|
+
var It = y(() => {
|
|
5977
6217
|
'use strict';
|
|
5978
|
-
|
|
6218
|
+
kt();
|
|
5979
6219
|
B();
|
|
5980
6220
|
});
|
|
5981
|
-
var
|
|
6221
|
+
var H,
|
|
5982
6222
|
de,
|
|
5983
|
-
|
|
6223
|
+
Ee = y(() => {
|
|
5984
6224
|
'use strict';
|
|
5985
|
-
((
|
|
6225
|
+
((H = [
|
|
5986
6226
|
'seedance-2-5',
|
|
5987
6227
|
'seedance-2',
|
|
5988
6228
|
'seedance-2-mini',
|
|
@@ -5994,41 +6234,41 @@ var J,
|
|
|
5994
6234
|
(de =
|
|
5995
6235
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
5996
6236
|
});
|
|
5997
|
-
function
|
|
6237
|
+
function J(e) {
|
|
5998
6238
|
return `$${Number(e.toFixed(5))}`;
|
|
5999
6239
|
}
|
|
6000
|
-
function
|
|
6240
|
+
function Er(e) {
|
|
6001
6241
|
if (e.kind === 'llm') {
|
|
6002
6242
|
let t = e.defaultEndpoint,
|
|
6003
|
-
r = (
|
|
6243
|
+
r = (s) =>
|
|
6004
6244
|
e.variants.find(
|
|
6005
6245
|
(o) =>
|
|
6006
|
-
o.component ===
|
|
6246
|
+
o.component === s &&
|
|
6007
6247
|
(!t || !o.endpoint || o.endpoint === t) &&
|
|
6008
6248
|
(!o.context || o.context === '0\u201332K'),
|
|
6009
6249
|
),
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
return
|
|
6013
|
-
? `${
|
|
6014
|
-
: `from ${
|
|
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`
|
|
6254
|
+
: `from ${J(le(e).price.starter)}/M tokens`;
|
|
6015
6255
|
}
|
|
6016
|
-
return `from ${
|
|
6256
|
+
return `from ${J(le(e).price.starter)}${e.unit}`;
|
|
6017
6257
|
}
|
|
6018
|
-
function
|
|
6019
|
-
let r = t.filter((
|
|
6020
|
-
return r.length ? `from ${
|
|
6258
|
+
function Ar(e, t) {
|
|
6259
|
+
let r = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
6260
|
+
return r.length ? `from ${J(Math.min(...r))}${e}` : null;
|
|
6021
6261
|
}
|
|
6022
|
-
function
|
|
6262
|
+
function Mt(e) {
|
|
6023
6263
|
for (let t of G) {
|
|
6024
6264
|
let r = ue[t],
|
|
6025
|
-
|
|
6026
|
-
r &&
|
|
6265
|
+
a = r ? Ar(r.unit, e[t] ?? []) : null;
|
|
6266
|
+
r && a && (r.priceFormatted = a);
|
|
6027
6267
|
}
|
|
6028
6268
|
}
|
|
6029
6269
|
function O(e, t) {
|
|
6030
6270
|
let r = e.axes?.resolution ?? [
|
|
6031
|
-
...new Set(e.variants.map((
|
|
6271
|
+
...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
|
|
6032
6272
|
];
|
|
6033
6273
|
return {
|
|
6034
6274
|
name: 'resolution',
|
|
@@ -6038,13 +6278,13 @@ function O(e, t) {
|
|
|
6038
6278
|
...(t ? { description: t } : {}),
|
|
6039
6279
|
};
|
|
6040
6280
|
}
|
|
6041
|
-
function
|
|
6281
|
+
function Kt(e) {
|
|
6042
6282
|
if (!e.endpoints?.length) return null;
|
|
6043
|
-
let t = e.endpoints.filter((r) =>
|
|
6283
|
+
let t = e.endpoints.filter((r) => ut(e.slug, r.id));
|
|
6044
6284
|
return {
|
|
6045
6285
|
name: 'endpoint',
|
|
6046
6286
|
type: 'select',
|
|
6047
|
-
default:
|
|
6287
|
+
default: Se(e),
|
|
6048
6288
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6049
6289
|
description:
|
|
6050
6290
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6053,20 +6293,20 @@ function _t(e) {
|
|
|
6053
6293
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
6054
6294
|
};
|
|
6055
6295
|
}
|
|
6056
|
-
function
|
|
6057
|
-
if (e.unfiltered == null || t.some((
|
|
6058
|
-
let r =
|
|
6059
|
-
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];
|
|
6060
6300
|
}
|
|
6061
|
-
function
|
|
6062
|
-
let r = e.filter((
|
|
6063
|
-
|
|
6064
|
-
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]);
|
|
6065
6305
|
}
|
|
6066
|
-
function
|
|
6306
|
+
function Pt(e, t = {}) {
|
|
6067
6307
|
return [
|
|
6068
6308
|
...e
|
|
6069
|
-
.filter((r) => !
|
|
6309
|
+
.filter((r) => !Lr.has(r.name) && !Le.has(r.name))
|
|
6070
6310
|
.map((r) =>
|
|
6071
6311
|
r.name === 'prompt'
|
|
6072
6312
|
? { ...r, required: !0 }
|
|
@@ -6074,7 +6314,7 @@ function xt(e, t = {}) {
|
|
|
6074
6314
|
? {
|
|
6075
6315
|
...r,
|
|
6076
6316
|
...(t.no4k && r.options
|
|
6077
|
-
? { options: r.options.filter((
|
|
6317
|
+
? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
6078
6318
|
: {}),
|
|
6079
6319
|
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
|
|
6080
6320
|
}
|
|
@@ -6087,11 +6327,11 @@ function xt(e, t = {}) {
|
|
|
6087
6327
|
options: ['standard'],
|
|
6088
6328
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
6089
6329
|
},
|
|
6090
|
-
|
|
6091
|
-
|
|
6330
|
+
qt,
|
|
6331
|
+
$t,
|
|
6092
6332
|
];
|
|
6093
6333
|
}
|
|
6094
|
-
function
|
|
6334
|
+
function Oe(e, t) {
|
|
6095
6335
|
return [
|
|
6096
6336
|
M('Text prompt describing the video.'),
|
|
6097
6337
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -6120,8 +6360,8 @@ function Ae(e, t) {
|
|
|
6120
6360
|
),
|
|
6121
6361
|
];
|
|
6122
6362
|
}
|
|
6123
|
-
function
|
|
6124
|
-
let t =
|
|
6363
|
+
function Vr(e) {
|
|
6364
|
+
let t = Kt(e);
|
|
6125
6365
|
return [
|
|
6126
6366
|
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
6127
6367
|
...(t ? [t] : []),
|
|
@@ -6134,14 +6374,14 @@ function Dr(e) {
|
|
|
6134
6374
|
O(
|
|
6135
6375
|
e,
|
|
6136
6376
|
e.slug === 'gpt-image-2'
|
|
6137
|
-
? `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}`
|
|
6138
6378
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6139
6379
|
),
|
|
6140
6380
|
{
|
|
6141
6381
|
name: 'aspect_ratio',
|
|
6142
6382
|
type: 'select',
|
|
6143
6383
|
default: 'auto',
|
|
6144
|
-
options: [...
|
|
6384
|
+
options: [...rt],
|
|
6145
6385
|
description:
|
|
6146
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.",
|
|
6147
6387
|
},
|
|
@@ -6188,7 +6428,7 @@ function Dr(e) {
|
|
|
6188
6428
|
},
|
|
6189
6429
|
];
|
|
6190
6430
|
}
|
|
6191
|
-
function
|
|
6431
|
+
function Nr(e) {
|
|
6192
6432
|
return [
|
|
6193
6433
|
M('Image prompt text.'),
|
|
6194
6434
|
{
|
|
@@ -6196,7 +6436,7 @@ function Lr(e) {
|
|
|
6196
6436
|
type: 'string[]',
|
|
6197
6437
|
description: 'Images to edit or use as reference (up to 14).',
|
|
6198
6438
|
},
|
|
6199
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
6439
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...ft(e.slug)] },
|
|
6200
6440
|
O(e),
|
|
6201
6441
|
{
|
|
6202
6442
|
name: 'n',
|
|
@@ -6222,10 +6462,10 @@ function Lr(e) {
|
|
|
6222
6462
|
},
|
|
6223
6463
|
];
|
|
6224
6464
|
}
|
|
6225
|
-
function
|
|
6226
|
-
let e =
|
|
6465
|
+
function jr() {
|
|
6466
|
+
let e = ht,
|
|
6227
6467
|
t = [];
|
|
6228
|
-
for (let r of
|
|
6468
|
+
for (let r of Ve(!0))
|
|
6229
6469
|
e.includes(r.name) &&
|
|
6230
6470
|
(t.push({
|
|
6231
6471
|
...r,
|
|
@@ -6247,12 +6487,12 @@ function Br() {
|
|
|
6247
6487
|
}));
|
|
6248
6488
|
return t;
|
|
6249
6489
|
}
|
|
6250
|
-
function
|
|
6251
|
-
return
|
|
6490
|
+
function Gr() {
|
|
6491
|
+
return Ve(!0).map((e) =>
|
|
6252
6492
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6253
6493
|
);
|
|
6254
6494
|
}
|
|
6255
|
-
function
|
|
6495
|
+
function Ve(e) {
|
|
6256
6496
|
return [
|
|
6257
6497
|
M('The user message or task.'),
|
|
6258
6498
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -6347,21 +6587,29 @@ function De(e) {
|
|
|
6347
6587
|
},
|
|
6348
6588
|
];
|
|
6349
6589
|
}
|
|
6350
|
-
function
|
|
6351
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6352
|
-
let t =
|
|
6590
|
+
function zr(e) {
|
|
6591
|
+
if (e.slug === 'seed-2-1-turbo') return Br;
|
|
6592
|
+
let t = Kt(e);
|
|
6353
6593
|
return [
|
|
6354
6594
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
6355
|
-
?
|
|
6595
|
+
? jr()
|
|
6356
6596
|
: e.slug === 'gemini-3.7-flash'
|
|
6357
|
-
?
|
|
6358
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6359
|
-
?
|
|
6360
|
-
:
|
|
6597
|
+
? Gr()
|
|
6598
|
+
: e.slug === 'gpt-6-astra' || Fr.includes(e.slug)
|
|
6599
|
+
? Ve(e.slug !== 'gpt-6-astra')
|
|
6600
|
+
: Ur),
|
|
6361
6601
|
...(t ? [t] : []),
|
|
6362
6602
|
];
|
|
6363
6603
|
}
|
|
6364
|
-
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) {
|
|
6365
6613
|
return [
|
|
6366
6614
|
{
|
|
6367
6615
|
name: 'video_url',
|
|
@@ -6383,26 +6631,26 @@ function Gr(e) {
|
|
|
6383
6631
|
},
|
|
6384
6632
|
];
|
|
6385
6633
|
}
|
|
6386
|
-
function
|
|
6634
|
+
function Wr(e) {
|
|
6387
6635
|
let t = e.slug;
|
|
6388
|
-
if (
|
|
6389
|
-
if (e.kind === 'llm') return
|
|
6390
|
-
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);
|
|
6391
6639
|
switch (t) {
|
|
6392
6640
|
case 'seedance-2-5':
|
|
6393
|
-
return
|
|
6641
|
+
return Ae(_t, t);
|
|
6394
6642
|
case 'seedance-2-5-lite':
|
|
6395
|
-
return
|
|
6643
|
+
return Pt(_t, { no4k: !0 });
|
|
6396
6644
|
case 'seedance-2':
|
|
6397
|
-
return
|
|
6645
|
+
return Ae(vt, t);
|
|
6398
6646
|
case 'seedance-2-lite':
|
|
6399
|
-
return
|
|
6647
|
+
return Pt(vt);
|
|
6400
6648
|
case 'seedance-2-mini':
|
|
6401
|
-
return
|
|
6649
|
+
return Ae(Yr, t);
|
|
6402
6650
|
case 'nano-banana-2':
|
|
6403
6651
|
case 'nano-banana-2.1':
|
|
6404
6652
|
case 'nano-banana-pro':
|
|
6405
|
-
return
|
|
6653
|
+
return Nr(e);
|
|
6406
6654
|
case 'seedream-5-pro':
|
|
6407
6655
|
return [
|
|
6408
6656
|
M('Detailed description of the image to generate.'),
|
|
@@ -6551,9 +6799,117 @@ function zr(e) {
|
|
|
6551
6799
|
},
|
|
6552
6800
|
{ name: 'watermark', type: 'json', description: 'aigc_watermark and aigc_metadata.' },
|
|
6553
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
|
+
];
|
|
6554
6910
|
case 'wan-3-0':
|
|
6555
6911
|
case 'wan-3-0-prime':
|
|
6556
|
-
return
|
|
6912
|
+
return Oe(e, {
|
|
6557
6913
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6558
6914
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
6559
6915
|
minSec: 2,
|
|
@@ -6563,7 +6919,7 @@ function zr(e) {
|
|
|
6563
6919
|
});
|
|
6564
6920
|
case 'happy-horse-1-1':
|
|
6565
6921
|
case 'happy-horse-1-0':
|
|
6566
|
-
return
|
|
6922
|
+
return Oe(e, {
|
|
6567
6923
|
modes:
|
|
6568
6924
|
t === 'happy-horse-1-0'
|
|
6569
6925
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -6574,7 +6930,7 @@ function zr(e) {
|
|
|
6574
6930
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
6575
6931
|
});
|
|
6576
6932
|
case 'minimax-h3':
|
|
6577
|
-
return
|
|
6933
|
+
return Oe(e, {
|
|
6578
6934
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6579
6935
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
6580
6936
|
minSec: 4,
|
|
@@ -6585,48 +6941,52 @@ function zr(e) {
|
|
|
6585
6941
|
return [M('Prompt text.')];
|
|
6586
6942
|
}
|
|
6587
6943
|
}
|
|
6588
|
-
function
|
|
6944
|
+
function De(e, t = e.api.model) {
|
|
6589
6945
|
return {
|
|
6590
6946
|
slug: t,
|
|
6591
6947
|
name: e.name,
|
|
6592
|
-
category:
|
|
6593
|
-
kind:
|
|
6948
|
+
category: qr[e.kind],
|
|
6949
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Cr[e.kind],
|
|
6594
6950
|
vendor: e.vendor ?? '',
|
|
6595
6951
|
description: e.desc ?? e.name,
|
|
6596
|
-
priceFormatted:
|
|
6952
|
+
priceFormatted: Er(e),
|
|
6597
6953
|
unit: e.unit,
|
|
6598
|
-
primaryToolName:
|
|
6599
|
-
parameters:
|
|
6954
|
+
primaryToolName: $r[e.kind],
|
|
6955
|
+
parameters: Dr(e, Wr(e)),
|
|
6600
6956
|
};
|
|
6601
6957
|
}
|
|
6602
|
-
function
|
|
6958
|
+
function Qr() {
|
|
6603
6959
|
let e = {};
|
|
6604
6960
|
for (let t of oe())
|
|
6605
6961
|
if (t.slug !== 'seedance-2-fast') {
|
|
6606
6962
|
if (t.slug === 'seedance-2-mini') {
|
|
6607
|
-
e['seedance-2-mini'] =
|
|
6963
|
+
e['seedance-2-mini'] = De(t, 'seedance-2-mini');
|
|
6608
6964
|
continue;
|
|
6609
6965
|
}
|
|
6610
6966
|
if (t.slug === 'seedance-2') {
|
|
6611
|
-
let r =
|
|
6967
|
+
let r = De(t);
|
|
6612
6968
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
6613
6969
|
(e['seedance-2'] = r));
|
|
6614
6970
|
continue;
|
|
6615
6971
|
}
|
|
6616
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
6972
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = De(t));
|
|
6617
6973
|
}
|
|
6618
|
-
Object.assign(e,
|
|
6974
|
+
Object.assign(e, xt());
|
|
6619
6975
|
for (let [t, r] of Object.entries(pe))
|
|
6620
6976
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
6621
6977
|
return e;
|
|
6622
6978
|
}
|
|
6623
|
-
function
|
|
6979
|
+
function me(e) {
|
|
6980
|
+
return !!e?.parameters.some((t) => t.name === 'image');
|
|
6981
|
+
}
|
|
6982
|
+
function F(e) {
|
|
6624
6983
|
return ue[e] ?? null;
|
|
6625
6984
|
}
|
|
6626
|
-
function
|
|
6985
|
+
function Xr(e, t, r) {
|
|
6986
|
+
if (e.startsWith('enhancor-skin-fix-')) return !1;
|
|
6627
6987
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
6628
|
-
let
|
|
6629
|
-
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;
|
|
6630
6990
|
}
|
|
6631
6991
|
return !(
|
|
6632
6992
|
(t === 'max_tokens' && Tt(r.max_completion_tokens)) ||
|
|
@@ -6636,105 +6996,106 @@ function Wr(e, t, r) {
|
|
|
6636
6996
|
function Tt(e) {
|
|
6637
6997
|
return e != null && e !== '';
|
|
6638
6998
|
}
|
|
6639
|
-
function
|
|
6999
|
+
function At(e, t) {
|
|
6640
7000
|
let r = { ...t };
|
|
6641
7001
|
if (e?.slug === 'seedance-2-5') {
|
|
6642
|
-
let
|
|
6643
|
-
for (let
|
|
6644
|
-
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;
|
|
6645
7005
|
}
|
|
6646
|
-
for (let
|
|
6647
|
-
|
|
6648
|
-
r[
|
|
6649
|
-
|
|
6650
|
-
(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);
|
|
6651
7011
|
return r;
|
|
6652
7012
|
}
|
|
6653
7013
|
function R() {
|
|
6654
7014
|
return Object.values(ue);
|
|
6655
7015
|
}
|
|
6656
|
-
var
|
|
6657
|
-
|
|
6658
|
-
|
|
7016
|
+
var qr,
|
|
7017
|
+
$r,
|
|
7018
|
+
Cr,
|
|
6659
7019
|
M,
|
|
6660
|
-
Mt,
|
|
6661
|
-
Er,
|
|
6662
|
-
Ar,
|
|
6663
|
-
Kt,
|
|
6664
7020
|
St,
|
|
6665
|
-
|
|
7021
|
+
Or,
|
|
6666
7022
|
Rr,
|
|
6667
|
-
Vr,
|
|
6668
|
-
Nr,
|
|
6669
|
-
Ur,
|
|
6670
|
-
ce,
|
|
6671
|
-
It,
|
|
6672
7023
|
qt,
|
|
6673
7024
|
$t,
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
7025
|
+
Le,
|
|
7026
|
+
Lr,
|
|
7027
|
+
Ur,
|
|
7028
|
+
Br,
|
|
7029
|
+
Fr,
|
|
7030
|
+
Hr,
|
|
7031
|
+
ce,
|
|
7032
|
+
_t,
|
|
7033
|
+
Ct,
|
|
7034
|
+
Et,
|
|
7035
|
+
vt,
|
|
6677
7036
|
Yr,
|
|
7037
|
+
ue,
|
|
7038
|
+
Zr,
|
|
6678
7039
|
W = y(() => {
|
|
6679
7040
|
'use strict';
|
|
6680
|
-
|
|
6681
|
-
xe();
|
|
6682
|
-
B();
|
|
6683
|
-
Se();
|
|
7041
|
+
it();
|
|
6684
7042
|
Ie();
|
|
7043
|
+
B();
|
|
6685
7044
|
qe();
|
|
6686
|
-
|
|
7045
|
+
Pe();
|
|
7046
|
+
$e();
|
|
6687
7047
|
mt();
|
|
6688
7048
|
gt();
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
(
|
|
6692
|
-
|
|
7049
|
+
yt();
|
|
7050
|
+
It();
|
|
7051
|
+
Ee();
|
|
7052
|
+
((qr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
7053
|
+
($r = {
|
|
6693
7054
|
video: 'generate_video',
|
|
6694
7055
|
image: 'generate_image',
|
|
6695
7056
|
audio: 'generate_audio',
|
|
6696
7057
|
llm: 'run_task',
|
|
6697
7058
|
}),
|
|
6698
|
-
(
|
|
7059
|
+
(Cr = {
|
|
6699
7060
|
video: 'Text-to-Video',
|
|
6700
7061
|
image: 'Text-to-Image',
|
|
6701
7062
|
audio: 'Text-to-Audio',
|
|
6702
7063
|
llm: 'Reasoning (LLM)',
|
|
6703
7064
|
}));
|
|
6704
7065
|
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
6705
|
-
((
|
|
7066
|
+
((St = {
|
|
6706
7067
|
name: 'creative_mode',
|
|
6707
7068
|
type: 'boolean',
|
|
6708
7069
|
default: !1,
|
|
6709
7070
|
description:
|
|
6710
7071
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
6711
7072
|
}),
|
|
6712
|
-
(
|
|
7073
|
+
(Or = {
|
|
6713
7074
|
name: 'creative_mode',
|
|
6714
7075
|
type: 'boolean',
|
|
6715
7076
|
default: !1,
|
|
6716
7077
|
description: `Not available yet on this model: ${de}.`,
|
|
6717
7078
|
}),
|
|
6718
|
-
(
|
|
7079
|
+
(Rr = {
|
|
6719
7080
|
name: 'priority',
|
|
6720
7081
|
type: 'boolean',
|
|
6721
7082
|
default: !1,
|
|
6722
7083
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
6723
7084
|
}),
|
|
6724
|
-
(
|
|
7085
|
+
(qt = {
|
|
6725
7086
|
name: 'reference_roles',
|
|
6726
7087
|
type: 'json',
|
|
6727
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).`,
|
|
6728
7089
|
}),
|
|
6729
|
-
(
|
|
7090
|
+
($t = {
|
|
6730
7091
|
name: 'auto_fit_images',
|
|
6731
7092
|
type: 'boolean',
|
|
6732
7093
|
default: !1,
|
|
6733
7094
|
description:
|
|
6734
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.',
|
|
6735
7096
|
}),
|
|
6736
|
-
(
|
|
6737
|
-
|
|
7097
|
+
(Le = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
7098
|
+
Lr = new Set([
|
|
6738
7099
|
'quality',
|
|
6739
7100
|
'bitrate_mode',
|
|
6740
7101
|
'draft',
|
|
@@ -6743,7 +7104,7 @@ var Kr,
|
|
|
6743
7104
|
'draft_generation_id',
|
|
6744
7105
|
'pass_faces',
|
|
6745
7106
|
]);
|
|
6746
|
-
((
|
|
7107
|
+
((Ur = [
|
|
6747
7108
|
M('The user message or task.'),
|
|
6748
7109
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
6749
7110
|
{
|
|
@@ -6761,7 +7122,7 @@ var Kr,
|
|
|
6761
7122
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
6762
7123
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
6763
7124
|
]),
|
|
6764
|
-
(
|
|
7125
|
+
(Br = [
|
|
6765
7126
|
M('The user message or task.'),
|
|
6766
7127
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
6767
7128
|
{
|
|
@@ -6843,9 +7204,35 @@ var Kr,
|
|
|
6843
7204
|
description: 'Video frames read a second.',
|
|
6844
7205
|
},
|
|
6845
7206
|
]),
|
|
6846
|
-
(
|
|
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
|
+
}));
|
|
6847
7234
|
((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
6848
|
-
(
|
|
7235
|
+
(_t = [
|
|
6849
7236
|
{
|
|
6850
7237
|
name: 'prompt',
|
|
6851
7238
|
type: 'string',
|
|
@@ -6994,19 +7381,19 @@ var Kr,
|
|
|
6994
7381
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6995
7382
|
},
|
|
6996
7383
|
]),
|
|
6997
|
-
(
|
|
7384
|
+
(Ct = {
|
|
6998
7385
|
name: 'images',
|
|
6999
7386
|
type: 'string[]',
|
|
7000
7387
|
description:
|
|
7001
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.',
|
|
7002
7389
|
}),
|
|
7003
|
-
(
|
|
7390
|
+
(Et = {
|
|
7004
7391
|
name: 'audios',
|
|
7005
7392
|
type: 'string[]',
|
|
7006
7393
|
description:
|
|
7007
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.',
|
|
7008
7395
|
}),
|
|
7009
|
-
(
|
|
7396
|
+
(vt = [
|
|
7010
7397
|
{
|
|
7011
7398
|
name: 'prompt',
|
|
7012
7399
|
type: 'string',
|
|
@@ -7084,8 +7471,8 @@ var Kr,
|
|
|
7084
7471
|
description:
|
|
7085
7472
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7086
7473
|
},
|
|
7087
|
-
|
|
7088
|
-
|
|
7474
|
+
Ct,
|
|
7475
|
+
Et,
|
|
7089
7476
|
{
|
|
7090
7477
|
name: 'first_frame_image',
|
|
7091
7478
|
type: 'string',
|
|
@@ -7106,7 +7493,7 @@ var Kr,
|
|
|
7106
7493
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7107
7494
|
},
|
|
7108
7495
|
]),
|
|
7109
|
-
(
|
|
7496
|
+
(Yr = [
|
|
7110
7497
|
{
|
|
7111
7498
|
name: 'prompt',
|
|
7112
7499
|
type: 'string',
|
|
@@ -7161,8 +7548,8 @@ var Kr,
|
|
|
7161
7548
|
description:
|
|
7162
7549
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7163
7550
|
},
|
|
7164
|
-
|
|
7165
|
-
|
|
7551
|
+
Ct,
|
|
7552
|
+
Et,
|
|
7166
7553
|
{
|
|
7167
7554
|
name: 'first_frame_image',
|
|
7168
7555
|
type: 'string',
|
|
@@ -7177,53 +7564,53 @@ var Kr,
|
|
|
7177
7564
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7178
7565
|
},
|
|
7179
7566
|
]));
|
|
7180
|
-
ue =
|
|
7181
|
-
|
|
7567
|
+
ue = Qr();
|
|
7568
|
+
Zr = ['draft_task_id', 'draft_generation_id'];
|
|
7182
7569
|
});
|
|
7183
|
-
function
|
|
7570
|
+
function fe(e) {
|
|
7184
7571
|
let t = '/v1/pricing/models',
|
|
7185
7572
|
r = e?.trim();
|
|
7186
7573
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7187
7574
|
}
|
|
7188
|
-
var
|
|
7575
|
+
var Ue = y(() => {
|
|
7189
7576
|
'use strict';
|
|
7190
7577
|
});
|
|
7191
|
-
function
|
|
7578
|
+
function Gt(e) {
|
|
7192
7579
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
7193
7580
|
}
|
|
7194
|
-
function
|
|
7195
|
-
let t = oe().filter((
|
|
7196
|
-
r = t.filter((
|
|
7197
|
-
|
|
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);
|
|
7198
7585
|
return [
|
|
7199
7586
|
...(r.length
|
|
7200
|
-
? [`${
|
|
7587
|
+
? [`${Gt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7201
7588
|
: []),
|
|
7202
|
-
...(
|
|
7589
|
+
...(a.length ? [`Not available yet on ${Gt(a)}: ${de}.`] : []),
|
|
7203
7590
|
'The Acceptable Use Policy applies.',
|
|
7204
7591
|
].join(' ');
|
|
7205
7592
|
}
|
|
7206
|
-
function
|
|
7207
|
-
if (
|
|
7593
|
+
function Pa(e) {
|
|
7594
|
+
if (xa.has(e.name)) return e;
|
|
7208
7595
|
let t = e.inputSchema.properties;
|
|
7209
7596
|
return !t || t.callback_url
|
|
7210
7597
|
? e
|
|
7211
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7598
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: wa } } };
|
|
7212
7599
|
}
|
|
7213
|
-
function
|
|
7600
|
+
function _a(e) {
|
|
7214
7601
|
let t = e.inputSchema.properties;
|
|
7215
7602
|
if (!t) return e;
|
|
7216
7603
|
let r = !1,
|
|
7217
|
-
|
|
7218
|
-
for (let [
|
|
7219
|
-
|
|
7220
|
-
? ((
|
|
7221
|
-
:
|
|
7222
|
-
? ((
|
|
7223
|
-
: (
|
|
7224
|
-
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;
|
|
7225
7612
|
}
|
|
7226
|
-
function
|
|
7613
|
+
function va(e) {
|
|
7227
7614
|
switch (e.type) {
|
|
7228
7615
|
case 'string':
|
|
7229
7616
|
return {
|
|
@@ -7278,29 +7665,29 @@ function Ii(e) {
|
|
|
7278
7665
|
return { type: 'string', description: e.description };
|
|
7279
7666
|
}
|
|
7280
7667
|
}
|
|
7281
|
-
function
|
|
7668
|
+
function Ta(e, t) {
|
|
7282
7669
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
for (let o of e.parameters) ((
|
|
7286
|
-
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 = {
|
|
7287
7674
|
type: 'object',
|
|
7288
|
-
properties:
|
|
7289
|
-
...(
|
|
7675
|
+
properties: a,
|
|
7676
|
+
...(n.length > 0 ? { required: n } : {}),
|
|
7290
7677
|
additionalProperties: !0,
|
|
7291
7678
|
};
|
|
7292
7679
|
return {
|
|
7293
7680
|
name: r,
|
|
7294
7681
|
description: `[Tein AI - ${e.name} (${e.category})] ${e.description} (Pricing: ${e.priceFormatted})`,
|
|
7295
|
-
inputSchema:
|
|
7682
|
+
inputSchema: s,
|
|
7296
7683
|
};
|
|
7297
7684
|
}
|
|
7298
|
-
function
|
|
7299
|
-
let e = R().filter((d) => d.category === 'Image'),
|
|
7685
|
+
function Ma() {
|
|
7686
|
+
let e = R().filter((d) => d.category === 'Image' && !me(d)),
|
|
7300
7687
|
t = R().filter((d) => d.category === 'Video'),
|
|
7301
7688
|
r = R().filter((d) => d.category === 'Text'),
|
|
7302
|
-
|
|
7303
|
-
|
|
7689
|
+
a = R().filter((d) => d.category === 'Audio'),
|
|
7690
|
+
n = {
|
|
7304
7691
|
name: 'generate_image',
|
|
7305
7692
|
description:
|
|
7306
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.',
|
|
@@ -7391,13 +7778,13 @@ function Ti() {
|
|
|
7391
7778
|
maximum: 2147483647,
|
|
7392
7779
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
7393
7780
|
},
|
|
7394
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7781
|
+
creative_mode: { type: 'boolean', default: !1, description: zt('image') },
|
|
7395
7782
|
},
|
|
7396
7783
|
required: ['prompt'],
|
|
7397
7784
|
additionalProperties: !0,
|
|
7398
7785
|
},
|
|
7399
7786
|
},
|
|
7400
|
-
|
|
7787
|
+
s = {
|
|
7401
7788
|
name: 'generate_video',
|
|
7402
7789
|
description:
|
|
7403
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.',
|
|
@@ -7428,7 +7815,7 @@ function Ti() {
|
|
|
7428
7815
|
default: '480p',
|
|
7429
7816
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
7430
7817
|
},
|
|
7431
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7818
|
+
creative_mode: { type: 'boolean', default: !1, description: zt('video') },
|
|
7432
7819
|
priority: {
|
|
7433
7820
|
type: 'boolean',
|
|
7434
7821
|
default: !1,
|
|
@@ -7566,10 +7953,10 @@ function Ti() {
|
|
|
7566
7953
|
additionalProperties: !0,
|
|
7567
7954
|
},
|
|
7568
7955
|
},
|
|
7569
|
-
p =
|
|
7570
|
-
return [
|
|
7956
|
+
p = Ka();
|
|
7957
|
+
return [n, s, o, u, l, p, c, Ia];
|
|
7571
7958
|
}
|
|
7572
|
-
function
|
|
7959
|
+
function Ka() {
|
|
7573
7960
|
return {
|
|
7574
7961
|
name: 'upload_asset',
|
|
7575
7962
|
description:
|
|
@@ -7616,26 +8003,26 @@ function vi() {
|
|
|
7616
8003
|
},
|
|
7617
8004
|
};
|
|
7618
8005
|
}
|
|
7619
|
-
function
|
|
7620
|
-
let e =
|
|
7621
|
-
t = R().map((r) =>
|
|
7622
|
-
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);
|
|
7623
8010
|
}
|
|
7624
|
-
var
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
8011
|
+
var wa,
|
|
8012
|
+
xa,
|
|
8013
|
+
Ia,
|
|
8014
|
+
Ht,
|
|
8015
|
+
Jt = y(() => {
|
|
7629
8016
|
'use strict';
|
|
7630
8017
|
B();
|
|
7631
|
-
|
|
8018
|
+
Ee();
|
|
7632
8019
|
W();
|
|
7633
|
-
((
|
|
8020
|
+
((wa = {
|
|
7634
8021
|
type: 'string',
|
|
7635
8022
|
description:
|
|
7636
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.',
|
|
7637
8024
|
}),
|
|
7638
|
-
(
|
|
8025
|
+
(xa = new Set([
|
|
7639
8026
|
'upload_asset',
|
|
7640
8027
|
'upload_media',
|
|
7641
8028
|
'upload_image',
|
|
@@ -7643,7 +8030,7 @@ var yi,
|
|
|
7643
8030
|
'check_status',
|
|
7644
8031
|
'get_pricing',
|
|
7645
8032
|
])),
|
|
7646
|
-
(
|
|
8033
|
+
(Ia = {
|
|
7647
8034
|
name: 'get_pricing',
|
|
7648
8035
|
description:
|
|
7649
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.',
|
|
@@ -7658,7 +8045,7 @@ var yi,
|
|
|
7658
8045
|
additionalProperties: !1,
|
|
7659
8046
|
},
|
|
7660
8047
|
}));
|
|
7661
|
-
|
|
8048
|
+
Ht = new Set([
|
|
7662
8049
|
'image',
|
|
7663
8050
|
'images',
|
|
7664
8051
|
'image_url',
|
|
@@ -7675,31 +8062,31 @@ var yi,
|
|
|
7675
8062
|
'lipsyncing_audio',
|
|
7676
8063
|
]);
|
|
7677
8064
|
});
|
|
7678
|
-
var
|
|
7679
|
-
|
|
7680
|
-
forgetToolSchemas: () =>
|
|
7681
|
-
jsonRpcAnswer: () =>
|
|
7682
|
-
preprocessLocalFiles: () =>
|
|
7683
|
-
startStdioServer: () =>
|
|
8065
|
+
var ir = {};
|
|
8066
|
+
ur(ir, {
|
|
8067
|
+
forgetToolSchemas: () => Ea,
|
|
8068
|
+
jsonRpcAnswer: () => Xt,
|
|
8069
|
+
preprocessLocalFiles: () => rr,
|
|
8070
|
+
startStdioServer: () => ar,
|
|
7684
8071
|
});
|
|
7685
|
-
function
|
|
8072
|
+
function Sa(e) {
|
|
7686
8073
|
let t = (r) =>
|
|
7687
8074
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
7688
8075
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
7689
8076
|
}
|
|
7690
|
-
function
|
|
7691
|
-
let
|
|
7692
|
-
|
|
7693
|
-
|
|
8077
|
+
function Xt(e, t, r) {
|
|
8078
|
+
let a = e?.id,
|
|
8079
|
+
n = a == null,
|
|
8080
|
+
s = null;
|
|
7694
8081
|
try {
|
|
7695
|
-
|
|
8082
|
+
s = r ? JSON.parse(r) : null;
|
|
7696
8083
|
} catch {
|
|
7697
|
-
|
|
8084
|
+
s = null;
|
|
7698
8085
|
}
|
|
7699
|
-
if (
|
|
7700
|
-
if (
|
|
8086
|
+
if (s !== null && Sa(s)) return n ? null : s;
|
|
8087
|
+
if (n) return null;
|
|
7701
8088
|
if (!r && t >= 200 && t < 300) return;
|
|
7702
|
-
let o =
|
|
8089
|
+
let o = s?.error,
|
|
7703
8090
|
u =
|
|
7704
8091
|
typeof o == 'string'
|
|
7705
8092
|
? o
|
|
@@ -7709,7 +8096,7 @@ function Yt(e, t, r) {
|
|
|
7709
8096
|
l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
|
|
7710
8097
|
return {
|
|
7711
8098
|
jsonrpc: '2.0',
|
|
7712
|
-
id:
|
|
8099
|
+
id: a,
|
|
7713
8100
|
error: {
|
|
7714
8101
|
code: t === 401 ? -32001 : -32603,
|
|
7715
8102
|
message: u,
|
|
@@ -7717,23 +8104,23 @@ function Yt(e, t, r) {
|
|
|
7717
8104
|
},
|
|
7718
8105
|
};
|
|
7719
8106
|
}
|
|
7720
|
-
function
|
|
8107
|
+
function qa() {
|
|
7721
8108
|
let e = process.argv.slice(2),
|
|
7722
8109
|
t = e.indexOf('--api-key');
|
|
7723
8110
|
return q(t >= 0 ? e[t + 1] : void 0);
|
|
7724
8111
|
}
|
|
7725
|
-
async function
|
|
7726
|
-
let
|
|
7727
|
-
if (!D.default.existsSync(
|
|
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())
|
|
7728
8115
|
throw new Error(`File not found: ${e}`);
|
|
7729
|
-
let
|
|
7730
|
-
|
|
7731
|
-
o =
|
|
8116
|
+
let n = D.default.readFileSync(a),
|
|
8117
|
+
s = n.toString('base64'),
|
|
8118
|
+
o = n.length,
|
|
7732
8119
|
u = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
7733
8120
|
l = await fetch(u, {
|
|
7734
8121
|
method: 'POST',
|
|
7735
8122
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
7736
|
-
body: JSON.stringify({ data:
|
|
8123
|
+
body: JSON.stringify({ data: s }),
|
|
7737
8124
|
});
|
|
7738
8125
|
if (!l.ok) {
|
|
7739
8126
|
let p = `Upload failed (HTTP ${l.status})`;
|
|
@@ -7751,15 +8138,15 @@ async function Qt(e, t, r) {
|
|
|
7751
8138
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
7752
8139
|
};
|
|
7753
8140
|
}
|
|
7754
|
-
function
|
|
7755
|
-
return
|
|
8141
|
+
function er(e) {
|
|
8142
|
+
return $a.has(j.default.extname(e).toLowerCase());
|
|
7756
8143
|
}
|
|
7757
|
-
function
|
|
8144
|
+
function tr(e) {
|
|
7758
8145
|
return new Error(
|
|
7759
|
-
`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.`,
|
|
7760
8147
|
);
|
|
7761
8148
|
}
|
|
7762
|
-
function
|
|
8149
|
+
function Ca(e) {
|
|
7763
8150
|
let t = e.trim();
|
|
7764
8151
|
if (
|
|
7765
8152
|
!t ||
|
|
@@ -7769,10 +8156,10 @@ function Si(e) {
|
|
|
7769
8156
|
`)
|
|
7770
8157
|
)
|
|
7771
8158
|
return null;
|
|
7772
|
-
let r =
|
|
8159
|
+
let r = j.default.resolve(t);
|
|
7773
8160
|
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
7774
8161
|
}
|
|
7775
|
-
function
|
|
8162
|
+
function We(e) {
|
|
7776
8163
|
if (Array.isArray(e))
|
|
7777
8164
|
for (let t of e) {
|
|
7778
8165
|
let r = t;
|
|
@@ -7782,14 +8169,14 @@ function Je(e) {
|
|
|
7782
8169
|
X.set(r.name, r.inputSchema);
|
|
7783
8170
|
}
|
|
7784
8171
|
}
|
|
7785
|
-
function
|
|
7786
|
-
(X.clear(), (
|
|
8172
|
+
function Ea() {
|
|
8173
|
+
(X.clear(), (Je = 0));
|
|
7787
8174
|
}
|
|
7788
|
-
async function
|
|
7789
|
-
if (!(Date.now() -
|
|
7790
|
-
|
|
8175
|
+
async function Aa(e, t) {
|
|
8176
|
+
if (!(Date.now() - Je < 6e4)) {
|
|
8177
|
+
Je = Date.now();
|
|
7791
8178
|
try {
|
|
7792
|
-
let
|
|
8179
|
+
let a = await (
|
|
7793
8180
|
await fetch(e, {
|
|
7794
8181
|
method: 'POST',
|
|
7795
8182
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
@@ -7797,39 +8184,39 @@ async function $i(e, t) {
|
|
|
7797
8184
|
signal: AbortSignal.timeout(1e4),
|
|
7798
8185
|
})
|
|
7799
8186
|
).json();
|
|
7800
|
-
|
|
8187
|
+
We(a.result?.tools);
|
|
7801
8188
|
} catch {}
|
|
7802
8189
|
}
|
|
7803
8190
|
}
|
|
7804
|
-
function
|
|
8191
|
+
function Oa(e) {
|
|
7805
8192
|
return e
|
|
7806
8193
|
? e.type === 'string'
|
|
7807
8194
|
? e.format === 'uri'
|
|
7808
8195
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
7809
8196
|
: !1;
|
|
7810
8197
|
}
|
|
7811
|
-
async function
|
|
8198
|
+
async function Wt(e, t, r) {
|
|
7812
8199
|
if (typeof e != 'string') return e;
|
|
7813
|
-
let
|
|
7814
|
-
if (!
|
|
7815
|
-
if (!
|
|
7816
|
-
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;
|
|
7817
8204
|
}
|
|
7818
|
-
async function
|
|
7819
|
-
(X.size === 0 &&
|
|
7820
|
-
let
|
|
7821
|
-
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;
|
|
7822
8209
|
let o = { ...t };
|
|
7823
8210
|
for (let [u, l] of Object.entries(t))
|
|
7824
|
-
if (
|
|
8211
|
+
if (Oa(s[u]))
|
|
7825
8212
|
if (Array.isArray(l)) {
|
|
7826
8213
|
let c = [];
|
|
7827
|
-
for (let p of l) c.push(await
|
|
8214
|
+
for (let p of l) c.push(await Wt(p, r, a));
|
|
7828
8215
|
o[u] = c;
|
|
7829
|
-
} else o[u] = await
|
|
8216
|
+
} else o[u] = await Wt(l, r, a);
|
|
7830
8217
|
return o;
|
|
7831
8218
|
}
|
|
7832
|
-
function
|
|
8219
|
+
function Ra(e) {
|
|
7833
8220
|
let t = e.id ?? null;
|
|
7834
8221
|
switch (e.method) {
|
|
7835
8222
|
case 'initialize':
|
|
@@ -7847,7 +8234,7 @@ function Ei(e) {
|
|
|
7847
8234
|
case 'ping':
|
|
7848
8235
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
7849
8236
|
case 'tools/list':
|
|
7850
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
8237
|
+
return { jsonrpc: '2.0', id: t, result: { tools: He() } };
|
|
7851
8238
|
case 'tools/call':
|
|
7852
8239
|
return {
|
|
7853
8240
|
jsonrpc: '2.0',
|
|
@@ -7870,25 +8257,25 @@ function Ei(e) {
|
|
|
7870
8257
|
};
|
|
7871
8258
|
}
|
|
7872
8259
|
}
|
|
7873
|
-
async function
|
|
7874
|
-
if (
|
|
7875
|
-
|
|
7876
|
-
let e =
|
|
8260
|
+
async function ar() {
|
|
8261
|
+
if (Yt) return;
|
|
8262
|
+
Yt = !0;
|
|
8263
|
+
let e = qa(),
|
|
7877
8264
|
t = P(),
|
|
7878
8265
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
7879
|
-
(
|
|
8266
|
+
(Qt.default
|
|
7880
8267
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
7881
|
-
.on('line', async (
|
|
7882
|
-
let
|
|
7883
|
-
if (
|
|
8268
|
+
.on('line', async (n) => {
|
|
8269
|
+
let s = n.trim();
|
|
8270
|
+
if (s)
|
|
7884
8271
|
try {
|
|
7885
|
-
let o = JSON.parse(
|
|
8272
|
+
let o = JSON.parse(s);
|
|
7886
8273
|
if (o && o.method === 'tools/call' && o.params) {
|
|
7887
8274
|
let l = o.params.name,
|
|
7888
8275
|
c = o.params.arguments || {};
|
|
7889
8276
|
if (l === 'get_pricing') {
|
|
7890
8277
|
let p = typeof c.model == 'string' ? c.model.trim() : '',
|
|
7891
|
-
d = `${t.replace(/\/+$/, '')}${
|
|
8278
|
+
d = `${t.replace(/\/+$/, '')}${fe(p)}`;
|
|
7892
8279
|
try {
|
|
7893
8280
|
let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
|
|
7894
8281
|
h = await m.text();
|
|
@@ -7935,19 +8322,19 @@ async function tr() {
|
|
|
7935
8322
|
!p.startsWith('data:')
|
|
7936
8323
|
)
|
|
7937
8324
|
try {
|
|
7938
|
-
let d =
|
|
8325
|
+
let d = j.default.resolve(p.trim());
|
|
7939
8326
|
if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
|
|
7940
|
-
if (!
|
|
7941
|
-
let m = await
|
|
8327
|
+
if (!er(d)) throw tr(d);
|
|
8328
|
+
let m = await Zt(d, e, t),
|
|
7942
8329
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
7943
|
-
|
|
8330
|
+
ge =
|
|
7944
8331
|
m.mimeType.startsWith('image/') ||
|
|
7945
8332
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
7946
8333
|
? `
|
|
7947
8334
|
|
|
7948
8335
|
`
|
|
7949
8336
|
: '',
|
|
7950
|
-
|
|
8337
|
+
he = {
|
|
7951
8338
|
jsonrpc: '2.0',
|
|
7952
8339
|
id: o.id,
|
|
7953
8340
|
result: {
|
|
@@ -7958,7 +8345,7 @@ async function tr() {
|
|
|
7958
8345
|
|
|
7959
8346
|
- **URL:** ${m.url}
|
|
7960
8347
|
- **Type:** \`${m.mimeType}\`
|
|
7961
|
-
- **Size:** ${h} KB${
|
|
8348
|
+
- **Size:** ${h} KB${ge}
|
|
7962
8349
|
|
|
7963
8350
|
Pass this URL to any Tein generation tool.`,
|
|
7964
8351
|
},
|
|
@@ -7967,7 +8354,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7967
8354
|
},
|
|
7968
8355
|
};
|
|
7969
8356
|
process.stdout.write(
|
|
7970
|
-
JSON.stringify(
|
|
8357
|
+
JSON.stringify(he) +
|
|
7971
8358
|
`
|
|
7972
8359
|
`,
|
|
7973
8360
|
);
|
|
@@ -7994,7 +8381,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7994
8381
|
}
|
|
7995
8382
|
if (e)
|
|
7996
8383
|
try {
|
|
7997
|
-
o.params.arguments = await
|
|
8384
|
+
o.params.arguments = await rr(String(l), c, e, t, r);
|
|
7998
8385
|
} catch (p) {
|
|
7999
8386
|
let d = p instanceof Error ? p.message : String(p);
|
|
8000
8387
|
process.stdout.write(
|
|
@@ -8025,10 +8412,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8025
8412
|
body: JSON.stringify(o),
|
|
8026
8413
|
}),
|
|
8027
8414
|
c = await l.text(),
|
|
8028
|
-
p =
|
|
8415
|
+
p = Xt(o, l.status, c);
|
|
8029
8416
|
if (p === null) return;
|
|
8030
8417
|
if (p) {
|
|
8031
|
-
(o?.method === 'tools/list' &&
|
|
8418
|
+
(o?.method === 'tools/list' && We(p.result?.tools),
|
|
8032
8419
|
process.stdout.write(
|
|
8033
8420
|
JSON.stringify(p) +
|
|
8034
8421
|
`
|
|
@@ -8037,7 +8424,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8037
8424
|
return;
|
|
8038
8425
|
}
|
|
8039
8426
|
} catch {}
|
|
8040
|
-
let u =
|
|
8427
|
+
let u = Ra(o);
|
|
8041
8428
|
u !== null &&
|
|
8042
8429
|
process.stdout.write(
|
|
8043
8430
|
JSON.stringify(u) +
|
|
@@ -8061,21 +8448,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8061
8448
|
`));
|
|
8062
8449
|
}
|
|
8063
8450
|
var D,
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8451
|
+
j,
|
|
8452
|
+
Qt,
|
|
8453
|
+
$a,
|
|
8067
8454
|
X,
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8455
|
+
Je,
|
|
8456
|
+
Yt,
|
|
8457
|
+
nr = y(() => {
|
|
8071
8458
|
'use strict';
|
|
8072
|
-
((D =
|
|
8073
|
-
(
|
|
8074
|
-
(
|
|
8075
|
-
|
|
8076
|
-
|
|
8459
|
+
((D = _(require('node:fs'))),
|
|
8460
|
+
(j = _(require('node:path'))),
|
|
8461
|
+
(Qt = _(require('node:readline'))));
|
|
8462
|
+
Ue();
|
|
8463
|
+
Jt();
|
|
8077
8464
|
A();
|
|
8078
|
-
|
|
8465
|
+
$a = new Set([
|
|
8079
8466
|
'.png',
|
|
8080
8467
|
'.jpg',
|
|
8081
8468
|
'.jpeg',
|
|
@@ -8101,22 +8488,22 @@ var D,
|
|
|
8101
8488
|
'.flac',
|
|
8102
8489
|
'.opus',
|
|
8103
8490
|
]);
|
|
8104
|
-
((X = new Map()), (
|
|
8105
|
-
|
|
8491
|
+
((X = new Map()), (Je = 0));
|
|
8492
|
+
Yt = !1;
|
|
8106
8493
|
require.main === module &&
|
|
8107
|
-
|
|
8494
|
+
ar().catch((e) => {
|
|
8108
8495
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
8109
8496
|
`),
|
|
8110
8497
|
process.exit(1));
|
|
8111
8498
|
});
|
|
8112
8499
|
});
|
|
8113
|
-
var
|
|
8500
|
+
var fr =
|
|
8114
8501
|
!process.env.NO_COLOR &&
|
|
8115
8502
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
8116
8503
|
function k(e, t) {
|
|
8117
|
-
return (r) => (
|
|
8504
|
+
return (r) => (fr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
8118
8505
|
}
|
|
8119
|
-
var
|
|
8506
|
+
var i = {
|
|
8120
8507
|
bold: k(1, 22),
|
|
8121
8508
|
dim: k(2, 22),
|
|
8122
8509
|
italic: k(3, 23),
|
|
@@ -8136,7 +8523,7 @@ var a = {
|
|
|
8136
8523
|
bgCyan: k(46, 49),
|
|
8137
8524
|
bgGreen: k(42, 49),
|
|
8138
8525
|
},
|
|
8139
|
-
|
|
8526
|
+
T = class {
|
|
8140
8527
|
constructor(t = '') {
|
|
8141
8528
|
this.frames = [
|
|
8142
8529
|
'\u280B',
|
|
@@ -8160,7 +8547,7 @@ var a = {
|
|
|
8160
8547
|
process.stdout.isTTY
|
|
8161
8548
|
? (this.stop(),
|
|
8162
8549
|
(this.timer = setInterval(() => {
|
|
8163
|
-
let r =
|
|
8550
|
+
let r = i.cyan(this.frames[this.current]);
|
|
8164
8551
|
(process.stdout.write(`\r${r} ${this.text} `),
|
|
8165
8552
|
(this.current = (this.current + 1) % this.frames.length));
|
|
8166
8553
|
}, 80)),
|
|
@@ -8177,7 +8564,7 @@ var a = {
|
|
|
8177
8564
|
this.stop();
|
|
8178
8565
|
let r = t || this.text;
|
|
8179
8566
|
process.stdout.isTTY
|
|
8180
|
-
? process.stdout.write(`\r${
|
|
8567
|
+
? process.stdout.write(`\r${i.green('\u2713')} ${r}
|
|
8181
8568
|
`)
|
|
8182
8569
|
: process.stdout.write(`[\u2713] ${r}
|
|
8183
8570
|
`);
|
|
@@ -8186,7 +8573,7 @@ var a = {
|
|
|
8186
8573
|
this.stop();
|
|
8187
8574
|
let r = t || this.text;
|
|
8188
8575
|
process.stdout.isTTY
|
|
8189
|
-
? process.stdout.write(`\r${
|
|
8576
|
+
? process.stdout.write(`\r${i.red('\u2717')} ${r}
|
|
8190
8577
|
`)
|
|
8191
8578
|
: process.stdout.write(`[\u2717] ${r}
|
|
8192
8579
|
`);
|
|
@@ -8198,13 +8585,13 @@ var a = {
|
|
|
8198
8585
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
8199
8586
|
}
|
|
8200
8587
|
};
|
|
8201
|
-
var V =
|
|
8202
|
-
$ =
|
|
8203
|
-
var ee =
|
|
8204
|
-
|
|
8205
|
-
|
|
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');
|
|
8206
8593
|
var Z = '1.1.7';
|
|
8207
|
-
var
|
|
8594
|
+
var gr = new Set([
|
|
8208
8595
|
'account_suspended',
|
|
8209
8596
|
'account_terminated',
|
|
8210
8597
|
'creative_mode_restricted',
|
|
@@ -8212,59 +8599,59 @@ var mr = new Set([
|
|
|
8212
8599
|
'workspace_paused',
|
|
8213
8600
|
]),
|
|
8214
8601
|
v = 1,
|
|
8215
|
-
|
|
8602
|
+
hr = 3,
|
|
8216
8603
|
w = class extends Error {
|
|
8217
|
-
constructor(t, r,
|
|
8604
|
+
constructor(t, r, a, n = {}) {
|
|
8218
8605
|
(super(r),
|
|
8219
8606
|
(this.name = 'TeinApiError'),
|
|
8220
8607
|
(this.status = t),
|
|
8221
|
-
|
|
8222
|
-
(this.fields =
|
|
8608
|
+
a && (this.code = a),
|
|
8609
|
+
(this.fields = n));
|
|
8223
8610
|
}
|
|
8224
8611
|
get exitCode() {
|
|
8225
|
-
return this.code &&
|
|
8612
|
+
return this.code && gr.has(this.code) ? hr : v;
|
|
8226
8613
|
}
|
|
8227
8614
|
};
|
|
8228
|
-
function
|
|
8229
|
-
let
|
|
8230
|
-
if (!r || typeof r != 'object') return new w(e,
|
|
8231
|
-
let
|
|
8232
|
-
if (
|
|
8233
|
-
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,
|
|
8234
8621
|
{ code: d, message: m, ...h } = p;
|
|
8235
|
-
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);
|
|
8236
8623
|
}
|
|
8237
|
-
let { error:
|
|
8238
|
-
c = (typeof
|
|
8624
|
+
let { error: s, code: o, message: u, ...l } = n,
|
|
8625
|
+
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
8239
8626
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8240
8627
|
}
|
|
8241
|
-
function
|
|
8628
|
+
function Qe(e) {
|
|
8242
8629
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8243
8630
|
}
|
|
8244
8631
|
function S(e) {
|
|
8245
8632
|
let t = [e.message],
|
|
8246
|
-
r =
|
|
8247
|
-
|
|
8248
|
-
(r ||
|
|
8249
|
-
t.push([r ? `Required: ${r}` : '',
|
|
8250
|
-
let
|
|
8251
|
-
typeof
|
|
8252
|
-
let
|
|
8253
|
-
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);
|
|
8254
8641
|
}
|
|
8255
|
-
function
|
|
8642
|
+
function br(e) {
|
|
8256
8643
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
8257
8644
|
? 'video'
|
|
8258
8645
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
8259
8646
|
? 'audio'
|
|
8260
8647
|
: 'image';
|
|
8261
8648
|
}
|
|
8262
|
-
function
|
|
8649
|
+
function Xe(e) {
|
|
8263
8650
|
let t = [];
|
|
8264
8651
|
for (let r of e.data ?? [])
|
|
8265
8652
|
typeof r.message?.content == 'string'
|
|
8266
8653
|
? t.push({ type: 'text', text: r.message.content })
|
|
8267
|
-
: r.url && t.push({ type:
|
|
8654
|
+
: r.url && t.push({ type: br(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
8268
8655
|
return t;
|
|
8269
8656
|
}
|
|
8270
8657
|
var K = class {
|
|
@@ -8279,56 +8666,56 @@ var K = class {
|
|
|
8279
8666
|
'X-Tein-Client': 'cli',
|
|
8280
8667
|
};
|
|
8281
8668
|
}
|
|
8282
|
-
async send(t, r,
|
|
8283
|
-
let
|
|
8669
|
+
async send(t, r, a) {
|
|
8670
|
+
let n = await fetch(`${this.baseUrl}${r}`, {
|
|
8284
8671
|
method: t,
|
|
8285
8672
|
headers: this.getHeaders(),
|
|
8286
|
-
...(
|
|
8673
|
+
...(a === void 0 ? {} : { body: JSON.stringify(a) }),
|
|
8287
8674
|
});
|
|
8288
|
-
if (!
|
|
8289
|
-
let
|
|
8675
|
+
if (!n.ok) {
|
|
8676
|
+
let s = null;
|
|
8290
8677
|
try {
|
|
8291
|
-
|
|
8678
|
+
s = await n.json();
|
|
8292
8679
|
} catch {}
|
|
8293
|
-
throw
|
|
8680
|
+
throw yr(n.status, n.statusText, s);
|
|
8294
8681
|
}
|
|
8295
|
-
return await
|
|
8682
|
+
return await n.json();
|
|
8296
8683
|
}
|
|
8297
8684
|
async checkKey() {
|
|
8298
8685
|
await this.send('GET', '/v1/jobs?limit=1');
|
|
8299
8686
|
}
|
|
8300
8687
|
queueJob(t, r) {
|
|
8301
|
-
return this.send('POST', '/v1/generate', { model: t, ...r }).then((
|
|
8302
|
-
let
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
?
|
|
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
|
|
8306
8693
|
: 'processing',
|
|
8307
|
-
o =
|
|
8694
|
+
o = Xe(a);
|
|
8308
8695
|
return {
|
|
8309
|
-
request_id:
|
|
8310
|
-
model:
|
|
8311
|
-
status:
|
|
8696
|
+
request_id: a.request_id || a.id || '',
|
|
8697
|
+
model: a.model,
|
|
8698
|
+
status: s,
|
|
8312
8699
|
...(o.length ? { output: o } : {}),
|
|
8313
|
-
error:
|
|
8314
|
-
...(
|
|
8700
|
+
error: a.error && typeof a.error.message == 'string' ? a.error.message : null,
|
|
8701
|
+
...(a.usage ? { usage: a.usage } : {}),
|
|
8315
8702
|
};
|
|
8316
8703
|
});
|
|
8317
8704
|
}
|
|
8318
8705
|
getStatus(t) {
|
|
8319
8706
|
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
|
|
8320
|
-
let
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
?
|
|
8707
|
+
let a = r.status,
|
|
8708
|
+
n =
|
|
8709
|
+
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
8710
|
+
? a
|
|
8324
8711
|
: 'processing',
|
|
8325
|
-
|
|
8712
|
+
s = Xe(r),
|
|
8326
8713
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8327
8714
|
return {
|
|
8328
8715
|
request_id: r.id || t,
|
|
8329
8716
|
model: r.model,
|
|
8330
|
-
status:
|
|
8331
|
-
...(
|
|
8717
|
+
status: n,
|
|
8718
|
+
...(s.length ? { output: s } : {}),
|
|
8332
8719
|
error: o,
|
|
8333
8720
|
...(r.usage ? { usage: r.usage } : {}),
|
|
8334
8721
|
};
|
|
@@ -8338,65 +8725,65 @@ var K = class {
|
|
|
8338
8725
|
return this.send('POST', '/v1/upload', { data: t });
|
|
8339
8726
|
}
|
|
8340
8727
|
async downloadOutput(t, r) {
|
|
8341
|
-
let
|
|
8342
|
-
if (!
|
|
8343
|
-
let
|
|
8344
|
-
ee.default.existsSync(
|
|
8345
|
-
let
|
|
8346
|
-
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);
|
|
8347
8734
|
}
|
|
8348
8735
|
};
|
|
8349
8736
|
A();
|
|
8350
|
-
function
|
|
8737
|
+
function xe(e) {
|
|
8351
8738
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
8352
8739
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
8353
8740
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
8354
8741
|
r = 10 ** t,
|
|
8355
|
-
|
|
8356
|
-
return
|
|
8742
|
+
a = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8743
|
+
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
8357
8744
|
}
|
|
8358
8745
|
W();
|
|
8359
|
-
var
|
|
8360
|
-
function
|
|
8361
|
-
for (let t of
|
|
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]]);
|
|
8362
8749
|
}
|
|
8363
|
-
function
|
|
8750
|
+
function ta(e) {
|
|
8364
8751
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8365
8752
|
let t = $.default.resolve(e);
|
|
8366
8753
|
return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
|
|
8367
8754
|
}
|
|
8368
|
-
async function
|
|
8369
|
-
for (let r of
|
|
8755
|
+
async function ra(e, t) {
|
|
8756
|
+
for (let r of Ot) {
|
|
8370
8757
|
if (!Array.isArray(e[r])) continue;
|
|
8371
|
-
let
|
|
8372
|
-
for (let
|
|
8373
|
-
if (typeof
|
|
8374
|
-
let
|
|
8375
|
-
|
|
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);
|
|
8376
8763
|
}
|
|
8377
|
-
e[r] =
|
|
8764
|
+
e[r] = a;
|
|
8378
8765
|
}
|
|
8379
8766
|
}
|
|
8380
8767
|
var Y = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
8381
|
-
function
|
|
8768
|
+
function aa(e) {
|
|
8382
8769
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
8383
8770
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
8384
8771
|
r = Y.enterprise;
|
|
8385
8772
|
return (
|
|
8386
8773
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
8387
8774
|
(process.stderr
|
|
8388
|
-
.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.
|
|
8389
8776
|
`),
|
|
8390
8777
|
process.exit(1)),
|
|
8391
8778
|
t
|
|
8392
8779
|
);
|
|
8393
8780
|
}
|
|
8394
|
-
async function
|
|
8395
|
-
|
|
8396
|
-
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...
|
|
8397
8784
|
`);
|
|
8398
|
-
let
|
|
8399
|
-
Array.from({ length:
|
|
8785
|
+
let s = await Promise.all(
|
|
8786
|
+
Array.from({ length: a }, async () => {
|
|
8400
8787
|
try {
|
|
8401
8788
|
return { job: await e.queueJob(t, r) };
|
|
8402
8789
|
} catch (l) {
|
|
@@ -8406,7 +8793,7 @@ async function ti(e, t, r, i, s) {
|
|
|
8406
8793
|
),
|
|
8407
8794
|
o = [],
|
|
8408
8795
|
u = [];
|
|
8409
|
-
for (let l of
|
|
8796
|
+
for (let l of s)
|
|
8410
8797
|
'job' in l && l.job
|
|
8411
8798
|
? o.push(l.job)
|
|
8412
8799
|
: 'err' in l &&
|
|
@@ -8415,13 +8802,13 @@ async function ti(e, t, r, i, s) {
|
|
|
8415
8802
|
? l.err
|
|
8416
8803
|
: new w(0, l.err instanceof Error ? l.err.message : String(l.err)),
|
|
8417
8804
|
);
|
|
8418
|
-
if (!
|
|
8805
|
+
if (!n.isAsync) {
|
|
8419
8806
|
let l = Date.now(),
|
|
8420
8807
|
c = o.filter((p) => p.status === 'processing' && p.request_id);
|
|
8421
8808
|
for (; c.length;) {
|
|
8422
|
-
if ((await new Promise((d) => setTimeout(d, 2e3)), !
|
|
8809
|
+
if ((await new Promise((d) => setTimeout(d, 2e3)), !n.isJson)) {
|
|
8423
8810
|
let d = Math.round((Date.now() - l) / 1e3);
|
|
8424
|
-
process.stderr.write(`Waiting on ${c.length} of ${
|
|
8811
|
+
process.stderr.write(`Waiting on ${c.length} of ${a} (${d}s)...
|
|
8425
8812
|
`);
|
|
8426
8813
|
}
|
|
8427
8814
|
let p = await Promise.all(
|
|
@@ -8440,7 +8827,7 @@ async function ti(e, t, r, i, s) {
|
|
|
8440
8827
|
c = o.filter((d) => d.status === 'processing' && d.request_id);
|
|
8441
8828
|
}
|
|
8442
8829
|
}
|
|
8443
|
-
if (
|
|
8830
|
+
if (n.isJson)
|
|
8444
8831
|
process.stdout.write(
|
|
8445
8832
|
JSON.stringify(
|
|
8446
8833
|
{ jobs: o, errors: u.map((l) => ({ code: l.code ?? null, message: l.message })) },
|
|
@@ -8453,7 +8840,7 @@ async function ti(e, t, r, i, s) {
|
|
|
8453
8840
|
else {
|
|
8454
8841
|
for (let l of o)
|
|
8455
8842
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
8456
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
8843
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${xe(l.usage.cost)}`),
|
|
8457
8844
|
l.error && process.stdout.write(` ${l.error}`),
|
|
8458
8845
|
process.stdout.write(`
|
|
8459
8846
|
`));
|
|
@@ -8466,24 +8853,24 @@ async function ti(e, t, r, i, s) {
|
|
|
8466
8853
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
8467
8854
|
process.exit(v);
|
|
8468
8855
|
}
|
|
8469
|
-
function
|
|
8856
|
+
function na(e, t, r) {
|
|
8470
8857
|
if (r <= 1) return e;
|
|
8471
|
-
let
|
|
8472
|
-
return `${e.slice(0, e.length -
|
|
8858
|
+
let a = $.default.extname(e);
|
|
8859
|
+
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
8473
8860
|
}
|
|
8474
|
-
function
|
|
8861
|
+
function Rt(e) {
|
|
8475
8862
|
let t = {},
|
|
8476
8863
|
r = new Set(),
|
|
8477
|
-
|
|
8478
|
-
for (let
|
|
8479
|
-
let
|
|
8480
|
-
if (
|
|
8481
|
-
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);
|
|
8482
8869
|
if (o.includes('=')) {
|
|
8483
8870
|
let [u, l] = o.split('=', 2);
|
|
8484
8871
|
t[u.replace(/-/g, '_')] = l;
|
|
8485
|
-
} else if (
|
|
8486
|
-
let u = e[
|
|
8872
|
+
} else if (n + 1 < e.length && !e[n + 1].startsWith('-')) {
|
|
8873
|
+
let u = e[n + 1];
|
|
8487
8874
|
(u === 'true'
|
|
8488
8875
|
? (t[o.replace(/-/g, '_')] = !0)
|
|
8489
8876
|
: u === 'false'
|
|
@@ -8491,10 +8878,10 @@ function At(e) {
|
|
|
8491
8878
|
: /^-?\d+(\.\d+)?$/.test(u)
|
|
8492
8879
|
? (t[o.replace(/-/g, '_')] = Number(u))
|
|
8493
8880
|
: (t[o.replace(/-/g, '_')] = u),
|
|
8494
|
-
|
|
8881
|
+
n++);
|
|
8495
8882
|
} else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
|
|
8496
|
-
} else if (
|
|
8497
|
-
let o =
|
|
8883
|
+
} else if (s.startsWith('-') && s.length === 2) {
|
|
8884
|
+
let o = s[1],
|
|
8498
8885
|
l =
|
|
8499
8886
|
{
|
|
8500
8887
|
p: 'prompt',
|
|
@@ -8509,36 +8896,36 @@ function At(e) {
|
|
|
8509
8896
|
}[o] || o;
|
|
8510
8897
|
o === 'j' || o === 'h' || o === 'v'
|
|
8511
8898
|
? ((t[l] = !0), r.add(l))
|
|
8512
|
-
:
|
|
8513
|
-
? ((t[l] = e[
|
|
8899
|
+
: n + 1 < e.length && !e[n + 1].startsWith('-')
|
|
8900
|
+
? ((t[l] = e[n + 1]), n++)
|
|
8514
8901
|
: (t[l] = !0);
|
|
8515
|
-
} else
|
|
8902
|
+
} else a.push(s);
|
|
8516
8903
|
}
|
|
8517
|
-
return { command:
|
|
8904
|
+
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
|
|
8518
8905
|
}
|
|
8519
|
-
async function
|
|
8906
|
+
async function Ne(e, t) {
|
|
8520
8907
|
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8521
|
-
|
|
8908
|
+
a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8522
8909
|
(r ||
|
|
8523
|
-
(process.stderr.write(`${
|
|
8910
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
8524
8911
|
`),
|
|
8525
8912
|
process.stderr
|
|
8526
|
-
.write(`Please run ${
|
|
8913
|
+
.write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
|
|
8527
8914
|
`),
|
|
8528
8915
|
process.exit(1)),
|
|
8529
8916
|
e ||
|
|
8530
|
-
(process.stderr.write(`${
|
|
8917
|
+
(process.stderr.write(`${i.red('Error:')} Missing model slug.
|
|
8531
8918
|
`),
|
|
8532
|
-
process.stderr.write(`Usage: ${
|
|
8919
|
+
process.stderr.write(`Usage: ${i.cyan('tein run <model-slug> --prompt "..."')}
|
|
8533
8920
|
`),
|
|
8534
|
-
process.stderr.write(`Run ${
|
|
8921
|
+
process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
|
|
8535
8922
|
`),
|
|
8536
8923
|
process.exit(1)));
|
|
8537
|
-
let
|
|
8538
|
-
|
|
8924
|
+
let n = F(e),
|
|
8925
|
+
s = !!t.json,
|
|
8539
8926
|
o = !!(t.async || t.no_wait),
|
|
8540
8927
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
8541
|
-
l =
|
|
8928
|
+
l = aa(t),
|
|
8542
8929
|
c = { ...t };
|
|
8543
8930
|
(delete c.json,
|
|
8544
8931
|
delete c.async,
|
|
@@ -8547,29 +8934,37 @@ async function Le(e, t) {
|
|
|
8547
8934
|
delete c.api_key,
|
|
8548
8935
|
delete c.api_url,
|
|
8549
8936
|
delete c.count);
|
|
8550
|
-
let p =
|
|
8551
|
-
(
|
|
8552
|
-
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),
|
|
8553
8940
|
p.image_url &&
|
|
8554
8941
|
!p.first_frame_image &&
|
|
8555
8942
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
8556
8943
|
(p.first_frame_image = p.image_url));
|
|
8557
|
-
let d = new K(r,
|
|
8558
|
-
m = [
|
|
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
|
+
];
|
|
8559
8954
|
for (let b of m) {
|
|
8560
8955
|
let g = p[b];
|
|
8561
8956
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
8562
8957
|
let x = $.default.resolve(g);
|
|
8563
8958
|
if (V.default.existsSync(x) && V.default.statSync(x).isFile()) {
|
|
8564
|
-
let I = new
|
|
8565
|
-
|
|
8959
|
+
let I = new T(`Uploading local file ${$.default.basename(x)} to CDN...`);
|
|
8960
|
+
s || I.start();
|
|
8566
8961
|
try {
|
|
8567
8962
|
let L = V.default.readFileSync(x),
|
|
8568
8963
|
C = await d.uploadAsset(L.toString('base64'));
|
|
8569
|
-
((p[b] = C.url),
|
|
8964
|
+
((p[b] = C.url), s || I.succeed(`Uploaded ${$.default.basename(x)} to CDN`));
|
|
8570
8965
|
} catch (L) {
|
|
8571
8966
|
let C = L instanceof Error ? L.message : String(L);
|
|
8572
|
-
(
|
|
8967
|
+
(s
|
|
8573
8968
|
? process.stdout.write(
|
|
8574
8969
|
JSON.stringify({ error: C }) +
|
|
8575
8970
|
`
|
|
@@ -8581,16 +8976,16 @@ async function Le(e, t) {
|
|
|
8581
8976
|
}
|
|
8582
8977
|
}
|
|
8583
8978
|
}
|
|
8584
|
-
await
|
|
8585
|
-
let g = new
|
|
8586
|
-
|
|
8979
|
+
await ra(p, async (b) => {
|
|
8980
|
+
let g = new T(`Uploading local file ${$.default.basename(b)} to CDN...`);
|
|
8981
|
+
s || g.start();
|
|
8587
8982
|
try {
|
|
8588
8983
|
let x = V.default.readFileSync(b),
|
|
8589
8984
|
I = await d.uploadAsset(x.toString('base64'));
|
|
8590
|
-
return (
|
|
8985
|
+
return (s || g.succeed(`Uploaded ${$.default.basename(b)} to CDN`), I.url);
|
|
8591
8986
|
} catch (x) {
|
|
8592
8987
|
let I = x instanceof Error ? x.message : String(x);
|
|
8593
|
-
(
|
|
8988
|
+
(s
|
|
8594
8989
|
? process.stdout.write(
|
|
8595
8990
|
JSON.stringify({ error: I }) +
|
|
8596
8991
|
`
|
|
@@ -8600,18 +8995,18 @@ async function Le(e, t) {
|
|
|
8600
8995
|
process.exit(1));
|
|
8601
8996
|
}
|
|
8602
8997
|
});
|
|
8603
|
-
let h = new
|
|
8604
|
-
|
|
8998
|
+
let h = new T(`Submitting task for ${i.bold(e)}...`);
|
|
8999
|
+
s || h.start();
|
|
8605
9000
|
let f;
|
|
8606
9001
|
try {
|
|
8607
9002
|
if (l > 1) {
|
|
8608
|
-
await
|
|
9003
|
+
await ia(d, e, p, l, { isJson: s, isAsync: o });
|
|
8609
9004
|
return;
|
|
8610
9005
|
}
|
|
8611
9006
|
f = await d.queueJob(e, p);
|
|
8612
9007
|
} catch (b) {
|
|
8613
9008
|
let g = b instanceof w ? b : null;
|
|
8614
|
-
(
|
|
9009
|
+
(s
|
|
8615
9010
|
? process.stdout.write(
|
|
8616
9011
|
JSON.stringify(
|
|
8617
9012
|
g
|
|
@@ -8632,29 +9027,29 @@ async function Le(e, t) {
|
|
|
8632
9027
|
process.exit(g ? g.exitCode : v));
|
|
8633
9028
|
}
|
|
8634
9029
|
if (o) {
|
|
8635
|
-
|
|
9030
|
+
s
|
|
8636
9031
|
? process.stdout.write(
|
|
8637
9032
|
JSON.stringify(f, null, 2) +
|
|
8638
9033
|
`
|
|
8639
9034
|
`,
|
|
8640
9035
|
)
|
|
8641
|
-
: (h.succeed(`Queued successfully! Request ID: ${
|
|
8642
|
-
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}`)}
|
|
8643
9038
|
`));
|
|
8644
9039
|
return;
|
|
8645
9040
|
}
|
|
8646
|
-
let
|
|
8647
|
-
|
|
9041
|
+
let ge = Date.now(),
|
|
9042
|
+
he = 1500;
|
|
8648
9043
|
for (; f.status === 'processing';) {
|
|
8649
|
-
let b = Math.round((Date.now() -
|
|
8650
|
-
(
|
|
8651
|
-
await new Promise((g) => setTimeout(g,
|
|
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)));
|
|
8652
9047
|
try {
|
|
8653
9048
|
f = await d.getStatus(f.request_id);
|
|
8654
9049
|
} catch (g) {
|
|
8655
9050
|
g instanceof w &&
|
|
8656
9051
|
g.exitCode !== v &&
|
|
8657
|
-
(
|
|
9052
|
+
(s ||
|
|
8658
9053
|
h.fail(
|
|
8659
9054
|
S(g).join(`
|
|
8660
9055
|
`),
|
|
@@ -8664,7 +9059,7 @@ async function Le(e, t) {
|
|
|
8664
9059
|
}
|
|
8665
9060
|
if (
|
|
8666
9061
|
((f.status === 'failed' || f.status === 'expired' || f.status === 'cancelled') &&
|
|
8667
|
-
(
|
|
9062
|
+
(s
|
|
8668
9063
|
? process.stdout.write(
|
|
8669
9064
|
JSON.stringify(f, null, 2) +
|
|
8670
9065
|
`
|
|
@@ -8672,8 +9067,8 @@ async function Le(e, t) {
|
|
|
8672
9067
|
)
|
|
8673
9068
|
: h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
|
|
8674
9069
|
process.exit(v)),
|
|
8675
|
-
|
|
8676
|
-
|
|
9070
|
+
s || h.succeed(`Generation completed for ${i.bold(n?.name || e)}!`),
|
|
9071
|
+
s)
|
|
8677
9072
|
) {
|
|
8678
9073
|
process.stdout.write(
|
|
8679
9074
|
JSON.stringify(f, null, 2) +
|
|
@@ -8685,36 +9080,36 @@ async function Le(e, t) {
|
|
|
8685
9080
|
if (
|
|
8686
9081
|
(process.stdout.write(`
|
|
8687
9082
|
`),
|
|
8688
|
-
process.stdout.write(` ${
|
|
9083
|
+
process.stdout.write(` ${i.bold('Status:')} ${i.green('Succeeded')}
|
|
8689
9084
|
`),
|
|
8690
|
-
process.stdout.write(` ${
|
|
9085
|
+
process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
|
|
8691
9086
|
`),
|
|
8692
9087
|
f.usage?.cost !== void 0 &&
|
|
8693
|
-
process.stdout.write(` ${
|
|
9088
|
+
process.stdout.write(` ${i.bold('Cost:')} ${xe(f.usage.cost)}
|
|
8694
9089
|
`),
|
|
8695
9090
|
f.output && f.output.length > 0)
|
|
8696
9091
|
) {
|
|
8697
9092
|
process.stdout.write(`
|
|
8698
|
-
${
|
|
9093
|
+
${i.bold('Outputs:')}
|
|
8699
9094
|
`);
|
|
8700
9095
|
let b = f.output.filter((x) => x.url).length,
|
|
8701
9096
|
g = 0;
|
|
8702
9097
|
for (let x = 0; x < f.output.length; x++) {
|
|
8703
9098
|
let I = f.output[x];
|
|
8704
9099
|
if (I.url) {
|
|
8705
|
-
let L = I.layer?.name ? ` ${
|
|
9100
|
+
let L = I.layer?.name ? ` ${i.bold(I.layer.name)}` : '';
|
|
8706
9101
|
if (
|
|
8707
|
-
(process.stdout.write(` [${I.type.toUpperCase()}]${L} ${
|
|
9102
|
+
(process.stdout.write(` [${I.type.toUpperCase()}]${L} ${i.cyan(i.underline(I.url))}
|
|
8708
9103
|
`),
|
|
8709
9104
|
u)
|
|
8710
9105
|
) {
|
|
8711
|
-
let C =
|
|
8712
|
-
|
|
9106
|
+
let C = na(u, g++, b),
|
|
9107
|
+
Ye = new T(`Downloading output to ${C}...`).start();
|
|
8713
9108
|
try {
|
|
8714
9109
|
(await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
|
|
8715
|
-
|
|
8716
|
-
} catch (
|
|
8717
|
-
|
|
9110
|
+
Ye.succeed(`Saved to ${i.bold(C)}`));
|
|
9111
|
+
} catch (ye) {
|
|
9112
|
+
Ye.fail(`Failed to download: ${ye instanceof Error ? ye.message : ye}`);
|
|
8718
9113
|
}
|
|
8719
9114
|
}
|
|
8720
9115
|
} else
|
|
@@ -8727,9 +9122,9 @@ ${I.text}
|
|
|
8727
9122
|
process.stdout.write(`
|
|
8728
9123
|
`);
|
|
8729
9124
|
}
|
|
8730
|
-
var
|
|
9125
|
+
var Dt = _(require('node:readline'));
|
|
8731
9126
|
A();
|
|
8732
|
-
async function
|
|
9127
|
+
async function sa(e) {
|
|
8733
9128
|
try {
|
|
8734
9129
|
return (await new K(e, P()).checkKey(), 'ok');
|
|
8735
9130
|
} catch (t) {
|
|
@@ -8740,11 +9135,11 @@ async function ii(e) {
|
|
|
8740
9135
|
return 'unchecked';
|
|
8741
9136
|
}
|
|
8742
9137
|
}
|
|
8743
|
-
function
|
|
8744
|
-
let t =
|
|
9138
|
+
function oa(e) {
|
|
9139
|
+
let t = Dt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
8745
9140
|
return new Promise((r) => {
|
|
8746
|
-
t.question(e, (
|
|
8747
|
-
(t.close(), r(
|
|
9141
|
+
t.question(e, (a) => {
|
|
9142
|
+
(t.close(), r(a.trim()));
|
|
8748
9143
|
});
|
|
8749
9144
|
});
|
|
8750
9145
|
}
|
|
@@ -8755,38 +9150,38 @@ async function Q(e, t) {
|
|
|
8755
9150
|
let r = t?.trim() || '';
|
|
8756
9151
|
(r ||
|
|
8757
9152
|
(process.stdout.write(`
|
|
8758
|
-
${
|
|
9153
|
+
${i.bold('Tein AI Authentication')}
|
|
8759
9154
|
`),
|
|
8760
|
-
process.stdout.write(`Get your API key at: ${
|
|
9155
|
+
process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
|
|
8761
9156
|
|
|
8762
9157
|
`),
|
|
8763
|
-
(r = await
|
|
9158
|
+
(r = await oa('Enter your Tein API Key (sk_live_...): '))),
|
|
8764
9159
|
!r.startsWith('sk_live_') &&
|
|
8765
9160
|
!r.startsWith('sk_test_') &&
|
|
8766
9161
|
(process.stderr
|
|
8767
|
-
.write(`${
|
|
9162
|
+
.write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
8768
9163
|
`),
|
|
8769
9164
|
process.exit(1)));
|
|
8770
|
-
let
|
|
8771
|
-
(
|
|
9165
|
+
let a = await sa(r);
|
|
9166
|
+
(a === 'invalid' &&
|
|
8772
9167
|
(process.stderr
|
|
8773
|
-
.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.
|
|
8774
9169
|
`),
|
|
8775
9170
|
process.exit(1)),
|
|
8776
|
-
|
|
9171
|
+
we({ apiKey: r }),
|
|
8777
9172
|
process.stdout.write(`
|
|
8778
|
-
${
|
|
9173
|
+
${i.green('\u2713')} API key saved to ${i.dim(re())}
|
|
8779
9174
|
`),
|
|
8780
|
-
|
|
9175
|
+
a === 'blocked'
|
|
8781
9176
|
? process.stdout
|
|
8782
|
-
.write(`${
|
|
9177
|
+
.write(`${i.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
|
|
8783
9178
|
`)
|
|
8784
|
-
:
|
|
9179
|
+
: a === 'unchecked' &&
|
|
8785
9180
|
process.stdout
|
|
8786
|
-
.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.
|
|
8787
9182
|
`),
|
|
8788
9183
|
process.stdout
|
|
8789
|
-
.write(`You can now run models directly using: ${
|
|
9184
|
+
.write(`You can now run models directly using: ${i.cyan('tein run <model-slug> --prompt "..."')}
|
|
8790
9185
|
|
|
8791
9186
|
`));
|
|
8792
9187
|
break;
|
|
@@ -8794,41 +9189,41 @@ ${a.green('\u2713')} API key saved to ${a.dim(re())}
|
|
|
8794
9189
|
case 'logout': {
|
|
8795
9190
|
if (!U().apiKey) {
|
|
8796
9191
|
process.stdout
|
|
8797
|
-
.write(`${
|
|
9192
|
+
.write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
|
|
8798
9193
|
`);
|
|
8799
9194
|
break;
|
|
8800
9195
|
}
|
|
8801
|
-
(
|
|
9196
|
+
(we({ apiKey: '' }),
|
|
8802
9197
|
process.stdout
|
|
8803
|
-
.write(`${
|
|
9198
|
+
.write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(re())}
|
|
8804
9199
|
`));
|
|
8805
9200
|
break;
|
|
8806
9201
|
}
|
|
8807
9202
|
default: {
|
|
8808
9203
|
let r = q(),
|
|
8809
|
-
|
|
8810
|
-
|
|
9204
|
+
a = P(),
|
|
9205
|
+
n = U();
|
|
8811
9206
|
if (
|
|
8812
9207
|
(process.stdout.write(`
|
|
8813
|
-
${
|
|
9208
|
+
${i.bold('Tein AI CLI Configuration')}
|
|
8814
9209
|
`),
|
|
8815
|
-
process.stdout.write(` Config file: ${
|
|
9210
|
+
process.stdout.write(` Config file: ${i.dim(re())}
|
|
8816
9211
|
`),
|
|
8817
|
-
process.stdout.write(` API URL: ${
|
|
9212
|
+
process.stdout.write(` API URL: ${i.cyan(a)}
|
|
8818
9213
|
`),
|
|
8819
9214
|
!r)
|
|
8820
9215
|
)
|
|
8821
|
-
(process.stdout.write(` API Key: ${
|
|
9216
|
+
(process.stdout.write(` API Key: ${i.red('Not configured')}
|
|
8822
9217
|
|
|
8823
9218
|
`),
|
|
8824
9219
|
process.stdout
|
|
8825
|
-
.write(`Run ${
|
|
9220
|
+
.write(`Run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
|
|
8826
9221
|
|
|
8827
9222
|
`));
|
|
8828
9223
|
else {
|
|
8829
|
-
let
|
|
9224
|
+
let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
|
|
8830
9225
|
process.stdout
|
|
8831
|
-
.write(` API Key: ${
|
|
9226
|
+
.write(` API Key: ${i.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
|
|
8832
9227
|
|
|
8833
9228
|
`);
|
|
8834
9229
|
}
|
|
@@ -8837,57 +9232,57 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
8837
9232
|
}
|
|
8838
9233
|
}
|
|
8839
9234
|
A();
|
|
8840
|
-
|
|
9235
|
+
Ie();
|
|
8841
9236
|
W();
|
|
8842
|
-
var
|
|
8843
|
-
async function
|
|
9237
|
+
var la = 3e3;
|
|
9238
|
+
async function Lt(e) {
|
|
8844
9239
|
try {
|
|
8845
|
-
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
9240
|
+
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(la) });
|
|
8846
9241
|
if (!t.ok) return;
|
|
8847
9242
|
let r = await t.json(),
|
|
8848
|
-
|
|
8849
|
-
for (let
|
|
8850
|
-
let
|
|
8851
|
-
G.has(
|
|
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));
|
|
8852
9247
|
}
|
|
8853
|
-
|
|
9248
|
+
Mt(a);
|
|
8854
9249
|
} catch {}
|
|
8855
9250
|
}
|
|
8856
|
-
var
|
|
8857
|
-
|
|
8858
|
-
async function
|
|
8859
|
-
await
|
|
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);
|
|
8860
9255
|
let r = R();
|
|
8861
9256
|
if (e) {
|
|
8862
|
-
let
|
|
8863
|
-
o =
|
|
8864
|
-
r =
|
|
9257
|
+
let s = e.toLowerCase(),
|
|
9258
|
+
o = da[s] ?? s;
|
|
9259
|
+
r = pa.has(o)
|
|
8865
9260
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
8866
|
-
: r.filter((u) => u.kind.toLowerCase().includes(
|
|
9261
|
+
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
8867
9262
|
}
|
|
8868
9263
|
(process.stdout.write(`
|
|
8869
|
-
${
|
|
9264
|
+
${i.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
8870
9265
|
`),
|
|
8871
9266
|
process.stdout
|
|
8872
|
-
.write(`${
|
|
9267
|
+
.write(`${i.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
|
|
8873
9268
|
|
|
8874
9269
|
`));
|
|
8875
|
-
let
|
|
8876
|
-
for (let
|
|
8877
|
-
let o =
|
|
8878
|
-
(
|
|
9270
|
+
let a = {};
|
|
9271
|
+
for (let s of r) {
|
|
9272
|
+
let o = s.category;
|
|
9273
|
+
(a[o] || (a[o] = []), a[o].push(s));
|
|
8879
9274
|
}
|
|
8880
|
-
let
|
|
8881
|
-
for (let
|
|
8882
|
-
let o =
|
|
9275
|
+
let n = ['Video', 'Image', 'Text', 'Audio', '3D'];
|
|
9276
|
+
for (let s of n) {
|
|
9277
|
+
let o = a[s];
|
|
8883
9278
|
if (!(!o || o.length === 0)) {
|
|
8884
|
-
process.stdout.write(`${
|
|
9279
|
+
process.stdout.write(`${i.bold(i.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
|
|
8885
9280
|
`);
|
|
8886
9281
|
for (let u of o) {
|
|
8887
9282
|
let l = u.slug.padEnd(24),
|
|
8888
9283
|
c = u.name.padEnd(22),
|
|
8889
9284
|
p = u.priceFormatted.padEnd(22);
|
|
8890
|
-
process.stdout.write(` ${
|
|
9285
|
+
process.stdout.write(` ${i.bold(l)} ${i.gray(c)} ${i.green(p)} ${i.dim(u.vendor)}
|
|
8891
9286
|
`);
|
|
8892
9287
|
}
|
|
8893
9288
|
process.stdout.write(`
|
|
@@ -8895,95 +9290,95 @@ ${a.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
|
8895
9290
|
}
|
|
8896
9291
|
}
|
|
8897
9292
|
process.stdout
|
|
8898
|
-
.write(`${
|
|
9293
|
+
.write(`${i.dim('Tip:')} Generate directly with ${i.cyan('tein run <model-slug> --prompt "..."')}
|
|
8899
9294
|
|
|
8900
9295
|
`);
|
|
8901
9296
|
}
|
|
8902
|
-
async function
|
|
8903
|
-
G.has(e) && (await
|
|
8904
|
-
let r =
|
|
9297
|
+
async function Nt(e, t) {
|
|
9298
|
+
G.has(e) && (await Lt(t));
|
|
9299
|
+
let r = F(e);
|
|
8905
9300
|
(r ||
|
|
8906
|
-
(process.stderr.write(`${
|
|
9301
|
+
(process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
8907
9302
|
`),
|
|
8908
|
-
process.stderr.write(`Run ${
|
|
9303
|
+
process.stderr.write(`Run ${i.cyan('tein models')} to see all available model slugs.
|
|
8909
9304
|
`),
|
|
8910
9305
|
process.exit(1)),
|
|
8911
9306
|
process.stdout.write(`
|
|
8912
|
-
${
|
|
9307
|
+
${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
|
|
8913
9308
|
`),
|
|
8914
|
-
process.stdout.write(` ${
|
|
9309
|
+
process.stdout.write(` ${i.gray(r.description)}
|
|
8915
9310
|
|
|
8916
9311
|
`),
|
|
8917
|
-
process.stdout.write(`${
|
|
9312
|
+
process.stdout.write(`${i.bold('Metadata:')}
|
|
8918
9313
|
`),
|
|
8919
|
-
process.stdout.write(` Category: ${
|
|
9314
|
+
process.stdout.write(` Category: ${i.yellow(r.category)}
|
|
8920
9315
|
`),
|
|
8921
9316
|
process.stdout.write(` Kind: ${r.kind}
|
|
8922
9317
|
`),
|
|
8923
9318
|
process.stdout.write(` Vendor: ${r.vendor}
|
|
8924
9319
|
`),
|
|
8925
|
-
process.stdout.write(` Pricing: ${
|
|
9320
|
+
process.stdout.write(` Pricing: ${i.green(r.priceFormatted)}
|
|
8926
9321
|
|
|
8927
9322
|
`),
|
|
8928
|
-
process.stdout.write(`${
|
|
9323
|
+
process.stdout.write(`${i.bold('Parameters:')}
|
|
8929
9324
|
`));
|
|
8930
|
-
for (let
|
|
8931
|
-
let
|
|
8932
|
-
|
|
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}]`) : '';
|
|
8933
9328
|
(process.stdout
|
|
8934
|
-
.write(` ${
|
|
9329
|
+
.write(` ${i.bold(`--${a.name.replace(/_/g, '-')}`)} ${i.yellow(`<${a.type}>`)} ${n}${s}
|
|
8935
9330
|
`),
|
|
8936
|
-
|
|
8937
|
-
process.stdout.write(` ${
|
|
9331
|
+
a.description &&
|
|
9332
|
+
process.stdout.write(` ${i.gray(a.description)}
|
|
8938
9333
|
`),
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
process.stdout.write(` Allowed values: ${
|
|
9334
|
+
a.options &&
|
|
9335
|
+
a.options.length > 0 &&
|
|
9336
|
+
process.stdout.write(` Allowed values: ${i.dim(a.options.join(', '))}
|
|
8942
9337
|
`),
|
|
8943
|
-
(
|
|
8944
|
-
process.stdout.write(` Range: ${
|
|
9338
|
+
(a.min !== void 0 || a.max !== void 0) &&
|
|
9339
|
+
process.stdout.write(` Range: ${a.min ?? ''} to ${a.max ?? ''}
|
|
8945
9340
|
`),
|
|
8946
9341
|
process.stdout.write(`
|
|
8947
9342
|
`));
|
|
8948
9343
|
}
|
|
8949
9344
|
if (
|
|
8950
|
-
(r.parameters.some((
|
|
9345
|
+
(r.parameters.some((a) => a.name === 'callback_url') ||
|
|
8951
9346
|
(process.stdout
|
|
8952
|
-
.write(` ${
|
|
9347
|
+
.write(` ${i.bold('--callback-url')} ${i.yellow('<string>')} ${i.dim('(optional)')}
|
|
8953
9348
|
`),
|
|
8954
9349
|
process.stdout
|
|
8955
|
-
.write(` ${
|
|
9350
|
+
.write(` ${i.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
|
|
8956
9351
|
|
|
8957
9352
|
`)),
|
|
8958
|
-
process.stdout.write(`${
|
|
9353
|
+
process.stdout.write(`${i.bold('Sample CLI Usage:')}
|
|
8959
9354
|
`),
|
|
8960
9355
|
r.category === 'Video')
|
|
8961
9356
|
)
|
|
8962
9357
|
process.stdout
|
|
8963
|
-
.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`)}
|
|
8964
9359
|
|
|
8965
9360
|
`);
|
|
8966
9361
|
else if (r.category === 'Image') {
|
|
8967
|
-
let
|
|
9362
|
+
let a = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
|
|
8968
9363
|
process.stdout
|
|
8969
|
-
.write(` ${
|
|
9364
|
+
.write(` ${i.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${a} -o output.png`)}
|
|
8970
9365
|
|
|
8971
9366
|
`);
|
|
8972
9367
|
} else
|
|
8973
9368
|
r.category === 'Audio'
|
|
8974
9369
|
? process.stdout
|
|
8975
|
-
.write(` ${
|
|
9370
|
+
.write(` ${i.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
|
|
8976
9371
|
|
|
8977
9372
|
`)
|
|
8978
9373
|
: process.stdout
|
|
8979
|
-
.write(` ${
|
|
9374
|
+
.write(` ${i.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
|
|
8980
9375
|
|
|
8981
9376
|
`);
|
|
8982
9377
|
}
|
|
8983
9378
|
A();
|
|
8984
|
-
|
|
8985
|
-
var
|
|
8986
|
-
|
|
9379
|
+
Ue();
|
|
9380
|
+
var ca = 1e4,
|
|
9381
|
+
Fe = {
|
|
8987
9382
|
price: '',
|
|
8988
9383
|
creativeMode: 'Creative mode',
|
|
8989
9384
|
priority: 'Priority',
|
|
@@ -8993,114 +9388,114 @@ var li = 1e4,
|
|
|
8993
9388
|
priorityDraft: 'Priority + Draft',
|
|
8994
9389
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
8995
9390
|
},
|
|
8996
|
-
|
|
8997
|
-
|
|
9391
|
+
ua = Object.keys(Fe),
|
|
9392
|
+
ma = {
|
|
8998
9393
|
creativeMode: 'unfiltered',
|
|
8999
9394
|
creativeModePriority: 'unfilteredPriority',
|
|
9000
9395
|
creativeModeDraft: 'unfilteredDraft',
|
|
9001
9396
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
9002
9397
|
};
|
|
9003
|
-
function
|
|
9004
|
-
let r =
|
|
9398
|
+
function fa(e, t) {
|
|
9399
|
+
let r = ma[t];
|
|
9005
9400
|
return e[t] ?? (r ? e[r] : void 0);
|
|
9006
9401
|
}
|
|
9007
|
-
async function
|
|
9008
|
-
let r = `${P(e)}${
|
|
9009
|
-
|
|
9402
|
+
async function ga(e, t) {
|
|
9403
|
+
let r = `${P(e)}${fe(t)}`,
|
|
9404
|
+
a;
|
|
9010
9405
|
try {
|
|
9011
|
-
|
|
9406
|
+
a = await fetch(r, { signal: AbortSignal.timeout(ca) });
|
|
9012
9407
|
} catch {
|
|
9013
9408
|
throw new Error(`Could not reach ${r}`);
|
|
9014
9409
|
}
|
|
9015
|
-
let
|
|
9016
|
-
if (!
|
|
9017
|
-
let
|
|
9018
|
-
|
|
9019
|
-
?
|
|
9020
|
-
:
|
|
9021
|
-
?
|
|
9022
|
-
: `Pricing request failed (${
|
|
9023
|
-
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);
|
|
9024
9419
|
}
|
|
9025
|
-
return
|
|
9420
|
+
return n;
|
|
9026
9421
|
}
|
|
9027
|
-
function
|
|
9422
|
+
function Be(e) {
|
|
9028
9423
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
9029
|
-
[r,
|
|
9030
|
-
return `$${r}.${
|
|
9424
|
+
[r, a = ''] = t.split('.');
|
|
9425
|
+
return `$${r}.${a.padEnd(2, '0')}`;
|
|
9031
9426
|
}
|
|
9032
|
-
function
|
|
9427
|
+
function je(e) {
|
|
9033
9428
|
if (!e || typeof e.starter != 'number') return null;
|
|
9034
9429
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
9035
9430
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9036
|
-
return `Starter ${
|
|
9431
|
+
return `Starter ${Be(e.starter)} Plus ${Be(t)} Scale ${Be(r)}`;
|
|
9037
9432
|
}
|
|
9038
|
-
function
|
|
9433
|
+
function ha(e) {
|
|
9039
9434
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
9040
9435
|
let t = [];
|
|
9041
9436
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
9042
|
-
let
|
|
9043
|
-
|
|
9437
|
+
let a = e[r];
|
|
9438
|
+
a != null && a !== '' && t.push(String(a));
|
|
9044
9439
|
}
|
|
9045
9440
|
return (
|
|
9046
9441
|
e.withVideo === !0 && t.push('with video'),
|
|
9047
9442
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
9048
9443
|
);
|
|
9049
9444
|
}
|
|
9050
|
-
function
|
|
9051
|
-
let r =
|
|
9052
|
-
for (let
|
|
9053
|
-
let
|
|
9054
|
-
if (!
|
|
9055
|
-
let
|
|
9056
|
-
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}`);
|
|
9057
9452
|
}
|
|
9058
9453
|
}
|
|
9059
|
-
function
|
|
9454
|
+
function ba(e, t) {
|
|
9060
9455
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
9061
9456
|
t.push(
|
|
9062
|
-
` ${
|
|
9457
|
+
` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
9063
9458
|
);
|
|
9064
|
-
for (let
|
|
9065
|
-
let
|
|
9066
|
-
if (Array.isArray(
|
|
9067
|
-
for (let
|
|
9068
|
-
if (!
|
|
9069
|
-
let
|
|
9070
|
-
o = typeof
|
|
9071
|
-
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);
|
|
9072
9467
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
9073
9468
|
}
|
|
9074
9469
|
t.push('');
|
|
9075
9470
|
}
|
|
9076
|
-
function
|
|
9471
|
+
function ka(e) {
|
|
9077
9472
|
let t = [],
|
|
9078
9473
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9079
|
-
(t.push(`${
|
|
9474
|
+
(t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
|
|
9080
9475
|
t.push(
|
|
9081
|
-
`${
|
|
9476
|
+
`${i.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
|
|
9082
9477
|
),
|
|
9083
9478
|
t.push(''));
|
|
9084
|
-
let
|
|
9479
|
+
let a = new Map();
|
|
9085
9480
|
for (let l of e.board.models) {
|
|
9086
9481
|
let c = l.kind || 'other',
|
|
9087
|
-
p =
|
|
9088
|
-
(p.push(l),
|
|
9482
|
+
p = a.get(c) ?? [];
|
|
9483
|
+
(p.push(l), a.set(c, p));
|
|
9089
9484
|
}
|
|
9090
|
-
let
|
|
9091
|
-
|
|
9092
|
-
let p =
|
|
9093
|
-
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);
|
|
9094
9489
|
return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
|
|
9095
9490
|
});
|
|
9096
|
-
for (let l of
|
|
9097
|
-
t.push(`${
|
|
9098
|
-
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);
|
|
9099
9494
|
}
|
|
9100
9495
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
9101
9496
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
9102
9497
|
if (u.length) {
|
|
9103
|
-
t.push(`${
|
|
9498
|
+
t.push(`${i.bold(i.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
|
|
9104
9499
|
let l = new Map();
|
|
9105
9500
|
for (let c of u) {
|
|
9106
9501
|
let p = String(c.modelSlug ?? ''),
|
|
@@ -9109,29 +9504,29 @@ function hi(e) {
|
|
|
9109
9504
|
}
|
|
9110
9505
|
for (let [c, p] of l) {
|
|
9111
9506
|
let d = String(p[0]?.modelName ?? c);
|
|
9112
|
-
t.push(` ${
|
|
9507
|
+
t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
|
|
9113
9508
|
for (let m of p) {
|
|
9114
9509
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
9115
|
-
f =
|
|
9510
|
+
f = je(m.prices);
|
|
9116
9511
|
f && t.push(` ${h} ${f}`);
|
|
9117
9512
|
}
|
|
9118
9513
|
t.push('');
|
|
9119
9514
|
}
|
|
9120
9515
|
}
|
|
9121
9516
|
return (
|
|
9122
|
-
t.push(`${
|
|
9517
|
+
t.push(`${i.dim('JSON:')} ${i.cyan('tein pricing --json')}`),
|
|
9123
9518
|
`${t.join(`
|
|
9124
9519
|
`)}
|
|
9125
9520
|
`
|
|
9126
9521
|
);
|
|
9127
9522
|
}
|
|
9128
|
-
async function
|
|
9523
|
+
async function Ut(e) {
|
|
9129
9524
|
let t;
|
|
9130
9525
|
try {
|
|
9131
|
-
t = await
|
|
9526
|
+
t = await ga(e.apiUrl, e.model);
|
|
9132
9527
|
} catch (r) {
|
|
9133
|
-
let
|
|
9134
|
-
(process.stderr.write(`${
|
|
9528
|
+
let a = r instanceof Error ? r.message : String(r);
|
|
9529
|
+
(process.stderr.write(`${i.red('Error:')} ${a}
|
|
9135
9530
|
`),
|
|
9136
9531
|
process.exit(1));
|
|
9137
9532
|
}
|
|
@@ -9139,39 +9534,39 @@ async function Vt(e) {
|
|
|
9139
9534
|
e.json
|
|
9140
9535
|
? `${JSON.stringify(t, null, 2)}
|
|
9141
9536
|
`
|
|
9142
|
-
:
|
|
9537
|
+
: ka(t),
|
|
9143
9538
|
);
|
|
9144
9539
|
}
|
|
9145
|
-
var
|
|
9540
|
+
var Bt = _(require('node:path'));
|
|
9146
9541
|
A();
|
|
9147
|
-
async function
|
|
9542
|
+
async function Ft(e, t) {
|
|
9148
9543
|
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9149
|
-
|
|
9544
|
+
a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9150
9545
|
(r ||
|
|
9151
|
-
(process.stderr.write(`${
|
|
9546
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9152
9547
|
`),
|
|
9153
9548
|
process.stderr
|
|
9154
|
-
.write(`Please run ${
|
|
9549
|
+
.write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
|
|
9155
9550
|
`),
|
|
9156
9551
|
process.exit(1)),
|
|
9157
9552
|
e ||
|
|
9158
|
-
(process.stderr.write(`${
|
|
9553
|
+
(process.stderr.write(`${i.red('Error:')} Missing request ID.
|
|
9159
9554
|
`),
|
|
9160
|
-
process.stderr.write(`Usage: ${
|
|
9555
|
+
process.stderr.write(`Usage: ${i.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
|
|
9161
9556
|
`),
|
|
9162
9557
|
process.exit(1)));
|
|
9163
|
-
let
|
|
9164
|
-
|
|
9558
|
+
let n = !!t.json,
|
|
9559
|
+
s = !!t.wait,
|
|
9165
9560
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
9166
|
-
u = new K(r,
|
|
9167
|
-
l = new
|
|
9168
|
-
|
|
9561
|
+
u = new K(r, a),
|
|
9562
|
+
l = new T(`Checking status of ${i.bold(e)}...`);
|
|
9563
|
+
n || l.start();
|
|
9169
9564
|
let c;
|
|
9170
9565
|
try {
|
|
9171
9566
|
c = await u.getStatus(e);
|
|
9172
9567
|
} catch (p) {
|
|
9173
9568
|
(p instanceof w &&
|
|
9174
|
-
(
|
|
9569
|
+
(n
|
|
9175
9570
|
? process.stdout.write(
|
|
9176
9571
|
JSON.stringify(
|
|
9177
9572
|
{ error: { code: p.code ?? null, message: p.message, ...p.fields } },
|
|
@@ -9186,14 +9581,14 @@ async function Ut(e, t) {
|
|
|
9186
9581
|
`),
|
|
9187
9582
|
),
|
|
9188
9583
|
process.exit(p.exitCode)),
|
|
9189
|
-
|
|
9584
|
+
n || l.fail(p instanceof Error ? p.message : String(p)),
|
|
9190
9585
|
process.exit(v));
|
|
9191
9586
|
}
|
|
9192
|
-
if (
|
|
9587
|
+
if (s && c.status === 'processing') {
|
|
9193
9588
|
let p = Date.now();
|
|
9194
9589
|
for (; c.status === 'processing';) {
|
|
9195
9590
|
let d = Math.round((Date.now() - p) / 1e3);
|
|
9196
|
-
(
|
|
9591
|
+
(n || l.update(`Waiting for ${i.bold(c.model)} (${d}s elapsed)...`),
|
|
9197
9592
|
await new Promise((m) => setTimeout(m, 1500)));
|
|
9198
9593
|
try {
|
|
9199
9594
|
c = await u.getStatus(e);
|
|
@@ -9201,13 +9596,13 @@ async function Ut(e, t) {
|
|
|
9201
9596
|
}
|
|
9202
9597
|
}
|
|
9203
9598
|
if (
|
|
9204
|
-
(
|
|
9599
|
+
(n ||
|
|
9205
9600
|
(c.status === 'succeeded'
|
|
9206
9601
|
? l.succeed('Task completed!')
|
|
9207
9602
|
: c.status === 'failed' || c.status === 'expired' || c.status === 'cancelled'
|
|
9208
9603
|
? l.fail(`Task ${c.status}: ${c.error || 'Something failed on our side.'}`)
|
|
9209
9604
|
: l.stop()),
|
|
9210
|
-
|
|
9605
|
+
n)
|
|
9211
9606
|
) {
|
|
9212
9607
|
process.stdout.write(
|
|
9213
9608
|
JSON.stringify(c, null, 2) +
|
|
@@ -9218,29 +9613,29 @@ async function Ut(e, t) {
|
|
|
9218
9613
|
}
|
|
9219
9614
|
if (
|
|
9220
9615
|
(process.stdout.write(`
|
|
9221
|
-
${
|
|
9616
|
+
${i.bold('Model:')} ${c.model}
|
|
9222
9617
|
`),
|
|
9223
9618
|
process.stdout
|
|
9224
|
-
.write(` ${
|
|
9619
|
+
.write(` ${i.bold('Status:')} ${c.status === 'succeeded' ? i.green(c.status) : c.status === 'processing' ? i.yellow(c.status) : i.red(c.status)}
|
|
9225
9620
|
`),
|
|
9226
|
-
process.stdout.write(` ${
|
|
9621
|
+
process.stdout.write(` ${i.bold('Request ID:')} ${c.request_id}
|
|
9227
9622
|
`),
|
|
9228
9623
|
c.output && c.output.length > 0)
|
|
9229
9624
|
) {
|
|
9230
9625
|
process.stdout.write(`
|
|
9231
|
-
${
|
|
9626
|
+
${i.bold('Outputs:')}
|
|
9232
9627
|
`);
|
|
9233
9628
|
for (let p of c.output)
|
|
9234
9629
|
if (p.url) {
|
|
9235
9630
|
if (
|
|
9236
|
-
(process.stdout.write(` [${p.type.toUpperCase()}] ${
|
|
9631
|
+
(process.stdout.write(` [${p.type.toUpperCase()}] ${i.cyan(i.underline(p.url))}
|
|
9237
9632
|
`),
|
|
9238
9633
|
o)
|
|
9239
9634
|
) {
|
|
9240
|
-
let d = new
|
|
9635
|
+
let d = new T(`Downloading output to ${o}...`).start();
|
|
9241
9636
|
try {
|
|
9242
|
-
(await u.downloadOutput(p.url,
|
|
9243
|
-
d.succeed(`Saved to ${
|
|
9637
|
+
(await u.downloadOutput(p.url, Bt.default.resolve(process.cwd(), o)),
|
|
9638
|
+
d.succeed(`Saved to ${i.bold(o)}`));
|
|
9244
9639
|
} catch (m) {
|
|
9245
9640
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
9246
9641
|
}
|
|
@@ -9254,39 +9649,39 @@ ${p.text}
|
|
|
9254
9649
|
process.stdout.write(`
|
|
9255
9650
|
`);
|
|
9256
9651
|
}
|
|
9257
|
-
var
|
|
9258
|
-
|
|
9652
|
+
var Ge = _(require('node:fs')),
|
|
9653
|
+
ze = _(require('node:path'));
|
|
9259
9654
|
A();
|
|
9260
|
-
async function
|
|
9655
|
+
async function jt(e, t = {}) {
|
|
9261
9656
|
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9262
|
-
|
|
9263
|
-
|
|
9657
|
+
a = P(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9658
|
+
n = !!t.json;
|
|
9264
9659
|
(r ||
|
|
9265
|
-
(process.stderr.write(`${
|
|
9660
|
+
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9266
9661
|
`),
|
|
9267
9662
|
process.stderr
|
|
9268
|
-
.write(`Please run ${
|
|
9663
|
+
.write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
|
|
9269
9664
|
`),
|
|
9270
9665
|
process.exit(1)),
|
|
9271
9666
|
e ||
|
|
9272
|
-
(process.stderr.write(`${
|
|
9667
|
+
(process.stderr.write(`${i.red('Error:')} Missing file path.
|
|
9273
9668
|
`),
|
|
9274
|
-
process.stderr.write(`Usage: ${
|
|
9669
|
+
process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
|
|
9275
9670
|
`),
|
|
9276
9671
|
process.exit(1)));
|
|
9277
|
-
let
|
|
9278
|
-
|
|
9279
|
-
(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}
|
|
9280
9675
|
`),
|
|
9281
9676
|
process.exit(1));
|
|
9282
|
-
let o =
|
|
9283
|
-
l =
|
|
9284
|
-
c = new K(r,
|
|
9285
|
-
p = new
|
|
9286
|
-
|
|
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();
|
|
9287
9682
|
try {
|
|
9288
9683
|
let d = await c.uploadAsset(l);
|
|
9289
|
-
|
|
9684
|
+
n
|
|
9290
9685
|
? process.stdout.write(
|
|
9291
9686
|
JSON.stringify(d, null, 2) +
|
|
9292
9687
|
`
|
|
@@ -9294,13 +9689,13 @@ async function Bt(e, t = {}) {
|
|
|
9294
9689
|
)
|
|
9295
9690
|
: (p.succeed('Upload successful!'),
|
|
9296
9691
|
process.stdout.write(`
|
|
9297
|
-
${
|
|
9692
|
+
${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
9298
9693
|
`),
|
|
9299
|
-
process.stdout.write(`${
|
|
9694
|
+
process.stdout.write(`${i.dim(`Key: ${d.key}`)}
|
|
9300
9695
|
|
|
9301
9696
|
`),
|
|
9302
9697
|
process.stdout.write(`Use this CDN URL directly in your CLI runs:
|
|
9303
|
-
${
|
|
9698
|
+
${i.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
|
|
9304
9699
|
|
|
9305
9700
|
`));
|
|
9306
9701
|
} catch (d) {
|
|
@@ -9311,7 +9706,7 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
9311
9706
|
: d instanceof Error
|
|
9312
9707
|
? d.message
|
|
9313
9708
|
: String(d);
|
|
9314
|
-
(
|
|
9709
|
+
(n
|
|
9315
9710
|
? process.stdout.write(
|
|
9316
9711
|
JSON.stringify({ error: { code: m?.code ?? null, message: m?.message ?? h } }, null, 2) +
|
|
9317
9712
|
`
|
|
@@ -9322,72 +9717,72 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
9322
9717
|
}
|
|
9323
9718
|
}
|
|
9324
9719
|
W();
|
|
9325
|
-
|
|
9326
|
-
function
|
|
9720
|
+
$e();
|
|
9721
|
+
function sr() {
|
|
9327
9722
|
process.stdout.write(`
|
|
9328
|
-
${
|
|
9723
|
+
${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9329
9724
|
|
|
9330
|
-
${
|
|
9331
|
-
${
|
|
9725
|
+
${i.bold('USAGE:')}
|
|
9726
|
+
${i.cyan('tein')} <command> [arguments] [options]
|
|
9332
9727
|
|
|
9333
|
-
${
|
|
9334
|
-
${
|
|
9335
|
-
${
|
|
9336
|
-
${
|
|
9337
|
-
${
|
|
9338
|
-
${
|
|
9339
|
-
${
|
|
9340
|
-
${
|
|
9341
|
-
${
|
|
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
|
|
9342
9737
|
|
|
9343
|
-
${
|
|
9344
|
-
${
|
|
9345
|
-
${
|
|
9346
|
-
${
|
|
9347
|
-
${
|
|
9348
|
-
${
|
|
9349
|
-
${
|
|
9350
|
-
${
|
|
9351
|
-
${
|
|
9352
|
-
${
|
|
9353
|
-
${
|
|
9354
|
-
${
|
|
9355
|
-
${
|
|
9356
|
-
${
|
|
9357
|
-
${
|
|
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
|
|
9358
9753
|
|
|
9359
|
-
${
|
|
9360
|
-
${
|
|
9361
|
-
${
|
|
9754
|
+
${i.bold('EXAMPLES:')}
|
|
9755
|
+
${i.dim('# 1. Authenticate with your Tein API key')}
|
|
9756
|
+
${i.cyan('tein auth login')}
|
|
9362
9757
|
|
|
9363
|
-
${
|
|
9364
|
-
${
|
|
9758
|
+
${i.dim('# 2. List all Video models')}
|
|
9759
|
+
${i.cyan('tein models video')}
|
|
9365
9760
|
|
|
9366
|
-
${
|
|
9367
|
-
${
|
|
9368
|
-
${
|
|
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')}
|
|
9369
9764
|
|
|
9370
|
-
${
|
|
9371
|
-
${
|
|
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')}
|
|
9372
9767
|
|
|
9373
|
-
${
|
|
9374
|
-
${
|
|
9375
|
-
${
|
|
9376
|
-
${
|
|
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')}
|
|
9377
9772
|
|
|
9378
|
-
${
|
|
9379
|
-
${
|
|
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')}
|
|
9380
9775
|
|
|
9381
|
-
${
|
|
9382
|
-
${
|
|
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"')}
|
|
9383
9778
|
|
|
9384
9779
|
`);
|
|
9385
9780
|
}
|
|
9386
|
-
async function
|
|
9781
|
+
async function Da() {
|
|
9387
9782
|
let e = process.argv.slice(2),
|
|
9388
|
-
t =
|
|
9783
|
+
t = Rt(e);
|
|
9389
9784
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
9390
|
-
|
|
9785
|
+
sr();
|
|
9391
9786
|
return;
|
|
9392
9787
|
}
|
|
9393
9788
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -9414,15 +9809,15 @@ async function Ai() {
|
|
|
9414
9809
|
}
|
|
9415
9810
|
case 'models':
|
|
9416
9811
|
case 'list': {
|
|
9417
|
-
await
|
|
9812
|
+
await Vt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
9418
9813
|
break;
|
|
9419
9814
|
}
|
|
9420
9815
|
case 'pricing':
|
|
9421
9816
|
case 'prices': {
|
|
9422
9817
|
let r = t.options.model,
|
|
9423
|
-
|
|
9424
|
-
await
|
|
9425
|
-
model:
|
|
9818
|
+
a = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
9819
|
+
await Ut({
|
|
9820
|
+
model: a,
|
|
9426
9821
|
json: !!t.options.json,
|
|
9427
9822
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
9428
9823
|
});
|
|
@@ -9431,61 +9826,61 @@ async function Ai() {
|
|
|
9431
9826
|
case 'info':
|
|
9432
9827
|
case 'show': {
|
|
9433
9828
|
(t.subcommand ||
|
|
9434
|
-
(process.stderr.write(`${
|
|
9829
|
+
(process.stderr.write(`${i.red('Error:')} Missing model slug.
|
|
9435
9830
|
`),
|
|
9436
|
-
process.stderr.write(`Usage: ${
|
|
9831
|
+
process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
|
|
9437
9832
|
`),
|
|
9438
9833
|
process.exit(1)),
|
|
9439
|
-
await
|
|
9834
|
+
await Nt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
9440
9835
|
break;
|
|
9441
9836
|
}
|
|
9442
9837
|
case 'upload': {
|
|
9443
9838
|
let r = t.subcommand || '';
|
|
9444
|
-
await
|
|
9839
|
+
await jt(r, t.options);
|
|
9445
9840
|
break;
|
|
9446
9841
|
}
|
|
9447
9842
|
case 'run':
|
|
9448
9843
|
case 'generate': {
|
|
9449
9844
|
let r = t.subcommand || '';
|
|
9450
|
-
await
|
|
9845
|
+
await Ne(r, t.options);
|
|
9451
9846
|
break;
|
|
9452
9847
|
}
|
|
9453
9848
|
case 'status': {
|
|
9454
9849
|
let r = t.subcommand || '';
|
|
9455
|
-
await
|
|
9850
|
+
await Ft(r, t.options);
|
|
9456
9851
|
break;
|
|
9457
9852
|
}
|
|
9458
9853
|
case 'mcp': {
|
|
9459
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
9854
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (nr(), ir));
|
|
9460
9855
|
await r();
|
|
9461
9856
|
break;
|
|
9462
9857
|
}
|
|
9463
9858
|
default: {
|
|
9464
9859
|
if (t.command && !t.command.startsWith('-')) {
|
|
9465
|
-
(!
|
|
9860
|
+
(!F(t.command) &&
|
|
9466
9861
|
!pe[t.command] &&
|
|
9467
9862
|
(process.stderr.write(`
|
|
9468
|
-
${
|
|
9469
|
-
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.
|
|
9470
9865
|
`),
|
|
9471
9866
|
process.exit(v)),
|
|
9472
|
-
await
|
|
9867
|
+
await Ne(t.command, t.options));
|
|
9473
9868
|
return;
|
|
9474
9869
|
}
|
|
9475
|
-
|
|
9870
|
+
sr();
|
|
9476
9871
|
break;
|
|
9477
9872
|
}
|
|
9478
9873
|
}
|
|
9479
9874
|
}
|
|
9480
|
-
|
|
9875
|
+
Da().catch((e) => {
|
|
9481
9876
|
(e instanceof w &&
|
|
9482
9877
|
(process.stderr.write(`
|
|
9483
|
-
${
|
|
9878
|
+
${i.red('Error:')} ${S(e).join(`
|
|
9484
9879
|
`)}
|
|
9485
9880
|
`),
|
|
9486
9881
|
process.exit(e.exitCode)),
|
|
9487
9882
|
process.stderr.write(`
|
|
9488
|
-
${
|
|
9883
|
+
${i.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
9489
9884
|
`),
|
|
9490
9885
|
process.exit(v));
|
|
9491
9886
|
});
|