@teinai/cli 1.1.19 → 1.1.20
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 +768 -639
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
3
|
+
var sr = Object.create;
|
|
4
|
+
var ye = Object.defineProperty;
|
|
5
|
+
var nr = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var or = Object.getOwnPropertyNames;
|
|
7
|
+
var lr = Object.getPrototypeOf,
|
|
8
|
+
pr = Object.prototype.hasOwnProperty;
|
|
9
|
+
var y = (e, t, r) => () => {
|
|
10
10
|
if (r) throw r[0];
|
|
11
11
|
try {
|
|
12
12
|
return (e && (t = e((e = 0))), t);
|
|
@@ -14,94 +14,94 @@ var b = (e, t, r) => () => {
|
|
|
14
14
|
throw ((r = [i]), i);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var r in t)
|
|
17
|
+
var dr = (e, t) => {
|
|
18
|
+
for (var r in t) ye(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
cr = (e, t, r, i) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let s of
|
|
23
|
-
!
|
|
22
|
+
for (let s of or(t))
|
|
23
|
+
!pr.call(e, s) &&
|
|
24
24
|
s !== r &&
|
|
25
|
-
|
|
25
|
+
ye(e, s, { get: () => t[s], enumerable: !(i = nr(t, s)) || i.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
(r = e != null ?
|
|
30
|
-
|
|
28
|
+
var T = (e, t, r) => (
|
|
29
|
+
(r = e != null ? sr(lr(e)) : {}),
|
|
30
|
+
cr(t || !e || !e.__esModule ? ye(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function U() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if (E.default.existsSync(N)) {
|
|
35
|
+
let e = E.default.readFileSync(N, 'utf-8');
|
|
36
36
|
return JSON.parse(e);
|
|
37
37
|
}
|
|
38
38
|
} catch {}
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ke(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let r = { ...
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
E.default.existsSync(te) || E.default.mkdirSync(te, { recursive: !0, mode: 448 });
|
|
44
|
+
let r = { ...U(), ...e };
|
|
45
|
+
(E.default.writeFileSync(N, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
E.default.chmodSync(te, 448),
|
|
47
|
+
E.default.chmodSync(N, 384));
|
|
48
48
|
} catch (t) {
|
|
49
|
-
throw new Error(`Failed to save config to ${
|
|
49
|
+
throw new Error(`Failed to save config to ${N}: ${t}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function q(e) {
|
|
53
53
|
if (e && e.trim()) return e.trim();
|
|
54
54
|
let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
|
|
55
55
|
if (t && t.trim()) return t.trim();
|
|
56
|
-
let r =
|
|
56
|
+
let r = U();
|
|
57
57
|
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function P(e) {
|
|
60
60
|
if (e && e.trim()) return e.trim().replace(/\/+$/, '');
|
|
61
61
|
let t = process.env.TEIN_API_URL;
|
|
62
62
|
if (t && t.trim()) return t.trim().replace(/\/+$/, '');
|
|
63
|
-
let r =
|
|
63
|
+
let r = U();
|
|
64
64
|
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
66
|
function re() {
|
|
67
|
-
return
|
|
67
|
+
return N;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
var E,
|
|
70
|
+
Ze,
|
|
71
|
+
be,
|
|
72
72
|
te,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
N,
|
|
74
|
+
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(te =
|
|
80
|
-
(
|
|
76
|
+
((E = T(require('node:fs'))),
|
|
77
|
+
(Ze = T(require('node:os'))),
|
|
78
|
+
(be = T(require('node:path'))),
|
|
79
|
+
(te = be.default.join(Ze.default.homedir(), '.tein')),
|
|
80
|
+
(N = be.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var yr,
|
|
83
|
+
et,
|
|
84
|
+
tt,
|
|
85
|
+
rt = y(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
87
|
+
((yr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(et = [...yr, 'auto']),
|
|
89
|
+
(tt =
|
|
90
90
|
'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
|
|
91
91
|
});
|
|
92
|
-
var
|
|
93
|
-
|
|
92
|
+
var G,
|
|
93
|
+
xe = y(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
97
|
function ie(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var it = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var ae,
|
|
104
|
-
|
|
104
|
+
at = y(() => {
|
|
105
105
|
'use strict';
|
|
106
106
|
ae = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
@@ -134,7 +134,7 @@ var ae,
|
|
|
134
134
|
'seedance-2-mini',
|
|
135
135
|
],
|
|
136
136
|
},
|
|
137
|
-
{ slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro'] },
|
|
137
|
+
{ slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro', 'seedream-5-5'] },
|
|
138
138
|
{ slug: 'seed', name: 'Seed', models: ['seed-audio-1-0', 'seed-2-1-turbo'] },
|
|
139
139
|
{ slug: 'wan', name: 'Wan', models: ['wan-3-0', 'wan-3-0-prime'] },
|
|
140
140
|
{ slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
|
|
@@ -1256,6 +1256,53 @@ var ae,
|
|
|
1256
1256
|
axes: { resolution: ['1K', '2K'] },
|
|
1257
1257
|
from: { variant: '1k' },
|
|
1258
1258
|
},
|
|
1259
|
+
{
|
|
1260
|
+
slug: 'seedream-5-5',
|
|
1261
|
+
name: 'Seedream 5.5',
|
|
1262
|
+
family: 'seedream',
|
|
1263
|
+
vendor: 'ByteDance',
|
|
1264
|
+
desc: "ByteDance's newest image model: sharper realism and steadier multi-turn edits than 5.0 Pro, native transparent PNGs, and layer decomposition into a base image and up to 99 editable layers with typeset-text recognition. Creative mode available. Every input image is billed.",
|
|
1265
|
+
kind: 'image',
|
|
1266
|
+
unit: '/img',
|
|
1267
|
+
api: { model: 'seedream-5-5' },
|
|
1268
|
+
variants: [
|
|
1269
|
+
{
|
|
1270
|
+
id: '1k',
|
|
1271
|
+
price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
|
|
1272
|
+
label: '1K',
|
|
1273
|
+
resolution: '1K',
|
|
1274
|
+
unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
id: '1.5k',
|
|
1278
|
+
price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
|
|
1279
|
+
label: '1.5K',
|
|
1280
|
+
resolution: '1.5K',
|
|
1281
|
+
unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
id: '2k',
|
|
1285
|
+
price: { starter: 0.021, plus: 0.0199, scale: 0.0178 },
|
|
1286
|
+
label: '2K',
|
|
1287
|
+
resolution: '2K',
|
|
1288
|
+
unfiltered: { starter: 0.022, plus: 0.0208, scale: 0.0186 },
|
|
1289
|
+
},
|
|
1290
|
+
],
|
|
1291
|
+
unfiltered: 0.05,
|
|
1292
|
+
priority: null,
|
|
1293
|
+
draft: null,
|
|
1294
|
+
addons: [
|
|
1295
|
+
{
|
|
1296
|
+
id: 'image-input',
|
|
1297
|
+
price: { starter: 0.0048, plus: 0.0045, scale: 0.004 },
|
|
1298
|
+
label: 'Each input image',
|
|
1299
|
+
unit: '/input image',
|
|
1300
|
+
unfiltered: { starter: 0.005, plus: 0.0047, scale: 0.0042 },
|
|
1301
|
+
},
|
|
1302
|
+
],
|
|
1303
|
+
axes: { resolution: ['1K', '1.5K', '2K'] },
|
|
1304
|
+
from: { variant: '1k' },
|
|
1305
|
+
},
|
|
1259
1306
|
{
|
|
1260
1307
|
slug: 'seed-audio-1-0',
|
|
1261
1308
|
name: 'Seed Audio 1.0',
|
|
@@ -5555,11 +5602,11 @@ var ae,
|
|
|
5555
5602
|
],
|
|
5556
5603
|
};
|
|
5557
5604
|
});
|
|
5558
|
-
var
|
|
5605
|
+
var st,
|
|
5559
5606
|
se,
|
|
5560
|
-
|
|
5607
|
+
Ie = y(() => {
|
|
5561
5608
|
'use strict';
|
|
5562
|
-
((
|
|
5609
|
+
((st = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
|
|
5563
5610
|
(se = [
|
|
5564
5611
|
{
|
|
5565
5612
|
slug: 'tein-video-upscaler',
|
|
@@ -5598,10 +5645,10 @@ var it,
|
|
|
5598
5645
|
},
|
|
5599
5646
|
]));
|
|
5600
5647
|
});
|
|
5601
|
-
function
|
|
5648
|
+
function Me(e, t) {
|
|
5602
5649
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5603
5650
|
}
|
|
5604
|
-
function
|
|
5651
|
+
function wr(e, t) {
|
|
5605
5652
|
if (e === 'seedance-2-mini') return 'mini';
|
|
5606
5653
|
if (e !== 'seedance-2') return;
|
|
5607
5654
|
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -5611,86 +5658,86 @@ function br(e, t) {
|
|
|
5611
5658
|
? 'fast'
|
|
5612
5659
|
: 'standard';
|
|
5613
5660
|
}
|
|
5614
|
-
function
|
|
5661
|
+
function xr(e, t) {
|
|
5615
5662
|
let r = e
|
|
5616
5663
|
.trim()
|
|
5617
5664
|
.toLowerCase()
|
|
5618
5665
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5619
5666
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5620
|
-
let s =
|
|
5621
|
-
n =
|
|
5667
|
+
let s = wr(r, t),
|
|
5668
|
+
n = ve.get(Me('seedance-2', s));
|
|
5622
5669
|
return n ? n.slug : null;
|
|
5623
5670
|
}
|
|
5624
|
-
let i = ne.get(r) ??
|
|
5671
|
+
let i = ne.get(r) ?? ve.get(Me(r));
|
|
5625
5672
|
return i ? i.slug : null;
|
|
5626
5673
|
}
|
|
5627
|
-
function
|
|
5628
|
-
return ne.has(e) && !(
|
|
5674
|
+
function Pr(e, t) {
|
|
5675
|
+
return ne.has(e) && !(Ir.has(e) && t) ? e : xr(e, t);
|
|
5629
5676
|
}
|
|
5630
|
-
function
|
|
5631
|
-
let r =
|
|
5677
|
+
function z(e, t) {
|
|
5678
|
+
let r = Pr(e, t);
|
|
5632
5679
|
return r ? (ne.get(r) ?? null) : null;
|
|
5633
5680
|
}
|
|
5634
5681
|
function oe() {
|
|
5635
|
-
return
|
|
5682
|
+
return ot;
|
|
5636
5683
|
}
|
|
5637
|
-
var
|
|
5638
|
-
Pe,
|
|
5639
|
-
st,
|
|
5640
|
-
hr,
|
|
5641
|
-
ne,
|
|
5684
|
+
var Pe,
|
|
5642
5685
|
Te,
|
|
5643
|
-
|
|
5644
|
-
|
|
5686
|
+
ot,
|
|
5687
|
+
br,
|
|
5688
|
+
ne,
|
|
5645
5689
|
ve,
|
|
5646
|
-
|
|
5647
|
-
|
|
5690
|
+
nt,
|
|
5691
|
+
kr,
|
|
5692
|
+
_e,
|
|
5693
|
+
Ir,
|
|
5694
|
+
B = y(() => {
|
|
5648
5695
|
'use strict';
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
((
|
|
5696
|
+
it();
|
|
5697
|
+
at();
|
|
5698
|
+
Ie();
|
|
5699
|
+
((Pe = {
|
|
5653
5700
|
...ae,
|
|
5654
5701
|
families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !ie(t)) })),
|
|
5655
5702
|
models: ae.models.filter((e) => !ie(e.slug)),
|
|
5656
5703
|
}),
|
|
5657
|
-
(
|
|
5658
|
-
(
|
|
5659
|
-
(
|
|
5704
|
+
(Te = se.filter((e) => !ie(e.slug))),
|
|
5705
|
+
(ot = [...Pe.models, ...Te]),
|
|
5706
|
+
(br = Te.length ? [...Pe.families, { ...st, models: Te.map((e) => e.slug) }] : Pe.families),
|
|
5660
5707
|
(ne = new Map()),
|
|
5661
|
-
(
|
|
5662
|
-
(
|
|
5663
|
-
(
|
|
5664
|
-
(
|
|
5665
|
-
for (let e of
|
|
5666
|
-
(ne.set(e.slug, e),
|
|
5667
|
-
for (let t of e.variants)
|
|
5708
|
+
(ve = new Map()),
|
|
5709
|
+
(nt = new Map()),
|
|
5710
|
+
(kr = new Map()),
|
|
5711
|
+
(_e = new Map()));
|
|
5712
|
+
for (let e of ot) {
|
|
5713
|
+
(ne.set(e.slug, e), ve.set(Me(e.api.model, e.api.quality), e));
|
|
5714
|
+
for (let t of e.variants) nt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
5668
5715
|
for (let t of e.editVariants ?? [])
|
|
5669
|
-
|
|
5670
|
-
for (let t of e.addons ?? [])
|
|
5671
|
-
|
|
5716
|
+
nt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
5717
|
+
for (let t of e.addons ?? []) kr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
5718
|
+
_e.set(e.slug, e.family);
|
|
5672
5719
|
}
|
|
5673
|
-
for (let e of
|
|
5674
|
-
|
|
5720
|
+
for (let e of br) for (let t of e.models) _e.has(t) || _e.set(t, e.slug);
|
|
5721
|
+
Ir = new Set(['seedance-2']);
|
|
5675
5722
|
});
|
|
5676
5723
|
function le(e) {
|
|
5677
5724
|
let t = e.from?.variant;
|
|
5678
5725
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
5679
5726
|
}
|
|
5680
|
-
function
|
|
5727
|
+
function Ke(e) {
|
|
5681
5728
|
if (e.endpoints?.length)
|
|
5682
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
5683
|
-
?
|
|
5729
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === lt)
|
|
5730
|
+
? lt
|
|
5684
5731
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
5685
5732
|
}
|
|
5686
|
-
var
|
|
5687
|
-
|
|
5733
|
+
var lt,
|
|
5734
|
+
Se = y(() => {
|
|
5688
5735
|
'use strict';
|
|
5689
|
-
|
|
5690
|
-
|
|
5736
|
+
B();
|
|
5737
|
+
lt = 'dynamic';
|
|
5691
5738
|
});
|
|
5692
5739
|
var pe,
|
|
5693
|
-
|
|
5740
|
+
qe = y(() => {
|
|
5694
5741
|
'use strict';
|
|
5695
5742
|
pe = {
|
|
5696
5743
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -5702,29 +5749,29 @@ var pe,
|
|
|
5702
5749
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
5703
5750
|
};
|
|
5704
5751
|
});
|
|
5705
|
-
var
|
|
5752
|
+
var pt = y(() => {
|
|
5706
5753
|
'use strict';
|
|
5707
5754
|
});
|
|
5708
|
-
function
|
|
5709
|
-
return typeof t == 'string' && (
|
|
5755
|
+
function dt(e, t) {
|
|
5756
|
+
return typeof t == 'string' && (Tr[e]?.includes(t) ?? !1);
|
|
5710
5757
|
}
|
|
5711
|
-
var
|
|
5712
|
-
|
|
5758
|
+
var Tr,
|
|
5759
|
+
ct = y(() => {
|
|
5713
5760
|
'use strict';
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5761
|
+
B();
|
|
5762
|
+
Se();
|
|
5763
|
+
pt();
|
|
5764
|
+
Tr = {};
|
|
5718
5765
|
});
|
|
5719
|
-
function
|
|
5720
|
-
return e === 'nano-banana-pro' ?
|
|
5766
|
+
function ut(e) {
|
|
5767
|
+
return e === 'nano-banana-pro' ? vr : _r;
|
|
5721
5768
|
}
|
|
5722
|
-
var
|
|
5723
|
-
|
|
5724
|
-
|
|
5769
|
+
var vr,
|
|
5770
|
+
_r,
|
|
5771
|
+
mt = y(() => {
|
|
5725
5772
|
'use strict';
|
|
5726
|
-
((
|
|
5727
|
-
(
|
|
5773
|
+
((vr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
5774
|
+
(_r = [
|
|
5728
5775
|
'auto',
|
|
5729
5776
|
'1:1',
|
|
5730
5777
|
'1:4',
|
|
@@ -5742,10 +5789,10 @@ var Pr,
|
|
|
5742
5789
|
'21:9',
|
|
5743
5790
|
]));
|
|
5744
5791
|
});
|
|
5745
|
-
var
|
|
5746
|
-
|
|
5792
|
+
var ft,
|
|
5793
|
+
gt = y(() => {
|
|
5747
5794
|
'use strict';
|
|
5748
|
-
|
|
5795
|
+
ft = [
|
|
5749
5796
|
'prompt',
|
|
5750
5797
|
'system',
|
|
5751
5798
|
'messages',
|
|
@@ -5759,10 +5806,10 @@ var ut,
|
|
|
5759
5806
|
'endpoint',
|
|
5760
5807
|
];
|
|
5761
5808
|
});
|
|
5762
|
-
var
|
|
5763
|
-
|
|
5809
|
+
var ht,
|
|
5810
|
+
yt = y(() => {
|
|
5764
5811
|
'use strict';
|
|
5765
|
-
|
|
5812
|
+
ht = [
|
|
5766
5813
|
{
|
|
5767
5814
|
slug: 'claude-fable-5-1',
|
|
5768
5815
|
family: 'fable-5-1',
|
|
@@ -5831,13 +5878,13 @@ var ft,
|
|
|
5831
5878
|
},
|
|
5832
5879
|
];
|
|
5833
5880
|
});
|
|
5834
|
-
function
|
|
5881
|
+
function bt(e) {
|
|
5835
5882
|
return `$${e}`;
|
|
5836
5883
|
}
|
|
5837
|
-
function
|
|
5838
|
-
return
|
|
5884
|
+
function $e(e, t, r) {
|
|
5885
|
+
return z(e)?.variants.find((s) => s.endpoint === t && s.component === r)?.price.starter ?? null;
|
|
5839
5886
|
}
|
|
5840
|
-
function
|
|
5887
|
+
function Mr(e) {
|
|
5841
5888
|
return [
|
|
5842
5889
|
{
|
|
5843
5890
|
name: 'prompt',
|
|
@@ -5903,13 +5950,13 @@ function vr(e) {
|
|
|
5903
5950
|
},
|
|
5904
5951
|
];
|
|
5905
5952
|
}
|
|
5906
|
-
function
|
|
5953
|
+
function kt() {
|
|
5907
5954
|
return Object.fromEntries(
|
|
5908
|
-
|
|
5909
|
-
let t =
|
|
5910
|
-
r =
|
|
5911
|
-
i =
|
|
5912
|
-
s = t != null && r != null ? `${
|
|
5955
|
+
ht.map((e) => {
|
|
5956
|
+
let t = $e(e.slug, 'cheap', 'input'),
|
|
5957
|
+
r = $e(e.slug, 'cheap', 'output'),
|
|
5958
|
+
i = $e(e.slug, 'stable', 'input') != null,
|
|
5959
|
+
s = t != null && r != null ? `${bt(t)}/M in \xB7 ${bt(r)}/M out` : '',
|
|
5913
5960
|
n = {
|
|
5914
5961
|
slug: e.slug,
|
|
5915
5962
|
name: e.name,
|
|
@@ -5920,36 +5967,37 @@ function yt() {
|
|
|
5920
5967
|
priceFormatted: s,
|
|
5921
5968
|
unit: '/M tokens',
|
|
5922
5969
|
primaryToolName: 'run_task',
|
|
5923
|
-
parameters:
|
|
5970
|
+
parameters: Mr(i),
|
|
5924
5971
|
};
|
|
5925
5972
|
return [e.slug, n];
|
|
5926
5973
|
}),
|
|
5927
5974
|
);
|
|
5928
5975
|
}
|
|
5929
|
-
var
|
|
5976
|
+
var wt = y(() => {
|
|
5930
5977
|
'use strict';
|
|
5931
|
-
|
|
5932
|
-
|
|
5978
|
+
yt();
|
|
5979
|
+
B();
|
|
5933
5980
|
});
|
|
5934
|
-
var
|
|
5981
|
+
var J,
|
|
5935
5982
|
de,
|
|
5936
|
-
|
|
5983
|
+
Ce = y(() => {
|
|
5937
5984
|
'use strict';
|
|
5938
|
-
((
|
|
5985
|
+
((J = [
|
|
5939
5986
|
'seedance-2-5',
|
|
5940
5987
|
'seedance-2',
|
|
5941
5988
|
'seedance-2-mini',
|
|
5942
5989
|
'seedream-5-pro',
|
|
5990
|
+
'seedream-5-5',
|
|
5943
5991
|
'wan-3-0',
|
|
5944
5992
|
'z-image-pro',
|
|
5945
5993
|
]),
|
|
5946
5994
|
(de =
|
|
5947
5995
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
5948
5996
|
});
|
|
5949
|
-
function
|
|
5997
|
+
function H(e) {
|
|
5950
5998
|
return `$${Number(e.toFixed(5))}`;
|
|
5951
5999
|
}
|
|
5952
|
-
function
|
|
6000
|
+
function $r(e) {
|
|
5953
6001
|
if (e.kind === 'llm') {
|
|
5954
6002
|
let t = e.defaultEndpoint,
|
|
5955
6003
|
r = (n) =>
|
|
@@ -5962,23 +6010,23 @@ function Sr(e) {
|
|
|
5962
6010
|
i = r('input'),
|
|
5963
6011
|
s = r('output');
|
|
5964
6012
|
return i && s
|
|
5965
|
-
? `${
|
|
5966
|
-
: `from ${
|
|
6013
|
+
? `${H(i.price.starter)}/M in \xB7 ${H(s.price.starter)}/M out`
|
|
6014
|
+
: `from ${H(le(e).price.starter)}/M tokens`;
|
|
5967
6015
|
}
|
|
5968
|
-
return `from ${
|
|
6016
|
+
return `from ${H(le(e).price.starter)}${e.unit}`;
|
|
5969
6017
|
}
|
|
5970
|
-
function
|
|
6018
|
+
function Cr(e, t) {
|
|
5971
6019
|
let r = t.filter((i) => Number.isFinite(i) && i > 0);
|
|
5972
|
-
return r.length ? `from ${
|
|
6020
|
+
return r.length ? `from ${H(Math.min(...r))}${e}` : null;
|
|
5973
6021
|
}
|
|
5974
|
-
function
|
|
5975
|
-
for (let t of
|
|
6022
|
+
function vt(e) {
|
|
6023
|
+
for (let t of G) {
|
|
5976
6024
|
let r = ue[t],
|
|
5977
|
-
i = r ?
|
|
6025
|
+
i = r ? Cr(r.unit, e[t] ?? []) : null;
|
|
5978
6026
|
r && i && (r.priceFormatted = i);
|
|
5979
6027
|
}
|
|
5980
6028
|
}
|
|
5981
|
-
function
|
|
6029
|
+
function O(e, t) {
|
|
5982
6030
|
let r = e.axes?.resolution ?? [
|
|
5983
6031
|
...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
|
|
5984
6032
|
];
|
|
@@ -5990,13 +6038,13 @@ function R(e, t) {
|
|
|
5990
6038
|
...(t ? { description: t } : {}),
|
|
5991
6039
|
};
|
|
5992
6040
|
}
|
|
5993
|
-
function
|
|
6041
|
+
function _t(e) {
|
|
5994
6042
|
if (!e.endpoints?.length) return null;
|
|
5995
|
-
let t = e.endpoints.filter((r) =>
|
|
6043
|
+
let t = e.endpoints.filter((r) => dt(e.slug, r.id));
|
|
5996
6044
|
return {
|
|
5997
6045
|
name: 'endpoint',
|
|
5998
6046
|
type: 'select',
|
|
5999
|
-
default:
|
|
6047
|
+
default: Ke(e),
|
|
6000
6048
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6001
6049
|
description:
|
|
6002
6050
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6005,20 +6053,20 @@ function Tt(e) {
|
|
|
6005
6053
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
6006
6054
|
};
|
|
6007
6055
|
}
|
|
6008
|
-
function
|
|
6056
|
+
function Or(e, t) {
|
|
6009
6057
|
if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
|
|
6010
|
-
let r =
|
|
6011
|
-
return [...t.filter((i) => !
|
|
6058
|
+
let r = J.includes(e.api.model);
|
|
6059
|
+
return [...t.filter((i) => !Re.has(i.name)), r ? Mt : Er];
|
|
6012
6060
|
}
|
|
6013
|
-
function
|
|
6014
|
-
let r = e.filter((s) => !
|
|
6015
|
-
i = [
|
|
6016
|
-
return (i.push(
|
|
6061
|
+
function Ee(e, t) {
|
|
6062
|
+
let r = e.filter((s) => !Re.has(s.name)),
|
|
6063
|
+
i = [Mt, Ar];
|
|
6064
|
+
return (i.push(Kt, St), [...r, ...i]);
|
|
6017
6065
|
}
|
|
6018
|
-
function
|
|
6066
|
+
function xt(e, t = {}) {
|
|
6019
6067
|
return [
|
|
6020
6068
|
...e
|
|
6021
|
-
.filter((r) => !
|
|
6069
|
+
.filter((r) => !Rr.has(r.name) && !Re.has(r.name))
|
|
6022
6070
|
.map((r) =>
|
|
6023
6071
|
r.name === 'prompt'
|
|
6024
6072
|
? { ...r, required: !0 }
|
|
@@ -6039,13 +6087,13 @@ function kt(e, t = {}) {
|
|
|
6039
6087
|
options: ['standard'],
|
|
6040
6088
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
6041
6089
|
},
|
|
6042
|
-
|
|
6043
|
-
|
|
6090
|
+
Kt,
|
|
6091
|
+
St,
|
|
6044
6092
|
];
|
|
6045
6093
|
}
|
|
6046
|
-
function
|
|
6094
|
+
function Ae(e, t) {
|
|
6047
6095
|
return [
|
|
6048
|
-
|
|
6096
|
+
M('Text prompt describing the video.'),
|
|
6049
6097
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
6050
6098
|
{
|
|
6051
6099
|
name: 'duration',
|
|
@@ -6055,7 +6103,7 @@ function Ee(e, t) {
|
|
|
6055
6103
|
max: t.maxSec,
|
|
6056
6104
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
6057
6105
|
},
|
|
6058
|
-
|
|
6106
|
+
O(e),
|
|
6059
6107
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
6060
6108
|
...t.references.map((r) =>
|
|
6061
6109
|
r.endsWith('s')
|
|
@@ -6072,10 +6120,10 @@ function Ee(e, t) {
|
|
|
6072
6120
|
),
|
|
6073
6121
|
];
|
|
6074
6122
|
}
|
|
6075
|
-
function
|
|
6076
|
-
let t =
|
|
6123
|
+
function Dr(e) {
|
|
6124
|
+
let t = _t(e);
|
|
6077
6125
|
return [
|
|
6078
|
-
|
|
6126
|
+
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
6079
6127
|
...(t ? [t] : []),
|
|
6080
6128
|
{
|
|
6081
6129
|
name: 'quality',
|
|
@@ -6083,17 +6131,17 @@ function Or(e) {
|
|
|
6083
6131
|
default: 'low',
|
|
6084
6132
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
6085
6133
|
},
|
|
6086
|
-
|
|
6134
|
+
O(
|
|
6087
6135
|
e,
|
|
6088
6136
|
e.slug === 'gpt-image-2'
|
|
6089
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
6137
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${tt}`
|
|
6090
6138
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6091
6139
|
),
|
|
6092
6140
|
{
|
|
6093
6141
|
name: 'aspect_ratio',
|
|
6094
6142
|
type: 'select',
|
|
6095
6143
|
default: 'auto',
|
|
6096
|
-
options: [...
|
|
6144
|
+
options: [...et],
|
|
6097
6145
|
description:
|
|
6098
6146
|
"The frame. auto: an edit keeps its first input image's ratio (the nearest listed one), text to image is 1:1. The image is delivered at exactly the size for the ratio and resolution.",
|
|
6099
6147
|
},
|
|
@@ -6140,16 +6188,16 @@ function Or(e) {
|
|
|
6140
6188
|
},
|
|
6141
6189
|
];
|
|
6142
6190
|
}
|
|
6143
|
-
function
|
|
6191
|
+
function Lr(e) {
|
|
6144
6192
|
return [
|
|
6145
|
-
|
|
6193
|
+
M('Image prompt text.'),
|
|
6146
6194
|
{
|
|
6147
6195
|
name: 'input_images',
|
|
6148
6196
|
type: 'string[]',
|
|
6149
6197
|
description: 'Images to edit or use as reference (up to 14).',
|
|
6150
6198
|
},
|
|
6151
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
6152
|
-
|
|
6199
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...ut(e.slug)] },
|
|
6200
|
+
O(e),
|
|
6153
6201
|
{
|
|
6154
6202
|
name: 'n',
|
|
6155
6203
|
type: 'slider',
|
|
@@ -6174,10 +6222,10 @@ function Rr(e) {
|
|
|
6174
6222
|
},
|
|
6175
6223
|
];
|
|
6176
6224
|
}
|
|
6177
|
-
function
|
|
6178
|
-
let e =
|
|
6225
|
+
function Br() {
|
|
6226
|
+
let e = ft,
|
|
6179
6227
|
t = [];
|
|
6180
|
-
for (let r of
|
|
6228
|
+
for (let r of De(!0))
|
|
6181
6229
|
e.includes(r.name) &&
|
|
6182
6230
|
(t.push({
|
|
6183
6231
|
...r,
|
|
@@ -6199,14 +6247,14 @@ function Nr() {
|
|
|
6199
6247
|
}));
|
|
6200
6248
|
return t;
|
|
6201
6249
|
}
|
|
6202
|
-
function
|
|
6203
|
-
return
|
|
6250
|
+
function jr() {
|
|
6251
|
+
return De(!0).map((e) =>
|
|
6204
6252
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6205
6253
|
);
|
|
6206
6254
|
}
|
|
6207
|
-
function
|
|
6255
|
+
function De(e) {
|
|
6208
6256
|
return [
|
|
6209
|
-
|
|
6257
|
+
M('The user message or task.'),
|
|
6210
6258
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
6211
6259
|
{
|
|
6212
6260
|
name: 'messages',
|
|
@@ -6299,21 +6347,21 @@ function Re(e) {
|
|
|
6299
6347
|
},
|
|
6300
6348
|
];
|
|
6301
6349
|
}
|
|
6302
|
-
function
|
|
6303
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6304
|
-
let t =
|
|
6350
|
+
function Fr(e) {
|
|
6351
|
+
if (e.slug === 'seed-2-1-turbo') return Nr;
|
|
6352
|
+
let t = _t(e);
|
|
6305
6353
|
return [
|
|
6306
6354
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
6307
|
-
?
|
|
6355
|
+
? Br()
|
|
6308
6356
|
: e.slug === 'gemini-3.7-flash'
|
|
6309
|
-
?
|
|
6310
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6311
|
-
?
|
|
6312
|
-
:
|
|
6357
|
+
? jr()
|
|
6358
|
+
: e.slug === 'gpt-6-astra' || Ur.includes(e.slug)
|
|
6359
|
+
? De(e.slug !== 'gpt-6-astra')
|
|
6360
|
+
: Vr),
|
|
6313
6361
|
...(t ? [t] : []),
|
|
6314
6362
|
];
|
|
6315
6363
|
}
|
|
6316
|
-
function
|
|
6364
|
+
function Gr(e) {
|
|
6317
6365
|
return [
|
|
6318
6366
|
{
|
|
6319
6367
|
name: 'video_url',
|
|
@@ -6322,7 +6370,7 @@ function Fr(e) {
|
|
|
6322
6370
|
description:
|
|
6323
6371
|
'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
|
|
6324
6372
|
},
|
|
6325
|
-
|
|
6373
|
+
O(
|
|
6326
6374
|
e,
|
|
6327
6375
|
'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
|
|
6328
6376
|
),
|
|
@@ -6335,31 +6383,31 @@ function Fr(e) {
|
|
|
6335
6383
|
},
|
|
6336
6384
|
];
|
|
6337
6385
|
}
|
|
6338
|
-
function
|
|
6386
|
+
function zr(e) {
|
|
6339
6387
|
let t = e.slug;
|
|
6340
|
-
if (se.some((r) => r.slug === t)) return
|
|
6341
|
-
if (e.kind === 'llm') return
|
|
6342
|
-
if (e.editVariants?.length) return
|
|
6388
|
+
if (se.some((r) => r.slug === t)) return Gr(e);
|
|
6389
|
+
if (e.kind === 'llm') return Fr(e);
|
|
6390
|
+
if (e.editVariants?.length) return Dr(e);
|
|
6343
6391
|
switch (t) {
|
|
6344
6392
|
case 'seedance-2-5':
|
|
6345
|
-
return
|
|
6393
|
+
return Ee(It, t);
|
|
6346
6394
|
case 'seedance-2-5-lite':
|
|
6347
|
-
return
|
|
6395
|
+
return xt(It, { no4k: !0 });
|
|
6348
6396
|
case 'seedance-2':
|
|
6349
|
-
return
|
|
6397
|
+
return Ee(Pt, t);
|
|
6350
6398
|
case 'seedance-2-lite':
|
|
6351
|
-
return
|
|
6399
|
+
return xt(Pt);
|
|
6352
6400
|
case 'seedance-2-mini':
|
|
6353
|
-
return
|
|
6401
|
+
return Ee(Jr, t);
|
|
6354
6402
|
case 'nano-banana-2':
|
|
6355
6403
|
case 'nano-banana-2.1':
|
|
6356
6404
|
case 'nano-banana-pro':
|
|
6357
|
-
return
|
|
6405
|
+
return Lr(e);
|
|
6358
6406
|
case 'seedream-5-pro':
|
|
6359
6407
|
return [
|
|
6360
|
-
|
|
6408
|
+
M('Detailed description of the image to generate.'),
|
|
6361
6409
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
6362
|
-
|
|
6410
|
+
O(e),
|
|
6363
6411
|
{
|
|
6364
6412
|
name: 'aspect_ratio',
|
|
6365
6413
|
type: 'select',
|
|
@@ -6368,16 +6416,72 @@ function jr(e) {
|
|
|
6368
6416
|
},
|
|
6369
6417
|
{ name: 'output_format', type: 'select', default: 'jpeg', options: ['jpeg', 'png'] },
|
|
6370
6418
|
];
|
|
6419
|
+
case 'seedream-5-5':
|
|
6420
|
+
return [
|
|
6421
|
+
{
|
|
6422
|
+
name: 'mode',
|
|
6423
|
+
type: 'select',
|
|
6424
|
+
default: 'text_to_image',
|
|
6425
|
+
options: ['text_to_image', 'image_to_image', 'layer_decomposition'],
|
|
6426
|
+
description:
|
|
6427
|
+
'text_to_image, image_to_image (up to 10 reference images) or layer_decomposition (split one image into a base image and editable transparent layers).',
|
|
6428
|
+
},
|
|
6429
|
+
M(
|
|
6430
|
+
'What to make or change. Optional for layer_decomposition, where it can say how to split the image (for example "keep the logo as one layer").',
|
|
6431
|
+
),
|
|
6432
|
+
{
|
|
6433
|
+
name: 'images',
|
|
6434
|
+
type: 'string[]',
|
|
6435
|
+
description:
|
|
6436
|
+
'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
|
|
6437
|
+
},
|
|
6438
|
+
O(
|
|
6439
|
+
e,
|
|
6440
|
+
'1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
|
|
6441
|
+
),
|
|
6442
|
+
{
|
|
6443
|
+
name: 'aspect_ratio',
|
|
6444
|
+
type: 'select',
|
|
6445
|
+
default: '1:1',
|
|
6446
|
+
options: ['1:1', '4:3', '3:4', '16:9', '9:16', '3:2', '2:3', '21:9', 'adaptive'],
|
|
6447
|
+
description: 'Not used by layer_decomposition. adaptive lets the prompt pick the shape.',
|
|
6448
|
+
},
|
|
6449
|
+
{
|
|
6450
|
+
name: 'background',
|
|
6451
|
+
type: 'select',
|
|
6452
|
+
default: 'auto',
|
|
6453
|
+
options: ['auto', 'transparent', 'opaque'],
|
|
6454
|
+
description:
|
|
6455
|
+
'transparent makes a PNG with an alpha channel (needs output_format png). auto decides from the prompt. Not used by layer_decomposition.',
|
|
6456
|
+
},
|
|
6457
|
+
{ name: 'output_format', type: 'select', default: 'png', options: ['png', 'jpeg'] },
|
|
6458
|
+
{
|
|
6459
|
+
name: 'max_layers',
|
|
6460
|
+
type: 'slider',
|
|
6461
|
+
default: 30,
|
|
6462
|
+
min: 2,
|
|
6463
|
+
max: 100,
|
|
6464
|
+
description:
|
|
6465
|
+
'layer_decomposition only: most images to return, the base image included. Held for this many; you pay for the layers made.',
|
|
6466
|
+
},
|
|
6467
|
+
{
|
|
6468
|
+
name: 'text_recognition',
|
|
6469
|
+
type: 'boolean',
|
|
6470
|
+
default: !1,
|
|
6471
|
+
description:
|
|
6472
|
+
'layer_decomposition only: return the text, lines, font and style of each typeset text layer (layer.text_recognition).',
|
|
6473
|
+
},
|
|
6474
|
+
];
|
|
6371
6475
|
case 'qwen-3':
|
|
6372
6476
|
case 'qwen-3-pro':
|
|
6373
6477
|
return [
|
|
6374
|
-
|
|
6478
|
+
M('Image prompt text; dense layouts and multilingual text work well.'),
|
|
6375
6479
|
{
|
|
6376
6480
|
name: 'images',
|
|
6377
6481
|
type: 'string[]',
|
|
6378
6482
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
6379
6483
|
},
|
|
6380
|
-
|
|
6484
|
+
O(e),
|
|
6381
6485
|
{
|
|
6382
6486
|
name: 'aspect_ratio',
|
|
6383
6487
|
type: 'select',
|
|
@@ -6395,8 +6499,8 @@ function jr(e) {
|
|
|
6395
6499
|
];
|
|
6396
6500
|
case 'z-image-pro':
|
|
6397
6501
|
return [
|
|
6398
|
-
|
|
6399
|
-
|
|
6502
|
+
M('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
6503
|
+
O(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
6400
6504
|
{
|
|
6401
6505
|
name: 'aspect_ratio',
|
|
6402
6506
|
type: 'select',
|
|
@@ -6449,7 +6553,7 @@ function jr(e) {
|
|
|
6449
6553
|
];
|
|
6450
6554
|
case 'wan-3-0':
|
|
6451
6555
|
case 'wan-3-0-prime':
|
|
6452
|
-
return
|
|
6556
|
+
return Ae(e, {
|
|
6453
6557
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6454
6558
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
6455
6559
|
minSec: 2,
|
|
@@ -6459,7 +6563,7 @@ function jr(e) {
|
|
|
6459
6563
|
});
|
|
6460
6564
|
case 'happy-horse-1-1':
|
|
6461
6565
|
case 'happy-horse-1-0':
|
|
6462
|
-
return
|
|
6566
|
+
return Ae(e, {
|
|
6463
6567
|
modes:
|
|
6464
6568
|
t === 'happy-horse-1-0'
|
|
6465
6569
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -6470,7 +6574,7 @@ function jr(e) {
|
|
|
6470
6574
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
6471
6575
|
});
|
|
6472
6576
|
case 'minimax-h3':
|
|
6473
|
-
return
|
|
6577
|
+
return Ae(e, {
|
|
6474
6578
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6475
6579
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
6476
6580
|
minSec: 4,
|
|
@@ -6478,159 +6582,159 @@ function jr(e) {
|
|
|
6478
6582
|
references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
|
|
6479
6583
|
});
|
|
6480
6584
|
default:
|
|
6481
|
-
return [
|
|
6585
|
+
return [M('Prompt text.')];
|
|
6482
6586
|
}
|
|
6483
6587
|
}
|
|
6484
|
-
function
|
|
6588
|
+
function Oe(e, t = e.api.model) {
|
|
6485
6589
|
return {
|
|
6486
6590
|
slug: t,
|
|
6487
6591
|
name: e.name,
|
|
6488
|
-
category:
|
|
6489
|
-
kind:
|
|
6592
|
+
category: Kr[e.kind],
|
|
6593
|
+
kind: qr[e.kind],
|
|
6490
6594
|
vendor: e.vendor ?? '',
|
|
6491
6595
|
description: e.desc ?? e.name,
|
|
6492
|
-
priceFormatted:
|
|
6596
|
+
priceFormatted: $r(e),
|
|
6493
6597
|
unit: e.unit,
|
|
6494
|
-
primaryToolName:
|
|
6495
|
-
parameters:
|
|
6598
|
+
primaryToolName: Sr[e.kind],
|
|
6599
|
+
parameters: Or(e, zr(e)),
|
|
6496
6600
|
};
|
|
6497
6601
|
}
|
|
6498
|
-
function
|
|
6602
|
+
function Hr() {
|
|
6499
6603
|
let e = {};
|
|
6500
6604
|
for (let t of oe())
|
|
6501
6605
|
if (t.slug !== 'seedance-2-fast') {
|
|
6502
6606
|
if (t.slug === 'seedance-2-mini') {
|
|
6503
|
-
e['seedance-2-mini'] =
|
|
6607
|
+
e['seedance-2-mini'] = Oe(t, 'seedance-2-mini');
|
|
6504
6608
|
continue;
|
|
6505
6609
|
}
|
|
6506
6610
|
if (t.slug === 'seedance-2') {
|
|
6507
|
-
let r =
|
|
6611
|
+
let r = Oe(t);
|
|
6508
6612
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
6509
6613
|
(e['seedance-2'] = r));
|
|
6510
6614
|
continue;
|
|
6511
6615
|
}
|
|
6512
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
6616
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Oe(t));
|
|
6513
6617
|
}
|
|
6514
|
-
Object.assign(e,
|
|
6618
|
+
Object.assign(e, kt());
|
|
6515
6619
|
for (let [t, r] of Object.entries(pe))
|
|
6516
6620
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
6517
6621
|
return e;
|
|
6518
6622
|
}
|
|
6519
|
-
function
|
|
6623
|
+
function j(e) {
|
|
6520
6624
|
return ue[e] ?? null;
|
|
6521
6625
|
}
|
|
6522
|
-
function
|
|
6626
|
+
function Wr(e, t, r) {
|
|
6523
6627
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
6524
6628
|
let i = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
6525
6629
|
if (i(r.mode) === 'edit' || i(r.omni_reference_task_type) === 'edit') return !1;
|
|
6526
6630
|
}
|
|
6527
6631
|
return !(
|
|
6528
|
-
(t === 'max_tokens' &&
|
|
6529
|
-
(t === 'max_completion_tokens' &&
|
|
6632
|
+
(t === 'max_tokens' && Tt(r.max_completion_tokens)) ||
|
|
6633
|
+
(t === 'max_completion_tokens' && Tt(r.max_tokens))
|
|
6530
6634
|
);
|
|
6531
6635
|
}
|
|
6532
|
-
function
|
|
6636
|
+
function Tt(e) {
|
|
6533
6637
|
return e != null && e !== '';
|
|
6534
6638
|
}
|
|
6535
|
-
function
|
|
6639
|
+
function Ct(e, t) {
|
|
6536
6640
|
let r = { ...t };
|
|
6537
6641
|
if (e?.slug === 'seedance-2-5') {
|
|
6538
6642
|
let i = (s) => typeof s != 'string' || !s.trim();
|
|
6539
|
-
for (let s of
|
|
6643
|
+
for (let s of Yr) (i(r.finalize) && !i(r[s]) && (r.finalize = r[s]), delete r[s]);
|
|
6540
6644
|
if (!i(r.finalize)) return r;
|
|
6541
6645
|
}
|
|
6542
6646
|
for (let i of e?.parameters ?? [])
|
|
6543
6647
|
i.default !== void 0 &&
|
|
6544
6648
|
r[i.name] === void 0 &&
|
|
6545
|
-
|
|
6649
|
+
Wr(e.slug, i.name, t) &&
|
|
6546
6650
|
(r[i.name] = i.default);
|
|
6547
6651
|
return r;
|
|
6548
6652
|
}
|
|
6549
|
-
function
|
|
6653
|
+
function R() {
|
|
6550
6654
|
return Object.values(ue);
|
|
6551
6655
|
}
|
|
6552
|
-
var
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
vt,
|
|
6557
|
-
$r,
|
|
6558
|
-
Cr,
|
|
6559
|
-
_t,
|
|
6656
|
+
var Kr,
|
|
6657
|
+
Sr,
|
|
6658
|
+
qr,
|
|
6659
|
+
M,
|
|
6560
6660
|
Mt,
|
|
6561
|
-
|
|
6661
|
+
Er,
|
|
6562
6662
|
Ar,
|
|
6563
|
-
Dr,
|
|
6564
|
-
Lr,
|
|
6565
|
-
Vr,
|
|
6566
|
-
ce,
|
|
6567
|
-
wt,
|
|
6568
6663
|
Kt,
|
|
6569
6664
|
St,
|
|
6570
|
-
|
|
6571
|
-
|
|
6665
|
+
Re,
|
|
6666
|
+
Rr,
|
|
6667
|
+
Vr,
|
|
6668
|
+
Nr,
|
|
6669
|
+
Ur,
|
|
6670
|
+
ce,
|
|
6671
|
+
It,
|
|
6672
|
+
qt,
|
|
6673
|
+
$t,
|
|
6674
|
+
Pt,
|
|
6675
|
+
Jr,
|
|
6572
6676
|
ue,
|
|
6573
|
-
|
|
6574
|
-
|
|
6677
|
+
Yr,
|
|
6678
|
+
W = y(() => {
|
|
6575
6679
|
'use strict';
|
|
6576
|
-
|
|
6577
|
-
we();
|
|
6578
|
-
N();
|
|
6579
|
-
Ke();
|
|
6680
|
+
rt();
|
|
6580
6681
|
xe();
|
|
6682
|
+
B();
|
|
6581
6683
|
Se();
|
|
6582
|
-
|
|
6684
|
+
Ie();
|
|
6685
|
+
qe();
|
|
6583
6686
|
ct();
|
|
6584
6687
|
mt();
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
(
|
|
6588
|
-
|
|
6688
|
+
gt();
|
|
6689
|
+
wt();
|
|
6690
|
+
Ce();
|
|
6691
|
+
((Kr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
6692
|
+
(Sr = {
|
|
6589
6693
|
video: 'generate_video',
|
|
6590
6694
|
image: 'generate_image',
|
|
6591
6695
|
audio: 'generate_audio',
|
|
6592
6696
|
llm: 'run_task',
|
|
6593
6697
|
}),
|
|
6594
|
-
(
|
|
6698
|
+
(qr = {
|
|
6595
6699
|
video: 'Text-to-Video',
|
|
6596
6700
|
image: 'Text-to-Image',
|
|
6597
6701
|
audio: 'Text-to-Audio',
|
|
6598
6702
|
llm: 'Reasoning (LLM)',
|
|
6599
6703
|
}));
|
|
6600
|
-
|
|
6601
|
-
((
|
|
6704
|
+
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
6705
|
+
((Mt = {
|
|
6602
6706
|
name: 'creative_mode',
|
|
6603
6707
|
type: 'boolean',
|
|
6604
6708
|
default: !1,
|
|
6605
6709
|
description:
|
|
6606
6710
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
6607
6711
|
}),
|
|
6608
|
-
(
|
|
6712
|
+
(Er = {
|
|
6609
6713
|
name: 'creative_mode',
|
|
6610
6714
|
type: 'boolean',
|
|
6611
6715
|
default: !1,
|
|
6612
6716
|
description: `Not available yet on this model: ${de}.`,
|
|
6613
6717
|
}),
|
|
6614
|
-
(
|
|
6718
|
+
(Ar = {
|
|
6615
6719
|
name: 'priority',
|
|
6616
6720
|
type: 'boolean',
|
|
6617
6721
|
default: !1,
|
|
6618
6722
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
6619
6723
|
}),
|
|
6620
|
-
(
|
|
6724
|
+
(Kt = {
|
|
6621
6725
|
name: 'reference_roles',
|
|
6622
6726
|
type: 'json',
|
|
6623
6727
|
description: `Omni Reference only. Role of each reference, by tag { "@Image1": "prop" } or by kind { "image": ["prop"] }. Image: appearance, clothing, prop, scene_layout, lighting, first_frame, last_frame; Seedance 2.5 also keyframe, storyboard. Video: motion, camera, style; Seedance 2.5 also blockout_coarse, blockout_fine. Audio: voice, ambience, music, sound_effect. On a tag, the value image, video or audio uses that kind's default (appearance, motion, voice).`,
|
|
6624
6728
|
}),
|
|
6625
|
-
(
|
|
6729
|
+
(St = {
|
|
6626
6730
|
name: 'auto_fit_images',
|
|
6627
6731
|
type: 'boolean',
|
|
6628
6732
|
default: !1,
|
|
6629
6733
|
description:
|
|
6630
6734
|
'Fits a reference image whose aspect ratio (width / height) is outside 0.40-2.50 just inside it: a slight stretch, or the image on a blurred copy of itself, never cropped. Off: such an image is refused with a 422. First and last frames are never changed. Same price.',
|
|
6631
6735
|
}),
|
|
6632
|
-
(
|
|
6633
|
-
|
|
6736
|
+
(Re = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
6737
|
+
Rr = new Set([
|
|
6634
6738
|
'quality',
|
|
6635
6739
|
'bitrate_mode',
|
|
6636
6740
|
'draft',
|
|
@@ -6639,8 +6743,8 @@ var _r,
|
|
|
6639
6743
|
'draft_generation_id',
|
|
6640
6744
|
'pass_faces',
|
|
6641
6745
|
]);
|
|
6642
|
-
((
|
|
6643
|
-
|
|
6746
|
+
((Vr = [
|
|
6747
|
+
M('The user message or task.'),
|
|
6644
6748
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
6645
6749
|
{
|
|
6646
6750
|
name: 'messages',
|
|
@@ -6657,8 +6761,8 @@ var _r,
|
|
|
6657
6761
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
6658
6762
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
6659
6763
|
]),
|
|
6660
|
-
(
|
|
6661
|
-
|
|
6764
|
+
(Nr = [
|
|
6765
|
+
M('The user message or task.'),
|
|
6662
6766
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
6663
6767
|
{
|
|
6664
6768
|
name: 'messages',
|
|
@@ -6739,9 +6843,9 @@ var _r,
|
|
|
6739
6843
|
description: 'Video frames read a second.',
|
|
6740
6844
|
},
|
|
6741
6845
|
]),
|
|
6742
|
-
(
|
|
6846
|
+
(Ur = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
6743
6847
|
((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
6744
|
-
(
|
|
6848
|
+
(It = [
|
|
6745
6849
|
{
|
|
6746
6850
|
name: 'prompt',
|
|
6747
6851
|
type: 'string',
|
|
@@ -6890,19 +6994,19 @@ var _r,
|
|
|
6890
6994
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6891
6995
|
},
|
|
6892
6996
|
]),
|
|
6893
|
-
(
|
|
6997
|
+
(qt = {
|
|
6894
6998
|
name: 'images',
|
|
6895
6999
|
type: 'string[]',
|
|
6896
7000
|
description:
|
|
6897
7001
|
'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
6898
7002
|
}),
|
|
6899
|
-
(
|
|
7003
|
+
($t = {
|
|
6900
7004
|
name: 'audios',
|
|
6901
7005
|
type: 'string[]',
|
|
6902
7006
|
description:
|
|
6903
7007
|
'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
6904
7008
|
}),
|
|
6905
|
-
(
|
|
7009
|
+
(Pt = [
|
|
6906
7010
|
{
|
|
6907
7011
|
name: 'prompt',
|
|
6908
7012
|
type: 'string',
|
|
@@ -6980,8 +7084,8 @@ var _r,
|
|
|
6980
7084
|
description:
|
|
6981
7085
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6982
7086
|
},
|
|
6983
|
-
|
|
6984
|
-
|
|
7087
|
+
qt,
|
|
7088
|
+
$t,
|
|
6985
7089
|
{
|
|
6986
7090
|
name: 'first_frame_image',
|
|
6987
7091
|
type: 'string',
|
|
@@ -7002,7 +7106,7 @@ var _r,
|
|
|
7002
7106
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7003
7107
|
},
|
|
7004
7108
|
]),
|
|
7005
|
-
(
|
|
7109
|
+
(Jr = [
|
|
7006
7110
|
{
|
|
7007
7111
|
name: 'prompt',
|
|
7008
7112
|
type: 'string',
|
|
@@ -7057,8 +7161,8 @@ var _r,
|
|
|
7057
7161
|
description:
|
|
7058
7162
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7059
7163
|
},
|
|
7060
|
-
|
|
7061
|
-
|
|
7164
|
+
qt,
|
|
7165
|
+
$t,
|
|
7062
7166
|
{
|
|
7063
7167
|
name: 'first_frame_image',
|
|
7064
7168
|
type: 'string',
|
|
@@ -7073,53 +7177,53 @@ var _r,
|
|
|
7073
7177
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7074
7178
|
},
|
|
7075
7179
|
]));
|
|
7076
|
-
ue =
|
|
7077
|
-
|
|
7180
|
+
ue = Hr();
|
|
7181
|
+
Yr = ['draft_task_id', 'draft_generation_id'];
|
|
7078
7182
|
});
|
|
7079
7183
|
function me(e) {
|
|
7080
7184
|
let t = '/v1/pricing/models',
|
|
7081
7185
|
r = e?.trim();
|
|
7082
7186
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7083
7187
|
}
|
|
7084
|
-
var
|
|
7188
|
+
var Ve = y(() => {
|
|
7085
7189
|
'use strict';
|
|
7086
7190
|
});
|
|
7087
|
-
function
|
|
7191
|
+
function jt(e) {
|
|
7088
7192
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
7089
7193
|
}
|
|
7090
|
-
function
|
|
7194
|
+
function Ft(e) {
|
|
7091
7195
|
let t = oe().filter((n) => n.kind === e && n.unfiltered != null),
|
|
7092
|
-
r = t.filter((n) =>
|
|
7093
|
-
i = t.filter((n) => !
|
|
7196
|
+
r = t.filter((n) => J.includes(n.api.model)).map((n) => n.name),
|
|
7197
|
+
i = t.filter((n) => !J.includes(n.api.model)).map((n) => n.name);
|
|
7094
7198
|
return [
|
|
7095
7199
|
...(r.length
|
|
7096
|
-
? [`${
|
|
7200
|
+
? [`${jt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7097
7201
|
: []),
|
|
7098
|
-
...(i.length ? [`Not available yet on ${
|
|
7202
|
+
...(i.length ? [`Not available yet on ${jt(i)}: ${de}.`] : []),
|
|
7099
7203
|
'The Acceptable Use Policy applies.',
|
|
7100
7204
|
].join(' ');
|
|
7101
7205
|
}
|
|
7102
|
-
function
|
|
7103
|
-
if (
|
|
7206
|
+
function wi(e) {
|
|
7207
|
+
if (bi.has(e.name)) return e;
|
|
7104
7208
|
let t = e.inputSchema.properties;
|
|
7105
7209
|
return !t || t.callback_url
|
|
7106
7210
|
? e
|
|
7107
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7211
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: yi } } };
|
|
7108
7212
|
}
|
|
7109
|
-
function
|
|
7213
|
+
function xi(e) {
|
|
7110
7214
|
let t = e.inputSchema.properties;
|
|
7111
7215
|
if (!t) return e;
|
|
7112
7216
|
let r = !1,
|
|
7113
7217
|
i = {};
|
|
7114
7218
|
for (let [s, n] of Object.entries(t))
|
|
7115
|
-
|
|
7219
|
+
Gt.has(s) && n.type === 'string' && !n.format
|
|
7116
7220
|
? ((i[s] = { ...n, format: 'uri' }), (r = !0))
|
|
7117
|
-
:
|
|
7221
|
+
: Gt.has(s) && n.type === 'array' && n.items?.type === 'string' && !n.items.format
|
|
7118
7222
|
? ((i[s] = { ...n, items: { ...n.items, format: 'uri' } }), (r = !0))
|
|
7119
7223
|
: (i[s] = n);
|
|
7120
7224
|
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
|
|
7121
7225
|
}
|
|
7122
|
-
function
|
|
7226
|
+
function Ii(e) {
|
|
7123
7227
|
switch (e.type) {
|
|
7124
7228
|
case 'string':
|
|
7125
7229
|
return {
|
|
@@ -7174,11 +7278,11 @@ function ki(e) {
|
|
|
7174
7278
|
return { type: 'string', description: e.description };
|
|
7175
7279
|
}
|
|
7176
7280
|
}
|
|
7177
|
-
function
|
|
7281
|
+
function Pi(e, t) {
|
|
7178
7282
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7179
7283
|
i = {},
|
|
7180
7284
|
s = [];
|
|
7181
|
-
for (let o of e.parameters) ((i[o.name] =
|
|
7285
|
+
for (let o of e.parameters) ((i[o.name] = Ii(o)), o.required && s.push(o.name));
|
|
7182
7286
|
let n = {
|
|
7183
7287
|
type: 'object',
|
|
7184
7288
|
properties: i,
|
|
@@ -7191,15 +7295,15 @@ function wi(e, t) {
|
|
|
7191
7295
|
inputSchema: n,
|
|
7192
7296
|
};
|
|
7193
7297
|
}
|
|
7194
|
-
function
|
|
7195
|
-
let e =
|
|
7196
|
-
t =
|
|
7197
|
-
r =
|
|
7198
|
-
i =
|
|
7298
|
+
function Ti() {
|
|
7299
|
+
let e = R().filter((d) => d.category === 'Image'),
|
|
7300
|
+
t = R().filter((d) => d.category === 'Video'),
|
|
7301
|
+
r = R().filter((d) => d.category === 'Text'),
|
|
7302
|
+
i = R().filter((d) => d.category === 'Audio'),
|
|
7199
7303
|
s = {
|
|
7200
7304
|
name: 'generate_image',
|
|
7201
7305
|
description:
|
|
7202
|
-
'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
|
|
7306
|
+
'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.5 and 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
|
|
7203
7307
|
inputSchema: {
|
|
7204
7308
|
type: 'object',
|
|
7205
7309
|
properties: {
|
|
@@ -7287,7 +7391,7 @@ function xi() {
|
|
|
7287
7391
|
maximum: 2147483647,
|
|
7288
7392
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
7289
7393
|
},
|
|
7290
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7394
|
+
creative_mode: { type: 'boolean', default: !1, description: Ft('image') },
|
|
7291
7395
|
},
|
|
7292
7396
|
required: ['prompt'],
|
|
7293
7397
|
additionalProperties: !0,
|
|
@@ -7324,7 +7428,7 @@ function xi() {
|
|
|
7324
7428
|
default: '480p',
|
|
7325
7429
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
7326
7430
|
},
|
|
7327
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7431
|
+
creative_mode: { type: 'boolean', default: !1, description: Ft('video') },
|
|
7328
7432
|
priority: {
|
|
7329
7433
|
type: 'boolean',
|
|
7330
7434
|
default: !1,
|
|
@@ -7415,16 +7519,32 @@ function xi() {
|
|
|
7415
7519
|
},
|
|
7416
7520
|
l = {
|
|
7417
7521
|
name: 'generate_mesh',
|
|
7418
|
-
description:
|
|
7522
|
+
description:
|
|
7523
|
+
'Split an image into layers (layer decomposition): Seedream 5.0 Pro by default, or model seedream-5-5 for up to 100 transparent layers billed per layer made, with optional typeset-text recognition.',
|
|
7419
7524
|
inputSchema: {
|
|
7420
7525
|
type: 'object',
|
|
7421
7526
|
properties: {
|
|
7527
|
+
model: {
|
|
7528
|
+
type: 'string',
|
|
7529
|
+
enum: ['seedream-5-pro', 'seedream-5-5'],
|
|
7530
|
+
description: 'seedream-5-pro (default) or seedream-5-5.',
|
|
7531
|
+
},
|
|
7422
7532
|
prompt: { type: 'string', description: 'What to separate into layers.' },
|
|
7423
7533
|
images: {
|
|
7424
7534
|
type: 'array',
|
|
7425
7535
|
items: { type: 'string' },
|
|
7426
7536
|
description: 'The image to decompose (jpeg or png).',
|
|
7427
7537
|
},
|
|
7538
|
+
max_layers: {
|
|
7539
|
+
type: 'number',
|
|
7540
|
+
description:
|
|
7541
|
+
'seedream-5-5 only: most images to return, the base image included (2-100, default 30). You pay for the layers made.',
|
|
7542
|
+
},
|
|
7543
|
+
text_recognition: {
|
|
7544
|
+
type: 'boolean',
|
|
7545
|
+
description:
|
|
7546
|
+
'seedream-5-5 only: return the text and style of each typeset text layer (layer.text_recognition).',
|
|
7547
|
+
},
|
|
7428
7548
|
},
|
|
7429
7549
|
required: ['prompt'],
|
|
7430
7550
|
additionalProperties: !0,
|
|
@@ -7446,10 +7566,10 @@ function xi() {
|
|
|
7446
7566
|
additionalProperties: !0,
|
|
7447
7567
|
},
|
|
7448
7568
|
},
|
|
7449
|
-
p =
|
|
7450
|
-
return [s, n, o, u, l, p, c,
|
|
7569
|
+
p = vi();
|
|
7570
|
+
return [s, n, o, u, l, p, c, ki];
|
|
7451
7571
|
}
|
|
7452
|
-
function
|
|
7572
|
+
function vi() {
|
|
7453
7573
|
return {
|
|
7454
7574
|
name: 'upload_asset',
|
|
7455
7575
|
description:
|
|
@@ -7496,26 +7616,26 @@ function Ii() {
|
|
|
7496
7616
|
},
|
|
7497
7617
|
};
|
|
7498
7618
|
}
|
|
7499
|
-
function
|
|
7500
|
-
let e =
|
|
7501
|
-
t =
|
|
7502
|
-
return [...e, ...t].map(
|
|
7619
|
+
function Ge() {
|
|
7620
|
+
let e = Ti(),
|
|
7621
|
+
t = R().map((r) => Pi(r));
|
|
7622
|
+
return [...e, ...t].map(wi).map(xi);
|
|
7503
7623
|
}
|
|
7504
|
-
var
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7624
|
+
var yi,
|
|
7625
|
+
bi,
|
|
7626
|
+
ki,
|
|
7627
|
+
Gt,
|
|
7628
|
+
zt = y(() => {
|
|
7509
7629
|
'use strict';
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
((
|
|
7630
|
+
B();
|
|
7631
|
+
Ce();
|
|
7632
|
+
W();
|
|
7633
|
+
((yi = {
|
|
7514
7634
|
type: 'string',
|
|
7515
7635
|
description:
|
|
7516
7636
|
'Optional HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled. The body matches GET /v1/jobs/:id and is signed with X-Tein-Signature.',
|
|
7517
7637
|
}),
|
|
7518
|
-
(
|
|
7638
|
+
(bi = new Set([
|
|
7519
7639
|
'upload_asset',
|
|
7520
7640
|
'upload_media',
|
|
7521
7641
|
'upload_image',
|
|
@@ -7523,7 +7643,7 @@ var fi,
|
|
|
7523
7643
|
'check_status',
|
|
7524
7644
|
'get_pricing',
|
|
7525
7645
|
])),
|
|
7526
|
-
(
|
|
7646
|
+
(ki = {
|
|
7527
7647
|
name: 'get_pricing',
|
|
7528
7648
|
description:
|
|
7529
7649
|
'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
|
|
@@ -7538,7 +7658,7 @@ var fi,
|
|
|
7538
7658
|
additionalProperties: !1,
|
|
7539
7659
|
},
|
|
7540
7660
|
}));
|
|
7541
|
-
|
|
7661
|
+
Gt = new Set([
|
|
7542
7662
|
'image',
|
|
7543
7663
|
'images',
|
|
7544
7664
|
'image_url',
|
|
@@ -7555,19 +7675,19 @@ var fi,
|
|
|
7555
7675
|
'lipsyncing_audio',
|
|
7556
7676
|
]);
|
|
7557
7677
|
});
|
|
7558
|
-
var
|
|
7559
|
-
|
|
7560
|
-
forgetToolSchemas: () =>
|
|
7561
|
-
jsonRpcAnswer: () =>
|
|
7562
|
-
preprocessLocalFiles: () =>
|
|
7563
|
-
startStdioServer: () =>
|
|
7678
|
+
var rr = {};
|
|
7679
|
+
dr(rr, {
|
|
7680
|
+
forgetToolSchemas: () => qi,
|
|
7681
|
+
jsonRpcAnswer: () => Yt,
|
|
7682
|
+
preprocessLocalFiles: () => er,
|
|
7683
|
+
startStdioServer: () => tr,
|
|
7564
7684
|
});
|
|
7565
|
-
function
|
|
7685
|
+
function _i(e) {
|
|
7566
7686
|
let t = (r) =>
|
|
7567
7687
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
7568
7688
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
7569
7689
|
}
|
|
7570
|
-
function
|
|
7690
|
+
function Yt(e, t, r) {
|
|
7571
7691
|
let i = e?.id,
|
|
7572
7692
|
s = i == null,
|
|
7573
7693
|
n = null;
|
|
@@ -7576,7 +7696,7 @@ function Ht(e, t, r) {
|
|
|
7576
7696
|
} catch {
|
|
7577
7697
|
n = null;
|
|
7578
7698
|
}
|
|
7579
|
-
if (n !== null &&
|
|
7699
|
+
if (n !== null && _i(n)) return s ? null : n;
|
|
7580
7700
|
if (s) return null;
|
|
7581
7701
|
if (!r && t >= 200 && t < 300) return;
|
|
7582
7702
|
let o = n?.error,
|
|
@@ -7597,16 +7717,16 @@ function Ht(e, t, r) {
|
|
|
7597
7717
|
},
|
|
7598
7718
|
};
|
|
7599
7719
|
}
|
|
7600
|
-
function
|
|
7720
|
+
function Mi() {
|
|
7601
7721
|
let e = process.argv.slice(2),
|
|
7602
7722
|
t = e.indexOf('--api-key');
|
|
7603
|
-
return
|
|
7723
|
+
return q(t >= 0 ? e[t + 1] : void 0);
|
|
7604
7724
|
}
|
|
7605
|
-
async function
|
|
7606
|
-
let i =
|
|
7607
|
-
if (!
|
|
7725
|
+
async function Qt(e, t, r) {
|
|
7726
|
+
let i = F.default.resolve(e);
|
|
7727
|
+
if (!D.default.existsSync(i) || !D.default.statSync(i).isFile())
|
|
7608
7728
|
throw new Error(`File not found: ${e}`);
|
|
7609
|
-
let s =
|
|
7729
|
+
let s = D.default.readFileSync(i),
|
|
7610
7730
|
n = s.toString('base64'),
|
|
7611
7731
|
o = s.length,
|
|
7612
7732
|
u = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
@@ -7631,15 +7751,15 @@ async function Wt(e, t, r) {
|
|
|
7631
7751
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
7632
7752
|
};
|
|
7633
7753
|
}
|
|
7634
|
-
function
|
|
7635
|
-
return
|
|
7754
|
+
function Xt(e) {
|
|
7755
|
+
return Ki.has(F.default.extname(e).toLowerCase());
|
|
7636
7756
|
}
|
|
7637
|
-
function
|
|
7757
|
+
function Zt(e) {
|
|
7638
7758
|
return new Error(
|
|
7639
|
-
`Tein uploads image, video and audio files only, and ${
|
|
7759
|
+
`Tein uploads image, video and audio files only, and ${F.default.basename(e)} is not one.`,
|
|
7640
7760
|
);
|
|
7641
7761
|
}
|
|
7642
|
-
function
|
|
7762
|
+
function Si(e) {
|
|
7643
7763
|
let t = e.trim();
|
|
7644
7764
|
if (
|
|
7645
7765
|
!t ||
|
|
@@ -7649,25 +7769,25 @@ function _i(e) {
|
|
|
7649
7769
|
`)
|
|
7650
7770
|
)
|
|
7651
7771
|
return null;
|
|
7652
|
-
let r =
|
|
7653
|
-
return
|
|
7772
|
+
let r = F.default.resolve(t);
|
|
7773
|
+
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
7654
7774
|
}
|
|
7655
|
-
function
|
|
7775
|
+
function Je(e) {
|
|
7656
7776
|
if (Array.isArray(e))
|
|
7657
7777
|
for (let t of e) {
|
|
7658
7778
|
let r = t;
|
|
7659
7779
|
typeof r.name == 'string' &&
|
|
7660
7780
|
r.inputSchema &&
|
|
7661
7781
|
typeof r.inputSchema == 'object' &&
|
|
7662
|
-
|
|
7782
|
+
X.set(r.name, r.inputSchema);
|
|
7663
7783
|
}
|
|
7664
7784
|
}
|
|
7665
|
-
function
|
|
7666
|
-
(
|
|
7785
|
+
function qi() {
|
|
7786
|
+
(X.clear(), (ze = 0));
|
|
7667
7787
|
}
|
|
7668
|
-
async function
|
|
7669
|
-
if (!(Date.now() -
|
|
7670
|
-
|
|
7788
|
+
async function $i(e, t) {
|
|
7789
|
+
if (!(Date.now() - ze < 6e4)) {
|
|
7790
|
+
ze = Date.now();
|
|
7671
7791
|
try {
|
|
7672
7792
|
let i = await (
|
|
7673
7793
|
await fetch(e, {
|
|
@@ -7677,39 +7797,39 @@ async function Ki(e, t) {
|
|
|
7677
7797
|
signal: AbortSignal.timeout(1e4),
|
|
7678
7798
|
})
|
|
7679
7799
|
).json();
|
|
7680
|
-
|
|
7800
|
+
Je(i.result?.tools);
|
|
7681
7801
|
} catch {}
|
|
7682
7802
|
}
|
|
7683
7803
|
}
|
|
7684
|
-
function
|
|
7804
|
+
function Ci(e) {
|
|
7685
7805
|
return e
|
|
7686
7806
|
? e.type === 'string'
|
|
7687
7807
|
? e.format === 'uri'
|
|
7688
7808
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
7689
7809
|
: !1;
|
|
7690
7810
|
}
|
|
7691
|
-
async function
|
|
7811
|
+
async function Jt(e, t, r) {
|
|
7692
7812
|
if (typeof e != 'string') return e;
|
|
7693
|
-
let i =
|
|
7813
|
+
let i = Si(e);
|
|
7694
7814
|
if (!i) return e;
|
|
7695
|
-
if (!
|
|
7696
|
-
return (await
|
|
7815
|
+
if (!Xt(i)) throw Zt(i);
|
|
7816
|
+
return (await Qt(i, t, r)).url;
|
|
7697
7817
|
}
|
|
7698
|
-
async function
|
|
7699
|
-
(
|
|
7700
|
-
let n =
|
|
7818
|
+
async function er(e, t, r, i, s) {
|
|
7819
|
+
(X.size === 0 && Je(Ge()), X.has(e) || (await $i(s, r)));
|
|
7820
|
+
let n = X.get(e)?.properties;
|
|
7701
7821
|
if (!n) return t;
|
|
7702
7822
|
let o = { ...t };
|
|
7703
7823
|
for (let [u, l] of Object.entries(t))
|
|
7704
|
-
if (
|
|
7824
|
+
if (Ci(n[u]))
|
|
7705
7825
|
if (Array.isArray(l)) {
|
|
7706
7826
|
let c = [];
|
|
7707
|
-
for (let p of l) c.push(await
|
|
7827
|
+
for (let p of l) c.push(await Jt(p, r, i));
|
|
7708
7828
|
o[u] = c;
|
|
7709
|
-
} else o[u] = await
|
|
7829
|
+
} else o[u] = await Jt(l, r, i);
|
|
7710
7830
|
return o;
|
|
7711
7831
|
}
|
|
7712
|
-
function
|
|
7832
|
+
function Ei(e) {
|
|
7713
7833
|
let t = e.id ?? null;
|
|
7714
7834
|
switch (e.method) {
|
|
7715
7835
|
case 'initialize':
|
|
@@ -7727,7 +7847,7 @@ function qi(e) {
|
|
|
7727
7847
|
case 'ping':
|
|
7728
7848
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
7729
7849
|
case 'tools/list':
|
|
7730
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
7850
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ge() } };
|
|
7731
7851
|
case 'tools/call':
|
|
7732
7852
|
return {
|
|
7733
7853
|
jsonrpc: '2.0',
|
|
@@ -7750,13 +7870,13 @@ function qi(e) {
|
|
|
7750
7870
|
};
|
|
7751
7871
|
}
|
|
7752
7872
|
}
|
|
7753
|
-
async function
|
|
7754
|
-
if (
|
|
7755
|
-
|
|
7756
|
-
let e =
|
|
7757
|
-
t =
|
|
7873
|
+
async function tr() {
|
|
7874
|
+
if (Ht) return;
|
|
7875
|
+
Ht = !0;
|
|
7876
|
+
let e = Mi(),
|
|
7877
|
+
t = P(),
|
|
7758
7878
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
7759
|
-
(
|
|
7879
|
+
(Wt.default
|
|
7760
7880
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
7761
7881
|
.on('line', async (s) => {
|
|
7762
7882
|
let n = s.trim();
|
|
@@ -7815,10 +7935,10 @@ async function Zt() {
|
|
|
7815
7935
|
!p.startsWith('data:')
|
|
7816
7936
|
)
|
|
7817
7937
|
try {
|
|
7818
|
-
let d =
|
|
7819
|
-
if (
|
|
7820
|
-
if (!
|
|
7821
|
-
let m = await
|
|
7938
|
+
let d = F.default.resolve(p.trim());
|
|
7939
|
+
if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
|
|
7940
|
+
if (!Xt(d)) throw Zt(d);
|
|
7941
|
+
let m = await Qt(d, e, t),
|
|
7822
7942
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
7823
7943
|
fe =
|
|
7824
7944
|
m.mimeType.startsWith('image/') ||
|
|
@@ -7874,7 +7994,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7874
7994
|
}
|
|
7875
7995
|
if (e)
|
|
7876
7996
|
try {
|
|
7877
|
-
o.params.arguments = await
|
|
7997
|
+
o.params.arguments = await er(String(l), c, e, t, r);
|
|
7878
7998
|
} catch (p) {
|
|
7879
7999
|
let d = p instanceof Error ? p.message : String(p);
|
|
7880
8000
|
process.stdout.write(
|
|
@@ -7905,10 +8025,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7905
8025
|
body: JSON.stringify(o),
|
|
7906
8026
|
}),
|
|
7907
8027
|
c = await l.text(),
|
|
7908
|
-
p =
|
|
8028
|
+
p = Yt(o, l.status, c);
|
|
7909
8029
|
if (p === null) return;
|
|
7910
8030
|
if (p) {
|
|
7911
|
-
(o?.method === 'tools/list' &&
|
|
8031
|
+
(o?.method === 'tools/list' && Je(p.result?.tools),
|
|
7912
8032
|
process.stdout.write(
|
|
7913
8033
|
JSON.stringify(p) +
|
|
7914
8034
|
`
|
|
@@ -7917,7 +8037,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7917
8037
|
return;
|
|
7918
8038
|
}
|
|
7919
8039
|
} catch {}
|
|
7920
|
-
let u =
|
|
8040
|
+
let u = Ei(o);
|
|
7921
8041
|
u !== null &&
|
|
7922
8042
|
process.stdout.write(
|
|
7923
8043
|
JSON.stringify(u) +
|
|
@@ -7940,22 +8060,22 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7940
8060
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
7941
8061
|
`));
|
|
7942
8062
|
}
|
|
7943
|
-
var
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
8063
|
+
var D,
|
|
8064
|
+
F,
|
|
8065
|
+
Wt,
|
|
8066
|
+
Ki,
|
|
8067
|
+
X,
|
|
8068
|
+
ze,
|
|
8069
|
+
Ht,
|
|
8070
|
+
ir = y(() => {
|
|
7951
8071
|
'use strict';
|
|
7952
|
-
((
|
|
7953
|
-
(
|
|
7954
|
-
(
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
8072
|
+
((D = T(require('node:fs'))),
|
|
8073
|
+
(F = T(require('node:path'))),
|
|
8074
|
+
(Wt = T(require('node:readline'))));
|
|
8075
|
+
Ve();
|
|
8076
|
+
zt();
|
|
8077
|
+
A();
|
|
8078
|
+
Ki = new Set([
|
|
7959
8079
|
'.png',
|
|
7960
8080
|
'.jpg',
|
|
7961
8081
|
'.jpeg',
|
|
@@ -7981,20 +8101,20 @@ var O,
|
|
|
7981
8101
|
'.flac',
|
|
7982
8102
|
'.opus',
|
|
7983
8103
|
]);
|
|
7984
|
-
((
|
|
7985
|
-
|
|
8104
|
+
((X = new Map()), (ze = 0));
|
|
8105
|
+
Ht = !1;
|
|
7986
8106
|
require.main === module &&
|
|
7987
|
-
|
|
8107
|
+
tr().catch((e) => {
|
|
7988
8108
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
7989
8109
|
`),
|
|
7990
8110
|
process.exit(1));
|
|
7991
8111
|
});
|
|
7992
8112
|
});
|
|
7993
|
-
var
|
|
8113
|
+
var ur =
|
|
7994
8114
|
!process.env.NO_COLOR &&
|
|
7995
8115
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
7996
8116
|
function k(e, t) {
|
|
7997
|
-
return (r) => (
|
|
8117
|
+
return (r) => (ur ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
7998
8118
|
}
|
|
7999
8119
|
var a = {
|
|
8000
8120
|
bold: k(1, 22),
|
|
@@ -8078,21 +8198,21 @@ var a = {
|
|
|
8078
8198
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
8079
8199
|
}
|
|
8080
8200
|
};
|
|
8081
|
-
var
|
|
8082
|
-
|
|
8083
|
-
var ee =
|
|
8084
|
-
|
|
8085
|
-
|
|
8201
|
+
var V = T(require('node:fs')),
|
|
8202
|
+
$ = T(require('node:path'));
|
|
8203
|
+
var ee = T(require('node:fs')),
|
|
8204
|
+
Qe = T(require('node:path')),
|
|
8205
|
+
Xe = require('node:stream/promises');
|
|
8086
8206
|
var Z = '1.1.7';
|
|
8087
|
-
var
|
|
8207
|
+
var mr = new Set([
|
|
8088
8208
|
'account_suspended',
|
|
8089
8209
|
'account_terminated',
|
|
8090
8210
|
'creative_mode_restricted',
|
|
8091
8211
|
'unfiltered_restricted',
|
|
8092
8212
|
'workspace_paused',
|
|
8093
8213
|
]),
|
|
8094
|
-
|
|
8095
|
-
|
|
8214
|
+
v = 1,
|
|
8215
|
+
fr = 3,
|
|
8096
8216
|
w = class extends Error {
|
|
8097
8217
|
constructor(t, r, i, s = {}) {
|
|
8098
8218
|
(super(r),
|
|
@@ -8102,10 +8222,10 @@ var cr = new Set([
|
|
|
8102
8222
|
(this.fields = s));
|
|
8103
8223
|
}
|
|
8104
8224
|
get exitCode() {
|
|
8105
|
-
return this.code &&
|
|
8225
|
+
return this.code && mr.has(this.code) ? fr : v;
|
|
8106
8226
|
}
|
|
8107
8227
|
};
|
|
8108
|
-
function
|
|
8228
|
+
function gr(e, t, r) {
|
|
8109
8229
|
let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
8110
8230
|
if (!r || typeof r != 'object') return new w(e, i);
|
|
8111
8231
|
let s = r;
|
|
@@ -8118,13 +8238,13 @@ function mr(e, t, r) {
|
|
|
8118
8238
|
c = (typeof n == 'string' && n) || (typeof u == 'string' && u) || i;
|
|
8119
8239
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8120
8240
|
}
|
|
8121
|
-
function
|
|
8241
|
+
function We(e) {
|
|
8122
8242
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8123
8243
|
}
|
|
8124
|
-
function
|
|
8244
|
+
function S(e) {
|
|
8125
8245
|
let t = [e.message],
|
|
8126
|
-
r =
|
|
8127
|
-
i =
|
|
8246
|
+
r = We(e.fields.required),
|
|
8247
|
+
i = We(e.fields.balance);
|
|
8128
8248
|
(r || i) &&
|
|
8129
8249
|
t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
|
|
8130
8250
|
let s = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -8132,22 +8252,22 @@ function K(e) {
|
|
|
8132
8252
|
let n = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8133
8253
|
return (typeof n == 'string' && n && t.push(n), e.code && t.push(`(${e.code})`), t);
|
|
8134
8254
|
}
|
|
8135
|
-
function
|
|
8255
|
+
function hr(e) {
|
|
8136
8256
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
8137
8257
|
? 'video'
|
|
8138
8258
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
8139
8259
|
? 'audio'
|
|
8140
8260
|
: 'image';
|
|
8141
8261
|
}
|
|
8142
|
-
function
|
|
8262
|
+
function Ye(e) {
|
|
8143
8263
|
let t = [];
|
|
8144
8264
|
for (let r of e.data ?? [])
|
|
8145
8265
|
typeof r.message?.content == 'string'
|
|
8146
8266
|
? t.push({ type: 'text', text: r.message.content })
|
|
8147
|
-
: r.url && t.push({ type:
|
|
8267
|
+
: r.url && t.push({ type: hr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
8148
8268
|
return t;
|
|
8149
8269
|
}
|
|
8150
|
-
var
|
|
8270
|
+
var K = class {
|
|
8151
8271
|
constructor(t, r) {
|
|
8152
8272
|
((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
|
|
8153
8273
|
}
|
|
@@ -8170,7 +8290,7 @@ var M = class {
|
|
|
8170
8290
|
try {
|
|
8171
8291
|
n = await s.json();
|
|
8172
8292
|
} catch {}
|
|
8173
|
-
throw
|
|
8293
|
+
throw gr(s.status, s.statusText, n);
|
|
8174
8294
|
}
|
|
8175
8295
|
return await s.json();
|
|
8176
8296
|
}
|
|
@@ -8184,7 +8304,7 @@ var M = class {
|
|
|
8184
8304
|
s === 'succeeded' || s === 'failed' || s === 'expired' || s === 'cancelled'
|
|
8185
8305
|
? s
|
|
8186
8306
|
: 'processing',
|
|
8187
|
-
o =
|
|
8307
|
+
o = Ye(i);
|
|
8188
8308
|
return {
|
|
8189
8309
|
request_id: i.request_id || i.id || '',
|
|
8190
8310
|
model: i.model,
|
|
@@ -8202,7 +8322,7 @@ var M = class {
|
|
|
8202
8322
|
i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
|
|
8203
8323
|
? i
|
|
8204
8324
|
: 'processing',
|
|
8205
|
-
n =
|
|
8325
|
+
n = Ye(r),
|
|
8206
8326
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8207
8327
|
return {
|
|
8208
8328
|
request_id: r.id || t,
|
|
@@ -8220,14 +8340,14 @@ var M = class {
|
|
|
8220
8340
|
async downloadOutput(t, r) {
|
|
8221
8341
|
let i = await fetch(t);
|
|
8222
8342
|
if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
|
|
8223
|
-
let s =
|
|
8343
|
+
let s = Qe.default.dirname(r);
|
|
8224
8344
|
ee.default.existsSync(s) || ee.default.mkdirSync(s, { recursive: !0 });
|
|
8225
8345
|
let n = ee.default.createWriteStream(r);
|
|
8226
|
-
return (await (0,
|
|
8346
|
+
return (await (0, Xe.pipeline)(i.body, n), r);
|
|
8227
8347
|
}
|
|
8228
8348
|
};
|
|
8229
|
-
|
|
8230
|
-
function
|
|
8349
|
+
A();
|
|
8350
|
+
function we(e) {
|
|
8231
8351
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
8232
8352
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
8233
8353
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -8235,43 +8355,43 @@ function ke(e) {
|
|
|
8235
8355
|
i = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8236
8356
|
return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
|
|
8237
8357
|
}
|
|
8238
|
-
|
|
8239
|
-
var
|
|
8240
|
-
function
|
|
8241
|
-
for (let t of
|
|
8358
|
+
W();
|
|
8359
|
+
var Et = ['images', 'input_images', 'videos', 'audios'];
|
|
8360
|
+
function Qr(e) {
|
|
8361
|
+
for (let t of Et) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
8242
8362
|
}
|
|
8243
|
-
function
|
|
8363
|
+
function Xr(e) {
|
|
8244
8364
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8245
|
-
let t =
|
|
8246
|
-
return
|
|
8365
|
+
let t = $.default.resolve(e);
|
|
8366
|
+
return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
|
|
8247
8367
|
}
|
|
8248
|
-
async function
|
|
8249
|
-
for (let r of
|
|
8368
|
+
async function Zr(e, t) {
|
|
8369
|
+
for (let r of Et) {
|
|
8250
8370
|
if (!Array.isArray(e[r])) continue;
|
|
8251
8371
|
let i = [];
|
|
8252
8372
|
for (let s of e[r]) {
|
|
8253
8373
|
if (typeof s != 'string') continue;
|
|
8254
|
-
let n =
|
|
8374
|
+
let n = Xr(s);
|
|
8255
8375
|
i.push(n ? await t(n) : s);
|
|
8256
8376
|
}
|
|
8257
8377
|
e[r] = i;
|
|
8258
8378
|
}
|
|
8259
8379
|
}
|
|
8260
|
-
var
|
|
8261
|
-
function
|
|
8380
|
+
var Y = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
8381
|
+
function ei(e) {
|
|
8262
8382
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
8263
8383
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
8264
|
-
r =
|
|
8384
|
+
r = Y.enterprise;
|
|
8265
8385
|
return (
|
|
8266
8386
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
8267
8387
|
(process.stderr
|
|
8268
|
-
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${
|
|
8388
|
+
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Y.starter}, Plus ${Y.plus}, Scale ${Y.scale}, Enterprise ${Y.enterprise} at once, including polling.
|
|
8269
8389
|
`),
|
|
8270
8390
|
process.exit(1)),
|
|
8271
8391
|
t
|
|
8272
8392
|
);
|
|
8273
8393
|
}
|
|
8274
|
-
async function
|
|
8394
|
+
async function ti(e, t, r, i, s) {
|
|
8275
8395
|
s.isJson ||
|
|
8276
8396
|
process.stderr.write(`Starting ${i} ${t} jobs together...
|
|
8277
8397
|
`);
|
|
@@ -8333,20 +8453,25 @@ async function Zr(e, t, r, i, s) {
|
|
|
8333
8453
|
else {
|
|
8334
8454
|
for (let l of o)
|
|
8335
8455
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
8336
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
8456
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${we(l.usage.cost)}`),
|
|
8337
8457
|
l.error && process.stdout.write(` ${l.error}`),
|
|
8338
8458
|
process.stdout.write(`
|
|
8339
8459
|
`));
|
|
8340
8460
|
for (let l of u)
|
|
8341
|
-
process.stderr.write(`${
|
|
8461
|
+
process.stderr.write(`${S(l).join(`
|
|
8342
8462
|
`)}
|
|
8343
8463
|
`);
|
|
8344
8464
|
}
|
|
8345
8465
|
(u.length ||
|
|
8346
8466
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
8347
|
-
process.exit(
|
|
8467
|
+
process.exit(v);
|
|
8468
|
+
}
|
|
8469
|
+
function ri(e, t, r) {
|
|
8470
|
+
if (r <= 1) return e;
|
|
8471
|
+
let i = $.default.extname(e);
|
|
8472
|
+
return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
|
|
8348
8473
|
}
|
|
8349
|
-
function
|
|
8474
|
+
function At(e) {
|
|
8350
8475
|
let t = {},
|
|
8351
8476
|
r = new Set(),
|
|
8352
8477
|
i = [];
|
|
@@ -8391,9 +8516,9 @@ function Ct(e) {
|
|
|
8391
8516
|
}
|
|
8392
8517
|
return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
|
|
8393
8518
|
}
|
|
8394
|
-
async function
|
|
8395
|
-
let r =
|
|
8396
|
-
i =
|
|
8519
|
+
async function Le(e, t) {
|
|
8520
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8521
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8397
8522
|
(r ||
|
|
8398
8523
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
8399
8524
|
`),
|
|
@@ -8409,11 +8534,11 @@ async function De(e, t) {
|
|
|
8409
8534
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
8410
8535
|
`),
|
|
8411
8536
|
process.exit(1)));
|
|
8412
|
-
let s =
|
|
8537
|
+
let s = j(e),
|
|
8413
8538
|
n = !!t.json,
|
|
8414
8539
|
o = !!(t.async || t.no_wait),
|
|
8415
8540
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
8416
|
-
l =
|
|
8541
|
+
l = ei(t),
|
|
8417
8542
|
c = { ...t };
|
|
8418
8543
|
(delete c.json,
|
|
8419
8544
|
delete c.async,
|
|
@@ -8422,76 +8547,76 @@ async function De(e, t) {
|
|
|
8422
8547
|
delete c.api_key,
|
|
8423
8548
|
delete c.api_url,
|
|
8424
8549
|
delete c.count);
|
|
8425
|
-
let p =
|
|
8426
|
-
(
|
|
8550
|
+
let p = Ct(s, c);
|
|
8551
|
+
(Qr(p),
|
|
8427
8552
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
8428
8553
|
p.image_url &&
|
|
8429
8554
|
!p.first_frame_image &&
|
|
8430
8555
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
8431
8556
|
(p.first_frame_image = p.image_url));
|
|
8432
|
-
let d = new
|
|
8557
|
+
let d = new K(r, i),
|
|
8433
8558
|
m = ['image', 'first_frame_image', 'last_frame_image', 'lipsyncing_audio', 'audio', 'video'];
|
|
8434
|
-
for (let
|
|
8435
|
-
let
|
|
8436
|
-
if (typeof
|
|
8437
|
-
let
|
|
8438
|
-
if (
|
|
8439
|
-
let
|
|
8440
|
-
n ||
|
|
8559
|
+
for (let b of m) {
|
|
8560
|
+
let g = p[b];
|
|
8561
|
+
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
8562
|
+
let x = $.default.resolve(g);
|
|
8563
|
+
if (V.default.existsSync(x) && V.default.statSync(x).isFile()) {
|
|
8564
|
+
let I = new _(`Uploading local file ${$.default.basename(x)} to CDN...`);
|
|
8565
|
+
n || I.start();
|
|
8441
8566
|
try {
|
|
8442
|
-
let
|
|
8443
|
-
|
|
8444
|
-
((p[
|
|
8445
|
-
} catch (
|
|
8446
|
-
let
|
|
8567
|
+
let L = V.default.readFileSync(x),
|
|
8568
|
+
C = await d.uploadAsset(L.toString('base64'));
|
|
8569
|
+
((p[b] = C.url), n || I.succeed(`Uploaded ${$.default.basename(x)} to CDN`));
|
|
8570
|
+
} catch (L) {
|
|
8571
|
+
let C = L instanceof Error ? L.message : String(L);
|
|
8447
8572
|
(n
|
|
8448
8573
|
? process.stdout.write(
|
|
8449
|
-
JSON.stringify({ error:
|
|
8574
|
+
JSON.stringify({ error: C }) +
|
|
8450
8575
|
`
|
|
8451
8576
|
`,
|
|
8452
8577
|
)
|
|
8453
|
-
:
|
|
8578
|
+
: I.fail(`Upload failed: ${C}`),
|
|
8454
8579
|
process.exit(1));
|
|
8455
8580
|
}
|
|
8456
8581
|
}
|
|
8457
8582
|
}
|
|
8458
8583
|
}
|
|
8459
|
-
await
|
|
8460
|
-
let
|
|
8461
|
-
n ||
|
|
8584
|
+
await Zr(p, async (b) => {
|
|
8585
|
+
let g = new _(`Uploading local file ${$.default.basename(b)} to CDN...`);
|
|
8586
|
+
n || g.start();
|
|
8462
8587
|
try {
|
|
8463
|
-
let
|
|
8464
|
-
|
|
8465
|
-
return (n ||
|
|
8466
|
-
} catch (
|
|
8467
|
-
let
|
|
8588
|
+
let x = V.default.readFileSync(b),
|
|
8589
|
+
I = await d.uploadAsset(x.toString('base64'));
|
|
8590
|
+
return (n || g.succeed(`Uploaded ${$.default.basename(b)} to CDN`), I.url);
|
|
8591
|
+
} catch (x) {
|
|
8592
|
+
let I = x instanceof Error ? x.message : String(x);
|
|
8468
8593
|
(n
|
|
8469
8594
|
? process.stdout.write(
|
|
8470
|
-
JSON.stringify({ error:
|
|
8595
|
+
JSON.stringify({ error: I }) +
|
|
8471
8596
|
`
|
|
8472
8597
|
`,
|
|
8473
8598
|
)
|
|
8474
|
-
:
|
|
8599
|
+
: g.fail(`Upload failed: ${I}`),
|
|
8475
8600
|
process.exit(1));
|
|
8476
8601
|
}
|
|
8477
8602
|
});
|
|
8478
8603
|
let h = new _(`Submitting task for ${a.bold(e)}...`);
|
|
8479
8604
|
n || h.start();
|
|
8480
|
-
let
|
|
8605
|
+
let f;
|
|
8481
8606
|
try {
|
|
8482
8607
|
if (l > 1) {
|
|
8483
|
-
await
|
|
8608
|
+
await ti(d, e, p, l, { isJson: n, isAsync: o });
|
|
8484
8609
|
return;
|
|
8485
8610
|
}
|
|
8486
|
-
|
|
8487
|
-
} catch (
|
|
8488
|
-
let
|
|
8611
|
+
f = await d.queueJob(e, p);
|
|
8612
|
+
} catch (b) {
|
|
8613
|
+
let g = b instanceof w ? b : null;
|
|
8489
8614
|
(n
|
|
8490
8615
|
? process.stdout.write(
|
|
8491
8616
|
JSON.stringify(
|
|
8492
|
-
|
|
8493
|
-
? { error: { code:
|
|
8494
|
-
: { error: { code: null, message:
|
|
8617
|
+
g
|
|
8618
|
+
? { error: { code: g.code ?? null, message: g.message, ...g.fields } }
|
|
8619
|
+
: { error: { code: null, message: b instanceof Error ? b.message : String(b) } },
|
|
8495
8620
|
null,
|
|
8496
8621
|
2,
|
|
8497
8622
|
) +
|
|
@@ -8499,59 +8624,59 @@ async function De(e, t) {
|
|
|
8499
8624
|
`,
|
|
8500
8625
|
)
|
|
8501
8626
|
: h.fail(
|
|
8502
|
-
|
|
8503
|
-
?
|
|
8627
|
+
g
|
|
8628
|
+
? S(g).join(`
|
|
8504
8629
|
`)
|
|
8505
|
-
: `Failed to start generation: ${
|
|
8630
|
+
: `Failed to start generation: ${b instanceof Error ? b.message : b}`,
|
|
8506
8631
|
),
|
|
8507
|
-
process.exit(
|
|
8632
|
+
process.exit(g ? g.exitCode : v));
|
|
8508
8633
|
}
|
|
8509
8634
|
if (o) {
|
|
8510
8635
|
n
|
|
8511
8636
|
? process.stdout.write(
|
|
8512
|
-
JSON.stringify(
|
|
8637
|
+
JSON.stringify(f, null, 2) +
|
|
8513
8638
|
`
|
|
8514
8639
|
`,
|
|
8515
8640
|
)
|
|
8516
|
-
: (h.succeed(`Queued successfully! Request ID: ${a.bold(
|
|
8517
|
-
process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${
|
|
8641
|
+
: (h.succeed(`Queued successfully! Request ID: ${a.bold(f.request_id)}`),
|
|
8642
|
+
process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${f.request_id}`)}
|
|
8518
8643
|
`));
|
|
8519
8644
|
return;
|
|
8520
8645
|
}
|
|
8521
8646
|
let fe = Date.now(),
|
|
8522
8647
|
ge = 1500;
|
|
8523
|
-
for (;
|
|
8524
|
-
let
|
|
8525
|
-
(n || h.update(`Rendering ${a.bold(e)} (${
|
|
8526
|
-
await new Promise((
|
|
8648
|
+
for (; f.status === 'processing';) {
|
|
8649
|
+
let b = Math.round((Date.now() - fe) / 1e3);
|
|
8650
|
+
(n || h.update(`Rendering ${a.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
|
|
8651
|
+
await new Promise((g) => setTimeout(g, ge)));
|
|
8527
8652
|
try {
|
|
8528
|
-
|
|
8529
|
-
} catch (
|
|
8530
|
-
|
|
8531
|
-
|
|
8653
|
+
f = await d.getStatus(f.request_id);
|
|
8654
|
+
} catch (g) {
|
|
8655
|
+
g instanceof w &&
|
|
8656
|
+
g.exitCode !== v &&
|
|
8532
8657
|
(n ||
|
|
8533
8658
|
h.fail(
|
|
8534
|
-
|
|
8659
|
+
S(g).join(`
|
|
8535
8660
|
`),
|
|
8536
8661
|
),
|
|
8537
|
-
process.exit(
|
|
8662
|
+
process.exit(g.exitCode));
|
|
8538
8663
|
}
|
|
8539
8664
|
}
|
|
8540
8665
|
if (
|
|
8541
|
-
((
|
|
8666
|
+
((f.status === 'failed' || f.status === 'expired' || f.status === 'cancelled') &&
|
|
8542
8667
|
(n
|
|
8543
8668
|
? process.stdout.write(
|
|
8544
|
-
JSON.stringify(
|
|
8669
|
+
JSON.stringify(f, null, 2) +
|
|
8545
8670
|
`
|
|
8546
8671
|
`,
|
|
8547
8672
|
)
|
|
8548
|
-
: h.fail(`Generation ${
|
|
8549
|
-
process.exit(
|
|
8673
|
+
: h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
|
|
8674
|
+
process.exit(v)),
|
|
8550
8675
|
n || h.succeed(`Generation completed for ${a.bold(s?.name || e)}!`),
|
|
8551
8676
|
n)
|
|
8552
8677
|
) {
|
|
8553
8678
|
process.stdout.write(
|
|
8554
|
-
JSON.stringify(
|
|
8679
|
+
JSON.stringify(f, null, 2) +
|
|
8555
8680
|
`
|
|
8556
8681
|
`,
|
|
8557
8682
|
);
|
|
@@ -8562,47 +8687,51 @@ async function De(e, t) {
|
|
|
8562
8687
|
`),
|
|
8563
8688
|
process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
|
|
8564
8689
|
`),
|
|
8565
|
-
process.stdout.write(` ${a.bold('Request ID:')} ${
|
|
8690
|
+
process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
|
|
8566
8691
|
`),
|
|
8567
|
-
|
|
8568
|
-
process.stdout.write(` ${a.bold('Cost:')} ${
|
|
8692
|
+
f.usage?.cost !== void 0 &&
|
|
8693
|
+
process.stdout.write(` ${a.bold('Cost:')} ${we(f.usage.cost)}
|
|
8569
8694
|
`),
|
|
8570
|
-
|
|
8695
|
+
f.output && f.output.length > 0)
|
|
8571
8696
|
) {
|
|
8572
8697
|
process.stdout.write(`
|
|
8573
8698
|
${a.bold('Outputs:')}
|
|
8574
8699
|
`);
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8700
|
+
let b = f.output.filter((x) => x.url).length,
|
|
8701
|
+
g = 0;
|
|
8702
|
+
for (let x = 0; x < f.output.length; x++) {
|
|
8703
|
+
let I = f.output[x];
|
|
8704
|
+
if (I.url) {
|
|
8705
|
+
let L = I.layer?.name ? ` ${a.bold(I.layer.name)}` : '';
|
|
8578
8706
|
if (
|
|
8579
|
-
(process.stdout.write(` [${
|
|
8707
|
+
(process.stdout.write(` [${I.type.toUpperCase()}]${L} ${a.cyan(a.underline(I.url))}
|
|
8580
8708
|
`),
|
|
8581
8709
|
u)
|
|
8582
8710
|
) {
|
|
8583
|
-
let
|
|
8711
|
+
let C = ri(u, g++, b),
|
|
8712
|
+
He = new _(`Downloading output to ${C}...`).start();
|
|
8584
8713
|
try {
|
|
8585
|
-
(await d.downloadOutput(
|
|
8586
|
-
|
|
8587
|
-
} catch (
|
|
8588
|
-
|
|
8714
|
+
(await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
|
|
8715
|
+
He.succeed(`Saved to ${a.bold(C)}`));
|
|
8716
|
+
} catch (he) {
|
|
8717
|
+
He.fail(`Failed to download: ${he instanceof Error ? he.message : he}`);
|
|
8589
8718
|
}
|
|
8590
8719
|
}
|
|
8591
8720
|
} else
|
|
8592
|
-
|
|
8721
|
+
I.text &&
|
|
8593
8722
|
process.stdout.write(`
|
|
8594
|
-
${
|
|
8723
|
+
${I.text}
|
|
8595
8724
|
`);
|
|
8596
8725
|
}
|
|
8597
8726
|
}
|
|
8598
8727
|
process.stdout.write(`
|
|
8599
8728
|
`);
|
|
8600
8729
|
}
|
|
8601
|
-
var
|
|
8602
|
-
|
|
8603
|
-
async function
|
|
8730
|
+
var Ot = T(require('node:readline'));
|
|
8731
|
+
A();
|
|
8732
|
+
async function ii(e) {
|
|
8604
8733
|
try {
|
|
8605
|
-
return (await new
|
|
8734
|
+
return (await new K(e, P()).checkKey(), 'ok');
|
|
8606
8735
|
} catch (t) {
|
|
8607
8736
|
if (t instanceof w) {
|
|
8608
8737
|
if (t.status === 401) return 'invalid';
|
|
@@ -8611,15 +8740,15 @@ async function ei(e) {
|
|
|
8611
8740
|
return 'unchecked';
|
|
8612
8741
|
}
|
|
8613
8742
|
}
|
|
8614
|
-
function
|
|
8615
|
-
let t =
|
|
8743
|
+
function ai(e) {
|
|
8744
|
+
let t = Ot.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
8616
8745
|
return new Promise((r) => {
|
|
8617
8746
|
t.question(e, (i) => {
|
|
8618
8747
|
(t.close(), r(i.trim()));
|
|
8619
8748
|
});
|
|
8620
8749
|
});
|
|
8621
8750
|
}
|
|
8622
|
-
async function
|
|
8751
|
+
async function Q(e, t) {
|
|
8623
8752
|
switch (e) {
|
|
8624
8753
|
case 'login':
|
|
8625
8754
|
case 'set-key': {
|
|
@@ -8631,20 +8760,20 @@ ${a.bold('Tein AI Authentication')}
|
|
|
8631
8760
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
8632
8761
|
|
|
8633
8762
|
`),
|
|
8634
|
-
(r = await
|
|
8763
|
+
(r = await ai('Enter your Tein API Key (sk_live_...): '))),
|
|
8635
8764
|
!r.startsWith('sk_live_') &&
|
|
8636
8765
|
!r.startsWith('sk_test_') &&
|
|
8637
8766
|
(process.stderr
|
|
8638
8767
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
8639
8768
|
`),
|
|
8640
8769
|
process.exit(1)));
|
|
8641
|
-
let i = await
|
|
8770
|
+
let i = await ii(r);
|
|
8642
8771
|
(i === 'invalid' &&
|
|
8643
8772
|
(process.stderr
|
|
8644
8773
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
8645
8774
|
`),
|
|
8646
8775
|
process.exit(1)),
|
|
8647
|
-
|
|
8776
|
+
ke({ apiKey: r }),
|
|
8648
8777
|
process.stdout.write(`
|
|
8649
8778
|
${a.green('\u2713')} API key saved to ${a.dim(re())}
|
|
8650
8779
|
`),
|
|
@@ -8663,22 +8792,22 @@ ${a.green('\u2713')} API key saved to ${a.dim(re())}
|
|
|
8663
8792
|
break;
|
|
8664
8793
|
}
|
|
8665
8794
|
case 'logout': {
|
|
8666
|
-
if (!
|
|
8795
|
+
if (!U().apiKey) {
|
|
8667
8796
|
process.stdout
|
|
8668
8797
|
.write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
|
|
8669
8798
|
`);
|
|
8670
8799
|
break;
|
|
8671
8800
|
}
|
|
8672
|
-
(
|
|
8801
|
+
(ke({ apiKey: '' }),
|
|
8673
8802
|
process.stdout
|
|
8674
8803
|
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(re())}
|
|
8675
8804
|
`));
|
|
8676
8805
|
break;
|
|
8677
8806
|
}
|
|
8678
8807
|
default: {
|
|
8679
|
-
let r =
|
|
8680
|
-
i =
|
|
8681
|
-
s =
|
|
8808
|
+
let r = q(),
|
|
8809
|
+
i = P(),
|
|
8810
|
+
s = U();
|
|
8682
8811
|
if (
|
|
8683
8812
|
(process.stdout.write(`
|
|
8684
8813
|
${a.bold('Tein AI CLI Configuration')}
|
|
@@ -8707,32 +8836,32 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
8707
8836
|
}
|
|
8708
8837
|
}
|
|
8709
8838
|
}
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
var
|
|
8714
|
-
async function
|
|
8839
|
+
A();
|
|
8840
|
+
xe();
|
|
8841
|
+
W();
|
|
8842
|
+
var si = 3e3;
|
|
8843
|
+
async function Rt(e) {
|
|
8715
8844
|
try {
|
|
8716
|
-
let t = await fetch(`${
|
|
8845
|
+
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(si) });
|
|
8717
8846
|
if (!t.ok) return;
|
|
8718
8847
|
let r = await t.json(),
|
|
8719
8848
|
i = {};
|
|
8720
8849
|
for (let s of r.configs ?? []) {
|
|
8721
8850
|
let n = String(s.modelSlug ?? '');
|
|
8722
|
-
|
|
8851
|
+
G.has(n) && (i[n] ??= []).push(Number(s.starterPrice));
|
|
8723
8852
|
}
|
|
8724
|
-
|
|
8853
|
+
vt(i);
|
|
8725
8854
|
} catch {}
|
|
8726
8855
|
}
|
|
8727
|
-
var
|
|
8728
|
-
|
|
8729
|
-
async function
|
|
8730
|
-
await
|
|
8731
|
-
let r =
|
|
8856
|
+
var ni = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
8857
|
+
oi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
8858
|
+
async function Dt(e, t) {
|
|
8859
|
+
await Rt(t);
|
|
8860
|
+
let r = R();
|
|
8732
8861
|
if (e) {
|
|
8733
8862
|
let n = e.toLowerCase(),
|
|
8734
|
-
o =
|
|
8735
|
-
r =
|
|
8863
|
+
o = oi[n] ?? n;
|
|
8864
|
+
r = ni.has(o)
|
|
8736
8865
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
8737
8866
|
: r.filter((u) => u.kind.toLowerCase().includes(n) || u.slug.toLowerCase().includes(n));
|
|
8738
8867
|
}
|
|
@@ -8770,9 +8899,9 @@ ${a.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
|
8770
8899
|
|
|
8771
8900
|
`);
|
|
8772
8901
|
}
|
|
8773
|
-
async function
|
|
8774
|
-
|
|
8775
|
-
let r =
|
|
8902
|
+
async function Lt(e, t) {
|
|
8903
|
+
G.has(e) && (await Rt(t));
|
|
8904
|
+
let r = j(e);
|
|
8776
8905
|
(r ||
|
|
8777
8906
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
8778
8907
|
`),
|
|
@@ -8851,10 +8980,10 @@ ${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
|
|
|
8851
8980
|
|
|
8852
8981
|
`);
|
|
8853
8982
|
}
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
var
|
|
8857
|
-
|
|
8983
|
+
A();
|
|
8984
|
+
Ve();
|
|
8985
|
+
var li = 1e4,
|
|
8986
|
+
Ue = {
|
|
8858
8987
|
price: '',
|
|
8859
8988
|
creativeMode: 'Creative mode',
|
|
8860
8989
|
priority: 'Priority',
|
|
@@ -8864,22 +8993,22 @@ var si = 1e4,
|
|
|
8864
8993
|
priorityDraft: 'Priority + Draft',
|
|
8865
8994
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
8866
8995
|
},
|
|
8867
|
-
|
|
8868
|
-
|
|
8996
|
+
pi = Object.keys(Ue),
|
|
8997
|
+
di = {
|
|
8869
8998
|
creativeMode: 'unfiltered',
|
|
8870
8999
|
creativeModePriority: 'unfilteredPriority',
|
|
8871
9000
|
creativeModeDraft: 'unfilteredDraft',
|
|
8872
9001
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
8873
9002
|
};
|
|
8874
|
-
function
|
|
8875
|
-
let r =
|
|
9003
|
+
function ci(e, t) {
|
|
9004
|
+
let r = di[t];
|
|
8876
9005
|
return e[t] ?? (r ? e[r] : void 0);
|
|
8877
9006
|
}
|
|
8878
|
-
async function
|
|
8879
|
-
let r = `${
|
|
9007
|
+
async function ui(e, t) {
|
|
9008
|
+
let r = `${P(e)}${me(t)}`,
|
|
8880
9009
|
i;
|
|
8881
9010
|
try {
|
|
8882
|
-
i = await fetch(r, { signal: AbortSignal.timeout(
|
|
9011
|
+
i = await fetch(r, { signal: AbortSignal.timeout(li) });
|
|
8883
9012
|
} catch {
|
|
8884
9013
|
throw new Error(`Could not reach ${r}`);
|
|
8885
9014
|
}
|
|
@@ -8895,18 +9024,18 @@ async function pi(e, t) {
|
|
|
8895
9024
|
}
|
|
8896
9025
|
return s;
|
|
8897
9026
|
}
|
|
8898
|
-
function
|
|
9027
|
+
function Ne(e) {
|
|
8899
9028
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
8900
9029
|
[r, i = ''] = t.split('.');
|
|
8901
9030
|
return `$${r}.${i.padEnd(2, '0')}`;
|
|
8902
9031
|
}
|
|
8903
|
-
function
|
|
9032
|
+
function Be(e) {
|
|
8904
9033
|
if (!e || typeof e.starter != 'number') return null;
|
|
8905
9034
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
8906
9035
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
8907
|
-
return `Starter ${
|
|
9036
|
+
return `Starter ${Ne(e.starter)} Plus ${Ne(t)} Scale ${Ne(r)}`;
|
|
8908
9037
|
}
|
|
8909
|
-
function
|
|
9038
|
+
function mi(e) {
|
|
8910
9039
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
8911
9040
|
let t = [];
|
|
8912
9041
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -8918,33 +9047,33 @@ function di(e) {
|
|
|
8918
9047
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
8919
9048
|
);
|
|
8920
9049
|
}
|
|
8921
|
-
function
|
|
8922
|
-
let r =
|
|
8923
|
-
for (let i of
|
|
8924
|
-
let s =
|
|
9050
|
+
function fi(e, t) {
|
|
9051
|
+
let r = mi(e);
|
|
9052
|
+
for (let i of pi) {
|
|
9053
|
+
let s = Be(ci(e, i));
|
|
8925
9054
|
if (!s) continue;
|
|
8926
|
-
let n =
|
|
9055
|
+
let n = Ue[i] ? ` (${Ue[i]})` : '';
|
|
8927
9056
|
t.push(` ${r}${n} ${s}`);
|
|
8928
9057
|
}
|
|
8929
9058
|
}
|
|
8930
|
-
function
|
|
9059
|
+
function gi(e, t) {
|
|
8931
9060
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
8932
9061
|
t.push(
|
|
8933
9062
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
8934
9063
|
);
|
|
8935
|
-
for (let s of e.variants ?? [])
|
|
9064
|
+
for (let s of e.variants ?? []) fi(s, t);
|
|
8936
9065
|
let i = e.addons;
|
|
8937
9066
|
if (Array.isArray(i))
|
|
8938
9067
|
for (let s of i) {
|
|
8939
9068
|
if (!s || typeof s != 'object') continue;
|
|
8940
9069
|
let n = s,
|
|
8941
9070
|
o = typeof n.label == 'string' ? n.label : String(n.id ?? 'add-on'),
|
|
8942
|
-
u =
|
|
9071
|
+
u = Be(n.price);
|
|
8943
9072
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
8944
9073
|
}
|
|
8945
9074
|
t.push('');
|
|
8946
9075
|
}
|
|
8947
|
-
function
|
|
9076
|
+
function hi(e) {
|
|
8948
9077
|
let t = [],
|
|
8949
9078
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
8950
9079
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
|
|
@@ -8966,7 +9095,7 @@ function mi(e) {
|
|
|
8966
9095
|
});
|
|
8967
9096
|
for (let l of n) {
|
|
8968
9097
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
8969
|
-
for (let c of i.get(l) ?? [])
|
|
9098
|
+
for (let c of i.get(l) ?? []) gi(c, t);
|
|
8970
9099
|
}
|
|
8971
9100
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
8972
9101
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -8983,8 +9112,8 @@ function mi(e) {
|
|
|
8983
9112
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
8984
9113
|
for (let m of p) {
|
|
8985
9114
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
8986
|
-
|
|
8987
|
-
|
|
9115
|
+
f = Be(m.prices);
|
|
9116
|
+
f && t.push(` ${h} ${f}`);
|
|
8988
9117
|
}
|
|
8989
9118
|
t.push('');
|
|
8990
9119
|
}
|
|
@@ -8996,10 +9125,10 @@ function mi(e) {
|
|
|
8996
9125
|
`
|
|
8997
9126
|
);
|
|
8998
9127
|
}
|
|
8999
|
-
async function
|
|
9128
|
+
async function Vt(e) {
|
|
9000
9129
|
let t;
|
|
9001
9130
|
try {
|
|
9002
|
-
t = await
|
|
9131
|
+
t = await ui(e.apiUrl, e.model);
|
|
9003
9132
|
} catch (r) {
|
|
9004
9133
|
let i = r instanceof Error ? r.message : String(r);
|
|
9005
9134
|
(process.stderr.write(`${a.red('Error:')} ${i}
|
|
@@ -9010,14 +9139,14 @@ async function Dt(e) {
|
|
|
9010
9139
|
e.json
|
|
9011
9140
|
? `${JSON.stringify(t, null, 2)}
|
|
9012
9141
|
`
|
|
9013
|
-
:
|
|
9142
|
+
: hi(t),
|
|
9014
9143
|
);
|
|
9015
9144
|
}
|
|
9016
|
-
var
|
|
9017
|
-
|
|
9018
|
-
async function
|
|
9019
|
-
let r =
|
|
9020
|
-
i =
|
|
9145
|
+
var Nt = T(require('node:path'));
|
|
9146
|
+
A();
|
|
9147
|
+
async function Ut(e, t) {
|
|
9148
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9149
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9021
9150
|
(r ||
|
|
9022
9151
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
9023
9152
|
`),
|
|
@@ -9034,7 +9163,7 @@ async function Vt(e, t) {
|
|
|
9034
9163
|
let s = !!t.json,
|
|
9035
9164
|
n = !!t.wait,
|
|
9036
9165
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
9037
|
-
u = new
|
|
9166
|
+
u = new K(r, i),
|
|
9038
9167
|
l = new _(`Checking status of ${a.bold(e)}...`);
|
|
9039
9168
|
s || l.start();
|
|
9040
9169
|
let c;
|
|
@@ -9053,12 +9182,12 @@ async function Vt(e, t) {
|
|
|
9053
9182
|
`,
|
|
9054
9183
|
)
|
|
9055
9184
|
: l.fail(
|
|
9056
|
-
|
|
9185
|
+
S(p).join(`
|
|
9057
9186
|
`),
|
|
9058
9187
|
),
|
|
9059
9188
|
process.exit(p.exitCode)),
|
|
9060
9189
|
s || l.fail(p instanceof Error ? p.message : String(p)),
|
|
9061
|
-
process.exit(
|
|
9190
|
+
process.exit(v));
|
|
9062
9191
|
}
|
|
9063
9192
|
if (n && c.status === 'processing') {
|
|
9064
9193
|
let p = Date.now();
|
|
@@ -9110,7 +9239,7 @@ ${a.bold('Outputs:')}
|
|
|
9110
9239
|
) {
|
|
9111
9240
|
let d = new _(`Downloading output to ${o}...`).start();
|
|
9112
9241
|
try {
|
|
9113
|
-
(await u.downloadOutput(p.url,
|
|
9242
|
+
(await u.downloadOutput(p.url, Nt.default.resolve(process.cwd(), o)),
|
|
9114
9243
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
9115
9244
|
} catch (m) {
|
|
9116
9245
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -9125,12 +9254,12 @@ ${p.text}
|
|
|
9125
9254
|
process.stdout.write(`
|
|
9126
9255
|
`);
|
|
9127
9256
|
}
|
|
9128
|
-
var
|
|
9129
|
-
Fe =
|
|
9130
|
-
|
|
9131
|
-
async function
|
|
9132
|
-
let r =
|
|
9133
|
-
i =
|
|
9257
|
+
var je = T(require('node:fs')),
|
|
9258
|
+
Fe = T(require('node:path'));
|
|
9259
|
+
A();
|
|
9260
|
+
async function Bt(e, t = {}) {
|
|
9261
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9262
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9134
9263
|
s = !!t.json;
|
|
9135
9264
|
(r ||
|
|
9136
9265
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
@@ -9146,13 +9275,13 @@ async function Nt(e, t = {}) {
|
|
|
9146
9275
|
`),
|
|
9147
9276
|
process.exit(1)));
|
|
9148
9277
|
let n = Fe.default.resolve(e);
|
|
9149
|
-
|
|
9278
|
+
je.default.existsSync(n) ||
|
|
9150
9279
|
(process.stderr.write(`${a.red('Error:')} File not found: ${n}
|
|
9151
9280
|
`),
|
|
9152
9281
|
process.exit(1));
|
|
9153
9282
|
let o = Fe.default.basename(n),
|
|
9154
|
-
l =
|
|
9155
|
-
c = new
|
|
9283
|
+
l = je.default.readFileSync(n).toString('base64'),
|
|
9284
|
+
c = new K(r, i),
|
|
9156
9285
|
p = new _(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
9157
9286
|
s || p.start();
|
|
9158
9287
|
try {
|
|
@@ -9177,7 +9306,7 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
9177
9306
|
} catch (d) {
|
|
9178
9307
|
let m = d instanceof w ? d : null,
|
|
9179
9308
|
h = m
|
|
9180
|
-
?
|
|
9309
|
+
? S(m).join(`
|
|
9181
9310
|
`)
|
|
9182
9311
|
: d instanceof Error
|
|
9183
9312
|
? d.message
|
|
@@ -9189,12 +9318,12 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
9189
9318
|
`,
|
|
9190
9319
|
)
|
|
9191
9320
|
: p.fail(`Upload failed: ${h}`),
|
|
9192
|
-
process.exit(m ? m.exitCode :
|
|
9321
|
+
process.exit(m ? m.exitCode : v));
|
|
9193
9322
|
}
|
|
9194
9323
|
}
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
function
|
|
9324
|
+
W();
|
|
9325
|
+
qe();
|
|
9326
|
+
function ar() {
|
|
9198
9327
|
process.stdout.write(`
|
|
9199
9328
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9200
9329
|
|
|
@@ -9254,11 +9383,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
9254
9383
|
|
|
9255
9384
|
`);
|
|
9256
9385
|
}
|
|
9257
|
-
async function
|
|
9386
|
+
async function Ai() {
|
|
9258
9387
|
let e = process.argv.slice(2),
|
|
9259
|
-
t =
|
|
9388
|
+
t = At(e);
|
|
9260
9389
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
9261
|
-
|
|
9390
|
+
ar();
|
|
9262
9391
|
return;
|
|
9263
9392
|
}
|
|
9264
9393
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -9268,31 +9397,31 @@ async function $i() {
|
|
|
9268
9397
|
}
|
|
9269
9398
|
switch (t.command) {
|
|
9270
9399
|
case 'auth': {
|
|
9271
|
-
await
|
|
9400
|
+
await Q(t.subcommand, t.options.key);
|
|
9272
9401
|
break;
|
|
9273
9402
|
}
|
|
9274
9403
|
case 'login': {
|
|
9275
|
-
await
|
|
9404
|
+
await Q('login', t.options.key);
|
|
9276
9405
|
break;
|
|
9277
9406
|
}
|
|
9278
9407
|
case 'logout': {
|
|
9279
|
-
await
|
|
9408
|
+
await Q('logout');
|
|
9280
9409
|
break;
|
|
9281
9410
|
}
|
|
9282
9411
|
case 'whoami': {
|
|
9283
|
-
await
|
|
9412
|
+
await Q('status');
|
|
9284
9413
|
break;
|
|
9285
9414
|
}
|
|
9286
9415
|
case 'models':
|
|
9287
9416
|
case 'list': {
|
|
9288
|
-
await
|
|
9417
|
+
await Dt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
9289
9418
|
break;
|
|
9290
9419
|
}
|
|
9291
9420
|
case 'pricing':
|
|
9292
9421
|
case 'prices': {
|
|
9293
9422
|
let r = t.options.model,
|
|
9294
9423
|
i = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
9295
|
-
await
|
|
9424
|
+
await Vt({
|
|
9296
9425
|
model: i,
|
|
9297
9426
|
json: !!t.options.json,
|
|
9298
9427
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -9307,56 +9436,56 @@ async function $i() {
|
|
|
9307
9436
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
9308
9437
|
`),
|
|
9309
9438
|
process.exit(1)),
|
|
9310
|
-
await
|
|
9439
|
+
await Lt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
9311
9440
|
break;
|
|
9312
9441
|
}
|
|
9313
9442
|
case 'upload': {
|
|
9314
9443
|
let r = t.subcommand || '';
|
|
9315
|
-
await
|
|
9444
|
+
await Bt(r, t.options);
|
|
9316
9445
|
break;
|
|
9317
9446
|
}
|
|
9318
9447
|
case 'run':
|
|
9319
9448
|
case 'generate': {
|
|
9320
9449
|
let r = t.subcommand || '';
|
|
9321
|
-
await
|
|
9450
|
+
await Le(r, t.options);
|
|
9322
9451
|
break;
|
|
9323
9452
|
}
|
|
9324
9453
|
case 'status': {
|
|
9325
9454
|
let r = t.subcommand || '';
|
|
9326
|
-
await
|
|
9455
|
+
await Ut(r, t.options);
|
|
9327
9456
|
break;
|
|
9328
9457
|
}
|
|
9329
9458
|
case 'mcp': {
|
|
9330
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
9459
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (ir(), rr));
|
|
9331
9460
|
await r();
|
|
9332
9461
|
break;
|
|
9333
9462
|
}
|
|
9334
9463
|
default: {
|
|
9335
9464
|
if (t.command && !t.command.startsWith('-')) {
|
|
9336
|
-
(!
|
|
9465
|
+
(!j(t.command) &&
|
|
9337
9466
|
!pe[t.command] &&
|
|
9338
9467
|
(process.stderr.write(`
|
|
9339
9468
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
9340
9469
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
9341
9470
|
`),
|
|
9342
|
-
process.exit(
|
|
9343
|
-
await
|
|
9471
|
+
process.exit(v)),
|
|
9472
|
+
await Le(t.command, t.options));
|
|
9344
9473
|
return;
|
|
9345
9474
|
}
|
|
9346
|
-
|
|
9475
|
+
ar();
|
|
9347
9476
|
break;
|
|
9348
9477
|
}
|
|
9349
9478
|
}
|
|
9350
9479
|
}
|
|
9351
|
-
|
|
9480
|
+
Ai().catch((e) => {
|
|
9352
9481
|
(e instanceof w &&
|
|
9353
9482
|
(process.stderr.write(`
|
|
9354
|
-
${a.red('Error:')} ${
|
|
9483
|
+
${a.red('Error:')} ${S(e).join(`
|
|
9355
9484
|
`)}
|
|
9356
9485
|
`),
|
|
9357
9486
|
process.exit(e.exitCode)),
|
|
9358
9487
|
process.stderr.write(`
|
|
9359
9488
|
${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
9360
9489
|
`),
|
|
9361
|
-
process.exit(
|
|
9490
|
+
process.exit(v));
|
|
9362
9491
|
});
|