@teinai/cli 1.1.39 → 1.1.40
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 +675 -642
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var Zi = Object.create;
|
|
4
|
+
var ve = Object.defineProperty;
|
|
5
|
+
var ea = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var ta = Object.getOwnPropertyNames;
|
|
7
|
+
var ia = Object.getPrototypeOf,
|
|
8
|
+
aa = Object.prototype.hasOwnProperty;
|
|
9
9
|
var h = (e, t, i) => () => {
|
|
10
10
|
if (i) throw i[0];
|
|
11
11
|
try {
|
|
@@ -14,45 +14,45 @@ var h = (e, t, i) => () => {
|
|
|
14
14
|
throw ((i = [a]), a);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var i in t)
|
|
17
|
+
var ra = (e, t) => {
|
|
18
|
+
for (var i in t) ve(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
na = (e, t, i, a) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let n of
|
|
23
|
-
!
|
|
22
|
+
for (let n of ta(t))
|
|
23
|
+
!aa.call(e, n) &&
|
|
24
24
|
n !== i &&
|
|
25
|
-
|
|
25
|
+
ve(e, n, { get: () => t[n], enumerable: !(a = ea(t, n)) || a.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
28
|
var T = (e, t, i) => (
|
|
29
|
-
(i = e != null ?
|
|
30
|
-
|
|
29
|
+
(i = e != null ? Zi(ia(e)) : {}),
|
|
30
|
+
na(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function la(e) {
|
|
33
33
|
for (let t of e)
|
|
34
34
|
try {
|
|
35
|
-
let i = JSON.parse(
|
|
35
|
+
let i = JSON.parse(ft.default.readFileSync(t, 'utf8'));
|
|
36
36
|
if (i.name === '@teinai/cli' && typeof i.version == 'string' && i.version.trim())
|
|
37
37
|
return i.version.trim();
|
|
38
38
|
} catch {}
|
|
39
|
-
return
|
|
39
|
+
return oa;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function da() {
|
|
42
42
|
let e = typeof __dirname == 'string' ? __dirname : process.cwd();
|
|
43
43
|
return [
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
Te.default.join(e, 'package.json'),
|
|
45
|
+
Te.default.join(e, '..', '..', 'cli-package', 'package.json'),
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
var ft,
|
|
49
|
+
Te,
|
|
50
|
+
oa,
|
|
51
51
|
F,
|
|
52
52
|
re = h(() => {
|
|
53
53
|
'use strict';
|
|
54
|
-
((
|
|
55
|
-
F =
|
|
54
|
+
((ft = T(require('node:fs'))), (Te = T(require('node:path'))), (oa = '0.0.0-dev'));
|
|
55
|
+
F = la(da());
|
|
56
56
|
});
|
|
57
57
|
function j() {
|
|
58
58
|
try {
|
|
@@ -63,7 +63,7 @@ function j() {
|
|
|
63
63
|
} catch {}
|
|
64
64
|
return {};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Ke(e) {
|
|
67
67
|
try {
|
|
68
68
|
R.default.existsSync(se) || R.default.mkdirSync(se, { recursive: !0, mode: 448 });
|
|
69
69
|
let i = { ...j(), ...e };
|
|
@@ -92,41 +92,41 @@ function oe() {
|
|
|
92
92
|
return B;
|
|
93
93
|
}
|
|
94
94
|
var R,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
kt,
|
|
96
|
+
Me,
|
|
97
97
|
se,
|
|
98
98
|
B,
|
|
99
99
|
$ = h(() => {
|
|
100
100
|
'use strict';
|
|
101
101
|
((R = T(require('node:fs'))),
|
|
102
|
-
(
|
|
103
|
-
(
|
|
104
|
-
(se =
|
|
105
|
-
(B =
|
|
102
|
+
(kt = T(require('node:os'))),
|
|
103
|
+
(Me = T(require('node:path'))),
|
|
104
|
+
(se = Me.default.join(kt.default.homedir(), '.tein')),
|
|
105
|
+
(B = Me.default.join(se, 'config.json')));
|
|
106
106
|
});
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
var fa,
|
|
108
|
+
wt,
|
|
109
|
+
xt,
|
|
110
|
+
_t = h(() => {
|
|
111
111
|
'use strict';
|
|
112
|
-
((
|
|
113
|
-
(
|
|
114
|
-
(
|
|
112
|
+
((fa = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
|
|
113
|
+
(wt = [...fa, 'auto']),
|
|
114
|
+
(xt =
|
|
115
115
|
'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
|
|
116
116
|
});
|
|
117
117
|
var J,
|
|
118
|
-
|
|
118
|
+
Ee = h(() => {
|
|
119
119
|
'use strict';
|
|
120
120
|
J = new Set([]);
|
|
121
121
|
});
|
|
122
122
|
function W(e) {
|
|
123
123
|
return !1;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
125
|
+
var Pt = h(() => {
|
|
126
126
|
'use strict';
|
|
127
127
|
});
|
|
128
128
|
var le,
|
|
129
|
-
|
|
129
|
+
It = h(() => {
|
|
130
130
|
'use strict';
|
|
131
131
|
le = {
|
|
132
132
|
source: 'TEIN Price Board',
|
|
@@ -6240,14 +6240,14 @@ var le,
|
|
|
6240
6240
|
],
|
|
6241
6241
|
};
|
|
6242
6242
|
});
|
|
6243
|
-
var
|
|
6244
|
-
|
|
6243
|
+
var vt,
|
|
6244
|
+
Tt = h(() => {
|
|
6245
6245
|
'use strict';
|
|
6246
|
-
|
|
6246
|
+
vt = [];
|
|
6247
6247
|
});
|
|
6248
6248
|
var de,
|
|
6249
|
-
|
|
6250
|
-
|
|
6249
|
+
Mt,
|
|
6250
|
+
Ce = h(() => {
|
|
6251
6251
|
'use strict';
|
|
6252
6252
|
((de = [
|
|
6253
6253
|
{
|
|
@@ -6324,12 +6324,12 @@ var de,
|
|
|
6324
6324
|
from: { variant: 'swap' },
|
|
6325
6325
|
},
|
|
6326
6326
|
]),
|
|
6327
|
-
(
|
|
6327
|
+
(Mt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
6328
6328
|
});
|
|
6329
|
-
function
|
|
6329
|
+
function Oe(e, t) {
|
|
6330
6330
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
6331
6331
|
}
|
|
6332
|
-
function
|
|
6332
|
+
function ya(e, t) {
|
|
6333
6333
|
if (e === 'seedance-2-mini') return 'mini';
|
|
6334
6334
|
if (e !== 'seedance-2') return;
|
|
6335
6335
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -6339,97 +6339,98 @@ function pa(e, t) {
|
|
|
6339
6339
|
? 'fast'
|
|
6340
6340
|
: 'standard';
|
|
6341
6341
|
}
|
|
6342
|
-
function
|
|
6342
|
+
function ba(e, t) {
|
|
6343
6343
|
let i = e
|
|
6344
6344
|
.trim()
|
|
6345
6345
|
.toLowerCase()
|
|
6346
6346
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
6347
6347
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
6348
|
-
let n =
|
|
6349
|
-
s =
|
|
6348
|
+
let n = ya(i, t),
|
|
6349
|
+
s = $e.get(Oe('seedance-2', n));
|
|
6350
6350
|
return s ? s.slug : null;
|
|
6351
6351
|
}
|
|
6352
|
-
let a = pe.get(i) ??
|
|
6352
|
+
let a = pe.get(i) ?? $e.get(Oe(i));
|
|
6353
6353
|
return a ? a.slug : null;
|
|
6354
6354
|
}
|
|
6355
|
-
function
|
|
6356
|
-
return pe.has(e) && !(
|
|
6355
|
+
function wa(e, t) {
|
|
6356
|
+
return pe.has(e) && !(ka.has(e) && t) ? e : ba(e, t);
|
|
6357
6357
|
}
|
|
6358
6358
|
function Y(e, t) {
|
|
6359
|
-
let i =
|
|
6359
|
+
let i = wa(e, t);
|
|
6360
6360
|
return i ? (pe.get(i) ?? null) : null;
|
|
6361
6361
|
}
|
|
6362
6362
|
function ce() {
|
|
6363
|
-
return
|
|
6363
|
+
return Ct;
|
|
6364
6364
|
}
|
|
6365
|
-
var
|
|
6366
|
-
Mt,
|
|
6367
|
-
Kt,
|
|
6365
|
+
var qe,
|
|
6368
6366
|
St,
|
|
6369
|
-
|
|
6367
|
+
Et,
|
|
6368
|
+
Ct,
|
|
6369
|
+
ga,
|
|
6370
6370
|
pe,
|
|
6371
|
-
Ce,
|
|
6372
|
-
Tt,
|
|
6373
|
-
da,
|
|
6374
6371
|
$e,
|
|
6375
|
-
|
|
6372
|
+
Kt,
|
|
6373
|
+
ha,
|
|
6374
|
+
Ae,
|
|
6375
|
+
ka,
|
|
6376
6376
|
G = h(() => {
|
|
6377
6377
|
'use strict';
|
|
6378
|
-
|
|
6379
|
-
_t();
|
|
6378
|
+
Pt();
|
|
6380
6379
|
It();
|
|
6381
|
-
|
|
6382
|
-
(
|
|
6380
|
+
Tt();
|
|
6381
|
+
Ce();
|
|
6382
|
+
((qe = {
|
|
6383
6383
|
...le,
|
|
6384
6384
|
families: le.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
|
|
6385
6385
|
models: le.models.filter((e) => !W(e.slug)),
|
|
6386
6386
|
}),
|
|
6387
|
-
(
|
|
6388
|
-
(
|
|
6389
|
-
(
|
|
6390
|
-
(
|
|
6391
|
-
...
|
|
6392
|
-
let t =
|
|
6387
|
+
(St = de.filter((e) => !W(e.slug))),
|
|
6388
|
+
(Et = vt.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
|
|
6389
|
+
(Ct = [...qe.models, ...Et, ...St]),
|
|
6390
|
+
(ga = [
|
|
6391
|
+
...qe.families.map((e) => {
|
|
6392
|
+
let t = Et.filter((i) => i.family === e.slug).map((i) => i.slug);
|
|
6393
6393
|
return t.length ? { ...e, models: [...e.models, ...t] } : e;
|
|
6394
6394
|
}),
|
|
6395
|
-
...
|
|
6396
|
-
|
|
6397
|
-
.filter((
|
|
6395
|
+
...Mt.map((e) => ({
|
|
6396
|
+
...e,
|
|
6397
|
+
models: St.filter((t) => t.family === e.slug).map((t) => t.slug),
|
|
6398
|
+
})).filter((e) => e.models.length > 0),
|
|
6398
6399
|
]),
|
|
6399
6400
|
(pe = new Map()),
|
|
6400
|
-
(
|
|
6401
|
-
(
|
|
6402
|
-
(
|
|
6403
|
-
(
|
|
6404
|
-
for (let e of
|
|
6405
|
-
(pe.set(e.slug, e),
|
|
6406
|
-
for (let t of e.variants)
|
|
6401
|
+
($e = new Map()),
|
|
6402
|
+
(Kt = new Map()),
|
|
6403
|
+
(ha = new Map()),
|
|
6404
|
+
(Ae = new Map()));
|
|
6405
|
+
for (let e of Ct) {
|
|
6406
|
+
(pe.set(e.slug, e), $e.set(Oe(e.api.model, e.api.quality), e));
|
|
6407
|
+
for (let t of e.variants) Kt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
6407
6408
|
for (let t of e.editVariants ?? [])
|
|
6408
|
-
|
|
6409
|
-
for (let t of e.addons ?? [])
|
|
6410
|
-
|
|
6409
|
+
Kt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6410
|
+
for (let t of e.addons ?? []) ha.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6411
|
+
Ae.set(e.slug, e.family);
|
|
6411
6412
|
}
|
|
6412
|
-
for (let e of
|
|
6413
|
-
|
|
6413
|
+
for (let e of ga) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
|
|
6414
|
+
ka = new Set(['seedance-2']);
|
|
6414
6415
|
});
|
|
6415
6416
|
function ue(e) {
|
|
6416
6417
|
let t = e.from?.variant;
|
|
6417
6418
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
6418
6419
|
}
|
|
6419
|
-
function
|
|
6420
|
+
function Re(e) {
|
|
6420
6421
|
if (e.endpoints?.length)
|
|
6421
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6422
|
-
?
|
|
6422
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === $t)
|
|
6423
|
+
? $t
|
|
6423
6424
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6424
6425
|
}
|
|
6425
|
-
var
|
|
6426
|
-
|
|
6426
|
+
var $t,
|
|
6427
|
+
Le = h(() => {
|
|
6427
6428
|
'use strict';
|
|
6428
6429
|
G();
|
|
6429
|
-
|
|
6430
|
+
$t = 'dynamic';
|
|
6430
6431
|
});
|
|
6431
6432
|
var me,
|
|
6432
|
-
|
|
6433
|
+
De = h(() => {
|
|
6433
6434
|
'use strict';
|
|
6434
6435
|
me = {
|
|
6435
6436
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -6441,29 +6442,29 @@ var me,
|
|
|
6441
6442
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
6442
6443
|
};
|
|
6443
6444
|
});
|
|
6444
|
-
var
|
|
6445
|
+
var At = h(() => {
|
|
6445
6446
|
'use strict';
|
|
6446
6447
|
});
|
|
6447
|
-
function
|
|
6448
|
-
return typeof t == 'string' && (
|
|
6448
|
+
function Ot(e, t) {
|
|
6449
|
+
return typeof t == 'string' && (xa[e]?.includes(t) ?? !1);
|
|
6449
6450
|
}
|
|
6450
|
-
var
|
|
6451
|
-
|
|
6451
|
+
var xa,
|
|
6452
|
+
qt = h(() => {
|
|
6452
6453
|
'use strict';
|
|
6453
6454
|
G();
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6455
|
+
Le();
|
|
6456
|
+
At();
|
|
6457
|
+
xa = {};
|
|
6457
6458
|
});
|
|
6458
|
-
function
|
|
6459
|
-
return e === 'nano-banana-pro' ?
|
|
6459
|
+
function Rt(e) {
|
|
6460
|
+
return e === 'nano-banana-pro' ? _a : Pa;
|
|
6460
6461
|
}
|
|
6461
|
-
var
|
|
6462
|
-
|
|
6463
|
-
|
|
6462
|
+
var _a,
|
|
6463
|
+
Pa,
|
|
6464
|
+
Lt = h(() => {
|
|
6464
6465
|
'use strict';
|
|
6465
|
-
((
|
|
6466
|
-
(
|
|
6466
|
+
((_a = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6467
|
+
(Pa = [
|
|
6467
6468
|
'auto',
|
|
6468
6469
|
'1:1',
|
|
6469
6470
|
'1:4',
|
|
@@ -6481,10 +6482,10 @@ var ga,
|
|
|
6481
6482
|
'21:9',
|
|
6482
6483
|
]));
|
|
6483
6484
|
});
|
|
6484
|
-
var
|
|
6485
|
-
|
|
6485
|
+
var Dt,
|
|
6486
|
+
Nt = h(() => {
|
|
6486
6487
|
'use strict';
|
|
6487
|
-
|
|
6488
|
+
Dt = [
|
|
6488
6489
|
'prompt',
|
|
6489
6490
|
'system',
|
|
6490
6491
|
'messages',
|
|
@@ -6498,10 +6499,10 @@ var Rt,
|
|
|
6498
6499
|
'endpoint',
|
|
6499
6500
|
];
|
|
6500
6501
|
});
|
|
6501
|
-
var
|
|
6502
|
-
|
|
6502
|
+
var Vt,
|
|
6503
|
+
Ut = h(() => {
|
|
6503
6504
|
'use strict';
|
|
6504
|
-
|
|
6505
|
+
Vt = [
|
|
6505
6506
|
{
|
|
6506
6507
|
slug: 'claude-fable-5-1',
|
|
6507
6508
|
family: 'fable-5-1',
|
|
@@ -6570,13 +6571,13 @@ var Dt,
|
|
|
6570
6571
|
},
|
|
6571
6572
|
];
|
|
6572
6573
|
});
|
|
6573
|
-
function
|
|
6574
|
+
function Ft(e) {
|
|
6574
6575
|
return `$${e}`;
|
|
6575
6576
|
}
|
|
6576
|
-
function
|
|
6577
|
+
function Ne(e, t, i) {
|
|
6577
6578
|
return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
6578
6579
|
}
|
|
6579
|
-
function
|
|
6580
|
+
function Ia(e) {
|
|
6580
6581
|
return [
|
|
6581
6582
|
{
|
|
6582
6583
|
name: 'prompt',
|
|
@@ -6642,13 +6643,13 @@ function ya(e) {
|
|
|
6642
6643
|
},
|
|
6643
6644
|
];
|
|
6644
6645
|
}
|
|
6645
|
-
function
|
|
6646
|
+
function Bt() {
|
|
6646
6647
|
return Object.fromEntries(
|
|
6647
|
-
|
|
6648
|
-
let t =
|
|
6649
|
-
i =
|
|
6650
|
-
a =
|
|
6651
|
-
n = t != null && i != null ? `${
|
|
6648
|
+
Vt.map((e) => {
|
|
6649
|
+
let t = Ne(e.slug, 'cheap', 'input'),
|
|
6650
|
+
i = Ne(e.slug, 'cheap', 'output'),
|
|
6651
|
+
a = Ne(e.slug, 'stable', 'input') != null,
|
|
6652
|
+
n = t != null && i != null ? `${Ft(t)}/M in \xB7 ${Ft(i)}/M out` : '',
|
|
6652
6653
|
s = {
|
|
6653
6654
|
slug: e.slug,
|
|
6654
6655
|
name: e.name,
|
|
@@ -6659,50 +6660,50 @@ function Ut() {
|
|
|
6659
6660
|
priceFormatted: n,
|
|
6660
6661
|
unit: '/M tokens',
|
|
6661
6662
|
primaryToolName: 'run_task',
|
|
6662
|
-
parameters:
|
|
6663
|
+
parameters: Ia(a),
|
|
6663
6664
|
};
|
|
6664
6665
|
return [e.slug, s];
|
|
6665
6666
|
}),
|
|
6666
6667
|
);
|
|
6667
6668
|
}
|
|
6668
|
-
var
|
|
6669
|
+
var jt = h(() => {
|
|
6669
6670
|
'use strict';
|
|
6670
|
-
|
|
6671
|
+
Ut();
|
|
6671
6672
|
G();
|
|
6672
6673
|
});
|
|
6673
6674
|
function fe(e) {
|
|
6674
|
-
return e ?
|
|
6675
|
+
return e ? Ta.get(e) : void 0;
|
|
6675
6676
|
}
|
|
6676
|
-
function
|
|
6677
|
+
function Jt(e, t) {
|
|
6677
6678
|
return !e.aspects?.length || e.sourceFramedModes?.includes(t)
|
|
6678
6679
|
? null
|
|
6679
6680
|
: e.adaptiveModes?.includes(t)
|
|
6680
6681
|
? [...e.aspects, 'adaptive']
|
|
6681
6682
|
: [...e.aspects];
|
|
6682
6683
|
}
|
|
6683
|
-
function
|
|
6684
|
+
function Wt(e, t, i) {
|
|
6684
6685
|
return e.modes.includes('motion_control')
|
|
6685
6686
|
? t === 'motion_control'
|
|
6686
|
-
? !
|
|
6687
|
-
: !
|
|
6687
|
+
? !Ka.includes(i)
|
|
6688
|
+
: !Ma.includes(i)
|
|
6688
6689
|
: !0;
|
|
6689
6690
|
}
|
|
6690
|
-
var
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
Ne,
|
|
6697
|
-
Kn,
|
|
6691
|
+
var Gt,
|
|
6692
|
+
va,
|
|
6693
|
+
Ht,
|
|
6694
|
+
Rn,
|
|
6695
|
+
Ta,
|
|
6696
|
+
zt,
|
|
6698
6697
|
Ve,
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6698
|
+
Ln,
|
|
6699
|
+
Ue,
|
|
6700
|
+
Ma,
|
|
6701
|
+
Ka,
|
|
6702
|
+
Fe = h(() => {
|
|
6702
6703
|
'use strict';
|
|
6703
|
-
((
|
|
6704
|
-
(
|
|
6705
|
-
(
|
|
6704
|
+
((Gt = ['16:9', '9:16', '1:1', '21:9']),
|
|
6705
|
+
(va = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
|
|
6706
|
+
(Ht = [
|
|
6706
6707
|
{
|
|
6707
6708
|
slug: 'kling-v4',
|
|
6708
6709
|
kind: 'video',
|
|
@@ -6710,7 +6711,7 @@ var Bt,
|
|
|
6710
6711
|
promptMax: 26e3,
|
|
6711
6712
|
duration: { min: 3, max: 30, default: 5 },
|
|
6712
6713
|
heights: { '720p': 720, '1080p': 1080 },
|
|
6713
|
-
aspects:
|
|
6714
|
+
aspects: Gt,
|
|
6714
6715
|
sourceFramedModes: ['image_to_video'],
|
|
6715
6716
|
adaptiveModes: ['multi_reference'],
|
|
6716
6717
|
fps: 24,
|
|
@@ -6734,7 +6735,7 @@ var Bt,
|
|
|
6734
6735
|
promptMax: 26e3,
|
|
6735
6736
|
duration: { min: 3, max: 20, default: 5 },
|
|
6736
6737
|
heights: { '720p': 720 },
|
|
6737
|
-
aspects: [...
|
|
6738
|
+
aspects: [...Gt, '4:3', '3:4'],
|
|
6738
6739
|
sourceFramedModes: ['image_to_video'],
|
|
6739
6740
|
adaptiveModes: ['multi_reference'],
|
|
6740
6741
|
fps: 24,
|
|
@@ -6774,7 +6775,7 @@ var Bt,
|
|
|
6774
6775
|
promptMax: 65535,
|
|
6775
6776
|
duration: { min: 5, max: 15, default: 5 },
|
|
6776
6777
|
heights: { '480p': 480, '768p': 768 },
|
|
6777
|
-
aspects:
|
|
6778
|
+
aspects: va,
|
|
6778
6779
|
fps: 24,
|
|
6779
6780
|
audio: 'free',
|
|
6780
6781
|
seed: !0,
|
|
@@ -6849,10 +6850,10 @@ var Bt,
|
|
|
6849
6850
|
seed: !0,
|
|
6850
6851
|
},
|
|
6851
6852
|
]),
|
|
6852
|
-
(
|
|
6853
|
-
(
|
|
6854
|
-
((
|
|
6855
|
-
(
|
|
6853
|
+
(Rn = Ht.map((e) => e.slug)),
|
|
6854
|
+
(Ta = new Map(Ht.map((e) => [e.slug, e]))));
|
|
6855
|
+
((zt = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6856
|
+
(Ve = {
|
|
6856
6857
|
hpp4J3VqNfWAUOO0d1Us: 'Bella',
|
|
6857
6858
|
CwhRBWXzGAHq8TQ4Fs17: 'Roger',
|
|
6858
6859
|
EXAVITQu4vr4xnSDxMaL: 'Sarah',
|
|
@@ -6874,8 +6875,8 @@ var Bt,
|
|
|
6874
6875
|
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
6875
6876
|
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
6876
6877
|
}),
|
|
6877
|
-
(
|
|
6878
|
-
(
|
|
6878
|
+
(Ln = Object.keys(Ve)),
|
|
6879
|
+
(Ue = [
|
|
6879
6880
|
'mp3_44100_128',
|
|
6880
6881
|
'mp3_22050_32',
|
|
6881
6882
|
'mp3_24000_48',
|
|
@@ -6889,8 +6890,8 @@ var Bt,
|
|
|
6889
6890
|
'opus_48000_128',
|
|
6890
6891
|
'opus_48000_192',
|
|
6891
6892
|
]));
|
|
6892
|
-
((
|
|
6893
|
-
(
|
|
6893
|
+
((Ma = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
6894
|
+
(Ka = [
|
|
6894
6895
|
'duration',
|
|
6895
6896
|
'aspect_ratio',
|
|
6896
6897
|
'generate_audio',
|
|
@@ -6902,7 +6903,7 @@ var Bt,
|
|
|
6902
6903
|
'audios',
|
|
6903
6904
|
]));
|
|
6904
6905
|
});
|
|
6905
|
-
function
|
|
6906
|
+
function Ea() {
|
|
6906
6907
|
return [
|
|
6907
6908
|
{
|
|
6908
6909
|
name: 'image_url',
|
|
@@ -6930,7 +6931,7 @@ function Pa() {
|
|
|
6930
6931
|
},
|
|
6931
6932
|
];
|
|
6932
6933
|
}
|
|
6933
|
-
function
|
|
6934
|
+
function Ca(e) {
|
|
6934
6935
|
let t = e.duration,
|
|
6935
6936
|
i = Object.keys(e.heights),
|
|
6936
6937
|
a = e.sourceFramedModes?.length
|
|
@@ -7023,7 +7024,7 @@ function Ia(e) {
|
|
|
7023
7024
|
}
|
|
7024
7025
|
return o;
|
|
7025
7026
|
}
|
|
7026
|
-
function
|
|
7027
|
+
function $a(e) {
|
|
7027
7028
|
let t = Object.keys(e.sizes);
|
|
7028
7029
|
return [
|
|
7029
7030
|
{
|
|
@@ -7040,13 +7041,13 @@ function va(e) {
|
|
|
7040
7041
|
},
|
|
7041
7042
|
];
|
|
7042
7043
|
}
|
|
7043
|
-
function
|
|
7044
|
+
function Oa() {
|
|
7044
7045
|
return [
|
|
7045
7046
|
{
|
|
7046
7047
|
name: 'voice_id',
|
|
7047
7048
|
type: 'string',
|
|
7048
|
-
default:
|
|
7049
|
-
description: `text_to_speech: the ElevenLabs voice id, one of: ${
|
|
7049
|
+
default: zt,
|
|
7050
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${Aa}.`,
|
|
7050
7051
|
},
|
|
7051
7052
|
{
|
|
7052
7053
|
name: 'turns',
|
|
@@ -7054,7 +7055,7 @@ function Ma() {
|
|
|
7054
7055
|
description:
|
|
7055
7056
|
'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
|
|
7056
7057
|
},
|
|
7057
|
-
{ name: 'output_format', type: 'select', default:
|
|
7058
|
+
{ name: 'output_format', type: 'select', default: Ue[0], options: [...Ue] },
|
|
7058
7059
|
{ name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
|
|
7059
7060
|
{
|
|
7060
7061
|
name: 'similarity_boost',
|
|
@@ -7065,7 +7066,7 @@ function Ma() {
|
|
|
7065
7066
|
},
|
|
7066
7067
|
];
|
|
7067
7068
|
}
|
|
7068
|
-
function
|
|
7069
|
+
function Yt(e) {
|
|
7069
7070
|
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
7070
7071
|
i = [
|
|
7071
7072
|
{
|
|
@@ -7080,26 +7081,26 @@ function Jt(e) {
|
|
|
7080
7081
|
required: !0,
|
|
7081
7082
|
...(e.modeRequired ? {} : { default: e.modes[0] }),
|
|
7082
7083
|
options: [...e.modes],
|
|
7083
|
-
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) =>
|
|
7084
|
+
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => Sa[a]).join(' ')}`,
|
|
7084
7085
|
},
|
|
7085
7086
|
];
|
|
7086
7087
|
return (
|
|
7087
|
-
e.kind === 'video' ? i.push(...
|
|
7088
|
-
e.modes.includes('motion_control') && i.push(...
|
|
7088
|
+
e.kind === 'video' ? i.push(...Ca(e)) : e.kind === 'image' ? i.push(...$a(e)) : i.push(...Oa()),
|
|
7089
|
+
e.modes.includes('motion_control') && i.push(...Ea()),
|
|
7089
7090
|
e.seed &&
|
|
7090
7091
|
i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
7091
7092
|
i
|
|
7092
7093
|
);
|
|
7093
7094
|
}
|
|
7094
7095
|
var L,
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7096
|
+
Sa,
|
|
7097
|
+
Aa,
|
|
7098
|
+
Xt = h(() => {
|
|
7098
7099
|
'use strict';
|
|
7099
|
-
|
|
7100
|
+
Fe();
|
|
7100
7101
|
((L =
|
|
7101
7102
|
'as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
|
|
7102
|
-
(
|
|
7103
|
+
(Sa = {
|
|
7103
7104
|
text_to_video: 'text_to_video: from the prompt alone.',
|
|
7104
7105
|
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
7105
7106
|
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
@@ -7111,35 +7112,44 @@ var L,
|
|
|
7111
7112
|
motion_control:
|
|
7112
7113
|
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
7113
7114
|
}));
|
|
7114
|
-
|
|
7115
|
+
Aa = Object.entries(Ve)
|
|
7115
7116
|
.map(([e, t]) => `${e} (${t})`)
|
|
7116
7117
|
.join(', ');
|
|
7117
7118
|
});
|
|
7119
|
+
function ei(e) {
|
|
7120
|
+
return e === ge || e === he;
|
|
7121
|
+
}
|
|
7118
7122
|
var ge,
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7123
|
+
Qt,
|
|
7124
|
+
he,
|
|
7125
|
+
Zt,
|
|
7126
|
+
Be,
|
|
7127
|
+
ti,
|
|
7128
|
+
Un,
|
|
7129
|
+
Fn,
|
|
7130
|
+
Bn,
|
|
7131
|
+
jn,
|
|
7132
|
+
ii = h(() => {
|
|
7127
7133
|
'use strict';
|
|
7128
7134
|
((ge = 'enhancor-ultrafine'),
|
|
7129
|
-
(
|
|
7130
|
-
(
|
|
7131
|
-
(
|
|
7132
|
-
|
|
7133
|
-
(
|
|
7134
|
-
(
|
|
7135
|
-
(
|
|
7135
|
+
(Qt = 'Enhancor Ultrafine'),
|
|
7136
|
+
(he = 'enhancor-deblur'),
|
|
7137
|
+
(Zt = 'Enhancor Deblur'));
|
|
7138
|
+
((Be = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
7139
|
+
(ti = 2),
|
|
7140
|
+
(Un = 24 * 1024 * 1024),
|
|
7141
|
+
(Fn = 4096 * 4096),
|
|
7142
|
+
(Bn = 30 * 6e4),
|
|
7143
|
+
(jn = 120 * 6e4));
|
|
7136
7144
|
});
|
|
7137
|
-
var
|
|
7138
|
-
|
|
7139
|
-
|
|
7145
|
+
var qa,
|
|
7146
|
+
ai,
|
|
7147
|
+
Ra,
|
|
7148
|
+
je,
|
|
7149
|
+
ri = h(() => {
|
|
7140
7150
|
'use strict';
|
|
7141
|
-
((
|
|
7142
|
-
(
|
|
7151
|
+
((qa = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
|
|
7152
|
+
(ai = {
|
|
7143
7153
|
natural: 'Natural',
|
|
7144
7154
|
pores: 'Pores',
|
|
7145
7155
|
freckles: 'Freckles',
|
|
@@ -7147,11 +7157,13 @@ var Be,
|
|
|
7147
7157
|
blemish: 'Blemish',
|
|
7148
7158
|
glow: 'Glow',
|
|
7149
7159
|
unblur: 'Unblur',
|
|
7150
|
-
})
|
|
7160
|
+
}),
|
|
7161
|
+
(Ra = 'unblur'),
|
|
7162
|
+
(je = qa.filter((e) => e !== Ra)));
|
|
7151
7163
|
});
|
|
7152
7164
|
var X,
|
|
7153
|
-
|
|
7154
|
-
|
|
7165
|
+
ye,
|
|
7166
|
+
Ge = h(() => {
|
|
7155
7167
|
'use strict';
|
|
7156
7168
|
((X = [
|
|
7157
7169
|
'seedance-2-5',
|
|
@@ -7165,13 +7177,13 @@ var X,
|
|
|
7165
7177
|
'wan-2-5-image',
|
|
7166
7178
|
'doppel',
|
|
7167
7179
|
]),
|
|
7168
|
-
(
|
|
7180
|
+
(ye =
|
|
7169
7181
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
7170
7182
|
});
|
|
7171
7183
|
function Q(e) {
|
|
7172
7184
|
return `$${Number(e.toFixed(5))}`;
|
|
7173
7185
|
}
|
|
7174
|
-
function
|
|
7186
|
+
function Na(e) {
|
|
7175
7187
|
if (e.kind === 'llm') {
|
|
7176
7188
|
let t = e.defaultEndpoint,
|
|
7177
7189
|
i = (s) =>
|
|
@@ -7189,14 +7201,14 @@ function Ea(e) {
|
|
|
7189
7201
|
}
|
|
7190
7202
|
return `from ${Q(ue(e).price.starter)}${e.unit}`;
|
|
7191
7203
|
}
|
|
7192
|
-
function
|
|
7204
|
+
function Va(e, t) {
|
|
7193
7205
|
let i = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
7194
7206
|
return i.length ? `from ${Q(Math.min(...i))}${e}` : null;
|
|
7195
7207
|
}
|
|
7196
|
-
function
|
|
7208
|
+
function li(e) {
|
|
7197
7209
|
for (let t of J) {
|
|
7198
|
-
let i =
|
|
7199
|
-
a = i ?
|
|
7210
|
+
let i = ke[t],
|
|
7211
|
+
a = i ? Va(i.unit, e[t] ?? []) : null;
|
|
7200
7212
|
i && a && (i.priceFormatted = a);
|
|
7201
7213
|
}
|
|
7202
7214
|
}
|
|
@@ -7212,13 +7224,13 @@ function A(e, t) {
|
|
|
7212
7224
|
...(t ? { description: t } : {}),
|
|
7213
7225
|
};
|
|
7214
7226
|
}
|
|
7215
|
-
function
|
|
7227
|
+
function di(e) {
|
|
7216
7228
|
if (!e.endpoints?.length) return null;
|
|
7217
|
-
let t = e.endpoints.filter((i) =>
|
|
7229
|
+
let t = e.endpoints.filter((i) => Ot(e.slug, i.id));
|
|
7218
7230
|
return {
|
|
7219
7231
|
name: 'endpoint',
|
|
7220
7232
|
type: 'select',
|
|
7221
|
-
default:
|
|
7233
|
+
default: Re(e),
|
|
7222
7234
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
7223
7235
|
description:
|
|
7224
7236
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -7227,20 +7239,20 @@ function si(e) {
|
|
|
7227
7239
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
7228
7240
|
};
|
|
7229
7241
|
}
|
|
7230
|
-
function
|
|
7242
|
+
function Fa(e, t) {
|
|
7231
7243
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
7232
7244
|
let i = X.includes(e.api.model);
|
|
7233
|
-
return [...t.filter((a) => !
|
|
7245
|
+
return [...t.filter((a) => !be.has(a.name)), i ? Qe : Ua];
|
|
7234
7246
|
}
|
|
7235
|
-
function
|
|
7236
|
-
let i = e.filter((n) => !
|
|
7237
|
-
a = [
|
|
7238
|
-
return (a.push(
|
|
7247
|
+
function He(e, t) {
|
|
7248
|
+
let i = e.filter((n) => !be.has(n.name)),
|
|
7249
|
+
a = [Qe, pi];
|
|
7250
|
+
return (a.push(Ze, et), [...i, ...a]);
|
|
7239
7251
|
}
|
|
7240
|
-
function
|
|
7252
|
+
function Ha(e) {
|
|
7241
7253
|
return [
|
|
7242
7254
|
...e
|
|
7243
|
-
.filter((t) => !
|
|
7255
|
+
.filter((t) => !ja.has(t.name) && !be.has(t.name))
|
|
7244
7256
|
.map((t) => {
|
|
7245
7257
|
if (t.name === 'resolution')
|
|
7246
7258
|
return {
|
|
@@ -7254,28 +7266,28 @@ function La(e) {
|
|
|
7254
7266
|
: {}),
|
|
7255
7267
|
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Z}`,
|
|
7256
7268
|
};
|
|
7257
|
-
let i =
|
|
7269
|
+
let i = Ga[t.name];
|
|
7258
7270
|
return i && typeof t.description == 'string'
|
|
7259
7271
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
|
|
7260
7272
|
: t;
|
|
7261
7273
|
}),
|
|
7262
|
-
Ye,
|
|
7263
|
-
oi,
|
|
7264
|
-
Xe,
|
|
7265
7274
|
Qe,
|
|
7275
|
+
pi,
|
|
7276
|
+
Ze,
|
|
7277
|
+
et,
|
|
7266
7278
|
];
|
|
7267
7279
|
}
|
|
7268
|
-
function
|
|
7280
|
+
function ci(e) {
|
|
7269
7281
|
return (
|
|
7270
7282
|
e.startsWith('seedance-2-5-') &&
|
|
7271
7283
|
e !== 'seedance-2-5-lite' &&
|
|
7272
7284
|
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
7273
7285
|
);
|
|
7274
7286
|
}
|
|
7275
|
-
function
|
|
7287
|
+
function ni(e, t = {}) {
|
|
7276
7288
|
return [
|
|
7277
7289
|
...e
|
|
7278
|
-
.filter((i) => !
|
|
7290
|
+
.filter((i) => !Ba.has(i.name) && !be.has(i.name))
|
|
7279
7291
|
.map((i) =>
|
|
7280
7292
|
i.name === 'prompt'
|
|
7281
7293
|
? { ...i, required: !0 }
|
|
@@ -7296,11 +7308,11 @@ function ti(e, t = {}) {
|
|
|
7296
7308
|
options: ['standard'],
|
|
7297
7309
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
7298
7310
|
},
|
|
7299
|
-
|
|
7300
|
-
|
|
7311
|
+
Ze,
|
|
7312
|
+
et,
|
|
7301
7313
|
];
|
|
7302
7314
|
}
|
|
7303
|
-
function
|
|
7315
|
+
function ze(e, t) {
|
|
7304
7316
|
return [
|
|
7305
7317
|
E('Text prompt describing the video.'),
|
|
7306
7318
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -7329,8 +7341,8 @@ function He(e, t) {
|
|
|
7329
7341
|
),
|
|
7330
7342
|
];
|
|
7331
7343
|
}
|
|
7332
|
-
function
|
|
7333
|
-
let t =
|
|
7344
|
+
function za(e) {
|
|
7345
|
+
let t = di(e);
|
|
7334
7346
|
return [
|
|
7335
7347
|
E('Image prompt text. Supports complex composition and text instructions.'),
|
|
7336
7348
|
...(t ? [t] : []),
|
|
@@ -7343,14 +7355,14 @@ function Da(e) {
|
|
|
7343
7355
|
A(
|
|
7344
7356
|
e,
|
|
7345
7357
|
e.slug === 'gpt-image-2'
|
|
7346
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
7358
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${xt}`
|
|
7347
7359
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
7348
7360
|
),
|
|
7349
7361
|
{
|
|
7350
7362
|
name: 'aspect_ratio',
|
|
7351
7363
|
type: 'select',
|
|
7352
7364
|
default: 'auto',
|
|
7353
|
-
options: [...
|
|
7365
|
+
options: [...wt],
|
|
7354
7366
|
description:
|
|
7355
7367
|
"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.",
|
|
7356
7368
|
},
|
|
@@ -7397,7 +7409,7 @@ function Da(e) {
|
|
|
7397
7409
|
},
|
|
7398
7410
|
];
|
|
7399
7411
|
}
|
|
7400
|
-
function
|
|
7412
|
+
function Ja(e) {
|
|
7401
7413
|
return [
|
|
7402
7414
|
E('Image prompt text.'),
|
|
7403
7415
|
{
|
|
@@ -7405,7 +7417,7 @@ function Na(e) {
|
|
|
7405
7417
|
type: 'string[]',
|
|
7406
7418
|
description: 'Images to edit or use as reference (up to 14).',
|
|
7407
7419
|
},
|
|
7408
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
7420
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Rt(e.slug)] },
|
|
7409
7421
|
A(e),
|
|
7410
7422
|
{
|
|
7411
7423
|
name: 'n',
|
|
@@ -7431,10 +7443,10 @@ function Na(e) {
|
|
|
7431
7443
|
},
|
|
7432
7444
|
];
|
|
7433
7445
|
}
|
|
7434
|
-
function
|
|
7435
|
-
let e =
|
|
7446
|
+
function Qa() {
|
|
7447
|
+
let e = Dt,
|
|
7436
7448
|
t = [];
|
|
7437
|
-
for (let i of
|
|
7449
|
+
for (let i of tt(!0))
|
|
7438
7450
|
e.includes(i.name) &&
|
|
7439
7451
|
(t.push({
|
|
7440
7452
|
...i,
|
|
@@ -7456,12 +7468,12 @@ function Ba() {
|
|
|
7456
7468
|
}));
|
|
7457
7469
|
return t;
|
|
7458
7470
|
}
|
|
7459
|
-
function
|
|
7460
|
-
return
|
|
7471
|
+
function Za() {
|
|
7472
|
+
return tt(!0).map((e) =>
|
|
7461
7473
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
7462
7474
|
);
|
|
7463
7475
|
}
|
|
7464
|
-
function
|
|
7476
|
+
function tt(e) {
|
|
7465
7477
|
return [
|
|
7466
7478
|
E('The user message or task.'),
|
|
7467
7479
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -7556,21 +7568,21 @@ function Ze(e) {
|
|
|
7556
7568
|
},
|
|
7557
7569
|
];
|
|
7558
7570
|
}
|
|
7559
|
-
function
|
|
7560
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
7561
|
-
let t =
|
|
7571
|
+
function er(e) {
|
|
7572
|
+
if (e.slug === 'seed-2-1-turbo') return Ya;
|
|
7573
|
+
let t = di(e);
|
|
7562
7574
|
return [
|
|
7563
7575
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
7564
|
-
?
|
|
7576
|
+
? Qa()
|
|
7565
7577
|
: e.slug === 'gemini-3.7-flash'
|
|
7566
|
-
?
|
|
7567
|
-
: e.slug === 'gpt-6-astra' ||
|
|
7568
|
-
?
|
|
7569
|
-
:
|
|
7578
|
+
? Za()
|
|
7579
|
+
: e.slug === 'gpt-6-astra' || Xa.includes(e.slug)
|
|
7580
|
+
? tt(e.slug !== 'gpt-6-astra')
|
|
7581
|
+
: Wa),
|
|
7570
7582
|
...(t ? [t] : []),
|
|
7571
7583
|
];
|
|
7572
7584
|
}
|
|
7573
|
-
function
|
|
7585
|
+
function Je() {
|
|
7574
7586
|
return {
|
|
7575
7587
|
name: 'image',
|
|
7576
7588
|
type: 'string',
|
|
@@ -7578,7 +7590,7 @@ function ze() {
|
|
|
7578
7590
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
7579
7591
|
};
|
|
7580
7592
|
}
|
|
7581
|
-
function
|
|
7593
|
+
function ir(e) {
|
|
7582
7594
|
return [
|
|
7583
7595
|
{
|
|
7584
7596
|
name: 'video_url',
|
|
@@ -7600,7 +7612,7 @@ function za(e) {
|
|
|
7600
7612
|
},
|
|
7601
7613
|
];
|
|
7602
7614
|
}
|
|
7603
|
-
function
|
|
7615
|
+
function ar() {
|
|
7604
7616
|
return [
|
|
7605
7617
|
{
|
|
7606
7618
|
name: 'mode',
|
|
@@ -7671,30 +7683,30 @@ function Ja() {
|
|
|
7671
7683
|
},
|
|
7672
7684
|
];
|
|
7673
7685
|
}
|
|
7674
|
-
function
|
|
7686
|
+
function rr(e) {
|
|
7675
7687
|
let t = e.slug;
|
|
7676
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
7677
|
-
if (de.some((a) => a.slug === t)) return
|
|
7678
|
-
if (e.kind === 'llm') return
|
|
7679
|
-
if (e.editVariants?.length) return
|
|
7688
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return ar();
|
|
7689
|
+
if (de.some((a) => a.slug === t)) return ir(e);
|
|
7690
|
+
if (e.kind === 'llm') return er(e);
|
|
7691
|
+
if (e.editVariants?.length) return za(e);
|
|
7680
7692
|
let i = fe(t);
|
|
7681
|
-
if (i) return
|
|
7682
|
-
if (
|
|
7693
|
+
if (i) return Yt(i);
|
|
7694
|
+
if (ci(t)) return Ha(We);
|
|
7683
7695
|
switch (t) {
|
|
7684
7696
|
case 'seedance-2-5':
|
|
7685
|
-
return
|
|
7697
|
+
return He(We, t);
|
|
7686
7698
|
case 'seedance-2-5-lite':
|
|
7687
|
-
return
|
|
7699
|
+
return ni(We, { no4k: !0 });
|
|
7688
7700
|
case 'seedance-2':
|
|
7689
|
-
return
|
|
7701
|
+
return He(si, t);
|
|
7690
7702
|
case 'seedance-2-lite':
|
|
7691
|
-
return
|
|
7703
|
+
return ni(si);
|
|
7692
7704
|
case 'seedance-2-mini':
|
|
7693
|
-
return
|
|
7705
|
+
return He(nr, t);
|
|
7694
7706
|
case 'nano-banana-2':
|
|
7695
7707
|
case 'nano-banana-2.1':
|
|
7696
7708
|
case 'nano-banana-pro':
|
|
7697
|
-
return
|
|
7709
|
+
return Ja(e);
|
|
7698
7710
|
case 'seedream-5-pro':
|
|
7699
7711
|
return [
|
|
7700
7712
|
E('Detailed description of the image to generate.'),
|
|
@@ -7928,7 +7940,7 @@ function Wa(e) {
|
|
|
7928
7940
|
];
|
|
7929
7941
|
case 'enhancor-skin-fix-v1':
|
|
7930
7942
|
return [
|
|
7931
|
-
|
|
7943
|
+
Je(),
|
|
7932
7944
|
{
|
|
7933
7945
|
name: 'mode',
|
|
7934
7946
|
type: 'select',
|
|
@@ -7961,11 +7973,11 @@ function Wa(e) {
|
|
|
7961
7973
|
max: 0.4,
|
|
7962
7974
|
description: 'Portrait depth. Heavy only.',
|
|
7963
7975
|
},
|
|
7964
|
-
...
|
|
7976
|
+
...tr,
|
|
7965
7977
|
];
|
|
7966
7978
|
case 'enhancor-skin-fix-v3':
|
|
7967
7979
|
return [
|
|
7968
|
-
|
|
7980
|
+
Je(),
|
|
7969
7981
|
{
|
|
7970
7982
|
name: 'mask_image',
|
|
7971
7983
|
type: 'string',
|
|
@@ -8005,7 +8017,7 @@ function Wa(e) {
|
|
|
8005
8017
|
];
|
|
8006
8018
|
case 'enhancor-skin-fix-v4':
|
|
8007
8019
|
return [
|
|
8008
|
-
|
|
8020
|
+
Je(),
|
|
8009
8021
|
{
|
|
8010
8022
|
name: 'mode',
|
|
8011
8023
|
type: 'select',
|
|
@@ -8036,7 +8048,7 @@ function Wa(e) {
|
|
|
8036
8048
|
];
|
|
8037
8049
|
case 'wan-3-0':
|
|
8038
8050
|
case 'wan-3-0-prime':
|
|
8039
|
-
return
|
|
8051
|
+
return ze(e, {
|
|
8040
8052
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
8041
8053
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
8042
8054
|
minSec: 2,
|
|
@@ -8046,7 +8058,7 @@ function Wa(e) {
|
|
|
8046
8058
|
});
|
|
8047
8059
|
case 'happy-horse-1-1':
|
|
8048
8060
|
case 'happy-horse-1-0':
|
|
8049
|
-
return
|
|
8061
|
+
return ze(e, {
|
|
8050
8062
|
modes:
|
|
8051
8063
|
t === 'happy-horse-1-0'
|
|
8052
8064
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -8117,7 +8129,7 @@ function Wa(e) {
|
|
|
8117
8129
|
},
|
|
8118
8130
|
];
|
|
8119
8131
|
case 'minimax-h3':
|
|
8120
|
-
return
|
|
8132
|
+
return ze(e, {
|
|
8121
8133
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
8122
8134
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
8123
8135
|
minSec: 4,
|
|
@@ -8128,7 +8140,7 @@ function Wa(e) {
|
|
|
8128
8140
|
return [E('Prompt text.')];
|
|
8129
8141
|
}
|
|
8130
8142
|
}
|
|
8131
|
-
function
|
|
8143
|
+
function fi() {
|
|
8132
8144
|
let e = (t, i) => ({
|
|
8133
8145
|
name: t,
|
|
8134
8146
|
type: 'slider',
|
|
@@ -8149,31 +8161,33 @@ function Xa() {
|
|
|
8149
8161
|
),
|
|
8150
8162
|
];
|
|
8151
8163
|
}
|
|
8152
|
-
function
|
|
8164
|
+
function gi(e) {
|
|
8165
|
+
return {
|
|
8166
|
+
name: 'image',
|
|
8167
|
+
type: 'string',
|
|
8168
|
+
required: !0,
|
|
8169
|
+
description: `The photo to ${e}: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.`,
|
|
8170
|
+
};
|
|
8171
|
+
}
|
|
8172
|
+
function sr() {
|
|
8153
8173
|
return {
|
|
8154
8174
|
slug: ge,
|
|
8155
|
-
name:
|
|
8175
|
+
name: Qt,
|
|
8156
8176
|
category: 'Image',
|
|
8157
8177
|
kind: 'Image-to-Image',
|
|
8158
8178
|
vendor: 'Enhancor',
|
|
8159
8179
|
description:
|
|
8160
|
-
'Upscales a photo, with an optional skin preset that gives AI or smooth skin real texture first (Natural, Pores, Freckles, More freckles, Blemish, Glow
|
|
8180
|
+
'Upscales a photo, with an optional skin preset that gives AI or smooth skin real texture first (Natural, Pores, Freckles, More freckles, Blemish, Glow). Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). For a blurry photo use Enhancor Deblur (enhancor-deblur).',
|
|
8161
8181
|
priceFormatted: '',
|
|
8162
8182
|
unit: '/img',
|
|
8163
|
-
primaryToolName:
|
|
8183
|
+
primaryToolName: Xe.image,
|
|
8164
8184
|
parameters: [
|
|
8165
|
-
|
|
8166
|
-
name: 'image',
|
|
8167
|
-
type: 'string',
|
|
8168
|
-
required: !0,
|
|
8169
|
-
description:
|
|
8170
|
-
"The photo to upscale: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.",
|
|
8171
|
-
},
|
|
8185
|
+
gi('upscale'),
|
|
8172
8186
|
{
|
|
8173
8187
|
name: 'preset',
|
|
8174
8188
|
type: 'select',
|
|
8175
|
-
options: [...
|
|
8176
|
-
description: `Skin preset, run before the upscale: ${
|
|
8189
|
+
options: [...je],
|
|
8190
|
+
description: `Skin preset, run before the upscale: ${je.map((e) => `${e} (${ai[e]})`).join(', ')}. Seedream 5.5 redraws the skin at about the photo's own size and shape, keeping the person, the background and any text; that picture is brought back to the photo's size and upscaled, so the output is still the photo times the scale. Priced at the skin rate. Leave it out for a plain upscale.`,
|
|
8177
8191
|
},
|
|
8178
8192
|
{
|
|
8179
8193
|
name: 'skin_fix',
|
|
@@ -8181,80 +8195,82 @@ function Qa() {
|
|
|
8181
8195
|
default: !1,
|
|
8182
8196
|
description: 'Same as preset natural. Off by default.',
|
|
8183
8197
|
},
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
default: 'full',
|
|
8188
|
-
options: ['full', 'fast'],
|
|
8189
|
-
description:
|
|
8190
|
-
'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum.',
|
|
8191
|
-
},
|
|
8192
|
-
{
|
|
8193
|
-
name: 'scale',
|
|
8194
|
-
type: 'select',
|
|
8195
|
-
default: String(Xt),
|
|
8196
|
-
options: Fe.noSkin.map(String),
|
|
8197
|
-
description: `Full only: ${Fe.noSkin.join(', ')}. The output is at most 48 megapixels, so with a preset (a picture of about 4.2 MP) up to 3; Unblur up to 4.`,
|
|
8198
|
-
},
|
|
8199
|
-
...Xa(),
|
|
8198
|
+
hi,
|
|
8199
|
+
yi,
|
|
8200
|
+
...fi(),
|
|
8200
8201
|
],
|
|
8201
8202
|
};
|
|
8202
8203
|
}
|
|
8203
|
-
function
|
|
8204
|
+
function or() {
|
|
8205
|
+
return {
|
|
8206
|
+
slug: he,
|
|
8207
|
+
name: Zt,
|
|
8208
|
+
category: 'Image',
|
|
8209
|
+
kind: 'Image-to-Image',
|
|
8210
|
+
vendor: 'Enhancor',
|
|
8211
|
+
description:
|
|
8212
|
+
'Sharpens a blurry or soft photo and upscales it: Seedream 5.5 unblurs the photo at about its own size and shape, keeping the same person, face, freckles and moles, then that picture is upscaled. Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px). No prompt.',
|
|
8213
|
+
priceFormatted: '',
|
|
8214
|
+
unit: '/img',
|
|
8215
|
+
primaryToolName: Xe.image,
|
|
8216
|
+
parameters: [gi('deblur'), hi, yi, ...fi()],
|
|
8217
|
+
};
|
|
8218
|
+
}
|
|
8219
|
+
function Ye(e, t = e.api.model) {
|
|
8204
8220
|
return {
|
|
8205
8221
|
slug: t,
|
|
8206
8222
|
name: e.name,
|
|
8207
|
-
category:
|
|
8208
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
8223
|
+
category: La[e.kind],
|
|
8224
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Da[e.kind],
|
|
8209
8225
|
vendor: e.vendor ?? '',
|
|
8210
8226
|
description: e.desc ?? e.name,
|
|
8211
|
-
priceFormatted:
|
|
8227
|
+
priceFormatted: Na(e),
|
|
8212
8228
|
unit: e.unit,
|
|
8213
|
-
primaryToolName:
|
|
8214
|
-
parameters:
|
|
8229
|
+
primaryToolName: Xe[e.kind],
|
|
8230
|
+
parameters: Fa(e, rr(e)),
|
|
8215
8231
|
};
|
|
8216
8232
|
}
|
|
8217
|
-
function
|
|
8233
|
+
function lr() {
|
|
8218
8234
|
let e = {};
|
|
8219
8235
|
for (let t of ce())
|
|
8220
8236
|
if (t.slug !== 'seedance-2-fast') {
|
|
8221
8237
|
if (t.slug === 'seedance-2-mini') {
|
|
8222
|
-
e['seedance-2-mini'] =
|
|
8238
|
+
e['seedance-2-mini'] = Ye(t, 'seedance-2-mini');
|
|
8223
8239
|
continue;
|
|
8224
8240
|
}
|
|
8225
8241
|
if (t.slug === 'seedance-2') {
|
|
8226
|
-
let i =
|
|
8242
|
+
let i = Ye(t);
|
|
8227
8243
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8228
8244
|
(e['seedance-2'] = i));
|
|
8229
8245
|
continue;
|
|
8230
8246
|
}
|
|
8231
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
8247
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Ye(t));
|
|
8232
8248
|
}
|
|
8233
|
-
(Object.assign(e,
|
|
8249
|
+
(Object.assign(e, Bt()), (e[ge] = sr()), (e[he] = or()));
|
|
8234
8250
|
for (let [t, i] of Object.entries(me))
|
|
8235
8251
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
8236
8252
|
return e;
|
|
8237
8253
|
}
|
|
8238
|
-
function
|
|
8254
|
+
function we(e) {
|
|
8239
8255
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
8240
8256
|
}
|
|
8241
8257
|
function H(e) {
|
|
8242
|
-
return
|
|
8258
|
+
return ke[e] ?? null;
|
|
8243
8259
|
}
|
|
8244
|
-
function
|
|
8260
|
+
function dr(e, t, i) {
|
|
8245
8261
|
if (
|
|
8246
8262
|
e.startsWith('enhancor-skin-fix-') ||
|
|
8247
|
-
e
|
|
8263
|
+
ei(e) ||
|
|
8248
8264
|
(e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
|
|
8249
8265
|
)
|
|
8250
8266
|
return !1;
|
|
8251
|
-
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' ||
|
|
8267
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ci(e)) && t === 'duration') {
|
|
8252
8268
|
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
8253
8269
|
if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
|
|
8254
8270
|
}
|
|
8255
8271
|
if (
|
|
8256
|
-
(t === 'max_tokens' &&
|
|
8257
|
-
(t === 'max_completion_tokens' &&
|
|
8272
|
+
(t === 'max_tokens' && oi(i.max_completion_tokens)) ||
|
|
8273
|
+
(t === 'max_completion_tokens' && oi(i.max_tokens))
|
|
8258
8274
|
)
|
|
8259
8275
|
return !1;
|
|
8260
8276
|
if (t === 'aspect_ratio') {
|
|
@@ -8262,125 +8278,127 @@ function er(e, t, i) {
|
|
|
8262
8278
|
if (n) {
|
|
8263
8279
|
let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8264
8280
|
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
8265
|
-
if (n.modes.includes(o) && !
|
|
8281
|
+
if (n.modes.includes(o) && !Jt(n, o)) return !1;
|
|
8266
8282
|
}
|
|
8267
8283
|
}
|
|
8268
8284
|
let a = fe(e);
|
|
8269
8285
|
if (a) {
|
|
8270
8286
|
let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8271
8287
|
s = n ? n.replace(/-/g, '_') : a.modes[0];
|
|
8272
|
-
if (a.modes.includes(s) && !
|
|
8288
|
+
if (a.modes.includes(s) && !Wt(a, s, t)) return !1;
|
|
8273
8289
|
}
|
|
8274
8290
|
return !0;
|
|
8275
8291
|
}
|
|
8276
|
-
function
|
|
8292
|
+
function oi(e) {
|
|
8277
8293
|
return e != null && e !== '';
|
|
8278
8294
|
}
|
|
8279
|
-
function
|
|
8295
|
+
function bi(e, t) {
|
|
8280
8296
|
let i = { ...t };
|
|
8281
8297
|
if (e?.slug === 'seedance-2-5') {
|
|
8282
8298
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
8283
|
-
for (let n of
|
|
8299
|
+
for (let n of pr) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
8284
8300
|
if (!a(i.finalize)) return i;
|
|
8285
8301
|
}
|
|
8286
8302
|
for (let a of e?.parameters ?? [])
|
|
8287
8303
|
a.default !== void 0 &&
|
|
8288
8304
|
i[a.name] === void 0 &&
|
|
8289
|
-
|
|
8305
|
+
dr(e.slug, a.name, t) &&
|
|
8290
8306
|
(i[a.name] = a.default);
|
|
8291
8307
|
return i;
|
|
8292
8308
|
}
|
|
8293
8309
|
function D() {
|
|
8294
|
-
return Object.values(
|
|
8310
|
+
return Object.values(ke);
|
|
8295
8311
|
}
|
|
8296
|
-
var
|
|
8297
|
-
ri,
|
|
8298
|
-
Sa,
|
|
8299
|
-
E,
|
|
8300
|
-
Ye,
|
|
8301
|
-
$a,
|
|
8302
|
-
oi,
|
|
8312
|
+
var La,
|
|
8303
8313
|
Xe,
|
|
8314
|
+
Da,
|
|
8315
|
+
E,
|
|
8304
8316
|
Qe,
|
|
8305
|
-
ye,
|
|
8306
|
-
Oa,
|
|
8307
|
-
qa,
|
|
8308
|
-
Ra,
|
|
8309
|
-
Va,
|
|
8310
8317
|
Ua,
|
|
8311
|
-
Fa,
|
|
8312
|
-
Ha,
|
|
8313
|
-
Z,
|
|
8314
|
-
Je,
|
|
8315
|
-
di,
|
|
8316
8318
|
pi,
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
+
Ze,
|
|
8320
|
+
et,
|
|
8319
8321
|
be,
|
|
8322
|
+
Ba,
|
|
8323
|
+
ja,
|
|
8324
|
+
Ga,
|
|
8325
|
+
Wa,
|
|
8326
|
+
Ya,
|
|
8327
|
+
Xa,
|
|
8320
8328
|
tr,
|
|
8329
|
+
Z,
|
|
8330
|
+
We,
|
|
8331
|
+
ui,
|
|
8332
|
+
mi,
|
|
8333
|
+
si,
|
|
8334
|
+
nr,
|
|
8335
|
+
hi,
|
|
8336
|
+
yi,
|
|
8337
|
+
ke,
|
|
8338
|
+
pr,
|
|
8321
8339
|
ee = h(() => {
|
|
8322
8340
|
'use strict';
|
|
8323
|
-
|
|
8324
|
-
Se();
|
|
8325
|
-
G();
|
|
8326
|
-
Re();
|
|
8341
|
+
_t();
|
|
8327
8342
|
Ee();
|
|
8343
|
+
G();
|
|
8328
8344
|
Le();
|
|
8329
|
-
|
|
8345
|
+
Ce();
|
|
8346
|
+
De();
|
|
8330
8347
|
qt();
|
|
8331
8348
|
Lt();
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
(
|
|
8339
|
-
|
|
8349
|
+
Nt();
|
|
8350
|
+
jt();
|
|
8351
|
+
Fe();
|
|
8352
|
+
Xt();
|
|
8353
|
+
ii();
|
|
8354
|
+
ri();
|
|
8355
|
+
Ge();
|
|
8356
|
+
((La = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8357
|
+
(Xe = {
|
|
8340
8358
|
video: 'generate_video',
|
|
8341
8359
|
image: 'generate_image',
|
|
8342
8360
|
audio: 'generate_audio',
|
|
8343
8361
|
llm: 'run_task',
|
|
8344
8362
|
}),
|
|
8345
|
-
(
|
|
8363
|
+
(Da = {
|
|
8346
8364
|
video: 'Text-to-Video',
|
|
8347
8365
|
image: 'Text-to-Image',
|
|
8348
8366
|
audio: 'Text-to-Audio',
|
|
8349
8367
|
llm: 'Reasoning (LLM)',
|
|
8350
8368
|
}));
|
|
8351
8369
|
E = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
8352
|
-
((
|
|
8370
|
+
((Qe = {
|
|
8353
8371
|
name: 'creative_mode',
|
|
8354
8372
|
type: 'boolean',
|
|
8355
8373
|
default: !1,
|
|
8356
8374
|
description:
|
|
8357
8375
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8358
8376
|
}),
|
|
8359
|
-
(
|
|
8377
|
+
(Ua = {
|
|
8360
8378
|
name: 'creative_mode',
|
|
8361
8379
|
type: 'boolean',
|
|
8362
8380
|
default: !1,
|
|
8363
|
-
description: `Not available yet on this model: ${
|
|
8381
|
+
description: `Not available yet on this model: ${ye}.`,
|
|
8364
8382
|
}),
|
|
8365
|
-
(
|
|
8383
|
+
(pi = {
|
|
8366
8384
|
name: 'priority',
|
|
8367
8385
|
type: 'boolean',
|
|
8368
8386
|
default: !1,
|
|
8369
8387
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
8370
8388
|
}),
|
|
8371
|
-
(
|
|
8389
|
+
(Ze = {
|
|
8372
8390
|
name: 'reference_roles',
|
|
8373
8391
|
type: 'json',
|
|
8374
8392
|
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).`,
|
|
8375
8393
|
}),
|
|
8376
|
-
(
|
|
8394
|
+
(et = {
|
|
8377
8395
|
name: 'auto_fit_images',
|
|
8378
8396
|
type: 'boolean',
|
|
8379
8397
|
description:
|
|
8380
8398
|
'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.',
|
|
8381
8399
|
}),
|
|
8382
|
-
(
|
|
8383
|
-
((
|
|
8400
|
+
(be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8401
|
+
((Ba = new Set([
|
|
8384
8402
|
'quality',
|
|
8385
8403
|
'bitrate_mode',
|
|
8386
8404
|
'draft',
|
|
@@ -8389,7 +8407,7 @@ var Ka,
|
|
|
8389
8407
|
'draft_generation_id',
|
|
8390
8408
|
'pass_faces',
|
|
8391
8409
|
])),
|
|
8392
|
-
(
|
|
8410
|
+
(ja = new Set([
|
|
8393
8411
|
'quality',
|
|
8394
8412
|
'bitrate_mode',
|
|
8395
8413
|
'draft',
|
|
@@ -8397,12 +8415,12 @@ var Ka,
|
|
|
8397
8415
|
'draft_task_id',
|
|
8398
8416
|
'draft_generation_id',
|
|
8399
8417
|
])),
|
|
8400
|
-
(
|
|
8418
|
+
(Ga = {
|
|
8401
8419
|
images: 'up to 10',
|
|
8402
8420
|
videos: 'up to 5; combined duration < 30s',
|
|
8403
8421
|
audios: 'up to 5; combined duration < 30s',
|
|
8404
8422
|
}));
|
|
8405
|
-
((
|
|
8423
|
+
((Wa = [
|
|
8406
8424
|
E('The user message or task.'),
|
|
8407
8425
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8408
8426
|
{
|
|
@@ -8420,7 +8438,7 @@ var Ka,
|
|
|
8420
8438
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8421
8439
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8422
8440
|
]),
|
|
8423
|
-
(
|
|
8441
|
+
(Ya = [
|
|
8424
8442
|
E('The user message or task.'),
|
|
8425
8443
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8426
8444
|
{
|
|
@@ -8502,8 +8520,8 @@ var Ka,
|
|
|
8502
8520
|
description: 'Video frames read a second.',
|
|
8503
8521
|
},
|
|
8504
8522
|
]),
|
|
8505
|
-
(
|
|
8506
|
-
|
|
8523
|
+
(Xa = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8524
|
+
tr = Object.entries({
|
|
8507
8525
|
background: !1,
|
|
8508
8526
|
skin: !1,
|
|
8509
8527
|
nose: !1,
|
|
@@ -8530,7 +8548,7 @@ var Ka,
|
|
|
8530
8548
|
description: 'Keep this part out of the fix. Standard only.',
|
|
8531
8549
|
}));
|
|
8532
8550
|
((Z = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8533
|
-
(
|
|
8551
|
+
(We = [
|
|
8534
8552
|
{
|
|
8535
8553
|
name: 'prompt',
|
|
8536
8554
|
type: 'string',
|
|
@@ -8679,19 +8697,19 @@ var Ka,
|
|
|
8679
8697
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8680
8698
|
},
|
|
8681
8699
|
]),
|
|
8682
|
-
(
|
|
8700
|
+
(ui = {
|
|
8683
8701
|
name: 'images',
|
|
8684
8702
|
type: 'string[]',
|
|
8685
8703
|
description:
|
|
8686
8704
|
'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.',
|
|
8687
8705
|
}),
|
|
8688
|
-
(
|
|
8706
|
+
(mi = {
|
|
8689
8707
|
name: 'audios',
|
|
8690
8708
|
type: 'string[]',
|
|
8691
8709
|
description:
|
|
8692
8710
|
'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.',
|
|
8693
8711
|
}),
|
|
8694
|
-
(
|
|
8712
|
+
(si = [
|
|
8695
8713
|
{
|
|
8696
8714
|
name: 'prompt',
|
|
8697
8715
|
type: 'string',
|
|
@@ -8769,8 +8787,8 @@ var Ka,
|
|
|
8769
8787
|
description:
|
|
8770
8788
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8771
8789
|
},
|
|
8772
|
-
|
|
8773
|
-
|
|
8790
|
+
ui,
|
|
8791
|
+
mi,
|
|
8774
8792
|
{
|
|
8775
8793
|
name: 'first_frame_image',
|
|
8776
8794
|
type: 'string',
|
|
@@ -8791,7 +8809,7 @@ var Ka,
|
|
|
8791
8809
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8792
8810
|
},
|
|
8793
8811
|
]),
|
|
8794
|
-
(
|
|
8812
|
+
(nr = [
|
|
8795
8813
|
{
|
|
8796
8814
|
name: 'prompt',
|
|
8797
8815
|
type: 'string',
|
|
@@ -8846,8 +8864,8 @@ var Ka,
|
|
|
8846
8864
|
description:
|
|
8847
8865
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8848
8866
|
},
|
|
8849
|
-
|
|
8850
|
-
|
|
8867
|
+
ui,
|
|
8868
|
+
mi,
|
|
8851
8869
|
{
|
|
8852
8870
|
name: 'first_frame_image',
|
|
8853
8871
|
type: 'string',
|
|
@@ -8862,53 +8880,68 @@ var Ka,
|
|
|
8862
8880
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8863
8881
|
},
|
|
8864
8882
|
]));
|
|
8865
|
-
|
|
8866
|
-
|
|
8883
|
+
((hi = {
|
|
8884
|
+
name: 'mode',
|
|
8885
|
+
type: 'select',
|
|
8886
|
+
default: 'full',
|
|
8887
|
+
options: ['full', 'fast'],
|
|
8888
|
+
description:
|
|
8889
|
+
'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum: the first 10 MP at one rate, every MP past 10 at a lower one (get_pricing).',
|
|
8890
|
+
}),
|
|
8891
|
+
(yi = {
|
|
8892
|
+
name: 'scale',
|
|
8893
|
+
type: 'select',
|
|
8894
|
+
default: String(ti),
|
|
8895
|
+
options: Be.noSkin.map(String),
|
|
8896
|
+
description: `Full only: ${Be.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
|
|
8897
|
+
}));
|
|
8898
|
+
ke = lr();
|
|
8899
|
+
pr = ['draft_task_id', 'draft_generation_id'];
|
|
8867
8900
|
});
|
|
8868
|
-
function
|
|
8901
|
+
function xe(e) {
|
|
8869
8902
|
let t = '/v1/pricing/models',
|
|
8870
8903
|
i = e?.trim();
|
|
8871
8904
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
8872
8905
|
}
|
|
8873
|
-
var
|
|
8906
|
+
var rt = h(() => {
|
|
8874
8907
|
'use strict';
|
|
8875
8908
|
});
|
|
8876
|
-
function
|
|
8909
|
+
function Ri(e) {
|
|
8877
8910
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
8878
8911
|
}
|
|
8879
|
-
function
|
|
8912
|
+
function Li(e) {
|
|
8880
8913
|
let t = ce().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8881
8914
|
i = t.filter((s) => X.includes(s.api.model)).map((s) => s.name),
|
|
8882
8915
|
a = t.filter((s) => !X.includes(s.api.model)).map((s) => s.name);
|
|
8883
8916
|
return [
|
|
8884
8917
|
...(i.length
|
|
8885
|
-
? [`${
|
|
8918
|
+
? [`${Ri(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
8886
8919
|
: []),
|
|
8887
|
-
...(a.length ? [`Not available yet on ${
|
|
8920
|
+
...(a.length ? [`Not available yet on ${Ri(a)}: ${ye}.`] : []),
|
|
8888
8921
|
'The Acceptable Use Policy applies.',
|
|
8889
8922
|
].join(' ');
|
|
8890
8923
|
}
|
|
8891
|
-
function
|
|
8892
|
-
if (
|
|
8924
|
+
function Vr(e) {
|
|
8925
|
+
if (qr.has(e.name)) return e;
|
|
8893
8926
|
let t = e.inputSchema.properties;
|
|
8894
8927
|
return !t || t.callback_url
|
|
8895
8928
|
? e
|
|
8896
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8929
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: Or } } };
|
|
8897
8930
|
}
|
|
8898
|
-
function
|
|
8931
|
+
function Ur(e) {
|
|
8899
8932
|
let t = e.inputSchema.properties;
|
|
8900
8933
|
if (!t) return e;
|
|
8901
8934
|
let i = !1,
|
|
8902
8935
|
a = {};
|
|
8903
8936
|
for (let [n, s] of Object.entries(t))
|
|
8904
|
-
|
|
8937
|
+
Di.has(n) && s.type === 'string' && !s.format
|
|
8905
8938
|
? ((a[n] = { ...s, format: 'uri' }), (i = !0))
|
|
8906
|
-
:
|
|
8939
|
+
: Di.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8907
8940
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
8908
8941
|
: (a[n] = s);
|
|
8909
8942
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
8910
8943
|
}
|
|
8911
|
-
function
|
|
8944
|
+
function Fr(e) {
|
|
8912
8945
|
switch (e.type) {
|
|
8913
8946
|
case 'string':
|
|
8914
8947
|
return {
|
|
@@ -8963,11 +8996,11 @@ function Ar(e) {
|
|
|
8963
8996
|
return { type: 'string', description: e.description };
|
|
8964
8997
|
}
|
|
8965
8998
|
}
|
|
8966
|
-
function
|
|
8999
|
+
function Br(e, t) {
|
|
8967
9000
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
8968
9001
|
a = {},
|
|
8969
9002
|
n = [];
|
|
8970
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
9003
|
+
for (let o of e.parameters) ((a[o.name] = Fr(o)), o.required && n.push(o.name));
|
|
8971
9004
|
let s = {
|
|
8972
9005
|
type: 'object',
|
|
8973
9006
|
properties: a,
|
|
@@ -8980,8 +9013,8 @@ function Or(e, t) {
|
|
|
8980
9013
|
inputSchema: s,
|
|
8981
9014
|
};
|
|
8982
9015
|
}
|
|
8983
|
-
function
|
|
8984
|
-
let e = D().filter((p) => p.category === 'Image' && !
|
|
9016
|
+
function jr() {
|
|
9017
|
+
let e = D().filter((p) => p.category === 'Image' && !we(p)),
|
|
8985
9018
|
t = D().filter((p) => p.category === 'Video'),
|
|
8986
9019
|
i = D().filter((p) => p.category === 'Text'),
|
|
8987
9020
|
a = D().filter((p) => p.category === 'Audio'),
|
|
@@ -9071,7 +9104,7 @@ function qr() {
|
|
|
9071
9104
|
maximum: 2147483647,
|
|
9072
9105
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
9073
9106
|
},
|
|
9074
|
-
creative_mode: { type: 'boolean', description:
|
|
9107
|
+
creative_mode: { type: 'boolean', description: Li('image') },
|
|
9075
9108
|
},
|
|
9076
9109
|
required: ['prompt'],
|
|
9077
9110
|
additionalProperties: !0,
|
|
@@ -9108,7 +9141,7 @@ function qr() {
|
|
|
9108
9141
|
description:
|
|
9109
9142
|
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default, which that model's tool shows.",
|
|
9110
9143
|
},
|
|
9111
|
-
creative_mode: { type: 'boolean', description:
|
|
9144
|
+
creative_mode: { type: 'boolean', description: Li('video') },
|
|
9112
9145
|
priority: {
|
|
9113
9146
|
type: 'boolean',
|
|
9114
9147
|
description:
|
|
@@ -9244,10 +9277,10 @@ function qr() {
|
|
|
9244
9277
|
additionalProperties: !0,
|
|
9245
9278
|
},
|
|
9246
9279
|
},
|
|
9247
|
-
d =
|
|
9248
|
-
return [n, s, o, u, l, d, c,
|
|
9280
|
+
d = Gr();
|
|
9281
|
+
return [n, s, o, u, l, d, c, Rr, ...Ni];
|
|
9249
9282
|
}
|
|
9250
|
-
function
|
|
9283
|
+
function Gr() {
|
|
9251
9284
|
return {
|
|
9252
9285
|
name: 'upload_asset',
|
|
9253
9286
|
description:
|
|
@@ -9294,31 +9327,31 @@ function Rr() {
|
|
|
9294
9327
|
},
|
|
9295
9328
|
};
|
|
9296
9329
|
}
|
|
9297
|
-
function
|
|
9298
|
-
let e =
|
|
9299
|
-
t = D().map((i) =>
|
|
9300
|
-
return [...e, ...t].map(
|
|
9301
|
-
}
|
|
9302
|
-
var
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9330
|
+
function pt() {
|
|
9331
|
+
let e = jr(),
|
|
9332
|
+
t = D().map((i) => Br(i));
|
|
9333
|
+
return [...e, ...t].map(Vr).map(Ur);
|
|
9334
|
+
}
|
|
9335
|
+
var Or,
|
|
9336
|
+
qr,
|
|
9337
|
+
Rr,
|
|
9338
|
+
Lr,
|
|
9339
|
+
Dr,
|
|
9340
|
+
Nr,
|
|
9341
|
+
Ni,
|
|
9342
|
+
Ys,
|
|
9343
|
+
Di,
|
|
9344
|
+
Vi = h(() => {
|
|
9312
9345
|
'use strict';
|
|
9313
9346
|
G();
|
|
9314
|
-
|
|
9347
|
+
Ge();
|
|
9315
9348
|
ee();
|
|
9316
|
-
((
|
|
9349
|
+
((Or = {
|
|
9317
9350
|
type: 'string',
|
|
9318
9351
|
description:
|
|
9319
9352
|
'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.',
|
|
9320
9353
|
}),
|
|
9321
|
-
(
|
|
9354
|
+
(qr = new Set([
|
|
9322
9355
|
'upload_asset',
|
|
9323
9356
|
'upload_media',
|
|
9324
9357
|
'upload_image',
|
|
@@ -9329,7 +9362,7 @@ var vr,
|
|
|
9329
9362
|
'get_usage',
|
|
9330
9363
|
'get_balance_history',
|
|
9331
9364
|
])),
|
|
9332
|
-
(
|
|
9365
|
+
(Rr = {
|
|
9333
9366
|
name: 'get_pricing',
|
|
9334
9367
|
description:
|
|
9335
9368
|
'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.',
|
|
@@ -9344,13 +9377,13 @@ var vr,
|
|
|
9344
9377
|
additionalProperties: !1,
|
|
9345
9378
|
},
|
|
9346
9379
|
}),
|
|
9347
|
-
(
|
|
9380
|
+
(Lr = {
|
|
9348
9381
|
name: 'get_balance',
|
|
9349
9382
|
description:
|
|
9350
9383
|
"Your Tein workspace's balance right now, what this API key can still spend (the balance, or less when the key has its own spending limit), credits on hold, and the workspace's usage this month and in the last 30 days from every channel (website, API, MCP, CLI, workflows). Use it before a run to check the balance covers it, or to show the balance in an app. Nothing runs and nothing is charged. The same payload as GET /v1/balance.",
|
|
9351
9384
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9352
9385
|
}),
|
|
9353
|
-
(
|
|
9386
|
+
(Dr = {
|
|
9354
9387
|
name: 'get_usage',
|
|
9355
9388
|
description:
|
|
9356
9389
|
"Your Tein workspace's usage in detail, the same numbers as the dashboard's Usage page: total spend and requests (succeeded, failed, running), this API key's own share, and breakdowns by model, by channel (website, api, mcp, cli), by API key, and over time. Covers every run of the workspace, wherever it was started. Nothing runs and nothing is charged. The same payload as GET /v1/usage.",
|
|
@@ -9381,7 +9414,7 @@ var vr,
|
|
|
9381
9414
|
additionalProperties: !1,
|
|
9382
9415
|
},
|
|
9383
9416
|
}),
|
|
9384
|
-
(
|
|
9417
|
+
(Nr = {
|
|
9385
9418
|
name: 'get_balance_history',
|
|
9386
9419
|
description:
|
|
9387
9420
|
"Your Tein balance's history, newest first, the same list as the Billing page: top ups, each run's charge (with its job_id and model), refunds, credits from Tein and adjustments, each with the balance after it. Nothing runs and nothing is charged. The same payload as GET /v1/balance/transactions.",
|
|
@@ -9399,9 +9432,9 @@ var vr,
|
|
|
9399
9432
|
additionalProperties: !1,
|
|
9400
9433
|
},
|
|
9401
9434
|
}),
|
|
9402
|
-
(
|
|
9403
|
-
(
|
|
9404
|
-
|
|
9435
|
+
(Ni = [Lr, Dr, Nr]),
|
|
9436
|
+
(Ys = new Set(Ni.map((e) => e.name))));
|
|
9437
|
+
Di = new Set([
|
|
9405
9438
|
'image',
|
|
9406
9439
|
'images',
|
|
9407
9440
|
'image_url',
|
|
@@ -9418,19 +9451,19 @@ var vr,
|
|
|
9418
9451
|
'lipsyncing_audio',
|
|
9419
9452
|
]);
|
|
9420
9453
|
});
|
|
9421
|
-
var
|
|
9422
|
-
|
|
9423
|
-
forgetToolSchemas: () =>
|
|
9424
|
-
jsonRpcAnswer: () =>
|
|
9425
|
-
preprocessLocalFiles: () =>
|
|
9426
|
-
startStdioServer: () =>
|
|
9454
|
+
var Yi = {};
|
|
9455
|
+
ra(Yi, {
|
|
9456
|
+
forgetToolSchemas: () => Yr,
|
|
9457
|
+
jsonRpcAnswer: () => ji,
|
|
9458
|
+
preprocessLocalFiles: () => Ji,
|
|
9459
|
+
startStdioServer: () => Wi,
|
|
9427
9460
|
});
|
|
9428
|
-
function
|
|
9461
|
+
function Hr(e) {
|
|
9429
9462
|
let t = (i) =>
|
|
9430
9463
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
9431
9464
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
9432
9465
|
}
|
|
9433
|
-
function
|
|
9466
|
+
function ji(e, t, i) {
|
|
9434
9467
|
let a = e?.id,
|
|
9435
9468
|
n = a == null,
|
|
9436
9469
|
s = null;
|
|
@@ -9439,7 +9472,7 @@ function Li(e, t, i) {
|
|
|
9439
9472
|
} catch {
|
|
9440
9473
|
s = null;
|
|
9441
9474
|
}
|
|
9442
|
-
if (s !== null &&
|
|
9475
|
+
if (s !== null && Hr(s)) return n ? null : s;
|
|
9443
9476
|
if (n) return null;
|
|
9444
9477
|
if (!i && t >= 200 && t < 300) return;
|
|
9445
9478
|
let o = s?.error,
|
|
@@ -9460,12 +9493,12 @@ function Li(e, t, i) {
|
|
|
9460
9493
|
},
|
|
9461
9494
|
};
|
|
9462
9495
|
}
|
|
9463
|
-
function
|
|
9496
|
+
function zr() {
|
|
9464
9497
|
let e = process.argv.slice(2),
|
|
9465
9498
|
t = e.indexOf('--api-key');
|
|
9466
9499
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
9467
9500
|
}
|
|
9468
|
-
async function
|
|
9501
|
+
async function Gi(e, t, i) {
|
|
9469
9502
|
let a = z.default.resolve(e);
|
|
9470
9503
|
if (!N.default.existsSync(a) || !N.default.statSync(a).isFile())
|
|
9471
9504
|
throw new Error(`File not found: ${e}`);
|
|
@@ -9494,15 +9527,15 @@ async function Di(e, t, i) {
|
|
|
9494
9527
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
9495
9528
|
};
|
|
9496
9529
|
}
|
|
9497
|
-
function
|
|
9498
|
-
return
|
|
9530
|
+
function Hi(e) {
|
|
9531
|
+
return Jr.has(z.default.extname(e).toLowerCase());
|
|
9499
9532
|
}
|
|
9500
|
-
function
|
|
9533
|
+
function zi(e) {
|
|
9501
9534
|
return new Error(
|
|
9502
9535
|
`Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
|
|
9503
9536
|
);
|
|
9504
9537
|
}
|
|
9505
|
-
function
|
|
9538
|
+
function Wr(e) {
|
|
9506
9539
|
let t = e.trim();
|
|
9507
9540
|
if (
|
|
9508
9541
|
!t ||
|
|
@@ -9515,7 +9548,7 @@ function Vr(e) {
|
|
|
9515
9548
|
let i = z.default.resolve(t);
|
|
9516
9549
|
return N.default.existsSync(i) && N.default.statSync(i).isFile() ? i : null;
|
|
9517
9550
|
}
|
|
9518
|
-
function
|
|
9551
|
+
function ut(e) {
|
|
9519
9552
|
if (Array.isArray(e))
|
|
9520
9553
|
for (let t of e) {
|
|
9521
9554
|
let i = t;
|
|
@@ -9525,12 +9558,12 @@ function pt(e) {
|
|
|
9525
9558
|
ae.set(i.name, i.inputSchema);
|
|
9526
9559
|
}
|
|
9527
9560
|
}
|
|
9528
|
-
function
|
|
9529
|
-
(ae.clear(), (
|
|
9561
|
+
function Yr() {
|
|
9562
|
+
(ae.clear(), (ct = 0));
|
|
9530
9563
|
}
|
|
9531
|
-
async function
|
|
9532
|
-
if (!(Date.now() -
|
|
9533
|
-
|
|
9564
|
+
async function Xr(e, t) {
|
|
9565
|
+
if (!(Date.now() - ct < 6e4)) {
|
|
9566
|
+
ct = Date.now();
|
|
9534
9567
|
try {
|
|
9535
9568
|
let a = await (
|
|
9536
9569
|
await fetch(e, {
|
|
@@ -9540,39 +9573,39 @@ async function Fr(e, t) {
|
|
|
9540
9573
|
signal: AbortSignal.timeout(1e4),
|
|
9541
9574
|
})
|
|
9542
9575
|
).json();
|
|
9543
|
-
|
|
9576
|
+
ut(a.result?.tools);
|
|
9544
9577
|
} catch {}
|
|
9545
9578
|
}
|
|
9546
9579
|
}
|
|
9547
|
-
function
|
|
9580
|
+
function Qr(e) {
|
|
9548
9581
|
return e
|
|
9549
9582
|
? e.type === 'string'
|
|
9550
9583
|
? e.format === 'uri'
|
|
9551
9584
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
9552
9585
|
: !1;
|
|
9553
9586
|
}
|
|
9554
|
-
async function
|
|
9587
|
+
async function Ui(e, t, i) {
|
|
9555
9588
|
if (typeof e != 'string') return e;
|
|
9556
|
-
let a =
|
|
9589
|
+
let a = Wr(e);
|
|
9557
9590
|
if (!a) return e;
|
|
9558
|
-
if (!
|
|
9559
|
-
return (await
|
|
9591
|
+
if (!Hi(a)) throw zi(a);
|
|
9592
|
+
return (await Gi(a, t, i)).url;
|
|
9560
9593
|
}
|
|
9561
|
-
async function
|
|
9562
|
-
(ae.size === 0 && pt(
|
|
9594
|
+
async function Ji(e, t, i, a, n) {
|
|
9595
|
+
(ae.size === 0 && ut(pt()), ae.has(e) || (await Xr(n, i)));
|
|
9563
9596
|
let s = ae.get(e)?.properties;
|
|
9564
9597
|
if (!s) return t;
|
|
9565
9598
|
let o = { ...t };
|
|
9566
9599
|
for (let [u, l] of Object.entries(t))
|
|
9567
|
-
if (
|
|
9600
|
+
if (Qr(s[u]))
|
|
9568
9601
|
if (Array.isArray(l)) {
|
|
9569
9602
|
let c = [];
|
|
9570
|
-
for (let d of l) c.push(await
|
|
9603
|
+
for (let d of l) c.push(await Ui(d, i, a));
|
|
9571
9604
|
o[u] = c;
|
|
9572
|
-
} else o[u] = await
|
|
9605
|
+
} else o[u] = await Ui(l, i, a);
|
|
9573
9606
|
return o;
|
|
9574
9607
|
}
|
|
9575
|
-
function
|
|
9608
|
+
function Zr(e) {
|
|
9576
9609
|
let t = e.id ?? null;
|
|
9577
9610
|
switch (e.method) {
|
|
9578
9611
|
case 'initialize':
|
|
@@ -9590,7 +9623,7 @@ function jr(e) {
|
|
|
9590
9623
|
case 'ping':
|
|
9591
9624
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
9592
9625
|
case 'tools/list':
|
|
9593
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9626
|
+
return { jsonrpc: '2.0', id: t, result: { tools: pt() } };
|
|
9594
9627
|
case 'tools/call':
|
|
9595
9628
|
return {
|
|
9596
9629
|
jsonrpc: '2.0',
|
|
@@ -9613,13 +9646,13 @@ function jr(e) {
|
|
|
9613
9646
|
};
|
|
9614
9647
|
}
|
|
9615
9648
|
}
|
|
9616
|
-
async function
|
|
9617
|
-
if (
|
|
9618
|
-
|
|
9619
|
-
let e =
|
|
9649
|
+
async function Wi() {
|
|
9650
|
+
if (Fi) return;
|
|
9651
|
+
Fi = !0;
|
|
9652
|
+
let e = zr(),
|
|
9620
9653
|
t = w(),
|
|
9621
9654
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9622
|
-
(
|
|
9655
|
+
(Bi.default
|
|
9623
9656
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
9624
9657
|
.on('line', async (n) => {
|
|
9625
9658
|
let s = n.trim();
|
|
@@ -9631,7 +9664,7 @@ async function Fi() {
|
|
|
9631
9664
|
c = o.params.arguments || {};
|
|
9632
9665
|
if (l === 'get_pricing') {
|
|
9633
9666
|
let d = typeof c.model == 'string' ? c.model.trim() : '',
|
|
9634
|
-
p = `${t.replace(/\/+$/, '')}${
|
|
9667
|
+
p = `${t.replace(/\/+$/, '')}${xe(d)}`;
|
|
9635
9668
|
try {
|
|
9636
9669
|
let m = await fetch(p, { signal: AbortSignal.timeout(1e4) }),
|
|
9637
9670
|
y = await m.text();
|
|
@@ -9680,17 +9713,17 @@ async function Fi() {
|
|
|
9680
9713
|
try {
|
|
9681
9714
|
let p = z.default.resolve(d.trim());
|
|
9682
9715
|
if (N.default.existsSync(p) && N.default.statSync(p).isFile() && e) {
|
|
9683
|
-
if (!
|
|
9684
|
-
let m = await
|
|
9716
|
+
if (!Hi(p)) throw zi(p);
|
|
9717
|
+
let m = await Gi(p, e, t),
|
|
9685
9718
|
y = (m.sizeBytes / 1024).toFixed(1),
|
|
9686
|
-
|
|
9719
|
+
_e =
|
|
9687
9720
|
m.mimeType.startsWith('image/') ||
|
|
9688
9721
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
9689
9722
|
? `
|
|
9690
9723
|
|
|
9691
9724
|
`
|
|
9692
9725
|
: '',
|
|
9693
|
-
|
|
9726
|
+
Pe = {
|
|
9694
9727
|
jsonrpc: '2.0',
|
|
9695
9728
|
id: o.id,
|
|
9696
9729
|
result: {
|
|
@@ -9701,7 +9734,7 @@ async function Fi() {
|
|
|
9701
9734
|
|
|
9702
9735
|
- **URL:** ${m.url}
|
|
9703
9736
|
- **Type:** \`${m.mimeType}\`
|
|
9704
|
-
- **Size:** ${y} KB${
|
|
9737
|
+
- **Size:** ${y} KB${_e}
|
|
9705
9738
|
|
|
9706
9739
|
Pass this URL to any Tein generation tool.`,
|
|
9707
9740
|
},
|
|
@@ -9710,7 +9743,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9710
9743
|
},
|
|
9711
9744
|
};
|
|
9712
9745
|
process.stdout.write(
|
|
9713
|
-
JSON.stringify(
|
|
9746
|
+
JSON.stringify(Pe) +
|
|
9714
9747
|
`
|
|
9715
9748
|
`,
|
|
9716
9749
|
);
|
|
@@ -9737,7 +9770,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9737
9770
|
}
|
|
9738
9771
|
if (e)
|
|
9739
9772
|
try {
|
|
9740
|
-
o.params.arguments = await
|
|
9773
|
+
o.params.arguments = await Ji(String(l), c, e, t, i);
|
|
9741
9774
|
} catch (d) {
|
|
9742
9775
|
let p = d instanceof Error ? d.message : String(d);
|
|
9743
9776
|
process.stdout.write(
|
|
@@ -9768,10 +9801,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9768
9801
|
body: JSON.stringify(o),
|
|
9769
9802
|
}),
|
|
9770
9803
|
c = await l.text(),
|
|
9771
|
-
d =
|
|
9804
|
+
d = ji(o, l.status, c);
|
|
9772
9805
|
if (d === null) return;
|
|
9773
9806
|
if (d) {
|
|
9774
|
-
(o?.method === 'tools/list' &&
|
|
9807
|
+
(o?.method === 'tools/list' && ut(d.result?.tools),
|
|
9775
9808
|
process.stdout.write(
|
|
9776
9809
|
JSON.stringify(d) +
|
|
9777
9810
|
`
|
|
@@ -9780,7 +9813,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9780
9813
|
return;
|
|
9781
9814
|
}
|
|
9782
9815
|
} catch {}
|
|
9783
|
-
let u =
|
|
9816
|
+
let u = Zr(o);
|
|
9784
9817
|
u !== null &&
|
|
9785
9818
|
process.stdout.write(
|
|
9786
9819
|
JSON.stringify(u) +
|
|
@@ -9805,21 +9838,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9805
9838
|
}
|
|
9806
9839
|
var N,
|
|
9807
9840
|
z,
|
|
9808
|
-
|
|
9809
|
-
|
|
9841
|
+
Bi,
|
|
9842
|
+
Jr,
|
|
9810
9843
|
ae,
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9844
|
+
ct,
|
|
9845
|
+
Fi,
|
|
9846
|
+
Xi = h(() => {
|
|
9814
9847
|
'use strict';
|
|
9815
9848
|
((N = T(require('node:fs'))),
|
|
9816
9849
|
(z = T(require('node:path'))),
|
|
9817
|
-
(
|
|
9818
|
-
|
|
9819
|
-
|
|
9850
|
+
(Bi = T(require('node:readline'))));
|
|
9851
|
+
rt();
|
|
9852
|
+
Vi();
|
|
9820
9853
|
$();
|
|
9821
9854
|
re();
|
|
9822
|
-
|
|
9855
|
+
Jr = new Set([
|
|
9823
9856
|
'.png',
|
|
9824
9857
|
'.jpg',
|
|
9825
9858
|
'.jpeg',
|
|
@@ -9845,20 +9878,20 @@ var N,
|
|
|
9845
9878
|
'.flac',
|
|
9846
9879
|
'.opus',
|
|
9847
9880
|
]);
|
|
9848
|
-
((ae = new Map()), (
|
|
9849
|
-
|
|
9881
|
+
((ae = new Map()), (ct = 0));
|
|
9882
|
+
Fi = !1;
|
|
9850
9883
|
require.main === module &&
|
|
9851
|
-
|
|
9884
|
+
Wi().catch((e) => {
|
|
9852
9885
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
9853
9886
|
`),
|
|
9854
9887
|
process.exit(1));
|
|
9855
9888
|
});
|
|
9856
9889
|
});
|
|
9857
|
-
var
|
|
9890
|
+
var sa =
|
|
9858
9891
|
!process.env.NO_COLOR &&
|
|
9859
9892
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
9860
9893
|
function x(e, t) {
|
|
9861
|
-
return (i) => (
|
|
9894
|
+
return (i) => (sa ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
9862
9895
|
}
|
|
9863
9896
|
var r = {
|
|
9864
9897
|
bold: x(1, 22),
|
|
@@ -9945,10 +9978,10 @@ var r = {
|
|
|
9945
9978
|
var U = T(require('node:fs')),
|
|
9946
9979
|
O = T(require('node:path'));
|
|
9947
9980
|
var ne = T(require('node:fs')),
|
|
9948
|
-
|
|
9949
|
-
|
|
9981
|
+
yt = T(require('node:path')),
|
|
9982
|
+
bt = require('node:stream/promises');
|
|
9950
9983
|
re();
|
|
9951
|
-
var
|
|
9984
|
+
var pa = new Set([
|
|
9952
9985
|
'account_suspended',
|
|
9953
9986
|
'account_terminated',
|
|
9954
9987
|
'creative_mode_restricted',
|
|
@@ -9956,7 +9989,7 @@ var aa = new Set([
|
|
|
9956
9989
|
'workspace_paused',
|
|
9957
9990
|
]),
|
|
9958
9991
|
v = 1,
|
|
9959
|
-
|
|
9992
|
+
ca = 3,
|
|
9960
9993
|
b = class extends Error {
|
|
9961
9994
|
constructor(t, i, a, n = {}) {
|
|
9962
9995
|
(super(i),
|
|
@@ -9966,10 +9999,10 @@ var aa = new Set([
|
|
|
9966
9999
|
(this.fields = n));
|
|
9967
10000
|
}
|
|
9968
10001
|
get exitCode() {
|
|
9969
|
-
return this.code &&
|
|
10002
|
+
return this.code && pa.has(this.code) ? ca : v;
|
|
9970
10003
|
}
|
|
9971
10004
|
};
|
|
9972
|
-
function
|
|
10005
|
+
function ua(e, t, i) {
|
|
9973
10006
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9974
10007
|
if (!i || typeof i != 'object') return new b(e, a);
|
|
9975
10008
|
let n = i;
|
|
@@ -9982,13 +10015,13 @@ function na(e, t, i) {
|
|
|
9982
10015
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
9983
10016
|
return new b(e, c, typeof o == 'string' ? o : void 0, l);
|
|
9984
10017
|
}
|
|
9985
|
-
function
|
|
10018
|
+
function gt(e) {
|
|
9986
10019
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
9987
10020
|
}
|
|
9988
10021
|
function K(e) {
|
|
9989
10022
|
let t = [e.message],
|
|
9990
|
-
i =
|
|
9991
|
-
a =
|
|
10023
|
+
i = gt(e.fields.required),
|
|
10024
|
+
a = gt(e.fields.balance);
|
|
9992
10025
|
(i || a) &&
|
|
9993
10026
|
t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
9994
10027
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -9996,19 +10029,19 @@ function K(e) {
|
|
|
9996
10029
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
9997
10030
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
9998
10031
|
}
|
|
9999
|
-
function
|
|
10032
|
+
function ma(e) {
|
|
10000
10033
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
10001
10034
|
? 'video'
|
|
10002
10035
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
10003
10036
|
? 'audio'
|
|
10004
10037
|
: 'image';
|
|
10005
10038
|
}
|
|
10006
|
-
function
|
|
10039
|
+
function ht(e) {
|
|
10007
10040
|
let t = [];
|
|
10008
10041
|
for (let i of e.data ?? [])
|
|
10009
10042
|
typeof i.message?.content == 'string'
|
|
10010
10043
|
? t.push({ type: 'text', text: i.message.content })
|
|
10011
|
-
: i.url && t.push({ type:
|
|
10044
|
+
: i.url && t.push({ type: ma(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
|
|
10012
10045
|
return t;
|
|
10013
10046
|
}
|
|
10014
10047
|
var M = class {
|
|
@@ -10034,7 +10067,7 @@ var M = class {
|
|
|
10034
10067
|
try {
|
|
10035
10068
|
s = await n.json();
|
|
10036
10069
|
} catch {}
|
|
10037
|
-
throw
|
|
10070
|
+
throw ua(n.status, n.statusText, s);
|
|
10038
10071
|
}
|
|
10039
10072
|
return await n.json();
|
|
10040
10073
|
}
|
|
@@ -10048,7 +10081,7 @@ var M = class {
|
|
|
10048
10081
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
10049
10082
|
? n
|
|
10050
10083
|
: 'processing',
|
|
10051
|
-
o =
|
|
10084
|
+
o = ht(a);
|
|
10052
10085
|
return {
|
|
10053
10086
|
request_id: a.request_id || a.id || '',
|
|
10054
10087
|
model: a.model,
|
|
@@ -10066,7 +10099,7 @@ var M = class {
|
|
|
10066
10099
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
10067
10100
|
? a
|
|
10068
10101
|
: 'processing',
|
|
10069
|
-
s =
|
|
10102
|
+
s = ht(i),
|
|
10070
10103
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
10071
10104
|
return {
|
|
10072
10105
|
request_id: i.id || t,
|
|
@@ -10095,14 +10128,14 @@ var M = class {
|
|
|
10095
10128
|
async downloadOutput(t, i) {
|
|
10096
10129
|
let a = await fetch(t);
|
|
10097
10130
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
10098
|
-
let n =
|
|
10131
|
+
let n = yt.default.dirname(i);
|
|
10099
10132
|
ne.default.existsSync(n) || ne.default.mkdirSync(n, { recursive: !0 });
|
|
10100
10133
|
let s = ne.default.createWriteStream(i);
|
|
10101
|
-
return (await (0,
|
|
10134
|
+
return (await (0, bt.pipeline)(a.body, s), i);
|
|
10102
10135
|
}
|
|
10103
10136
|
};
|
|
10104
10137
|
$();
|
|
10105
|
-
function
|
|
10138
|
+
function Se(e) {
|
|
10106
10139
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
10107
10140
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
10108
10141
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -10111,29 +10144,29 @@ function Ke(e) {
|
|
|
10111
10144
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
10112
10145
|
}
|
|
10113
10146
|
ee();
|
|
10114
|
-
var
|
|
10115
|
-
function
|
|
10116
|
-
for (let t of
|
|
10147
|
+
var ki = ['images', 'input_images', 'videos', 'audios'];
|
|
10148
|
+
function cr(e) {
|
|
10149
|
+
for (let t of ki) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
10117
10150
|
}
|
|
10118
|
-
function
|
|
10151
|
+
function ur(e) {
|
|
10119
10152
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
10120
10153
|
let t = O.default.resolve(e);
|
|
10121
10154
|
return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
|
|
10122
10155
|
}
|
|
10123
|
-
async function
|
|
10124
|
-
for (let i of
|
|
10156
|
+
async function mr(e, t) {
|
|
10157
|
+
for (let i of ki) {
|
|
10125
10158
|
if (!Array.isArray(e[i])) continue;
|
|
10126
10159
|
let a = [];
|
|
10127
10160
|
for (let n of e[i]) {
|
|
10128
10161
|
if (typeof n != 'string') continue;
|
|
10129
|
-
let s =
|
|
10162
|
+
let s = ur(n);
|
|
10130
10163
|
a.push(s ? await t(s) : n);
|
|
10131
10164
|
}
|
|
10132
10165
|
e[i] = a;
|
|
10133
10166
|
}
|
|
10134
10167
|
}
|
|
10135
10168
|
var te = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10136
|
-
function
|
|
10169
|
+
function fr(e) {
|
|
10137
10170
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
10138
10171
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
10139
10172
|
i = te.enterprise;
|
|
@@ -10146,7 +10179,7 @@ function nr(e) {
|
|
|
10146
10179
|
t
|
|
10147
10180
|
);
|
|
10148
10181
|
}
|
|
10149
|
-
async function
|
|
10182
|
+
async function gr(e, t, i, a, n) {
|
|
10150
10183
|
n.isJson ||
|
|
10151
10184
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
10152
10185
|
`);
|
|
@@ -10208,7 +10241,7 @@ async function sr(e, t, i, a, n) {
|
|
|
10208
10241
|
else {
|
|
10209
10242
|
for (let l of o)
|
|
10210
10243
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
10211
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
10244
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${Se(l.usage.cost)}`),
|
|
10212
10245
|
l.error && process.stdout.write(` ${l.error}`),
|
|
10213
10246
|
process.stdout.write(`
|
|
10214
10247
|
`));
|
|
@@ -10221,12 +10254,12 @@ async function sr(e, t, i, a, n) {
|
|
|
10221
10254
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10222
10255
|
process.exit(v);
|
|
10223
10256
|
}
|
|
10224
|
-
function
|
|
10257
|
+
function hr(e, t, i) {
|
|
10225
10258
|
if (i <= 1) return e;
|
|
10226
10259
|
let a = O.default.extname(e);
|
|
10227
10260
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
10228
10261
|
}
|
|
10229
|
-
function
|
|
10262
|
+
function wi(e) {
|
|
10230
10263
|
let t = {},
|
|
10231
10264
|
i = new Set(),
|
|
10232
10265
|
a = [];
|
|
@@ -10271,7 +10304,7 @@ function mi(e) {
|
|
|
10271
10304
|
}
|
|
10272
10305
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
|
|
10273
10306
|
}
|
|
10274
|
-
async function
|
|
10307
|
+
async function it(e, t) {
|
|
10275
10308
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10276
10309
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10277
10310
|
(i ||
|
|
@@ -10293,7 +10326,7 @@ async function et(e, t) {
|
|
|
10293
10326
|
s = !!t.json,
|
|
10294
10327
|
o = !!(t.async || t.no_wait),
|
|
10295
10328
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
10296
|
-
l =
|
|
10329
|
+
l = fr(t),
|
|
10297
10330
|
c = { ...t };
|
|
10298
10331
|
(delete c.json,
|
|
10299
10332
|
delete c.async,
|
|
@@ -10302,9 +10335,9 @@ async function et(e, t) {
|
|
|
10302
10335
|
delete c.api_key,
|
|
10303
10336
|
delete c.api_url,
|
|
10304
10337
|
delete c.count);
|
|
10305
|
-
let d =
|
|
10306
|
-
(
|
|
10307
|
-
typeof d.image == 'string' && !d.images && !
|
|
10338
|
+
let d = bi(n, c);
|
|
10339
|
+
(cr(d),
|
|
10340
|
+
typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
|
|
10308
10341
|
d.image_url &&
|
|
10309
10342
|
!d.first_frame_image &&
|
|
10310
10343
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
@@ -10346,7 +10379,7 @@ async function et(e, t) {
|
|
|
10346
10379
|
}
|
|
10347
10380
|
}
|
|
10348
10381
|
}
|
|
10349
|
-
await
|
|
10382
|
+
await mr(d, async (k) => {
|
|
10350
10383
|
let g = new C(`Uploading local file ${O.default.basename(k)} to CDN...`);
|
|
10351
10384
|
s || g.start();
|
|
10352
10385
|
try {
|
|
@@ -10370,7 +10403,7 @@ async function et(e, t) {
|
|
|
10370
10403
|
let f;
|
|
10371
10404
|
try {
|
|
10372
10405
|
if (l > 1) {
|
|
10373
|
-
await
|
|
10406
|
+
await gr(p, e, d, l, { isJson: s, isAsync: o });
|
|
10374
10407
|
return;
|
|
10375
10408
|
}
|
|
10376
10409
|
f = await p.queueJob(e, d);
|
|
@@ -10408,12 +10441,12 @@ async function et(e, t) {
|
|
|
10408
10441
|
`));
|
|
10409
10442
|
return;
|
|
10410
10443
|
}
|
|
10411
|
-
let
|
|
10412
|
-
|
|
10444
|
+
let _e = Date.now(),
|
|
10445
|
+
Pe = 1500;
|
|
10413
10446
|
for (; f.status === 'processing';) {
|
|
10414
|
-
let k = Math.round((Date.now() -
|
|
10447
|
+
let k = Math.round((Date.now() - _e) / 1e3);
|
|
10415
10448
|
(s || y.update(`Rendering ${r.bold(e)} (${k}s elapsed)... [ID: ${f.request_id}]`),
|
|
10416
|
-
await new Promise((g) => setTimeout(g,
|
|
10449
|
+
await new Promise((g) => setTimeout(g, Pe)));
|
|
10417
10450
|
try {
|
|
10418
10451
|
f = await p.getStatus(f.request_id);
|
|
10419
10452
|
} catch (g) {
|
|
@@ -10455,7 +10488,7 @@ async function et(e, t) {
|
|
|
10455
10488
|
process.stdout.write(` ${r.bold('Request ID:')} ${f.request_id}
|
|
10456
10489
|
`),
|
|
10457
10490
|
f.usage?.cost !== void 0 &&
|
|
10458
|
-
process.stdout.write(` ${r.bold('Cost:')} ${
|
|
10491
|
+
process.stdout.write(` ${r.bold('Cost:')} ${Se(f.usage.cost)}
|
|
10459
10492
|
`),
|
|
10460
10493
|
f.output && f.output.length > 0)
|
|
10461
10494
|
) {
|
|
@@ -10473,13 +10506,13 @@ ${r.bold('Outputs:')}
|
|
|
10473
10506
|
`),
|
|
10474
10507
|
u)
|
|
10475
10508
|
) {
|
|
10476
|
-
let q =
|
|
10477
|
-
|
|
10509
|
+
let q = hr(u, g++, k),
|
|
10510
|
+
mt = new C(`Downloading output to ${q}...`).start();
|
|
10478
10511
|
try {
|
|
10479
10512
|
(await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
|
|
10480
|
-
|
|
10481
|
-
} catch (
|
|
10482
|
-
|
|
10513
|
+
mt.succeed(`Saved to ${r.bold(q)}`));
|
|
10514
|
+
} catch (Ie) {
|
|
10515
|
+
mt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
|
|
10483
10516
|
}
|
|
10484
10517
|
}
|
|
10485
10518
|
} else
|
|
@@ -10492,9 +10525,9 @@ ${I.text}
|
|
|
10492
10525
|
process.stdout.write(`
|
|
10493
10526
|
`);
|
|
10494
10527
|
}
|
|
10495
|
-
var
|
|
10528
|
+
var xi = T(require('node:readline'));
|
|
10496
10529
|
$();
|
|
10497
|
-
async function
|
|
10530
|
+
async function yr(e) {
|
|
10498
10531
|
try {
|
|
10499
10532
|
return (await new M(e, w()).checkKey(), 'ok');
|
|
10500
10533
|
} catch (t) {
|
|
@@ -10505,8 +10538,8 @@ async function lr(e) {
|
|
|
10505
10538
|
return 'unchecked';
|
|
10506
10539
|
}
|
|
10507
10540
|
}
|
|
10508
|
-
function
|
|
10509
|
-
let t =
|
|
10541
|
+
function br(e) {
|
|
10542
|
+
let t = xi.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10510
10543
|
return new Promise((i) => {
|
|
10511
10544
|
t.question(e, (a) => {
|
|
10512
10545
|
(t.close(), i(a.trim()));
|
|
@@ -10525,20 +10558,20 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10525
10558
|
process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
|
|
10526
10559
|
|
|
10527
10560
|
`),
|
|
10528
|
-
(i = await
|
|
10561
|
+
(i = await br('Enter your Tein API Key (sk_live_...): '))),
|
|
10529
10562
|
!i.startsWith('sk_live_') &&
|
|
10530
10563
|
!i.startsWith('sk_test_') &&
|
|
10531
10564
|
(process.stderr
|
|
10532
10565
|
.write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10533
10566
|
`),
|
|
10534
10567
|
process.exit(1)));
|
|
10535
|
-
let a = await
|
|
10568
|
+
let a = await yr(i);
|
|
10536
10569
|
(a === 'invalid' &&
|
|
10537
10570
|
(process.stderr
|
|
10538
10571
|
.write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
10539
10572
|
`),
|
|
10540
10573
|
process.exit(1)),
|
|
10541
|
-
|
|
10574
|
+
Ke({ apiKey: i }),
|
|
10542
10575
|
process.stdout.write(`
|
|
10543
10576
|
${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
10544
10577
|
`),
|
|
@@ -10563,7 +10596,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10563
10596
|
`);
|
|
10564
10597
|
break;
|
|
10565
10598
|
}
|
|
10566
|
-
(
|
|
10599
|
+
(Ke({ apiKey: '' }),
|
|
10567
10600
|
process.stdout
|
|
10568
10601
|
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(oe())}
|
|
10569
10602
|
`));
|
|
@@ -10607,10 +10640,10 @@ function _(e) {
|
|
|
10607
10640
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10608
10641
|
: `$${e.toFixed(2)}`;
|
|
10609
10642
|
}
|
|
10610
|
-
function
|
|
10643
|
+
function _i(e) {
|
|
10611
10644
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10612
10645
|
}
|
|
10613
|
-
function
|
|
10646
|
+
function kr(e) {
|
|
10614
10647
|
let t = [
|
|
10615
10648
|
['Balance', _(e.balance)],
|
|
10616
10649
|
['Available to this key', _(e.available)],
|
|
@@ -10630,8 +10663,8 @@ function pr(e) {
|
|
|
10630
10663
|
`${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
|
|
10631
10664
|
]),
|
|
10632
10665
|
t.push(
|
|
10633
|
-
['This month', `${_(e.usage.this_month.spend)} on ${
|
|
10634
|
-
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${
|
|
10666
|
+
['This month', `${_(e.usage.this_month.spend)} on ${_i(e.usage.this_month.requests)}`],
|
|
10667
|
+
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${_i(e.usage.last_30_days.requests)}`],
|
|
10635
10668
|
[
|
|
10636
10669
|
'Auto top up',
|
|
10637
10670
|
e.auto_top_up.enabled
|
|
@@ -10644,7 +10677,7 @@ function pr(e) {
|
|
|
10644
10677
|
let a = Math.max(...t.map(([n]) => n.length));
|
|
10645
10678
|
return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
|
|
10646
10679
|
}
|
|
10647
|
-
async function
|
|
10680
|
+
async function Pi(e) {
|
|
10648
10681
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10649
10682
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10650
10683
|
a = !!e.json;
|
|
@@ -10688,13 +10721,13 @@ async function hi(e) {
|
|
|
10688
10721
|
}
|
|
10689
10722
|
process.stdout.write(`
|
|
10690
10723
|
${r.bold('Tein balance')}
|
|
10691
|
-
${
|
|
10724
|
+
${kr(n).join(`
|
|
10692
10725
|
`)}
|
|
10693
10726
|
|
|
10694
10727
|
`);
|
|
10695
10728
|
}
|
|
10696
10729
|
$();
|
|
10697
|
-
function
|
|
10730
|
+
function Ii(e) {
|
|
10698
10731
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10699
10732
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
|
|
10700
10733
|
return (
|
|
@@ -10708,7 +10741,7 @@ function yi(e) {
|
|
|
10708
10741
|
new M(t, i)
|
|
10709
10742
|
);
|
|
10710
10743
|
}
|
|
10711
|
-
function
|
|
10744
|
+
function vi(e, t) {
|
|
10712
10745
|
let i = {};
|
|
10713
10746
|
for (let a of t) {
|
|
10714
10747
|
let n = e[a];
|
|
@@ -10716,7 +10749,7 @@ function bi(e, t) {
|
|
|
10716
10749
|
}
|
|
10717
10750
|
return i;
|
|
10718
10751
|
}
|
|
10719
|
-
async function
|
|
10752
|
+
async function Ti(e, t) {
|
|
10720
10753
|
try {
|
|
10721
10754
|
return await t();
|
|
10722
10755
|
} catch (i) {
|
|
@@ -10740,7 +10773,7 @@ async function ki(e, t) {
|
|
|
10740
10773
|
process.exit(v));
|
|
10741
10774
|
}
|
|
10742
10775
|
}
|
|
10743
|
-
function
|
|
10776
|
+
function at(e) {
|
|
10744
10777
|
let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
|
|
10745
10778
|
i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
|
|
10746
10779
|
return e.map(
|
|
@@ -10751,7 +10784,7 @@ function tt(e) {
|
|
|
10751
10784
|
.trimEnd()}`,
|
|
10752
10785
|
);
|
|
10753
10786
|
}
|
|
10754
|
-
function
|
|
10787
|
+
function wr(e) {
|
|
10755
10788
|
let t = e.summary,
|
|
10756
10789
|
i = [
|
|
10757
10790
|
` Window ${e.from.slice(0, 10)} to ${e.to.slice(0, 10)} (${e.range})${e.filters.model ? `, model ${e.filters.model}` : ''}${e.filters.channel ? `, channel ${e.filters.channel}` : ''}`,
|
|
@@ -10763,7 +10796,7 @@ function cr(e) {
|
|
|
10763
10796
|
e.by_channel.length &&
|
|
10764
10797
|
(i.push('', r.bold('By channel')),
|
|
10765
10798
|
i.push(
|
|
10766
|
-
...
|
|
10799
|
+
...at([
|
|
10767
10800
|
['Channel', 'Spend', 'Requests'],
|
|
10768
10801
|
...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
|
|
10769
10802
|
]),
|
|
@@ -10771,7 +10804,7 @@ function cr(e) {
|
|
|
10771
10804
|
e.by_model.length &&
|
|
10772
10805
|
(i.push('', r.bold('By model')),
|
|
10773
10806
|
i.push(
|
|
10774
|
-
...
|
|
10807
|
+
...at([
|
|
10775
10808
|
['Model', 'Spend', 'Requests', 'Failed'],
|
|
10776
10809
|
...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
|
|
10777
10810
|
]),
|
|
@@ -10779,10 +10812,10 @@ function cr(e) {
|
|
|
10779
10812
|
i
|
|
10780
10813
|
);
|
|
10781
10814
|
}
|
|
10782
|
-
async function
|
|
10815
|
+
async function Mi(e) {
|
|
10783
10816
|
let t = !!e.json,
|
|
10784
|
-
i =
|
|
10785
|
-
a = await
|
|
10817
|
+
i = Ii(e),
|
|
10818
|
+
a = await Ti(t, () => i.getUsage(vi(e, ['range', 'from', 'to', 'model', 'channel'])));
|
|
10786
10819
|
if (t) {
|
|
10787
10820
|
process.stdout.write(
|
|
10788
10821
|
JSON.stringify(a, null, 2) +
|
|
@@ -10793,14 +10826,14 @@ async function wi(e) {
|
|
|
10793
10826
|
}
|
|
10794
10827
|
process.stdout.write(`
|
|
10795
10828
|
${r.bold('Tein usage')}
|
|
10796
|
-
${
|
|
10829
|
+
${wr(a).join(`
|
|
10797
10830
|
`)}
|
|
10798
10831
|
|
|
10799
10832
|
`);
|
|
10800
10833
|
}
|
|
10801
|
-
function
|
|
10834
|
+
function xr(e) {
|
|
10802
10835
|
return e.data.length
|
|
10803
|
-
?
|
|
10836
|
+
? at([
|
|
10804
10837
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
10805
10838
|
...e.data.map((t) => [
|
|
10806
10839
|
t.created_at.slice(0, 16).replace('T', ' '),
|
|
@@ -10811,10 +10844,10 @@ function ur(e) {
|
|
|
10811
10844
|
])
|
|
10812
10845
|
: [' No transactions yet.'];
|
|
10813
10846
|
}
|
|
10814
|
-
async function
|
|
10847
|
+
async function Ki(e) {
|
|
10815
10848
|
let t = !!e.json,
|
|
10816
|
-
i =
|
|
10817
|
-
a = await
|
|
10849
|
+
i = Ii(e),
|
|
10850
|
+
a = await Ti(t, () => i.getTransactions(vi(e, ['limit', 'type', 'after'])));
|
|
10818
10851
|
if (t) {
|
|
10819
10852
|
process.stdout.write(
|
|
10820
10853
|
JSON.stringify(a, null, 2) +
|
|
@@ -10830,18 +10863,18 @@ async function xi(e) {
|
|
|
10830
10863
|
: '';
|
|
10831
10864
|
process.stdout.write(`
|
|
10832
10865
|
${r.bold('Tein balance history')}
|
|
10833
|
-
${
|
|
10866
|
+
${xr(a).join(`
|
|
10834
10867
|
`)}${n}
|
|
10835
10868
|
|
|
10836
10869
|
`);
|
|
10837
10870
|
}
|
|
10838
10871
|
$();
|
|
10839
|
-
|
|
10872
|
+
Ee();
|
|
10840
10873
|
ee();
|
|
10841
|
-
var
|
|
10842
|
-
async function
|
|
10874
|
+
var _r = 3e3;
|
|
10875
|
+
async function Si(e) {
|
|
10843
10876
|
try {
|
|
10844
|
-
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
10877
|
+
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(_r) });
|
|
10845
10878
|
if (!t.ok) return;
|
|
10846
10879
|
let i = await t.json(),
|
|
10847
10880
|
a = {};
|
|
@@ -10849,18 +10882,18 @@ async function _i(e) {
|
|
|
10849
10882
|
let s = String(n.modelSlug ?? '');
|
|
10850
10883
|
J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
10851
10884
|
}
|
|
10852
|
-
|
|
10885
|
+
li(a);
|
|
10853
10886
|
} catch {}
|
|
10854
10887
|
}
|
|
10855
|
-
var
|
|
10856
|
-
|
|
10857
|
-
async function
|
|
10858
|
-
await
|
|
10888
|
+
var Pr = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
10889
|
+
Ir = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
10890
|
+
async function Ei(e, t) {
|
|
10891
|
+
await Si(t);
|
|
10859
10892
|
let i = D();
|
|
10860
10893
|
if (e) {
|
|
10861
10894
|
let s = e.toLowerCase(),
|
|
10862
|
-
o =
|
|
10863
|
-
i =
|
|
10895
|
+
o = Ir[s] ?? s;
|
|
10896
|
+
i = Pr.has(o)
|
|
10864
10897
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
10865
10898
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
10866
10899
|
}
|
|
@@ -10898,8 +10931,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
10898
10931
|
|
|
10899
10932
|
`);
|
|
10900
10933
|
}
|
|
10901
|
-
async function
|
|
10902
|
-
J.has(e) && (await
|
|
10934
|
+
async function Ci(e, t) {
|
|
10935
|
+
J.has(e) && (await Si(t));
|
|
10903
10936
|
let i = H(e);
|
|
10904
10937
|
(i ||
|
|
10905
10938
|
(process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -10980,9 +11013,9 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
|
|
|
10980
11013
|
`);
|
|
10981
11014
|
}
|
|
10982
11015
|
$();
|
|
10983
|
-
|
|
10984
|
-
var
|
|
10985
|
-
|
|
11016
|
+
rt();
|
|
11017
|
+
var vr = 1e4,
|
|
11018
|
+
st = {
|
|
10986
11019
|
price: '',
|
|
10987
11020
|
creativeMode: 'Creative mode',
|
|
10988
11021
|
priority: 'Priority',
|
|
@@ -10992,22 +11025,22 @@ var hr = 1e4,
|
|
|
10992
11025
|
priorityDraft: 'Priority + Draft',
|
|
10993
11026
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
10994
11027
|
},
|
|
10995
|
-
|
|
10996
|
-
|
|
11028
|
+
Tr = Object.keys(st),
|
|
11029
|
+
Mr = {
|
|
10997
11030
|
creativeMode: 'unfiltered',
|
|
10998
11031
|
creativeModePriority: 'unfilteredPriority',
|
|
10999
11032
|
creativeModeDraft: 'unfilteredDraft',
|
|
11000
11033
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
11001
11034
|
};
|
|
11002
|
-
function
|
|
11003
|
-
let i =
|
|
11035
|
+
function Kr(e, t) {
|
|
11036
|
+
let i = Mr[t];
|
|
11004
11037
|
return e[t] ?? (i ? e[i] : void 0);
|
|
11005
11038
|
}
|
|
11006
|
-
async function
|
|
11007
|
-
let i = `${w(e)}${
|
|
11039
|
+
async function Sr(e, t) {
|
|
11040
|
+
let i = `${w(e)}${xe(t)}`,
|
|
11008
11041
|
a;
|
|
11009
11042
|
try {
|
|
11010
|
-
a = await fetch(i, { signal: AbortSignal.timeout(
|
|
11043
|
+
a = await fetch(i, { signal: AbortSignal.timeout(vr) });
|
|
11011
11044
|
} catch {
|
|
11012
11045
|
throw new Error(`Could not reach ${i}`);
|
|
11013
11046
|
}
|
|
@@ -11023,18 +11056,18 @@ async function wr(e, t) {
|
|
|
11023
11056
|
}
|
|
11024
11057
|
return n;
|
|
11025
11058
|
}
|
|
11026
|
-
function
|
|
11059
|
+
function nt(e) {
|
|
11027
11060
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
11028
11061
|
[i, a = ''] = t.split('.');
|
|
11029
11062
|
return `$${i}.${a.padEnd(2, '0')}`;
|
|
11030
11063
|
}
|
|
11031
|
-
function
|
|
11064
|
+
function ot(e) {
|
|
11032
11065
|
if (!e || typeof e.starter != 'number') return null;
|
|
11033
11066
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
11034
11067
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
11035
|
-
return `Starter ${
|
|
11068
|
+
return `Starter ${nt(e.starter)} Plus ${nt(t)} Scale ${nt(i)}`;
|
|
11036
11069
|
}
|
|
11037
|
-
function
|
|
11070
|
+
function Er(e) {
|
|
11038
11071
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
11039
11072
|
let t = [];
|
|
11040
11073
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -11046,33 +11079,33 @@ function xr(e) {
|
|
|
11046
11079
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
11047
11080
|
);
|
|
11048
11081
|
}
|
|
11049
|
-
function
|
|
11050
|
-
let i =
|
|
11051
|
-
for (let a of
|
|
11052
|
-
let n =
|
|
11082
|
+
function Cr(e, t) {
|
|
11083
|
+
let i = Er(e);
|
|
11084
|
+
for (let a of Tr) {
|
|
11085
|
+
let n = ot(Kr(e, a));
|
|
11053
11086
|
if (!n) continue;
|
|
11054
|
-
let s =
|
|
11087
|
+
let s = st[a] ? ` (${st[a]})` : '';
|
|
11055
11088
|
t.push(` ${i}${s} ${n}`);
|
|
11056
11089
|
}
|
|
11057
11090
|
}
|
|
11058
|
-
function
|
|
11091
|
+
function $r(e, t) {
|
|
11059
11092
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
11060
11093
|
t.push(
|
|
11061
11094
|
` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
11062
11095
|
);
|
|
11063
|
-
for (let n of e.variants ?? [])
|
|
11096
|
+
for (let n of e.variants ?? []) Cr(n, t);
|
|
11064
11097
|
let a = e.addons;
|
|
11065
11098
|
if (Array.isArray(a))
|
|
11066
11099
|
for (let n of a) {
|
|
11067
11100
|
if (!n || typeof n != 'object') continue;
|
|
11068
11101
|
let s = n,
|
|
11069
11102
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
11070
|
-
u =
|
|
11103
|
+
u = ot(s.price);
|
|
11071
11104
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
11072
11105
|
}
|
|
11073
11106
|
t.push('');
|
|
11074
11107
|
}
|
|
11075
|
-
function
|
|
11108
|
+
function Ar(e) {
|
|
11076
11109
|
let t = [],
|
|
11077
11110
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
11078
11111
|
(t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -11094,7 +11127,7 @@ function Ir(e) {
|
|
|
11094
11127
|
});
|
|
11095
11128
|
for (let l of s) {
|
|
11096
11129
|
t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
11097
|
-
for (let c of a.get(l) ?? [])
|
|
11130
|
+
for (let c of a.get(l) ?? []) $r(c, t);
|
|
11098
11131
|
}
|
|
11099
11132
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
11100
11133
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -11111,7 +11144,7 @@ function Ir(e) {
|
|
|
11111
11144
|
t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
|
|
11112
11145
|
for (let m of d) {
|
|
11113
11146
|
let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
11114
|
-
f =
|
|
11147
|
+
f = ot(m.prices);
|
|
11115
11148
|
f && t.push(` ${y} ${f}`);
|
|
11116
11149
|
}
|
|
11117
11150
|
t.push('');
|
|
@@ -11124,10 +11157,10 @@ function Ir(e) {
|
|
|
11124
11157
|
`
|
|
11125
11158
|
);
|
|
11126
11159
|
}
|
|
11127
|
-
async function
|
|
11160
|
+
async function $i(e) {
|
|
11128
11161
|
let t;
|
|
11129
11162
|
try {
|
|
11130
|
-
t = await
|
|
11163
|
+
t = await Sr(e.apiUrl, e.model);
|
|
11131
11164
|
} catch (i) {
|
|
11132
11165
|
let a = i instanceof Error ? i.message : String(i);
|
|
11133
11166
|
(process.stderr.write(`${r.red('Error:')} ${a}
|
|
@@ -11138,12 +11171,12 @@ async function vi(e) {
|
|
|
11138
11171
|
e.json
|
|
11139
11172
|
? `${JSON.stringify(t, null, 2)}
|
|
11140
11173
|
`
|
|
11141
|
-
:
|
|
11174
|
+
: Ar(t),
|
|
11142
11175
|
);
|
|
11143
11176
|
}
|
|
11144
|
-
var
|
|
11177
|
+
var Ai = T(require('node:path'));
|
|
11145
11178
|
$();
|
|
11146
|
-
async function
|
|
11179
|
+
async function Oi(e, t) {
|
|
11147
11180
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11148
11181
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
11149
11182
|
(i ||
|
|
@@ -11238,7 +11271,7 @@ ${r.bold('Outputs:')}
|
|
|
11238
11271
|
) {
|
|
11239
11272
|
let p = new C(`Downloading output to ${o}...`).start();
|
|
11240
11273
|
try {
|
|
11241
|
-
(await u.downloadOutput(d.url,
|
|
11274
|
+
(await u.downloadOutput(d.url, Ai.default.resolve(process.cwd(), o)),
|
|
11242
11275
|
p.succeed(`Saved to ${r.bold(o)}`));
|
|
11243
11276
|
} catch (m) {
|
|
11244
11277
|
p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -11253,10 +11286,10 @@ ${d.text}
|
|
|
11253
11286
|
process.stdout.write(`
|
|
11254
11287
|
`);
|
|
11255
11288
|
}
|
|
11256
|
-
var
|
|
11257
|
-
|
|
11289
|
+
var lt = T(require('node:fs')),
|
|
11290
|
+
dt = T(require('node:path'));
|
|
11258
11291
|
$();
|
|
11259
|
-
async function
|
|
11292
|
+
async function qi(e, t = {}) {
|
|
11260
11293
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11261
11294
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
11262
11295
|
n = !!t.json;
|
|
@@ -11273,13 +11306,13 @@ async function Ki(e, t = {}) {
|
|
|
11273
11306
|
process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
|
|
11274
11307
|
`),
|
|
11275
11308
|
process.exit(1)));
|
|
11276
|
-
let s =
|
|
11277
|
-
|
|
11309
|
+
let s = dt.default.resolve(e);
|
|
11310
|
+
lt.default.existsSync(s) ||
|
|
11278
11311
|
(process.stderr.write(`${r.red('Error:')} File not found: ${s}
|
|
11279
11312
|
`),
|
|
11280
11313
|
process.exit(1));
|
|
11281
|
-
let o =
|
|
11282
|
-
l =
|
|
11314
|
+
let o = dt.default.basename(s),
|
|
11315
|
+
l = lt.default.readFileSync(s).toString('base64'),
|
|
11283
11316
|
c = new M(i, a),
|
|
11284
11317
|
d = new C(`Uploading ${r.bold(o)} to Tein AI CDN...`);
|
|
11285
11318
|
n || d.start();
|
|
@@ -11322,8 +11355,8 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
|
|
|
11322
11355
|
}
|
|
11323
11356
|
re();
|
|
11324
11357
|
ee();
|
|
11325
|
-
|
|
11326
|
-
function
|
|
11358
|
+
De();
|
|
11359
|
+
function Qi() {
|
|
11327
11360
|
process.stdout.write(`
|
|
11328
11361
|
${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
11329
11362
|
|
|
@@ -11405,11 +11438,11 @@ ${r.bold('EXAMPLES:')}
|
|
|
11405
11438
|
|
|
11406
11439
|
`);
|
|
11407
11440
|
}
|
|
11408
|
-
async function
|
|
11441
|
+
async function en() {
|
|
11409
11442
|
let e = process.argv.slice(2),
|
|
11410
|
-
t =
|
|
11443
|
+
t = wi(e);
|
|
11411
11444
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
11412
|
-
|
|
11445
|
+
Qi();
|
|
11413
11446
|
return;
|
|
11414
11447
|
}
|
|
11415
11448
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -11436,14 +11469,14 @@ async function Gr() {
|
|
|
11436
11469
|
}
|
|
11437
11470
|
case 'models':
|
|
11438
11471
|
case 'list': {
|
|
11439
|
-
await
|
|
11472
|
+
await Ei(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
11440
11473
|
break;
|
|
11441
11474
|
}
|
|
11442
11475
|
case 'pricing':
|
|
11443
11476
|
case 'prices': {
|
|
11444
11477
|
let i = t.options.model,
|
|
11445
11478
|
a = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
11446
|
-
await
|
|
11479
|
+
await $i({
|
|
11447
11480
|
model: a,
|
|
11448
11481
|
json: !!t.options.json,
|
|
11449
11482
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -11458,40 +11491,40 @@ async function Gr() {
|
|
|
11458
11491
|
process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
|
|
11459
11492
|
`),
|
|
11460
11493
|
process.exit(1)),
|
|
11461
|
-
await
|
|
11494
|
+
await Ci(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
11462
11495
|
break;
|
|
11463
11496
|
}
|
|
11464
11497
|
case 'upload': {
|
|
11465
11498
|
let i = t.subcommand || '';
|
|
11466
|
-
await
|
|
11499
|
+
await qi(i, t.options);
|
|
11467
11500
|
break;
|
|
11468
11501
|
}
|
|
11469
11502
|
case 'run':
|
|
11470
11503
|
case 'generate': {
|
|
11471
11504
|
let i = t.subcommand || '';
|
|
11472
|
-
await
|
|
11505
|
+
await it(i, t.options);
|
|
11473
11506
|
break;
|
|
11474
11507
|
}
|
|
11475
11508
|
case 'status': {
|
|
11476
11509
|
let i = t.subcommand || '';
|
|
11477
|
-
await
|
|
11510
|
+
await Oi(i, t.options);
|
|
11478
11511
|
break;
|
|
11479
11512
|
}
|
|
11480
11513
|
case 'balance': {
|
|
11481
|
-
await
|
|
11514
|
+
await Pi(t.options);
|
|
11482
11515
|
break;
|
|
11483
11516
|
}
|
|
11484
11517
|
case 'usage': {
|
|
11485
|
-
await
|
|
11518
|
+
await Mi(t.options);
|
|
11486
11519
|
break;
|
|
11487
11520
|
}
|
|
11488
11521
|
case 'transactions':
|
|
11489
11522
|
case 'history': {
|
|
11490
|
-
await
|
|
11523
|
+
await Ki(t.options);
|
|
11491
11524
|
break;
|
|
11492
11525
|
}
|
|
11493
11526
|
case 'mcp': {
|
|
11494
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
11527
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Xi(), Yi));
|
|
11495
11528
|
await i();
|
|
11496
11529
|
break;
|
|
11497
11530
|
}
|
|
@@ -11504,15 +11537,15 @@ ${r.red('Error:')} Unknown command or model "${t.command}".
|
|
|
11504
11537
|
Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
|
|
11505
11538
|
`),
|
|
11506
11539
|
process.exit(v)),
|
|
11507
|
-
await
|
|
11540
|
+
await it(t.command, t.options));
|
|
11508
11541
|
return;
|
|
11509
11542
|
}
|
|
11510
|
-
|
|
11543
|
+
Qi();
|
|
11511
11544
|
break;
|
|
11512
11545
|
}
|
|
11513
11546
|
}
|
|
11514
11547
|
}
|
|
11515
|
-
|
|
11548
|
+
en().catch((e) => {
|
|
11516
11549
|
(e instanceof b &&
|
|
11517
11550
|
(process.stderr.write(`
|
|
11518
11551
|
${r.red('Error:')} ${K(e).join(`
|