@teinai/cli 1.1.36 → 1.1.38
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 +743 -624
- 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
|
|
3
|
+
var Bi = Object.create;
|
|
4
4
|
var ve = Object.defineProperty;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
5
|
+
var ji = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var Gi = Object.getOwnPropertyNames;
|
|
7
|
+
var Hi = Object.getPrototypeOf,
|
|
8
|
+
zi = 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
|
|
17
|
+
var Ji = (e, t) => {
|
|
18
18
|
for (var i in t) ve(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
Wi = (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 Gi(t))
|
|
23
|
+
!zi.call(e, n) &&
|
|
24
24
|
n !== i &&
|
|
25
|
-
ve(e, n, { get: () => t[n], enumerable: !(a =
|
|
25
|
+
ve(e, n, { get: () => t[n], enumerable: !(a = ji(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 ? Bi(Hi(e)) : {}),
|
|
30
|
+
Wi(t || !e || !e.__esModule ? ve(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function Qi(e) {
|
|
33
33
|
for (let t of e)
|
|
34
34
|
try {
|
|
35
|
-
let i = JSON.parse(
|
|
35
|
+
let i = JSON.parse(ct.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 Xi;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Zi() {
|
|
42
42
|
let e = typeof __dirname == 'string' ? __dirname : process.cwd();
|
|
43
43
|
return [
|
|
44
44
|
Te.default.join(e, 'package.json'),
|
|
45
45
|
Te.default.join(e, '..', '..', 'cli-package', 'package.json'),
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var ct,
|
|
49
49
|
Te,
|
|
50
|
-
|
|
50
|
+
Xi,
|
|
51
51
|
F,
|
|
52
|
-
|
|
52
|
+
ne = h(() => {
|
|
53
53
|
'use strict';
|
|
54
|
-
((
|
|
55
|
-
F =
|
|
54
|
+
((ct = T(require('node:fs'))), (Te = T(require('node:path'))), (Xi = '0.0.0-dev'));
|
|
55
|
+
F = Qi(Zi());
|
|
56
56
|
});
|
|
57
57
|
function j() {
|
|
58
58
|
try {
|
|
@@ -65,10 +65,10 @@ function j() {
|
|
|
65
65
|
}
|
|
66
66
|
function Ke(e) {
|
|
67
67
|
try {
|
|
68
|
-
R.default.existsSync(
|
|
68
|
+
R.default.existsSync(oe) || R.default.mkdirSync(oe, { 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(oe, 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,30 +88,30 @@ 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 le() {
|
|
92
92
|
return B;
|
|
93
93
|
}
|
|
94
94
|
var R,
|
|
95
|
-
|
|
95
|
+
ht,
|
|
96
96
|
Me,
|
|
97
|
-
|
|
97
|
+
oe,
|
|
98
98
|
B,
|
|
99
99
|
E = h(() => {
|
|
100
100
|
'use strict';
|
|
101
101
|
((R = T(require('node:fs'))),
|
|
102
|
-
(
|
|
102
|
+
(ht = T(require('node:os'))),
|
|
103
103
|
(Me = T(require('node:path'))),
|
|
104
|
-
(
|
|
105
|
-
(B = Me.default.join(
|
|
104
|
+
(oe = Me.default.join(ht.default.homedir(), '.tein')),
|
|
105
|
+
(B = Me.default.join(oe, 'config.json')));
|
|
106
106
|
});
|
|
107
|
-
var
|
|
108
|
-
ht,
|
|
107
|
+
var ra,
|
|
109
108
|
yt,
|
|
110
|
-
bt
|
|
109
|
+
bt,
|
|
110
|
+
kt = h(() => {
|
|
111
111
|
'use strict';
|
|
112
|
-
((
|
|
113
|
-
(
|
|
114
|
-
(
|
|
112
|
+
((ra = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4', '4:5', '5:4']),
|
|
113
|
+
(yt = [...ra, 'auto']),
|
|
114
|
+
(bt =
|
|
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,
|
|
@@ -119,14 +119,14 @@ var J,
|
|
|
119
119
|
'use strict';
|
|
120
120
|
J = new Set([]);
|
|
121
121
|
});
|
|
122
|
-
function
|
|
122
|
+
function W(e) {
|
|
123
123
|
return !1;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
125
|
+
var wt = h(() => {
|
|
126
126
|
'use strict';
|
|
127
127
|
});
|
|
128
128
|
var de,
|
|
129
|
-
|
|
129
|
+
xt = h(() => {
|
|
130
130
|
'use strict';
|
|
131
131
|
de = {
|
|
132
132
|
source: 'TEIN Price Board',
|
|
@@ -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,8 +6240,13 @@ var de,
|
|
|
6198
6240
|
],
|
|
6199
6241
|
};
|
|
6200
6242
|
});
|
|
6243
|
+
var _t,
|
|
6244
|
+
Pt = h(() => {
|
|
6245
|
+
'use strict';
|
|
6246
|
+
_t = [];
|
|
6247
|
+
});
|
|
6201
6248
|
var pe,
|
|
6202
|
-
|
|
6249
|
+
It,
|
|
6203
6250
|
$e = h(() => {
|
|
6204
6251
|
'use strict';
|
|
6205
6252
|
((pe = [
|
|
@@ -6277,12 +6324,12 @@ var pe,
|
|
|
6277
6324
|
from: { variant: 'swap' },
|
|
6278
6325
|
},
|
|
6279
6326
|
]),
|
|
6280
|
-
(
|
|
6327
|
+
(It = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
6281
6328
|
});
|
|
6282
|
-
function
|
|
6329
|
+
function Oe(e, t) {
|
|
6283
6330
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
6284
6331
|
}
|
|
6285
|
-
function
|
|
6332
|
+
function oa(e, t) {
|
|
6286
6333
|
if (e === 'seedance-2-mini') return 'mini';
|
|
6287
6334
|
if (e !== 'seedance-2') return;
|
|
6288
6335
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -6292,91 +6339,98 @@ function ra(e, t) {
|
|
|
6292
6339
|
? 'fast'
|
|
6293
6340
|
: 'standard';
|
|
6294
6341
|
}
|
|
6295
|
-
function
|
|
6342
|
+
function la(e, t) {
|
|
6296
6343
|
let i = e
|
|
6297
6344
|
.trim()
|
|
6298
6345
|
.toLowerCase()
|
|
6299
6346
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
6300
6347
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
6301
|
-
let n =
|
|
6302
|
-
s = Ee.get(
|
|
6348
|
+
let n = oa(i, t),
|
|
6349
|
+
s = Ee.get(Oe('seedance-2', n));
|
|
6303
6350
|
return s ? s.slug : null;
|
|
6304
6351
|
}
|
|
6305
|
-
let a = ce.get(i) ?? Ee.get(
|
|
6352
|
+
let a = ce.get(i) ?? Ee.get(Oe(i));
|
|
6306
6353
|
return a ? a.slug : null;
|
|
6307
6354
|
}
|
|
6308
|
-
function
|
|
6309
|
-
return ce.has(e) && !(
|
|
6355
|
+
function pa(e, t) {
|
|
6356
|
+
return ce.has(e) && !(da.has(e) && t) ? e : la(e, t);
|
|
6310
6357
|
}
|
|
6311
|
-
function
|
|
6312
|
-
let i =
|
|
6358
|
+
function Y(e, t) {
|
|
6359
|
+
let i = pa(e, t);
|
|
6313
6360
|
return i ? (ce.get(i) ?? null) : null;
|
|
6314
6361
|
}
|
|
6315
6362
|
function ue() {
|
|
6316
|
-
return
|
|
6363
|
+
return Kt;
|
|
6317
6364
|
}
|
|
6318
|
-
var
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6365
|
+
var qe,
|
|
6366
|
+
Tt,
|
|
6367
|
+
Mt,
|
|
6368
|
+
Kt,
|
|
6369
|
+
na,
|
|
6322
6370
|
ce,
|
|
6323
6371
|
Ee,
|
|
6324
|
-
|
|
6325
|
-
aa,
|
|
6326
|
-
Ae,
|
|
6372
|
+
vt,
|
|
6327
6373
|
sa,
|
|
6374
|
+
Ae,
|
|
6375
|
+
da,
|
|
6328
6376
|
G = h(() => {
|
|
6329
6377
|
'use strict';
|
|
6330
|
-
kt();
|
|
6331
6378
|
wt();
|
|
6379
|
+
xt();
|
|
6380
|
+
Pt();
|
|
6332
6381
|
$e();
|
|
6333
|
-
((
|
|
6382
|
+
((qe = {
|
|
6334
6383
|
...de,
|
|
6335
|
-
families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !
|
|
6336
|
-
models: de.models.filter((e) => !
|
|
6384
|
+
families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
|
|
6385
|
+
models: de.models.filter((e) => !W(e.slug)),
|
|
6337
6386
|
}),
|
|
6338
|
-
(
|
|
6339
|
-
(
|
|
6340
|
-
(
|
|
6341
|
-
|
|
6342
|
-
...
|
|
6343
|
-
|
|
6344
|
-
.
|
|
6387
|
+
(Tt = pe.filter((e) => !W(e.slug))),
|
|
6388
|
+
(Mt = _t.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
|
|
6389
|
+
(Kt = [...qe.models, ...Mt, ...Tt]),
|
|
6390
|
+
(na = [
|
|
6391
|
+
...qe.families.map((e) => {
|
|
6392
|
+
let t = Mt.filter((i) => i.family === e.slug).map((i) => i.slug);
|
|
6393
|
+
return t.length ? { ...e, models: [...e.models, ...t] } : e;
|
|
6394
|
+
}),
|
|
6395
|
+
...It.map((e) => ({
|
|
6396
|
+
...e,
|
|
6397
|
+
models: Tt.filter((t) => t.family === e.slug).map((t) => t.slug),
|
|
6398
|
+
})).filter((e) => e.models.length > 0),
|
|
6345
6399
|
]),
|
|
6346
6400
|
(ce = new Map()),
|
|
6347
6401
|
(Ee = new Map()),
|
|
6348
|
-
(
|
|
6349
|
-
(
|
|
6402
|
+
(vt = new Map()),
|
|
6403
|
+
(sa = new Map()),
|
|
6350
6404
|
(Ae = new Map()));
|
|
6351
|
-
for (let e of
|
|
6352
|
-
(ce.set(e.slug, e), Ee.set(
|
|
6353
|
-
for (let t of e.variants)
|
|
6405
|
+
for (let e of Kt) {
|
|
6406
|
+
(ce.set(e.slug, e), Ee.set(Oe(e.api.model, e.api.quality), e));
|
|
6407
|
+
for (let t of e.variants) vt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
6354
6408
|
for (let t of e.editVariants ?? [])
|
|
6355
|
-
|
|
6356
|
-
for (let t of e.addons ?? [])
|
|
6409
|
+
vt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6410
|
+
for (let t of e.addons ?? []) sa.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6357
6411
|
Ae.set(e.slug, e.family);
|
|
6358
6412
|
}
|
|
6359
|
-
for (let e of
|
|
6360
|
-
|
|
6413
|
+
for (let e of na) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
|
|
6414
|
+
da = new Set(['seedance-2']);
|
|
6361
6415
|
});
|
|
6362
6416
|
function me(e) {
|
|
6363
6417
|
let t = e.from?.variant;
|
|
6364
6418
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
6365
6419
|
}
|
|
6366
|
-
function
|
|
6420
|
+
function Re(e) {
|
|
6367
6421
|
if (e.endpoints?.length)
|
|
6368
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6369
|
-
?
|
|
6422
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === St)
|
|
6423
|
+
? St
|
|
6370
6424
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6371
6425
|
}
|
|
6372
|
-
var
|
|
6373
|
-
|
|
6426
|
+
var St,
|
|
6427
|
+
Le = h(() => {
|
|
6374
6428
|
'use strict';
|
|
6375
6429
|
G();
|
|
6376
|
-
|
|
6430
|
+
St = 'dynamic';
|
|
6377
6431
|
});
|
|
6378
6432
|
var fe,
|
|
6379
|
-
|
|
6433
|
+
De = h(() => {
|
|
6380
6434
|
'use strict';
|
|
6381
6435
|
fe = {
|
|
6382
6436
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -6388,29 +6442,29 @@ var fe,
|
|
|
6388
6442
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
6389
6443
|
};
|
|
6390
6444
|
});
|
|
6391
|
-
var
|
|
6445
|
+
var Ct = h(() => {
|
|
6392
6446
|
'use strict';
|
|
6393
6447
|
});
|
|
6394
|
-
function
|
|
6395
|
-
return typeof t == 'string' && (
|
|
6448
|
+
function $t(e, t) {
|
|
6449
|
+
return typeof t == 'string' && (ca[e]?.includes(t) ?? !1);
|
|
6396
6450
|
}
|
|
6397
|
-
var
|
|
6398
|
-
|
|
6451
|
+
var ca,
|
|
6452
|
+
Et = h(() => {
|
|
6399
6453
|
'use strict';
|
|
6400
6454
|
G();
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6455
|
+
Le();
|
|
6456
|
+
Ct();
|
|
6457
|
+
ca = {};
|
|
6404
6458
|
});
|
|
6405
|
-
function
|
|
6406
|
-
return e === 'nano-banana-pro' ?
|
|
6459
|
+
function At(e) {
|
|
6460
|
+
return e === 'nano-banana-pro' ? ua : ma;
|
|
6407
6461
|
}
|
|
6408
|
-
var
|
|
6409
|
-
|
|
6410
|
-
|
|
6462
|
+
var ua,
|
|
6463
|
+
ma,
|
|
6464
|
+
Ot = h(() => {
|
|
6411
6465
|
'use strict';
|
|
6412
|
-
((
|
|
6413
|
-
(
|
|
6466
|
+
((ua = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6467
|
+
(ma = [
|
|
6414
6468
|
'auto',
|
|
6415
6469
|
'1:1',
|
|
6416
6470
|
'1:4',
|
|
@@ -6428,10 +6482,10 @@ var da,
|
|
|
6428
6482
|
'21:9',
|
|
6429
6483
|
]));
|
|
6430
6484
|
});
|
|
6431
|
-
var
|
|
6432
|
-
|
|
6485
|
+
var qt,
|
|
6486
|
+
Rt = h(() => {
|
|
6433
6487
|
'use strict';
|
|
6434
|
-
|
|
6488
|
+
qt = [
|
|
6435
6489
|
'prompt',
|
|
6436
6490
|
'system',
|
|
6437
6491
|
'messages',
|
|
@@ -6445,10 +6499,10 @@ var Et,
|
|
|
6445
6499
|
'endpoint',
|
|
6446
6500
|
];
|
|
6447
6501
|
});
|
|
6448
|
-
var
|
|
6449
|
-
|
|
6502
|
+
var Lt,
|
|
6503
|
+
Dt = h(() => {
|
|
6450
6504
|
'use strict';
|
|
6451
|
-
|
|
6505
|
+
Lt = [
|
|
6452
6506
|
{
|
|
6453
6507
|
slug: 'claude-fable-5-1',
|
|
6454
6508
|
family: 'fable-5-1',
|
|
@@ -6517,13 +6571,13 @@ var qt,
|
|
|
6517
6571
|
},
|
|
6518
6572
|
];
|
|
6519
6573
|
});
|
|
6520
|
-
function
|
|
6574
|
+
function Vt(e) {
|
|
6521
6575
|
return `$${e}`;
|
|
6522
6576
|
}
|
|
6523
|
-
function
|
|
6524
|
-
return
|
|
6577
|
+
function Ve(e, t, i) {
|
|
6578
|
+
return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
6525
6579
|
}
|
|
6526
|
-
function
|
|
6580
|
+
function fa(e) {
|
|
6527
6581
|
return [
|
|
6528
6582
|
{
|
|
6529
6583
|
name: 'prompt',
|
|
@@ -6589,13 +6643,13 @@ function ca(e) {
|
|
|
6589
6643
|
},
|
|
6590
6644
|
];
|
|
6591
6645
|
}
|
|
6592
|
-
function
|
|
6646
|
+
function Nt() {
|
|
6593
6647
|
return Object.fromEntries(
|
|
6594
|
-
|
|
6595
|
-
let t =
|
|
6596
|
-
i =
|
|
6597
|
-
a =
|
|
6598
|
-
n = t != null && i != null ? `${
|
|
6648
|
+
Lt.map((e) => {
|
|
6649
|
+
let t = Ve(e.slug, 'cheap', 'input'),
|
|
6650
|
+
i = Ve(e.slug, 'cheap', 'output'),
|
|
6651
|
+
a = Ve(e.slug, 'stable', 'input') != null,
|
|
6652
|
+
n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
|
|
6599
6653
|
s = {
|
|
6600
6654
|
slug: e.slug,
|
|
6601
6655
|
name: e.name,
|
|
@@ -6606,50 +6660,50 @@ function Lt() {
|
|
|
6606
6660
|
priceFormatted: n,
|
|
6607
6661
|
unit: '/M tokens',
|
|
6608
6662
|
primaryToolName: 'run_task',
|
|
6609
|
-
parameters:
|
|
6663
|
+
parameters: fa(a),
|
|
6610
6664
|
};
|
|
6611
6665
|
return [e.slug, s];
|
|
6612
6666
|
}),
|
|
6613
6667
|
);
|
|
6614
6668
|
}
|
|
6615
|
-
var
|
|
6669
|
+
var Ut = h(() => {
|
|
6616
6670
|
'use strict';
|
|
6617
|
-
|
|
6671
|
+
Dt();
|
|
6618
6672
|
G();
|
|
6619
6673
|
});
|
|
6620
6674
|
function ge(e) {
|
|
6621
|
-
return e ?
|
|
6675
|
+
return e ? ha.get(e) : void 0;
|
|
6622
6676
|
}
|
|
6623
|
-
function
|
|
6677
|
+
function Gt(e, t) {
|
|
6624
6678
|
return !e.aspects?.length || e.sourceFramedModes?.includes(t)
|
|
6625
6679
|
? null
|
|
6626
6680
|
: e.adaptiveModes?.includes(t)
|
|
6627
6681
|
? [...e.aspects, 'adaptive']
|
|
6628
6682
|
: [...e.aspects];
|
|
6629
6683
|
}
|
|
6630
|
-
function
|
|
6684
|
+
function Ht(e, t, i) {
|
|
6631
6685
|
return e.modes.includes('motion_control')
|
|
6632
6686
|
? t === 'motion_control'
|
|
6633
|
-
? !
|
|
6634
|
-
: !
|
|
6687
|
+
? !ba.includes(i)
|
|
6688
|
+
: !ya.includes(i)
|
|
6635
6689
|
: !0;
|
|
6636
6690
|
}
|
|
6637
|
-
var
|
|
6638
|
-
ua,
|
|
6639
|
-
Nt,
|
|
6640
|
-
kn,
|
|
6641
|
-
ma,
|
|
6642
|
-
Ut,
|
|
6643
|
-
Ve,
|
|
6644
|
-
wn,
|
|
6645
|
-
Ne,
|
|
6646
|
-
fa,
|
|
6691
|
+
var Ft,
|
|
6647
6692
|
ga,
|
|
6648
|
-
|
|
6693
|
+
Bt,
|
|
6694
|
+
In,
|
|
6695
|
+
ha,
|
|
6696
|
+
jt,
|
|
6697
|
+
Ne,
|
|
6698
|
+
vn,
|
|
6699
|
+
Ue,
|
|
6700
|
+
ya,
|
|
6701
|
+
ba,
|
|
6702
|
+
Fe = h(() => {
|
|
6649
6703
|
'use strict';
|
|
6650
|
-
((
|
|
6651
|
-
(
|
|
6652
|
-
(
|
|
6704
|
+
((Ft = ['16:9', '9:16', '1:1', '21:9']),
|
|
6705
|
+
(ga = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
|
|
6706
|
+
(Bt = [
|
|
6653
6707
|
{
|
|
6654
6708
|
slug: 'kling-v4',
|
|
6655
6709
|
kind: 'video',
|
|
@@ -6657,7 +6711,7 @@ var Vt,
|
|
|
6657
6711
|
promptMax: 26e3,
|
|
6658
6712
|
duration: { min: 3, max: 30, default: 5 },
|
|
6659
6713
|
heights: { '720p': 720, '1080p': 1080 },
|
|
6660
|
-
aspects:
|
|
6714
|
+
aspects: Ft,
|
|
6661
6715
|
sourceFramedModes: ['image_to_video'],
|
|
6662
6716
|
adaptiveModes: ['multi_reference'],
|
|
6663
6717
|
fps: 24,
|
|
@@ -6681,7 +6735,7 @@ var Vt,
|
|
|
6681
6735
|
promptMax: 26e3,
|
|
6682
6736
|
duration: { min: 3, max: 20, default: 5 },
|
|
6683
6737
|
heights: { '720p': 720 },
|
|
6684
|
-
aspects: [...
|
|
6738
|
+
aspects: [...Ft, '4:3', '3:4'],
|
|
6685
6739
|
sourceFramedModes: ['image_to_video'],
|
|
6686
6740
|
adaptiveModes: ['multi_reference'],
|
|
6687
6741
|
fps: 24,
|
|
@@ -6721,7 +6775,7 @@ var Vt,
|
|
|
6721
6775
|
promptMax: 65535,
|
|
6722
6776
|
duration: { min: 5, max: 15, default: 5 },
|
|
6723
6777
|
heights: { '480p': 480, '768p': 768 },
|
|
6724
|
-
aspects:
|
|
6778
|
+
aspects: ga,
|
|
6725
6779
|
fps: 24,
|
|
6726
6780
|
audio: 'free',
|
|
6727
6781
|
seed: !0,
|
|
@@ -6796,10 +6850,10 @@ var Vt,
|
|
|
6796
6850
|
seed: !0,
|
|
6797
6851
|
},
|
|
6798
6852
|
]),
|
|
6799
|
-
(
|
|
6800
|
-
(
|
|
6801
|
-
((
|
|
6802
|
-
(
|
|
6853
|
+
(In = Bt.map((e) => e.slug)),
|
|
6854
|
+
(ha = new Map(Bt.map((e) => [e.slug, e]))));
|
|
6855
|
+
((jt = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6856
|
+
(Ne = {
|
|
6803
6857
|
hpp4J3VqNfWAUOO0d1Us: 'Bella',
|
|
6804
6858
|
CwhRBWXzGAHq8TQ4Fs17: 'Roger',
|
|
6805
6859
|
EXAVITQu4vr4xnSDxMaL: 'Sarah',
|
|
@@ -6821,8 +6875,8 @@ var Vt,
|
|
|
6821
6875
|
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
6822
6876
|
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
6823
6877
|
}),
|
|
6824
|
-
(
|
|
6825
|
-
(
|
|
6878
|
+
(vn = Object.keys(Ne)),
|
|
6879
|
+
(Ue = [
|
|
6826
6880
|
'mp3_44100_128',
|
|
6827
6881
|
'mp3_22050_32',
|
|
6828
6882
|
'mp3_24000_48',
|
|
@@ -6836,8 +6890,8 @@ var Vt,
|
|
|
6836
6890
|
'opus_48000_128',
|
|
6837
6891
|
'opus_48000_192',
|
|
6838
6892
|
]));
|
|
6839
|
-
((
|
|
6840
|
-
(
|
|
6893
|
+
((ya = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
6894
|
+
(ba = [
|
|
6841
6895
|
'duration',
|
|
6842
6896
|
'aspect_ratio',
|
|
6843
6897
|
'generate_audio',
|
|
@@ -6849,7 +6903,7 @@ var Vt,
|
|
|
6849
6903
|
'audios',
|
|
6850
6904
|
]));
|
|
6851
6905
|
});
|
|
6852
|
-
function
|
|
6906
|
+
function wa() {
|
|
6853
6907
|
return [
|
|
6854
6908
|
{
|
|
6855
6909
|
name: 'image_url',
|
|
@@ -6877,7 +6931,7 @@ function ya() {
|
|
|
6877
6931
|
},
|
|
6878
6932
|
];
|
|
6879
6933
|
}
|
|
6880
|
-
function
|
|
6934
|
+
function xa(e) {
|
|
6881
6935
|
let t = e.duration,
|
|
6882
6936
|
i = Object.keys(e.heights),
|
|
6883
6937
|
a = e.sourceFramedModes?.length
|
|
@@ -6970,7 +7024,7 @@ function ba(e) {
|
|
|
6970
7024
|
}
|
|
6971
7025
|
return o;
|
|
6972
7026
|
}
|
|
6973
|
-
function
|
|
7027
|
+
function _a(e) {
|
|
6974
7028
|
let t = Object.keys(e.sizes);
|
|
6975
7029
|
return [
|
|
6976
7030
|
{
|
|
@@ -6987,13 +7041,13 @@ function ka(e) {
|
|
|
6987
7041
|
},
|
|
6988
7042
|
];
|
|
6989
7043
|
}
|
|
6990
|
-
function
|
|
7044
|
+
function Ia() {
|
|
6991
7045
|
return [
|
|
6992
7046
|
{
|
|
6993
7047
|
name: 'voice_id',
|
|
6994
7048
|
type: 'string',
|
|
6995
|
-
default:
|
|
6996
|
-
description: `text_to_speech: the ElevenLabs voice id, one of: ${
|
|
7049
|
+
default: jt,
|
|
7050
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${Pa}.`,
|
|
6997
7051
|
},
|
|
6998
7052
|
{
|
|
6999
7053
|
name: 'turns',
|
|
@@ -7001,7 +7055,7 @@ function xa() {
|
|
|
7001
7055
|
description:
|
|
7002
7056
|
'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
|
|
7003
7057
|
},
|
|
7004
|
-
{ name: 'output_format', type: 'select', default:
|
|
7058
|
+
{ name: 'output_format', type: 'select', default: Ue[0], options: [...Ue] },
|
|
7005
7059
|
{ name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
|
|
7006
7060
|
{
|
|
7007
7061
|
name: 'similarity_boost',
|
|
@@ -7012,7 +7066,7 @@ function xa() {
|
|
|
7012
7066
|
},
|
|
7013
7067
|
];
|
|
7014
7068
|
}
|
|
7015
|
-
function
|
|
7069
|
+
function zt(e) {
|
|
7016
7070
|
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
7017
7071
|
i = [
|
|
7018
7072
|
{
|
|
@@ -7027,26 +7081,26 @@ function jt(e) {
|
|
|
7027
7081
|
required: !0,
|
|
7028
7082
|
...(e.modeRequired ? {} : { default: e.modes[0] }),
|
|
7029
7083
|
options: [...e.modes],
|
|
7030
|
-
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) =>
|
|
7084
|
+
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ka[a]).join(' ')}`,
|
|
7031
7085
|
},
|
|
7032
7086
|
];
|
|
7033
7087
|
return (
|
|
7034
|
-
e.kind === 'video' ? i.push(...
|
|
7035
|
-
e.modes.includes('motion_control') && i.push(...
|
|
7088
|
+
e.kind === 'video' ? i.push(...xa(e)) : e.kind === 'image' ? i.push(..._a(e)) : i.push(...Ia()),
|
|
7089
|
+
e.modes.includes('motion_control') && i.push(...wa()),
|
|
7036
7090
|
e.seed &&
|
|
7037
7091
|
i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
7038
7092
|
i
|
|
7039
7093
|
);
|
|
7040
7094
|
}
|
|
7041
7095
|
var L,
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7096
|
+
ka,
|
|
7097
|
+
Pa,
|
|
7098
|
+
Jt = h(() => {
|
|
7045
7099
|
'use strict';
|
|
7046
|
-
|
|
7100
|
+
Fe();
|
|
7047
7101
|
((L =
|
|
7048
7102
|
'as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
|
|
7049
|
-
(
|
|
7103
|
+
(ka = {
|
|
7050
7104
|
text_to_video: 'text_to_video: from the prompt alone.',
|
|
7051
7105
|
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
7052
7106
|
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
@@ -7058,34 +7112,34 @@ var L,
|
|
|
7058
7112
|
motion_control:
|
|
7059
7113
|
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
7060
7114
|
}));
|
|
7061
|
-
|
|
7115
|
+
Pa = Object.entries(Ne)
|
|
7062
7116
|
.map(([e, t]) => `${e} (${t})`)
|
|
7063
7117
|
.join(', ');
|
|
7064
7118
|
});
|
|
7065
7119
|
var he,
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7120
|
+
Wt,
|
|
7121
|
+
X,
|
|
7122
|
+
Yt,
|
|
7123
|
+
Sn,
|
|
7124
|
+
Cn,
|
|
7125
|
+
$n,
|
|
7126
|
+
En,
|
|
7127
|
+
Xt = h(() => {
|
|
7074
7128
|
'use strict';
|
|
7075
7129
|
((he = 'enhancor-ultrafine'),
|
|
7076
|
-
(
|
|
7077
|
-
(
|
|
7078
|
-
(
|
|
7079
|
-
(
|
|
7080
|
-
(
|
|
7081
|
-
(
|
|
7082
|
-
(
|
|
7130
|
+
(Wt = 'Enhancor Ultrafine'),
|
|
7131
|
+
(X = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
7132
|
+
(Yt = 2),
|
|
7133
|
+
(Sn = 24 * 1024 * 1024),
|
|
7134
|
+
(Cn = 4096 * 4096),
|
|
7135
|
+
($n = 30 * 6e4),
|
|
7136
|
+
(En = 120 * 6e4));
|
|
7083
7137
|
});
|
|
7084
|
-
var
|
|
7138
|
+
var Q,
|
|
7085
7139
|
ye,
|
|
7086
|
-
|
|
7140
|
+
Be = h(() => {
|
|
7087
7141
|
'use strict';
|
|
7088
|
-
((
|
|
7142
|
+
((Q = [
|
|
7089
7143
|
'seedance-2-5',
|
|
7090
7144
|
'seedance-2-5-flash',
|
|
7091
7145
|
'seedance-2',
|
|
@@ -7100,10 +7154,10 @@ var X,
|
|
|
7100
7154
|
(ye =
|
|
7101
7155
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
7102
7156
|
});
|
|
7103
|
-
function
|
|
7157
|
+
function Z(e) {
|
|
7104
7158
|
return `$${Number(e.toFixed(5))}`;
|
|
7105
7159
|
}
|
|
7106
|
-
function
|
|
7160
|
+
function Ma(e) {
|
|
7107
7161
|
if (e.kind === 'llm') {
|
|
7108
7162
|
let t = e.defaultEndpoint,
|
|
7109
7163
|
i = (s) =>
|
|
@@ -7116,19 +7170,19 @@ function Ia(e) {
|
|
|
7116
7170
|
a = i('input'),
|
|
7117
7171
|
n = i('output');
|
|
7118
7172
|
return a && n
|
|
7119
|
-
? `${
|
|
7120
|
-
: `from ${
|
|
7173
|
+
? `${Z(a.price.starter)}/M in \xB7 ${Z(n.price.starter)}/M out`
|
|
7174
|
+
: `from ${Z(me(e).price.starter)}/M tokens`;
|
|
7121
7175
|
}
|
|
7122
|
-
return `from ${
|
|
7176
|
+
return `from ${Z(me(e).price.starter)}${e.unit}`;
|
|
7123
7177
|
}
|
|
7124
|
-
function
|
|
7178
|
+
function Ka(e, t) {
|
|
7125
7179
|
let i = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
7126
|
-
return i.length ? `from ${
|
|
7180
|
+
return i.length ? `from ${Z(Math.min(...i))}${e}` : null;
|
|
7127
7181
|
}
|
|
7128
|
-
function
|
|
7182
|
+
function ii(e) {
|
|
7129
7183
|
for (let t of J) {
|
|
7130
7184
|
let i = ke[t],
|
|
7131
|
-
a = i ?
|
|
7185
|
+
a = i ? Ka(i.unit, e[t] ?? []) : null;
|
|
7132
7186
|
i && a && (i.priceFormatted = a);
|
|
7133
7187
|
}
|
|
7134
7188
|
}
|
|
@@ -7144,13 +7198,13 @@ function A(e, t) {
|
|
|
7144
7198
|
...(t ? { description: t } : {}),
|
|
7145
7199
|
};
|
|
7146
7200
|
}
|
|
7147
|
-
function
|
|
7201
|
+
function ai(e) {
|
|
7148
7202
|
if (!e.endpoints?.length) return null;
|
|
7149
|
-
let t = e.endpoints.filter((i) =>
|
|
7203
|
+
let t = e.endpoints.filter((i) => $t(e.slug, i.id));
|
|
7150
7204
|
return {
|
|
7151
7205
|
name: 'endpoint',
|
|
7152
7206
|
type: 'select',
|
|
7153
|
-
default:
|
|
7207
|
+
default: Re(e),
|
|
7154
7208
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
7155
7209
|
description:
|
|
7156
7210
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -7159,20 +7213,20 @@ function ei(e) {
|
|
|
7159
7213
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
7160
7214
|
};
|
|
7161
7215
|
}
|
|
7162
|
-
function
|
|
7216
|
+
function Ca(e, t) {
|
|
7163
7217
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
7164
|
-
let i =
|
|
7165
|
-
return [...t.filter((a) => !be.has(a.name)), i ?
|
|
7218
|
+
let i = Q.includes(e.api.model);
|
|
7219
|
+
return [...t.filter((a) => !be.has(a.name)), i ? We : Sa];
|
|
7166
7220
|
}
|
|
7167
|
-
function
|
|
7221
|
+
function je(e, t) {
|
|
7168
7222
|
let i = e.filter((n) => !be.has(n.name)),
|
|
7169
|
-
a = [
|
|
7170
|
-
return (a.push(
|
|
7223
|
+
a = [We, ri];
|
|
7224
|
+
return (a.push(Ye, Xe), [...i, ...a]);
|
|
7171
7225
|
}
|
|
7172
|
-
function
|
|
7226
|
+
function Oa(e) {
|
|
7173
7227
|
return [
|
|
7174
7228
|
...e
|
|
7175
|
-
.filter((t) => !
|
|
7229
|
+
.filter((t) => !Ea.has(t.name) && !be.has(t.name))
|
|
7176
7230
|
.map((t) => {
|
|
7177
7231
|
if (t.name === 'resolution')
|
|
7178
7232
|
return {
|
|
@@ -7184,30 +7238,30 @@ function $a(e) {
|
|
|
7184
7238
|
),
|
|
7185
7239
|
}
|
|
7186
7240
|
: {}),
|
|
7187
|
-
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${
|
|
7241
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${ee}`,
|
|
7188
7242
|
};
|
|
7189
|
-
let i =
|
|
7243
|
+
let i = Aa[t.name];
|
|
7190
7244
|
return i && typeof t.description == 'string'
|
|
7191
7245
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
|
|
7192
7246
|
: t;
|
|
7193
7247
|
}),
|
|
7194
|
-
Je,
|
|
7195
|
-
ti,
|
|
7196
7248
|
We,
|
|
7249
|
+
ri,
|
|
7197
7250
|
Ye,
|
|
7251
|
+
Xe,
|
|
7198
7252
|
];
|
|
7199
7253
|
}
|
|
7200
|
-
function
|
|
7254
|
+
function ni(e) {
|
|
7201
7255
|
return (
|
|
7202
7256
|
e.startsWith('seedance-2-5-') &&
|
|
7203
7257
|
e !== 'seedance-2-5-lite' &&
|
|
7204
7258
|
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
7205
7259
|
);
|
|
7206
7260
|
}
|
|
7207
|
-
function
|
|
7261
|
+
function Qt(e, t = {}) {
|
|
7208
7262
|
return [
|
|
7209
7263
|
...e
|
|
7210
|
-
.filter((i) =>
|
|
7264
|
+
.filter((i) => !$a.has(i.name) && !be.has(i.name))
|
|
7211
7265
|
.map((i) =>
|
|
7212
7266
|
i.name === 'prompt'
|
|
7213
7267
|
? { ...i, required: !0 }
|
|
@@ -7217,7 +7271,7 @@ function Wt(e, t = {}) {
|
|
|
7217
7271
|
...(t.no4k && i.options
|
|
7218
7272
|
? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
7219
7273
|
: {}),
|
|
7220
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
7274
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ee}`,
|
|
7221
7275
|
}
|
|
7222
7276
|
: i,
|
|
7223
7277
|
),
|
|
@@ -7228,11 +7282,11 @@ function Wt(e, t = {}) {
|
|
|
7228
7282
|
options: ['standard'],
|
|
7229
7283
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
7230
7284
|
},
|
|
7231
|
-
We,
|
|
7232
7285
|
Ye,
|
|
7286
|
+
Xe,
|
|
7233
7287
|
];
|
|
7234
7288
|
}
|
|
7235
|
-
function
|
|
7289
|
+
function Ge(e, t) {
|
|
7236
7290
|
return [
|
|
7237
7291
|
C('Text prompt describing the video.'),
|
|
7238
7292
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -7261,8 +7315,8 @@ function je(e, t) {
|
|
|
7261
7315
|
),
|
|
7262
7316
|
];
|
|
7263
7317
|
}
|
|
7264
|
-
function
|
|
7265
|
-
let t =
|
|
7318
|
+
function qa(e) {
|
|
7319
|
+
let t = ai(e);
|
|
7266
7320
|
return [
|
|
7267
7321
|
C('Image prompt text. Supports complex composition and text instructions.'),
|
|
7268
7322
|
...(t ? [t] : []),
|
|
@@ -7275,14 +7329,14 @@ function Ea(e) {
|
|
|
7275
7329
|
A(
|
|
7276
7330
|
e,
|
|
7277
7331
|
e.slug === 'gpt-image-2'
|
|
7278
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
7332
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${bt}`
|
|
7279
7333
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
7280
7334
|
),
|
|
7281
7335
|
{
|
|
7282
7336
|
name: 'aspect_ratio',
|
|
7283
7337
|
type: 'select',
|
|
7284
7338
|
default: 'auto',
|
|
7285
|
-
options: [...
|
|
7339
|
+
options: [...yt],
|
|
7286
7340
|
description:
|
|
7287
7341
|
"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.",
|
|
7288
7342
|
},
|
|
@@ -7329,7 +7383,7 @@ function Ea(e) {
|
|
|
7329
7383
|
},
|
|
7330
7384
|
];
|
|
7331
7385
|
}
|
|
7332
|
-
function
|
|
7386
|
+
function Ra(e) {
|
|
7333
7387
|
return [
|
|
7334
7388
|
C('Image prompt text.'),
|
|
7335
7389
|
{
|
|
@@ -7337,7 +7391,7 @@ function Aa(e) {
|
|
|
7337
7391
|
type: 'string[]',
|
|
7338
7392
|
description: 'Images to edit or use as reference (up to 14).',
|
|
7339
7393
|
},
|
|
7340
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
7394
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...At(e.slug)] },
|
|
7341
7395
|
A(e),
|
|
7342
7396
|
{
|
|
7343
7397
|
name: 'n',
|
|
@@ -7363,10 +7417,10 @@ function Aa(e) {
|
|
|
7363
7417
|
},
|
|
7364
7418
|
];
|
|
7365
7419
|
}
|
|
7366
|
-
function
|
|
7367
|
-
let e =
|
|
7420
|
+
function Na() {
|
|
7421
|
+
let e = qt,
|
|
7368
7422
|
t = [];
|
|
7369
|
-
for (let i of
|
|
7423
|
+
for (let i of Qe(!0))
|
|
7370
7424
|
e.includes(i.name) &&
|
|
7371
7425
|
(t.push({
|
|
7372
7426
|
...i,
|
|
@@ -7388,12 +7442,12 @@ function La() {
|
|
|
7388
7442
|
}));
|
|
7389
7443
|
return t;
|
|
7390
7444
|
}
|
|
7391
|
-
function
|
|
7392
|
-
return
|
|
7445
|
+
function Ua() {
|
|
7446
|
+
return Qe(!0).map((e) =>
|
|
7393
7447
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
7394
7448
|
);
|
|
7395
7449
|
}
|
|
7396
|
-
function
|
|
7450
|
+
function Qe(e) {
|
|
7397
7451
|
return [
|
|
7398
7452
|
C('The user message or task.'),
|
|
7399
7453
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -7488,21 +7542,21 @@ function Xe(e) {
|
|
|
7488
7542
|
},
|
|
7489
7543
|
];
|
|
7490
7544
|
}
|
|
7491
|
-
function
|
|
7492
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
7493
|
-
let t =
|
|
7545
|
+
function Fa(e) {
|
|
7546
|
+
if (e.slug === 'seed-2-1-turbo') return Da;
|
|
7547
|
+
let t = ai(e);
|
|
7494
7548
|
return [
|
|
7495
7549
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
7496
|
-
?
|
|
7550
|
+
? Na()
|
|
7497
7551
|
: e.slug === 'gemini-3.7-flash'
|
|
7498
|
-
?
|
|
7499
|
-
: e.slug === 'gpt-6-astra' ||
|
|
7500
|
-
?
|
|
7501
|
-
:
|
|
7552
|
+
? Ua()
|
|
7553
|
+
: e.slug === 'gpt-6-astra' || Va.includes(e.slug)
|
|
7554
|
+
? Qe(e.slug !== 'gpt-6-astra')
|
|
7555
|
+
: La),
|
|
7502
7556
|
...(t ? [t] : []),
|
|
7503
7557
|
];
|
|
7504
7558
|
}
|
|
7505
|
-
function
|
|
7559
|
+
function He() {
|
|
7506
7560
|
return {
|
|
7507
7561
|
name: 'image',
|
|
7508
7562
|
type: 'string',
|
|
@@ -7510,7 +7564,7 @@ function Ge() {
|
|
|
7510
7564
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
7511
7565
|
};
|
|
7512
7566
|
}
|
|
7513
|
-
function
|
|
7567
|
+
function ja(e) {
|
|
7514
7568
|
return [
|
|
7515
7569
|
{
|
|
7516
7570
|
name: 'video_url',
|
|
@@ -7532,7 +7586,7 @@ function Ua(e) {
|
|
|
7532
7586
|
},
|
|
7533
7587
|
];
|
|
7534
7588
|
}
|
|
7535
|
-
function
|
|
7589
|
+
function Ga() {
|
|
7536
7590
|
return [
|
|
7537
7591
|
{
|
|
7538
7592
|
name: 'mode',
|
|
@@ -7603,30 +7657,30 @@ function Fa() {
|
|
|
7603
7657
|
},
|
|
7604
7658
|
];
|
|
7605
7659
|
}
|
|
7606
|
-
function
|
|
7660
|
+
function Ha(e) {
|
|
7607
7661
|
let t = e.slug;
|
|
7608
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
7609
|
-
if (pe.some((a) => a.slug === t)) return
|
|
7610
|
-
if (e.kind === 'llm') return
|
|
7611
|
-
if (e.editVariants?.length) return
|
|
7662
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return Ga();
|
|
7663
|
+
if (pe.some((a) => a.slug === t)) return ja(e);
|
|
7664
|
+
if (e.kind === 'llm') return Fa(e);
|
|
7665
|
+
if (e.editVariants?.length) return qa(e);
|
|
7612
7666
|
let i = ge(t);
|
|
7613
|
-
if (i) return
|
|
7614
|
-
if (
|
|
7667
|
+
if (i) return zt(i);
|
|
7668
|
+
if (ni(t)) return Oa(ze);
|
|
7615
7669
|
switch (t) {
|
|
7616
7670
|
case 'seedance-2-5':
|
|
7617
|
-
return
|
|
7671
|
+
return je(ze, t);
|
|
7618
7672
|
case 'seedance-2-5-lite':
|
|
7619
|
-
return
|
|
7673
|
+
return Qt(ze, { no4k: !0 });
|
|
7620
7674
|
case 'seedance-2':
|
|
7621
|
-
return
|
|
7675
|
+
return je(Zt, t);
|
|
7622
7676
|
case 'seedance-2-lite':
|
|
7623
|
-
return
|
|
7677
|
+
return Qt(Zt);
|
|
7624
7678
|
case 'seedance-2-mini':
|
|
7625
|
-
return
|
|
7679
|
+
return je(za, t);
|
|
7626
7680
|
case 'nano-banana-2':
|
|
7627
7681
|
case 'nano-banana-2.1':
|
|
7628
7682
|
case 'nano-banana-pro':
|
|
7629
|
-
return
|
|
7683
|
+
return Ra(e);
|
|
7630
7684
|
case 'seedream-5-pro':
|
|
7631
7685
|
return [
|
|
7632
7686
|
C('Detailed description of the image to generate.'),
|
|
@@ -7860,7 +7914,7 @@ function Ba(e) {
|
|
|
7860
7914
|
];
|
|
7861
7915
|
case 'enhancor-skin-fix-v1':
|
|
7862
7916
|
return [
|
|
7863
|
-
|
|
7917
|
+
He(),
|
|
7864
7918
|
{
|
|
7865
7919
|
name: 'mode',
|
|
7866
7920
|
type: 'select',
|
|
@@ -7893,11 +7947,11 @@ function Ba(e) {
|
|
|
7893
7947
|
max: 0.4,
|
|
7894
7948
|
description: 'Portrait depth. Heavy only.',
|
|
7895
7949
|
},
|
|
7896
|
-
...
|
|
7950
|
+
...Ba,
|
|
7897
7951
|
];
|
|
7898
7952
|
case 'enhancor-skin-fix-v3':
|
|
7899
7953
|
return [
|
|
7900
|
-
|
|
7954
|
+
He(),
|
|
7901
7955
|
{
|
|
7902
7956
|
name: 'mask_image',
|
|
7903
7957
|
type: 'string',
|
|
@@ -7937,7 +7991,7 @@ function Ba(e) {
|
|
|
7937
7991
|
];
|
|
7938
7992
|
case 'enhancor-skin-fix-v4':
|
|
7939
7993
|
return [
|
|
7940
|
-
|
|
7994
|
+
He(),
|
|
7941
7995
|
{
|
|
7942
7996
|
name: 'mode',
|
|
7943
7997
|
type: 'select',
|
|
@@ -7968,7 +8022,7 @@ function Ba(e) {
|
|
|
7968
8022
|
];
|
|
7969
8023
|
case 'wan-3-0':
|
|
7970
8024
|
case 'wan-3-0-prime':
|
|
7971
|
-
return
|
|
8025
|
+
return Ge(e, {
|
|
7972
8026
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7973
8027
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
7974
8028
|
minSec: 2,
|
|
@@ -7978,7 +8032,7 @@ function Ba(e) {
|
|
|
7978
8032
|
});
|
|
7979
8033
|
case 'happy-horse-1-1':
|
|
7980
8034
|
case 'happy-horse-1-0':
|
|
7981
|
-
return
|
|
8035
|
+
return Ge(e, {
|
|
7982
8036
|
modes:
|
|
7983
8037
|
t === 'happy-horse-1-0'
|
|
7984
8038
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -7988,8 +8042,68 @@ function Ba(e) {
|
|
|
7988
8042
|
maxSec: 15,
|
|
7989
8043
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
7990
8044
|
});
|
|
8045
|
+
case 'gemini-omni-1.2-flash':
|
|
8046
|
+
return [
|
|
8047
|
+
C(
|
|
8048
|
+
'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).',
|
|
8049
|
+
),
|
|
8050
|
+
{
|
|
8051
|
+
name: 'mode',
|
|
8052
|
+
type: 'select',
|
|
8053
|
+
required: !0,
|
|
8054
|
+
options: [
|
|
8055
|
+
'text_to_video',
|
|
8056
|
+
'image_to_video',
|
|
8057
|
+
'multi_reference',
|
|
8058
|
+
'video_edit',
|
|
8059
|
+
'video_extend',
|
|
8060
|
+
],
|
|
8061
|
+
description:
|
|
8062
|
+
'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).',
|
|
8063
|
+
},
|
|
8064
|
+
{
|
|
8065
|
+
name: 'duration',
|
|
8066
|
+
type: 'slider',
|
|
8067
|
+
default: 5,
|
|
8068
|
+
min: 3,
|
|
8069
|
+
max: 15,
|
|
8070
|
+
description:
|
|
8071
|
+
'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.',
|
|
8072
|
+
},
|
|
8073
|
+
{ ...A(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
|
|
8074
|
+
{
|
|
8075
|
+
name: 'aspect_ratio',
|
|
8076
|
+
type: 'select',
|
|
8077
|
+
options: ['16:9', '9:16'],
|
|
8078
|
+
description:
|
|
8079
|
+
'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.',
|
|
8080
|
+
},
|
|
8081
|
+
{
|
|
8082
|
+
name: 'first_frame_image',
|
|
8083
|
+
type: 'string',
|
|
8084
|
+
description:
|
|
8085
|
+
'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.',
|
|
8086
|
+
},
|
|
8087
|
+
{
|
|
8088
|
+
name: 'last_frame_image',
|
|
8089
|
+
type: 'string',
|
|
8090
|
+
description: 'image_to_video: an optional end frame (duration then 3 to 10 s).',
|
|
8091
|
+
},
|
|
8092
|
+
{
|
|
8093
|
+
name: 'images',
|
|
8094
|
+
type: 'string[]',
|
|
8095
|
+
description:
|
|
8096
|
+
'multi_reference: 1-6 reference images; video_edit: up to 5 optional images. Public http(s) URLs or data URIs.',
|
|
8097
|
+
},
|
|
8098
|
+
{
|
|
8099
|
+
name: 'video',
|
|
8100
|
+
type: 'string',
|
|
8101
|
+
description:
|
|
8102
|
+
'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.',
|
|
8103
|
+
},
|
|
8104
|
+
];
|
|
7991
8105
|
case 'minimax-h3':
|
|
7992
|
-
return
|
|
8106
|
+
return Ge(e, {
|
|
7993
8107
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7994
8108
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
7995
8109
|
minSec: 4,
|
|
@@ -8000,7 +8114,7 @@ function Ba(e) {
|
|
|
8000
8114
|
return [C('Prompt text.')];
|
|
8001
8115
|
}
|
|
8002
8116
|
}
|
|
8003
|
-
function
|
|
8117
|
+
function Ja() {
|
|
8004
8118
|
let e = (t, i) => ({
|
|
8005
8119
|
name: t,
|
|
8006
8120
|
type: 'slider',
|
|
@@ -8023,10 +8137,10 @@ function Ga() {
|
|
|
8023
8137
|
),
|
|
8024
8138
|
];
|
|
8025
8139
|
}
|
|
8026
|
-
function
|
|
8140
|
+
function Wa() {
|
|
8027
8141
|
return {
|
|
8028
8142
|
slug: he,
|
|
8029
|
-
name:
|
|
8143
|
+
name: Wt,
|
|
8030
8144
|
category: 'Image',
|
|
8031
8145
|
kind: 'Image-to-Image',
|
|
8032
8146
|
vendor: 'Enhancor',
|
|
@@ -8034,7 +8148,7 @@ function Ha() {
|
|
|
8034
8148
|
'Upscales a photo, with an optional skin fix. Full makes the photo its size times the scale; Fast makes a fixed size (long side 2432 px).',
|
|
8035
8149
|
priceFormatted: '',
|
|
8036
8150
|
unit: '/img',
|
|
8037
|
-
primaryToolName:
|
|
8151
|
+
primaryToolName: ti.image,
|
|
8038
8152
|
parameters: [
|
|
8039
8153
|
{
|
|
8040
8154
|
name: 'image',
|
|
@@ -8060,45 +8174,45 @@ function Ha() {
|
|
|
8060
8174
|
{
|
|
8061
8175
|
name: 'scale',
|
|
8062
8176
|
type: 'select',
|
|
8063
|
-
default: String(
|
|
8064
|
-
options:
|
|
8065
|
-
description: `Full only. ${
|
|
8177
|
+
default: String(Yt),
|
|
8178
|
+
options: X.noSkin.map(String),
|
|
8179
|
+
description: `Full only. ${X.skin.join(', ')} with skin_fix on; also ${X.noSkin.filter((e) => !X.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
|
|
8066
8180
|
},
|
|
8067
|
-
...
|
|
8181
|
+
...Ja(),
|
|
8068
8182
|
],
|
|
8069
8183
|
};
|
|
8070
8184
|
}
|
|
8071
|
-
function
|
|
8185
|
+
function Je(e, t = e.api.model) {
|
|
8072
8186
|
return {
|
|
8073
8187
|
slug: t,
|
|
8074
8188
|
name: e.name,
|
|
8075
|
-
category:
|
|
8076
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
8189
|
+
category: va[e.kind],
|
|
8190
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Ta[e.kind],
|
|
8077
8191
|
vendor: e.vendor ?? '',
|
|
8078
8192
|
description: e.desc ?? e.name,
|
|
8079
|
-
priceFormatted:
|
|
8193
|
+
priceFormatted: Ma(e),
|
|
8080
8194
|
unit: e.unit,
|
|
8081
|
-
primaryToolName:
|
|
8082
|
-
parameters:
|
|
8195
|
+
primaryToolName: ti[e.kind],
|
|
8196
|
+
parameters: Ca(e, Ha(e)),
|
|
8083
8197
|
};
|
|
8084
8198
|
}
|
|
8085
|
-
function
|
|
8199
|
+
function Ya() {
|
|
8086
8200
|
let e = {};
|
|
8087
8201
|
for (let t of ue())
|
|
8088
8202
|
if (t.slug !== 'seedance-2-fast') {
|
|
8089
8203
|
if (t.slug === 'seedance-2-mini') {
|
|
8090
|
-
e['seedance-2-mini'] =
|
|
8204
|
+
e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
|
|
8091
8205
|
continue;
|
|
8092
8206
|
}
|
|
8093
8207
|
if (t.slug === 'seedance-2') {
|
|
8094
|
-
let i =
|
|
8208
|
+
let i = Je(t);
|
|
8095
8209
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8096
8210
|
(e['seedance-2'] = i));
|
|
8097
8211
|
continue;
|
|
8098
8212
|
}
|
|
8099
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
8213
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
|
|
8100
8214
|
}
|
|
8101
|
-
(Object.assign(e,
|
|
8215
|
+
(Object.assign(e, Nt()), (e[he] = Wa()));
|
|
8102
8216
|
for (let [t, i] of Object.entries(fe))
|
|
8103
8217
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
8104
8218
|
return e;
|
|
@@ -8109,15 +8223,20 @@ function we(e) {
|
|
|
8109
8223
|
function H(e) {
|
|
8110
8224
|
return ke[e] ?? null;
|
|
8111
8225
|
}
|
|
8112
|
-
function
|
|
8113
|
-
if (
|
|
8114
|
-
|
|
8226
|
+
function Xa(e, t, i) {
|
|
8227
|
+
if (
|
|
8228
|
+
e.startsWith('enhancor-skin-fix-') ||
|
|
8229
|
+
e === he ||
|
|
8230
|
+
(e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration'))
|
|
8231
|
+
)
|
|
8232
|
+
return !1;
|
|
8233
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ni(e)) && t === 'duration') {
|
|
8115
8234
|
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
8116
8235
|
if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
|
|
8117
8236
|
}
|
|
8118
8237
|
if (
|
|
8119
|
-
(t === 'max_tokens' &&
|
|
8120
|
-
(t === 'max_completion_tokens' &&
|
|
8238
|
+
(t === 'max_tokens' && ei(i.max_completion_tokens)) ||
|
|
8239
|
+
(t === 'max_completion_tokens' && ei(i.max_tokens))
|
|
8121
8240
|
)
|
|
8122
8241
|
return !1;
|
|
8123
8242
|
if (t === 'aspect_ratio') {
|
|
@@ -8125,124 +8244,124 @@ function Ja(e, t, i) {
|
|
|
8125
8244
|
if (n) {
|
|
8126
8245
|
let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8127
8246
|
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
8128
|
-
if (n.modes.includes(o) && !
|
|
8247
|
+
if (n.modes.includes(o) && !Gt(n, o)) return !1;
|
|
8129
8248
|
}
|
|
8130
8249
|
}
|
|
8131
8250
|
let a = ge(e);
|
|
8132
8251
|
if (a) {
|
|
8133
8252
|
let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8134
8253
|
s = n ? n.replace(/-/g, '_') : a.modes[0];
|
|
8135
|
-
if (a.modes.includes(s) && !
|
|
8254
|
+
if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
|
|
8136
8255
|
}
|
|
8137
8256
|
return !0;
|
|
8138
8257
|
}
|
|
8139
|
-
function
|
|
8258
|
+
function ei(e) {
|
|
8140
8259
|
return e != null && e !== '';
|
|
8141
8260
|
}
|
|
8142
|
-
function
|
|
8261
|
+
function li(e, t) {
|
|
8143
8262
|
let i = { ...t };
|
|
8144
8263
|
if (e?.slug === 'seedance-2-5') {
|
|
8145
8264
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
8146
|
-
for (let n of
|
|
8265
|
+
for (let n of Qa) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
8147
8266
|
if (!a(i.finalize)) return i;
|
|
8148
8267
|
}
|
|
8149
8268
|
for (let a of e?.parameters ?? [])
|
|
8150
8269
|
a.default !== void 0 &&
|
|
8151
8270
|
i[a.name] === void 0 &&
|
|
8152
|
-
|
|
8271
|
+
Xa(e.slug, a.name, t) &&
|
|
8153
8272
|
(i[a.name] = a.default);
|
|
8154
8273
|
return i;
|
|
8155
8274
|
}
|
|
8156
8275
|
function D() {
|
|
8157
8276
|
return Object.values(ke);
|
|
8158
8277
|
}
|
|
8159
|
-
var
|
|
8160
|
-
Qt,
|
|
8161
|
-
Pa,
|
|
8162
|
-
C,
|
|
8163
|
-
Je,
|
|
8164
|
-
Ta,
|
|
8278
|
+
var va,
|
|
8165
8279
|
ti,
|
|
8280
|
+
Ta,
|
|
8281
|
+
C,
|
|
8166
8282
|
We,
|
|
8167
|
-
Ye,
|
|
8168
|
-
be,
|
|
8169
|
-
Ka,
|
|
8170
8283
|
Sa,
|
|
8171
|
-
Ca,
|
|
8172
|
-
qa,
|
|
8173
|
-
Oa,
|
|
8174
|
-
Ra,
|
|
8175
|
-
Na,
|
|
8176
|
-
Z,
|
|
8177
|
-
He,
|
|
8178
|
-
ai,
|
|
8179
8284
|
ri,
|
|
8180
|
-
|
|
8181
|
-
|
|
8285
|
+
Ye,
|
|
8286
|
+
Xe,
|
|
8287
|
+
be,
|
|
8288
|
+
$a,
|
|
8289
|
+
Ea,
|
|
8290
|
+
Aa,
|
|
8291
|
+
La,
|
|
8292
|
+
Da,
|
|
8293
|
+
Va,
|
|
8294
|
+
Ba,
|
|
8295
|
+
ee,
|
|
8296
|
+
ze,
|
|
8297
|
+
si,
|
|
8298
|
+
oi,
|
|
8299
|
+
Zt,
|
|
8300
|
+
za,
|
|
8182
8301
|
ke,
|
|
8183
|
-
|
|
8184
|
-
|
|
8302
|
+
Qa,
|
|
8303
|
+
te = h(() => {
|
|
8185
8304
|
'use strict';
|
|
8186
|
-
|
|
8305
|
+
kt();
|
|
8187
8306
|
Ce();
|
|
8188
8307
|
G();
|
|
8189
|
-
Re();
|
|
8190
|
-
$e();
|
|
8191
8308
|
Le();
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
Jt();
|
|
8309
|
+
$e();
|
|
8310
|
+
De();
|
|
8311
|
+
Et();
|
|
8312
|
+
Ot();
|
|
8313
|
+
Rt();
|
|
8314
|
+
Ut();
|
|
8199
8315
|
Fe();
|
|
8200
|
-
(
|
|
8201
|
-
|
|
8316
|
+
Jt();
|
|
8317
|
+
Xt();
|
|
8318
|
+
Be();
|
|
8319
|
+
((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8320
|
+
(ti = {
|
|
8202
8321
|
video: 'generate_video',
|
|
8203
8322
|
image: 'generate_image',
|
|
8204
8323
|
audio: 'generate_audio',
|
|
8205
8324
|
llm: 'run_task',
|
|
8206
8325
|
}),
|
|
8207
|
-
(
|
|
8326
|
+
(Ta = {
|
|
8208
8327
|
video: 'Text-to-Video',
|
|
8209
8328
|
image: 'Text-to-Image',
|
|
8210
8329
|
audio: 'Text-to-Audio',
|
|
8211
8330
|
llm: 'Reasoning (LLM)',
|
|
8212
8331
|
}));
|
|
8213
8332
|
C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
8214
|
-
((
|
|
8333
|
+
((We = {
|
|
8215
8334
|
name: 'creative_mode',
|
|
8216
8335
|
type: 'boolean',
|
|
8217
8336
|
default: !1,
|
|
8218
8337
|
description:
|
|
8219
8338
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8220
8339
|
}),
|
|
8221
|
-
(
|
|
8340
|
+
(Sa = {
|
|
8222
8341
|
name: 'creative_mode',
|
|
8223
8342
|
type: 'boolean',
|
|
8224
8343
|
default: !1,
|
|
8225
8344
|
description: `Not available yet on this model: ${ye}.`,
|
|
8226
8345
|
}),
|
|
8227
|
-
(
|
|
8346
|
+
(ri = {
|
|
8228
8347
|
name: 'priority',
|
|
8229
8348
|
type: 'boolean',
|
|
8230
8349
|
default: !1,
|
|
8231
8350
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
8232
8351
|
}),
|
|
8233
|
-
(
|
|
8352
|
+
(Ye = {
|
|
8234
8353
|
name: 'reference_roles',
|
|
8235
8354
|
type: 'json',
|
|
8236
8355
|
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).`,
|
|
8237
8356
|
}),
|
|
8238
|
-
(
|
|
8357
|
+
(Xe = {
|
|
8239
8358
|
name: 'auto_fit_images',
|
|
8240
8359
|
type: 'boolean',
|
|
8241
8360
|
description:
|
|
8242
8361
|
'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.',
|
|
8243
8362
|
}),
|
|
8244
8363
|
(be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8245
|
-
((
|
|
8364
|
+
(($a = new Set([
|
|
8246
8365
|
'quality',
|
|
8247
8366
|
'bitrate_mode',
|
|
8248
8367
|
'draft',
|
|
@@ -8251,7 +8370,7 @@ var _a,
|
|
|
8251
8370
|
'draft_generation_id',
|
|
8252
8371
|
'pass_faces',
|
|
8253
8372
|
])),
|
|
8254
|
-
(
|
|
8373
|
+
(Ea = new Set([
|
|
8255
8374
|
'quality',
|
|
8256
8375
|
'bitrate_mode',
|
|
8257
8376
|
'draft',
|
|
@@ -8259,12 +8378,12 @@ var _a,
|
|
|
8259
8378
|
'draft_task_id',
|
|
8260
8379
|
'draft_generation_id',
|
|
8261
8380
|
])),
|
|
8262
|
-
(
|
|
8381
|
+
(Aa = {
|
|
8263
8382
|
images: 'up to 10',
|
|
8264
8383
|
videos: 'up to 5; combined duration < 30s',
|
|
8265
8384
|
audios: 'up to 5; combined duration < 30s',
|
|
8266
8385
|
}));
|
|
8267
|
-
((
|
|
8386
|
+
((La = [
|
|
8268
8387
|
C('The user message or task.'),
|
|
8269
8388
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8270
8389
|
{
|
|
@@ -8282,7 +8401,7 @@ var _a,
|
|
|
8282
8401
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8283
8402
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8284
8403
|
]),
|
|
8285
|
-
(
|
|
8404
|
+
(Da = [
|
|
8286
8405
|
C('The user message or task.'),
|
|
8287
8406
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8288
8407
|
{
|
|
@@ -8364,8 +8483,8 @@ var _a,
|
|
|
8364
8483
|
description: 'Video frames read a second.',
|
|
8365
8484
|
},
|
|
8366
8485
|
]),
|
|
8367
|
-
(
|
|
8368
|
-
|
|
8486
|
+
(Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8487
|
+
Ba = Object.entries({
|
|
8369
8488
|
background: !1,
|
|
8370
8489
|
skin: !1,
|
|
8371
8490
|
nose: !1,
|
|
@@ -8391,8 +8510,8 @@ var _a,
|
|
|
8391
8510
|
default: t,
|
|
8392
8511
|
description: 'Keep this part out of the fix. Standard only.',
|
|
8393
8512
|
}));
|
|
8394
|
-
((
|
|
8395
|
-
(
|
|
8513
|
+
((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8514
|
+
(ze = [
|
|
8396
8515
|
{
|
|
8397
8516
|
name: 'prompt',
|
|
8398
8517
|
type: 'string',
|
|
@@ -8430,7 +8549,7 @@ var _a,
|
|
|
8430
8549
|
type: 'select',
|
|
8431
8550
|
default: '480p',
|
|
8432
8551
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8433
|
-
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. ${
|
|
8552
|
+
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. ${ee}`,
|
|
8434
8553
|
},
|
|
8435
8554
|
{
|
|
8436
8555
|
name: 'aspect_ratio',
|
|
@@ -8541,19 +8660,19 @@ var _a,
|
|
|
8541
8660
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8542
8661
|
},
|
|
8543
8662
|
]),
|
|
8544
|
-
(
|
|
8663
|
+
(si = {
|
|
8545
8664
|
name: 'images',
|
|
8546
8665
|
type: 'string[]',
|
|
8547
8666
|
description:
|
|
8548
8667
|
'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.',
|
|
8549
8668
|
}),
|
|
8550
|
-
(
|
|
8669
|
+
(oi = {
|
|
8551
8670
|
name: 'audios',
|
|
8552
8671
|
type: 'string[]',
|
|
8553
8672
|
description:
|
|
8554
8673
|
'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.',
|
|
8555
8674
|
}),
|
|
8556
|
-
(
|
|
8675
|
+
(Zt = [
|
|
8557
8676
|
{
|
|
8558
8677
|
name: 'prompt',
|
|
8559
8678
|
type: 'string',
|
|
@@ -8597,7 +8716,7 @@ var _a,
|
|
|
8597
8716
|
type: 'select',
|
|
8598
8717
|
default: '480p',
|
|
8599
8718
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8600
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
8719
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ee}`,
|
|
8601
8720
|
},
|
|
8602
8721
|
{
|
|
8603
8722
|
name: 'bitrate_mode',
|
|
@@ -8631,8 +8750,8 @@ var _a,
|
|
|
8631
8750
|
description:
|
|
8632
8751
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8633
8752
|
},
|
|
8634
|
-
|
|
8635
|
-
|
|
8753
|
+
si,
|
|
8754
|
+
oi,
|
|
8636
8755
|
{
|
|
8637
8756
|
name: 'first_frame_image',
|
|
8638
8757
|
type: 'string',
|
|
@@ -8653,7 +8772,7 @@ var _a,
|
|
|
8653
8772
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8654
8773
|
},
|
|
8655
8774
|
]),
|
|
8656
|
-
(
|
|
8775
|
+
(za = [
|
|
8657
8776
|
{
|
|
8658
8777
|
name: 'prompt',
|
|
8659
8778
|
type: 'string',
|
|
@@ -8674,7 +8793,7 @@ var _a,
|
|
|
8674
8793
|
type: 'select',
|
|
8675
8794
|
default: '480p',
|
|
8676
8795
|
options: ['480p', '720p'],
|
|
8677
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
8796
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ee}`,
|
|
8678
8797
|
},
|
|
8679
8798
|
{
|
|
8680
8799
|
name: 'bitrate_mode',
|
|
@@ -8708,8 +8827,8 @@ var _a,
|
|
|
8708
8827
|
description:
|
|
8709
8828
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8710
8829
|
},
|
|
8711
|
-
|
|
8712
|
-
|
|
8830
|
+
si,
|
|
8831
|
+
oi,
|
|
8713
8832
|
{
|
|
8714
8833
|
name: 'first_frame_image',
|
|
8715
8834
|
type: 'string',
|
|
@@ -8724,53 +8843,53 @@ var _a,
|
|
|
8724
8843
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8725
8844
|
},
|
|
8726
8845
|
]));
|
|
8727
|
-
ke =
|
|
8728
|
-
|
|
8846
|
+
ke = Ya();
|
|
8847
|
+
Qa = ['draft_task_id', 'draft_generation_id'];
|
|
8729
8848
|
});
|
|
8730
8849
|
function xe(e) {
|
|
8731
8850
|
let t = '/v1/pricing/models',
|
|
8732
8851
|
i = e?.trim();
|
|
8733
8852
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
8734
8853
|
}
|
|
8735
|
-
var
|
|
8854
|
+
var tt = h(() => {
|
|
8736
8855
|
'use strict';
|
|
8737
8856
|
});
|
|
8738
|
-
function
|
|
8857
|
+
function Ti(e) {
|
|
8739
8858
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
8740
8859
|
}
|
|
8741
|
-
function
|
|
8860
|
+
function Mi(e) {
|
|
8742
8861
|
let t = ue().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8743
|
-
i = t.filter((s) =>
|
|
8744
|
-
a = t.filter((s) => !
|
|
8862
|
+
i = t.filter((s) => Q.includes(s.api.model)).map((s) => s.name),
|
|
8863
|
+
a = t.filter((s) => !Q.includes(s.api.model)).map((s) => s.name);
|
|
8745
8864
|
return [
|
|
8746
8865
|
...(i.length
|
|
8747
|
-
? [`${
|
|
8866
|
+
? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
8748
8867
|
: []),
|
|
8749
|
-
...(a.length ? [`Not available yet on ${
|
|
8868
|
+
...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
|
|
8750
8869
|
'The Acceptable Use Policy applies.',
|
|
8751
8870
|
].join(' ');
|
|
8752
8871
|
}
|
|
8753
|
-
function
|
|
8754
|
-
if (
|
|
8872
|
+
function Kr(e) {
|
|
8873
|
+
if (Pr.has(e.name)) return e;
|
|
8755
8874
|
let t = e.inputSchema.properties;
|
|
8756
8875
|
return !t || t.callback_url
|
|
8757
8876
|
? e
|
|
8758
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8877
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
|
|
8759
8878
|
}
|
|
8760
|
-
function
|
|
8879
|
+
function Sr(e) {
|
|
8761
8880
|
let t = e.inputSchema.properties;
|
|
8762
8881
|
if (!t) return e;
|
|
8763
8882
|
let i = !1,
|
|
8764
8883
|
a = {};
|
|
8765
8884
|
for (let [n, s] of Object.entries(t))
|
|
8766
|
-
|
|
8885
|
+
Ki.has(n) && s.type === 'string' && !s.format
|
|
8767
8886
|
? ((a[n] = { ...s, format: 'uri' }), (i = !0))
|
|
8768
|
-
:
|
|
8887
|
+
: Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8769
8888
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
8770
8889
|
: (a[n] = s);
|
|
8771
8890
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
8772
8891
|
}
|
|
8773
|
-
function
|
|
8892
|
+
function Cr(e) {
|
|
8774
8893
|
switch (e.type) {
|
|
8775
8894
|
case 'string':
|
|
8776
8895
|
return {
|
|
@@ -8825,11 +8944,11 @@ function Mr(e) {
|
|
|
8825
8944
|
return { type: 'string', description: e.description };
|
|
8826
8945
|
}
|
|
8827
8946
|
}
|
|
8828
|
-
function
|
|
8947
|
+
function $r(e, t) {
|
|
8829
8948
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
8830
8949
|
a = {},
|
|
8831
8950
|
n = [];
|
|
8832
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
8951
|
+
for (let o of e.parameters) ((a[o.name] = Cr(o)), o.required && n.push(o.name));
|
|
8833
8952
|
let s = {
|
|
8834
8953
|
type: 'object',
|
|
8835
8954
|
properties: a,
|
|
@@ -8842,7 +8961,7 @@ function Kr(e, t) {
|
|
|
8842
8961
|
inputSchema: s,
|
|
8843
8962
|
};
|
|
8844
8963
|
}
|
|
8845
|
-
function
|
|
8964
|
+
function Er() {
|
|
8846
8965
|
let e = D().filter((p) => p.category === 'Image' && !we(p)),
|
|
8847
8966
|
t = D().filter((p) => p.category === 'Video'),
|
|
8848
8967
|
i = D().filter((p) => p.category === 'Text'),
|
|
@@ -8933,7 +9052,7 @@ function Sr() {
|
|
|
8933
9052
|
maximum: 2147483647,
|
|
8934
9053
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
8935
9054
|
},
|
|
8936
|
-
creative_mode: { type: 'boolean', description:
|
|
9055
|
+
creative_mode: { type: 'boolean', description: Mi('image') },
|
|
8937
9056
|
},
|
|
8938
9057
|
required: ['prompt'],
|
|
8939
9058
|
additionalProperties: !0,
|
|
@@ -8966,11 +9085,11 @@ function Sr() {
|
|
|
8966
9085
|
},
|
|
8967
9086
|
resolution: {
|
|
8968
9087
|
type: 'string',
|
|
8969
|
-
enum: ['480p', '720p', '768p', '1080p', '2k', '4k'],
|
|
9088
|
+
enum: ['360p', '480p', '540p', '720p', '768p', '1080p', '1440p', '2k', '4k'],
|
|
8970
9089
|
description:
|
|
8971
|
-
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default,
|
|
9090
|
+
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default, which that model's tool shows.",
|
|
8972
9091
|
},
|
|
8973
|
-
creative_mode: { type: 'boolean', description:
|
|
9092
|
+
creative_mode: { type: 'boolean', description: Mi('video') },
|
|
8974
9093
|
priority: {
|
|
8975
9094
|
type: 'boolean',
|
|
8976
9095
|
description:
|
|
@@ -9106,10 +9225,10 @@ function Sr() {
|
|
|
9106
9225
|
additionalProperties: !0,
|
|
9107
9226
|
},
|
|
9108
9227
|
},
|
|
9109
|
-
d =
|
|
9110
|
-
return [n, s, o, u, l, d, c,
|
|
9228
|
+
d = Ar();
|
|
9229
|
+
return [n, s, o, u, l, d, c, Ir, ...Si];
|
|
9111
9230
|
}
|
|
9112
|
-
function
|
|
9231
|
+
function Ar() {
|
|
9113
9232
|
return {
|
|
9114
9233
|
name: 'upload_asset',
|
|
9115
9234
|
description:
|
|
@@ -9156,31 +9275,31 @@ function Cr() {
|
|
|
9156
9275
|
},
|
|
9157
9276
|
};
|
|
9158
9277
|
}
|
|
9159
|
-
function
|
|
9160
|
-
let e =
|
|
9161
|
-
t = D().map((i) =>
|
|
9162
|
-
return [...e, ...t].map(
|
|
9278
|
+
function ot() {
|
|
9279
|
+
let e = Er(),
|
|
9280
|
+
t = D().map((i) => $r(i));
|
|
9281
|
+
return [...e, ...t].map(Kr).map(Sr);
|
|
9163
9282
|
}
|
|
9164
|
-
var
|
|
9165
|
-
wr,
|
|
9166
|
-
xr,
|
|
9167
|
-
_r,
|
|
9283
|
+
var _r,
|
|
9168
9284
|
Pr,
|
|
9169
9285
|
Ir,
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9286
|
+
vr,
|
|
9287
|
+
Tr,
|
|
9288
|
+
Mr,
|
|
9289
|
+
Si,
|
|
9290
|
+
Rs,
|
|
9291
|
+
Ki,
|
|
9292
|
+
Ci = h(() => {
|
|
9174
9293
|
'use strict';
|
|
9175
9294
|
G();
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
((
|
|
9295
|
+
Be();
|
|
9296
|
+
te();
|
|
9297
|
+
((_r = {
|
|
9179
9298
|
type: 'string',
|
|
9180
9299
|
description:
|
|
9181
9300
|
'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.',
|
|
9182
9301
|
}),
|
|
9183
|
-
(
|
|
9302
|
+
(Pr = new Set([
|
|
9184
9303
|
'upload_asset',
|
|
9185
9304
|
'upload_media',
|
|
9186
9305
|
'upload_image',
|
|
@@ -9191,7 +9310,7 @@ var kr,
|
|
|
9191
9310
|
'get_usage',
|
|
9192
9311
|
'get_balance_history',
|
|
9193
9312
|
])),
|
|
9194
|
-
(
|
|
9313
|
+
(Ir = {
|
|
9195
9314
|
name: 'get_pricing',
|
|
9196
9315
|
description:
|
|
9197
9316
|
'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.',
|
|
@@ -9206,13 +9325,13 @@ var kr,
|
|
|
9206
9325
|
additionalProperties: !1,
|
|
9207
9326
|
},
|
|
9208
9327
|
}),
|
|
9209
|
-
(
|
|
9328
|
+
(vr = {
|
|
9210
9329
|
name: 'get_balance',
|
|
9211
9330
|
description:
|
|
9212
9331
|
"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.",
|
|
9213
9332
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9214
9333
|
}),
|
|
9215
|
-
(
|
|
9334
|
+
(Tr = {
|
|
9216
9335
|
name: 'get_usage',
|
|
9217
9336
|
description:
|
|
9218
9337
|
"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.",
|
|
@@ -9243,7 +9362,7 @@ var kr,
|
|
|
9243
9362
|
additionalProperties: !1,
|
|
9244
9363
|
},
|
|
9245
9364
|
}),
|
|
9246
|
-
(
|
|
9365
|
+
(Mr = {
|
|
9247
9366
|
name: 'get_balance_history',
|
|
9248
9367
|
description:
|
|
9249
9368
|
"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.",
|
|
@@ -9261,9 +9380,9 @@ var kr,
|
|
|
9261
9380
|
additionalProperties: !1,
|
|
9262
9381
|
},
|
|
9263
9382
|
}),
|
|
9264
|
-
(
|
|
9265
|
-
(
|
|
9266
|
-
|
|
9383
|
+
(Si = [vr, Tr, Mr]),
|
|
9384
|
+
(Rs = new Set(Si.map((e) => e.name))));
|
|
9385
|
+
Ki = new Set([
|
|
9267
9386
|
'image',
|
|
9268
9387
|
'images',
|
|
9269
9388
|
'image_url',
|
|
@@ -9280,19 +9399,19 @@ var kr,
|
|
|
9280
9399
|
'lipsyncing_audio',
|
|
9281
9400
|
]);
|
|
9282
9401
|
});
|
|
9283
|
-
var
|
|
9284
|
-
|
|
9285
|
-
forgetToolSchemas: () =>
|
|
9286
|
-
jsonRpcAnswer: () =>
|
|
9287
|
-
preprocessLocalFiles: () =>
|
|
9288
|
-
startStdioServer: () =>
|
|
9402
|
+
var Ni = {};
|
|
9403
|
+
Ji(Ni, {
|
|
9404
|
+
forgetToolSchemas: () => Dr,
|
|
9405
|
+
jsonRpcAnswer: () => Oi,
|
|
9406
|
+
preprocessLocalFiles: () => Di,
|
|
9407
|
+
startStdioServer: () => Vi,
|
|
9289
9408
|
});
|
|
9290
|
-
function
|
|
9409
|
+
function Or(e) {
|
|
9291
9410
|
let t = (i) =>
|
|
9292
9411
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
9293
9412
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
9294
9413
|
}
|
|
9295
|
-
function
|
|
9414
|
+
function Oi(e, t, i) {
|
|
9296
9415
|
let a = e?.id,
|
|
9297
9416
|
n = a == null,
|
|
9298
9417
|
s = null;
|
|
@@ -9301,7 +9420,7 @@ function $i(e, t, i) {
|
|
|
9301
9420
|
} catch {
|
|
9302
9421
|
s = null;
|
|
9303
9422
|
}
|
|
9304
|
-
if (s !== null &&
|
|
9423
|
+
if (s !== null && Or(s)) return n ? null : s;
|
|
9305
9424
|
if (n) return null;
|
|
9306
9425
|
if (!i && t >= 200 && t < 300) return;
|
|
9307
9426
|
let o = s?.error,
|
|
@@ -9322,12 +9441,12 @@ function $i(e, t, i) {
|
|
|
9322
9441
|
},
|
|
9323
9442
|
};
|
|
9324
9443
|
}
|
|
9325
|
-
function
|
|
9444
|
+
function qr() {
|
|
9326
9445
|
let e = process.argv.slice(2),
|
|
9327
9446
|
t = e.indexOf('--api-key');
|
|
9328
9447
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
9329
9448
|
}
|
|
9330
|
-
async function
|
|
9449
|
+
async function qi(e, t, i) {
|
|
9331
9450
|
let a = z.default.resolve(e);
|
|
9332
9451
|
if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
|
|
9333
9452
|
throw new Error(`File not found: ${e}`);
|
|
@@ -9356,15 +9475,15 @@ async function Ei(e, t, i) {
|
|
|
9356
9475
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
9357
9476
|
};
|
|
9358
9477
|
}
|
|
9359
|
-
function
|
|
9360
|
-
return
|
|
9478
|
+
function Ri(e) {
|
|
9479
|
+
return Rr.has(z.default.extname(e).toLowerCase());
|
|
9361
9480
|
}
|
|
9362
|
-
function
|
|
9481
|
+
function Li(e) {
|
|
9363
9482
|
return new Error(
|
|
9364
9483
|
`Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
|
|
9365
9484
|
);
|
|
9366
9485
|
}
|
|
9367
|
-
function
|
|
9486
|
+
function Lr(e) {
|
|
9368
9487
|
let t = e.trim();
|
|
9369
9488
|
if (
|
|
9370
9489
|
!t ||
|
|
@@ -9377,22 +9496,22 @@ function qr(e) {
|
|
|
9377
9496
|
let i = z.default.resolve(t);
|
|
9378
9497
|
return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
|
|
9379
9498
|
}
|
|
9380
|
-
function
|
|
9499
|
+
function dt(e) {
|
|
9381
9500
|
if (Array.isArray(e))
|
|
9382
9501
|
for (let t of e) {
|
|
9383
9502
|
let i = t;
|
|
9384
9503
|
typeof i.name == 'string' &&
|
|
9385
9504
|
i.inputSchema &&
|
|
9386
9505
|
typeof i.inputSchema == 'object' &&
|
|
9387
|
-
|
|
9506
|
+
re.set(i.name, i.inputSchema);
|
|
9388
9507
|
}
|
|
9389
9508
|
}
|
|
9390
|
-
function
|
|
9391
|
-
(
|
|
9509
|
+
function Dr() {
|
|
9510
|
+
(re.clear(), (lt = 0));
|
|
9392
9511
|
}
|
|
9393
|
-
async function
|
|
9394
|
-
if (!(Date.now() -
|
|
9395
|
-
|
|
9512
|
+
async function Vr(e, t) {
|
|
9513
|
+
if (!(Date.now() - lt < 6e4)) {
|
|
9514
|
+
lt = Date.now();
|
|
9396
9515
|
try {
|
|
9397
9516
|
let a = await (
|
|
9398
9517
|
await fetch(e, {
|
|
@@ -9402,39 +9521,39 @@ async function Rr(e, t) {
|
|
|
9402
9521
|
signal: AbortSignal.timeout(1e4),
|
|
9403
9522
|
})
|
|
9404
9523
|
).json();
|
|
9405
|
-
|
|
9524
|
+
dt(a.result?.tools);
|
|
9406
9525
|
} catch {}
|
|
9407
9526
|
}
|
|
9408
9527
|
}
|
|
9409
|
-
function
|
|
9528
|
+
function Nr(e) {
|
|
9410
9529
|
return e
|
|
9411
9530
|
? e.type === 'string'
|
|
9412
9531
|
? e.format === 'uri'
|
|
9413
9532
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
9414
9533
|
: !1;
|
|
9415
9534
|
}
|
|
9416
|
-
async function
|
|
9535
|
+
async function $i(e, t, i) {
|
|
9417
9536
|
if (typeof e != 'string') return e;
|
|
9418
|
-
let a =
|
|
9537
|
+
let a = Lr(e);
|
|
9419
9538
|
if (!a) return e;
|
|
9420
|
-
if (!
|
|
9421
|
-
return (await
|
|
9539
|
+
if (!Ri(a)) throw Li(a);
|
|
9540
|
+
return (await qi(a, t, i)).url;
|
|
9422
9541
|
}
|
|
9423
|
-
async function
|
|
9424
|
-
(
|
|
9425
|
-
let s =
|
|
9542
|
+
async function Di(e, t, i, a, n) {
|
|
9543
|
+
(re.size === 0 && dt(ot()), re.has(e) || (await Vr(n, i)));
|
|
9544
|
+
let s = re.get(e)?.properties;
|
|
9426
9545
|
if (!s) return t;
|
|
9427
9546
|
let o = { ...t };
|
|
9428
9547
|
for (let [u, l] of Object.entries(t))
|
|
9429
|
-
if (
|
|
9548
|
+
if (Nr(s[u]))
|
|
9430
9549
|
if (Array.isArray(l)) {
|
|
9431
9550
|
let c = [];
|
|
9432
|
-
for (let d of l) c.push(await
|
|
9551
|
+
for (let d of l) c.push(await $i(d, i, a));
|
|
9433
9552
|
o[u] = c;
|
|
9434
|
-
} else o[u] = await
|
|
9553
|
+
} else o[u] = await $i(l, i, a);
|
|
9435
9554
|
return o;
|
|
9436
9555
|
}
|
|
9437
|
-
function
|
|
9556
|
+
function Ur(e) {
|
|
9438
9557
|
let t = e.id ?? null;
|
|
9439
9558
|
switch (e.method) {
|
|
9440
9559
|
case 'initialize':
|
|
@@ -9452,7 +9571,7 @@ function Dr(e) {
|
|
|
9452
9571
|
case 'ping':
|
|
9453
9572
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
9454
9573
|
case 'tools/list':
|
|
9455
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9574
|
+
return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
|
|
9456
9575
|
case 'tools/call':
|
|
9457
9576
|
return {
|
|
9458
9577
|
jsonrpc: '2.0',
|
|
@@ -9475,13 +9594,13 @@ function Dr(e) {
|
|
|
9475
9594
|
};
|
|
9476
9595
|
}
|
|
9477
9596
|
}
|
|
9478
|
-
async function
|
|
9479
|
-
if (
|
|
9480
|
-
|
|
9481
|
-
let e =
|
|
9597
|
+
async function Vi() {
|
|
9598
|
+
if (Ei) return;
|
|
9599
|
+
Ei = !0;
|
|
9600
|
+
let e = qr(),
|
|
9482
9601
|
t = w(),
|
|
9483
9602
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9484
|
-
(
|
|
9603
|
+
(Ai.default
|
|
9485
9604
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
9486
9605
|
.on('line', async (n) => {
|
|
9487
9606
|
let s = n.trim();
|
|
@@ -9542,8 +9661,8 @@ async function Ri() {
|
|
|
9542
9661
|
try {
|
|
9543
9662
|
let p = z.default.resolve(d.trim());
|
|
9544
9663
|
if (V.default.existsSync(p) && V.default.statSync(p).isFile() && e) {
|
|
9545
|
-
if (!
|
|
9546
|
-
let m = await
|
|
9664
|
+
if (!Ri(p)) throw Li(p);
|
|
9665
|
+
let m = await qi(p, e, t),
|
|
9547
9666
|
y = (m.sizeBytes / 1024).toFixed(1),
|
|
9548
9667
|
_e =
|
|
9549
9668
|
m.mimeType.startsWith('image/') ||
|
|
@@ -9599,7 +9718,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9599
9718
|
}
|
|
9600
9719
|
if (e)
|
|
9601
9720
|
try {
|
|
9602
|
-
o.params.arguments = await
|
|
9721
|
+
o.params.arguments = await Di(String(l), c, e, t, i);
|
|
9603
9722
|
} catch (d) {
|
|
9604
9723
|
let p = d instanceof Error ? d.message : String(d);
|
|
9605
9724
|
process.stdout.write(
|
|
@@ -9630,10 +9749,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9630
9749
|
body: JSON.stringify(o),
|
|
9631
9750
|
}),
|
|
9632
9751
|
c = await l.text(),
|
|
9633
|
-
d =
|
|
9752
|
+
d = Oi(o, l.status, c);
|
|
9634
9753
|
if (d === null) return;
|
|
9635
9754
|
if (d) {
|
|
9636
|
-
(o?.method === 'tools/list' &&
|
|
9755
|
+
(o?.method === 'tools/list' && dt(d.result?.tools),
|
|
9637
9756
|
process.stdout.write(
|
|
9638
9757
|
JSON.stringify(d) +
|
|
9639
9758
|
`
|
|
@@ -9642,7 +9761,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9642
9761
|
return;
|
|
9643
9762
|
}
|
|
9644
9763
|
} catch {}
|
|
9645
|
-
let u =
|
|
9764
|
+
let u = Ur(o);
|
|
9646
9765
|
u !== null &&
|
|
9647
9766
|
process.stdout.write(
|
|
9648
9767
|
JSON.stringify(u) +
|
|
@@ -9667,21 +9786,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9667
9786
|
}
|
|
9668
9787
|
var V,
|
|
9669
9788
|
z,
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9789
|
+
Ai,
|
|
9790
|
+
Rr,
|
|
9791
|
+
re,
|
|
9792
|
+
lt,
|
|
9793
|
+
Ei,
|
|
9794
|
+
Ui = h(() => {
|
|
9676
9795
|
'use strict';
|
|
9677
9796
|
((V = T(require('node:fs'))),
|
|
9678
9797
|
(z = T(require('node:path'))),
|
|
9679
|
-
(
|
|
9680
|
-
|
|
9681
|
-
|
|
9798
|
+
(Ai = T(require('node:readline'))));
|
|
9799
|
+
tt();
|
|
9800
|
+
Ci();
|
|
9682
9801
|
E();
|
|
9683
|
-
|
|
9684
|
-
|
|
9802
|
+
ne();
|
|
9803
|
+
Rr = new Set([
|
|
9685
9804
|
'.png',
|
|
9686
9805
|
'.jpg',
|
|
9687
9806
|
'.jpeg',
|
|
@@ -9707,20 +9826,20 @@ var V,
|
|
|
9707
9826
|
'.flac',
|
|
9708
9827
|
'.opus',
|
|
9709
9828
|
]);
|
|
9710
|
-
((
|
|
9711
|
-
|
|
9829
|
+
((re = new Map()), (lt = 0));
|
|
9830
|
+
Ei = !1;
|
|
9712
9831
|
require.main === module &&
|
|
9713
|
-
|
|
9832
|
+
Vi().catch((e) => {
|
|
9714
9833
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
9715
9834
|
`),
|
|
9716
9835
|
process.exit(1));
|
|
9717
9836
|
});
|
|
9718
9837
|
});
|
|
9719
|
-
var
|
|
9838
|
+
var Yi =
|
|
9720
9839
|
!process.env.NO_COLOR &&
|
|
9721
9840
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
9722
9841
|
function x(e, t) {
|
|
9723
|
-
return (i) => (
|
|
9842
|
+
return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
9724
9843
|
}
|
|
9725
9844
|
var r = {
|
|
9726
9845
|
bold: x(1, 22),
|
|
@@ -9805,12 +9924,12 @@ var r = {
|
|
|
9805
9924
|
}
|
|
9806
9925
|
};
|
|
9807
9926
|
var U = T(require('node:fs')),
|
|
9808
|
-
|
|
9809
|
-
var
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
var
|
|
9927
|
+
O = T(require('node:path'));
|
|
9928
|
+
var se = T(require('node:fs')),
|
|
9929
|
+
ft = T(require('node:path')),
|
|
9930
|
+
gt = require('node:stream/promises');
|
|
9931
|
+
ne();
|
|
9932
|
+
var ea = new Set([
|
|
9814
9933
|
'account_suspended',
|
|
9815
9934
|
'account_terminated',
|
|
9816
9935
|
'creative_mode_restricted',
|
|
@@ -9818,7 +9937,7 @@ var Xi = new Set([
|
|
|
9818
9937
|
'workspace_paused',
|
|
9819
9938
|
]),
|
|
9820
9939
|
v = 1,
|
|
9821
|
-
|
|
9940
|
+
ta = 3,
|
|
9822
9941
|
b = class extends Error {
|
|
9823
9942
|
constructor(t, i, a, n = {}) {
|
|
9824
9943
|
(super(i),
|
|
@@ -9828,10 +9947,10 @@ var Xi = new Set([
|
|
|
9828
9947
|
(this.fields = n));
|
|
9829
9948
|
}
|
|
9830
9949
|
get exitCode() {
|
|
9831
|
-
return this.code &&
|
|
9950
|
+
return this.code && ea.has(this.code) ? ta : v;
|
|
9832
9951
|
}
|
|
9833
9952
|
};
|
|
9834
|
-
function
|
|
9953
|
+
function ia(e, t, i) {
|
|
9835
9954
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9836
9955
|
if (!i || typeof i != 'object') return new b(e, a);
|
|
9837
9956
|
let n = i;
|
|
@@ -9844,13 +9963,13 @@ function Zi(e, t, i) {
|
|
|
9844
9963
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
9845
9964
|
return new b(e, c, typeof o == 'string' ? o : void 0, l);
|
|
9846
9965
|
}
|
|
9847
|
-
function
|
|
9966
|
+
function ut(e) {
|
|
9848
9967
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
9849
9968
|
}
|
|
9850
9969
|
function K(e) {
|
|
9851
9970
|
let t = [e.message],
|
|
9852
|
-
i =
|
|
9853
|
-
a =
|
|
9971
|
+
i = ut(e.fields.required),
|
|
9972
|
+
a = ut(e.fields.balance);
|
|
9854
9973
|
(i || a) &&
|
|
9855
9974
|
t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
9856
9975
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -9858,19 +9977,19 @@ function K(e) {
|
|
|
9858
9977
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
9859
9978
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
9860
9979
|
}
|
|
9861
|
-
function
|
|
9980
|
+
function aa(e) {
|
|
9862
9981
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
9863
9982
|
? 'video'
|
|
9864
9983
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
9865
9984
|
? 'audio'
|
|
9866
9985
|
: 'image';
|
|
9867
9986
|
}
|
|
9868
|
-
function
|
|
9987
|
+
function mt(e) {
|
|
9869
9988
|
let t = [];
|
|
9870
9989
|
for (let i of e.data ?? [])
|
|
9871
9990
|
typeof i.message?.content == 'string'
|
|
9872
9991
|
? t.push({ type: 'text', text: i.message.content })
|
|
9873
|
-
: i.url && t.push({ type:
|
|
9992
|
+
: i.url && t.push({ type: aa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
|
|
9874
9993
|
return t;
|
|
9875
9994
|
}
|
|
9876
9995
|
var M = class {
|
|
@@ -9896,7 +10015,7 @@ var M = class {
|
|
|
9896
10015
|
try {
|
|
9897
10016
|
s = await n.json();
|
|
9898
10017
|
} catch {}
|
|
9899
|
-
throw
|
|
10018
|
+
throw ia(n.status, n.statusText, s);
|
|
9900
10019
|
}
|
|
9901
10020
|
return await n.json();
|
|
9902
10021
|
}
|
|
@@ -9910,7 +10029,7 @@ var M = class {
|
|
|
9910
10029
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
9911
10030
|
? n
|
|
9912
10031
|
: 'processing',
|
|
9913
|
-
o =
|
|
10032
|
+
o = mt(a);
|
|
9914
10033
|
return {
|
|
9915
10034
|
request_id: a.request_id || a.id || '',
|
|
9916
10035
|
model: a.model,
|
|
@@ -9928,7 +10047,7 @@ var M = class {
|
|
|
9928
10047
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
9929
10048
|
? a
|
|
9930
10049
|
: 'processing',
|
|
9931
|
-
s =
|
|
10050
|
+
s = mt(i),
|
|
9932
10051
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
9933
10052
|
return {
|
|
9934
10053
|
request_id: i.id || t,
|
|
@@ -9957,10 +10076,10 @@ var M = class {
|
|
|
9957
10076
|
async downloadOutput(t, i) {
|
|
9958
10077
|
let a = await fetch(t);
|
|
9959
10078
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
9960
|
-
let n =
|
|
9961
|
-
|
|
9962
|
-
let s =
|
|
9963
|
-
return (await (0,
|
|
10079
|
+
let n = ft.default.dirname(i);
|
|
10080
|
+
se.default.existsSync(n) || se.default.mkdirSync(n, { recursive: !0 });
|
|
10081
|
+
let s = se.default.createWriteStream(i);
|
|
10082
|
+
return (await (0, gt.pipeline)(a.body, s), i);
|
|
9964
10083
|
}
|
|
9965
10084
|
};
|
|
9966
10085
|
E();
|
|
@@ -9972,43 +10091,43 @@ function Se(e) {
|
|
|
9972
10091
|
a = Math.round(Number((e * i).toFixed(6))) / i;
|
|
9973
10092
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
9974
10093
|
}
|
|
9975
|
-
|
|
9976
|
-
var
|
|
9977
|
-
function
|
|
9978
|
-
for (let t of
|
|
10094
|
+
te();
|
|
10095
|
+
var di = ['images', 'input_images', 'videos', 'audios'];
|
|
10096
|
+
function Za(e) {
|
|
10097
|
+
for (let t of di) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
9979
10098
|
}
|
|
9980
|
-
function
|
|
10099
|
+
function er(e) {
|
|
9981
10100
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
9982
|
-
let t =
|
|
10101
|
+
let t = O.default.resolve(e);
|
|
9983
10102
|
return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
|
|
9984
10103
|
}
|
|
9985
|
-
async function
|
|
9986
|
-
for (let i of
|
|
10104
|
+
async function tr(e, t) {
|
|
10105
|
+
for (let i of di) {
|
|
9987
10106
|
if (!Array.isArray(e[i])) continue;
|
|
9988
10107
|
let a = [];
|
|
9989
10108
|
for (let n of e[i]) {
|
|
9990
10109
|
if (typeof n != 'string') continue;
|
|
9991
|
-
let s =
|
|
10110
|
+
let s = er(n);
|
|
9992
10111
|
a.push(s ? await t(s) : n);
|
|
9993
10112
|
}
|
|
9994
10113
|
e[i] = a;
|
|
9995
10114
|
}
|
|
9996
10115
|
}
|
|
9997
|
-
var
|
|
9998
|
-
function
|
|
10116
|
+
var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10117
|
+
function ir(e) {
|
|
9999
10118
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
10000
10119
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
10001
|
-
i =
|
|
10120
|
+
i = ie.enterprise;
|
|
10002
10121
|
return (
|
|
10003
10122
|
(!Number.isInteger(t) || t < 1 || t > i) &&
|
|
10004
10123
|
(process.stderr
|
|
10005
|
-
.write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${
|
|
10124
|
+
.write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${ie.starter}, Plus ${ie.plus}, Scale ${ie.scale}, Enterprise ${ie.enterprise} at once, including polling.
|
|
10006
10125
|
`),
|
|
10007
10126
|
process.exit(1)),
|
|
10008
10127
|
t
|
|
10009
10128
|
);
|
|
10010
10129
|
}
|
|
10011
|
-
async function
|
|
10130
|
+
async function ar(e, t, i, a, n) {
|
|
10012
10131
|
n.isJson ||
|
|
10013
10132
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
10014
10133
|
`);
|
|
@@ -10083,12 +10202,12 @@ async function er(e, t, i, a, n) {
|
|
|
10083
10202
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10084
10203
|
process.exit(v);
|
|
10085
10204
|
}
|
|
10086
|
-
function
|
|
10205
|
+
function rr(e, t, i) {
|
|
10087
10206
|
if (i <= 1) return e;
|
|
10088
|
-
let a =
|
|
10207
|
+
let a = O.default.extname(e);
|
|
10089
10208
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
10090
10209
|
}
|
|
10091
|
-
function
|
|
10210
|
+
function pi(e) {
|
|
10092
10211
|
let t = {},
|
|
10093
10212
|
i = new Set(),
|
|
10094
10213
|
a = [];
|
|
@@ -10133,7 +10252,7 @@ function oi(e) {
|
|
|
10133
10252
|
}
|
|
10134
10253
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
|
|
10135
10254
|
}
|
|
10136
|
-
async function
|
|
10255
|
+
async function Ze(e, t) {
|
|
10137
10256
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10138
10257
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10139
10258
|
(i ||
|
|
@@ -10155,7 +10274,7 @@ async function Qe(e, t) {
|
|
|
10155
10274
|
s = !!t.json,
|
|
10156
10275
|
o = !!(t.async || t.no_wait),
|
|
10157
10276
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
10158
|
-
l =
|
|
10277
|
+
l = ir(t),
|
|
10159
10278
|
c = { ...t };
|
|
10160
10279
|
(delete c.json,
|
|
10161
10280
|
delete c.async,
|
|
@@ -10164,8 +10283,8 @@ async function Qe(e, t) {
|
|
|
10164
10283
|
delete c.api_key,
|
|
10165
10284
|
delete c.api_url,
|
|
10166
10285
|
delete c.count);
|
|
10167
|
-
let d =
|
|
10168
|
-
(
|
|
10286
|
+
let d = li(n, c);
|
|
10287
|
+
(Za(d),
|
|
10169
10288
|
typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
|
|
10170
10289
|
d.image_url &&
|
|
10171
10290
|
!d.first_frame_image &&
|
|
@@ -10186,35 +10305,35 @@ async function Qe(e, t) {
|
|
|
10186
10305
|
for (let k of m) {
|
|
10187
10306
|
let g = d[k];
|
|
10188
10307
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
10189
|
-
let P =
|
|
10308
|
+
let P = O.default.resolve(g);
|
|
10190
10309
|
if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
|
|
10191
|
-
let I = new $(`Uploading local file ${
|
|
10310
|
+
let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
|
|
10192
10311
|
s || I.start();
|
|
10193
10312
|
try {
|
|
10194
10313
|
let N = U.default.readFileSync(P),
|
|
10195
|
-
|
|
10196
|
-
((d[k] =
|
|
10314
|
+
q = await p.uploadAsset(N.toString('base64'));
|
|
10315
|
+
((d[k] = q.url), s || I.succeed(`Uploaded ${O.default.basename(P)} to CDN`));
|
|
10197
10316
|
} catch (N) {
|
|
10198
|
-
let
|
|
10317
|
+
let q = N instanceof Error ? N.message : String(N);
|
|
10199
10318
|
(s
|
|
10200
10319
|
? process.stdout.write(
|
|
10201
|
-
JSON.stringify({ error:
|
|
10320
|
+
JSON.stringify({ error: q }) +
|
|
10202
10321
|
`
|
|
10203
10322
|
`,
|
|
10204
10323
|
)
|
|
10205
|
-
: I.fail(`Upload failed: ${
|
|
10324
|
+
: I.fail(`Upload failed: ${q}`),
|
|
10206
10325
|
process.exit(1));
|
|
10207
10326
|
}
|
|
10208
10327
|
}
|
|
10209
10328
|
}
|
|
10210
10329
|
}
|
|
10211
|
-
await
|
|
10212
|
-
let g = new $(`Uploading local file ${
|
|
10330
|
+
await tr(d, async (k) => {
|
|
10331
|
+
let g = new $(`Uploading local file ${O.default.basename(k)} to CDN...`);
|
|
10213
10332
|
s || g.start();
|
|
10214
10333
|
try {
|
|
10215
10334
|
let P = U.default.readFileSync(k),
|
|
10216
10335
|
I = await p.uploadAsset(P.toString('base64'));
|
|
10217
|
-
return (s || g.succeed(`Uploaded ${
|
|
10336
|
+
return (s || g.succeed(`Uploaded ${O.default.basename(k)} to CDN`), I.url);
|
|
10218
10337
|
} catch (P) {
|
|
10219
10338
|
let I = P instanceof Error ? P.message : String(P);
|
|
10220
10339
|
(s
|
|
@@ -10232,7 +10351,7 @@ async function Qe(e, t) {
|
|
|
10232
10351
|
let f;
|
|
10233
10352
|
try {
|
|
10234
10353
|
if (l > 1) {
|
|
10235
|
-
await
|
|
10354
|
+
await ar(p, e, d, l, { isJson: s, isAsync: o });
|
|
10236
10355
|
return;
|
|
10237
10356
|
}
|
|
10238
10357
|
f = await p.queueJob(e, d);
|
|
@@ -10335,13 +10454,13 @@ ${r.bold('Outputs:')}
|
|
|
10335
10454
|
`),
|
|
10336
10455
|
u)
|
|
10337
10456
|
) {
|
|
10338
|
-
let
|
|
10339
|
-
|
|
10457
|
+
let q = rr(u, g++, k),
|
|
10458
|
+
pt = new $(`Downloading output to ${q}...`).start();
|
|
10340
10459
|
try {
|
|
10341
|
-
(await p.downloadOutput(I.url,
|
|
10342
|
-
|
|
10460
|
+
(await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
|
|
10461
|
+
pt.succeed(`Saved to ${r.bold(q)}`));
|
|
10343
10462
|
} catch (Ie) {
|
|
10344
|
-
|
|
10463
|
+
pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
|
|
10345
10464
|
}
|
|
10346
10465
|
}
|
|
10347
10466
|
} else
|
|
@@ -10354,9 +10473,9 @@ ${I.text}
|
|
|
10354
10473
|
process.stdout.write(`
|
|
10355
10474
|
`);
|
|
10356
10475
|
}
|
|
10357
|
-
var
|
|
10476
|
+
var ci = T(require('node:readline'));
|
|
10358
10477
|
E();
|
|
10359
|
-
async function
|
|
10478
|
+
async function nr(e) {
|
|
10360
10479
|
try {
|
|
10361
10480
|
return (await new M(e, w()).checkKey(), 'ok');
|
|
10362
10481
|
} catch (t) {
|
|
@@ -10367,15 +10486,15 @@ async function ir(e) {
|
|
|
10367
10486
|
return 'unchecked';
|
|
10368
10487
|
}
|
|
10369
10488
|
}
|
|
10370
|
-
function
|
|
10371
|
-
let t =
|
|
10489
|
+
function sr(e) {
|
|
10490
|
+
let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10372
10491
|
return new Promise((i) => {
|
|
10373
10492
|
t.question(e, (a) => {
|
|
10374
10493
|
(t.close(), i(a.trim()));
|
|
10375
10494
|
});
|
|
10376
10495
|
});
|
|
10377
10496
|
}
|
|
10378
|
-
async function
|
|
10497
|
+
async function ae(e, t) {
|
|
10379
10498
|
switch (e) {
|
|
10380
10499
|
case 'login':
|
|
10381
10500
|
case 'set-key': {
|
|
@@ -10387,14 +10506,14 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10387
10506
|
process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
|
|
10388
10507
|
|
|
10389
10508
|
`),
|
|
10390
|
-
(i = await
|
|
10509
|
+
(i = await sr('Enter your Tein API Key (sk_live_...): '))),
|
|
10391
10510
|
!i.startsWith('sk_live_') &&
|
|
10392
10511
|
!i.startsWith('sk_test_') &&
|
|
10393
10512
|
(process.stderr
|
|
10394
10513
|
.write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10395
10514
|
`),
|
|
10396
10515
|
process.exit(1)));
|
|
10397
|
-
let a = await
|
|
10516
|
+
let a = await nr(i);
|
|
10398
10517
|
(a === 'invalid' &&
|
|
10399
10518
|
(process.stderr
|
|
10400
10519
|
.write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -10402,7 +10521,7 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10402
10521
|
process.exit(1)),
|
|
10403
10522
|
Ke({ apiKey: i }),
|
|
10404
10523
|
process.stdout.write(`
|
|
10405
|
-
${r.green('\u2713')} API key saved to ${r.dim(
|
|
10524
|
+
${r.green('\u2713')} API key saved to ${r.dim(le())}
|
|
10406
10525
|
`),
|
|
10407
10526
|
a === 'blocked'
|
|
10408
10527
|
? process.stdout
|
|
@@ -10427,7 +10546,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10427
10546
|
}
|
|
10428
10547
|
(Ke({ apiKey: '' }),
|
|
10429
10548
|
process.stdout
|
|
10430
|
-
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(
|
|
10549
|
+
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(le())}
|
|
10431
10550
|
`));
|
|
10432
10551
|
break;
|
|
10433
10552
|
}
|
|
@@ -10439,7 +10558,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10439
10558
|
(process.stdout.write(`
|
|
10440
10559
|
${r.bold('Tein AI CLI Configuration')}
|
|
10441
10560
|
`),
|
|
10442
|
-
process.stdout.write(` Config file: ${r.dim(
|
|
10561
|
+
process.stdout.write(` Config file: ${r.dim(le())}
|
|
10443
10562
|
`),
|
|
10444
10563
|
process.stdout.write(` API URL: ${r.cyan(a)}
|
|
10445
10564
|
`),
|
|
@@ -10469,10 +10588,10 @@ function _(e) {
|
|
|
10469
10588
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10470
10589
|
: `$${e.toFixed(2)}`;
|
|
10471
10590
|
}
|
|
10472
|
-
function
|
|
10591
|
+
function ui(e) {
|
|
10473
10592
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10474
10593
|
}
|
|
10475
|
-
function
|
|
10594
|
+
function or(e) {
|
|
10476
10595
|
let t = [
|
|
10477
10596
|
['Balance', _(e.balance)],
|
|
10478
10597
|
['Available to this key', _(e.available)],
|
|
@@ -10492,8 +10611,8 @@ function rr(e) {
|
|
|
10492
10611
|
`${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
|
|
10493
10612
|
]),
|
|
10494
10613
|
t.push(
|
|
10495
|
-
['This month', `${_(e.usage.this_month.spend)} on ${
|
|
10496
|
-
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${
|
|
10614
|
+
['This month', `${_(e.usage.this_month.spend)} on ${ui(e.usage.this_month.requests)}`],
|
|
10615
|
+
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${ui(e.usage.last_30_days.requests)}`],
|
|
10497
10616
|
[
|
|
10498
10617
|
'Auto top up',
|
|
10499
10618
|
e.auto_top_up.enabled
|
|
@@ -10506,7 +10625,7 @@ function rr(e) {
|
|
|
10506
10625
|
let a = Math.max(...t.map(([n]) => n.length));
|
|
10507
10626
|
return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
|
|
10508
10627
|
}
|
|
10509
|
-
async function
|
|
10628
|
+
async function mi(e) {
|
|
10510
10629
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10511
10630
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10512
10631
|
a = !!e.json;
|
|
@@ -10550,13 +10669,13 @@ async function pi(e) {
|
|
|
10550
10669
|
}
|
|
10551
10670
|
process.stdout.write(`
|
|
10552
10671
|
${r.bold('Tein balance')}
|
|
10553
|
-
${
|
|
10672
|
+
${or(n).join(`
|
|
10554
10673
|
`)}
|
|
10555
10674
|
|
|
10556
10675
|
`);
|
|
10557
10676
|
}
|
|
10558
10677
|
E();
|
|
10559
|
-
function
|
|
10678
|
+
function fi(e) {
|
|
10560
10679
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10561
10680
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
|
|
10562
10681
|
return (
|
|
@@ -10570,7 +10689,7 @@ function ci(e) {
|
|
|
10570
10689
|
new M(t, i)
|
|
10571
10690
|
);
|
|
10572
10691
|
}
|
|
10573
|
-
function
|
|
10692
|
+
function gi(e, t) {
|
|
10574
10693
|
let i = {};
|
|
10575
10694
|
for (let a of t) {
|
|
10576
10695
|
let n = e[a];
|
|
@@ -10578,7 +10697,7 @@ function ui(e, t) {
|
|
|
10578
10697
|
}
|
|
10579
10698
|
return i;
|
|
10580
10699
|
}
|
|
10581
|
-
async function
|
|
10700
|
+
async function hi(e, t) {
|
|
10582
10701
|
try {
|
|
10583
10702
|
return await t();
|
|
10584
10703
|
} catch (i) {
|
|
@@ -10602,7 +10721,7 @@ async function mi(e, t) {
|
|
|
10602
10721
|
process.exit(v));
|
|
10603
10722
|
}
|
|
10604
10723
|
}
|
|
10605
|
-
function
|
|
10724
|
+
function et(e) {
|
|
10606
10725
|
let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
|
|
10607
10726
|
i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
|
|
10608
10727
|
return e.map(
|
|
@@ -10613,7 +10732,7 @@ function Ze(e) {
|
|
|
10613
10732
|
.trimEnd()}`,
|
|
10614
10733
|
);
|
|
10615
10734
|
}
|
|
10616
|
-
function
|
|
10735
|
+
function lr(e) {
|
|
10617
10736
|
let t = e.summary,
|
|
10618
10737
|
i = [
|
|
10619
10738
|
` 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}` : ''}`,
|
|
@@ -10625,7 +10744,7 @@ function nr(e) {
|
|
|
10625
10744
|
e.by_channel.length &&
|
|
10626
10745
|
(i.push('', r.bold('By channel')),
|
|
10627
10746
|
i.push(
|
|
10628
|
-
...
|
|
10747
|
+
...et([
|
|
10629
10748
|
['Channel', 'Spend', 'Requests'],
|
|
10630
10749
|
...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
|
|
10631
10750
|
]),
|
|
@@ -10633,7 +10752,7 @@ function nr(e) {
|
|
|
10633
10752
|
e.by_model.length &&
|
|
10634
10753
|
(i.push('', r.bold('By model')),
|
|
10635
10754
|
i.push(
|
|
10636
|
-
...
|
|
10755
|
+
...et([
|
|
10637
10756
|
['Model', 'Spend', 'Requests', 'Failed'],
|
|
10638
10757
|
...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
|
|
10639
10758
|
]),
|
|
@@ -10641,10 +10760,10 @@ function nr(e) {
|
|
|
10641
10760
|
i
|
|
10642
10761
|
);
|
|
10643
10762
|
}
|
|
10644
|
-
async function
|
|
10763
|
+
async function yi(e) {
|
|
10645
10764
|
let t = !!e.json,
|
|
10646
|
-
i =
|
|
10647
|
-
a = await
|
|
10765
|
+
i = fi(e),
|
|
10766
|
+
a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
|
|
10648
10767
|
if (t) {
|
|
10649
10768
|
process.stdout.write(
|
|
10650
10769
|
JSON.stringify(a, null, 2) +
|
|
@@ -10655,14 +10774,14 @@ async function fi(e) {
|
|
|
10655
10774
|
}
|
|
10656
10775
|
process.stdout.write(`
|
|
10657
10776
|
${r.bold('Tein usage')}
|
|
10658
|
-
${
|
|
10777
|
+
${lr(a).join(`
|
|
10659
10778
|
`)}
|
|
10660
10779
|
|
|
10661
10780
|
`);
|
|
10662
10781
|
}
|
|
10663
|
-
function
|
|
10782
|
+
function dr(e) {
|
|
10664
10783
|
return e.data.length
|
|
10665
|
-
?
|
|
10784
|
+
? et([
|
|
10666
10785
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
10667
10786
|
...e.data.map((t) => [
|
|
10668
10787
|
t.created_at.slice(0, 16).replace('T', ' '),
|
|
@@ -10673,10 +10792,10 @@ function sr(e) {
|
|
|
10673
10792
|
])
|
|
10674
10793
|
: [' No transactions yet.'];
|
|
10675
10794
|
}
|
|
10676
|
-
async function
|
|
10795
|
+
async function bi(e) {
|
|
10677
10796
|
let t = !!e.json,
|
|
10678
|
-
i =
|
|
10679
|
-
a = await
|
|
10797
|
+
i = fi(e),
|
|
10798
|
+
a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
|
|
10680
10799
|
if (t) {
|
|
10681
10800
|
process.stdout.write(
|
|
10682
10801
|
JSON.stringify(a, null, 2) +
|
|
@@ -10692,18 +10811,18 @@ async function gi(e) {
|
|
|
10692
10811
|
: '';
|
|
10693
10812
|
process.stdout.write(`
|
|
10694
10813
|
${r.bold('Tein balance history')}
|
|
10695
|
-
${
|
|
10814
|
+
${dr(a).join(`
|
|
10696
10815
|
`)}${n}
|
|
10697
10816
|
|
|
10698
10817
|
`);
|
|
10699
10818
|
}
|
|
10700
10819
|
E();
|
|
10701
10820
|
Ce();
|
|
10702
|
-
|
|
10703
|
-
var
|
|
10704
|
-
async function
|
|
10821
|
+
te();
|
|
10822
|
+
var pr = 3e3;
|
|
10823
|
+
async function ki(e) {
|
|
10705
10824
|
try {
|
|
10706
|
-
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
10825
|
+
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
|
|
10707
10826
|
if (!t.ok) return;
|
|
10708
10827
|
let i = await t.json(),
|
|
10709
10828
|
a = {};
|
|
@@ -10711,18 +10830,18 @@ async function hi(e) {
|
|
|
10711
10830
|
let s = String(n.modelSlug ?? '');
|
|
10712
10831
|
J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
10713
10832
|
}
|
|
10714
|
-
|
|
10833
|
+
ii(a);
|
|
10715
10834
|
} catch {}
|
|
10716
10835
|
}
|
|
10717
|
-
var
|
|
10718
|
-
|
|
10719
|
-
async function
|
|
10720
|
-
await
|
|
10836
|
+
var cr = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
10837
|
+
ur = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
10838
|
+
async function wi(e, t) {
|
|
10839
|
+
await ki(t);
|
|
10721
10840
|
let i = D();
|
|
10722
10841
|
if (e) {
|
|
10723
10842
|
let s = e.toLowerCase(),
|
|
10724
|
-
o =
|
|
10725
|
-
i =
|
|
10843
|
+
o = ur[s] ?? s;
|
|
10844
|
+
i = cr.has(o)
|
|
10726
10845
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
10727
10846
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
10728
10847
|
}
|
|
@@ -10760,8 +10879,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
10760
10879
|
|
|
10761
10880
|
`);
|
|
10762
10881
|
}
|
|
10763
|
-
async function
|
|
10764
|
-
J.has(e) && (await
|
|
10882
|
+
async function xi(e, t) {
|
|
10883
|
+
J.has(e) && (await ki(t));
|
|
10765
10884
|
let i = H(e);
|
|
10766
10885
|
(i ||
|
|
10767
10886
|
(process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -10842,9 +10961,9 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
|
|
|
10842
10961
|
`);
|
|
10843
10962
|
}
|
|
10844
10963
|
E();
|
|
10845
|
-
|
|
10846
|
-
var
|
|
10847
|
-
|
|
10964
|
+
tt();
|
|
10965
|
+
var mr = 1e4,
|
|
10966
|
+
at = {
|
|
10848
10967
|
price: '',
|
|
10849
10968
|
creativeMode: 'Creative mode',
|
|
10850
10969
|
priority: 'Priority',
|
|
@@ -10854,22 +10973,22 @@ var pr = 1e4,
|
|
|
10854
10973
|
priorityDraft: 'Priority + Draft',
|
|
10855
10974
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
10856
10975
|
},
|
|
10857
|
-
|
|
10858
|
-
|
|
10976
|
+
fr = Object.keys(at),
|
|
10977
|
+
gr = {
|
|
10859
10978
|
creativeMode: 'unfiltered',
|
|
10860
10979
|
creativeModePriority: 'unfilteredPriority',
|
|
10861
10980
|
creativeModeDraft: 'unfilteredDraft',
|
|
10862
10981
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
10863
10982
|
};
|
|
10864
|
-
function
|
|
10865
|
-
let i =
|
|
10983
|
+
function hr(e, t) {
|
|
10984
|
+
let i = gr[t];
|
|
10866
10985
|
return e[t] ?? (i ? e[i] : void 0);
|
|
10867
10986
|
}
|
|
10868
|
-
async function
|
|
10987
|
+
async function yr(e, t) {
|
|
10869
10988
|
let i = `${w(e)}${xe(t)}`,
|
|
10870
10989
|
a;
|
|
10871
10990
|
try {
|
|
10872
|
-
a = await fetch(i, { signal: AbortSignal.timeout(
|
|
10991
|
+
a = await fetch(i, { signal: AbortSignal.timeout(mr) });
|
|
10873
10992
|
} catch {
|
|
10874
10993
|
throw new Error(`Could not reach ${i}`);
|
|
10875
10994
|
}
|
|
@@ -10885,18 +11004,18 @@ async function fr(e, t) {
|
|
|
10885
11004
|
}
|
|
10886
11005
|
return n;
|
|
10887
11006
|
}
|
|
10888
|
-
function
|
|
11007
|
+
function it(e) {
|
|
10889
11008
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
10890
11009
|
[i, a = ''] = t.split('.');
|
|
10891
11010
|
return `$${i}.${a.padEnd(2, '0')}`;
|
|
10892
11011
|
}
|
|
10893
|
-
function
|
|
11012
|
+
function rt(e) {
|
|
10894
11013
|
if (!e || typeof e.starter != 'number') return null;
|
|
10895
11014
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
10896
11015
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
10897
|
-
return `Starter ${
|
|
11016
|
+
return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
|
|
10898
11017
|
}
|
|
10899
|
-
function
|
|
11018
|
+
function br(e) {
|
|
10900
11019
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
10901
11020
|
let t = [];
|
|
10902
11021
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -10908,33 +11027,33 @@ function gr(e) {
|
|
|
10908
11027
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
10909
11028
|
);
|
|
10910
11029
|
}
|
|
10911
|
-
function
|
|
10912
|
-
let i =
|
|
10913
|
-
for (let a of
|
|
10914
|
-
let n =
|
|
11030
|
+
function kr(e, t) {
|
|
11031
|
+
let i = br(e);
|
|
11032
|
+
for (let a of fr) {
|
|
11033
|
+
let n = rt(hr(e, a));
|
|
10915
11034
|
if (!n) continue;
|
|
10916
|
-
let s =
|
|
11035
|
+
let s = at[a] ? ` (${at[a]})` : '';
|
|
10917
11036
|
t.push(` ${i}${s} ${n}`);
|
|
10918
11037
|
}
|
|
10919
11038
|
}
|
|
10920
|
-
function
|
|
11039
|
+
function wr(e, t) {
|
|
10921
11040
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
10922
11041
|
t.push(
|
|
10923
11042
|
` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
10924
11043
|
);
|
|
10925
|
-
for (let n of e.variants ?? [])
|
|
11044
|
+
for (let n of e.variants ?? []) kr(n, t);
|
|
10926
11045
|
let a = e.addons;
|
|
10927
11046
|
if (Array.isArray(a))
|
|
10928
11047
|
for (let n of a) {
|
|
10929
11048
|
if (!n || typeof n != 'object') continue;
|
|
10930
11049
|
let s = n,
|
|
10931
11050
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
10932
|
-
u =
|
|
11051
|
+
u = rt(s.price);
|
|
10933
11052
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
10934
11053
|
}
|
|
10935
11054
|
t.push('');
|
|
10936
11055
|
}
|
|
10937
|
-
function
|
|
11056
|
+
function xr(e) {
|
|
10938
11057
|
let t = [],
|
|
10939
11058
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
10940
11059
|
(t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -10956,7 +11075,7 @@ function br(e) {
|
|
|
10956
11075
|
});
|
|
10957
11076
|
for (let l of s) {
|
|
10958
11077
|
t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
10959
|
-
for (let c of a.get(l) ?? [])
|
|
11078
|
+
for (let c of a.get(l) ?? []) wr(c, t);
|
|
10960
11079
|
}
|
|
10961
11080
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
10962
11081
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -10973,7 +11092,7 @@ function br(e) {
|
|
|
10973
11092
|
t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
|
|
10974
11093
|
for (let m of d) {
|
|
10975
11094
|
let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
10976
|
-
f =
|
|
11095
|
+
f = rt(m.prices);
|
|
10977
11096
|
f && t.push(` ${y} ${f}`);
|
|
10978
11097
|
}
|
|
10979
11098
|
t.push('');
|
|
@@ -10986,10 +11105,10 @@ function br(e) {
|
|
|
10986
11105
|
`
|
|
10987
11106
|
);
|
|
10988
11107
|
}
|
|
10989
|
-
async function
|
|
11108
|
+
async function _i(e) {
|
|
10990
11109
|
let t;
|
|
10991
11110
|
try {
|
|
10992
|
-
t = await
|
|
11111
|
+
t = await yr(e.apiUrl, e.model);
|
|
10993
11112
|
} catch (i) {
|
|
10994
11113
|
let a = i instanceof Error ? i.message : String(i);
|
|
10995
11114
|
(process.stderr.write(`${r.red('Error:')} ${a}
|
|
@@ -11000,12 +11119,12 @@ async function ki(e) {
|
|
|
11000
11119
|
e.json
|
|
11001
11120
|
? `${JSON.stringify(t, null, 2)}
|
|
11002
11121
|
`
|
|
11003
|
-
:
|
|
11122
|
+
: xr(t),
|
|
11004
11123
|
);
|
|
11005
11124
|
}
|
|
11006
|
-
var
|
|
11125
|
+
var Pi = T(require('node:path'));
|
|
11007
11126
|
E();
|
|
11008
|
-
async function
|
|
11127
|
+
async function Ii(e, t) {
|
|
11009
11128
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11010
11129
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
11011
11130
|
(i ||
|
|
@@ -11100,7 +11219,7 @@ ${r.bold('Outputs:')}
|
|
|
11100
11219
|
) {
|
|
11101
11220
|
let p = new $(`Downloading output to ${o}...`).start();
|
|
11102
11221
|
try {
|
|
11103
|
-
(await u.downloadOutput(d.url,
|
|
11222
|
+
(await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
|
|
11104
11223
|
p.succeed(`Saved to ${r.bold(o)}`));
|
|
11105
11224
|
} catch (m) {
|
|
11106
11225
|
p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -11115,10 +11234,10 @@ ${d.text}
|
|
|
11115
11234
|
process.stdout.write(`
|
|
11116
11235
|
`);
|
|
11117
11236
|
}
|
|
11118
|
-
var
|
|
11119
|
-
|
|
11237
|
+
var nt = T(require('node:fs')),
|
|
11238
|
+
st = T(require('node:path'));
|
|
11120
11239
|
E();
|
|
11121
|
-
async function
|
|
11240
|
+
async function vi(e, t = {}) {
|
|
11122
11241
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11123
11242
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
11124
11243
|
n = !!t.json;
|
|
@@ -11135,13 +11254,13 @@ async function _i(e, t = {}) {
|
|
|
11135
11254
|
process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
|
|
11136
11255
|
`),
|
|
11137
11256
|
process.exit(1)));
|
|
11138
|
-
let s =
|
|
11139
|
-
|
|
11257
|
+
let s = st.default.resolve(e);
|
|
11258
|
+
nt.default.existsSync(s) ||
|
|
11140
11259
|
(process.stderr.write(`${r.red('Error:')} File not found: ${s}
|
|
11141
11260
|
`),
|
|
11142
11261
|
process.exit(1));
|
|
11143
|
-
let o =
|
|
11144
|
-
l =
|
|
11262
|
+
let o = st.default.basename(s),
|
|
11263
|
+
l = nt.default.readFileSync(s).toString('base64'),
|
|
11145
11264
|
c = new M(i, a),
|
|
11146
11265
|
d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
|
|
11147
11266
|
n || d.start();
|
|
@@ -11182,10 +11301,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
|
|
|
11182
11301
|
process.exit(m ? m.exitCode : v));
|
|
11183
11302
|
}
|
|
11184
11303
|
}
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
function
|
|
11304
|
+
ne();
|
|
11305
|
+
te();
|
|
11306
|
+
De();
|
|
11307
|
+
function Fi() {
|
|
11189
11308
|
process.stdout.write(`
|
|
11190
11309
|
${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
11191
11310
|
|
|
@@ -11267,11 +11386,11 @@ ${r.bold('EXAMPLES:')}
|
|
|
11267
11386
|
|
|
11268
11387
|
`);
|
|
11269
11388
|
}
|
|
11270
|
-
async function
|
|
11389
|
+
async function Fr() {
|
|
11271
11390
|
let e = process.argv.slice(2),
|
|
11272
|
-
t =
|
|
11391
|
+
t = pi(e);
|
|
11273
11392
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
11274
|
-
|
|
11393
|
+
Fi();
|
|
11275
11394
|
return;
|
|
11276
11395
|
}
|
|
11277
11396
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -11281,31 +11400,31 @@ async function Vr() {
|
|
|
11281
11400
|
}
|
|
11282
11401
|
switch (t.command) {
|
|
11283
11402
|
case 'auth': {
|
|
11284
|
-
await
|
|
11403
|
+
await ae(t.subcommand, t.options.key);
|
|
11285
11404
|
break;
|
|
11286
11405
|
}
|
|
11287
11406
|
case 'login': {
|
|
11288
|
-
await
|
|
11407
|
+
await ae('login', t.options.key);
|
|
11289
11408
|
break;
|
|
11290
11409
|
}
|
|
11291
11410
|
case 'logout': {
|
|
11292
|
-
await
|
|
11411
|
+
await ae('logout');
|
|
11293
11412
|
break;
|
|
11294
11413
|
}
|
|
11295
11414
|
case 'whoami': {
|
|
11296
|
-
await
|
|
11415
|
+
await ae('status');
|
|
11297
11416
|
break;
|
|
11298
11417
|
}
|
|
11299
11418
|
case 'models':
|
|
11300
11419
|
case 'list': {
|
|
11301
|
-
await
|
|
11420
|
+
await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
11302
11421
|
break;
|
|
11303
11422
|
}
|
|
11304
11423
|
case 'pricing':
|
|
11305
11424
|
case 'prices': {
|
|
11306
11425
|
let i = t.options.model,
|
|
11307
11426
|
a = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
11308
|
-
await
|
|
11427
|
+
await _i({
|
|
11309
11428
|
model: a,
|
|
11310
11429
|
json: !!t.options.json,
|
|
11311
11430
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -11320,40 +11439,40 @@ async function Vr() {
|
|
|
11320
11439
|
process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
|
|
11321
11440
|
`),
|
|
11322
11441
|
process.exit(1)),
|
|
11323
|
-
await
|
|
11442
|
+
await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
11324
11443
|
break;
|
|
11325
11444
|
}
|
|
11326
11445
|
case 'upload': {
|
|
11327
11446
|
let i = t.subcommand || '';
|
|
11328
|
-
await
|
|
11447
|
+
await vi(i, t.options);
|
|
11329
11448
|
break;
|
|
11330
11449
|
}
|
|
11331
11450
|
case 'run':
|
|
11332
11451
|
case 'generate': {
|
|
11333
11452
|
let i = t.subcommand || '';
|
|
11334
|
-
await
|
|
11453
|
+
await Ze(i, t.options);
|
|
11335
11454
|
break;
|
|
11336
11455
|
}
|
|
11337
11456
|
case 'status': {
|
|
11338
11457
|
let i = t.subcommand || '';
|
|
11339
|
-
await
|
|
11458
|
+
await Ii(i, t.options);
|
|
11340
11459
|
break;
|
|
11341
11460
|
}
|
|
11342
11461
|
case 'balance': {
|
|
11343
|
-
await
|
|
11462
|
+
await mi(t.options);
|
|
11344
11463
|
break;
|
|
11345
11464
|
}
|
|
11346
11465
|
case 'usage': {
|
|
11347
|
-
await
|
|
11466
|
+
await yi(t.options);
|
|
11348
11467
|
break;
|
|
11349
11468
|
}
|
|
11350
11469
|
case 'transactions':
|
|
11351
11470
|
case 'history': {
|
|
11352
|
-
await
|
|
11471
|
+
await bi(t.options);
|
|
11353
11472
|
break;
|
|
11354
11473
|
}
|
|
11355
11474
|
case 'mcp': {
|
|
11356
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
11475
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
|
|
11357
11476
|
await i();
|
|
11358
11477
|
break;
|
|
11359
11478
|
}
|
|
@@ -11366,15 +11485,15 @@ ${r.red('Error:')} Unknown command or model "${t.command}".
|
|
|
11366
11485
|
Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
|
|
11367
11486
|
`),
|
|
11368
11487
|
process.exit(v)),
|
|
11369
|
-
await
|
|
11488
|
+
await Ze(t.command, t.options));
|
|
11370
11489
|
return;
|
|
11371
11490
|
}
|
|
11372
|
-
|
|
11491
|
+
Fi();
|
|
11373
11492
|
break;
|
|
11374
11493
|
}
|
|
11375
11494
|
}
|
|
11376
11495
|
}
|
|
11377
|
-
|
|
11496
|
+
Fr().catch((e) => {
|
|
11378
11497
|
(e instanceof b &&
|
|
11379
11498
|
(process.stderr.write(`
|
|
11380
11499
|
${r.red('Error:')} ${K(e).join(`
|