@teinai/cli 1.1.37 → 1.1.39
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 +850 -724
- 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 Hi = Object.create;
|
|
4
|
+
var Ie = Object.defineProperty;
|
|
5
|
+
var zi = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var Ji = Object.getOwnPropertyNames;
|
|
7
|
+
var Wi = Object.getPrototypeOf,
|
|
8
|
+
Yi = 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 Xi = (e, t) => {
|
|
18
|
+
for (var i in t) Ie(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
Qi = (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 Ji(t))
|
|
23
|
+
!Yi.call(e, n) &&
|
|
24
24
|
n !== i &&
|
|
25
|
-
|
|
25
|
+
Ie(e, n, { get: () => t[n], enumerable: !(a = zi(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 ? Hi(Wi(e)) : {}),
|
|
30
|
+
Qi(t || !e || !e.__esModule ? Ie(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function ta(e) {
|
|
33
33
|
for (let t of e)
|
|
34
34
|
try {
|
|
35
|
-
let i = JSON.parse(
|
|
35
|
+
let i = JSON.parse(ut.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 ea;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ia() {
|
|
42
42
|
let e = typeof __dirname == 'string' ? __dirname : process.cwd();
|
|
43
43
|
return [
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
ve.default.join(e, 'package.json'),
|
|
45
|
+
ve.default.join(e, '..', '..', 'cli-package', 'package.json'),
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
var ut,
|
|
49
|
+
ve,
|
|
50
|
+
ea,
|
|
51
51
|
F,
|
|
52
|
-
|
|
52
|
+
re = h(() => {
|
|
53
53
|
'use strict';
|
|
54
|
-
((
|
|
55
|
-
F =
|
|
54
|
+
((ut = T(require('node:fs'))), (ve = T(require('node:path'))), (ea = '0.0.0-dev'));
|
|
55
|
+
F = ta(ia());
|
|
56
56
|
});
|
|
57
57
|
function j() {
|
|
58
58
|
try {
|
|
@@ -63,12 +63,12 @@ function j() {
|
|
|
63
63
|
} catch {}
|
|
64
64
|
return {};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Me(e) {
|
|
67
67
|
try {
|
|
68
|
-
R.default.existsSync(
|
|
68
|
+
R.default.existsSync(se) || R.default.mkdirSync(se, { recursive: !0, mode: 448 });
|
|
69
69
|
let i = { ...j(), ...e };
|
|
70
70
|
(R.default.writeFileSync(B, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
71
|
-
R.default.chmodSync(
|
|
71
|
+
R.default.chmodSync(se, 448),
|
|
72
72
|
R.default.chmodSync(B, 384));
|
|
73
73
|
} catch (t) {
|
|
74
74
|
throw new Error(`Failed to save config to ${B}: ${t}`);
|
|
@@ -88,47 +88,47 @@ function w(e) {
|
|
|
88
88
|
let i = j();
|
|
89
89
|
return i.apiUrl && i.apiUrl.trim() ? i.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function oe() {
|
|
92
92
|
return B;
|
|
93
93
|
}
|
|
94
94
|
var R,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
yt,
|
|
96
|
+
Te,
|
|
97
|
+
se,
|
|
98
98
|
B,
|
|
99
|
-
|
|
99
|
+
$ = h(() => {
|
|
100
100
|
'use strict';
|
|
101
101
|
((R = T(require('node:fs'))),
|
|
102
|
-
(
|
|
103
|
-
(
|
|
104
|
-
(
|
|
105
|
-
(B =
|
|
102
|
+
(yt = T(require('node:os'))),
|
|
103
|
+
(Te = T(require('node:path'))),
|
|
104
|
+
(se = Te.default.join(yt.default.homedir(), '.tein')),
|
|
105
|
+
(B = Te.default.join(se, 'config.json')));
|
|
106
106
|
});
|
|
107
|
-
var
|
|
108
|
-
yt,
|
|
107
|
+
var oa,
|
|
109
108
|
bt,
|
|
110
|
-
kt
|
|
109
|
+
kt,
|
|
110
|
+
wt = h(() => {
|
|
111
111
|
'use strict';
|
|
112
|
-
((
|
|
113
|
-
(
|
|
114
|
-
(
|
|
112
|
+
((oa = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
|
|
113
|
+
(bt = [...oa, 'auto']),
|
|
114
|
+
(kt =
|
|
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
|
+
Se = 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 xt = h(() => {
|
|
126
126
|
'use strict';
|
|
127
127
|
});
|
|
128
|
-
var
|
|
129
|
-
|
|
128
|
+
var le,
|
|
129
|
+
_t = h(() => {
|
|
130
130
|
'use strict';
|
|
131
|
-
|
|
131
|
+
le = {
|
|
132
132
|
source: 'TEIN Price Board',
|
|
133
133
|
checked: '17 Sep 2026',
|
|
134
134
|
generated: '2026-10-01',
|
|
@@ -216,6 +216,7 @@ var de,
|
|
|
216
216
|
'claude-haiku-4-5',
|
|
217
217
|
],
|
|
218
218
|
},
|
|
219
|
+
{ slug: 'gemini-omni', name: 'Gemini Omni', models: ['gemini-omni-1.2-flash'] },
|
|
219
220
|
{ slug: 'kling', name: 'Kling', models: ['kling-v4', 'kling-v4-flash', 'kling-v3-video'] },
|
|
220
221
|
{ slug: 'ltx', name: 'LTX', models: ['ltx-2.3-pro'] },
|
|
221
222
|
{ slug: 'vidu', name: 'Vidu', models: ['vidu-q4-preview'] },
|
|
@@ -5716,6 +5717,47 @@ var de,
|
|
|
5716
5717
|
defaultEndpoint: 'cheap',
|
|
5717
5718
|
from: { variant: 'cheap-input' },
|
|
5718
5719
|
},
|
|
5720
|
+
{
|
|
5721
|
+
slug: 'gemini-omni-1.2-flash',
|
|
5722
|
+
name: 'Gemini Omni 1.2 Flash',
|
|
5723
|
+
family: 'gemini-omni',
|
|
5724
|
+
vendor: 'Google',
|
|
5725
|
+
desc: "Google's Gemini Omni 1.2 Flash \u2014 video with native sound from text, a start frame (with an optional end frame) or up to 6 reference images, plus edits and extensions of your own clips, at 360p to 4K for 3 to 15 seconds.",
|
|
5726
|
+
kind: 'video',
|
|
5727
|
+
unit: '/sec',
|
|
5728
|
+
api: { model: 'gemini-omni-1.2-flash' },
|
|
5729
|
+
variants: [
|
|
5730
|
+
{
|
|
5731
|
+
id: '360p',
|
|
5732
|
+
price: { starter: 0.0194, plus: 0.0176, scale: 0.0176 },
|
|
5733
|
+
label: '360p',
|
|
5734
|
+
resolution: '360p',
|
|
5735
|
+
},
|
|
5736
|
+
{
|
|
5737
|
+
id: '720p',
|
|
5738
|
+
price: { starter: 0.0436, plus: 0.0396, scale: 0.037 },
|
|
5739
|
+
label: '720p',
|
|
5740
|
+
resolution: '720p',
|
|
5741
|
+
},
|
|
5742
|
+
{
|
|
5743
|
+
id: '1080p',
|
|
5744
|
+
price: { starter: 0.0485, plus: 0.044, scale: 0.0412 },
|
|
5745
|
+
label: '1080p',
|
|
5746
|
+
resolution: '1080p',
|
|
5747
|
+
},
|
|
5748
|
+
{
|
|
5749
|
+
id: '4k',
|
|
5750
|
+
price: { starter: 0.1067, plus: 0.0969, scale: 0.0906 },
|
|
5751
|
+
label: '4K',
|
|
5752
|
+
resolution: '4k',
|
|
5753
|
+
},
|
|
5754
|
+
],
|
|
5755
|
+
unfiltered: null,
|
|
5756
|
+
priority: null,
|
|
5757
|
+
draft: null,
|
|
5758
|
+
axes: { resolution: ['360p', '720p', '1080p', '4k'] },
|
|
5759
|
+
from: { variant: '720p' },
|
|
5760
|
+
},
|
|
5719
5761
|
{
|
|
5720
5762
|
slug: 'kling-v4',
|
|
5721
5763
|
name: 'Kling Video 4.0',
|
|
@@ -6198,16 +6240,16 @@ var de,
|
|
|
6198
6240
|
],
|
|
6199
6241
|
};
|
|
6200
6242
|
});
|
|
6201
|
-
var
|
|
6202
|
-
|
|
6243
|
+
var Pt,
|
|
6244
|
+
It = h(() => {
|
|
6203
6245
|
'use strict';
|
|
6204
|
-
|
|
6246
|
+
Pt = [];
|
|
6205
6247
|
});
|
|
6206
|
-
var
|
|
6207
|
-
|
|
6208
|
-
|
|
6248
|
+
var de,
|
|
6249
|
+
vt,
|
|
6250
|
+
Ee = h(() => {
|
|
6209
6251
|
'use strict';
|
|
6210
|
-
((
|
|
6252
|
+
((de = [
|
|
6211
6253
|
{
|
|
6212
6254
|
slug: 'tein-video-upscaler',
|
|
6213
6255
|
name: 'Tein Video Upscaler',
|
|
@@ -6282,12 +6324,12 @@ var pe,
|
|
|
6282
6324
|
from: { variant: 'swap' },
|
|
6283
6325
|
},
|
|
6284
6326
|
]),
|
|
6285
|
-
(
|
|
6327
|
+
(vt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
6286
6328
|
});
|
|
6287
|
-
function
|
|
6329
|
+
function Ae(e, t) {
|
|
6288
6330
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
6289
6331
|
}
|
|
6290
|
-
function
|
|
6332
|
+
function pa(e, t) {
|
|
6291
6333
|
if (e === 'seedance-2-mini') return 'mini';
|
|
6292
6334
|
if (e !== 'seedance-2') return;
|
|
6293
6335
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -6297,100 +6339,99 @@ function oa(e, t) {
|
|
|
6297
6339
|
? 'fast'
|
|
6298
6340
|
: 'standard';
|
|
6299
6341
|
}
|
|
6300
|
-
function
|
|
6342
|
+
function ca(e, t) {
|
|
6301
6343
|
let i = e
|
|
6302
6344
|
.trim()
|
|
6303
6345
|
.toLowerCase()
|
|
6304
6346
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
6305
6347
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
6306
|
-
let n =
|
|
6307
|
-
s =
|
|
6348
|
+
let n = pa(i, t),
|
|
6349
|
+
s = Ce.get(Ae('seedance-2', n));
|
|
6308
6350
|
return s ? s.slug : null;
|
|
6309
6351
|
}
|
|
6310
|
-
let a =
|
|
6352
|
+
let a = pe.get(i) ?? Ce.get(Ae(i));
|
|
6311
6353
|
return a ? a.slug : null;
|
|
6312
6354
|
}
|
|
6313
|
-
function
|
|
6314
|
-
return
|
|
6355
|
+
function ma(e, t) {
|
|
6356
|
+
return pe.has(e) && !(ua.has(e) && t) ? e : ca(e, t);
|
|
6315
6357
|
}
|
|
6316
6358
|
function Y(e, t) {
|
|
6317
|
-
let i =
|
|
6318
|
-
return i ? (
|
|
6359
|
+
let i = ma(e, t);
|
|
6360
|
+
return i ? (pe.get(i) ?? null) : null;
|
|
6319
6361
|
}
|
|
6320
|
-
function
|
|
6321
|
-
return
|
|
6362
|
+
function ce() {
|
|
6363
|
+
return St;
|
|
6322
6364
|
}
|
|
6323
|
-
var
|
|
6324
|
-
Tt,
|
|
6365
|
+
var Oe,
|
|
6325
6366
|
Mt,
|
|
6326
6367
|
Kt,
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
Ae,
|
|
6368
|
+
St,
|
|
6369
|
+
la,
|
|
6370
|
+
pe,
|
|
6371
|
+
Ce,
|
|
6372
|
+
Tt,
|
|
6333
6373
|
da,
|
|
6374
|
+
$e,
|
|
6375
|
+
ua,
|
|
6334
6376
|
G = h(() => {
|
|
6335
6377
|
'use strict';
|
|
6336
|
-
wt();
|
|
6337
6378
|
xt();
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
(
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
models:
|
|
6379
|
+
_t();
|
|
6380
|
+
It();
|
|
6381
|
+
Ee();
|
|
6382
|
+
((Oe = {
|
|
6383
|
+
...le,
|
|
6384
|
+
families: le.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
|
|
6385
|
+
models: le.models.filter((e) => !W(e.slug)),
|
|
6344
6386
|
}),
|
|
6345
|
-
(
|
|
6346
|
-
(
|
|
6347
|
-
(
|
|
6348
|
-
(
|
|
6349
|
-
...
|
|
6350
|
-
let t =
|
|
6387
|
+
(Mt = de.filter((e) => !W(e.slug))),
|
|
6388
|
+
(Kt = Pt.filter((e) => !W(e.slug) && !Oe.models.some((t) => t.slug === e.slug))),
|
|
6389
|
+
(St = [...Oe.models, ...Kt, ...Mt]),
|
|
6390
|
+
(la = [
|
|
6391
|
+
...Oe.families.map((e) => {
|
|
6392
|
+
let t = Kt.filter((i) => i.family === e.slug).map((i) => i.slug);
|
|
6351
6393
|
return t.length ? { ...e, models: [...e.models, ...t] } : e;
|
|
6352
6394
|
}),
|
|
6353
|
-
...
|
|
6354
|
-
...e,
|
|
6355
|
-
|
|
6356
|
-
})).filter((e) => e.models.length > 0),
|
|
6395
|
+
...vt
|
|
6396
|
+
.map((e) => ({ ...e, models: Mt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
|
|
6397
|
+
.filter((e) => e.models.length > 0),
|
|
6357
6398
|
]),
|
|
6358
|
-
(
|
|
6359
|
-
(
|
|
6360
|
-
(
|
|
6361
|
-
(
|
|
6362
|
-
(
|
|
6363
|
-
for (let e of
|
|
6364
|
-
(
|
|
6365
|
-
for (let t of e.variants)
|
|
6399
|
+
(pe = new Map()),
|
|
6400
|
+
(Ce = new Map()),
|
|
6401
|
+
(Tt = new Map()),
|
|
6402
|
+
(da = new Map()),
|
|
6403
|
+
($e = new Map()));
|
|
6404
|
+
for (let e of St) {
|
|
6405
|
+
(pe.set(e.slug, e), Ce.set(Ae(e.api.model, e.api.quality), e));
|
|
6406
|
+
for (let t of e.variants) Tt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
6366
6407
|
for (let t of e.editVariants ?? [])
|
|
6367
|
-
|
|
6368
|
-
for (let t of e.addons ?? [])
|
|
6369
|
-
|
|
6408
|
+
Tt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6409
|
+
for (let t of e.addons ?? []) da.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6410
|
+
$e.set(e.slug, e.family);
|
|
6370
6411
|
}
|
|
6371
|
-
for (let e of
|
|
6372
|
-
|
|
6412
|
+
for (let e of la) for (let t of e.models) $e.has(t) || $e.set(t, e.slug);
|
|
6413
|
+
ua = new Set(['seedance-2']);
|
|
6373
6414
|
});
|
|
6374
|
-
function
|
|
6415
|
+
function ue(e) {
|
|
6375
6416
|
let t = e.from?.variant;
|
|
6376
6417
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
6377
6418
|
}
|
|
6378
|
-
function
|
|
6419
|
+
function qe(e) {
|
|
6379
6420
|
if (e.endpoints?.length)
|
|
6380
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6381
|
-
?
|
|
6421
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === Et)
|
|
6422
|
+
? Et
|
|
6382
6423
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6383
6424
|
}
|
|
6384
|
-
var
|
|
6385
|
-
|
|
6425
|
+
var Et,
|
|
6426
|
+
Re = h(() => {
|
|
6386
6427
|
'use strict';
|
|
6387
6428
|
G();
|
|
6388
|
-
|
|
6429
|
+
Et = 'dynamic';
|
|
6389
6430
|
});
|
|
6390
|
-
var
|
|
6391
|
-
|
|
6431
|
+
var me,
|
|
6432
|
+
Le = h(() => {
|
|
6392
6433
|
'use strict';
|
|
6393
|
-
|
|
6434
|
+
me = {
|
|
6394
6435
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
6395
6436
|
'gemini-3-7-flash': 'gemini-3.7-flash',
|
|
6396
6437
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
@@ -6404,25 +6445,25 @@ var Ct = h(() => {
|
|
|
6404
6445
|
'use strict';
|
|
6405
6446
|
});
|
|
6406
6447
|
function $t(e, t) {
|
|
6407
|
-
return typeof t == 'string' && (
|
|
6448
|
+
return typeof t == 'string' && (fa[e]?.includes(t) ?? !1);
|
|
6408
6449
|
}
|
|
6409
|
-
var
|
|
6410
|
-
|
|
6450
|
+
var fa,
|
|
6451
|
+
At = h(() => {
|
|
6411
6452
|
'use strict';
|
|
6412
6453
|
G();
|
|
6413
|
-
|
|
6454
|
+
Re();
|
|
6414
6455
|
Ct();
|
|
6415
|
-
|
|
6456
|
+
fa = {};
|
|
6416
6457
|
});
|
|
6417
|
-
function
|
|
6418
|
-
return e === 'nano-banana-pro' ?
|
|
6458
|
+
function Ot(e) {
|
|
6459
|
+
return e === 'nano-banana-pro' ? ga : ha;
|
|
6419
6460
|
}
|
|
6420
|
-
var
|
|
6421
|
-
|
|
6422
|
-
|
|
6461
|
+
var ga,
|
|
6462
|
+
ha,
|
|
6463
|
+
qt = h(() => {
|
|
6423
6464
|
'use strict';
|
|
6424
|
-
((
|
|
6425
|
-
(
|
|
6465
|
+
((ga = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6466
|
+
(ha = [
|
|
6426
6467
|
'auto',
|
|
6427
6468
|
'1:1',
|
|
6428
6469
|
'1:4',
|
|
@@ -6440,10 +6481,10 @@ var ua,
|
|
|
6440
6481
|
'21:9',
|
|
6441
6482
|
]));
|
|
6442
6483
|
});
|
|
6443
|
-
var
|
|
6444
|
-
|
|
6484
|
+
var Rt,
|
|
6485
|
+
Lt = h(() => {
|
|
6445
6486
|
'use strict';
|
|
6446
|
-
|
|
6487
|
+
Rt = [
|
|
6447
6488
|
'prompt',
|
|
6448
6489
|
'system',
|
|
6449
6490
|
'messages',
|
|
@@ -6457,10 +6498,10 @@ var qt,
|
|
|
6457
6498
|
'endpoint',
|
|
6458
6499
|
];
|
|
6459
6500
|
});
|
|
6460
|
-
var
|
|
6461
|
-
|
|
6501
|
+
var Dt,
|
|
6502
|
+
Nt = h(() => {
|
|
6462
6503
|
'use strict';
|
|
6463
|
-
|
|
6504
|
+
Dt = [
|
|
6464
6505
|
{
|
|
6465
6506
|
slug: 'claude-fable-5-1',
|
|
6466
6507
|
family: 'fable-5-1',
|
|
@@ -6532,10 +6573,10 @@ var Lt,
|
|
|
6532
6573
|
function Vt(e) {
|
|
6533
6574
|
return `$${e}`;
|
|
6534
6575
|
}
|
|
6535
|
-
function
|
|
6576
|
+
function De(e, t, i) {
|
|
6536
6577
|
return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
6537
6578
|
}
|
|
6538
|
-
function
|
|
6579
|
+
function ya(e) {
|
|
6539
6580
|
return [
|
|
6540
6581
|
{
|
|
6541
6582
|
name: 'prompt',
|
|
@@ -6601,12 +6642,12 @@ function fa(e) {
|
|
|
6601
6642
|
},
|
|
6602
6643
|
];
|
|
6603
6644
|
}
|
|
6604
|
-
function
|
|
6645
|
+
function Ut() {
|
|
6605
6646
|
return Object.fromEntries(
|
|
6606
|
-
|
|
6607
|
-
let t =
|
|
6608
|
-
i =
|
|
6609
|
-
a =
|
|
6647
|
+
Dt.map((e) => {
|
|
6648
|
+
let t = De(e.slug, 'cheap', 'input'),
|
|
6649
|
+
i = De(e.slug, 'cheap', 'output'),
|
|
6650
|
+
a = De(e.slug, 'stable', 'input') != null,
|
|
6610
6651
|
n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
|
|
6611
6652
|
s = {
|
|
6612
6653
|
slug: e.slug,
|
|
@@ -6618,50 +6659,50 @@ function Nt() {
|
|
|
6618
6659
|
priceFormatted: n,
|
|
6619
6660
|
unit: '/M tokens',
|
|
6620
6661
|
primaryToolName: 'run_task',
|
|
6621
|
-
parameters:
|
|
6662
|
+
parameters: ya(a),
|
|
6622
6663
|
};
|
|
6623
6664
|
return [e.slug, s];
|
|
6624
6665
|
}),
|
|
6625
6666
|
);
|
|
6626
6667
|
}
|
|
6627
|
-
var
|
|
6668
|
+
var Ft = h(() => {
|
|
6628
6669
|
'use strict';
|
|
6629
|
-
|
|
6670
|
+
Nt();
|
|
6630
6671
|
G();
|
|
6631
6672
|
});
|
|
6632
|
-
function
|
|
6633
|
-
return e ?
|
|
6673
|
+
function fe(e) {
|
|
6674
|
+
return e ? ka.get(e) : void 0;
|
|
6634
6675
|
}
|
|
6635
|
-
function
|
|
6676
|
+
function Ht(e, t) {
|
|
6636
6677
|
return !e.aspects?.length || e.sourceFramedModes?.includes(t)
|
|
6637
6678
|
? null
|
|
6638
6679
|
: e.adaptiveModes?.includes(t)
|
|
6639
6680
|
? [...e.aspects, 'adaptive']
|
|
6640
6681
|
: [...e.aspects];
|
|
6641
6682
|
}
|
|
6642
|
-
function
|
|
6683
|
+
function zt(e, t, i) {
|
|
6643
6684
|
return e.modes.includes('motion_control')
|
|
6644
6685
|
? t === 'motion_control'
|
|
6645
|
-
? !
|
|
6646
|
-
: !
|
|
6686
|
+
? !xa.includes(i)
|
|
6687
|
+
: !wa.includes(i)
|
|
6647
6688
|
: !0;
|
|
6648
6689
|
}
|
|
6649
|
-
var
|
|
6650
|
-
|
|
6651
|
-
Bt,
|
|
6652
|
-
In,
|
|
6653
|
-
ha,
|
|
6690
|
+
var Bt,
|
|
6691
|
+
ba,
|
|
6654
6692
|
jt,
|
|
6693
|
+
Mn,
|
|
6694
|
+
ka,
|
|
6695
|
+
Gt,
|
|
6655
6696
|
Ne,
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6697
|
+
Kn,
|
|
6698
|
+
Ve,
|
|
6699
|
+
wa,
|
|
6700
|
+
xa,
|
|
6701
|
+
Ue = h(() => {
|
|
6661
6702
|
'use strict';
|
|
6662
|
-
((
|
|
6663
|
-
(
|
|
6664
|
-
(
|
|
6703
|
+
((Bt = ['16:9', '9:16', '1:1', '21:9']),
|
|
6704
|
+
(ba = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
|
|
6705
|
+
(jt = [
|
|
6665
6706
|
{
|
|
6666
6707
|
slug: 'kling-v4',
|
|
6667
6708
|
kind: 'video',
|
|
@@ -6669,7 +6710,7 @@ var Ft,
|
|
|
6669
6710
|
promptMax: 26e3,
|
|
6670
6711
|
duration: { min: 3, max: 30, default: 5 },
|
|
6671
6712
|
heights: { '720p': 720, '1080p': 1080 },
|
|
6672
|
-
aspects:
|
|
6713
|
+
aspects: Bt,
|
|
6673
6714
|
sourceFramedModes: ['image_to_video'],
|
|
6674
6715
|
adaptiveModes: ['multi_reference'],
|
|
6675
6716
|
fps: 24,
|
|
@@ -6693,7 +6734,7 @@ var Ft,
|
|
|
6693
6734
|
promptMax: 26e3,
|
|
6694
6735
|
duration: { min: 3, max: 20, default: 5 },
|
|
6695
6736
|
heights: { '720p': 720 },
|
|
6696
|
-
aspects: [...
|
|
6737
|
+
aspects: [...Bt, '4:3', '3:4'],
|
|
6697
6738
|
sourceFramedModes: ['image_to_video'],
|
|
6698
6739
|
adaptiveModes: ['multi_reference'],
|
|
6699
6740
|
fps: 24,
|
|
@@ -6733,7 +6774,7 @@ var Ft,
|
|
|
6733
6774
|
promptMax: 65535,
|
|
6734
6775
|
duration: { min: 5, max: 15, default: 5 },
|
|
6735
6776
|
heights: { '480p': 480, '768p': 768 },
|
|
6736
|
-
aspects:
|
|
6777
|
+
aspects: ba,
|
|
6737
6778
|
fps: 24,
|
|
6738
6779
|
audio: 'free',
|
|
6739
6780
|
seed: !0,
|
|
@@ -6808,9 +6849,9 @@ var Ft,
|
|
|
6808
6849
|
seed: !0,
|
|
6809
6850
|
},
|
|
6810
6851
|
]),
|
|
6811
|
-
(
|
|
6812
|
-
(
|
|
6813
|
-
((
|
|
6852
|
+
(Mn = jt.map((e) => e.slug)),
|
|
6853
|
+
(ka = new Map(jt.map((e) => [e.slug, e]))));
|
|
6854
|
+
((Gt = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6814
6855
|
(Ne = {
|
|
6815
6856
|
hpp4J3VqNfWAUOO0d1Us: 'Bella',
|
|
6816
6857
|
CwhRBWXzGAHq8TQ4Fs17: 'Roger',
|
|
@@ -6833,8 +6874,8 @@ var Ft,
|
|
|
6833
6874
|
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
6834
6875
|
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
6835
6876
|
}),
|
|
6836
|
-
(
|
|
6837
|
-
(
|
|
6877
|
+
(Kn = Object.keys(Ne)),
|
|
6878
|
+
(Ve = [
|
|
6838
6879
|
'mp3_44100_128',
|
|
6839
6880
|
'mp3_22050_32',
|
|
6840
6881
|
'mp3_24000_48',
|
|
@@ -6848,8 +6889,8 @@ var Ft,
|
|
|
6848
6889
|
'opus_48000_128',
|
|
6849
6890
|
'opus_48000_192',
|
|
6850
6891
|
]));
|
|
6851
|
-
((
|
|
6852
|
-
(
|
|
6892
|
+
((wa = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
6893
|
+
(xa = [
|
|
6853
6894
|
'duration',
|
|
6854
6895
|
'aspect_ratio',
|
|
6855
6896
|
'generate_audio',
|
|
@@ -6861,7 +6902,7 @@ var Ft,
|
|
|
6861
6902
|
'audios',
|
|
6862
6903
|
]));
|
|
6863
6904
|
});
|
|
6864
|
-
function
|
|
6905
|
+
function Pa() {
|
|
6865
6906
|
return [
|
|
6866
6907
|
{
|
|
6867
6908
|
name: 'image_url',
|
|
@@ -6889,7 +6930,7 @@ function wa() {
|
|
|
6889
6930
|
},
|
|
6890
6931
|
];
|
|
6891
6932
|
}
|
|
6892
|
-
function
|
|
6933
|
+
function Ia(e) {
|
|
6893
6934
|
let t = e.duration,
|
|
6894
6935
|
i = Object.keys(e.heights),
|
|
6895
6936
|
a = e.sourceFramedModes?.length
|
|
@@ -6982,7 +7023,7 @@ function xa(e) {
|
|
|
6982
7023
|
}
|
|
6983
7024
|
return o;
|
|
6984
7025
|
}
|
|
6985
|
-
function
|
|
7026
|
+
function va(e) {
|
|
6986
7027
|
let t = Object.keys(e.sizes);
|
|
6987
7028
|
return [
|
|
6988
7029
|
{
|
|
@@ -6999,13 +7040,13 @@ function _a(e) {
|
|
|
6999
7040
|
},
|
|
7000
7041
|
];
|
|
7001
7042
|
}
|
|
7002
|
-
function
|
|
7043
|
+
function Ma() {
|
|
7003
7044
|
return [
|
|
7004
7045
|
{
|
|
7005
7046
|
name: 'voice_id',
|
|
7006
7047
|
type: 'string',
|
|
7007
|
-
default:
|
|
7008
|
-
description: `text_to_speech: the ElevenLabs voice id, one of: ${
|
|
7048
|
+
default: Gt,
|
|
7049
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${Ta}.`,
|
|
7009
7050
|
},
|
|
7010
7051
|
{
|
|
7011
7052
|
name: 'turns',
|
|
@@ -7013,7 +7054,7 @@ function Ia() {
|
|
|
7013
7054
|
description:
|
|
7014
7055
|
'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.',
|
|
7015
7056
|
},
|
|
7016
|
-
{ name: 'output_format', type: 'select', default:
|
|
7057
|
+
{ name: 'output_format', type: 'select', default: Ve[0], options: [...Ve] },
|
|
7017
7058
|
{ name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
|
|
7018
7059
|
{
|
|
7019
7060
|
name: 'similarity_boost',
|
|
@@ -7024,7 +7065,7 @@ function Ia() {
|
|
|
7024
7065
|
},
|
|
7025
7066
|
];
|
|
7026
7067
|
}
|
|
7027
|
-
function
|
|
7068
|
+
function Jt(e) {
|
|
7028
7069
|
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
7029
7070
|
i = [
|
|
7030
7071
|
{
|
|
@@ -7039,26 +7080,26 @@ function zt(e) {
|
|
|
7039
7080
|
required: !0,
|
|
7040
7081
|
...(e.modeRequired ? {} : { default: e.modes[0] }),
|
|
7041
7082
|
options: [...e.modes],
|
|
7042
|
-
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) =>
|
|
7083
|
+
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => _a[a]).join(' ')}`,
|
|
7043
7084
|
},
|
|
7044
7085
|
];
|
|
7045
7086
|
return (
|
|
7046
|
-
e.kind === 'video' ? i.push(...
|
|
7047
|
-
e.modes.includes('motion_control') && i.push(...
|
|
7087
|
+
e.kind === 'video' ? i.push(...Ia(e)) : e.kind === 'image' ? i.push(...va(e)) : i.push(...Ma()),
|
|
7088
|
+
e.modes.includes('motion_control') && i.push(...Pa()),
|
|
7048
7089
|
e.seed &&
|
|
7049
7090
|
i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
7050
7091
|
i
|
|
7051
7092
|
);
|
|
7052
7093
|
}
|
|
7053
7094
|
var L,
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7095
|
+
_a,
|
|
7096
|
+
Ta,
|
|
7097
|
+
Wt = h(() => {
|
|
7057
7098
|
'use strict';
|
|
7058
|
-
|
|
7099
|
+
Ue();
|
|
7059
7100
|
((L =
|
|
7060
7101
|
'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.'),
|
|
7061
|
-
(
|
|
7102
|
+
(_a = {
|
|
7062
7103
|
text_to_video: 'text_to_video: from the prompt alone.',
|
|
7063
7104
|
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
7064
7105
|
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
@@ -7070,34 +7111,49 @@ var L,
|
|
|
7070
7111
|
motion_control:
|
|
7071
7112
|
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
7072
7113
|
}));
|
|
7073
|
-
|
|
7114
|
+
Ta = Object.entries(Ne)
|
|
7074
7115
|
.map(([e, t]) => `${e} (${t})`)
|
|
7075
7116
|
.join(', ');
|
|
7076
7117
|
});
|
|
7077
|
-
var
|
|
7078
|
-
Wt,
|
|
7079
|
-
X,
|
|
7118
|
+
var ge,
|
|
7080
7119
|
Yt,
|
|
7081
|
-
|
|
7082
|
-
|
|
7120
|
+
Fe,
|
|
7121
|
+
Xt,
|
|
7083
7122
|
$n,
|
|
7084
|
-
|
|
7085
|
-
|
|
7123
|
+
An,
|
|
7124
|
+
On,
|
|
7125
|
+
qn,
|
|
7126
|
+
Qt = h(() => {
|
|
7086
7127
|
'use strict';
|
|
7087
|
-
((
|
|
7088
|
-
(
|
|
7089
|
-
(
|
|
7090
|
-
(
|
|
7091
|
-
(
|
|
7092
|
-
(
|
|
7093
|
-
(
|
|
7094
|
-
(
|
|
7128
|
+
((ge = 'enhancor-ultrafine'),
|
|
7129
|
+
(Yt = 'Enhancor Ultrafine'),
|
|
7130
|
+
(Fe = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
7131
|
+
(Xt = 2),
|
|
7132
|
+
($n = 24 * 1024 * 1024),
|
|
7133
|
+
(An = 4096 * 4096),
|
|
7134
|
+
(On = 30 * 6e4),
|
|
7135
|
+
(qn = 120 * 6e4));
|
|
7095
7136
|
});
|
|
7096
|
-
var
|
|
7097
|
-
|
|
7098
|
-
|
|
7137
|
+
var Be,
|
|
7138
|
+
Zt,
|
|
7139
|
+
ei = h(() => {
|
|
7099
7140
|
'use strict';
|
|
7100
|
-
((
|
|
7141
|
+
((Be = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
|
|
7142
|
+
(Zt = {
|
|
7143
|
+
natural: 'Natural',
|
|
7144
|
+
pores: 'Pores',
|
|
7145
|
+
freckles: 'Freckles',
|
|
7146
|
+
more_freckles: 'More freckles',
|
|
7147
|
+
blemish: 'Blemish',
|
|
7148
|
+
glow: 'Glow',
|
|
7149
|
+
unblur: 'Unblur',
|
|
7150
|
+
}));
|
|
7151
|
+
});
|
|
7152
|
+
var X,
|
|
7153
|
+
he,
|
|
7154
|
+
je = h(() => {
|
|
7155
|
+
'use strict';
|
|
7156
|
+
((X = [
|
|
7101
7157
|
'seedance-2-5',
|
|
7102
7158
|
'seedance-2-5-flash',
|
|
7103
7159
|
'seedance-2',
|
|
@@ -7109,13 +7165,13 @@ var Q,
|
|
|
7109
7165
|
'wan-2-5-image',
|
|
7110
7166
|
'doppel',
|
|
7111
7167
|
]),
|
|
7112
|
-
(
|
|
7168
|
+
(he =
|
|
7113
7169
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
7114
7170
|
});
|
|
7115
|
-
function
|
|
7171
|
+
function Q(e) {
|
|
7116
7172
|
return `$${Number(e.toFixed(5))}`;
|
|
7117
7173
|
}
|
|
7118
|
-
function
|
|
7174
|
+
function Ea(e) {
|
|
7119
7175
|
if (e.kind === 'llm') {
|
|
7120
7176
|
let t = e.defaultEndpoint,
|
|
7121
7177
|
i = (s) =>
|
|
@@ -7128,19 +7184,19 @@ function Ma(e) {
|
|
|
7128
7184
|
a = i('input'),
|
|
7129
7185
|
n = i('output');
|
|
7130
7186
|
return a && n
|
|
7131
|
-
? `${
|
|
7132
|
-
: `from ${
|
|
7187
|
+
? `${Q(a.price.starter)}/M in \xB7 ${Q(n.price.starter)}/M out`
|
|
7188
|
+
: `from ${Q(ue(e).price.starter)}/M tokens`;
|
|
7133
7189
|
}
|
|
7134
|
-
return `from ${
|
|
7190
|
+
return `from ${Q(ue(e).price.starter)}${e.unit}`;
|
|
7135
7191
|
}
|
|
7136
|
-
function
|
|
7192
|
+
function Ca(e, t) {
|
|
7137
7193
|
let i = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
7138
|
-
return i.length ? `from ${
|
|
7194
|
+
return i.length ? `from ${Q(Math.min(...i))}${e}` : null;
|
|
7139
7195
|
}
|
|
7140
|
-
function
|
|
7196
|
+
function ni(e) {
|
|
7141
7197
|
for (let t of J) {
|
|
7142
|
-
let i =
|
|
7143
|
-
a = i ?
|
|
7198
|
+
let i = be[t],
|
|
7199
|
+
a = i ? Ca(i.unit, e[t] ?? []) : null;
|
|
7144
7200
|
i && a && (i.priceFormatted = a);
|
|
7145
7201
|
}
|
|
7146
7202
|
}
|
|
@@ -7151,18 +7207,18 @@ function A(e, t) {
|
|
|
7151
7207
|
return {
|
|
7152
7208
|
name: 'resolution',
|
|
7153
7209
|
type: 'select',
|
|
7154
|
-
default:
|
|
7210
|
+
default: ue(e).resolution ?? i[0],
|
|
7155
7211
|
options: i,
|
|
7156
7212
|
...(t ? { description: t } : {}),
|
|
7157
7213
|
};
|
|
7158
7214
|
}
|
|
7159
|
-
function
|
|
7215
|
+
function si(e) {
|
|
7160
7216
|
if (!e.endpoints?.length) return null;
|
|
7161
7217
|
let t = e.endpoints.filter((i) => $t(e.slug, i.id));
|
|
7162
7218
|
return {
|
|
7163
7219
|
name: 'endpoint',
|
|
7164
7220
|
type: 'select',
|
|
7165
|
-
default:
|
|
7221
|
+
default: qe(e),
|
|
7166
7222
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
7167
7223
|
description:
|
|
7168
7224
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -7171,20 +7227,20 @@ function ai(e) {
|
|
|
7171
7227
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
7172
7228
|
};
|
|
7173
7229
|
}
|
|
7174
|
-
function
|
|
7230
|
+
function Aa(e, t) {
|
|
7175
7231
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
7176
|
-
let i =
|
|
7177
|
-
return [...t.filter((a) => !
|
|
7232
|
+
let i = X.includes(e.api.model);
|
|
7233
|
+
return [...t.filter((a) => !ye.has(a.name)), i ? Ye : $a];
|
|
7178
7234
|
}
|
|
7179
|
-
function
|
|
7180
|
-
let i = e.filter((n) => !
|
|
7181
|
-
a = [
|
|
7182
|
-
return (a.push(
|
|
7235
|
+
function Ge(e, t) {
|
|
7236
|
+
let i = e.filter((n) => !ye.has(n.name)),
|
|
7237
|
+
a = [Ye, oi];
|
|
7238
|
+
return (a.push(Xe, Qe), [...i, ...a]);
|
|
7183
7239
|
}
|
|
7184
|
-
function
|
|
7240
|
+
function La(e) {
|
|
7185
7241
|
return [
|
|
7186
7242
|
...e
|
|
7187
|
-
.filter((t) => !
|
|
7243
|
+
.filter((t) => !qa.has(t.name) && !ye.has(t.name))
|
|
7188
7244
|
.map((t) => {
|
|
7189
7245
|
if (t.name === 'resolution')
|
|
7190
7246
|
return {
|
|
@@ -7196,30 +7252,30 @@ function Oa(e) {
|
|
|
7196
7252
|
),
|
|
7197
7253
|
}
|
|
7198
7254
|
: {}),
|
|
7199
|
-
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${
|
|
7255
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Z}`,
|
|
7200
7256
|
};
|
|
7201
|
-
let i =
|
|
7257
|
+
let i = Ra[t.name];
|
|
7202
7258
|
return i && typeof t.description == 'string'
|
|
7203
7259
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
|
|
7204
7260
|
: t;
|
|
7205
7261
|
}),
|
|
7206
|
-
We,
|
|
7207
|
-
ri,
|
|
7208
7262
|
Ye,
|
|
7263
|
+
oi,
|
|
7209
7264
|
Xe,
|
|
7265
|
+
Qe,
|
|
7210
7266
|
];
|
|
7211
7267
|
}
|
|
7212
|
-
function
|
|
7268
|
+
function li(e) {
|
|
7213
7269
|
return (
|
|
7214
7270
|
e.startsWith('seedance-2-5-') &&
|
|
7215
7271
|
e !== 'seedance-2-5-lite' &&
|
|
7216
7272
|
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
7217
7273
|
);
|
|
7218
7274
|
}
|
|
7219
|
-
function
|
|
7275
|
+
function ti(e, t = {}) {
|
|
7220
7276
|
return [
|
|
7221
7277
|
...e
|
|
7222
|
-
.filter((i) =>
|
|
7278
|
+
.filter((i) => !Oa.has(i.name) && !ye.has(i.name))
|
|
7223
7279
|
.map((i) =>
|
|
7224
7280
|
i.name === 'prompt'
|
|
7225
7281
|
? { ...i, required: !0 }
|
|
@@ -7229,7 +7285,7 @@ function Qt(e, t = {}) {
|
|
|
7229
7285
|
...(t.no4k && i.options
|
|
7230
7286
|
? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
7231
7287
|
: {}),
|
|
7232
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
7288
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Z}`,
|
|
7233
7289
|
}
|
|
7234
7290
|
: i,
|
|
7235
7291
|
),
|
|
@@ -7240,13 +7296,13 @@ function Qt(e, t = {}) {
|
|
|
7240
7296
|
options: ['standard'],
|
|
7241
7297
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
7242
7298
|
},
|
|
7243
|
-
Ye,
|
|
7244
7299
|
Xe,
|
|
7300
|
+
Qe,
|
|
7245
7301
|
];
|
|
7246
7302
|
}
|
|
7247
|
-
function
|
|
7303
|
+
function He(e, t) {
|
|
7248
7304
|
return [
|
|
7249
|
-
|
|
7305
|
+
E('Text prompt describing the video.'),
|
|
7250
7306
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
7251
7307
|
{
|
|
7252
7308
|
name: 'duration',
|
|
@@ -7273,10 +7329,10 @@ function Ge(e, t) {
|
|
|
7273
7329
|
),
|
|
7274
7330
|
];
|
|
7275
7331
|
}
|
|
7276
|
-
function
|
|
7277
|
-
let t =
|
|
7332
|
+
function Da(e) {
|
|
7333
|
+
let t = si(e);
|
|
7278
7334
|
return [
|
|
7279
|
-
|
|
7335
|
+
E('Image prompt text. Supports complex composition and text instructions.'),
|
|
7280
7336
|
...(t ? [t] : []),
|
|
7281
7337
|
{
|
|
7282
7338
|
name: 'quality',
|
|
@@ -7287,14 +7343,14 @@ function qa(e) {
|
|
|
7287
7343
|
A(
|
|
7288
7344
|
e,
|
|
7289
7345
|
e.slug === 'gpt-image-2'
|
|
7290
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
7346
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${kt}`
|
|
7291
7347
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
7292
7348
|
),
|
|
7293
7349
|
{
|
|
7294
7350
|
name: 'aspect_ratio',
|
|
7295
7351
|
type: 'select',
|
|
7296
7352
|
default: 'auto',
|
|
7297
|
-
options: [...
|
|
7353
|
+
options: [...bt],
|
|
7298
7354
|
description:
|
|
7299
7355
|
"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.",
|
|
7300
7356
|
},
|
|
@@ -7341,15 +7397,15 @@ function qa(e) {
|
|
|
7341
7397
|
},
|
|
7342
7398
|
];
|
|
7343
7399
|
}
|
|
7344
|
-
function
|
|
7400
|
+
function Na(e) {
|
|
7345
7401
|
return [
|
|
7346
|
-
|
|
7402
|
+
E('Image prompt text.'),
|
|
7347
7403
|
{
|
|
7348
7404
|
name: 'input_images',
|
|
7349
7405
|
type: 'string[]',
|
|
7350
7406
|
description: 'Images to edit or use as reference (up to 14).',
|
|
7351
7407
|
},
|
|
7352
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
7408
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Ot(e.slug)] },
|
|
7353
7409
|
A(e),
|
|
7354
7410
|
{
|
|
7355
7411
|
name: 'n',
|
|
@@ -7375,10 +7431,10 @@ function Ra(e) {
|
|
|
7375
7431
|
},
|
|
7376
7432
|
];
|
|
7377
7433
|
}
|
|
7378
|
-
function
|
|
7379
|
-
let e =
|
|
7434
|
+
function Ba() {
|
|
7435
|
+
let e = Rt,
|
|
7380
7436
|
t = [];
|
|
7381
|
-
for (let i of
|
|
7437
|
+
for (let i of Ze(!0))
|
|
7382
7438
|
e.includes(i.name) &&
|
|
7383
7439
|
(t.push({
|
|
7384
7440
|
...i,
|
|
@@ -7400,14 +7456,14 @@ function Na() {
|
|
|
7400
7456
|
}));
|
|
7401
7457
|
return t;
|
|
7402
7458
|
}
|
|
7403
|
-
function
|
|
7404
|
-
return
|
|
7459
|
+
function ja() {
|
|
7460
|
+
return Ze(!0).map((e) =>
|
|
7405
7461
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
7406
7462
|
);
|
|
7407
7463
|
}
|
|
7408
|
-
function
|
|
7464
|
+
function Ze(e) {
|
|
7409
7465
|
return [
|
|
7410
|
-
|
|
7466
|
+
E('The user message or task.'),
|
|
7411
7467
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7412
7468
|
{
|
|
7413
7469
|
name: 'messages',
|
|
@@ -7500,21 +7556,21 @@ function Qe(e) {
|
|
|
7500
7556
|
},
|
|
7501
7557
|
];
|
|
7502
7558
|
}
|
|
7503
|
-
function
|
|
7504
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
7505
|
-
let t =
|
|
7559
|
+
function Ga(e) {
|
|
7560
|
+
if (e.slug === 'seed-2-1-turbo') return Ua;
|
|
7561
|
+
let t = si(e);
|
|
7506
7562
|
return [
|
|
7507
7563
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
7508
|
-
?
|
|
7564
|
+
? Ba()
|
|
7509
7565
|
: e.slug === 'gemini-3.7-flash'
|
|
7510
|
-
?
|
|
7511
|
-
: e.slug === 'gpt-6-astra' ||
|
|
7512
|
-
?
|
|
7513
|
-
:
|
|
7566
|
+
? ja()
|
|
7567
|
+
: e.slug === 'gpt-6-astra' || Fa.includes(e.slug)
|
|
7568
|
+
? Ze(e.slug !== 'gpt-6-astra')
|
|
7569
|
+
: Va),
|
|
7514
7570
|
...(t ? [t] : []),
|
|
7515
7571
|
];
|
|
7516
7572
|
}
|
|
7517
|
-
function
|
|
7573
|
+
function ze() {
|
|
7518
7574
|
return {
|
|
7519
7575
|
name: 'image',
|
|
7520
7576
|
type: 'string',
|
|
@@ -7522,7 +7578,7 @@ function He() {
|
|
|
7522
7578
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
7523
7579
|
};
|
|
7524
7580
|
}
|
|
7525
|
-
function
|
|
7581
|
+
function za(e) {
|
|
7526
7582
|
return [
|
|
7527
7583
|
{
|
|
7528
7584
|
name: 'video_url',
|
|
@@ -7544,7 +7600,7 @@ function ja(e) {
|
|
|
7544
7600
|
},
|
|
7545
7601
|
];
|
|
7546
7602
|
}
|
|
7547
|
-
function
|
|
7603
|
+
function Ja() {
|
|
7548
7604
|
return [
|
|
7549
7605
|
{
|
|
7550
7606
|
name: 'mode',
|
|
@@ -7615,33 +7671,33 @@ function Ga() {
|
|
|
7615
7671
|
},
|
|
7616
7672
|
];
|
|
7617
7673
|
}
|
|
7618
|
-
function
|
|
7674
|
+
function Wa(e) {
|
|
7619
7675
|
let t = e.slug;
|
|
7620
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
7621
|
-
if (
|
|
7622
|
-
if (e.kind === 'llm') return
|
|
7623
|
-
if (e.editVariants?.length) return
|
|
7624
|
-
let i =
|
|
7625
|
-
if (i) return
|
|
7626
|
-
if (
|
|
7676
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return Ja();
|
|
7677
|
+
if (de.some((a) => a.slug === t)) return za(e);
|
|
7678
|
+
if (e.kind === 'llm') return Ga(e);
|
|
7679
|
+
if (e.editVariants?.length) return Da(e);
|
|
7680
|
+
let i = fe(t);
|
|
7681
|
+
if (i) return Jt(i);
|
|
7682
|
+
if (li(t)) return La(Je);
|
|
7627
7683
|
switch (t) {
|
|
7628
7684
|
case 'seedance-2-5':
|
|
7629
|
-
return
|
|
7685
|
+
return Ge(Je, t);
|
|
7630
7686
|
case 'seedance-2-5-lite':
|
|
7631
|
-
return
|
|
7687
|
+
return ti(Je, { no4k: !0 });
|
|
7632
7688
|
case 'seedance-2':
|
|
7633
|
-
return
|
|
7689
|
+
return Ge(ii, t);
|
|
7634
7690
|
case 'seedance-2-lite':
|
|
7635
|
-
return
|
|
7691
|
+
return ti(ii);
|
|
7636
7692
|
case 'seedance-2-mini':
|
|
7637
|
-
return
|
|
7693
|
+
return Ge(Ya, t);
|
|
7638
7694
|
case 'nano-banana-2':
|
|
7639
7695
|
case 'nano-banana-2.1':
|
|
7640
7696
|
case 'nano-banana-pro':
|
|
7641
|
-
return
|
|
7697
|
+
return Na(e);
|
|
7642
7698
|
case 'seedream-5-pro':
|
|
7643
7699
|
return [
|
|
7644
|
-
|
|
7700
|
+
E('Detailed description of the image to generate.'),
|
|
7645
7701
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
7646
7702
|
A(e),
|
|
7647
7703
|
{
|
|
@@ -7655,7 +7711,7 @@ function Ha(e) {
|
|
|
7655
7711
|
case 'minimax-h3-image':
|
|
7656
7712
|
case 'minimax-h3-image-highspeed':
|
|
7657
7713
|
return [
|
|
7658
|
-
|
|
7714
|
+
E('What to make, or how to change the reference images.'),
|
|
7659
7715
|
{
|
|
7660
7716
|
name: 'images',
|
|
7661
7717
|
type: 'string[]',
|
|
@@ -7701,7 +7757,7 @@ function Ha(e) {
|
|
|
7701
7757
|
description:
|
|
7702
7758
|
'text_to_image, image_to_image (up to 10 reference images) or layer_decomposition (split one image into a base image and editable transparent layers).',
|
|
7703
7759
|
},
|
|
7704
|
-
|
|
7760
|
+
E(
|
|
7705
7761
|
'What to make or change. Optional for layer_decomposition, where it can say how to split the image (for example "keep the logo as one layer").',
|
|
7706
7762
|
),
|
|
7707
7763
|
{
|
|
@@ -7750,7 +7806,7 @@ function Ha(e) {
|
|
|
7750
7806
|
case 'qwen-3':
|
|
7751
7807
|
case 'qwen-3-pro':
|
|
7752
7808
|
return [
|
|
7753
|
-
|
|
7809
|
+
E('Image prompt text; dense layouts and multilingual text work well.'),
|
|
7754
7810
|
{
|
|
7755
7811
|
name: 'images',
|
|
7756
7812
|
type: 'string[]',
|
|
@@ -7774,7 +7830,7 @@ function Ha(e) {
|
|
|
7774
7830
|
];
|
|
7775
7831
|
case 'z-image-pro':
|
|
7776
7832
|
return [
|
|
7777
|
-
|
|
7833
|
+
E('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
7778
7834
|
A(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
7779
7835
|
{
|
|
7780
7836
|
name: 'aspect_ratio',
|
|
@@ -7806,7 +7862,7 @@ function Ha(e) {
|
|
|
7806
7862
|
];
|
|
7807
7863
|
case 'wan-2-5-image':
|
|
7808
7864
|
return [
|
|
7809
|
-
|
|
7865
|
+
E('Image prompt, or for an edit the change to make (up to 2000 characters).'),
|
|
7810
7866
|
{
|
|
7811
7867
|
name: 'images',
|
|
7812
7868
|
type: 'string[]',
|
|
@@ -7872,7 +7928,7 @@ function Ha(e) {
|
|
|
7872
7928
|
];
|
|
7873
7929
|
case 'enhancor-skin-fix-v1':
|
|
7874
7930
|
return [
|
|
7875
|
-
|
|
7931
|
+
ze(),
|
|
7876
7932
|
{
|
|
7877
7933
|
name: 'mode',
|
|
7878
7934
|
type: 'select',
|
|
@@ -7905,11 +7961,11 @@ function Ha(e) {
|
|
|
7905
7961
|
max: 0.4,
|
|
7906
7962
|
description: 'Portrait depth. Heavy only.',
|
|
7907
7963
|
},
|
|
7908
|
-
...
|
|
7964
|
+
...Ha,
|
|
7909
7965
|
];
|
|
7910
7966
|
case 'enhancor-skin-fix-v3':
|
|
7911
7967
|
return [
|
|
7912
|
-
|
|
7968
|
+
ze(),
|
|
7913
7969
|
{
|
|
7914
7970
|
name: 'mask_image',
|
|
7915
7971
|
type: 'string',
|
|
@@ -7949,7 +8005,7 @@ function Ha(e) {
|
|
|
7949
8005
|
];
|
|
7950
8006
|
case 'enhancor-skin-fix-v4':
|
|
7951
8007
|
return [
|
|
7952
|
-
|
|
8008
|
+
ze(),
|
|
7953
8009
|
{
|
|
7954
8010
|
name: 'mode',
|
|
7955
8011
|
type: 'select',
|
|
@@ -7980,7 +8036,7 @@ function Ha(e) {
|
|
|
7980
8036
|
];
|
|
7981
8037
|
case 'wan-3-0':
|
|
7982
8038
|
case 'wan-3-0-prime':
|
|
7983
|
-
return
|
|
8039
|
+
return He(e, {
|
|
7984
8040
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7985
8041
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
7986
8042
|
minSec: 2,
|
|
@@ -7990,7 +8046,7 @@ function Ha(e) {
|
|
|
7990
8046
|
});
|
|
7991
8047
|
case 'happy-horse-1-1':
|
|
7992
8048
|
case 'happy-horse-1-0':
|
|
7993
|
-
return
|
|
8049
|
+
return He(e, {
|
|
7994
8050
|
modes:
|
|
7995
8051
|
t === 'happy-horse-1-0'
|
|
7996
8052
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -8000,8 +8056,68 @@ function Ha(e) {
|
|
|
8000
8056
|
maxSec: 15,
|
|
8001
8057
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
8002
8058
|
});
|
|
8059
|
+
case 'gemini-omni-1.2-flash':
|
|
8060
|
+
return [
|
|
8061
|
+
E(
|
|
8062
|
+
'Describe the video and its sound (dialogue, effects, music), or for video_edit / video_extend the change or what happens next (up to 20000 characters).',
|
|
8063
|
+
),
|
|
8064
|
+
{
|
|
8065
|
+
name: 'mode',
|
|
8066
|
+
type: 'select',
|
|
8067
|
+
required: !0,
|
|
8068
|
+
options: [
|
|
8069
|
+
'text_to_video',
|
|
8070
|
+
'image_to_video',
|
|
8071
|
+
'multi_reference',
|
|
8072
|
+
'video_edit',
|
|
8073
|
+
'video_extend',
|
|
8074
|
+
],
|
|
8075
|
+
description:
|
|
8076
|
+
'text_to_video; image_to_video (first_frame_image, optional last_frame_image); multi_reference (1-6 images); video_edit (video, optional up to 5 images; keeps its length); video_extend (video, adds duration seconds).',
|
|
8077
|
+
},
|
|
8078
|
+
{
|
|
8079
|
+
name: 'duration',
|
|
8080
|
+
type: 'slider',
|
|
8081
|
+
default: 5,
|
|
8082
|
+
min: 3,
|
|
8083
|
+
max: 15,
|
|
8084
|
+
description:
|
|
8085
|
+
'Video length in seconds (3 to 15). With a last frame 3 to 10; for video_extend the seconds added (3 to 10). Not taken by video_edit, which bills the input video length.',
|
|
8086
|
+
},
|
|
8087
|
+
{ ...A(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
|
|
8088
|
+
{
|
|
8089
|
+
name: 'aspect_ratio',
|
|
8090
|
+
type: 'select',
|
|
8091
|
+
options: ['16:9', '9:16'],
|
|
8092
|
+
description:
|
|
8093
|
+
'text_to_video and multi_reference only (left out: 16:9). Leave it out for image_to_video, video_edit and video_extend: they keep the frame of their image or video and refuse it.',
|
|
8094
|
+
},
|
|
8095
|
+
{
|
|
8096
|
+
name: 'first_frame_image',
|
|
8097
|
+
type: 'string',
|
|
8098
|
+
description:
|
|
8099
|
+
'image_to_video: the start frame, as a public http(s) URL or data URI. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
8100
|
+
},
|
|
8101
|
+
{
|
|
8102
|
+
name: 'last_frame_image',
|
|
8103
|
+
type: 'string',
|
|
8104
|
+
description: 'image_to_video: an optional end frame (duration then 3 to 10 s).',
|
|
8105
|
+
},
|
|
8106
|
+
{
|
|
8107
|
+
name: 'images',
|
|
8108
|
+
type: 'string[]',
|
|
8109
|
+
description:
|
|
8110
|
+
'multi_reference: 1-6 reference images; video_edit: up to 5 optional images. Public http(s) URLs or data URIs.',
|
|
8111
|
+
},
|
|
8112
|
+
{
|
|
8113
|
+
name: 'video',
|
|
8114
|
+
type: 'string',
|
|
8115
|
+
description:
|
|
8116
|
+
'video_edit / video_extend: the video to change (MP4, MOV or WebM, with a video track): 3 to 15 s for video_edit, 15 s or less for video_extend. A public http(s) URL or data URI.',
|
|
8117
|
+
},
|
|
8118
|
+
];
|
|
8003
8119
|
case 'minimax-h3':
|
|
8004
|
-
return
|
|
8120
|
+
return He(e, {
|
|
8005
8121
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
8006
8122
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
8007
8123
|
minSec: 4,
|
|
@@ -8009,10 +8125,10 @@ function Ha(e) {
|
|
|
8009
8125
|
references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
|
|
8010
8126
|
});
|
|
8011
8127
|
default:
|
|
8012
|
-
return [
|
|
8128
|
+
return [E('Prompt text.')];
|
|
8013
8129
|
}
|
|
8014
8130
|
}
|
|
8015
|
-
function
|
|
8131
|
+
function Xa() {
|
|
8016
8132
|
let e = (t, i) => ({
|
|
8017
8133
|
name: t,
|
|
8018
8134
|
type: 'slider',
|
|
@@ -8023,30 +8139,28 @@ function Ja() {
|
|
|
8023
8139
|
description: `${i} 0 to 100. 50 is the default look.`,
|
|
8024
8140
|
});
|
|
8025
8141
|
return [
|
|
8026
|
-
e('skin_strength', 'Strength: how much the skin is repainted. Only with skin_fix on.'),
|
|
8027
|
-
e('skin_texture', 'Texture: how much fine pore detail is added. Only with skin_fix on.'),
|
|
8028
8142
|
e(
|
|
8029
8143
|
'grain',
|
|
8030
|
-
'Grain: fine noise over the photo. Works in Fast and Full, with or without
|
|
8144
|
+
'Grain: fine noise over the photo. Works in Fast and Full, with or without a preset.',
|
|
8031
8145
|
),
|
|
8032
8146
|
e(
|
|
8033
8147
|
'sharpness',
|
|
8034
|
-
'Sharpness: how crisp the edges are. Works in Fast and Full, with or without
|
|
8148
|
+
'Sharpness: how crisp the edges are. Works in Fast and Full, with or without a preset.',
|
|
8035
8149
|
),
|
|
8036
8150
|
];
|
|
8037
8151
|
}
|
|
8038
|
-
function
|
|
8152
|
+
function Qa() {
|
|
8039
8153
|
return {
|
|
8040
|
-
slug:
|
|
8041
|
-
name:
|
|
8154
|
+
slug: ge,
|
|
8155
|
+
name: Yt,
|
|
8042
8156
|
category: 'Image',
|
|
8043
8157
|
kind: 'Image-to-Image',
|
|
8044
8158
|
vendor: 'Enhancor',
|
|
8045
8159
|
description:
|
|
8046
|
-
'Upscales a photo, with an optional skin
|
|
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, Unblur). Full makes the picture its size times the scale; Fast makes a fixed size (long side 2432 px).',
|
|
8047
8161
|
priceFormatted: '',
|
|
8048
8162
|
unit: '/img',
|
|
8049
|
-
primaryToolName:
|
|
8163
|
+
primaryToolName: ri.image,
|
|
8050
8164
|
parameters: [
|
|
8051
8165
|
{
|
|
8052
8166
|
name: 'image',
|
|
@@ -8055,11 +8169,17 @@ function Wa() {
|
|
|
8055
8169
|
description:
|
|
8056
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.",
|
|
8057
8171
|
},
|
|
8172
|
+
{
|
|
8173
|
+
name: 'preset',
|
|
8174
|
+
type: 'select',
|
|
8175
|
+
options: [...Be],
|
|
8176
|
+
description: `Skin preset, run before the upscale: ${Be.map((e) => `${e} (${Zt[e]})`).join(', ')}. Seedream 5.5 redraws the skin in the photo's own shape (about 4.2 MP, Unblur about 1 MP), keeping the person, the background and any text, then that picture is upscaled. Leave it out for a plain upscale.`,
|
|
8177
|
+
},
|
|
8058
8178
|
{
|
|
8059
8179
|
name: 'skin_fix',
|
|
8060
8180
|
type: 'boolean',
|
|
8061
8181
|
default: !1,
|
|
8062
|
-
description: '
|
|
8182
|
+
description: 'Same as preset natural. Off by default.',
|
|
8063
8183
|
},
|
|
8064
8184
|
{
|
|
8065
8185
|
name: 'mode',
|
|
@@ -8072,189 +8192,195 @@ function Wa() {
|
|
|
8072
8192
|
{
|
|
8073
8193
|
name: 'scale',
|
|
8074
8194
|
type: 'select',
|
|
8075
|
-
default: String(
|
|
8076
|
-
options:
|
|
8077
|
-
description: `Full only
|
|
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.`,
|
|
8078
8198
|
},
|
|
8079
|
-
...
|
|
8199
|
+
...Xa(),
|
|
8080
8200
|
],
|
|
8081
8201
|
};
|
|
8082
8202
|
}
|
|
8083
|
-
function
|
|
8203
|
+
function We(e, t = e.api.model) {
|
|
8084
8204
|
return {
|
|
8085
8205
|
slug: t,
|
|
8086
8206
|
name: e.name,
|
|
8087
|
-
category:
|
|
8088
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
8207
|
+
category: Ka[e.kind],
|
|
8208
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Sa[e.kind],
|
|
8089
8209
|
vendor: e.vendor ?? '',
|
|
8090
8210
|
description: e.desc ?? e.name,
|
|
8091
|
-
priceFormatted:
|
|
8211
|
+
priceFormatted: Ea(e),
|
|
8092
8212
|
unit: e.unit,
|
|
8093
|
-
primaryToolName:
|
|
8094
|
-
parameters:
|
|
8213
|
+
primaryToolName: ri[e.kind],
|
|
8214
|
+
parameters: Aa(e, Wa(e)),
|
|
8095
8215
|
};
|
|
8096
8216
|
}
|
|
8097
|
-
function
|
|
8217
|
+
function Za() {
|
|
8098
8218
|
let e = {};
|
|
8099
|
-
for (let t of
|
|
8219
|
+
for (let t of ce())
|
|
8100
8220
|
if (t.slug !== 'seedance-2-fast') {
|
|
8101
8221
|
if (t.slug === 'seedance-2-mini') {
|
|
8102
|
-
e['seedance-2-mini'] =
|
|
8222
|
+
e['seedance-2-mini'] = We(t, 'seedance-2-mini');
|
|
8103
8223
|
continue;
|
|
8104
8224
|
}
|
|
8105
8225
|
if (t.slug === 'seedance-2') {
|
|
8106
|
-
let i =
|
|
8226
|
+
let i = We(t);
|
|
8107
8227
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8108
8228
|
(e['seedance-2'] = i));
|
|
8109
8229
|
continue;
|
|
8110
8230
|
}
|
|
8111
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
8231
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = We(t));
|
|
8112
8232
|
}
|
|
8113
|
-
(Object.assign(e,
|
|
8114
|
-
for (let [t, i] of Object.entries(
|
|
8233
|
+
(Object.assign(e, Ut()), (e[ge] = Qa()));
|
|
8234
|
+
for (let [t, i] of Object.entries(me))
|
|
8115
8235
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
8116
8236
|
return e;
|
|
8117
8237
|
}
|
|
8118
|
-
function
|
|
8238
|
+
function ke(e) {
|
|
8119
8239
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
8120
8240
|
}
|
|
8121
8241
|
function H(e) {
|
|
8122
|
-
return
|
|
8242
|
+
return be[e] ?? null;
|
|
8123
8243
|
}
|
|
8124
|
-
function
|
|
8125
|
-
if (
|
|
8126
|
-
|
|
8244
|
+
function er(e, t, i) {
|
|
8245
|
+
if (
|
|
8246
|
+
e.startsWith('enhancor-skin-fix-') ||
|
|
8247
|
+
e === ge ||
|
|
8248
|
+
(e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
|
|
8249
|
+
)
|
|
8250
|
+
return !1;
|
|
8251
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || li(e)) && t === 'duration') {
|
|
8127
8252
|
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
8128
8253
|
if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
|
|
8129
8254
|
}
|
|
8130
8255
|
if (
|
|
8131
|
-
(t === 'max_tokens' &&
|
|
8132
|
-
(t === 'max_completion_tokens' &&
|
|
8256
|
+
(t === 'max_tokens' && ai(i.max_completion_tokens)) ||
|
|
8257
|
+
(t === 'max_completion_tokens' && ai(i.max_tokens))
|
|
8133
8258
|
)
|
|
8134
8259
|
return !1;
|
|
8135
8260
|
if (t === 'aspect_ratio') {
|
|
8136
|
-
let n =
|
|
8261
|
+
let n = fe(e);
|
|
8137
8262
|
if (n) {
|
|
8138
8263
|
let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8139
8264
|
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
8140
|
-
if (n.modes.includes(o) && !
|
|
8265
|
+
if (n.modes.includes(o) && !Ht(n, o)) return !1;
|
|
8141
8266
|
}
|
|
8142
8267
|
}
|
|
8143
|
-
let a =
|
|
8268
|
+
let a = fe(e);
|
|
8144
8269
|
if (a) {
|
|
8145
8270
|
let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8146
8271
|
s = n ? n.replace(/-/g, '_') : a.modes[0];
|
|
8147
|
-
if (a.modes.includes(s) && !
|
|
8272
|
+
if (a.modes.includes(s) && !zt(a, s, t)) return !1;
|
|
8148
8273
|
}
|
|
8149
8274
|
return !0;
|
|
8150
8275
|
}
|
|
8151
|
-
function
|
|
8276
|
+
function ai(e) {
|
|
8152
8277
|
return e != null && e !== '';
|
|
8153
8278
|
}
|
|
8154
|
-
function
|
|
8279
|
+
function ci(e, t) {
|
|
8155
8280
|
let i = { ...t };
|
|
8156
8281
|
if (e?.slug === 'seedance-2-5') {
|
|
8157
8282
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
8158
|
-
for (let n of
|
|
8283
|
+
for (let n of tr) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
8159
8284
|
if (!a(i.finalize)) return i;
|
|
8160
8285
|
}
|
|
8161
8286
|
for (let a of e?.parameters ?? [])
|
|
8162
8287
|
a.default !== void 0 &&
|
|
8163
8288
|
i[a.name] === void 0 &&
|
|
8164
|
-
|
|
8289
|
+
er(e.slug, a.name, t) &&
|
|
8165
8290
|
(i[a.name] = a.default);
|
|
8166
8291
|
return i;
|
|
8167
8292
|
}
|
|
8168
8293
|
function D() {
|
|
8169
|
-
return Object.values(
|
|
8294
|
+
return Object.values(be);
|
|
8170
8295
|
}
|
|
8171
|
-
var
|
|
8172
|
-
ti,
|
|
8173
|
-
Ta,
|
|
8174
|
-
C,
|
|
8175
|
-
We,
|
|
8176
|
-
Sa,
|
|
8296
|
+
var Ka,
|
|
8177
8297
|
ri,
|
|
8298
|
+
Sa,
|
|
8299
|
+
E,
|
|
8178
8300
|
Ye,
|
|
8179
|
-
Xe,
|
|
8180
|
-
be,
|
|
8181
8301
|
$a,
|
|
8182
|
-
Ea,
|
|
8183
|
-
Aa,
|
|
8184
|
-
La,
|
|
8185
|
-
Da,
|
|
8186
|
-
Va,
|
|
8187
|
-
Ba,
|
|
8188
|
-
ee,
|
|
8189
|
-
ze,
|
|
8190
|
-
si,
|
|
8191
8302
|
oi,
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8303
|
+
Xe,
|
|
8304
|
+
Qe,
|
|
8305
|
+
ye,
|
|
8306
|
+
Oa,
|
|
8307
|
+
qa,
|
|
8308
|
+
Ra,
|
|
8309
|
+
Va,
|
|
8310
|
+
Ua,
|
|
8311
|
+
Fa,
|
|
8312
|
+
Ha,
|
|
8313
|
+
Z,
|
|
8314
|
+
Je,
|
|
8315
|
+
di,
|
|
8316
|
+
pi,
|
|
8317
|
+
ii,
|
|
8318
|
+
Ya,
|
|
8319
|
+
be,
|
|
8320
|
+
tr,
|
|
8321
|
+
ee = h(() => {
|
|
8197
8322
|
'use strict';
|
|
8198
|
-
|
|
8199
|
-
|
|
8323
|
+
wt();
|
|
8324
|
+
Se();
|
|
8200
8325
|
G();
|
|
8326
|
+
Re();
|
|
8327
|
+
Ee();
|
|
8201
8328
|
Le();
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
(ti = {
|
|
8329
|
+
At();
|
|
8330
|
+
qt();
|
|
8331
|
+
Lt();
|
|
8332
|
+
Ft();
|
|
8333
|
+
Ue();
|
|
8334
|
+
Wt();
|
|
8335
|
+
Qt();
|
|
8336
|
+
ei();
|
|
8337
|
+
je();
|
|
8338
|
+
((Ka = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8339
|
+
(ri = {
|
|
8214
8340
|
video: 'generate_video',
|
|
8215
8341
|
image: 'generate_image',
|
|
8216
8342
|
audio: 'generate_audio',
|
|
8217
8343
|
llm: 'run_task',
|
|
8218
8344
|
}),
|
|
8219
|
-
(
|
|
8345
|
+
(Sa = {
|
|
8220
8346
|
video: 'Text-to-Video',
|
|
8221
8347
|
image: 'Text-to-Image',
|
|
8222
8348
|
audio: 'Text-to-Audio',
|
|
8223
8349
|
llm: 'Reasoning (LLM)',
|
|
8224
8350
|
}));
|
|
8225
|
-
|
|
8226
|
-
((
|
|
8351
|
+
E = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
8352
|
+
((Ye = {
|
|
8227
8353
|
name: 'creative_mode',
|
|
8228
8354
|
type: 'boolean',
|
|
8229
8355
|
default: !1,
|
|
8230
8356
|
description:
|
|
8231
8357
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8232
8358
|
}),
|
|
8233
|
-
(
|
|
8359
|
+
($a = {
|
|
8234
8360
|
name: 'creative_mode',
|
|
8235
8361
|
type: 'boolean',
|
|
8236
8362
|
default: !1,
|
|
8237
|
-
description: `Not available yet on this model: ${
|
|
8363
|
+
description: `Not available yet on this model: ${he}.`,
|
|
8238
8364
|
}),
|
|
8239
|
-
(
|
|
8365
|
+
(oi = {
|
|
8240
8366
|
name: 'priority',
|
|
8241
8367
|
type: 'boolean',
|
|
8242
8368
|
default: !1,
|
|
8243
8369
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
8244
8370
|
}),
|
|
8245
|
-
(
|
|
8371
|
+
(Xe = {
|
|
8246
8372
|
name: 'reference_roles',
|
|
8247
8373
|
type: 'json',
|
|
8248
8374
|
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).`,
|
|
8249
8375
|
}),
|
|
8250
|
-
(
|
|
8376
|
+
(Qe = {
|
|
8251
8377
|
name: 'auto_fit_images',
|
|
8252
8378
|
type: 'boolean',
|
|
8253
8379
|
description:
|
|
8254
8380
|
'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.',
|
|
8255
8381
|
}),
|
|
8256
|
-
(
|
|
8257
|
-
((
|
|
8382
|
+
(ye = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8383
|
+
((Oa = new Set([
|
|
8258
8384
|
'quality',
|
|
8259
8385
|
'bitrate_mode',
|
|
8260
8386
|
'draft',
|
|
@@ -8263,7 +8389,7 @@ var va,
|
|
|
8263
8389
|
'draft_generation_id',
|
|
8264
8390
|
'pass_faces',
|
|
8265
8391
|
])),
|
|
8266
|
-
(
|
|
8392
|
+
(qa = new Set([
|
|
8267
8393
|
'quality',
|
|
8268
8394
|
'bitrate_mode',
|
|
8269
8395
|
'draft',
|
|
@@ -8271,13 +8397,13 @@ var va,
|
|
|
8271
8397
|
'draft_task_id',
|
|
8272
8398
|
'draft_generation_id',
|
|
8273
8399
|
])),
|
|
8274
|
-
(
|
|
8400
|
+
(Ra = {
|
|
8275
8401
|
images: 'up to 10',
|
|
8276
8402
|
videos: 'up to 5; combined duration < 30s',
|
|
8277
8403
|
audios: 'up to 5; combined duration < 30s',
|
|
8278
8404
|
}));
|
|
8279
|
-
((
|
|
8280
|
-
|
|
8405
|
+
((Va = [
|
|
8406
|
+
E('The user message or task.'),
|
|
8281
8407
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8282
8408
|
{
|
|
8283
8409
|
name: 'messages',
|
|
@@ -8294,8 +8420,8 @@ var va,
|
|
|
8294
8420
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8295
8421
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8296
8422
|
]),
|
|
8297
|
-
(
|
|
8298
|
-
|
|
8423
|
+
(Ua = [
|
|
8424
|
+
E('The user message or task.'),
|
|
8299
8425
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8300
8426
|
{
|
|
8301
8427
|
name: 'messages',
|
|
@@ -8376,8 +8502,8 @@ var va,
|
|
|
8376
8502
|
description: 'Video frames read a second.',
|
|
8377
8503
|
},
|
|
8378
8504
|
]),
|
|
8379
|
-
(
|
|
8380
|
-
|
|
8505
|
+
(Fa = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8506
|
+
Ha = Object.entries({
|
|
8381
8507
|
background: !1,
|
|
8382
8508
|
skin: !1,
|
|
8383
8509
|
nose: !1,
|
|
@@ -8403,8 +8529,8 @@ var va,
|
|
|
8403
8529
|
default: t,
|
|
8404
8530
|
description: 'Keep this part out of the fix. Standard only.',
|
|
8405
8531
|
}));
|
|
8406
|
-
((
|
|
8407
|
-
(
|
|
8532
|
+
((Z = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8533
|
+
(Je = [
|
|
8408
8534
|
{
|
|
8409
8535
|
name: 'prompt',
|
|
8410
8536
|
type: 'string',
|
|
@@ -8442,7 +8568,7 @@ var va,
|
|
|
8442
8568
|
type: 'select',
|
|
8443
8569
|
default: '480p',
|
|
8444
8570
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8445
|
-
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${
|
|
8571
|
+
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${Z}`,
|
|
8446
8572
|
},
|
|
8447
8573
|
{
|
|
8448
8574
|
name: 'aspect_ratio',
|
|
@@ -8553,19 +8679,19 @@ var va,
|
|
|
8553
8679
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8554
8680
|
},
|
|
8555
8681
|
]),
|
|
8556
|
-
(
|
|
8682
|
+
(di = {
|
|
8557
8683
|
name: 'images',
|
|
8558
8684
|
type: 'string[]',
|
|
8559
8685
|
description:
|
|
8560
8686
|
'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.',
|
|
8561
8687
|
}),
|
|
8562
|
-
(
|
|
8688
|
+
(pi = {
|
|
8563
8689
|
name: 'audios',
|
|
8564
8690
|
type: 'string[]',
|
|
8565
8691
|
description:
|
|
8566
8692
|
'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.',
|
|
8567
8693
|
}),
|
|
8568
|
-
(
|
|
8694
|
+
(ii = [
|
|
8569
8695
|
{
|
|
8570
8696
|
name: 'prompt',
|
|
8571
8697
|
type: 'string',
|
|
@@ -8609,7 +8735,7 @@ var va,
|
|
|
8609
8735
|
type: 'select',
|
|
8610
8736
|
default: '480p',
|
|
8611
8737
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8612
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
8738
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Z}`,
|
|
8613
8739
|
},
|
|
8614
8740
|
{
|
|
8615
8741
|
name: 'bitrate_mode',
|
|
@@ -8643,8 +8769,8 @@ var va,
|
|
|
8643
8769
|
description:
|
|
8644
8770
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8645
8771
|
},
|
|
8646
|
-
|
|
8647
|
-
|
|
8772
|
+
di,
|
|
8773
|
+
pi,
|
|
8648
8774
|
{
|
|
8649
8775
|
name: 'first_frame_image',
|
|
8650
8776
|
type: 'string',
|
|
@@ -8665,7 +8791,7 @@ var va,
|
|
|
8665
8791
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8666
8792
|
},
|
|
8667
8793
|
]),
|
|
8668
|
-
(
|
|
8794
|
+
(Ya = [
|
|
8669
8795
|
{
|
|
8670
8796
|
name: 'prompt',
|
|
8671
8797
|
type: 'string',
|
|
@@ -8686,7 +8812,7 @@ var va,
|
|
|
8686
8812
|
type: 'select',
|
|
8687
8813
|
default: '480p',
|
|
8688
8814
|
options: ['480p', '720p'],
|
|
8689
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
8815
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Z}`,
|
|
8690
8816
|
},
|
|
8691
8817
|
{
|
|
8692
8818
|
name: 'bitrate_mode',
|
|
@@ -8720,8 +8846,8 @@ var va,
|
|
|
8720
8846
|
description:
|
|
8721
8847
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8722
8848
|
},
|
|
8723
|
-
|
|
8724
|
-
|
|
8849
|
+
di,
|
|
8850
|
+
pi,
|
|
8725
8851
|
{
|
|
8726
8852
|
name: 'first_frame_image',
|
|
8727
8853
|
type: 'string',
|
|
@@ -8736,53 +8862,53 @@ var va,
|
|
|
8736
8862
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8737
8863
|
},
|
|
8738
8864
|
]));
|
|
8739
|
-
|
|
8740
|
-
|
|
8865
|
+
be = Za();
|
|
8866
|
+
tr = ['draft_task_id', 'draft_generation_id'];
|
|
8741
8867
|
});
|
|
8742
|
-
function
|
|
8868
|
+
function we(e) {
|
|
8743
8869
|
let t = '/v1/pricing/models',
|
|
8744
8870
|
i = e?.trim();
|
|
8745
8871
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
8746
8872
|
}
|
|
8747
|
-
var
|
|
8873
|
+
var it = h(() => {
|
|
8748
8874
|
'use strict';
|
|
8749
8875
|
});
|
|
8750
|
-
function
|
|
8876
|
+
function Si(e) {
|
|
8751
8877
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
8752
8878
|
}
|
|
8753
|
-
function
|
|
8754
|
-
let t =
|
|
8755
|
-
i = t.filter((s) =>
|
|
8756
|
-
a = t.filter((s) => !
|
|
8879
|
+
function Ei(e) {
|
|
8880
|
+
let t = ce().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8881
|
+
i = t.filter((s) => X.includes(s.api.model)).map((s) => s.name),
|
|
8882
|
+
a = t.filter((s) => !X.includes(s.api.model)).map((s) => s.name);
|
|
8757
8883
|
return [
|
|
8758
8884
|
...(i.length
|
|
8759
|
-
? [`${
|
|
8885
|
+
? [`${Si(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
8760
8886
|
: []),
|
|
8761
|
-
...(a.length ? [`Not available yet on ${
|
|
8887
|
+
...(a.length ? [`Not available yet on ${Si(a)}: ${he}.`] : []),
|
|
8762
8888
|
'The Acceptable Use Policy applies.',
|
|
8763
8889
|
].join(' ');
|
|
8764
8890
|
}
|
|
8765
|
-
function
|
|
8766
|
-
if (
|
|
8891
|
+
function Cr(e) {
|
|
8892
|
+
if (Tr.has(e.name)) return e;
|
|
8767
8893
|
let t = e.inputSchema.properties;
|
|
8768
8894
|
return !t || t.callback_url
|
|
8769
8895
|
? e
|
|
8770
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8896
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: vr } } };
|
|
8771
8897
|
}
|
|
8772
|
-
function
|
|
8898
|
+
function $r(e) {
|
|
8773
8899
|
let t = e.inputSchema.properties;
|
|
8774
8900
|
if (!t) return e;
|
|
8775
8901
|
let i = !1,
|
|
8776
8902
|
a = {};
|
|
8777
8903
|
for (let [n, s] of Object.entries(t))
|
|
8778
|
-
|
|
8904
|
+
Ci.has(n) && s.type === 'string' && !s.format
|
|
8779
8905
|
? ((a[n] = { ...s, format: 'uri' }), (i = !0))
|
|
8780
|
-
:
|
|
8906
|
+
: Ci.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8781
8907
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
8782
8908
|
: (a[n] = s);
|
|
8783
8909
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
8784
8910
|
}
|
|
8785
|
-
function
|
|
8911
|
+
function Ar(e) {
|
|
8786
8912
|
switch (e.type) {
|
|
8787
8913
|
case 'string':
|
|
8788
8914
|
return {
|
|
@@ -8837,11 +8963,11 @@ function Cr(e) {
|
|
|
8837
8963
|
return { type: 'string', description: e.description };
|
|
8838
8964
|
}
|
|
8839
8965
|
}
|
|
8840
|
-
function
|
|
8966
|
+
function Or(e, t) {
|
|
8841
8967
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
8842
8968
|
a = {},
|
|
8843
8969
|
n = [];
|
|
8844
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
8970
|
+
for (let o of e.parameters) ((a[o.name] = Ar(o)), o.required && n.push(o.name));
|
|
8845
8971
|
let s = {
|
|
8846
8972
|
type: 'object',
|
|
8847
8973
|
properties: a,
|
|
@@ -8854,8 +8980,8 @@ function $r(e, t) {
|
|
|
8854
8980
|
inputSchema: s,
|
|
8855
8981
|
};
|
|
8856
8982
|
}
|
|
8857
|
-
function
|
|
8858
|
-
let e = D().filter((p) => p.category === 'Image' && !
|
|
8983
|
+
function qr() {
|
|
8984
|
+
let e = D().filter((p) => p.category === 'Image' && !ke(p)),
|
|
8859
8985
|
t = D().filter((p) => p.category === 'Video'),
|
|
8860
8986
|
i = D().filter((p) => p.category === 'Text'),
|
|
8861
8987
|
a = D().filter((p) => p.category === 'Audio'),
|
|
@@ -8945,7 +9071,7 @@ function Er() {
|
|
|
8945
9071
|
maximum: 2147483647,
|
|
8946
9072
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
8947
9073
|
},
|
|
8948
|
-
creative_mode: { type: 'boolean', description:
|
|
9074
|
+
creative_mode: { type: 'boolean', description: Ei('image') },
|
|
8949
9075
|
},
|
|
8950
9076
|
required: ['prompt'],
|
|
8951
9077
|
additionalProperties: !0,
|
|
@@ -8978,11 +9104,11 @@ function Er() {
|
|
|
8978
9104
|
},
|
|
8979
9105
|
resolution: {
|
|
8980
9106
|
type: 'string',
|
|
8981
|
-
enum: ['480p', '720p', '768p', '1080p', '2k', '4k'],
|
|
9107
|
+
enum: ['360p', '480p', '540p', '720p', '768p', '1080p', '1440p', '2k', '4k'],
|
|
8982
9108
|
description:
|
|
8983
|
-
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default,
|
|
9109
|
+
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default, which that model's tool shows.",
|
|
8984
9110
|
},
|
|
8985
|
-
creative_mode: { type: 'boolean', description:
|
|
9111
|
+
creative_mode: { type: 'boolean', description: Ei('video') },
|
|
8986
9112
|
priority: {
|
|
8987
9113
|
type: 'boolean',
|
|
8988
9114
|
description:
|
|
@@ -9118,10 +9244,10 @@ function Er() {
|
|
|
9118
9244
|
additionalProperties: !0,
|
|
9119
9245
|
},
|
|
9120
9246
|
},
|
|
9121
|
-
d =
|
|
9122
|
-
return [n, s, o, u, l, d, c,
|
|
9247
|
+
d = Rr();
|
|
9248
|
+
return [n, s, o, u, l, d, c, Mr, ...$i];
|
|
9123
9249
|
}
|
|
9124
|
-
function
|
|
9250
|
+
function Rr() {
|
|
9125
9251
|
return {
|
|
9126
9252
|
name: 'upload_asset',
|
|
9127
9253
|
description:
|
|
@@ -9168,31 +9294,31 @@ function Ar() {
|
|
|
9168
9294
|
},
|
|
9169
9295
|
};
|
|
9170
9296
|
}
|
|
9171
|
-
function
|
|
9172
|
-
let e =
|
|
9173
|
-
t = D().map((i) =>
|
|
9174
|
-
return [...e, ...t].map(
|
|
9297
|
+
function lt() {
|
|
9298
|
+
let e = qr(),
|
|
9299
|
+
t = D().map((i) => Or(i));
|
|
9300
|
+
return [...e, ...t].map(Cr).map($r);
|
|
9175
9301
|
}
|
|
9176
|
-
var
|
|
9177
|
-
Pr,
|
|
9178
|
-
Ir,
|
|
9179
|
-
vr,
|
|
9302
|
+
var vr,
|
|
9180
9303
|
Tr,
|
|
9181
9304
|
Mr,
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9305
|
+
Kr,
|
|
9306
|
+
Sr,
|
|
9307
|
+
Er,
|
|
9308
|
+
$i,
|
|
9309
|
+
Us,
|
|
9310
|
+
Ci,
|
|
9311
|
+
Ai = h(() => {
|
|
9186
9312
|
'use strict';
|
|
9187
9313
|
G();
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
((
|
|
9314
|
+
je();
|
|
9315
|
+
ee();
|
|
9316
|
+
((vr = {
|
|
9191
9317
|
type: 'string',
|
|
9192
9318
|
description:
|
|
9193
9319
|
'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.',
|
|
9194
9320
|
}),
|
|
9195
|
-
(
|
|
9321
|
+
(Tr = new Set([
|
|
9196
9322
|
'upload_asset',
|
|
9197
9323
|
'upload_media',
|
|
9198
9324
|
'upload_image',
|
|
@@ -9203,7 +9329,7 @@ var _r,
|
|
|
9203
9329
|
'get_usage',
|
|
9204
9330
|
'get_balance_history',
|
|
9205
9331
|
])),
|
|
9206
|
-
(
|
|
9332
|
+
(Mr = {
|
|
9207
9333
|
name: 'get_pricing',
|
|
9208
9334
|
description:
|
|
9209
9335
|
'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.',
|
|
@@ -9218,13 +9344,13 @@ var _r,
|
|
|
9218
9344
|
additionalProperties: !1,
|
|
9219
9345
|
},
|
|
9220
9346
|
}),
|
|
9221
|
-
(
|
|
9347
|
+
(Kr = {
|
|
9222
9348
|
name: 'get_balance',
|
|
9223
9349
|
description:
|
|
9224
9350
|
"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.",
|
|
9225
9351
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9226
9352
|
}),
|
|
9227
|
-
(
|
|
9353
|
+
(Sr = {
|
|
9228
9354
|
name: 'get_usage',
|
|
9229
9355
|
description:
|
|
9230
9356
|
"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.",
|
|
@@ -9255,7 +9381,7 @@ var _r,
|
|
|
9255
9381
|
additionalProperties: !1,
|
|
9256
9382
|
},
|
|
9257
9383
|
}),
|
|
9258
|
-
(
|
|
9384
|
+
(Er = {
|
|
9259
9385
|
name: 'get_balance_history',
|
|
9260
9386
|
description:
|
|
9261
9387
|
"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.",
|
|
@@ -9273,9 +9399,9 @@ var _r,
|
|
|
9273
9399
|
additionalProperties: !1,
|
|
9274
9400
|
},
|
|
9275
9401
|
}),
|
|
9276
|
-
(
|
|
9277
|
-
(
|
|
9278
|
-
|
|
9402
|
+
($i = [Kr, Sr, Er]),
|
|
9403
|
+
(Us = new Set($i.map((e) => e.name))));
|
|
9404
|
+
Ci = new Set([
|
|
9279
9405
|
'image',
|
|
9280
9406
|
'images',
|
|
9281
9407
|
'image_url',
|
|
@@ -9292,19 +9418,19 @@ var _r,
|
|
|
9292
9418
|
'lipsyncing_audio',
|
|
9293
9419
|
]);
|
|
9294
9420
|
});
|
|
9295
|
-
var
|
|
9296
|
-
|
|
9297
|
-
forgetToolSchemas: () =>
|
|
9298
|
-
jsonRpcAnswer: () =>
|
|
9299
|
-
preprocessLocalFiles: () =>
|
|
9300
|
-
startStdioServer: () =>
|
|
9421
|
+
var Bi = {};
|
|
9422
|
+
Xi(Bi, {
|
|
9423
|
+
forgetToolSchemas: () => Ur,
|
|
9424
|
+
jsonRpcAnswer: () => Li,
|
|
9425
|
+
preprocessLocalFiles: () => Ui,
|
|
9426
|
+
startStdioServer: () => Fi,
|
|
9301
9427
|
});
|
|
9302
|
-
function
|
|
9428
|
+
function Lr(e) {
|
|
9303
9429
|
let t = (i) =>
|
|
9304
9430
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
9305
9431
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
9306
9432
|
}
|
|
9307
|
-
function
|
|
9433
|
+
function Li(e, t, i) {
|
|
9308
9434
|
let a = e?.id,
|
|
9309
9435
|
n = a == null,
|
|
9310
9436
|
s = null;
|
|
@@ -9313,7 +9439,7 @@ function Oi(e, t, i) {
|
|
|
9313
9439
|
} catch {
|
|
9314
9440
|
s = null;
|
|
9315
9441
|
}
|
|
9316
|
-
if (s !== null &&
|
|
9442
|
+
if (s !== null && Lr(s)) return n ? null : s;
|
|
9317
9443
|
if (n) return null;
|
|
9318
9444
|
if (!i && t >= 200 && t < 300) return;
|
|
9319
9445
|
let o = s?.error,
|
|
@@ -9334,16 +9460,16 @@ function Oi(e, t, i) {
|
|
|
9334
9460
|
},
|
|
9335
9461
|
};
|
|
9336
9462
|
}
|
|
9337
|
-
function
|
|
9463
|
+
function Dr() {
|
|
9338
9464
|
let e = process.argv.slice(2),
|
|
9339
9465
|
t = e.indexOf('--api-key');
|
|
9340
9466
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
9341
9467
|
}
|
|
9342
|
-
async function
|
|
9468
|
+
async function Di(e, t, i) {
|
|
9343
9469
|
let a = z.default.resolve(e);
|
|
9344
|
-
if (!
|
|
9470
|
+
if (!N.default.existsSync(a) || !N.default.statSync(a).isFile())
|
|
9345
9471
|
throw new Error(`File not found: ${e}`);
|
|
9346
|
-
let n =
|
|
9472
|
+
let n = N.default.readFileSync(a),
|
|
9347
9473
|
s = n.toString('base64'),
|
|
9348
9474
|
o = n.length,
|
|
9349
9475
|
u = `${i.replace(/\/$/, '')}/v1/upload`,
|
|
@@ -9368,15 +9494,15 @@ async function qi(e, t, i) {
|
|
|
9368
9494
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
9369
9495
|
};
|
|
9370
9496
|
}
|
|
9371
|
-
function
|
|
9372
|
-
return
|
|
9497
|
+
function Ni(e) {
|
|
9498
|
+
return Nr.has(z.default.extname(e).toLowerCase());
|
|
9373
9499
|
}
|
|
9374
|
-
function
|
|
9500
|
+
function Vi(e) {
|
|
9375
9501
|
return new Error(
|
|
9376
9502
|
`Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
|
|
9377
9503
|
);
|
|
9378
9504
|
}
|
|
9379
|
-
function
|
|
9505
|
+
function Vr(e) {
|
|
9380
9506
|
let t = e.trim();
|
|
9381
9507
|
if (
|
|
9382
9508
|
!t ||
|
|
@@ -9387,24 +9513,24 @@ function Lr(e) {
|
|
|
9387
9513
|
)
|
|
9388
9514
|
return null;
|
|
9389
9515
|
let i = z.default.resolve(t);
|
|
9390
|
-
return
|
|
9516
|
+
return N.default.existsSync(i) && N.default.statSync(i).isFile() ? i : null;
|
|
9391
9517
|
}
|
|
9392
|
-
function
|
|
9518
|
+
function pt(e) {
|
|
9393
9519
|
if (Array.isArray(e))
|
|
9394
9520
|
for (let t of e) {
|
|
9395
9521
|
let i = t;
|
|
9396
9522
|
typeof i.name == 'string' &&
|
|
9397
9523
|
i.inputSchema &&
|
|
9398
9524
|
typeof i.inputSchema == 'object' &&
|
|
9399
|
-
|
|
9525
|
+
ae.set(i.name, i.inputSchema);
|
|
9400
9526
|
}
|
|
9401
9527
|
}
|
|
9402
|
-
function
|
|
9403
|
-
(
|
|
9528
|
+
function Ur() {
|
|
9529
|
+
(ae.clear(), (dt = 0));
|
|
9404
9530
|
}
|
|
9405
|
-
async function
|
|
9406
|
-
if (!(Date.now() -
|
|
9407
|
-
|
|
9531
|
+
async function Fr(e, t) {
|
|
9532
|
+
if (!(Date.now() - dt < 6e4)) {
|
|
9533
|
+
dt = Date.now();
|
|
9408
9534
|
try {
|
|
9409
9535
|
let a = await (
|
|
9410
9536
|
await fetch(e, {
|
|
@@ -9414,39 +9540,39 @@ async function Vr(e, t) {
|
|
|
9414
9540
|
signal: AbortSignal.timeout(1e4),
|
|
9415
9541
|
})
|
|
9416
9542
|
).json();
|
|
9417
|
-
|
|
9543
|
+
pt(a.result?.tools);
|
|
9418
9544
|
} catch {}
|
|
9419
9545
|
}
|
|
9420
9546
|
}
|
|
9421
|
-
function
|
|
9547
|
+
function Br(e) {
|
|
9422
9548
|
return e
|
|
9423
9549
|
? e.type === 'string'
|
|
9424
9550
|
? e.format === 'uri'
|
|
9425
9551
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
9426
9552
|
: !1;
|
|
9427
9553
|
}
|
|
9428
|
-
async function
|
|
9554
|
+
async function Oi(e, t, i) {
|
|
9429
9555
|
if (typeof e != 'string') return e;
|
|
9430
|
-
let a =
|
|
9556
|
+
let a = Vr(e);
|
|
9431
9557
|
if (!a) return e;
|
|
9432
|
-
if (!
|
|
9433
|
-
return (await
|
|
9558
|
+
if (!Ni(a)) throw Vi(a);
|
|
9559
|
+
return (await Di(a, t, i)).url;
|
|
9434
9560
|
}
|
|
9435
|
-
async function
|
|
9436
|
-
(
|
|
9437
|
-
let s =
|
|
9561
|
+
async function Ui(e, t, i, a, n) {
|
|
9562
|
+
(ae.size === 0 && pt(lt()), ae.has(e) || (await Fr(n, i)));
|
|
9563
|
+
let s = ae.get(e)?.properties;
|
|
9438
9564
|
if (!s) return t;
|
|
9439
9565
|
let o = { ...t };
|
|
9440
9566
|
for (let [u, l] of Object.entries(t))
|
|
9441
|
-
if (
|
|
9567
|
+
if (Br(s[u]))
|
|
9442
9568
|
if (Array.isArray(l)) {
|
|
9443
9569
|
let c = [];
|
|
9444
|
-
for (let d of l) c.push(await
|
|
9570
|
+
for (let d of l) c.push(await Oi(d, i, a));
|
|
9445
9571
|
o[u] = c;
|
|
9446
|
-
} else o[u] = await
|
|
9572
|
+
} else o[u] = await Oi(l, i, a);
|
|
9447
9573
|
return o;
|
|
9448
9574
|
}
|
|
9449
|
-
function
|
|
9575
|
+
function jr(e) {
|
|
9450
9576
|
let t = e.id ?? null;
|
|
9451
9577
|
switch (e.method) {
|
|
9452
9578
|
case 'initialize':
|
|
@@ -9464,7 +9590,7 @@ function Ur(e) {
|
|
|
9464
9590
|
case 'ping':
|
|
9465
9591
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
9466
9592
|
case 'tools/list':
|
|
9467
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9593
|
+
return { jsonrpc: '2.0', id: t, result: { tools: lt() } };
|
|
9468
9594
|
case 'tools/call':
|
|
9469
9595
|
return {
|
|
9470
9596
|
jsonrpc: '2.0',
|
|
@@ -9487,13 +9613,13 @@ function Ur(e) {
|
|
|
9487
9613
|
};
|
|
9488
9614
|
}
|
|
9489
9615
|
}
|
|
9490
|
-
async function
|
|
9491
|
-
if (
|
|
9492
|
-
|
|
9493
|
-
let e =
|
|
9616
|
+
async function Fi() {
|
|
9617
|
+
if (qi) return;
|
|
9618
|
+
qi = !0;
|
|
9619
|
+
let e = Dr(),
|
|
9494
9620
|
t = w(),
|
|
9495
9621
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9496
|
-
(
|
|
9622
|
+
(Ri.default
|
|
9497
9623
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
9498
9624
|
.on('line', async (n) => {
|
|
9499
9625
|
let s = n.trim();
|
|
@@ -9505,7 +9631,7 @@ async function Vi() {
|
|
|
9505
9631
|
c = o.params.arguments || {};
|
|
9506
9632
|
if (l === 'get_pricing') {
|
|
9507
9633
|
let d = typeof c.model == 'string' ? c.model.trim() : '',
|
|
9508
|
-
p = `${t.replace(/\/+$/, '')}${
|
|
9634
|
+
p = `${t.replace(/\/+$/, '')}${we(d)}`;
|
|
9509
9635
|
try {
|
|
9510
9636
|
let m = await fetch(p, { signal: AbortSignal.timeout(1e4) }),
|
|
9511
9637
|
y = await m.text();
|
|
@@ -9553,18 +9679,18 @@ async function Vi() {
|
|
|
9553
9679
|
)
|
|
9554
9680
|
try {
|
|
9555
9681
|
let p = z.default.resolve(d.trim());
|
|
9556
|
-
if (
|
|
9557
|
-
if (!
|
|
9558
|
-
let m = await
|
|
9682
|
+
if (N.default.existsSync(p) && N.default.statSync(p).isFile() && e) {
|
|
9683
|
+
if (!Ni(p)) throw Vi(p);
|
|
9684
|
+
let m = await Di(p, e, t),
|
|
9559
9685
|
y = (m.sizeBytes / 1024).toFixed(1),
|
|
9560
|
-
|
|
9686
|
+
xe =
|
|
9561
9687
|
m.mimeType.startsWith('image/') ||
|
|
9562
9688
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
9563
9689
|
? `
|
|
9564
9690
|
|
|
9565
9691
|
`
|
|
9566
9692
|
: '',
|
|
9567
|
-
|
|
9693
|
+
_e = {
|
|
9568
9694
|
jsonrpc: '2.0',
|
|
9569
9695
|
id: o.id,
|
|
9570
9696
|
result: {
|
|
@@ -9575,7 +9701,7 @@ async function Vi() {
|
|
|
9575
9701
|
|
|
9576
9702
|
- **URL:** ${m.url}
|
|
9577
9703
|
- **Type:** \`${m.mimeType}\`
|
|
9578
|
-
- **Size:** ${y} KB${
|
|
9704
|
+
- **Size:** ${y} KB${xe}
|
|
9579
9705
|
|
|
9580
9706
|
Pass this URL to any Tein generation tool.`,
|
|
9581
9707
|
},
|
|
@@ -9584,7 +9710,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9584
9710
|
},
|
|
9585
9711
|
};
|
|
9586
9712
|
process.stdout.write(
|
|
9587
|
-
JSON.stringify(
|
|
9713
|
+
JSON.stringify(_e) +
|
|
9588
9714
|
`
|
|
9589
9715
|
`,
|
|
9590
9716
|
);
|
|
@@ -9611,7 +9737,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9611
9737
|
}
|
|
9612
9738
|
if (e)
|
|
9613
9739
|
try {
|
|
9614
|
-
o.params.arguments = await
|
|
9740
|
+
o.params.arguments = await Ui(String(l), c, e, t, i);
|
|
9615
9741
|
} catch (d) {
|
|
9616
9742
|
let p = d instanceof Error ? d.message : String(d);
|
|
9617
9743
|
process.stdout.write(
|
|
@@ -9642,10 +9768,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9642
9768
|
body: JSON.stringify(o),
|
|
9643
9769
|
}),
|
|
9644
9770
|
c = await l.text(),
|
|
9645
|
-
d =
|
|
9771
|
+
d = Li(o, l.status, c);
|
|
9646
9772
|
if (d === null) return;
|
|
9647
9773
|
if (d) {
|
|
9648
|
-
(o?.method === 'tools/list' &&
|
|
9774
|
+
(o?.method === 'tools/list' && pt(d.result?.tools),
|
|
9649
9775
|
process.stdout.write(
|
|
9650
9776
|
JSON.stringify(d) +
|
|
9651
9777
|
`
|
|
@@ -9654,7 +9780,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9654
9780
|
return;
|
|
9655
9781
|
}
|
|
9656
9782
|
} catch {}
|
|
9657
|
-
let u =
|
|
9783
|
+
let u = jr(o);
|
|
9658
9784
|
u !== null &&
|
|
9659
9785
|
process.stdout.write(
|
|
9660
9786
|
JSON.stringify(u) +
|
|
@@ -9677,23 +9803,23 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9677
9803
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
9678
9804
|
`));
|
|
9679
9805
|
}
|
|
9680
|
-
var
|
|
9806
|
+
var N,
|
|
9681
9807
|
z,
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9808
|
+
Ri,
|
|
9809
|
+
Nr,
|
|
9810
|
+
ae,
|
|
9811
|
+
dt,
|
|
9812
|
+
qi,
|
|
9813
|
+
ji = h(() => {
|
|
9688
9814
|
'use strict';
|
|
9689
|
-
((
|
|
9815
|
+
((N = T(require('node:fs'))),
|
|
9690
9816
|
(z = T(require('node:path'))),
|
|
9691
|
-
(
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9817
|
+
(Ri = T(require('node:readline'))));
|
|
9818
|
+
it();
|
|
9819
|
+
Ai();
|
|
9820
|
+
$();
|
|
9821
|
+
re();
|
|
9822
|
+
Nr = new Set([
|
|
9697
9823
|
'.png',
|
|
9698
9824
|
'.jpg',
|
|
9699
9825
|
'.jpeg',
|
|
@@ -9719,20 +9845,20 @@ var V,
|
|
|
9719
9845
|
'.flac',
|
|
9720
9846
|
'.opus',
|
|
9721
9847
|
]);
|
|
9722
|
-
((
|
|
9723
|
-
|
|
9848
|
+
((ae = new Map()), (dt = 0));
|
|
9849
|
+
qi = !1;
|
|
9724
9850
|
require.main === module &&
|
|
9725
|
-
|
|
9851
|
+
Fi().catch((e) => {
|
|
9726
9852
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
9727
9853
|
`),
|
|
9728
9854
|
process.exit(1));
|
|
9729
9855
|
});
|
|
9730
9856
|
});
|
|
9731
|
-
var
|
|
9857
|
+
var Zi =
|
|
9732
9858
|
!process.env.NO_COLOR &&
|
|
9733
9859
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
9734
9860
|
function x(e, t) {
|
|
9735
|
-
return (i) => (
|
|
9861
|
+
return (i) => (Zi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
9736
9862
|
}
|
|
9737
9863
|
var r = {
|
|
9738
9864
|
bold: x(1, 22),
|
|
@@ -9754,7 +9880,7 @@ var r = {
|
|
|
9754
9880
|
bgCyan: x(46, 49),
|
|
9755
9881
|
bgGreen: x(42, 49),
|
|
9756
9882
|
},
|
|
9757
|
-
|
|
9883
|
+
C = class {
|
|
9758
9884
|
constructor(t = '') {
|
|
9759
9885
|
this.frames = [
|
|
9760
9886
|
'\u280B',
|
|
@@ -9818,11 +9944,11 @@ var r = {
|
|
|
9818
9944
|
};
|
|
9819
9945
|
var U = T(require('node:fs')),
|
|
9820
9946
|
O = T(require('node:path'));
|
|
9821
|
-
var
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
var
|
|
9947
|
+
var ne = T(require('node:fs')),
|
|
9948
|
+
gt = T(require('node:path')),
|
|
9949
|
+
ht = require('node:stream/promises');
|
|
9950
|
+
re();
|
|
9951
|
+
var aa = new Set([
|
|
9826
9952
|
'account_suspended',
|
|
9827
9953
|
'account_terminated',
|
|
9828
9954
|
'creative_mode_restricted',
|
|
@@ -9830,7 +9956,7 @@ var ea = new Set([
|
|
|
9830
9956
|
'workspace_paused',
|
|
9831
9957
|
]),
|
|
9832
9958
|
v = 1,
|
|
9833
|
-
|
|
9959
|
+
ra = 3,
|
|
9834
9960
|
b = class extends Error {
|
|
9835
9961
|
constructor(t, i, a, n = {}) {
|
|
9836
9962
|
(super(i),
|
|
@@ -9840,10 +9966,10 @@ var ea = new Set([
|
|
|
9840
9966
|
(this.fields = n));
|
|
9841
9967
|
}
|
|
9842
9968
|
get exitCode() {
|
|
9843
|
-
return this.code &&
|
|
9969
|
+
return this.code && aa.has(this.code) ? ra : v;
|
|
9844
9970
|
}
|
|
9845
9971
|
};
|
|
9846
|
-
function
|
|
9972
|
+
function na(e, t, i) {
|
|
9847
9973
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9848
9974
|
if (!i || typeof i != 'object') return new b(e, a);
|
|
9849
9975
|
let n = i;
|
|
@@ -9856,13 +9982,13 @@ function ia(e, t, i) {
|
|
|
9856
9982
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
9857
9983
|
return new b(e, c, typeof o == 'string' ? o : void 0, l);
|
|
9858
9984
|
}
|
|
9859
|
-
function
|
|
9985
|
+
function mt(e) {
|
|
9860
9986
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
9861
9987
|
}
|
|
9862
9988
|
function K(e) {
|
|
9863
9989
|
let t = [e.message],
|
|
9864
|
-
i =
|
|
9865
|
-
a =
|
|
9990
|
+
i = mt(e.fields.required),
|
|
9991
|
+
a = mt(e.fields.balance);
|
|
9866
9992
|
(i || a) &&
|
|
9867
9993
|
t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
9868
9994
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -9870,19 +9996,19 @@ function K(e) {
|
|
|
9870
9996
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
9871
9997
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
9872
9998
|
}
|
|
9873
|
-
function
|
|
9999
|
+
function sa(e) {
|
|
9874
10000
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
9875
10001
|
? 'video'
|
|
9876
10002
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
9877
10003
|
? 'audio'
|
|
9878
10004
|
: 'image';
|
|
9879
10005
|
}
|
|
9880
|
-
function
|
|
10006
|
+
function ft(e) {
|
|
9881
10007
|
let t = [];
|
|
9882
10008
|
for (let i of e.data ?? [])
|
|
9883
10009
|
typeof i.message?.content == 'string'
|
|
9884
10010
|
? t.push({ type: 'text', text: i.message.content })
|
|
9885
|
-
: i.url && t.push({ type:
|
|
10011
|
+
: i.url && t.push({ type: sa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
|
|
9886
10012
|
return t;
|
|
9887
10013
|
}
|
|
9888
10014
|
var M = class {
|
|
@@ -9908,7 +10034,7 @@ var M = class {
|
|
|
9908
10034
|
try {
|
|
9909
10035
|
s = await n.json();
|
|
9910
10036
|
} catch {}
|
|
9911
|
-
throw
|
|
10037
|
+
throw na(n.status, n.statusText, s);
|
|
9912
10038
|
}
|
|
9913
10039
|
return await n.json();
|
|
9914
10040
|
}
|
|
@@ -9922,7 +10048,7 @@ var M = class {
|
|
|
9922
10048
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
9923
10049
|
? n
|
|
9924
10050
|
: 'processing',
|
|
9925
|
-
o =
|
|
10051
|
+
o = ft(a);
|
|
9926
10052
|
return {
|
|
9927
10053
|
request_id: a.request_id || a.id || '',
|
|
9928
10054
|
model: a.model,
|
|
@@ -9940,7 +10066,7 @@ var M = class {
|
|
|
9940
10066
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
9941
10067
|
? a
|
|
9942
10068
|
: 'processing',
|
|
9943
|
-
s =
|
|
10069
|
+
s = ft(i),
|
|
9944
10070
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
9945
10071
|
return {
|
|
9946
10072
|
request_id: i.id || t,
|
|
@@ -9969,14 +10095,14 @@ var M = class {
|
|
|
9969
10095
|
async downloadOutput(t, i) {
|
|
9970
10096
|
let a = await fetch(t);
|
|
9971
10097
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
9972
|
-
let n =
|
|
9973
|
-
|
|
9974
|
-
let s =
|
|
9975
|
-
return (await (0,
|
|
10098
|
+
let n = gt.default.dirname(i);
|
|
10099
|
+
ne.default.existsSync(n) || ne.default.mkdirSync(n, { recursive: !0 });
|
|
10100
|
+
let s = ne.default.createWriteStream(i);
|
|
10101
|
+
return (await (0, ht.pipeline)(a.body, s), i);
|
|
9976
10102
|
}
|
|
9977
10103
|
};
|
|
9978
|
-
|
|
9979
|
-
function
|
|
10104
|
+
$();
|
|
10105
|
+
function Ke(e) {
|
|
9980
10106
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
9981
10107
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
9982
10108
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -9984,43 +10110,43 @@ function Se(e) {
|
|
|
9984
10110
|
a = Math.round(Number((e * i).toFixed(6))) / i;
|
|
9985
10111
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
9986
10112
|
}
|
|
9987
|
-
|
|
9988
|
-
var
|
|
9989
|
-
function
|
|
9990
|
-
for (let t of
|
|
10113
|
+
ee();
|
|
10114
|
+
var ui = ['images', 'input_images', 'videos', 'audios'];
|
|
10115
|
+
function ir(e) {
|
|
10116
|
+
for (let t of ui) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
9991
10117
|
}
|
|
9992
|
-
function
|
|
10118
|
+
function ar(e) {
|
|
9993
10119
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
9994
10120
|
let t = O.default.resolve(e);
|
|
9995
10121
|
return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
|
|
9996
10122
|
}
|
|
9997
|
-
async function
|
|
9998
|
-
for (let i of
|
|
10123
|
+
async function rr(e, t) {
|
|
10124
|
+
for (let i of ui) {
|
|
9999
10125
|
if (!Array.isArray(e[i])) continue;
|
|
10000
10126
|
let a = [];
|
|
10001
10127
|
for (let n of e[i]) {
|
|
10002
10128
|
if (typeof n != 'string') continue;
|
|
10003
|
-
let s =
|
|
10129
|
+
let s = ar(n);
|
|
10004
10130
|
a.push(s ? await t(s) : n);
|
|
10005
10131
|
}
|
|
10006
10132
|
e[i] = a;
|
|
10007
10133
|
}
|
|
10008
10134
|
}
|
|
10009
|
-
var
|
|
10010
|
-
function
|
|
10135
|
+
var te = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10136
|
+
function nr(e) {
|
|
10011
10137
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
10012
10138
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
10013
|
-
i =
|
|
10139
|
+
i = te.enterprise;
|
|
10014
10140
|
return (
|
|
10015
10141
|
(!Number.isInteger(t) || t < 1 || t > i) &&
|
|
10016
10142
|
(process.stderr
|
|
10017
|
-
.write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${
|
|
10143
|
+
.write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${te.starter}, Plus ${te.plus}, Scale ${te.scale}, Enterprise ${te.enterprise} at once, including polling.
|
|
10018
10144
|
`),
|
|
10019
10145
|
process.exit(1)),
|
|
10020
10146
|
t
|
|
10021
10147
|
);
|
|
10022
10148
|
}
|
|
10023
|
-
async function
|
|
10149
|
+
async function sr(e, t, i, a, n) {
|
|
10024
10150
|
n.isJson ||
|
|
10025
10151
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
10026
10152
|
`);
|
|
@@ -10082,7 +10208,7 @@ async function ar(e, t, i, a, n) {
|
|
|
10082
10208
|
else {
|
|
10083
10209
|
for (let l of o)
|
|
10084
10210
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
10085
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
10211
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${Ke(l.usage.cost)}`),
|
|
10086
10212
|
l.error && process.stdout.write(` ${l.error}`),
|
|
10087
10213
|
process.stdout.write(`
|
|
10088
10214
|
`));
|
|
@@ -10095,12 +10221,12 @@ async function ar(e, t, i, a, n) {
|
|
|
10095
10221
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10096
10222
|
process.exit(v);
|
|
10097
10223
|
}
|
|
10098
|
-
function
|
|
10224
|
+
function or(e, t, i) {
|
|
10099
10225
|
if (i <= 1) return e;
|
|
10100
10226
|
let a = O.default.extname(e);
|
|
10101
10227
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
10102
10228
|
}
|
|
10103
|
-
function
|
|
10229
|
+
function mi(e) {
|
|
10104
10230
|
let t = {},
|
|
10105
10231
|
i = new Set(),
|
|
10106
10232
|
a = [];
|
|
@@ -10145,7 +10271,7 @@ function pi(e) {
|
|
|
10145
10271
|
}
|
|
10146
10272
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
|
|
10147
10273
|
}
|
|
10148
|
-
async function
|
|
10274
|
+
async function et(e, t) {
|
|
10149
10275
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10150
10276
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10151
10277
|
(i ||
|
|
@@ -10167,7 +10293,7 @@ async function Ze(e, t) {
|
|
|
10167
10293
|
s = !!t.json,
|
|
10168
10294
|
o = !!(t.async || t.no_wait),
|
|
10169
10295
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
10170
|
-
l =
|
|
10296
|
+
l = nr(t),
|
|
10171
10297
|
c = { ...t };
|
|
10172
10298
|
(delete c.json,
|
|
10173
10299
|
delete c.async,
|
|
@@ -10176,9 +10302,9 @@ async function Ze(e, t) {
|
|
|
10176
10302
|
delete c.api_key,
|
|
10177
10303
|
delete c.api_url,
|
|
10178
10304
|
delete c.count);
|
|
10179
|
-
let d =
|
|
10180
|
-
(
|
|
10181
|
-
typeof d.image == 'string' && !d.images && !
|
|
10305
|
+
let d = ci(n, c);
|
|
10306
|
+
(ir(d),
|
|
10307
|
+
typeof d.image == 'string' && !d.images && !ke(n) && ((d.images = [d.image]), delete d.image),
|
|
10182
10308
|
d.image_url &&
|
|
10183
10309
|
!d.first_frame_image &&
|
|
10184
10310
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
@@ -10200,14 +10326,14 @@ async function Ze(e, t) {
|
|
|
10200
10326
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
10201
10327
|
let P = O.default.resolve(g);
|
|
10202
10328
|
if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
|
|
10203
|
-
let I = new
|
|
10329
|
+
let I = new C(`Uploading local file ${O.default.basename(P)} to CDN...`);
|
|
10204
10330
|
s || I.start();
|
|
10205
10331
|
try {
|
|
10206
|
-
let
|
|
10207
|
-
q = await p.uploadAsset(
|
|
10332
|
+
let V = U.default.readFileSync(P),
|
|
10333
|
+
q = await p.uploadAsset(V.toString('base64'));
|
|
10208
10334
|
((d[k] = q.url), s || I.succeed(`Uploaded ${O.default.basename(P)} to CDN`));
|
|
10209
|
-
} catch (
|
|
10210
|
-
let q =
|
|
10335
|
+
} catch (V) {
|
|
10336
|
+
let q = V instanceof Error ? V.message : String(V);
|
|
10211
10337
|
(s
|
|
10212
10338
|
? process.stdout.write(
|
|
10213
10339
|
JSON.stringify({ error: q }) +
|
|
@@ -10220,8 +10346,8 @@ async function Ze(e, t) {
|
|
|
10220
10346
|
}
|
|
10221
10347
|
}
|
|
10222
10348
|
}
|
|
10223
|
-
await
|
|
10224
|
-
let g = new
|
|
10349
|
+
await rr(d, async (k) => {
|
|
10350
|
+
let g = new C(`Uploading local file ${O.default.basename(k)} to CDN...`);
|
|
10225
10351
|
s || g.start();
|
|
10226
10352
|
try {
|
|
10227
10353
|
let P = U.default.readFileSync(k),
|
|
@@ -10239,12 +10365,12 @@ async function Ze(e, t) {
|
|
|
10239
10365
|
process.exit(1));
|
|
10240
10366
|
}
|
|
10241
10367
|
});
|
|
10242
|
-
let y = new
|
|
10368
|
+
let y = new C(`Submitting task for ${r.bold(e)}...`);
|
|
10243
10369
|
s || y.start();
|
|
10244
10370
|
let f;
|
|
10245
10371
|
try {
|
|
10246
10372
|
if (l > 1) {
|
|
10247
|
-
await
|
|
10373
|
+
await sr(p, e, d, l, { isJson: s, isAsync: o });
|
|
10248
10374
|
return;
|
|
10249
10375
|
}
|
|
10250
10376
|
f = await p.queueJob(e, d);
|
|
@@ -10282,12 +10408,12 @@ async function Ze(e, t) {
|
|
|
10282
10408
|
`));
|
|
10283
10409
|
return;
|
|
10284
10410
|
}
|
|
10285
|
-
let
|
|
10286
|
-
|
|
10411
|
+
let xe = Date.now(),
|
|
10412
|
+
_e = 1500;
|
|
10287
10413
|
for (; f.status === 'processing';) {
|
|
10288
|
-
let k = Math.round((Date.now() -
|
|
10414
|
+
let k = Math.round((Date.now() - xe) / 1e3);
|
|
10289
10415
|
(s || y.update(`Rendering ${r.bold(e)} (${k}s elapsed)... [ID: ${f.request_id}]`),
|
|
10290
|
-
await new Promise((g) => setTimeout(g,
|
|
10416
|
+
await new Promise((g) => setTimeout(g, _e)));
|
|
10291
10417
|
try {
|
|
10292
10418
|
f = await p.getStatus(f.request_id);
|
|
10293
10419
|
} catch (g) {
|
|
@@ -10329,7 +10455,7 @@ async function Ze(e, t) {
|
|
|
10329
10455
|
process.stdout.write(` ${r.bold('Request ID:')} ${f.request_id}
|
|
10330
10456
|
`),
|
|
10331
10457
|
f.usage?.cost !== void 0 &&
|
|
10332
|
-
process.stdout.write(` ${r.bold('Cost:')} ${
|
|
10458
|
+
process.stdout.write(` ${r.bold('Cost:')} ${Ke(f.usage.cost)}
|
|
10333
10459
|
`),
|
|
10334
10460
|
f.output && f.output.length > 0)
|
|
10335
10461
|
) {
|
|
@@ -10341,19 +10467,19 @@ ${r.bold('Outputs:')}
|
|
|
10341
10467
|
for (let P = 0; P < f.output.length; P++) {
|
|
10342
10468
|
let I = f.output[P];
|
|
10343
10469
|
if (I.url) {
|
|
10344
|
-
let
|
|
10470
|
+
let V = I.layer?.name ? ` ${r.bold(I.layer.name)}` : '';
|
|
10345
10471
|
if (
|
|
10346
|
-
(process.stdout.write(` [${I.type.toUpperCase()}]${
|
|
10472
|
+
(process.stdout.write(` [${I.type.toUpperCase()}]${V} ${r.cyan(r.underline(I.url))}
|
|
10347
10473
|
`),
|
|
10348
10474
|
u)
|
|
10349
10475
|
) {
|
|
10350
|
-
let q =
|
|
10351
|
-
|
|
10476
|
+
let q = or(u, g++, k),
|
|
10477
|
+
ct = new C(`Downloading output to ${q}...`).start();
|
|
10352
10478
|
try {
|
|
10353
10479
|
(await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
|
|
10354
|
-
|
|
10355
|
-
} catch (
|
|
10356
|
-
|
|
10480
|
+
ct.succeed(`Saved to ${r.bold(q)}`));
|
|
10481
|
+
} catch (Pe) {
|
|
10482
|
+
ct.fail(`Failed to download: ${Pe instanceof Error ? Pe.message : Pe}`);
|
|
10357
10483
|
}
|
|
10358
10484
|
}
|
|
10359
10485
|
} else
|
|
@@ -10366,9 +10492,9 @@ ${I.text}
|
|
|
10366
10492
|
process.stdout.write(`
|
|
10367
10493
|
`);
|
|
10368
10494
|
}
|
|
10369
|
-
var
|
|
10370
|
-
|
|
10371
|
-
async function
|
|
10495
|
+
var fi = T(require('node:readline'));
|
|
10496
|
+
$();
|
|
10497
|
+
async function lr(e) {
|
|
10372
10498
|
try {
|
|
10373
10499
|
return (await new M(e, w()).checkKey(), 'ok');
|
|
10374
10500
|
} catch (t) {
|
|
@@ -10379,15 +10505,15 @@ async function nr(e) {
|
|
|
10379
10505
|
return 'unchecked';
|
|
10380
10506
|
}
|
|
10381
10507
|
}
|
|
10382
|
-
function
|
|
10383
|
-
let t =
|
|
10508
|
+
function dr(e) {
|
|
10509
|
+
let t = fi.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10384
10510
|
return new Promise((i) => {
|
|
10385
10511
|
t.question(e, (a) => {
|
|
10386
10512
|
(t.close(), i(a.trim()));
|
|
10387
10513
|
});
|
|
10388
10514
|
});
|
|
10389
10515
|
}
|
|
10390
|
-
async function
|
|
10516
|
+
async function ie(e, t) {
|
|
10391
10517
|
switch (e) {
|
|
10392
10518
|
case 'login':
|
|
10393
10519
|
case 'set-key': {
|
|
@@ -10399,22 +10525,22 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10399
10525
|
process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
|
|
10400
10526
|
|
|
10401
10527
|
`),
|
|
10402
|
-
(i = await
|
|
10528
|
+
(i = await dr('Enter your Tein API Key (sk_live_...): '))),
|
|
10403
10529
|
!i.startsWith('sk_live_') &&
|
|
10404
10530
|
!i.startsWith('sk_test_') &&
|
|
10405
10531
|
(process.stderr
|
|
10406
10532
|
.write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10407
10533
|
`),
|
|
10408
10534
|
process.exit(1)));
|
|
10409
|
-
let a = await
|
|
10535
|
+
let a = await lr(i);
|
|
10410
10536
|
(a === 'invalid' &&
|
|
10411
10537
|
(process.stderr
|
|
10412
10538
|
.write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
10413
10539
|
`),
|
|
10414
10540
|
process.exit(1)),
|
|
10415
|
-
|
|
10541
|
+
Me({ apiKey: i }),
|
|
10416
10542
|
process.stdout.write(`
|
|
10417
|
-
${r.green('\u2713')} API key saved to ${r.dim(
|
|
10543
|
+
${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
10418
10544
|
`),
|
|
10419
10545
|
a === 'blocked'
|
|
10420
10546
|
? process.stdout
|
|
@@ -10437,9 +10563,9 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
|
|
|
10437
10563
|
`);
|
|
10438
10564
|
break;
|
|
10439
10565
|
}
|
|
10440
|
-
(
|
|
10566
|
+
(Me({ apiKey: '' }),
|
|
10441
10567
|
process.stdout
|
|
10442
|
-
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(
|
|
10568
|
+
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(oe())}
|
|
10443
10569
|
`));
|
|
10444
10570
|
break;
|
|
10445
10571
|
}
|
|
@@ -10451,7 +10577,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(le())}
|
|
|
10451
10577
|
(process.stdout.write(`
|
|
10452
10578
|
${r.bold('Tein AI CLI Configuration')}
|
|
10453
10579
|
`),
|
|
10454
|
-
process.stdout.write(` Config file: ${r.dim(
|
|
10580
|
+
process.stdout.write(` Config file: ${r.dim(oe())}
|
|
10455
10581
|
`),
|
|
10456
10582
|
process.stdout.write(` API URL: ${r.cyan(a)}
|
|
10457
10583
|
`),
|
|
@@ -10475,16 +10601,16 @@ ${r.bold('Tein AI CLI Configuration')}
|
|
|
10475
10601
|
}
|
|
10476
10602
|
}
|
|
10477
10603
|
}
|
|
10478
|
-
|
|
10604
|
+
$();
|
|
10479
10605
|
function _(e) {
|
|
10480
10606
|
return e !== 0 && Math.abs(e) < 0.01
|
|
10481
10607
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10482
10608
|
: `$${e.toFixed(2)}`;
|
|
10483
10609
|
}
|
|
10484
|
-
function
|
|
10610
|
+
function gi(e) {
|
|
10485
10611
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10486
10612
|
}
|
|
10487
|
-
function
|
|
10613
|
+
function pr(e) {
|
|
10488
10614
|
let t = [
|
|
10489
10615
|
['Balance', _(e.balance)],
|
|
10490
10616
|
['Available to this key', _(e.available)],
|
|
@@ -10504,8 +10630,8 @@ function or(e) {
|
|
|
10504
10630
|
`${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
|
|
10505
10631
|
]),
|
|
10506
10632
|
t.push(
|
|
10507
|
-
['This month', `${_(e.usage.this_month.spend)} on ${
|
|
10508
|
-
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${
|
|
10633
|
+
['This month', `${_(e.usage.this_month.spend)} on ${gi(e.usage.this_month.requests)}`],
|
|
10634
|
+
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${gi(e.usage.last_30_days.requests)}`],
|
|
10509
10635
|
[
|
|
10510
10636
|
'Auto top up',
|
|
10511
10637
|
e.auto_top_up.enabled
|
|
@@ -10518,7 +10644,7 @@ function or(e) {
|
|
|
10518
10644
|
let a = Math.max(...t.map(([n]) => n.length));
|
|
10519
10645
|
return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
|
|
10520
10646
|
}
|
|
10521
|
-
async function
|
|
10647
|
+
async function hi(e) {
|
|
10522
10648
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10523
10649
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10524
10650
|
a = !!e.json;
|
|
@@ -10562,13 +10688,13 @@ async function mi(e) {
|
|
|
10562
10688
|
}
|
|
10563
10689
|
process.stdout.write(`
|
|
10564
10690
|
${r.bold('Tein balance')}
|
|
10565
|
-
${
|
|
10691
|
+
${pr(n).join(`
|
|
10566
10692
|
`)}
|
|
10567
10693
|
|
|
10568
10694
|
`);
|
|
10569
10695
|
}
|
|
10570
|
-
|
|
10571
|
-
function
|
|
10696
|
+
$();
|
|
10697
|
+
function yi(e) {
|
|
10572
10698
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10573
10699
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
|
|
10574
10700
|
return (
|
|
@@ -10582,7 +10708,7 @@ function fi(e) {
|
|
|
10582
10708
|
new M(t, i)
|
|
10583
10709
|
);
|
|
10584
10710
|
}
|
|
10585
|
-
function
|
|
10711
|
+
function bi(e, t) {
|
|
10586
10712
|
let i = {};
|
|
10587
10713
|
for (let a of t) {
|
|
10588
10714
|
let n = e[a];
|
|
@@ -10590,7 +10716,7 @@ function gi(e, t) {
|
|
|
10590
10716
|
}
|
|
10591
10717
|
return i;
|
|
10592
10718
|
}
|
|
10593
|
-
async function
|
|
10719
|
+
async function ki(e, t) {
|
|
10594
10720
|
try {
|
|
10595
10721
|
return await t();
|
|
10596
10722
|
} catch (i) {
|
|
@@ -10614,7 +10740,7 @@ async function hi(e, t) {
|
|
|
10614
10740
|
process.exit(v));
|
|
10615
10741
|
}
|
|
10616
10742
|
}
|
|
10617
|
-
function
|
|
10743
|
+
function tt(e) {
|
|
10618
10744
|
let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
|
|
10619
10745
|
i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
|
|
10620
10746
|
return e.map(
|
|
@@ -10625,7 +10751,7 @@ function et(e) {
|
|
|
10625
10751
|
.trimEnd()}`,
|
|
10626
10752
|
);
|
|
10627
10753
|
}
|
|
10628
|
-
function
|
|
10754
|
+
function cr(e) {
|
|
10629
10755
|
let t = e.summary,
|
|
10630
10756
|
i = [
|
|
10631
10757
|
` 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}` : ''}`,
|
|
@@ -10637,7 +10763,7 @@ function lr(e) {
|
|
|
10637
10763
|
e.by_channel.length &&
|
|
10638
10764
|
(i.push('', r.bold('By channel')),
|
|
10639
10765
|
i.push(
|
|
10640
|
-
...
|
|
10766
|
+
...tt([
|
|
10641
10767
|
['Channel', 'Spend', 'Requests'],
|
|
10642
10768
|
...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
|
|
10643
10769
|
]),
|
|
@@ -10645,7 +10771,7 @@ function lr(e) {
|
|
|
10645
10771
|
e.by_model.length &&
|
|
10646
10772
|
(i.push('', r.bold('By model')),
|
|
10647
10773
|
i.push(
|
|
10648
|
-
...
|
|
10774
|
+
...tt([
|
|
10649
10775
|
['Model', 'Spend', 'Requests', 'Failed'],
|
|
10650
10776
|
...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
|
|
10651
10777
|
]),
|
|
@@ -10653,10 +10779,10 @@ function lr(e) {
|
|
|
10653
10779
|
i
|
|
10654
10780
|
);
|
|
10655
10781
|
}
|
|
10656
|
-
async function
|
|
10782
|
+
async function wi(e) {
|
|
10657
10783
|
let t = !!e.json,
|
|
10658
|
-
i =
|
|
10659
|
-
a = await
|
|
10784
|
+
i = yi(e),
|
|
10785
|
+
a = await ki(t, () => i.getUsage(bi(e, ['range', 'from', 'to', 'model', 'channel'])));
|
|
10660
10786
|
if (t) {
|
|
10661
10787
|
process.stdout.write(
|
|
10662
10788
|
JSON.stringify(a, null, 2) +
|
|
@@ -10667,14 +10793,14 @@ async function yi(e) {
|
|
|
10667
10793
|
}
|
|
10668
10794
|
process.stdout.write(`
|
|
10669
10795
|
${r.bold('Tein usage')}
|
|
10670
|
-
${
|
|
10796
|
+
${cr(a).join(`
|
|
10671
10797
|
`)}
|
|
10672
10798
|
|
|
10673
10799
|
`);
|
|
10674
10800
|
}
|
|
10675
|
-
function
|
|
10801
|
+
function ur(e) {
|
|
10676
10802
|
return e.data.length
|
|
10677
|
-
?
|
|
10803
|
+
? tt([
|
|
10678
10804
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
10679
10805
|
...e.data.map((t) => [
|
|
10680
10806
|
t.created_at.slice(0, 16).replace('T', ' '),
|
|
@@ -10685,10 +10811,10 @@ function dr(e) {
|
|
|
10685
10811
|
])
|
|
10686
10812
|
: [' No transactions yet.'];
|
|
10687
10813
|
}
|
|
10688
|
-
async function
|
|
10814
|
+
async function xi(e) {
|
|
10689
10815
|
let t = !!e.json,
|
|
10690
|
-
i =
|
|
10691
|
-
a = await
|
|
10816
|
+
i = yi(e),
|
|
10817
|
+
a = await ki(t, () => i.getTransactions(bi(e, ['limit', 'type', 'after'])));
|
|
10692
10818
|
if (t) {
|
|
10693
10819
|
process.stdout.write(
|
|
10694
10820
|
JSON.stringify(a, null, 2) +
|
|
@@ -10704,18 +10830,18 @@ async function bi(e) {
|
|
|
10704
10830
|
: '';
|
|
10705
10831
|
process.stdout.write(`
|
|
10706
10832
|
${r.bold('Tein balance history')}
|
|
10707
|
-
${
|
|
10833
|
+
${ur(a).join(`
|
|
10708
10834
|
`)}${n}
|
|
10709
10835
|
|
|
10710
10836
|
`);
|
|
10711
10837
|
}
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
var
|
|
10716
|
-
async function
|
|
10838
|
+
$();
|
|
10839
|
+
Se();
|
|
10840
|
+
ee();
|
|
10841
|
+
var mr = 3e3;
|
|
10842
|
+
async function _i(e) {
|
|
10717
10843
|
try {
|
|
10718
|
-
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
10844
|
+
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(mr) });
|
|
10719
10845
|
if (!t.ok) return;
|
|
10720
10846
|
let i = await t.json(),
|
|
10721
10847
|
a = {};
|
|
@@ -10723,18 +10849,18 @@ async function ki(e) {
|
|
|
10723
10849
|
let s = String(n.modelSlug ?? '');
|
|
10724
10850
|
J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
10725
10851
|
}
|
|
10726
|
-
|
|
10852
|
+
ni(a);
|
|
10727
10853
|
} catch {}
|
|
10728
10854
|
}
|
|
10729
|
-
var
|
|
10730
|
-
|
|
10731
|
-
async function
|
|
10732
|
-
await
|
|
10855
|
+
var fr = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
10856
|
+
gr = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
10857
|
+
async function Pi(e, t) {
|
|
10858
|
+
await _i(t);
|
|
10733
10859
|
let i = D();
|
|
10734
10860
|
if (e) {
|
|
10735
10861
|
let s = e.toLowerCase(),
|
|
10736
|
-
o =
|
|
10737
|
-
i =
|
|
10862
|
+
o = gr[s] ?? s;
|
|
10863
|
+
i = fr.has(o)
|
|
10738
10864
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
10739
10865
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
10740
10866
|
}
|
|
@@ -10772,8 +10898,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
10772
10898
|
|
|
10773
10899
|
`);
|
|
10774
10900
|
}
|
|
10775
|
-
async function
|
|
10776
|
-
J.has(e) && (await
|
|
10901
|
+
async function Ii(e, t) {
|
|
10902
|
+
J.has(e) && (await _i(t));
|
|
10777
10903
|
let i = H(e);
|
|
10778
10904
|
(i ||
|
|
10779
10905
|
(process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -10853,10 +10979,10 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
|
|
|
10853
10979
|
|
|
10854
10980
|
`);
|
|
10855
10981
|
}
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
var
|
|
10859
|
-
|
|
10982
|
+
$();
|
|
10983
|
+
it();
|
|
10984
|
+
var hr = 1e4,
|
|
10985
|
+
rt = {
|
|
10860
10986
|
price: '',
|
|
10861
10987
|
creativeMode: 'Creative mode',
|
|
10862
10988
|
priority: 'Priority',
|
|
@@ -10866,22 +10992,22 @@ var mr = 1e4,
|
|
|
10866
10992
|
priorityDraft: 'Priority + Draft',
|
|
10867
10993
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
10868
10994
|
},
|
|
10869
|
-
|
|
10870
|
-
|
|
10995
|
+
yr = Object.keys(rt),
|
|
10996
|
+
br = {
|
|
10871
10997
|
creativeMode: 'unfiltered',
|
|
10872
10998
|
creativeModePriority: 'unfilteredPriority',
|
|
10873
10999
|
creativeModeDraft: 'unfilteredDraft',
|
|
10874
11000
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
10875
11001
|
};
|
|
10876
|
-
function
|
|
10877
|
-
let i =
|
|
11002
|
+
function kr(e, t) {
|
|
11003
|
+
let i = br[t];
|
|
10878
11004
|
return e[t] ?? (i ? e[i] : void 0);
|
|
10879
11005
|
}
|
|
10880
|
-
async function
|
|
10881
|
-
let i = `${w(e)}${
|
|
11006
|
+
async function wr(e, t) {
|
|
11007
|
+
let i = `${w(e)}${we(t)}`,
|
|
10882
11008
|
a;
|
|
10883
11009
|
try {
|
|
10884
|
-
a = await fetch(i, { signal: AbortSignal.timeout(
|
|
11010
|
+
a = await fetch(i, { signal: AbortSignal.timeout(hr) });
|
|
10885
11011
|
} catch {
|
|
10886
11012
|
throw new Error(`Could not reach ${i}`);
|
|
10887
11013
|
}
|
|
@@ -10897,18 +11023,18 @@ async function yr(e, t) {
|
|
|
10897
11023
|
}
|
|
10898
11024
|
return n;
|
|
10899
11025
|
}
|
|
10900
|
-
function
|
|
11026
|
+
function at(e) {
|
|
10901
11027
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
10902
11028
|
[i, a = ''] = t.split('.');
|
|
10903
11029
|
return `$${i}.${a.padEnd(2, '0')}`;
|
|
10904
11030
|
}
|
|
10905
|
-
function
|
|
11031
|
+
function nt(e) {
|
|
10906
11032
|
if (!e || typeof e.starter != 'number') return null;
|
|
10907
11033
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
10908
11034
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
10909
|
-
return `Starter ${
|
|
11035
|
+
return `Starter ${at(e.starter)} Plus ${at(t)} Scale ${at(i)}`;
|
|
10910
11036
|
}
|
|
10911
|
-
function
|
|
11037
|
+
function xr(e) {
|
|
10912
11038
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
10913
11039
|
let t = [];
|
|
10914
11040
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -10920,33 +11046,33 @@ function br(e) {
|
|
|
10920
11046
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
10921
11047
|
);
|
|
10922
11048
|
}
|
|
10923
|
-
function
|
|
10924
|
-
let i =
|
|
10925
|
-
for (let a of
|
|
10926
|
-
let n =
|
|
11049
|
+
function _r(e, t) {
|
|
11050
|
+
let i = xr(e);
|
|
11051
|
+
for (let a of yr) {
|
|
11052
|
+
let n = nt(kr(e, a));
|
|
10927
11053
|
if (!n) continue;
|
|
10928
|
-
let s =
|
|
11054
|
+
let s = rt[a] ? ` (${rt[a]})` : '';
|
|
10929
11055
|
t.push(` ${i}${s} ${n}`);
|
|
10930
11056
|
}
|
|
10931
11057
|
}
|
|
10932
|
-
function
|
|
11058
|
+
function Pr(e, t) {
|
|
10933
11059
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
10934
11060
|
t.push(
|
|
10935
11061
|
` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
10936
11062
|
);
|
|
10937
|
-
for (let n of e.variants ?? [])
|
|
11063
|
+
for (let n of e.variants ?? []) _r(n, t);
|
|
10938
11064
|
let a = e.addons;
|
|
10939
11065
|
if (Array.isArray(a))
|
|
10940
11066
|
for (let n of a) {
|
|
10941
11067
|
if (!n || typeof n != 'object') continue;
|
|
10942
11068
|
let s = n,
|
|
10943
11069
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
10944
|
-
u =
|
|
11070
|
+
u = nt(s.price);
|
|
10945
11071
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
10946
11072
|
}
|
|
10947
11073
|
t.push('');
|
|
10948
11074
|
}
|
|
10949
|
-
function
|
|
11075
|
+
function Ir(e) {
|
|
10950
11076
|
let t = [],
|
|
10951
11077
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
10952
11078
|
(t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -10968,7 +11094,7 @@ function xr(e) {
|
|
|
10968
11094
|
});
|
|
10969
11095
|
for (let l of s) {
|
|
10970
11096
|
t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
10971
|
-
for (let c of a.get(l) ?? [])
|
|
11097
|
+
for (let c of a.get(l) ?? []) Pr(c, t);
|
|
10972
11098
|
}
|
|
10973
11099
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
10974
11100
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -10985,7 +11111,7 @@ function xr(e) {
|
|
|
10985
11111
|
t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
|
|
10986
11112
|
for (let m of d) {
|
|
10987
11113
|
let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
10988
|
-
f =
|
|
11114
|
+
f = nt(m.prices);
|
|
10989
11115
|
f && t.push(` ${y} ${f}`);
|
|
10990
11116
|
}
|
|
10991
11117
|
t.push('');
|
|
@@ -10998,10 +11124,10 @@ function xr(e) {
|
|
|
10998
11124
|
`
|
|
10999
11125
|
);
|
|
11000
11126
|
}
|
|
11001
|
-
async function
|
|
11127
|
+
async function vi(e) {
|
|
11002
11128
|
let t;
|
|
11003
11129
|
try {
|
|
11004
|
-
t = await
|
|
11130
|
+
t = await wr(e.apiUrl, e.model);
|
|
11005
11131
|
} catch (i) {
|
|
11006
11132
|
let a = i instanceof Error ? i.message : String(i);
|
|
11007
11133
|
(process.stderr.write(`${r.red('Error:')} ${a}
|
|
@@ -11012,12 +11138,12 @@ async function _i(e) {
|
|
|
11012
11138
|
e.json
|
|
11013
11139
|
? `${JSON.stringify(t, null, 2)}
|
|
11014
11140
|
`
|
|
11015
|
-
:
|
|
11141
|
+
: Ir(t),
|
|
11016
11142
|
);
|
|
11017
11143
|
}
|
|
11018
|
-
var
|
|
11019
|
-
|
|
11020
|
-
async function
|
|
11144
|
+
var Ti = T(require('node:path'));
|
|
11145
|
+
$();
|
|
11146
|
+
async function Mi(e, t) {
|
|
11021
11147
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11022
11148
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
11023
11149
|
(i ||
|
|
@@ -11037,7 +11163,7 @@ async function Ii(e, t) {
|
|
|
11037
11163
|
s = !!t.wait,
|
|
11038
11164
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
11039
11165
|
u = new M(i, a),
|
|
11040
|
-
l = new
|
|
11166
|
+
l = new C(`Checking status of ${r.bold(e)}...`);
|
|
11041
11167
|
n || l.start();
|
|
11042
11168
|
let c;
|
|
11043
11169
|
try {
|
|
@@ -11110,9 +11236,9 @@ ${r.bold('Outputs:')}
|
|
|
11110
11236
|
`),
|
|
11111
11237
|
o)
|
|
11112
11238
|
) {
|
|
11113
|
-
let p = new
|
|
11239
|
+
let p = new C(`Downloading output to ${o}...`).start();
|
|
11114
11240
|
try {
|
|
11115
|
-
(await u.downloadOutput(d.url,
|
|
11241
|
+
(await u.downloadOutput(d.url, Ti.default.resolve(process.cwd(), o)),
|
|
11116
11242
|
p.succeed(`Saved to ${r.bold(o)}`));
|
|
11117
11243
|
} catch (m) {
|
|
11118
11244
|
p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -11127,10 +11253,10 @@ ${d.text}
|
|
|
11127
11253
|
process.stdout.write(`
|
|
11128
11254
|
`);
|
|
11129
11255
|
}
|
|
11130
|
-
var
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
async function
|
|
11256
|
+
var st = T(require('node:fs')),
|
|
11257
|
+
ot = T(require('node:path'));
|
|
11258
|
+
$();
|
|
11259
|
+
async function Ki(e, t = {}) {
|
|
11134
11260
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11135
11261
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
11136
11262
|
n = !!t.json;
|
|
@@ -11147,15 +11273,15 @@ async function vi(e, t = {}) {
|
|
|
11147
11273
|
process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
|
|
11148
11274
|
`),
|
|
11149
11275
|
process.exit(1)));
|
|
11150
|
-
let s =
|
|
11151
|
-
|
|
11276
|
+
let s = ot.default.resolve(e);
|
|
11277
|
+
st.default.existsSync(s) ||
|
|
11152
11278
|
(process.stderr.write(`${r.red('Error:')} File not found: ${s}
|
|
11153
11279
|
`),
|
|
11154
11280
|
process.exit(1));
|
|
11155
|
-
let o =
|
|
11156
|
-
l =
|
|
11281
|
+
let o = ot.default.basename(s),
|
|
11282
|
+
l = st.default.readFileSync(s).toString('base64'),
|
|
11157
11283
|
c = new M(i, a),
|
|
11158
|
-
d = new
|
|
11284
|
+
d = new C(`Uploading ${r.bold(o)} to Tein AI CDN...`);
|
|
11159
11285
|
n || d.start();
|
|
11160
11286
|
try {
|
|
11161
11287
|
let p = await c.uploadAsset(l);
|
|
@@ -11194,10 +11320,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
|
|
|
11194
11320
|
process.exit(m ? m.exitCode : v));
|
|
11195
11321
|
}
|
|
11196
11322
|
}
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
function
|
|
11323
|
+
re();
|
|
11324
|
+
ee();
|
|
11325
|
+
Le();
|
|
11326
|
+
function Gi() {
|
|
11201
11327
|
process.stdout.write(`
|
|
11202
11328
|
${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
11203
11329
|
|
|
@@ -11279,11 +11405,11 @@ ${r.bold('EXAMPLES:')}
|
|
|
11279
11405
|
|
|
11280
11406
|
`);
|
|
11281
11407
|
}
|
|
11282
|
-
async function
|
|
11408
|
+
async function Gr() {
|
|
11283
11409
|
let e = process.argv.slice(2),
|
|
11284
|
-
t =
|
|
11410
|
+
t = mi(e);
|
|
11285
11411
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
11286
|
-
|
|
11412
|
+
Gi();
|
|
11287
11413
|
return;
|
|
11288
11414
|
}
|
|
11289
11415
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -11293,31 +11419,31 @@ async function Fr() {
|
|
|
11293
11419
|
}
|
|
11294
11420
|
switch (t.command) {
|
|
11295
11421
|
case 'auth': {
|
|
11296
|
-
await
|
|
11422
|
+
await ie(t.subcommand, t.options.key);
|
|
11297
11423
|
break;
|
|
11298
11424
|
}
|
|
11299
11425
|
case 'login': {
|
|
11300
|
-
await
|
|
11426
|
+
await ie('login', t.options.key);
|
|
11301
11427
|
break;
|
|
11302
11428
|
}
|
|
11303
11429
|
case 'logout': {
|
|
11304
|
-
await
|
|
11430
|
+
await ie('logout');
|
|
11305
11431
|
break;
|
|
11306
11432
|
}
|
|
11307
11433
|
case 'whoami': {
|
|
11308
|
-
await
|
|
11434
|
+
await ie('status');
|
|
11309
11435
|
break;
|
|
11310
11436
|
}
|
|
11311
11437
|
case 'models':
|
|
11312
11438
|
case 'list': {
|
|
11313
|
-
await
|
|
11439
|
+
await Pi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
11314
11440
|
break;
|
|
11315
11441
|
}
|
|
11316
11442
|
case 'pricing':
|
|
11317
11443
|
case 'prices': {
|
|
11318
11444
|
let i = t.options.model,
|
|
11319
11445
|
a = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
11320
|
-
await
|
|
11446
|
+
await vi({
|
|
11321
11447
|
model: a,
|
|
11322
11448
|
json: !!t.options.json,
|
|
11323
11449
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -11332,61 +11458,61 @@ async function Fr() {
|
|
|
11332
11458
|
process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
|
|
11333
11459
|
`),
|
|
11334
11460
|
process.exit(1)),
|
|
11335
|
-
await
|
|
11461
|
+
await Ii(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
11336
11462
|
break;
|
|
11337
11463
|
}
|
|
11338
11464
|
case 'upload': {
|
|
11339
11465
|
let i = t.subcommand || '';
|
|
11340
|
-
await
|
|
11466
|
+
await Ki(i, t.options);
|
|
11341
11467
|
break;
|
|
11342
11468
|
}
|
|
11343
11469
|
case 'run':
|
|
11344
11470
|
case 'generate': {
|
|
11345
11471
|
let i = t.subcommand || '';
|
|
11346
|
-
await
|
|
11472
|
+
await et(i, t.options);
|
|
11347
11473
|
break;
|
|
11348
11474
|
}
|
|
11349
11475
|
case 'status': {
|
|
11350
11476
|
let i = t.subcommand || '';
|
|
11351
|
-
await
|
|
11477
|
+
await Mi(i, t.options);
|
|
11352
11478
|
break;
|
|
11353
11479
|
}
|
|
11354
11480
|
case 'balance': {
|
|
11355
|
-
await
|
|
11481
|
+
await hi(t.options);
|
|
11356
11482
|
break;
|
|
11357
11483
|
}
|
|
11358
11484
|
case 'usage': {
|
|
11359
|
-
await
|
|
11485
|
+
await wi(t.options);
|
|
11360
11486
|
break;
|
|
11361
11487
|
}
|
|
11362
11488
|
case 'transactions':
|
|
11363
11489
|
case 'history': {
|
|
11364
|
-
await
|
|
11490
|
+
await xi(t.options);
|
|
11365
11491
|
break;
|
|
11366
11492
|
}
|
|
11367
11493
|
case 'mcp': {
|
|
11368
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
11494
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (ji(), Bi));
|
|
11369
11495
|
await i();
|
|
11370
11496
|
break;
|
|
11371
11497
|
}
|
|
11372
11498
|
default: {
|
|
11373
11499
|
if (t.command && !t.command.startsWith('-')) {
|
|
11374
11500
|
(!H(t.command) &&
|
|
11375
|
-
!
|
|
11501
|
+
!me[t.command] &&
|
|
11376
11502
|
(process.stderr.write(`
|
|
11377
11503
|
${r.red('Error:')} Unknown command or model "${t.command}".
|
|
11378
11504
|
Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
|
|
11379
11505
|
`),
|
|
11380
11506
|
process.exit(v)),
|
|
11381
|
-
await
|
|
11507
|
+
await et(t.command, t.options));
|
|
11382
11508
|
return;
|
|
11383
11509
|
}
|
|
11384
|
-
|
|
11510
|
+
Gi();
|
|
11385
11511
|
break;
|
|
11386
11512
|
}
|
|
11387
11513
|
}
|
|
11388
11514
|
}
|
|
11389
|
-
|
|
11515
|
+
Gr().catch((e) => {
|
|
11390
11516
|
(e instanceof b &&
|
|
11391
11517
|
(process.stderr.write(`
|
|
11392
11518
|
${r.red('Error:')} ${K(e).join(`
|