@teinai/cli 1.1.35 → 1.1.37
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 +656 -620
- 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',
|
|
@@ -6198,8 +6198,13 @@ var de,
|
|
|
6198
6198
|
],
|
|
6199
6199
|
};
|
|
6200
6200
|
});
|
|
6201
|
+
var _t,
|
|
6202
|
+
Pt = h(() => {
|
|
6203
|
+
'use strict';
|
|
6204
|
+
_t = [];
|
|
6205
|
+
});
|
|
6201
6206
|
var pe,
|
|
6202
|
-
|
|
6207
|
+
It,
|
|
6203
6208
|
$e = h(() => {
|
|
6204
6209
|
'use strict';
|
|
6205
6210
|
((pe = [
|
|
@@ -6277,12 +6282,12 @@ var pe,
|
|
|
6277
6282
|
from: { variant: 'swap' },
|
|
6278
6283
|
},
|
|
6279
6284
|
]),
|
|
6280
|
-
(
|
|
6285
|
+
(It = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
6281
6286
|
});
|
|
6282
|
-
function
|
|
6287
|
+
function Oe(e, t) {
|
|
6283
6288
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
6284
6289
|
}
|
|
6285
|
-
function
|
|
6290
|
+
function oa(e, t) {
|
|
6286
6291
|
if (e === 'seedance-2-mini') return 'mini';
|
|
6287
6292
|
if (e !== 'seedance-2') return;
|
|
6288
6293
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -6292,91 +6297,98 @@ function ra(e, t) {
|
|
|
6292
6297
|
? 'fast'
|
|
6293
6298
|
: 'standard';
|
|
6294
6299
|
}
|
|
6295
|
-
function
|
|
6300
|
+
function la(e, t) {
|
|
6296
6301
|
let i = e
|
|
6297
6302
|
.trim()
|
|
6298
6303
|
.toLowerCase()
|
|
6299
6304
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
6300
6305
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
6301
|
-
let n =
|
|
6302
|
-
s = Ee.get(
|
|
6306
|
+
let n = oa(i, t),
|
|
6307
|
+
s = Ee.get(Oe('seedance-2', n));
|
|
6303
6308
|
return s ? s.slug : null;
|
|
6304
6309
|
}
|
|
6305
|
-
let a = ce.get(i) ?? Ee.get(
|
|
6310
|
+
let a = ce.get(i) ?? Ee.get(Oe(i));
|
|
6306
6311
|
return a ? a.slug : null;
|
|
6307
6312
|
}
|
|
6308
|
-
function
|
|
6309
|
-
return ce.has(e) && !(
|
|
6313
|
+
function pa(e, t) {
|
|
6314
|
+
return ce.has(e) && !(da.has(e) && t) ? e : la(e, t);
|
|
6310
6315
|
}
|
|
6311
|
-
function
|
|
6312
|
-
let i =
|
|
6316
|
+
function Y(e, t) {
|
|
6317
|
+
let i = pa(e, t);
|
|
6313
6318
|
return i ? (ce.get(i) ?? null) : null;
|
|
6314
6319
|
}
|
|
6315
6320
|
function ue() {
|
|
6316
|
-
return
|
|
6321
|
+
return Kt;
|
|
6317
6322
|
}
|
|
6318
|
-
var
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6323
|
+
var qe,
|
|
6324
|
+
Tt,
|
|
6325
|
+
Mt,
|
|
6326
|
+
Kt,
|
|
6327
|
+
na,
|
|
6322
6328
|
ce,
|
|
6323
6329
|
Ee,
|
|
6324
|
-
|
|
6325
|
-
aa,
|
|
6326
|
-
Ae,
|
|
6330
|
+
vt,
|
|
6327
6331
|
sa,
|
|
6332
|
+
Ae,
|
|
6333
|
+
da,
|
|
6328
6334
|
G = h(() => {
|
|
6329
6335
|
'use strict';
|
|
6330
|
-
kt();
|
|
6331
6336
|
wt();
|
|
6337
|
+
xt();
|
|
6338
|
+
Pt();
|
|
6332
6339
|
$e();
|
|
6333
|
-
((
|
|
6340
|
+
((qe = {
|
|
6334
6341
|
...de,
|
|
6335
|
-
families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !
|
|
6336
|
-
models: de.models.filter((e) => !
|
|
6342
|
+
families: de.families.map((e) => ({ ...e, models: e.models.filter((t) => !W(t)) })),
|
|
6343
|
+
models: de.models.filter((e) => !W(e.slug)),
|
|
6337
6344
|
}),
|
|
6338
|
-
(
|
|
6339
|
-
(
|
|
6340
|
-
(
|
|
6341
|
-
|
|
6342
|
-
...
|
|
6343
|
-
|
|
6344
|
-
.
|
|
6345
|
+
(Tt = pe.filter((e) => !W(e.slug))),
|
|
6346
|
+
(Mt = _t.filter((e) => !W(e.slug) && !qe.models.some((t) => t.slug === e.slug))),
|
|
6347
|
+
(Kt = [...qe.models, ...Mt, ...Tt]),
|
|
6348
|
+
(na = [
|
|
6349
|
+
...qe.families.map((e) => {
|
|
6350
|
+
let t = Mt.filter((i) => i.family === e.slug).map((i) => i.slug);
|
|
6351
|
+
return t.length ? { ...e, models: [...e.models, ...t] } : e;
|
|
6352
|
+
}),
|
|
6353
|
+
...It.map((e) => ({
|
|
6354
|
+
...e,
|
|
6355
|
+
models: Tt.filter((t) => t.family === e.slug).map((t) => t.slug),
|
|
6356
|
+
})).filter((e) => e.models.length > 0),
|
|
6345
6357
|
]),
|
|
6346
6358
|
(ce = new Map()),
|
|
6347
6359
|
(Ee = new Map()),
|
|
6348
|
-
(
|
|
6349
|
-
(
|
|
6360
|
+
(vt = new Map()),
|
|
6361
|
+
(sa = new Map()),
|
|
6350
6362
|
(Ae = new Map()));
|
|
6351
|
-
for (let e of
|
|
6352
|
-
(ce.set(e.slug, e), Ee.set(
|
|
6353
|
-
for (let t of e.variants)
|
|
6363
|
+
for (let e of Kt) {
|
|
6364
|
+
(ce.set(e.slug, e), Ee.set(Oe(e.api.model, e.api.quality), e));
|
|
6365
|
+
for (let t of e.variants) vt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
6354
6366
|
for (let t of e.editVariants ?? [])
|
|
6355
|
-
|
|
6356
|
-
for (let t of e.addons ?? [])
|
|
6367
|
+
vt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6368
|
+
for (let t of e.addons ?? []) sa.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6357
6369
|
Ae.set(e.slug, e.family);
|
|
6358
6370
|
}
|
|
6359
|
-
for (let e of
|
|
6360
|
-
|
|
6371
|
+
for (let e of na) for (let t of e.models) Ae.has(t) || Ae.set(t, e.slug);
|
|
6372
|
+
da = new Set(['seedance-2']);
|
|
6361
6373
|
});
|
|
6362
6374
|
function me(e) {
|
|
6363
6375
|
let t = e.from?.variant;
|
|
6364
6376
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
6365
6377
|
}
|
|
6366
|
-
function
|
|
6378
|
+
function Re(e) {
|
|
6367
6379
|
if (e.endpoints?.length)
|
|
6368
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6369
|
-
?
|
|
6380
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === St)
|
|
6381
|
+
? St
|
|
6370
6382
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6371
6383
|
}
|
|
6372
|
-
var
|
|
6373
|
-
|
|
6384
|
+
var St,
|
|
6385
|
+
Le = h(() => {
|
|
6374
6386
|
'use strict';
|
|
6375
6387
|
G();
|
|
6376
|
-
|
|
6388
|
+
St = 'dynamic';
|
|
6377
6389
|
});
|
|
6378
6390
|
var fe,
|
|
6379
|
-
|
|
6391
|
+
De = h(() => {
|
|
6380
6392
|
'use strict';
|
|
6381
6393
|
fe = {
|
|
6382
6394
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -6388,29 +6400,29 @@ var fe,
|
|
|
6388
6400
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
6389
6401
|
};
|
|
6390
6402
|
});
|
|
6391
|
-
var
|
|
6403
|
+
var Ct = h(() => {
|
|
6392
6404
|
'use strict';
|
|
6393
6405
|
});
|
|
6394
|
-
function
|
|
6395
|
-
return typeof t == 'string' && (
|
|
6406
|
+
function $t(e, t) {
|
|
6407
|
+
return typeof t == 'string' && (ca[e]?.includes(t) ?? !1);
|
|
6396
6408
|
}
|
|
6397
|
-
var
|
|
6398
|
-
|
|
6409
|
+
var ca,
|
|
6410
|
+
Et = h(() => {
|
|
6399
6411
|
'use strict';
|
|
6400
6412
|
G();
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6413
|
+
Le();
|
|
6414
|
+
Ct();
|
|
6415
|
+
ca = {};
|
|
6404
6416
|
});
|
|
6405
|
-
function
|
|
6406
|
-
return e === 'nano-banana-pro' ?
|
|
6417
|
+
function At(e) {
|
|
6418
|
+
return e === 'nano-banana-pro' ? ua : ma;
|
|
6407
6419
|
}
|
|
6408
|
-
var
|
|
6409
|
-
|
|
6410
|
-
|
|
6420
|
+
var ua,
|
|
6421
|
+
ma,
|
|
6422
|
+
Ot = h(() => {
|
|
6411
6423
|
'use strict';
|
|
6412
|
-
((
|
|
6413
|
-
(
|
|
6424
|
+
((ua = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6425
|
+
(ma = [
|
|
6414
6426
|
'auto',
|
|
6415
6427
|
'1:1',
|
|
6416
6428
|
'1:4',
|
|
@@ -6428,10 +6440,10 @@ var da,
|
|
|
6428
6440
|
'21:9',
|
|
6429
6441
|
]));
|
|
6430
6442
|
});
|
|
6431
|
-
var
|
|
6432
|
-
|
|
6443
|
+
var qt,
|
|
6444
|
+
Rt = h(() => {
|
|
6433
6445
|
'use strict';
|
|
6434
|
-
|
|
6446
|
+
qt = [
|
|
6435
6447
|
'prompt',
|
|
6436
6448
|
'system',
|
|
6437
6449
|
'messages',
|
|
@@ -6445,10 +6457,10 @@ var Et,
|
|
|
6445
6457
|
'endpoint',
|
|
6446
6458
|
];
|
|
6447
6459
|
});
|
|
6448
|
-
var
|
|
6449
|
-
|
|
6460
|
+
var Lt,
|
|
6461
|
+
Dt = h(() => {
|
|
6450
6462
|
'use strict';
|
|
6451
|
-
|
|
6463
|
+
Lt = [
|
|
6452
6464
|
{
|
|
6453
6465
|
slug: 'claude-fable-5-1',
|
|
6454
6466
|
family: 'fable-5-1',
|
|
@@ -6517,13 +6529,13 @@ var qt,
|
|
|
6517
6529
|
},
|
|
6518
6530
|
];
|
|
6519
6531
|
});
|
|
6520
|
-
function
|
|
6532
|
+
function Vt(e) {
|
|
6521
6533
|
return `$${e}`;
|
|
6522
6534
|
}
|
|
6523
|
-
function
|
|
6524
|
-
return
|
|
6535
|
+
function Ve(e, t, i) {
|
|
6536
|
+
return Y(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
6525
6537
|
}
|
|
6526
|
-
function
|
|
6538
|
+
function fa(e) {
|
|
6527
6539
|
return [
|
|
6528
6540
|
{
|
|
6529
6541
|
name: 'prompt',
|
|
@@ -6589,13 +6601,13 @@ function ca(e) {
|
|
|
6589
6601
|
},
|
|
6590
6602
|
];
|
|
6591
6603
|
}
|
|
6592
|
-
function
|
|
6604
|
+
function Nt() {
|
|
6593
6605
|
return Object.fromEntries(
|
|
6594
|
-
|
|
6595
|
-
let t =
|
|
6596
|
-
i =
|
|
6597
|
-
a =
|
|
6598
|
-
n = t != null && i != null ? `${
|
|
6606
|
+
Lt.map((e) => {
|
|
6607
|
+
let t = Ve(e.slug, 'cheap', 'input'),
|
|
6608
|
+
i = Ve(e.slug, 'cheap', 'output'),
|
|
6609
|
+
a = Ve(e.slug, 'stable', 'input') != null,
|
|
6610
|
+
n = t != null && i != null ? `${Vt(t)}/M in \xB7 ${Vt(i)}/M out` : '',
|
|
6599
6611
|
s = {
|
|
6600
6612
|
slug: e.slug,
|
|
6601
6613
|
name: e.name,
|
|
@@ -6606,50 +6618,50 @@ function Lt() {
|
|
|
6606
6618
|
priceFormatted: n,
|
|
6607
6619
|
unit: '/M tokens',
|
|
6608
6620
|
primaryToolName: 'run_task',
|
|
6609
|
-
parameters:
|
|
6621
|
+
parameters: fa(a),
|
|
6610
6622
|
};
|
|
6611
6623
|
return [e.slug, s];
|
|
6612
6624
|
}),
|
|
6613
6625
|
);
|
|
6614
6626
|
}
|
|
6615
|
-
var
|
|
6627
|
+
var Ut = h(() => {
|
|
6616
6628
|
'use strict';
|
|
6617
|
-
|
|
6629
|
+
Dt();
|
|
6618
6630
|
G();
|
|
6619
6631
|
});
|
|
6620
6632
|
function ge(e) {
|
|
6621
|
-
return e ?
|
|
6633
|
+
return e ? ha.get(e) : void 0;
|
|
6622
6634
|
}
|
|
6623
|
-
function
|
|
6635
|
+
function Gt(e, t) {
|
|
6624
6636
|
return !e.aspects?.length || e.sourceFramedModes?.includes(t)
|
|
6625
6637
|
? null
|
|
6626
6638
|
: e.adaptiveModes?.includes(t)
|
|
6627
6639
|
? [...e.aspects, 'adaptive']
|
|
6628
6640
|
: [...e.aspects];
|
|
6629
6641
|
}
|
|
6630
|
-
function
|
|
6642
|
+
function Ht(e, t, i) {
|
|
6631
6643
|
return e.modes.includes('motion_control')
|
|
6632
6644
|
? t === 'motion_control'
|
|
6633
|
-
? !
|
|
6634
|
-
: !
|
|
6645
|
+
? !ba.includes(i)
|
|
6646
|
+
: !ya.includes(i)
|
|
6635
6647
|
: !0;
|
|
6636
6648
|
}
|
|
6637
|
-
var
|
|
6638
|
-
ua,
|
|
6639
|
-
Nt,
|
|
6640
|
-
bn,
|
|
6641
|
-
ma,
|
|
6642
|
-
Ut,
|
|
6643
|
-
Ve,
|
|
6644
|
-
kn,
|
|
6645
|
-
Ne,
|
|
6646
|
-
fa,
|
|
6649
|
+
var Ft,
|
|
6647
6650
|
ga,
|
|
6648
|
-
|
|
6651
|
+
Bt,
|
|
6652
|
+
In,
|
|
6653
|
+
ha,
|
|
6654
|
+
jt,
|
|
6655
|
+
Ne,
|
|
6656
|
+
vn,
|
|
6657
|
+
Ue,
|
|
6658
|
+
ya,
|
|
6659
|
+
ba,
|
|
6660
|
+
Fe = h(() => {
|
|
6649
6661
|
'use strict';
|
|
6650
|
-
((
|
|
6651
|
-
(
|
|
6652
|
-
(
|
|
6662
|
+
((Ft = ['16:9', '9:16', '1:1', '21:9']),
|
|
6663
|
+
(ga = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
|
|
6664
|
+
(Bt = [
|
|
6653
6665
|
{
|
|
6654
6666
|
slug: 'kling-v4',
|
|
6655
6667
|
kind: 'video',
|
|
@@ -6657,7 +6669,7 @@ var Vt,
|
|
|
6657
6669
|
promptMax: 26e3,
|
|
6658
6670
|
duration: { min: 3, max: 30, default: 5 },
|
|
6659
6671
|
heights: { '720p': 720, '1080p': 1080 },
|
|
6660
|
-
aspects:
|
|
6672
|
+
aspects: Ft,
|
|
6661
6673
|
sourceFramedModes: ['image_to_video'],
|
|
6662
6674
|
adaptiveModes: ['multi_reference'],
|
|
6663
6675
|
fps: 24,
|
|
@@ -6681,7 +6693,7 @@ var Vt,
|
|
|
6681
6693
|
promptMax: 26e3,
|
|
6682
6694
|
duration: { min: 3, max: 20, default: 5 },
|
|
6683
6695
|
heights: { '720p': 720 },
|
|
6684
|
-
aspects: [...
|
|
6696
|
+
aspects: [...Ft, '4:3', '3:4'],
|
|
6685
6697
|
sourceFramedModes: ['image_to_video'],
|
|
6686
6698
|
adaptiveModes: ['multi_reference'],
|
|
6687
6699
|
fps: 24,
|
|
@@ -6721,7 +6733,7 @@ var Vt,
|
|
|
6721
6733
|
promptMax: 65535,
|
|
6722
6734
|
duration: { min: 5, max: 15, default: 5 },
|
|
6723
6735
|
heights: { '480p': 480, '768p': 768 },
|
|
6724
|
-
aspects:
|
|
6736
|
+
aspects: ga,
|
|
6725
6737
|
fps: 24,
|
|
6726
6738
|
audio: 'free',
|
|
6727
6739
|
seed: !0,
|
|
@@ -6796,10 +6808,10 @@ var Vt,
|
|
|
6796
6808
|
seed: !0,
|
|
6797
6809
|
},
|
|
6798
6810
|
]),
|
|
6799
|
-
(
|
|
6800
|
-
(
|
|
6801
|
-
((
|
|
6802
|
-
(
|
|
6811
|
+
(In = Bt.map((e) => e.slug)),
|
|
6812
|
+
(ha = new Map(Bt.map((e) => [e.slug, e]))));
|
|
6813
|
+
((jt = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6814
|
+
(Ne = {
|
|
6803
6815
|
hpp4J3VqNfWAUOO0d1Us: 'Bella',
|
|
6804
6816
|
CwhRBWXzGAHq8TQ4Fs17: 'Roger',
|
|
6805
6817
|
EXAVITQu4vr4xnSDxMaL: 'Sarah',
|
|
@@ -6821,8 +6833,8 @@ var Vt,
|
|
|
6821
6833
|
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
6822
6834
|
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
6823
6835
|
}),
|
|
6824
|
-
(
|
|
6825
|
-
(
|
|
6836
|
+
(vn = Object.keys(Ne)),
|
|
6837
|
+
(Ue = [
|
|
6826
6838
|
'mp3_44100_128',
|
|
6827
6839
|
'mp3_22050_32',
|
|
6828
6840
|
'mp3_24000_48',
|
|
@@ -6836,8 +6848,8 @@ var Vt,
|
|
|
6836
6848
|
'opus_48000_128',
|
|
6837
6849
|
'opus_48000_192',
|
|
6838
6850
|
]));
|
|
6839
|
-
((
|
|
6840
|
-
(
|
|
6851
|
+
((ya = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
6852
|
+
(ba = [
|
|
6841
6853
|
'duration',
|
|
6842
6854
|
'aspect_ratio',
|
|
6843
6855
|
'generate_audio',
|
|
@@ -6849,7 +6861,7 @@ var Vt,
|
|
|
6849
6861
|
'audios',
|
|
6850
6862
|
]));
|
|
6851
6863
|
});
|
|
6852
|
-
function
|
|
6864
|
+
function wa() {
|
|
6853
6865
|
return [
|
|
6854
6866
|
{
|
|
6855
6867
|
name: 'image_url',
|
|
@@ -6877,7 +6889,7 @@ function ya() {
|
|
|
6877
6889
|
},
|
|
6878
6890
|
];
|
|
6879
6891
|
}
|
|
6880
|
-
function
|
|
6892
|
+
function xa(e) {
|
|
6881
6893
|
let t = e.duration,
|
|
6882
6894
|
i = Object.keys(e.heights),
|
|
6883
6895
|
a = e.sourceFramedModes?.length
|
|
@@ -6970,7 +6982,7 @@ function ba(e) {
|
|
|
6970
6982
|
}
|
|
6971
6983
|
return o;
|
|
6972
6984
|
}
|
|
6973
|
-
function
|
|
6985
|
+
function _a(e) {
|
|
6974
6986
|
let t = Object.keys(e.sizes);
|
|
6975
6987
|
return [
|
|
6976
6988
|
{
|
|
@@ -6987,13 +6999,13 @@ function ka(e) {
|
|
|
6987
6999
|
},
|
|
6988
7000
|
];
|
|
6989
7001
|
}
|
|
6990
|
-
function
|
|
7002
|
+
function Ia() {
|
|
6991
7003
|
return [
|
|
6992
7004
|
{
|
|
6993
7005
|
name: 'voice_id',
|
|
6994
7006
|
type: 'string',
|
|
6995
|
-
default:
|
|
6996
|
-
description: `text_to_speech: the ElevenLabs voice id, one of: ${
|
|
7007
|
+
default: jt,
|
|
7008
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${Pa}.`,
|
|
6997
7009
|
},
|
|
6998
7010
|
{
|
|
6999
7011
|
name: 'turns',
|
|
@@ -7001,7 +7013,7 @@ function xa() {
|
|
|
7001
7013
|
description:
|
|
7002
7014
|
'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
7015
|
},
|
|
7004
|
-
{ name: 'output_format', type: 'select', default:
|
|
7016
|
+
{ name: 'output_format', type: 'select', default: Ue[0], options: [...Ue] },
|
|
7005
7017
|
{ name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
|
|
7006
7018
|
{
|
|
7007
7019
|
name: 'similarity_boost',
|
|
@@ -7012,7 +7024,7 @@ function xa() {
|
|
|
7012
7024
|
},
|
|
7013
7025
|
];
|
|
7014
7026
|
}
|
|
7015
|
-
function
|
|
7027
|
+
function zt(e) {
|
|
7016
7028
|
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
7017
7029
|
i = [
|
|
7018
7030
|
{
|
|
@@ -7027,26 +7039,26 @@ function jt(e) {
|
|
|
7027
7039
|
required: !0,
|
|
7028
7040
|
...(e.modeRequired ? {} : { default: e.modes[0] }),
|
|
7029
7041
|
options: [...e.modes],
|
|
7030
|
-
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) =>
|
|
7042
|
+
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((a) => ka[a]).join(' ')}`,
|
|
7031
7043
|
},
|
|
7032
7044
|
];
|
|
7033
7045
|
return (
|
|
7034
|
-
e.kind === 'video' ? i.push(...
|
|
7035
|
-
e.modes.includes('motion_control') && i.push(...
|
|
7046
|
+
e.kind === 'video' ? i.push(...xa(e)) : e.kind === 'image' ? i.push(..._a(e)) : i.push(...Ia()),
|
|
7047
|
+
e.modes.includes('motion_control') && i.push(...wa()),
|
|
7036
7048
|
e.seed &&
|
|
7037
7049
|
i.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
7038
7050
|
i
|
|
7039
7051
|
);
|
|
7040
7052
|
}
|
|
7041
7053
|
var L,
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7054
|
+
ka,
|
|
7055
|
+
Pa,
|
|
7056
|
+
Jt = h(() => {
|
|
7045
7057
|
'use strict';
|
|
7046
|
-
|
|
7058
|
+
Fe();
|
|
7047
7059
|
((L =
|
|
7048
7060
|
'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
|
-
(
|
|
7061
|
+
(ka = {
|
|
7050
7062
|
text_to_video: 'text_to_video: from the prompt alone.',
|
|
7051
7063
|
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
7052
7064
|
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
@@ -7058,34 +7070,34 @@ var L,
|
|
|
7058
7070
|
motion_control:
|
|
7059
7071
|
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
7060
7072
|
}));
|
|
7061
|
-
|
|
7073
|
+
Pa = Object.entries(Ne)
|
|
7062
7074
|
.map(([e, t]) => `${e} (${t})`)
|
|
7063
7075
|
.join(', ');
|
|
7064
7076
|
});
|
|
7065
7077
|
var he,
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7078
|
+
Wt,
|
|
7079
|
+
X,
|
|
7080
|
+
Yt,
|
|
7081
|
+
Sn,
|
|
7082
|
+
Cn,
|
|
7083
|
+
$n,
|
|
7084
|
+
En,
|
|
7085
|
+
Xt = h(() => {
|
|
7074
7086
|
'use strict';
|
|
7075
7087
|
((he = 'enhancor-ultrafine'),
|
|
7076
|
-
(
|
|
7077
|
-
(
|
|
7078
|
-
(
|
|
7079
|
-
(
|
|
7080
|
-
(
|
|
7081
|
-
(
|
|
7082
|
-
(
|
|
7088
|
+
(Wt = 'Enhancor Ultrafine'),
|
|
7089
|
+
(X = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
7090
|
+
(Yt = 2),
|
|
7091
|
+
(Sn = 24 * 1024 * 1024),
|
|
7092
|
+
(Cn = 4096 * 4096),
|
|
7093
|
+
($n = 30 * 6e4),
|
|
7094
|
+
(En = 120 * 6e4));
|
|
7083
7095
|
});
|
|
7084
|
-
var
|
|
7096
|
+
var Q,
|
|
7085
7097
|
ye,
|
|
7086
|
-
|
|
7098
|
+
Be = h(() => {
|
|
7087
7099
|
'use strict';
|
|
7088
|
-
((
|
|
7100
|
+
((Q = [
|
|
7089
7101
|
'seedance-2-5',
|
|
7090
7102
|
'seedance-2-5-flash',
|
|
7091
7103
|
'seedance-2',
|
|
@@ -7100,10 +7112,10 @@ var X,
|
|
|
7100
7112
|
(ye =
|
|
7101
7113
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
7102
7114
|
});
|
|
7103
|
-
function
|
|
7115
|
+
function Z(e) {
|
|
7104
7116
|
return `$${Number(e.toFixed(5))}`;
|
|
7105
7117
|
}
|
|
7106
|
-
function
|
|
7118
|
+
function Ma(e) {
|
|
7107
7119
|
if (e.kind === 'llm') {
|
|
7108
7120
|
let t = e.defaultEndpoint,
|
|
7109
7121
|
i = (s) =>
|
|
@@ -7116,19 +7128,19 @@ function Ia(e) {
|
|
|
7116
7128
|
a = i('input'),
|
|
7117
7129
|
n = i('output');
|
|
7118
7130
|
return a && n
|
|
7119
|
-
? `${
|
|
7120
|
-
: `from ${
|
|
7131
|
+
? `${Z(a.price.starter)}/M in \xB7 ${Z(n.price.starter)}/M out`
|
|
7132
|
+
: `from ${Z(me(e).price.starter)}/M tokens`;
|
|
7121
7133
|
}
|
|
7122
|
-
return `from ${
|
|
7134
|
+
return `from ${Z(me(e).price.starter)}${e.unit}`;
|
|
7123
7135
|
}
|
|
7124
|
-
function
|
|
7136
|
+
function Ka(e, t) {
|
|
7125
7137
|
let i = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
7126
|
-
return i.length ? `from ${
|
|
7138
|
+
return i.length ? `from ${Z(Math.min(...i))}${e}` : null;
|
|
7127
7139
|
}
|
|
7128
|
-
function
|
|
7140
|
+
function ii(e) {
|
|
7129
7141
|
for (let t of J) {
|
|
7130
7142
|
let i = ke[t],
|
|
7131
|
-
a = i ?
|
|
7143
|
+
a = i ? Ka(i.unit, e[t] ?? []) : null;
|
|
7132
7144
|
i && a && (i.priceFormatted = a);
|
|
7133
7145
|
}
|
|
7134
7146
|
}
|
|
@@ -7144,13 +7156,13 @@ function A(e, t) {
|
|
|
7144
7156
|
...(t ? { description: t } : {}),
|
|
7145
7157
|
};
|
|
7146
7158
|
}
|
|
7147
|
-
function
|
|
7159
|
+
function ai(e) {
|
|
7148
7160
|
if (!e.endpoints?.length) return null;
|
|
7149
|
-
let t = e.endpoints.filter((i) =>
|
|
7161
|
+
let t = e.endpoints.filter((i) => $t(e.slug, i.id));
|
|
7150
7162
|
return {
|
|
7151
7163
|
name: 'endpoint',
|
|
7152
7164
|
type: 'select',
|
|
7153
|
-
default:
|
|
7165
|
+
default: Re(e),
|
|
7154
7166
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
7155
7167
|
description:
|
|
7156
7168
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -7159,20 +7171,20 @@ function ei(e) {
|
|
|
7159
7171
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
7160
7172
|
};
|
|
7161
7173
|
}
|
|
7162
|
-
function
|
|
7174
|
+
function Ca(e, t) {
|
|
7163
7175
|
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 ?
|
|
7176
|
+
let i = Q.includes(e.api.model);
|
|
7177
|
+
return [...t.filter((a) => !be.has(a.name)), i ? We : Sa];
|
|
7166
7178
|
}
|
|
7167
|
-
function
|
|
7179
|
+
function je(e, t) {
|
|
7168
7180
|
let i = e.filter((n) => !be.has(n.name)),
|
|
7169
|
-
a = [
|
|
7170
|
-
return (a.push(
|
|
7181
|
+
a = [We, ri];
|
|
7182
|
+
return (a.push(Ye, Xe), [...i, ...a]);
|
|
7171
7183
|
}
|
|
7172
|
-
function
|
|
7184
|
+
function Oa(e) {
|
|
7173
7185
|
return [
|
|
7174
7186
|
...e
|
|
7175
|
-
.filter((t) => !
|
|
7187
|
+
.filter((t) => !Ea.has(t.name) && !be.has(t.name))
|
|
7176
7188
|
.map((t) => {
|
|
7177
7189
|
if (t.name === 'resolution')
|
|
7178
7190
|
return {
|
|
@@ -7184,30 +7196,30 @@ function $a(e) {
|
|
|
7184
7196
|
),
|
|
7185
7197
|
}
|
|
7186
7198
|
: {}),
|
|
7187
|
-
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${
|
|
7199
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${ee}`,
|
|
7188
7200
|
};
|
|
7189
|
-
let i =
|
|
7201
|
+
let i = Aa[t.name];
|
|
7190
7202
|
return i && typeof t.description == 'string'
|
|
7191
7203
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${i})`) }
|
|
7192
7204
|
: t;
|
|
7193
7205
|
}),
|
|
7194
|
-
Je,
|
|
7195
|
-
ti,
|
|
7196
7206
|
We,
|
|
7207
|
+
ri,
|
|
7197
7208
|
Ye,
|
|
7209
|
+
Xe,
|
|
7198
7210
|
];
|
|
7199
7211
|
}
|
|
7200
|
-
function
|
|
7212
|
+
function ni(e) {
|
|
7201
7213
|
return (
|
|
7202
7214
|
e.startsWith('seedance-2-5-') &&
|
|
7203
7215
|
e !== 'seedance-2-5-lite' &&
|
|
7204
7216
|
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
7205
7217
|
);
|
|
7206
7218
|
}
|
|
7207
|
-
function
|
|
7219
|
+
function Qt(e, t = {}) {
|
|
7208
7220
|
return [
|
|
7209
7221
|
...e
|
|
7210
|
-
.filter((i) =>
|
|
7222
|
+
.filter((i) => !$a.has(i.name) && !be.has(i.name))
|
|
7211
7223
|
.map((i) =>
|
|
7212
7224
|
i.name === 'prompt'
|
|
7213
7225
|
? { ...i, required: !0 }
|
|
@@ -7217,7 +7229,7 @@ function Wt(e, t = {}) {
|
|
|
7217
7229
|
...(t.no4k && i.options
|
|
7218
7230
|
? { options: i.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
7219
7231
|
: {}),
|
|
7220
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
7232
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ee}`,
|
|
7221
7233
|
}
|
|
7222
7234
|
: i,
|
|
7223
7235
|
),
|
|
@@ -7228,11 +7240,11 @@ function Wt(e, t = {}) {
|
|
|
7228
7240
|
options: ['standard'],
|
|
7229
7241
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
7230
7242
|
},
|
|
7231
|
-
We,
|
|
7232
7243
|
Ye,
|
|
7244
|
+
Xe,
|
|
7233
7245
|
];
|
|
7234
7246
|
}
|
|
7235
|
-
function
|
|
7247
|
+
function Ge(e, t) {
|
|
7236
7248
|
return [
|
|
7237
7249
|
C('Text prompt describing the video.'),
|
|
7238
7250
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -7261,8 +7273,8 @@ function je(e, t) {
|
|
|
7261
7273
|
),
|
|
7262
7274
|
];
|
|
7263
7275
|
}
|
|
7264
|
-
function
|
|
7265
|
-
let t =
|
|
7276
|
+
function qa(e) {
|
|
7277
|
+
let t = ai(e);
|
|
7266
7278
|
return [
|
|
7267
7279
|
C('Image prompt text. Supports complex composition and text instructions.'),
|
|
7268
7280
|
...(t ? [t] : []),
|
|
@@ -7275,14 +7287,14 @@ function Ea(e) {
|
|
|
7275
7287
|
A(
|
|
7276
7288
|
e,
|
|
7277
7289
|
e.slug === 'gpt-image-2'
|
|
7278
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
7290
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${bt}`
|
|
7279
7291
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
7280
7292
|
),
|
|
7281
7293
|
{
|
|
7282
7294
|
name: 'aspect_ratio',
|
|
7283
7295
|
type: 'select',
|
|
7284
7296
|
default: 'auto',
|
|
7285
|
-
options: [...
|
|
7297
|
+
options: [...yt],
|
|
7286
7298
|
description:
|
|
7287
7299
|
"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
7300
|
},
|
|
@@ -7329,7 +7341,7 @@ function Ea(e) {
|
|
|
7329
7341
|
},
|
|
7330
7342
|
];
|
|
7331
7343
|
}
|
|
7332
|
-
function
|
|
7344
|
+
function Ra(e) {
|
|
7333
7345
|
return [
|
|
7334
7346
|
C('Image prompt text.'),
|
|
7335
7347
|
{
|
|
@@ -7337,7 +7349,7 @@ function Aa(e) {
|
|
|
7337
7349
|
type: 'string[]',
|
|
7338
7350
|
description: 'Images to edit or use as reference (up to 14).',
|
|
7339
7351
|
},
|
|
7340
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
7352
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...At(e.slug)] },
|
|
7341
7353
|
A(e),
|
|
7342
7354
|
{
|
|
7343
7355
|
name: 'n',
|
|
@@ -7363,10 +7375,10 @@ function Aa(e) {
|
|
|
7363
7375
|
},
|
|
7364
7376
|
];
|
|
7365
7377
|
}
|
|
7366
|
-
function
|
|
7367
|
-
let e =
|
|
7378
|
+
function Na() {
|
|
7379
|
+
let e = qt,
|
|
7368
7380
|
t = [];
|
|
7369
|
-
for (let i of
|
|
7381
|
+
for (let i of Qe(!0))
|
|
7370
7382
|
e.includes(i.name) &&
|
|
7371
7383
|
(t.push({
|
|
7372
7384
|
...i,
|
|
@@ -7388,12 +7400,12 @@ function La() {
|
|
|
7388
7400
|
}));
|
|
7389
7401
|
return t;
|
|
7390
7402
|
}
|
|
7391
|
-
function
|
|
7392
|
-
return
|
|
7403
|
+
function Ua() {
|
|
7404
|
+
return Qe(!0).map((e) =>
|
|
7393
7405
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
7394
7406
|
);
|
|
7395
7407
|
}
|
|
7396
|
-
function
|
|
7408
|
+
function Qe(e) {
|
|
7397
7409
|
return [
|
|
7398
7410
|
C('The user message or task.'),
|
|
7399
7411
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -7488,21 +7500,21 @@ function Xe(e) {
|
|
|
7488
7500
|
},
|
|
7489
7501
|
];
|
|
7490
7502
|
}
|
|
7491
|
-
function
|
|
7492
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
7493
|
-
let t =
|
|
7503
|
+
function Fa(e) {
|
|
7504
|
+
if (e.slug === 'seed-2-1-turbo') return Da;
|
|
7505
|
+
let t = ai(e);
|
|
7494
7506
|
return [
|
|
7495
7507
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
7496
|
-
?
|
|
7508
|
+
? Na()
|
|
7497
7509
|
: e.slug === 'gemini-3.7-flash'
|
|
7498
|
-
?
|
|
7499
|
-
: e.slug === 'gpt-6-astra' ||
|
|
7500
|
-
?
|
|
7501
|
-
:
|
|
7510
|
+
? Ua()
|
|
7511
|
+
: e.slug === 'gpt-6-astra' || Va.includes(e.slug)
|
|
7512
|
+
? Qe(e.slug !== 'gpt-6-astra')
|
|
7513
|
+
: La),
|
|
7502
7514
|
...(t ? [t] : []),
|
|
7503
7515
|
];
|
|
7504
7516
|
}
|
|
7505
|
-
function
|
|
7517
|
+
function He() {
|
|
7506
7518
|
return {
|
|
7507
7519
|
name: 'image',
|
|
7508
7520
|
type: 'string',
|
|
@@ -7510,7 +7522,7 @@ function Ge() {
|
|
|
7510
7522
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
7511
7523
|
};
|
|
7512
7524
|
}
|
|
7513
|
-
function
|
|
7525
|
+
function ja(e) {
|
|
7514
7526
|
return [
|
|
7515
7527
|
{
|
|
7516
7528
|
name: 'video_url',
|
|
@@ -7532,7 +7544,7 @@ function Ua(e) {
|
|
|
7532
7544
|
},
|
|
7533
7545
|
];
|
|
7534
7546
|
}
|
|
7535
|
-
function
|
|
7547
|
+
function Ga() {
|
|
7536
7548
|
return [
|
|
7537
7549
|
{
|
|
7538
7550
|
name: 'mode',
|
|
@@ -7603,30 +7615,30 @@ function Fa() {
|
|
|
7603
7615
|
},
|
|
7604
7616
|
];
|
|
7605
7617
|
}
|
|
7606
|
-
function
|
|
7618
|
+
function Ha(e) {
|
|
7607
7619
|
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
|
|
7620
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return Ga();
|
|
7621
|
+
if (pe.some((a) => a.slug === t)) return ja(e);
|
|
7622
|
+
if (e.kind === 'llm') return Fa(e);
|
|
7623
|
+
if (e.editVariants?.length) return qa(e);
|
|
7612
7624
|
let i = ge(t);
|
|
7613
|
-
if (i) return
|
|
7614
|
-
if (
|
|
7625
|
+
if (i) return zt(i);
|
|
7626
|
+
if (ni(t)) return Oa(ze);
|
|
7615
7627
|
switch (t) {
|
|
7616
7628
|
case 'seedance-2-5':
|
|
7617
|
-
return
|
|
7629
|
+
return je(ze, t);
|
|
7618
7630
|
case 'seedance-2-5-lite':
|
|
7619
|
-
return
|
|
7631
|
+
return Qt(ze, { no4k: !0 });
|
|
7620
7632
|
case 'seedance-2':
|
|
7621
|
-
return
|
|
7633
|
+
return je(Zt, t);
|
|
7622
7634
|
case 'seedance-2-lite':
|
|
7623
|
-
return
|
|
7635
|
+
return Qt(Zt);
|
|
7624
7636
|
case 'seedance-2-mini':
|
|
7625
|
-
return
|
|
7637
|
+
return je(za, t);
|
|
7626
7638
|
case 'nano-banana-2':
|
|
7627
7639
|
case 'nano-banana-2.1':
|
|
7628
7640
|
case 'nano-banana-pro':
|
|
7629
|
-
return
|
|
7641
|
+
return Ra(e);
|
|
7630
7642
|
case 'seedream-5-pro':
|
|
7631
7643
|
return [
|
|
7632
7644
|
C('Detailed description of the image to generate.'),
|
|
@@ -7860,7 +7872,7 @@ function Ba(e) {
|
|
|
7860
7872
|
];
|
|
7861
7873
|
case 'enhancor-skin-fix-v1':
|
|
7862
7874
|
return [
|
|
7863
|
-
|
|
7875
|
+
He(),
|
|
7864
7876
|
{
|
|
7865
7877
|
name: 'mode',
|
|
7866
7878
|
type: 'select',
|
|
@@ -7893,11 +7905,11 @@ function Ba(e) {
|
|
|
7893
7905
|
max: 0.4,
|
|
7894
7906
|
description: 'Portrait depth. Heavy only.',
|
|
7895
7907
|
},
|
|
7896
|
-
...
|
|
7908
|
+
...Ba,
|
|
7897
7909
|
];
|
|
7898
7910
|
case 'enhancor-skin-fix-v3':
|
|
7899
7911
|
return [
|
|
7900
|
-
|
|
7912
|
+
He(),
|
|
7901
7913
|
{
|
|
7902
7914
|
name: 'mask_image',
|
|
7903
7915
|
type: 'string',
|
|
@@ -7937,7 +7949,7 @@ function Ba(e) {
|
|
|
7937
7949
|
];
|
|
7938
7950
|
case 'enhancor-skin-fix-v4':
|
|
7939
7951
|
return [
|
|
7940
|
-
|
|
7952
|
+
He(),
|
|
7941
7953
|
{
|
|
7942
7954
|
name: 'mode',
|
|
7943
7955
|
type: 'select',
|
|
@@ -7968,7 +7980,7 @@ function Ba(e) {
|
|
|
7968
7980
|
];
|
|
7969
7981
|
case 'wan-3-0':
|
|
7970
7982
|
case 'wan-3-0-prime':
|
|
7971
|
-
return
|
|
7983
|
+
return Ge(e, {
|
|
7972
7984
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7973
7985
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
7974
7986
|
minSec: 2,
|
|
@@ -7978,7 +7990,7 @@ function Ba(e) {
|
|
|
7978
7990
|
});
|
|
7979
7991
|
case 'happy-horse-1-1':
|
|
7980
7992
|
case 'happy-horse-1-0':
|
|
7981
|
-
return
|
|
7993
|
+
return Ge(e, {
|
|
7982
7994
|
modes:
|
|
7983
7995
|
t === 'happy-horse-1-0'
|
|
7984
7996
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -7989,7 +8001,7 @@ function Ba(e) {
|
|
|
7989
8001
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
7990
8002
|
});
|
|
7991
8003
|
case 'minimax-h3':
|
|
7992
|
-
return
|
|
8004
|
+
return Ge(e, {
|
|
7993
8005
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7994
8006
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
7995
8007
|
minSec: 4,
|
|
@@ -8000,10 +8012,33 @@ function Ba(e) {
|
|
|
8000
8012
|
return [C('Prompt text.')];
|
|
8001
8013
|
}
|
|
8002
8014
|
}
|
|
8003
|
-
function
|
|
8015
|
+
function Ja() {
|
|
8016
|
+
let e = (t, i) => ({
|
|
8017
|
+
name: t,
|
|
8018
|
+
type: 'slider',
|
|
8019
|
+
default: 50,
|
|
8020
|
+
min: 0,
|
|
8021
|
+
max: 100,
|
|
8022
|
+
step: 1,
|
|
8023
|
+
description: `${i} 0 to 100. 50 is the default look.`,
|
|
8024
|
+
});
|
|
8025
|
+
return [
|
|
8026
|
+
e('skin_strength', 'Strength: how much the skin is repainted. Only with skin_fix on.'),
|
|
8027
|
+
e('skin_texture', 'Texture: how much fine pore detail is added. Only with skin_fix on.'),
|
|
8028
|
+
e(
|
|
8029
|
+
'grain',
|
|
8030
|
+
'Grain: fine noise over the photo. Works in Fast and Full, with or without skin_fix.',
|
|
8031
|
+
),
|
|
8032
|
+
e(
|
|
8033
|
+
'sharpness',
|
|
8034
|
+
'Sharpness: how crisp the edges are. Works in Fast and Full, with or without skin_fix.',
|
|
8035
|
+
),
|
|
8036
|
+
];
|
|
8037
|
+
}
|
|
8038
|
+
function Wa() {
|
|
8004
8039
|
return {
|
|
8005
8040
|
slug: he,
|
|
8006
|
-
name:
|
|
8041
|
+
name: Wt,
|
|
8007
8042
|
category: 'Image',
|
|
8008
8043
|
kind: 'Image-to-Image',
|
|
8009
8044
|
vendor: 'Enhancor',
|
|
@@ -8011,7 +8046,7 @@ function Ga() {
|
|
|
8011
8046
|
'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).',
|
|
8012
8047
|
priceFormatted: '',
|
|
8013
8048
|
unit: '/img',
|
|
8014
|
-
primaryToolName:
|
|
8049
|
+
primaryToolName: ti.image,
|
|
8015
8050
|
parameters: [
|
|
8016
8051
|
{
|
|
8017
8052
|
name: 'image',
|
|
@@ -8037,44 +8072,45 @@ function Ga() {
|
|
|
8037
8072
|
{
|
|
8038
8073
|
name: 'scale',
|
|
8039
8074
|
type: 'select',
|
|
8040
|
-
default: String(
|
|
8041
|
-
options:
|
|
8042
|
-
description: `Full only. ${
|
|
8075
|
+
default: String(Yt),
|
|
8076
|
+
options: X.noSkin.map(String),
|
|
8077
|
+
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.`,
|
|
8043
8078
|
},
|
|
8079
|
+
...Ja(),
|
|
8044
8080
|
],
|
|
8045
8081
|
};
|
|
8046
8082
|
}
|
|
8047
|
-
function
|
|
8083
|
+
function Je(e, t = e.api.model) {
|
|
8048
8084
|
return {
|
|
8049
8085
|
slug: t,
|
|
8050
8086
|
name: e.name,
|
|
8051
|
-
category:
|
|
8052
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
8087
|
+
category: va[e.kind],
|
|
8088
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Ta[e.kind],
|
|
8053
8089
|
vendor: e.vendor ?? '',
|
|
8054
8090
|
description: e.desc ?? e.name,
|
|
8055
|
-
priceFormatted:
|
|
8091
|
+
priceFormatted: Ma(e),
|
|
8056
8092
|
unit: e.unit,
|
|
8057
|
-
primaryToolName:
|
|
8058
|
-
parameters:
|
|
8093
|
+
primaryToolName: ti[e.kind],
|
|
8094
|
+
parameters: Ca(e, Ha(e)),
|
|
8059
8095
|
};
|
|
8060
8096
|
}
|
|
8061
|
-
function
|
|
8097
|
+
function Ya() {
|
|
8062
8098
|
let e = {};
|
|
8063
8099
|
for (let t of ue())
|
|
8064
8100
|
if (t.slug !== 'seedance-2-fast') {
|
|
8065
8101
|
if (t.slug === 'seedance-2-mini') {
|
|
8066
|
-
e['seedance-2-mini'] =
|
|
8102
|
+
e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
|
|
8067
8103
|
continue;
|
|
8068
8104
|
}
|
|
8069
8105
|
if (t.slug === 'seedance-2') {
|
|
8070
|
-
let i =
|
|
8106
|
+
let i = Je(t);
|
|
8071
8107
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8072
8108
|
(e['seedance-2'] = i));
|
|
8073
8109
|
continue;
|
|
8074
8110
|
}
|
|
8075
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
8111
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
|
|
8076
8112
|
}
|
|
8077
|
-
(Object.assign(e,
|
|
8113
|
+
(Object.assign(e, Nt()), (e[he] = Wa()));
|
|
8078
8114
|
for (let [t, i] of Object.entries(fe))
|
|
8079
8115
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
8080
8116
|
return e;
|
|
@@ -8085,15 +8121,15 @@ function we(e) {
|
|
|
8085
8121
|
function H(e) {
|
|
8086
8122
|
return ke[e] ?? null;
|
|
8087
8123
|
}
|
|
8088
|
-
function
|
|
8124
|
+
function Xa(e, t, i) {
|
|
8089
8125
|
if (e.startsWith('enhancor-skin-fix-') || e === he) return !1;
|
|
8090
|
-
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' ||
|
|
8126
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || ni(e)) && t === 'duration') {
|
|
8091
8127
|
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
8092
8128
|
if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
|
|
8093
8129
|
}
|
|
8094
8130
|
if (
|
|
8095
|
-
(t === 'max_tokens' &&
|
|
8096
|
-
(t === 'max_completion_tokens' &&
|
|
8131
|
+
(t === 'max_tokens' && ei(i.max_completion_tokens)) ||
|
|
8132
|
+
(t === 'max_completion_tokens' && ei(i.max_tokens))
|
|
8097
8133
|
)
|
|
8098
8134
|
return !1;
|
|
8099
8135
|
if (t === 'aspect_ratio') {
|
|
@@ -8101,124 +8137,124 @@ function za(e, t, i) {
|
|
|
8101
8137
|
if (n) {
|
|
8102
8138
|
let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8103
8139
|
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
8104
|
-
if (n.modes.includes(o) && !
|
|
8140
|
+
if (n.modes.includes(o) && !Gt(n, o)) return !1;
|
|
8105
8141
|
}
|
|
8106
8142
|
}
|
|
8107
8143
|
let a = ge(e);
|
|
8108
8144
|
if (a) {
|
|
8109
8145
|
let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8110
8146
|
s = n ? n.replace(/-/g, '_') : a.modes[0];
|
|
8111
|
-
if (a.modes.includes(s) && !
|
|
8147
|
+
if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
|
|
8112
8148
|
}
|
|
8113
8149
|
return !0;
|
|
8114
8150
|
}
|
|
8115
|
-
function
|
|
8151
|
+
function ei(e) {
|
|
8116
8152
|
return e != null && e !== '';
|
|
8117
8153
|
}
|
|
8118
|
-
function
|
|
8154
|
+
function li(e, t) {
|
|
8119
8155
|
let i = { ...t };
|
|
8120
8156
|
if (e?.slug === 'seedance-2-5') {
|
|
8121
8157
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
8122
|
-
for (let n of
|
|
8158
|
+
for (let n of Qa) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
8123
8159
|
if (!a(i.finalize)) return i;
|
|
8124
8160
|
}
|
|
8125
8161
|
for (let a of e?.parameters ?? [])
|
|
8126
8162
|
a.default !== void 0 &&
|
|
8127
8163
|
i[a.name] === void 0 &&
|
|
8128
|
-
|
|
8164
|
+
Xa(e.slug, a.name, t) &&
|
|
8129
8165
|
(i[a.name] = a.default);
|
|
8130
8166
|
return i;
|
|
8131
8167
|
}
|
|
8132
8168
|
function D() {
|
|
8133
8169
|
return Object.values(ke);
|
|
8134
8170
|
}
|
|
8135
|
-
var
|
|
8136
|
-
Qt,
|
|
8137
|
-
Pa,
|
|
8138
|
-
C,
|
|
8139
|
-
Je,
|
|
8140
|
-
Ta,
|
|
8171
|
+
var va,
|
|
8141
8172
|
ti,
|
|
8173
|
+
Ta,
|
|
8174
|
+
C,
|
|
8142
8175
|
We,
|
|
8143
|
-
Ye,
|
|
8144
|
-
be,
|
|
8145
|
-
Ka,
|
|
8146
8176
|
Sa,
|
|
8147
|
-
Ca,
|
|
8148
|
-
qa,
|
|
8149
|
-
Oa,
|
|
8150
|
-
Ra,
|
|
8151
|
-
Na,
|
|
8152
|
-
Z,
|
|
8153
|
-
He,
|
|
8154
|
-
ai,
|
|
8155
8177
|
ri,
|
|
8156
|
-
|
|
8157
|
-
|
|
8178
|
+
Ye,
|
|
8179
|
+
Xe,
|
|
8180
|
+
be,
|
|
8181
|
+
$a,
|
|
8182
|
+
Ea,
|
|
8183
|
+
Aa,
|
|
8184
|
+
La,
|
|
8185
|
+
Da,
|
|
8186
|
+
Va,
|
|
8187
|
+
Ba,
|
|
8188
|
+
ee,
|
|
8189
|
+
ze,
|
|
8190
|
+
si,
|
|
8191
|
+
oi,
|
|
8192
|
+
Zt,
|
|
8193
|
+
za,
|
|
8158
8194
|
ke,
|
|
8159
|
-
|
|
8160
|
-
|
|
8195
|
+
Qa,
|
|
8196
|
+
te = h(() => {
|
|
8161
8197
|
'use strict';
|
|
8162
|
-
|
|
8198
|
+
kt();
|
|
8163
8199
|
Ce();
|
|
8164
8200
|
G();
|
|
8165
|
-
Re();
|
|
8166
|
-
$e();
|
|
8167
8201
|
Le();
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
Jt();
|
|
8202
|
+
$e();
|
|
8203
|
+
De();
|
|
8204
|
+
Et();
|
|
8205
|
+
Ot();
|
|
8206
|
+
Rt();
|
|
8207
|
+
Ut();
|
|
8175
8208
|
Fe();
|
|
8176
|
-
(
|
|
8177
|
-
|
|
8209
|
+
Jt();
|
|
8210
|
+
Xt();
|
|
8211
|
+
Be();
|
|
8212
|
+
((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8213
|
+
(ti = {
|
|
8178
8214
|
video: 'generate_video',
|
|
8179
8215
|
image: 'generate_image',
|
|
8180
8216
|
audio: 'generate_audio',
|
|
8181
8217
|
llm: 'run_task',
|
|
8182
8218
|
}),
|
|
8183
|
-
(
|
|
8219
|
+
(Ta = {
|
|
8184
8220
|
video: 'Text-to-Video',
|
|
8185
8221
|
image: 'Text-to-Image',
|
|
8186
8222
|
audio: 'Text-to-Audio',
|
|
8187
8223
|
llm: 'Reasoning (LLM)',
|
|
8188
8224
|
}));
|
|
8189
8225
|
C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
8190
|
-
((
|
|
8226
|
+
((We = {
|
|
8191
8227
|
name: 'creative_mode',
|
|
8192
8228
|
type: 'boolean',
|
|
8193
8229
|
default: !1,
|
|
8194
8230
|
description:
|
|
8195
8231
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8196
8232
|
}),
|
|
8197
|
-
(
|
|
8233
|
+
(Sa = {
|
|
8198
8234
|
name: 'creative_mode',
|
|
8199
8235
|
type: 'boolean',
|
|
8200
8236
|
default: !1,
|
|
8201
8237
|
description: `Not available yet on this model: ${ye}.`,
|
|
8202
8238
|
}),
|
|
8203
|
-
(
|
|
8239
|
+
(ri = {
|
|
8204
8240
|
name: 'priority',
|
|
8205
8241
|
type: 'boolean',
|
|
8206
8242
|
default: !1,
|
|
8207
8243
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
8208
8244
|
}),
|
|
8209
|
-
(
|
|
8245
|
+
(Ye = {
|
|
8210
8246
|
name: 'reference_roles',
|
|
8211
8247
|
type: 'json',
|
|
8212
8248
|
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).`,
|
|
8213
8249
|
}),
|
|
8214
|
-
(
|
|
8250
|
+
(Xe = {
|
|
8215
8251
|
name: 'auto_fit_images',
|
|
8216
8252
|
type: 'boolean',
|
|
8217
8253
|
description:
|
|
8218
8254
|
'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.',
|
|
8219
8255
|
}),
|
|
8220
8256
|
(be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8221
|
-
((
|
|
8257
|
+
(($a = new Set([
|
|
8222
8258
|
'quality',
|
|
8223
8259
|
'bitrate_mode',
|
|
8224
8260
|
'draft',
|
|
@@ -8227,7 +8263,7 @@ var _a,
|
|
|
8227
8263
|
'draft_generation_id',
|
|
8228
8264
|
'pass_faces',
|
|
8229
8265
|
])),
|
|
8230
|
-
(
|
|
8266
|
+
(Ea = new Set([
|
|
8231
8267
|
'quality',
|
|
8232
8268
|
'bitrate_mode',
|
|
8233
8269
|
'draft',
|
|
@@ -8235,12 +8271,12 @@ var _a,
|
|
|
8235
8271
|
'draft_task_id',
|
|
8236
8272
|
'draft_generation_id',
|
|
8237
8273
|
])),
|
|
8238
|
-
(
|
|
8274
|
+
(Aa = {
|
|
8239
8275
|
images: 'up to 10',
|
|
8240
8276
|
videos: 'up to 5; combined duration < 30s',
|
|
8241
8277
|
audios: 'up to 5; combined duration < 30s',
|
|
8242
8278
|
}));
|
|
8243
|
-
((
|
|
8279
|
+
((La = [
|
|
8244
8280
|
C('The user message or task.'),
|
|
8245
8281
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8246
8282
|
{
|
|
@@ -8258,7 +8294,7 @@ var _a,
|
|
|
8258
8294
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8259
8295
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8260
8296
|
]),
|
|
8261
|
-
(
|
|
8297
|
+
(Da = [
|
|
8262
8298
|
C('The user message or task.'),
|
|
8263
8299
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8264
8300
|
{
|
|
@@ -8340,8 +8376,8 @@ var _a,
|
|
|
8340
8376
|
description: 'Video frames read a second.',
|
|
8341
8377
|
},
|
|
8342
8378
|
]),
|
|
8343
|
-
(
|
|
8344
|
-
|
|
8379
|
+
(Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8380
|
+
Ba = Object.entries({
|
|
8345
8381
|
background: !1,
|
|
8346
8382
|
skin: !1,
|
|
8347
8383
|
nose: !1,
|
|
@@ -8367,8 +8403,8 @@ var _a,
|
|
|
8367
8403
|
default: t,
|
|
8368
8404
|
description: 'Keep this part out of the fix. Standard only.',
|
|
8369
8405
|
}));
|
|
8370
|
-
((
|
|
8371
|
-
(
|
|
8406
|
+
((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8407
|
+
(ze = [
|
|
8372
8408
|
{
|
|
8373
8409
|
name: 'prompt',
|
|
8374
8410
|
type: 'string',
|
|
@@ -8406,7 +8442,7 @@ var _a,
|
|
|
8406
8442
|
type: 'select',
|
|
8407
8443
|
default: '480p',
|
|
8408
8444
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8409
|
-
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. ${
|
|
8445
|
+
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${ee}`,
|
|
8410
8446
|
},
|
|
8411
8447
|
{
|
|
8412
8448
|
name: 'aspect_ratio',
|
|
@@ -8517,19 +8553,19 @@ var _a,
|
|
|
8517
8553
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8518
8554
|
},
|
|
8519
8555
|
]),
|
|
8520
|
-
(
|
|
8556
|
+
(si = {
|
|
8521
8557
|
name: 'images',
|
|
8522
8558
|
type: 'string[]',
|
|
8523
8559
|
description:
|
|
8524
8560
|
'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.',
|
|
8525
8561
|
}),
|
|
8526
|
-
(
|
|
8562
|
+
(oi = {
|
|
8527
8563
|
name: 'audios',
|
|
8528
8564
|
type: 'string[]',
|
|
8529
8565
|
description:
|
|
8530
8566
|
'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.',
|
|
8531
8567
|
}),
|
|
8532
|
-
(
|
|
8568
|
+
(Zt = [
|
|
8533
8569
|
{
|
|
8534
8570
|
name: 'prompt',
|
|
8535
8571
|
type: 'string',
|
|
@@ -8573,7 +8609,7 @@ var _a,
|
|
|
8573
8609
|
type: 'select',
|
|
8574
8610
|
default: '480p',
|
|
8575
8611
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8576
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
8612
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ee}`,
|
|
8577
8613
|
},
|
|
8578
8614
|
{
|
|
8579
8615
|
name: 'bitrate_mode',
|
|
@@ -8607,8 +8643,8 @@ var _a,
|
|
|
8607
8643
|
description:
|
|
8608
8644
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8609
8645
|
},
|
|
8610
|
-
|
|
8611
|
-
|
|
8646
|
+
si,
|
|
8647
|
+
oi,
|
|
8612
8648
|
{
|
|
8613
8649
|
name: 'first_frame_image',
|
|
8614
8650
|
type: 'string',
|
|
@@ -8629,7 +8665,7 @@ var _a,
|
|
|
8629
8665
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8630
8666
|
},
|
|
8631
8667
|
]),
|
|
8632
|
-
(
|
|
8668
|
+
(za = [
|
|
8633
8669
|
{
|
|
8634
8670
|
name: 'prompt',
|
|
8635
8671
|
type: 'string',
|
|
@@ -8650,7 +8686,7 @@ var _a,
|
|
|
8650
8686
|
type: 'select',
|
|
8651
8687
|
default: '480p',
|
|
8652
8688
|
options: ['480p', '720p'],
|
|
8653
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
8689
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ee}`,
|
|
8654
8690
|
},
|
|
8655
8691
|
{
|
|
8656
8692
|
name: 'bitrate_mode',
|
|
@@ -8684,8 +8720,8 @@ var _a,
|
|
|
8684
8720
|
description:
|
|
8685
8721
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8686
8722
|
},
|
|
8687
|
-
|
|
8688
|
-
|
|
8723
|
+
si,
|
|
8724
|
+
oi,
|
|
8689
8725
|
{
|
|
8690
8726
|
name: 'first_frame_image',
|
|
8691
8727
|
type: 'string',
|
|
@@ -8700,53 +8736,53 @@ var _a,
|
|
|
8700
8736
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8701
8737
|
},
|
|
8702
8738
|
]));
|
|
8703
|
-
ke =
|
|
8704
|
-
|
|
8739
|
+
ke = Ya();
|
|
8740
|
+
Qa = ['draft_task_id', 'draft_generation_id'];
|
|
8705
8741
|
});
|
|
8706
8742
|
function xe(e) {
|
|
8707
8743
|
let t = '/v1/pricing/models',
|
|
8708
8744
|
i = e?.trim();
|
|
8709
8745
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
8710
8746
|
}
|
|
8711
|
-
var
|
|
8747
|
+
var tt = h(() => {
|
|
8712
8748
|
'use strict';
|
|
8713
8749
|
});
|
|
8714
|
-
function
|
|
8750
|
+
function Ti(e) {
|
|
8715
8751
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
8716
8752
|
}
|
|
8717
|
-
function
|
|
8753
|
+
function Mi(e) {
|
|
8718
8754
|
let t = ue().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8719
|
-
i = t.filter((s) =>
|
|
8720
|
-
a = t.filter((s) => !
|
|
8755
|
+
i = t.filter((s) => Q.includes(s.api.model)).map((s) => s.name),
|
|
8756
|
+
a = t.filter((s) => !Q.includes(s.api.model)).map((s) => s.name);
|
|
8721
8757
|
return [
|
|
8722
8758
|
...(i.length
|
|
8723
|
-
? [`${
|
|
8759
|
+
? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
8724
8760
|
: []),
|
|
8725
|
-
...(a.length ? [`Not available yet on ${
|
|
8761
|
+
...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
|
|
8726
8762
|
'The Acceptable Use Policy applies.',
|
|
8727
8763
|
].join(' ');
|
|
8728
8764
|
}
|
|
8729
|
-
function
|
|
8730
|
-
if (
|
|
8765
|
+
function Kr(e) {
|
|
8766
|
+
if (Pr.has(e.name)) return e;
|
|
8731
8767
|
let t = e.inputSchema.properties;
|
|
8732
8768
|
return !t || t.callback_url
|
|
8733
8769
|
? e
|
|
8734
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8770
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
|
|
8735
8771
|
}
|
|
8736
|
-
function
|
|
8772
|
+
function Sr(e) {
|
|
8737
8773
|
let t = e.inputSchema.properties;
|
|
8738
8774
|
if (!t) return e;
|
|
8739
8775
|
let i = !1,
|
|
8740
8776
|
a = {};
|
|
8741
8777
|
for (let [n, s] of Object.entries(t))
|
|
8742
|
-
|
|
8778
|
+
Ki.has(n) && s.type === 'string' && !s.format
|
|
8743
8779
|
? ((a[n] = { ...s, format: 'uri' }), (i = !0))
|
|
8744
|
-
:
|
|
8780
|
+
: Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8745
8781
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
8746
8782
|
: (a[n] = s);
|
|
8747
8783
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
8748
8784
|
}
|
|
8749
|
-
function
|
|
8785
|
+
function Cr(e) {
|
|
8750
8786
|
switch (e.type) {
|
|
8751
8787
|
case 'string':
|
|
8752
8788
|
return {
|
|
@@ -8801,11 +8837,11 @@ function Tr(e) {
|
|
|
8801
8837
|
return { type: 'string', description: e.description };
|
|
8802
8838
|
}
|
|
8803
8839
|
}
|
|
8804
|
-
function
|
|
8840
|
+
function $r(e, t) {
|
|
8805
8841
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
8806
8842
|
a = {},
|
|
8807
8843
|
n = [];
|
|
8808
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
8844
|
+
for (let o of e.parameters) ((a[o.name] = Cr(o)), o.required && n.push(o.name));
|
|
8809
8845
|
let s = {
|
|
8810
8846
|
type: 'object',
|
|
8811
8847
|
properties: a,
|
|
@@ -8818,7 +8854,7 @@ function Mr(e, t) {
|
|
|
8818
8854
|
inputSchema: s,
|
|
8819
8855
|
};
|
|
8820
8856
|
}
|
|
8821
|
-
function
|
|
8857
|
+
function Er() {
|
|
8822
8858
|
let e = D().filter((p) => p.category === 'Image' && !we(p)),
|
|
8823
8859
|
t = D().filter((p) => p.category === 'Video'),
|
|
8824
8860
|
i = D().filter((p) => p.category === 'Text'),
|
|
@@ -8909,7 +8945,7 @@ function Kr() {
|
|
|
8909
8945
|
maximum: 2147483647,
|
|
8910
8946
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
8911
8947
|
},
|
|
8912
|
-
creative_mode: { type: 'boolean', description:
|
|
8948
|
+
creative_mode: { type: 'boolean', description: Mi('image') },
|
|
8913
8949
|
},
|
|
8914
8950
|
required: ['prompt'],
|
|
8915
8951
|
additionalProperties: !0,
|
|
@@ -8946,7 +8982,7 @@ function Kr() {
|
|
|
8946
8982
|
description:
|
|
8947
8983
|
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default, its lowest price.",
|
|
8948
8984
|
},
|
|
8949
|
-
creative_mode: { type: 'boolean', description:
|
|
8985
|
+
creative_mode: { type: 'boolean', description: Mi('video') },
|
|
8950
8986
|
priority: {
|
|
8951
8987
|
type: 'boolean',
|
|
8952
8988
|
description:
|
|
@@ -9082,10 +9118,10 @@ function Kr() {
|
|
|
9082
9118
|
additionalProperties: !0,
|
|
9083
9119
|
},
|
|
9084
9120
|
},
|
|
9085
|
-
d =
|
|
9086
|
-
return [n, s, o, u, l, d, c,
|
|
9121
|
+
d = Ar();
|
|
9122
|
+
return [n, s, o, u, l, d, c, Ir, ...Si];
|
|
9087
9123
|
}
|
|
9088
|
-
function
|
|
9124
|
+
function Ar() {
|
|
9089
9125
|
return {
|
|
9090
9126
|
name: 'upload_asset',
|
|
9091
9127
|
description:
|
|
@@ -9132,31 +9168,31 @@ function Sr() {
|
|
|
9132
9168
|
},
|
|
9133
9169
|
};
|
|
9134
9170
|
}
|
|
9135
|
-
function
|
|
9136
|
-
let e =
|
|
9137
|
-
t = D().map((i) =>
|
|
9138
|
-
return [...e, ...t].map(
|
|
9171
|
+
function ot() {
|
|
9172
|
+
let e = Er(),
|
|
9173
|
+
t = D().map((i) => $r(i));
|
|
9174
|
+
return [...e, ...t].map(Kr).map(Sr);
|
|
9139
9175
|
}
|
|
9140
|
-
var
|
|
9141
|
-
kr,
|
|
9142
|
-
wr,
|
|
9143
|
-
xr,
|
|
9144
|
-
_r,
|
|
9176
|
+
var _r,
|
|
9145
9177
|
Pr,
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9178
|
+
Ir,
|
|
9179
|
+
vr,
|
|
9180
|
+
Tr,
|
|
9181
|
+
Mr,
|
|
9182
|
+
Si,
|
|
9183
|
+
Rs,
|
|
9184
|
+
Ki,
|
|
9185
|
+
Ci = h(() => {
|
|
9150
9186
|
'use strict';
|
|
9151
9187
|
G();
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
((
|
|
9188
|
+
Be();
|
|
9189
|
+
te();
|
|
9190
|
+
((_r = {
|
|
9155
9191
|
type: 'string',
|
|
9156
9192
|
description:
|
|
9157
9193
|
'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.',
|
|
9158
9194
|
}),
|
|
9159
|
-
(
|
|
9195
|
+
(Pr = new Set([
|
|
9160
9196
|
'upload_asset',
|
|
9161
9197
|
'upload_media',
|
|
9162
9198
|
'upload_image',
|
|
@@ -9167,7 +9203,7 @@ var br,
|
|
|
9167
9203
|
'get_usage',
|
|
9168
9204
|
'get_balance_history',
|
|
9169
9205
|
])),
|
|
9170
|
-
(
|
|
9206
|
+
(Ir = {
|
|
9171
9207
|
name: 'get_pricing',
|
|
9172
9208
|
description:
|
|
9173
9209
|
'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.',
|
|
@@ -9182,13 +9218,13 @@ var br,
|
|
|
9182
9218
|
additionalProperties: !1,
|
|
9183
9219
|
},
|
|
9184
9220
|
}),
|
|
9185
|
-
(
|
|
9221
|
+
(vr = {
|
|
9186
9222
|
name: 'get_balance',
|
|
9187
9223
|
description:
|
|
9188
9224
|
"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.",
|
|
9189
9225
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9190
9226
|
}),
|
|
9191
|
-
(
|
|
9227
|
+
(Tr = {
|
|
9192
9228
|
name: 'get_usage',
|
|
9193
9229
|
description:
|
|
9194
9230
|
"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.",
|
|
@@ -9219,7 +9255,7 @@ var br,
|
|
|
9219
9255
|
additionalProperties: !1,
|
|
9220
9256
|
},
|
|
9221
9257
|
}),
|
|
9222
|
-
(
|
|
9258
|
+
(Mr = {
|
|
9223
9259
|
name: 'get_balance_history',
|
|
9224
9260
|
description:
|
|
9225
9261
|
"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.",
|
|
@@ -9237,9 +9273,9 @@ var br,
|
|
|
9237
9273
|
additionalProperties: !1,
|
|
9238
9274
|
},
|
|
9239
9275
|
}),
|
|
9240
|
-
(
|
|
9241
|
-
(
|
|
9242
|
-
|
|
9276
|
+
(Si = [vr, Tr, Mr]),
|
|
9277
|
+
(Rs = new Set(Si.map((e) => e.name))));
|
|
9278
|
+
Ki = new Set([
|
|
9243
9279
|
'image',
|
|
9244
9280
|
'images',
|
|
9245
9281
|
'image_url',
|
|
@@ -9256,19 +9292,19 @@ var br,
|
|
|
9256
9292
|
'lipsyncing_audio',
|
|
9257
9293
|
]);
|
|
9258
9294
|
});
|
|
9259
|
-
var
|
|
9260
|
-
|
|
9261
|
-
forgetToolSchemas: () =>
|
|
9262
|
-
jsonRpcAnswer: () =>
|
|
9263
|
-
preprocessLocalFiles: () =>
|
|
9264
|
-
startStdioServer: () =>
|
|
9295
|
+
var Ni = {};
|
|
9296
|
+
Ji(Ni, {
|
|
9297
|
+
forgetToolSchemas: () => Dr,
|
|
9298
|
+
jsonRpcAnswer: () => Oi,
|
|
9299
|
+
preprocessLocalFiles: () => Di,
|
|
9300
|
+
startStdioServer: () => Vi,
|
|
9265
9301
|
});
|
|
9266
|
-
function
|
|
9302
|
+
function Or(e) {
|
|
9267
9303
|
let t = (i) =>
|
|
9268
9304
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
9269
9305
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
9270
9306
|
}
|
|
9271
|
-
function
|
|
9307
|
+
function Oi(e, t, i) {
|
|
9272
9308
|
let a = e?.id,
|
|
9273
9309
|
n = a == null,
|
|
9274
9310
|
s = null;
|
|
@@ -9277,7 +9313,7 @@ function $i(e, t, i) {
|
|
|
9277
9313
|
} catch {
|
|
9278
9314
|
s = null;
|
|
9279
9315
|
}
|
|
9280
|
-
if (s !== null &&
|
|
9316
|
+
if (s !== null && Or(s)) return n ? null : s;
|
|
9281
9317
|
if (n) return null;
|
|
9282
9318
|
if (!i && t >= 200 && t < 300) return;
|
|
9283
9319
|
let o = s?.error,
|
|
@@ -9298,12 +9334,12 @@ function $i(e, t, i) {
|
|
|
9298
9334
|
},
|
|
9299
9335
|
};
|
|
9300
9336
|
}
|
|
9301
|
-
function
|
|
9337
|
+
function qr() {
|
|
9302
9338
|
let e = process.argv.slice(2),
|
|
9303
9339
|
t = e.indexOf('--api-key');
|
|
9304
9340
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
9305
9341
|
}
|
|
9306
|
-
async function
|
|
9342
|
+
async function qi(e, t, i) {
|
|
9307
9343
|
let a = z.default.resolve(e);
|
|
9308
9344
|
if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
|
|
9309
9345
|
throw new Error(`File not found: ${e}`);
|
|
@@ -9332,15 +9368,15 @@ async function Ei(e, t, i) {
|
|
|
9332
9368
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
9333
9369
|
};
|
|
9334
9370
|
}
|
|
9335
|
-
function
|
|
9336
|
-
return
|
|
9371
|
+
function Ri(e) {
|
|
9372
|
+
return Rr.has(z.default.extname(e).toLowerCase());
|
|
9337
9373
|
}
|
|
9338
|
-
function
|
|
9374
|
+
function Li(e) {
|
|
9339
9375
|
return new Error(
|
|
9340
9376
|
`Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
|
|
9341
9377
|
);
|
|
9342
9378
|
}
|
|
9343
|
-
function
|
|
9379
|
+
function Lr(e) {
|
|
9344
9380
|
let t = e.trim();
|
|
9345
9381
|
if (
|
|
9346
9382
|
!t ||
|
|
@@ -9353,22 +9389,22 @@ function Ar(e) {
|
|
|
9353
9389
|
let i = z.default.resolve(t);
|
|
9354
9390
|
return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
|
|
9355
9391
|
}
|
|
9356
|
-
function
|
|
9392
|
+
function dt(e) {
|
|
9357
9393
|
if (Array.isArray(e))
|
|
9358
9394
|
for (let t of e) {
|
|
9359
9395
|
let i = t;
|
|
9360
9396
|
typeof i.name == 'string' &&
|
|
9361
9397
|
i.inputSchema &&
|
|
9362
9398
|
typeof i.inputSchema == 'object' &&
|
|
9363
|
-
|
|
9399
|
+
re.set(i.name, i.inputSchema);
|
|
9364
9400
|
}
|
|
9365
9401
|
}
|
|
9366
|
-
function
|
|
9367
|
-
(
|
|
9402
|
+
function Dr() {
|
|
9403
|
+
(re.clear(), (lt = 0));
|
|
9368
9404
|
}
|
|
9369
|
-
async function
|
|
9370
|
-
if (!(Date.now() -
|
|
9371
|
-
|
|
9405
|
+
async function Vr(e, t) {
|
|
9406
|
+
if (!(Date.now() - lt < 6e4)) {
|
|
9407
|
+
lt = Date.now();
|
|
9372
9408
|
try {
|
|
9373
9409
|
let a = await (
|
|
9374
9410
|
await fetch(e, {
|
|
@@ -9378,39 +9414,39 @@ async function Or(e, t) {
|
|
|
9378
9414
|
signal: AbortSignal.timeout(1e4),
|
|
9379
9415
|
})
|
|
9380
9416
|
).json();
|
|
9381
|
-
|
|
9417
|
+
dt(a.result?.tools);
|
|
9382
9418
|
} catch {}
|
|
9383
9419
|
}
|
|
9384
9420
|
}
|
|
9385
|
-
function
|
|
9421
|
+
function Nr(e) {
|
|
9386
9422
|
return e
|
|
9387
9423
|
? e.type === 'string'
|
|
9388
9424
|
? e.format === 'uri'
|
|
9389
9425
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
9390
9426
|
: !1;
|
|
9391
9427
|
}
|
|
9392
|
-
async function
|
|
9428
|
+
async function $i(e, t, i) {
|
|
9393
9429
|
if (typeof e != 'string') return e;
|
|
9394
|
-
let a =
|
|
9430
|
+
let a = Lr(e);
|
|
9395
9431
|
if (!a) return e;
|
|
9396
|
-
if (!
|
|
9397
|
-
return (await
|
|
9432
|
+
if (!Ri(a)) throw Li(a);
|
|
9433
|
+
return (await qi(a, t, i)).url;
|
|
9398
9434
|
}
|
|
9399
|
-
async function
|
|
9400
|
-
(
|
|
9401
|
-
let s =
|
|
9435
|
+
async function Di(e, t, i, a, n) {
|
|
9436
|
+
(re.size === 0 && dt(ot()), re.has(e) || (await Vr(n, i)));
|
|
9437
|
+
let s = re.get(e)?.properties;
|
|
9402
9438
|
if (!s) return t;
|
|
9403
9439
|
let o = { ...t };
|
|
9404
9440
|
for (let [u, l] of Object.entries(t))
|
|
9405
|
-
if (
|
|
9441
|
+
if (Nr(s[u]))
|
|
9406
9442
|
if (Array.isArray(l)) {
|
|
9407
9443
|
let c = [];
|
|
9408
|
-
for (let d of l) c.push(await
|
|
9444
|
+
for (let d of l) c.push(await $i(d, i, a));
|
|
9409
9445
|
o[u] = c;
|
|
9410
|
-
} else o[u] = await
|
|
9446
|
+
} else o[u] = await $i(l, i, a);
|
|
9411
9447
|
return o;
|
|
9412
9448
|
}
|
|
9413
|
-
function
|
|
9449
|
+
function Ur(e) {
|
|
9414
9450
|
let t = e.id ?? null;
|
|
9415
9451
|
switch (e.method) {
|
|
9416
9452
|
case 'initialize':
|
|
@@ -9428,7 +9464,7 @@ function Lr(e) {
|
|
|
9428
9464
|
case 'ping':
|
|
9429
9465
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
9430
9466
|
case 'tools/list':
|
|
9431
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9467
|
+
return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
|
|
9432
9468
|
case 'tools/call':
|
|
9433
9469
|
return {
|
|
9434
9470
|
jsonrpc: '2.0',
|
|
@@ -9451,13 +9487,13 @@ function Lr(e) {
|
|
|
9451
9487
|
};
|
|
9452
9488
|
}
|
|
9453
9489
|
}
|
|
9454
|
-
async function
|
|
9455
|
-
if (
|
|
9456
|
-
|
|
9457
|
-
let e =
|
|
9490
|
+
async function Vi() {
|
|
9491
|
+
if (Ei) return;
|
|
9492
|
+
Ei = !0;
|
|
9493
|
+
let e = qr(),
|
|
9458
9494
|
t = w(),
|
|
9459
9495
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9460
|
-
(
|
|
9496
|
+
(Ai.default
|
|
9461
9497
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
9462
9498
|
.on('line', async (n) => {
|
|
9463
9499
|
let s = n.trim();
|
|
@@ -9518,8 +9554,8 @@ async function Ri() {
|
|
|
9518
9554
|
try {
|
|
9519
9555
|
let p = z.default.resolve(d.trim());
|
|
9520
9556
|
if (V.default.existsSync(p) && V.default.statSync(p).isFile() && e) {
|
|
9521
|
-
if (!
|
|
9522
|
-
let m = await
|
|
9557
|
+
if (!Ri(p)) throw Li(p);
|
|
9558
|
+
let m = await qi(p, e, t),
|
|
9523
9559
|
y = (m.sizeBytes / 1024).toFixed(1),
|
|
9524
9560
|
_e =
|
|
9525
9561
|
m.mimeType.startsWith('image/') ||
|
|
@@ -9575,7 +9611,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9575
9611
|
}
|
|
9576
9612
|
if (e)
|
|
9577
9613
|
try {
|
|
9578
|
-
o.params.arguments = await
|
|
9614
|
+
o.params.arguments = await Di(String(l), c, e, t, i);
|
|
9579
9615
|
} catch (d) {
|
|
9580
9616
|
let p = d instanceof Error ? d.message : String(d);
|
|
9581
9617
|
process.stdout.write(
|
|
@@ -9606,10 +9642,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9606
9642
|
body: JSON.stringify(o),
|
|
9607
9643
|
}),
|
|
9608
9644
|
c = await l.text(),
|
|
9609
|
-
d =
|
|
9645
|
+
d = Oi(o, l.status, c);
|
|
9610
9646
|
if (d === null) return;
|
|
9611
9647
|
if (d) {
|
|
9612
|
-
(o?.method === 'tools/list' &&
|
|
9648
|
+
(o?.method === 'tools/list' && dt(d.result?.tools),
|
|
9613
9649
|
process.stdout.write(
|
|
9614
9650
|
JSON.stringify(d) +
|
|
9615
9651
|
`
|
|
@@ -9618,7 +9654,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9618
9654
|
return;
|
|
9619
9655
|
}
|
|
9620
9656
|
} catch {}
|
|
9621
|
-
let u =
|
|
9657
|
+
let u = Ur(o);
|
|
9622
9658
|
u !== null &&
|
|
9623
9659
|
process.stdout.write(
|
|
9624
9660
|
JSON.stringify(u) +
|
|
@@ -9643,21 +9679,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9643
9679
|
}
|
|
9644
9680
|
var V,
|
|
9645
9681
|
z,
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9682
|
+
Ai,
|
|
9683
|
+
Rr,
|
|
9684
|
+
re,
|
|
9685
|
+
lt,
|
|
9686
|
+
Ei,
|
|
9687
|
+
Ui = h(() => {
|
|
9652
9688
|
'use strict';
|
|
9653
9689
|
((V = T(require('node:fs'))),
|
|
9654
9690
|
(z = T(require('node:path'))),
|
|
9655
|
-
(
|
|
9656
|
-
|
|
9657
|
-
|
|
9691
|
+
(Ai = T(require('node:readline'))));
|
|
9692
|
+
tt();
|
|
9693
|
+
Ci();
|
|
9658
9694
|
E();
|
|
9659
|
-
|
|
9660
|
-
|
|
9695
|
+
ne();
|
|
9696
|
+
Rr = new Set([
|
|
9661
9697
|
'.png',
|
|
9662
9698
|
'.jpg',
|
|
9663
9699
|
'.jpeg',
|
|
@@ -9683,20 +9719,20 @@ var V,
|
|
|
9683
9719
|
'.flac',
|
|
9684
9720
|
'.opus',
|
|
9685
9721
|
]);
|
|
9686
|
-
((
|
|
9687
|
-
|
|
9722
|
+
((re = new Map()), (lt = 0));
|
|
9723
|
+
Ei = !1;
|
|
9688
9724
|
require.main === module &&
|
|
9689
|
-
|
|
9725
|
+
Vi().catch((e) => {
|
|
9690
9726
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
9691
9727
|
`),
|
|
9692
9728
|
process.exit(1));
|
|
9693
9729
|
});
|
|
9694
9730
|
});
|
|
9695
|
-
var
|
|
9731
|
+
var Yi =
|
|
9696
9732
|
!process.env.NO_COLOR &&
|
|
9697
9733
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
9698
9734
|
function x(e, t) {
|
|
9699
|
-
return (i) => (
|
|
9735
|
+
return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
9700
9736
|
}
|
|
9701
9737
|
var r = {
|
|
9702
9738
|
bold: x(1, 22),
|
|
@@ -9781,12 +9817,12 @@ var r = {
|
|
|
9781
9817
|
}
|
|
9782
9818
|
};
|
|
9783
9819
|
var U = T(require('node:fs')),
|
|
9784
|
-
|
|
9785
|
-
var
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
var
|
|
9820
|
+
O = T(require('node:path'));
|
|
9821
|
+
var se = T(require('node:fs')),
|
|
9822
|
+
ft = T(require('node:path')),
|
|
9823
|
+
gt = require('node:stream/promises');
|
|
9824
|
+
ne();
|
|
9825
|
+
var ea = new Set([
|
|
9790
9826
|
'account_suspended',
|
|
9791
9827
|
'account_terminated',
|
|
9792
9828
|
'creative_mode_restricted',
|
|
@@ -9794,7 +9830,7 @@ var Xi = new Set([
|
|
|
9794
9830
|
'workspace_paused',
|
|
9795
9831
|
]),
|
|
9796
9832
|
v = 1,
|
|
9797
|
-
|
|
9833
|
+
ta = 3,
|
|
9798
9834
|
b = class extends Error {
|
|
9799
9835
|
constructor(t, i, a, n = {}) {
|
|
9800
9836
|
(super(i),
|
|
@@ -9804,10 +9840,10 @@ var Xi = new Set([
|
|
|
9804
9840
|
(this.fields = n));
|
|
9805
9841
|
}
|
|
9806
9842
|
get exitCode() {
|
|
9807
|
-
return this.code &&
|
|
9843
|
+
return this.code && ea.has(this.code) ? ta : v;
|
|
9808
9844
|
}
|
|
9809
9845
|
};
|
|
9810
|
-
function
|
|
9846
|
+
function ia(e, t, i) {
|
|
9811
9847
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9812
9848
|
if (!i || typeof i != 'object') return new b(e, a);
|
|
9813
9849
|
let n = i;
|
|
@@ -9820,13 +9856,13 @@ function Zi(e, t, i) {
|
|
|
9820
9856
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
9821
9857
|
return new b(e, c, typeof o == 'string' ? o : void 0, l);
|
|
9822
9858
|
}
|
|
9823
|
-
function
|
|
9859
|
+
function ut(e) {
|
|
9824
9860
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
9825
9861
|
}
|
|
9826
9862
|
function K(e) {
|
|
9827
9863
|
let t = [e.message],
|
|
9828
|
-
i =
|
|
9829
|
-
a =
|
|
9864
|
+
i = ut(e.fields.required),
|
|
9865
|
+
a = ut(e.fields.balance);
|
|
9830
9866
|
(i || a) &&
|
|
9831
9867
|
t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
9832
9868
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -9834,19 +9870,19 @@ function K(e) {
|
|
|
9834
9870
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
9835
9871
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
9836
9872
|
}
|
|
9837
|
-
function
|
|
9873
|
+
function aa(e) {
|
|
9838
9874
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
9839
9875
|
? 'video'
|
|
9840
9876
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
9841
9877
|
? 'audio'
|
|
9842
9878
|
: 'image';
|
|
9843
9879
|
}
|
|
9844
|
-
function
|
|
9880
|
+
function mt(e) {
|
|
9845
9881
|
let t = [];
|
|
9846
9882
|
for (let i of e.data ?? [])
|
|
9847
9883
|
typeof i.message?.content == 'string'
|
|
9848
9884
|
? t.push({ type: 'text', text: i.message.content })
|
|
9849
|
-
: i.url && t.push({ type:
|
|
9885
|
+
: i.url && t.push({ type: aa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
|
|
9850
9886
|
return t;
|
|
9851
9887
|
}
|
|
9852
9888
|
var M = class {
|
|
@@ -9872,7 +9908,7 @@ var M = class {
|
|
|
9872
9908
|
try {
|
|
9873
9909
|
s = await n.json();
|
|
9874
9910
|
} catch {}
|
|
9875
|
-
throw
|
|
9911
|
+
throw ia(n.status, n.statusText, s);
|
|
9876
9912
|
}
|
|
9877
9913
|
return await n.json();
|
|
9878
9914
|
}
|
|
@@ -9886,7 +9922,7 @@ var M = class {
|
|
|
9886
9922
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
9887
9923
|
? n
|
|
9888
9924
|
: 'processing',
|
|
9889
|
-
o =
|
|
9925
|
+
o = mt(a);
|
|
9890
9926
|
return {
|
|
9891
9927
|
request_id: a.request_id || a.id || '',
|
|
9892
9928
|
model: a.model,
|
|
@@ -9904,7 +9940,7 @@ var M = class {
|
|
|
9904
9940
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
9905
9941
|
? a
|
|
9906
9942
|
: 'processing',
|
|
9907
|
-
s =
|
|
9943
|
+
s = mt(i),
|
|
9908
9944
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
9909
9945
|
return {
|
|
9910
9946
|
request_id: i.id || t,
|
|
@@ -9933,10 +9969,10 @@ var M = class {
|
|
|
9933
9969
|
async downloadOutput(t, i) {
|
|
9934
9970
|
let a = await fetch(t);
|
|
9935
9971
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
9936
|
-
let n =
|
|
9937
|
-
|
|
9938
|
-
let s =
|
|
9939
|
-
return (await (0,
|
|
9972
|
+
let n = ft.default.dirname(i);
|
|
9973
|
+
se.default.existsSync(n) || se.default.mkdirSync(n, { recursive: !0 });
|
|
9974
|
+
let s = se.default.createWriteStream(i);
|
|
9975
|
+
return (await (0, gt.pipeline)(a.body, s), i);
|
|
9940
9976
|
}
|
|
9941
9977
|
};
|
|
9942
9978
|
E();
|
|
@@ -9948,43 +9984,43 @@ function Se(e) {
|
|
|
9948
9984
|
a = Math.round(Number((e * i).toFixed(6))) / i;
|
|
9949
9985
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
9950
9986
|
}
|
|
9951
|
-
|
|
9952
|
-
var
|
|
9953
|
-
function
|
|
9954
|
-
for (let t of
|
|
9987
|
+
te();
|
|
9988
|
+
var di = ['images', 'input_images', 'videos', 'audios'];
|
|
9989
|
+
function Za(e) {
|
|
9990
|
+
for (let t of di) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
9955
9991
|
}
|
|
9956
|
-
function
|
|
9992
|
+
function er(e) {
|
|
9957
9993
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
9958
|
-
let t =
|
|
9994
|
+
let t = O.default.resolve(e);
|
|
9959
9995
|
return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
|
|
9960
9996
|
}
|
|
9961
|
-
async function
|
|
9962
|
-
for (let i of
|
|
9997
|
+
async function tr(e, t) {
|
|
9998
|
+
for (let i of di) {
|
|
9963
9999
|
if (!Array.isArray(e[i])) continue;
|
|
9964
10000
|
let a = [];
|
|
9965
10001
|
for (let n of e[i]) {
|
|
9966
10002
|
if (typeof n != 'string') continue;
|
|
9967
|
-
let s =
|
|
10003
|
+
let s = er(n);
|
|
9968
10004
|
a.push(s ? await t(s) : n);
|
|
9969
10005
|
}
|
|
9970
10006
|
e[i] = a;
|
|
9971
10007
|
}
|
|
9972
10008
|
}
|
|
9973
|
-
var
|
|
9974
|
-
function
|
|
10009
|
+
var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10010
|
+
function ir(e) {
|
|
9975
10011
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
9976
10012
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
9977
|
-
i =
|
|
10013
|
+
i = ie.enterprise;
|
|
9978
10014
|
return (
|
|
9979
10015
|
(!Number.isInteger(t) || t < 1 || t > i) &&
|
|
9980
10016
|
(process.stderr
|
|
9981
|
-
.write(`${r.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${
|
|
10017
|
+
.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.
|
|
9982
10018
|
`),
|
|
9983
10019
|
process.exit(1)),
|
|
9984
10020
|
t
|
|
9985
10021
|
);
|
|
9986
10022
|
}
|
|
9987
|
-
async function
|
|
10023
|
+
async function ar(e, t, i, a, n) {
|
|
9988
10024
|
n.isJson ||
|
|
9989
10025
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
9990
10026
|
`);
|
|
@@ -10059,12 +10095,12 @@ async function Za(e, t, i, a, n) {
|
|
|
10059
10095
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10060
10096
|
process.exit(v);
|
|
10061
10097
|
}
|
|
10062
|
-
function
|
|
10098
|
+
function rr(e, t, i) {
|
|
10063
10099
|
if (i <= 1) return e;
|
|
10064
|
-
let a =
|
|
10100
|
+
let a = O.default.extname(e);
|
|
10065
10101
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
10066
10102
|
}
|
|
10067
|
-
function
|
|
10103
|
+
function pi(e) {
|
|
10068
10104
|
let t = {},
|
|
10069
10105
|
i = new Set(),
|
|
10070
10106
|
a = [];
|
|
@@ -10109,7 +10145,7 @@ function oi(e) {
|
|
|
10109
10145
|
}
|
|
10110
10146
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
|
|
10111
10147
|
}
|
|
10112
|
-
async function
|
|
10148
|
+
async function Ze(e, t) {
|
|
10113
10149
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10114
10150
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10115
10151
|
(i ||
|
|
@@ -10131,7 +10167,7 @@ async function Qe(e, t) {
|
|
|
10131
10167
|
s = !!t.json,
|
|
10132
10168
|
o = !!(t.async || t.no_wait),
|
|
10133
10169
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
10134
|
-
l =
|
|
10170
|
+
l = ir(t),
|
|
10135
10171
|
c = { ...t };
|
|
10136
10172
|
(delete c.json,
|
|
10137
10173
|
delete c.async,
|
|
@@ -10140,8 +10176,8 @@ async function Qe(e, t) {
|
|
|
10140
10176
|
delete c.api_key,
|
|
10141
10177
|
delete c.api_url,
|
|
10142
10178
|
delete c.count);
|
|
10143
|
-
let d =
|
|
10144
|
-
(
|
|
10179
|
+
let d = li(n, c);
|
|
10180
|
+
(Za(d),
|
|
10145
10181
|
typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
|
|
10146
10182
|
d.image_url &&
|
|
10147
10183
|
!d.first_frame_image &&
|
|
@@ -10162,35 +10198,35 @@ async function Qe(e, t) {
|
|
|
10162
10198
|
for (let k of m) {
|
|
10163
10199
|
let g = d[k];
|
|
10164
10200
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
10165
|
-
let P =
|
|
10201
|
+
let P = O.default.resolve(g);
|
|
10166
10202
|
if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
|
|
10167
|
-
let I = new $(`Uploading local file ${
|
|
10203
|
+
let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
|
|
10168
10204
|
s || I.start();
|
|
10169
10205
|
try {
|
|
10170
10206
|
let N = U.default.readFileSync(P),
|
|
10171
|
-
|
|
10172
|
-
((d[k] =
|
|
10207
|
+
q = await p.uploadAsset(N.toString('base64'));
|
|
10208
|
+
((d[k] = q.url), s || I.succeed(`Uploaded ${O.default.basename(P)} to CDN`));
|
|
10173
10209
|
} catch (N) {
|
|
10174
|
-
let
|
|
10210
|
+
let q = N instanceof Error ? N.message : String(N);
|
|
10175
10211
|
(s
|
|
10176
10212
|
? process.stdout.write(
|
|
10177
|
-
JSON.stringify({ error:
|
|
10213
|
+
JSON.stringify({ error: q }) +
|
|
10178
10214
|
`
|
|
10179
10215
|
`,
|
|
10180
10216
|
)
|
|
10181
|
-
: I.fail(`Upload failed: ${
|
|
10217
|
+
: I.fail(`Upload failed: ${q}`),
|
|
10182
10218
|
process.exit(1));
|
|
10183
10219
|
}
|
|
10184
10220
|
}
|
|
10185
10221
|
}
|
|
10186
10222
|
}
|
|
10187
|
-
await
|
|
10188
|
-
let g = new $(`Uploading local file ${
|
|
10223
|
+
await tr(d, async (k) => {
|
|
10224
|
+
let g = new $(`Uploading local file ${O.default.basename(k)} to CDN...`);
|
|
10189
10225
|
s || g.start();
|
|
10190
10226
|
try {
|
|
10191
10227
|
let P = U.default.readFileSync(k),
|
|
10192
10228
|
I = await p.uploadAsset(P.toString('base64'));
|
|
10193
|
-
return (s || g.succeed(`Uploaded ${
|
|
10229
|
+
return (s || g.succeed(`Uploaded ${O.default.basename(k)} to CDN`), I.url);
|
|
10194
10230
|
} catch (P) {
|
|
10195
10231
|
let I = P instanceof Error ? P.message : String(P);
|
|
10196
10232
|
(s
|
|
@@ -10208,7 +10244,7 @@ async function Qe(e, t) {
|
|
|
10208
10244
|
let f;
|
|
10209
10245
|
try {
|
|
10210
10246
|
if (l > 1) {
|
|
10211
|
-
await
|
|
10247
|
+
await ar(p, e, d, l, { isJson: s, isAsync: o });
|
|
10212
10248
|
return;
|
|
10213
10249
|
}
|
|
10214
10250
|
f = await p.queueJob(e, d);
|
|
@@ -10311,13 +10347,13 @@ ${r.bold('Outputs:')}
|
|
|
10311
10347
|
`),
|
|
10312
10348
|
u)
|
|
10313
10349
|
) {
|
|
10314
|
-
let
|
|
10315
|
-
|
|
10350
|
+
let q = rr(u, g++, k),
|
|
10351
|
+
pt = new $(`Downloading output to ${q}...`).start();
|
|
10316
10352
|
try {
|
|
10317
|
-
(await p.downloadOutput(I.url,
|
|
10318
|
-
|
|
10353
|
+
(await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
|
|
10354
|
+
pt.succeed(`Saved to ${r.bold(q)}`));
|
|
10319
10355
|
} catch (Ie) {
|
|
10320
|
-
|
|
10356
|
+
pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
|
|
10321
10357
|
}
|
|
10322
10358
|
}
|
|
10323
10359
|
} else
|
|
@@ -10330,9 +10366,9 @@ ${I.text}
|
|
|
10330
10366
|
process.stdout.write(`
|
|
10331
10367
|
`);
|
|
10332
10368
|
}
|
|
10333
|
-
var
|
|
10369
|
+
var ci = T(require('node:readline'));
|
|
10334
10370
|
E();
|
|
10335
|
-
async function
|
|
10371
|
+
async function nr(e) {
|
|
10336
10372
|
try {
|
|
10337
10373
|
return (await new M(e, w()).checkKey(), 'ok');
|
|
10338
10374
|
} catch (t) {
|
|
@@ -10343,15 +10379,15 @@ async function tr(e) {
|
|
|
10343
10379
|
return 'unchecked';
|
|
10344
10380
|
}
|
|
10345
10381
|
}
|
|
10346
|
-
function
|
|
10347
|
-
let t =
|
|
10382
|
+
function sr(e) {
|
|
10383
|
+
let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10348
10384
|
return new Promise((i) => {
|
|
10349
10385
|
t.question(e, (a) => {
|
|
10350
10386
|
(t.close(), i(a.trim()));
|
|
10351
10387
|
});
|
|
10352
10388
|
});
|
|
10353
10389
|
}
|
|
10354
|
-
async function
|
|
10390
|
+
async function ae(e, t) {
|
|
10355
10391
|
switch (e) {
|
|
10356
10392
|
case 'login':
|
|
10357
10393
|
case 'set-key': {
|
|
@@ -10363,14 +10399,14 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10363
10399
|
process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
|
|
10364
10400
|
|
|
10365
10401
|
`),
|
|
10366
|
-
(i = await
|
|
10402
|
+
(i = await sr('Enter your Tein API Key (sk_live_...): '))),
|
|
10367
10403
|
!i.startsWith('sk_live_') &&
|
|
10368
10404
|
!i.startsWith('sk_test_') &&
|
|
10369
10405
|
(process.stderr
|
|
10370
10406
|
.write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10371
10407
|
`),
|
|
10372
10408
|
process.exit(1)));
|
|
10373
|
-
let a = await
|
|
10409
|
+
let a = await nr(i);
|
|
10374
10410
|
(a === 'invalid' &&
|
|
10375
10411
|
(process.stderr
|
|
10376
10412
|
.write(`${r.red('Error:')} Tein did not accept this key. Copy it again from ${r.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -10378,7 +10414,7 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10378
10414
|
process.exit(1)),
|
|
10379
10415
|
Ke({ apiKey: i }),
|
|
10380
10416
|
process.stdout.write(`
|
|
10381
|
-
${r.green('\u2713')} API key saved to ${r.dim(
|
|
10417
|
+
${r.green('\u2713')} API key saved to ${r.dim(le())}
|
|
10382
10418
|
`),
|
|
10383
10419
|
a === 'blocked'
|
|
10384
10420
|
? process.stdout
|
|
@@ -10403,7 +10439,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10403
10439
|
}
|
|
10404
10440
|
(Ke({ apiKey: '' }),
|
|
10405
10441
|
process.stdout
|
|
10406
|
-
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(
|
|
10442
|
+
.write(`${r.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${r.dim(le())}
|
|
10407
10443
|
`));
|
|
10408
10444
|
break;
|
|
10409
10445
|
}
|
|
@@ -10415,7 +10451,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10415
10451
|
(process.stdout.write(`
|
|
10416
10452
|
${r.bold('Tein AI CLI Configuration')}
|
|
10417
10453
|
`),
|
|
10418
|
-
process.stdout.write(` Config file: ${r.dim(
|
|
10454
|
+
process.stdout.write(` Config file: ${r.dim(le())}
|
|
10419
10455
|
`),
|
|
10420
10456
|
process.stdout.write(` API URL: ${r.cyan(a)}
|
|
10421
10457
|
`),
|
|
@@ -10445,10 +10481,10 @@ function _(e) {
|
|
|
10445
10481
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10446
10482
|
: `$${e.toFixed(2)}`;
|
|
10447
10483
|
}
|
|
10448
|
-
function
|
|
10484
|
+
function ui(e) {
|
|
10449
10485
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10450
10486
|
}
|
|
10451
|
-
function
|
|
10487
|
+
function or(e) {
|
|
10452
10488
|
let t = [
|
|
10453
10489
|
['Balance', _(e.balance)],
|
|
10454
10490
|
['Available to this key', _(e.available)],
|
|
@@ -10468,8 +10504,8 @@ function ar(e) {
|
|
|
10468
10504
|
`${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
|
|
10469
10505
|
]),
|
|
10470
10506
|
t.push(
|
|
10471
|
-
['This month', `${_(e.usage.this_month.spend)} on ${
|
|
10472
|
-
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${
|
|
10507
|
+
['This month', `${_(e.usage.this_month.spend)} on ${ui(e.usage.this_month.requests)}`],
|
|
10508
|
+
['Last 30 days', `${_(e.usage.last_30_days.spend)} on ${ui(e.usage.last_30_days.requests)}`],
|
|
10473
10509
|
[
|
|
10474
10510
|
'Auto top up',
|
|
10475
10511
|
e.auto_top_up.enabled
|
|
@@ -10482,7 +10518,7 @@ function ar(e) {
|
|
|
10482
10518
|
let a = Math.max(...t.map(([n]) => n.length));
|
|
10483
10519
|
return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
|
|
10484
10520
|
}
|
|
10485
|
-
async function
|
|
10521
|
+
async function mi(e) {
|
|
10486
10522
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10487
10523
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10488
10524
|
a = !!e.json;
|
|
@@ -10526,13 +10562,13 @@ async function pi(e) {
|
|
|
10526
10562
|
}
|
|
10527
10563
|
process.stdout.write(`
|
|
10528
10564
|
${r.bold('Tein balance')}
|
|
10529
|
-
${
|
|
10565
|
+
${or(n).join(`
|
|
10530
10566
|
`)}
|
|
10531
10567
|
|
|
10532
10568
|
`);
|
|
10533
10569
|
}
|
|
10534
10570
|
E();
|
|
10535
|
-
function
|
|
10571
|
+
function fi(e) {
|
|
10536
10572
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10537
10573
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
|
|
10538
10574
|
return (
|
|
@@ -10546,7 +10582,7 @@ function ci(e) {
|
|
|
10546
10582
|
new M(t, i)
|
|
10547
10583
|
);
|
|
10548
10584
|
}
|
|
10549
|
-
function
|
|
10585
|
+
function gi(e, t) {
|
|
10550
10586
|
let i = {};
|
|
10551
10587
|
for (let a of t) {
|
|
10552
10588
|
let n = e[a];
|
|
@@ -10554,7 +10590,7 @@ function ui(e, t) {
|
|
|
10554
10590
|
}
|
|
10555
10591
|
return i;
|
|
10556
10592
|
}
|
|
10557
|
-
async function
|
|
10593
|
+
async function hi(e, t) {
|
|
10558
10594
|
try {
|
|
10559
10595
|
return await t();
|
|
10560
10596
|
} catch (i) {
|
|
@@ -10578,7 +10614,7 @@ async function mi(e, t) {
|
|
|
10578
10614
|
process.exit(v));
|
|
10579
10615
|
}
|
|
10580
10616
|
}
|
|
10581
|
-
function
|
|
10617
|
+
function et(e) {
|
|
10582
10618
|
let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
|
|
10583
10619
|
i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
|
|
10584
10620
|
return e.map(
|
|
@@ -10589,7 +10625,7 @@ function Ze(e) {
|
|
|
10589
10625
|
.trimEnd()}`,
|
|
10590
10626
|
);
|
|
10591
10627
|
}
|
|
10592
|
-
function
|
|
10628
|
+
function lr(e) {
|
|
10593
10629
|
let t = e.summary,
|
|
10594
10630
|
i = [
|
|
10595
10631
|
` 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}` : ''}`,
|
|
@@ -10601,7 +10637,7 @@ function rr(e) {
|
|
|
10601
10637
|
e.by_channel.length &&
|
|
10602
10638
|
(i.push('', r.bold('By channel')),
|
|
10603
10639
|
i.push(
|
|
10604
|
-
...
|
|
10640
|
+
...et([
|
|
10605
10641
|
['Channel', 'Spend', 'Requests'],
|
|
10606
10642
|
...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
|
|
10607
10643
|
]),
|
|
@@ -10609,7 +10645,7 @@ function rr(e) {
|
|
|
10609
10645
|
e.by_model.length &&
|
|
10610
10646
|
(i.push('', r.bold('By model')),
|
|
10611
10647
|
i.push(
|
|
10612
|
-
...
|
|
10648
|
+
...et([
|
|
10613
10649
|
['Model', 'Spend', 'Requests', 'Failed'],
|
|
10614
10650
|
...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
|
|
10615
10651
|
]),
|
|
@@ -10617,10 +10653,10 @@ function rr(e) {
|
|
|
10617
10653
|
i
|
|
10618
10654
|
);
|
|
10619
10655
|
}
|
|
10620
|
-
async function
|
|
10656
|
+
async function yi(e) {
|
|
10621
10657
|
let t = !!e.json,
|
|
10622
|
-
i =
|
|
10623
|
-
a = await
|
|
10658
|
+
i = fi(e),
|
|
10659
|
+
a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
|
|
10624
10660
|
if (t) {
|
|
10625
10661
|
process.stdout.write(
|
|
10626
10662
|
JSON.stringify(a, null, 2) +
|
|
@@ -10631,14 +10667,14 @@ async function fi(e) {
|
|
|
10631
10667
|
}
|
|
10632
10668
|
process.stdout.write(`
|
|
10633
10669
|
${r.bold('Tein usage')}
|
|
10634
|
-
${
|
|
10670
|
+
${lr(a).join(`
|
|
10635
10671
|
`)}
|
|
10636
10672
|
|
|
10637
10673
|
`);
|
|
10638
10674
|
}
|
|
10639
|
-
function
|
|
10675
|
+
function dr(e) {
|
|
10640
10676
|
return e.data.length
|
|
10641
|
-
?
|
|
10677
|
+
? et([
|
|
10642
10678
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
10643
10679
|
...e.data.map((t) => [
|
|
10644
10680
|
t.created_at.slice(0, 16).replace('T', ' '),
|
|
@@ -10649,10 +10685,10 @@ function nr(e) {
|
|
|
10649
10685
|
])
|
|
10650
10686
|
: [' No transactions yet.'];
|
|
10651
10687
|
}
|
|
10652
|
-
async function
|
|
10688
|
+
async function bi(e) {
|
|
10653
10689
|
let t = !!e.json,
|
|
10654
|
-
i =
|
|
10655
|
-
a = await
|
|
10690
|
+
i = fi(e),
|
|
10691
|
+
a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
|
|
10656
10692
|
if (t) {
|
|
10657
10693
|
process.stdout.write(
|
|
10658
10694
|
JSON.stringify(a, null, 2) +
|
|
@@ -10668,18 +10704,18 @@ async function gi(e) {
|
|
|
10668
10704
|
: '';
|
|
10669
10705
|
process.stdout.write(`
|
|
10670
10706
|
${r.bold('Tein balance history')}
|
|
10671
|
-
${
|
|
10707
|
+
${dr(a).join(`
|
|
10672
10708
|
`)}${n}
|
|
10673
10709
|
|
|
10674
10710
|
`);
|
|
10675
10711
|
}
|
|
10676
10712
|
E();
|
|
10677
10713
|
Ce();
|
|
10678
|
-
|
|
10679
|
-
var
|
|
10680
|
-
async function
|
|
10714
|
+
te();
|
|
10715
|
+
var pr = 3e3;
|
|
10716
|
+
async function ki(e) {
|
|
10681
10717
|
try {
|
|
10682
|
-
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
10718
|
+
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
|
|
10683
10719
|
if (!t.ok) return;
|
|
10684
10720
|
let i = await t.json(),
|
|
10685
10721
|
a = {};
|
|
@@ -10687,18 +10723,18 @@ async function hi(e) {
|
|
|
10687
10723
|
let s = String(n.modelSlug ?? '');
|
|
10688
10724
|
J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
10689
10725
|
}
|
|
10690
|
-
|
|
10726
|
+
ii(a);
|
|
10691
10727
|
} catch {}
|
|
10692
10728
|
}
|
|
10693
|
-
var
|
|
10694
|
-
|
|
10695
|
-
async function
|
|
10696
|
-
await
|
|
10729
|
+
var cr = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
10730
|
+
ur = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
10731
|
+
async function wi(e, t) {
|
|
10732
|
+
await ki(t);
|
|
10697
10733
|
let i = D();
|
|
10698
10734
|
if (e) {
|
|
10699
10735
|
let s = e.toLowerCase(),
|
|
10700
|
-
o =
|
|
10701
|
-
i =
|
|
10736
|
+
o = ur[s] ?? s;
|
|
10737
|
+
i = cr.has(o)
|
|
10702
10738
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
10703
10739
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
10704
10740
|
}
|
|
@@ -10736,8 +10772,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
10736
10772
|
|
|
10737
10773
|
`);
|
|
10738
10774
|
}
|
|
10739
|
-
async function
|
|
10740
|
-
J.has(e) && (await
|
|
10775
|
+
async function xi(e, t) {
|
|
10776
|
+
J.has(e) && (await ki(t));
|
|
10741
10777
|
let i = H(e);
|
|
10742
10778
|
(i ||
|
|
10743
10779
|
(process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -10818,9 +10854,9 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
|
|
|
10818
10854
|
`);
|
|
10819
10855
|
}
|
|
10820
10856
|
E();
|
|
10821
|
-
|
|
10822
|
-
var
|
|
10823
|
-
|
|
10857
|
+
tt();
|
|
10858
|
+
var mr = 1e4,
|
|
10859
|
+
at = {
|
|
10824
10860
|
price: '',
|
|
10825
10861
|
creativeMode: 'Creative mode',
|
|
10826
10862
|
priority: 'Priority',
|
|
@@ -10830,22 +10866,22 @@ var dr = 1e4,
|
|
|
10830
10866
|
priorityDraft: 'Priority + Draft',
|
|
10831
10867
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
10832
10868
|
},
|
|
10833
|
-
|
|
10834
|
-
|
|
10869
|
+
fr = Object.keys(at),
|
|
10870
|
+
gr = {
|
|
10835
10871
|
creativeMode: 'unfiltered',
|
|
10836
10872
|
creativeModePriority: 'unfilteredPriority',
|
|
10837
10873
|
creativeModeDraft: 'unfilteredDraft',
|
|
10838
10874
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
10839
10875
|
};
|
|
10840
|
-
function
|
|
10841
|
-
let i =
|
|
10876
|
+
function hr(e, t) {
|
|
10877
|
+
let i = gr[t];
|
|
10842
10878
|
return e[t] ?? (i ? e[i] : void 0);
|
|
10843
10879
|
}
|
|
10844
|
-
async function
|
|
10880
|
+
async function yr(e, t) {
|
|
10845
10881
|
let i = `${w(e)}${xe(t)}`,
|
|
10846
10882
|
a;
|
|
10847
10883
|
try {
|
|
10848
|
-
a = await fetch(i, { signal: AbortSignal.timeout(
|
|
10884
|
+
a = await fetch(i, { signal: AbortSignal.timeout(mr) });
|
|
10849
10885
|
} catch {
|
|
10850
10886
|
throw new Error(`Could not reach ${i}`);
|
|
10851
10887
|
}
|
|
@@ -10861,18 +10897,18 @@ async function mr(e, t) {
|
|
|
10861
10897
|
}
|
|
10862
10898
|
return n;
|
|
10863
10899
|
}
|
|
10864
|
-
function
|
|
10900
|
+
function it(e) {
|
|
10865
10901
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
10866
10902
|
[i, a = ''] = t.split('.');
|
|
10867
10903
|
return `$${i}.${a.padEnd(2, '0')}`;
|
|
10868
10904
|
}
|
|
10869
|
-
function
|
|
10905
|
+
function rt(e) {
|
|
10870
10906
|
if (!e || typeof e.starter != 'number') return null;
|
|
10871
10907
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
10872
10908
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
10873
|
-
return `Starter ${
|
|
10909
|
+
return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
|
|
10874
10910
|
}
|
|
10875
|
-
function
|
|
10911
|
+
function br(e) {
|
|
10876
10912
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
10877
10913
|
let t = [];
|
|
10878
10914
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -10884,33 +10920,33 @@ function fr(e) {
|
|
|
10884
10920
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
10885
10921
|
);
|
|
10886
10922
|
}
|
|
10887
|
-
function
|
|
10888
|
-
let i =
|
|
10889
|
-
for (let a of
|
|
10890
|
-
let n =
|
|
10923
|
+
function kr(e, t) {
|
|
10924
|
+
let i = br(e);
|
|
10925
|
+
for (let a of fr) {
|
|
10926
|
+
let n = rt(hr(e, a));
|
|
10891
10927
|
if (!n) continue;
|
|
10892
|
-
let s =
|
|
10928
|
+
let s = at[a] ? ` (${at[a]})` : '';
|
|
10893
10929
|
t.push(` ${i}${s} ${n}`);
|
|
10894
10930
|
}
|
|
10895
10931
|
}
|
|
10896
|
-
function
|
|
10932
|
+
function wr(e, t) {
|
|
10897
10933
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
10898
10934
|
t.push(
|
|
10899
10935
|
` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
10900
10936
|
);
|
|
10901
|
-
for (let n of e.variants ?? [])
|
|
10937
|
+
for (let n of e.variants ?? []) kr(n, t);
|
|
10902
10938
|
let a = e.addons;
|
|
10903
10939
|
if (Array.isArray(a))
|
|
10904
10940
|
for (let n of a) {
|
|
10905
10941
|
if (!n || typeof n != 'object') continue;
|
|
10906
10942
|
let s = n,
|
|
10907
10943
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
10908
|
-
u =
|
|
10944
|
+
u = rt(s.price);
|
|
10909
10945
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
10910
10946
|
}
|
|
10911
10947
|
t.push('');
|
|
10912
10948
|
}
|
|
10913
|
-
function
|
|
10949
|
+
function xr(e) {
|
|
10914
10950
|
let t = [],
|
|
10915
10951
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
10916
10952
|
(t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -10932,7 +10968,7 @@ function yr(e) {
|
|
|
10932
10968
|
});
|
|
10933
10969
|
for (let l of s) {
|
|
10934
10970
|
t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
10935
|
-
for (let c of a.get(l) ?? [])
|
|
10971
|
+
for (let c of a.get(l) ?? []) wr(c, t);
|
|
10936
10972
|
}
|
|
10937
10973
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
10938
10974
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -10949,7 +10985,7 @@ function yr(e) {
|
|
|
10949
10985
|
t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
|
|
10950
10986
|
for (let m of d) {
|
|
10951
10987
|
let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
10952
|
-
f =
|
|
10988
|
+
f = rt(m.prices);
|
|
10953
10989
|
f && t.push(` ${y} ${f}`);
|
|
10954
10990
|
}
|
|
10955
10991
|
t.push('');
|
|
@@ -10962,10 +10998,10 @@ function yr(e) {
|
|
|
10962
10998
|
`
|
|
10963
10999
|
);
|
|
10964
11000
|
}
|
|
10965
|
-
async function
|
|
11001
|
+
async function _i(e) {
|
|
10966
11002
|
let t;
|
|
10967
11003
|
try {
|
|
10968
|
-
t = await
|
|
11004
|
+
t = await yr(e.apiUrl, e.model);
|
|
10969
11005
|
} catch (i) {
|
|
10970
11006
|
let a = i instanceof Error ? i.message : String(i);
|
|
10971
11007
|
(process.stderr.write(`${r.red('Error:')} ${a}
|
|
@@ -10976,12 +11012,12 @@ async function ki(e) {
|
|
|
10976
11012
|
e.json
|
|
10977
11013
|
? `${JSON.stringify(t, null, 2)}
|
|
10978
11014
|
`
|
|
10979
|
-
:
|
|
11015
|
+
: xr(t),
|
|
10980
11016
|
);
|
|
10981
11017
|
}
|
|
10982
|
-
var
|
|
11018
|
+
var Pi = T(require('node:path'));
|
|
10983
11019
|
E();
|
|
10984
|
-
async function
|
|
11020
|
+
async function Ii(e, t) {
|
|
10985
11021
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10986
11022
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10987
11023
|
(i ||
|
|
@@ -11076,7 +11112,7 @@ ${r.bold('Outputs:')}
|
|
|
11076
11112
|
) {
|
|
11077
11113
|
let p = new $(`Downloading output to ${o}...`).start();
|
|
11078
11114
|
try {
|
|
11079
|
-
(await u.downloadOutput(d.url,
|
|
11115
|
+
(await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
|
|
11080
11116
|
p.succeed(`Saved to ${r.bold(o)}`));
|
|
11081
11117
|
} catch (m) {
|
|
11082
11118
|
p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -11091,10 +11127,10 @@ ${d.text}
|
|
|
11091
11127
|
process.stdout.write(`
|
|
11092
11128
|
`);
|
|
11093
11129
|
}
|
|
11094
|
-
var
|
|
11095
|
-
|
|
11130
|
+
var nt = T(require('node:fs')),
|
|
11131
|
+
st = T(require('node:path'));
|
|
11096
11132
|
E();
|
|
11097
|
-
async function
|
|
11133
|
+
async function vi(e, t = {}) {
|
|
11098
11134
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11099
11135
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
11100
11136
|
n = !!t.json;
|
|
@@ -11111,13 +11147,13 @@ async function _i(e, t = {}) {
|
|
|
11111
11147
|
process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
|
|
11112
11148
|
`),
|
|
11113
11149
|
process.exit(1)));
|
|
11114
|
-
let s =
|
|
11115
|
-
|
|
11150
|
+
let s = st.default.resolve(e);
|
|
11151
|
+
nt.default.existsSync(s) ||
|
|
11116
11152
|
(process.stderr.write(`${r.red('Error:')} File not found: ${s}
|
|
11117
11153
|
`),
|
|
11118
11154
|
process.exit(1));
|
|
11119
|
-
let o =
|
|
11120
|
-
l =
|
|
11155
|
+
let o = st.default.basename(s),
|
|
11156
|
+
l = nt.default.readFileSync(s).toString('base64'),
|
|
11121
11157
|
c = new M(i, a),
|
|
11122
11158
|
d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
|
|
11123
11159
|
n || d.start();
|
|
@@ -11158,10 +11194,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
|
|
|
11158
11194
|
process.exit(m ? m.exitCode : v));
|
|
11159
11195
|
}
|
|
11160
11196
|
}
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
function
|
|
11197
|
+
ne();
|
|
11198
|
+
te();
|
|
11199
|
+
De();
|
|
11200
|
+
function Fi() {
|
|
11165
11201
|
process.stdout.write(`
|
|
11166
11202
|
${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
11167
11203
|
|
|
@@ -11243,11 +11279,11 @@ ${r.bold('EXAMPLES:')}
|
|
|
11243
11279
|
|
|
11244
11280
|
`);
|
|
11245
11281
|
}
|
|
11246
|
-
async function
|
|
11282
|
+
async function Fr() {
|
|
11247
11283
|
let e = process.argv.slice(2),
|
|
11248
|
-
t =
|
|
11284
|
+
t = pi(e);
|
|
11249
11285
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
11250
|
-
|
|
11286
|
+
Fi();
|
|
11251
11287
|
return;
|
|
11252
11288
|
}
|
|
11253
11289
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -11257,31 +11293,31 @@ async function Dr() {
|
|
|
11257
11293
|
}
|
|
11258
11294
|
switch (t.command) {
|
|
11259
11295
|
case 'auth': {
|
|
11260
|
-
await
|
|
11296
|
+
await ae(t.subcommand, t.options.key);
|
|
11261
11297
|
break;
|
|
11262
11298
|
}
|
|
11263
11299
|
case 'login': {
|
|
11264
|
-
await
|
|
11300
|
+
await ae('login', t.options.key);
|
|
11265
11301
|
break;
|
|
11266
11302
|
}
|
|
11267
11303
|
case 'logout': {
|
|
11268
|
-
await
|
|
11304
|
+
await ae('logout');
|
|
11269
11305
|
break;
|
|
11270
11306
|
}
|
|
11271
11307
|
case 'whoami': {
|
|
11272
|
-
await
|
|
11308
|
+
await ae('status');
|
|
11273
11309
|
break;
|
|
11274
11310
|
}
|
|
11275
11311
|
case 'models':
|
|
11276
11312
|
case 'list': {
|
|
11277
|
-
await
|
|
11313
|
+
await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
11278
11314
|
break;
|
|
11279
11315
|
}
|
|
11280
11316
|
case 'pricing':
|
|
11281
11317
|
case 'prices': {
|
|
11282
11318
|
let i = t.options.model,
|
|
11283
11319
|
a = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
11284
|
-
await
|
|
11320
|
+
await _i({
|
|
11285
11321
|
model: a,
|
|
11286
11322
|
json: !!t.options.json,
|
|
11287
11323
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -11296,40 +11332,40 @@ async function Dr() {
|
|
|
11296
11332
|
process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
|
|
11297
11333
|
`),
|
|
11298
11334
|
process.exit(1)),
|
|
11299
|
-
await
|
|
11335
|
+
await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
11300
11336
|
break;
|
|
11301
11337
|
}
|
|
11302
11338
|
case 'upload': {
|
|
11303
11339
|
let i = t.subcommand || '';
|
|
11304
|
-
await
|
|
11340
|
+
await vi(i, t.options);
|
|
11305
11341
|
break;
|
|
11306
11342
|
}
|
|
11307
11343
|
case 'run':
|
|
11308
11344
|
case 'generate': {
|
|
11309
11345
|
let i = t.subcommand || '';
|
|
11310
|
-
await
|
|
11346
|
+
await Ze(i, t.options);
|
|
11311
11347
|
break;
|
|
11312
11348
|
}
|
|
11313
11349
|
case 'status': {
|
|
11314
11350
|
let i = t.subcommand || '';
|
|
11315
|
-
await
|
|
11351
|
+
await Ii(i, t.options);
|
|
11316
11352
|
break;
|
|
11317
11353
|
}
|
|
11318
11354
|
case 'balance': {
|
|
11319
|
-
await
|
|
11355
|
+
await mi(t.options);
|
|
11320
11356
|
break;
|
|
11321
11357
|
}
|
|
11322
11358
|
case 'usage': {
|
|
11323
|
-
await
|
|
11359
|
+
await yi(t.options);
|
|
11324
11360
|
break;
|
|
11325
11361
|
}
|
|
11326
11362
|
case 'transactions':
|
|
11327
11363
|
case 'history': {
|
|
11328
|
-
await
|
|
11364
|
+
await bi(t.options);
|
|
11329
11365
|
break;
|
|
11330
11366
|
}
|
|
11331
11367
|
case 'mcp': {
|
|
11332
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
11368
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
|
|
11333
11369
|
await i();
|
|
11334
11370
|
break;
|
|
11335
11371
|
}
|
|
@@ -11342,15 +11378,15 @@ ${r.red('Error:')} Unknown command or model "${t.command}".
|
|
|
11342
11378
|
Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
|
|
11343
11379
|
`),
|
|
11344
11380
|
process.exit(v)),
|
|
11345
|
-
await
|
|
11381
|
+
await Ze(t.command, t.options));
|
|
11346
11382
|
return;
|
|
11347
11383
|
}
|
|
11348
|
-
|
|
11384
|
+
Fi();
|
|
11349
11385
|
break;
|
|
11350
11386
|
}
|
|
11351
11387
|
}
|
|
11352
11388
|
}
|
|
11353
|
-
|
|
11389
|
+
Fr().catch((e) => {
|
|
11354
11390
|
(e instanceof b &&
|
|
11355
11391
|
(process.stderr.write(`
|
|
11356
11392
|
${r.red('Error:')} ${K(e).join(`
|