@teinai/cli 1.1.36 → 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 +633 -621
- 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
|
-
kn,
|
|
6641
|
-
ma,
|
|
6642
|
-
Ut,
|
|
6643
|
-
Ve,
|
|
6644
|
-
wn,
|
|
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,7 +8012,7 @@ function Ba(e) {
|
|
|
8000
8012
|
return [C('Prompt text.')];
|
|
8001
8013
|
}
|
|
8002
8014
|
}
|
|
8003
|
-
function
|
|
8015
|
+
function Ja() {
|
|
8004
8016
|
let e = (t, i) => ({
|
|
8005
8017
|
name: t,
|
|
8006
8018
|
type: 'slider',
|
|
@@ -8023,10 +8035,10 @@ function Ga() {
|
|
|
8023
8035
|
),
|
|
8024
8036
|
];
|
|
8025
8037
|
}
|
|
8026
|
-
function
|
|
8038
|
+
function Wa() {
|
|
8027
8039
|
return {
|
|
8028
8040
|
slug: he,
|
|
8029
|
-
name:
|
|
8041
|
+
name: Wt,
|
|
8030
8042
|
category: 'Image',
|
|
8031
8043
|
kind: 'Image-to-Image',
|
|
8032
8044
|
vendor: 'Enhancor',
|
|
@@ -8034,7 +8046,7 @@ function Ha() {
|
|
|
8034
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).',
|
|
8035
8047
|
priceFormatted: '',
|
|
8036
8048
|
unit: '/img',
|
|
8037
|
-
primaryToolName:
|
|
8049
|
+
primaryToolName: ti.image,
|
|
8038
8050
|
parameters: [
|
|
8039
8051
|
{
|
|
8040
8052
|
name: 'image',
|
|
@@ -8060,45 +8072,45 @@ function Ha() {
|
|
|
8060
8072
|
{
|
|
8061
8073
|
name: 'scale',
|
|
8062
8074
|
type: 'select',
|
|
8063
|
-
default: String(
|
|
8064
|
-
options:
|
|
8065
|
-
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.`,
|
|
8066
8078
|
},
|
|
8067
|
-
...
|
|
8079
|
+
...Ja(),
|
|
8068
8080
|
],
|
|
8069
8081
|
};
|
|
8070
8082
|
}
|
|
8071
|
-
function
|
|
8083
|
+
function Je(e, t = e.api.model) {
|
|
8072
8084
|
return {
|
|
8073
8085
|
slug: t,
|
|
8074
8086
|
name: e.name,
|
|
8075
|
-
category:
|
|
8076
|
-
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],
|
|
8077
8089
|
vendor: e.vendor ?? '',
|
|
8078
8090
|
description: e.desc ?? e.name,
|
|
8079
|
-
priceFormatted:
|
|
8091
|
+
priceFormatted: Ma(e),
|
|
8080
8092
|
unit: e.unit,
|
|
8081
|
-
primaryToolName:
|
|
8082
|
-
parameters:
|
|
8093
|
+
primaryToolName: ti[e.kind],
|
|
8094
|
+
parameters: Ca(e, Ha(e)),
|
|
8083
8095
|
};
|
|
8084
8096
|
}
|
|
8085
|
-
function
|
|
8097
|
+
function Ya() {
|
|
8086
8098
|
let e = {};
|
|
8087
8099
|
for (let t of ue())
|
|
8088
8100
|
if (t.slug !== 'seedance-2-fast') {
|
|
8089
8101
|
if (t.slug === 'seedance-2-mini') {
|
|
8090
|
-
e['seedance-2-mini'] =
|
|
8102
|
+
e['seedance-2-mini'] = Je(t, 'seedance-2-mini');
|
|
8091
8103
|
continue;
|
|
8092
8104
|
}
|
|
8093
8105
|
if (t.slug === 'seedance-2') {
|
|
8094
|
-
let i =
|
|
8106
|
+
let i = Je(t);
|
|
8095
8107
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8096
8108
|
(e['seedance-2'] = i));
|
|
8097
8109
|
continue;
|
|
8098
8110
|
}
|
|
8099
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
8111
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Je(t));
|
|
8100
8112
|
}
|
|
8101
|
-
(Object.assign(e,
|
|
8113
|
+
(Object.assign(e, Nt()), (e[he] = Wa()));
|
|
8102
8114
|
for (let [t, i] of Object.entries(fe))
|
|
8103
8115
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
8104
8116
|
return e;
|
|
@@ -8109,15 +8121,15 @@ function we(e) {
|
|
|
8109
8121
|
function H(e) {
|
|
8110
8122
|
return ke[e] ?? null;
|
|
8111
8123
|
}
|
|
8112
|
-
function
|
|
8124
|
+
function Xa(e, t, i) {
|
|
8113
8125
|
if (e.startsWith('enhancor-skin-fix-') || e === he) return !1;
|
|
8114
|
-
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') {
|
|
8115
8127
|
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
8116
8128
|
if (n(i.mode) === 'edit' || n(i.omni_reference_task_type) === 'edit') return !1;
|
|
8117
8129
|
}
|
|
8118
8130
|
if (
|
|
8119
|
-
(t === 'max_tokens' &&
|
|
8120
|
-
(t === 'max_completion_tokens' &&
|
|
8131
|
+
(t === 'max_tokens' && ei(i.max_completion_tokens)) ||
|
|
8132
|
+
(t === 'max_completion_tokens' && ei(i.max_tokens))
|
|
8121
8133
|
)
|
|
8122
8134
|
return !1;
|
|
8123
8135
|
if (t === 'aspect_ratio') {
|
|
@@ -8125,124 +8137,124 @@ function Ja(e, t, i) {
|
|
|
8125
8137
|
if (n) {
|
|
8126
8138
|
let s = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8127
8139
|
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
8128
|
-
if (n.modes.includes(o) && !
|
|
8140
|
+
if (n.modes.includes(o) && !Gt(n, o)) return !1;
|
|
8129
8141
|
}
|
|
8130
8142
|
}
|
|
8131
8143
|
let a = ge(e);
|
|
8132
8144
|
if (a) {
|
|
8133
8145
|
let n = typeof i.mode == 'string' ? i.mode.trim().toLowerCase() : '',
|
|
8134
8146
|
s = n ? n.replace(/-/g, '_') : a.modes[0];
|
|
8135
|
-
if (a.modes.includes(s) && !
|
|
8147
|
+
if (a.modes.includes(s) && !Ht(a, s, t)) return !1;
|
|
8136
8148
|
}
|
|
8137
8149
|
return !0;
|
|
8138
8150
|
}
|
|
8139
|
-
function
|
|
8151
|
+
function ei(e) {
|
|
8140
8152
|
return e != null && e !== '';
|
|
8141
8153
|
}
|
|
8142
|
-
function
|
|
8154
|
+
function li(e, t) {
|
|
8143
8155
|
let i = { ...t };
|
|
8144
8156
|
if (e?.slug === 'seedance-2-5') {
|
|
8145
8157
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
8146
|
-
for (let n of
|
|
8158
|
+
for (let n of Qa) (a(i.finalize) && !a(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
8147
8159
|
if (!a(i.finalize)) return i;
|
|
8148
8160
|
}
|
|
8149
8161
|
for (let a of e?.parameters ?? [])
|
|
8150
8162
|
a.default !== void 0 &&
|
|
8151
8163
|
i[a.name] === void 0 &&
|
|
8152
|
-
|
|
8164
|
+
Xa(e.slug, a.name, t) &&
|
|
8153
8165
|
(i[a.name] = a.default);
|
|
8154
8166
|
return i;
|
|
8155
8167
|
}
|
|
8156
8168
|
function D() {
|
|
8157
8169
|
return Object.values(ke);
|
|
8158
8170
|
}
|
|
8159
|
-
var
|
|
8160
|
-
Qt,
|
|
8161
|
-
Pa,
|
|
8162
|
-
C,
|
|
8163
|
-
Je,
|
|
8164
|
-
Ta,
|
|
8171
|
+
var va,
|
|
8165
8172
|
ti,
|
|
8173
|
+
Ta,
|
|
8174
|
+
C,
|
|
8166
8175
|
We,
|
|
8167
|
-
Ye,
|
|
8168
|
-
be,
|
|
8169
|
-
Ka,
|
|
8170
8176
|
Sa,
|
|
8171
|
-
Ca,
|
|
8172
|
-
qa,
|
|
8173
|
-
Oa,
|
|
8174
|
-
Ra,
|
|
8175
|
-
Na,
|
|
8176
|
-
Z,
|
|
8177
|
-
He,
|
|
8178
|
-
ai,
|
|
8179
8177
|
ri,
|
|
8180
|
-
|
|
8181
|
-
|
|
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,
|
|
8182
8194
|
ke,
|
|
8183
|
-
|
|
8184
|
-
|
|
8195
|
+
Qa,
|
|
8196
|
+
te = h(() => {
|
|
8185
8197
|
'use strict';
|
|
8186
|
-
|
|
8198
|
+
kt();
|
|
8187
8199
|
Ce();
|
|
8188
8200
|
G();
|
|
8189
|
-
Re();
|
|
8190
|
-
$e();
|
|
8191
8201
|
Le();
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
Jt();
|
|
8202
|
+
$e();
|
|
8203
|
+
De();
|
|
8204
|
+
Et();
|
|
8205
|
+
Ot();
|
|
8206
|
+
Rt();
|
|
8207
|
+
Ut();
|
|
8199
8208
|
Fe();
|
|
8200
|
-
(
|
|
8201
|
-
|
|
8209
|
+
Jt();
|
|
8210
|
+
Xt();
|
|
8211
|
+
Be();
|
|
8212
|
+
((va = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8213
|
+
(ti = {
|
|
8202
8214
|
video: 'generate_video',
|
|
8203
8215
|
image: 'generate_image',
|
|
8204
8216
|
audio: 'generate_audio',
|
|
8205
8217
|
llm: 'run_task',
|
|
8206
8218
|
}),
|
|
8207
|
-
(
|
|
8219
|
+
(Ta = {
|
|
8208
8220
|
video: 'Text-to-Video',
|
|
8209
8221
|
image: 'Text-to-Image',
|
|
8210
8222
|
audio: 'Text-to-Audio',
|
|
8211
8223
|
llm: 'Reasoning (LLM)',
|
|
8212
8224
|
}));
|
|
8213
8225
|
C = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
8214
|
-
((
|
|
8226
|
+
((We = {
|
|
8215
8227
|
name: 'creative_mode',
|
|
8216
8228
|
type: 'boolean',
|
|
8217
8229
|
default: !1,
|
|
8218
8230
|
description:
|
|
8219
8231
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8220
8232
|
}),
|
|
8221
|
-
(
|
|
8233
|
+
(Sa = {
|
|
8222
8234
|
name: 'creative_mode',
|
|
8223
8235
|
type: 'boolean',
|
|
8224
8236
|
default: !1,
|
|
8225
8237
|
description: `Not available yet on this model: ${ye}.`,
|
|
8226
8238
|
}),
|
|
8227
|
-
(
|
|
8239
|
+
(ri = {
|
|
8228
8240
|
name: 'priority',
|
|
8229
8241
|
type: 'boolean',
|
|
8230
8242
|
default: !1,
|
|
8231
8243
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
8232
8244
|
}),
|
|
8233
|
-
(
|
|
8245
|
+
(Ye = {
|
|
8234
8246
|
name: 'reference_roles',
|
|
8235
8247
|
type: 'json',
|
|
8236
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).`,
|
|
8237
8249
|
}),
|
|
8238
|
-
(
|
|
8250
|
+
(Xe = {
|
|
8239
8251
|
name: 'auto_fit_images',
|
|
8240
8252
|
type: 'boolean',
|
|
8241
8253
|
description:
|
|
8242
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.',
|
|
8243
8255
|
}),
|
|
8244
8256
|
(be = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8245
|
-
((
|
|
8257
|
+
(($a = new Set([
|
|
8246
8258
|
'quality',
|
|
8247
8259
|
'bitrate_mode',
|
|
8248
8260
|
'draft',
|
|
@@ -8251,7 +8263,7 @@ var _a,
|
|
|
8251
8263
|
'draft_generation_id',
|
|
8252
8264
|
'pass_faces',
|
|
8253
8265
|
])),
|
|
8254
|
-
(
|
|
8266
|
+
(Ea = new Set([
|
|
8255
8267
|
'quality',
|
|
8256
8268
|
'bitrate_mode',
|
|
8257
8269
|
'draft',
|
|
@@ -8259,12 +8271,12 @@ var _a,
|
|
|
8259
8271
|
'draft_task_id',
|
|
8260
8272
|
'draft_generation_id',
|
|
8261
8273
|
])),
|
|
8262
|
-
(
|
|
8274
|
+
(Aa = {
|
|
8263
8275
|
images: 'up to 10',
|
|
8264
8276
|
videos: 'up to 5; combined duration < 30s',
|
|
8265
8277
|
audios: 'up to 5; combined duration < 30s',
|
|
8266
8278
|
}));
|
|
8267
|
-
((
|
|
8279
|
+
((La = [
|
|
8268
8280
|
C('The user message or task.'),
|
|
8269
8281
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8270
8282
|
{
|
|
@@ -8282,7 +8294,7 @@ var _a,
|
|
|
8282
8294
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8283
8295
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8284
8296
|
]),
|
|
8285
|
-
(
|
|
8297
|
+
(Da = [
|
|
8286
8298
|
C('The user message or task.'),
|
|
8287
8299
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8288
8300
|
{
|
|
@@ -8364,8 +8376,8 @@ var _a,
|
|
|
8364
8376
|
description: 'Video frames read a second.',
|
|
8365
8377
|
},
|
|
8366
8378
|
]),
|
|
8367
|
-
(
|
|
8368
|
-
|
|
8379
|
+
(Va = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8380
|
+
Ba = Object.entries({
|
|
8369
8381
|
background: !1,
|
|
8370
8382
|
skin: !1,
|
|
8371
8383
|
nose: !1,
|
|
@@ -8391,8 +8403,8 @@ var _a,
|
|
|
8391
8403
|
default: t,
|
|
8392
8404
|
description: 'Keep this part out of the fix. Standard only.',
|
|
8393
8405
|
}));
|
|
8394
|
-
((
|
|
8395
|
-
(
|
|
8406
|
+
((ee = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8407
|
+
(ze = [
|
|
8396
8408
|
{
|
|
8397
8409
|
name: 'prompt',
|
|
8398
8410
|
type: 'string',
|
|
@@ -8430,7 +8442,7 @@ var _a,
|
|
|
8430
8442
|
type: 'select',
|
|
8431
8443
|
default: '480p',
|
|
8432
8444
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8433
|
-
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${
|
|
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}`,
|
|
8434
8446
|
},
|
|
8435
8447
|
{
|
|
8436
8448
|
name: 'aspect_ratio',
|
|
@@ -8541,19 +8553,19 @@ var _a,
|
|
|
8541
8553
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8542
8554
|
},
|
|
8543
8555
|
]),
|
|
8544
|
-
(
|
|
8556
|
+
(si = {
|
|
8545
8557
|
name: 'images',
|
|
8546
8558
|
type: 'string[]',
|
|
8547
8559
|
description:
|
|
8548
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.',
|
|
8549
8561
|
}),
|
|
8550
|
-
(
|
|
8562
|
+
(oi = {
|
|
8551
8563
|
name: 'audios',
|
|
8552
8564
|
type: 'string[]',
|
|
8553
8565
|
description:
|
|
8554
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.',
|
|
8555
8567
|
}),
|
|
8556
|
-
(
|
|
8568
|
+
(Zt = [
|
|
8557
8569
|
{
|
|
8558
8570
|
name: 'prompt',
|
|
8559
8571
|
type: 'string',
|
|
@@ -8597,7 +8609,7 @@ var _a,
|
|
|
8597
8609
|
type: 'select',
|
|
8598
8610
|
default: '480p',
|
|
8599
8611
|
options: ['480p', '720p', '1080p', '4k'],
|
|
8600
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
8612
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ee}`,
|
|
8601
8613
|
},
|
|
8602
8614
|
{
|
|
8603
8615
|
name: 'bitrate_mode',
|
|
@@ -8631,8 +8643,8 @@ var _a,
|
|
|
8631
8643
|
description:
|
|
8632
8644
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8633
8645
|
},
|
|
8634
|
-
|
|
8635
|
-
|
|
8646
|
+
si,
|
|
8647
|
+
oi,
|
|
8636
8648
|
{
|
|
8637
8649
|
name: 'first_frame_image',
|
|
8638
8650
|
type: 'string',
|
|
@@ -8653,7 +8665,7 @@ var _a,
|
|
|
8653
8665
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8654
8666
|
},
|
|
8655
8667
|
]),
|
|
8656
|
-
(
|
|
8668
|
+
(za = [
|
|
8657
8669
|
{
|
|
8658
8670
|
name: 'prompt',
|
|
8659
8671
|
type: 'string',
|
|
@@ -8674,7 +8686,7 @@ var _a,
|
|
|
8674
8686
|
type: 'select',
|
|
8675
8687
|
default: '480p',
|
|
8676
8688
|
options: ['480p', '720p'],
|
|
8677
|
-
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}`,
|
|
8678
8690
|
},
|
|
8679
8691
|
{
|
|
8680
8692
|
name: 'bitrate_mode',
|
|
@@ -8708,8 +8720,8 @@ var _a,
|
|
|
8708
8720
|
description:
|
|
8709
8721
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
8710
8722
|
},
|
|
8711
|
-
|
|
8712
|
-
|
|
8723
|
+
si,
|
|
8724
|
+
oi,
|
|
8713
8725
|
{
|
|
8714
8726
|
name: 'first_frame_image',
|
|
8715
8727
|
type: 'string',
|
|
@@ -8724,53 +8736,53 @@ var _a,
|
|
|
8724
8736
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
8725
8737
|
},
|
|
8726
8738
|
]));
|
|
8727
|
-
ke =
|
|
8728
|
-
|
|
8739
|
+
ke = Ya();
|
|
8740
|
+
Qa = ['draft_task_id', 'draft_generation_id'];
|
|
8729
8741
|
});
|
|
8730
8742
|
function xe(e) {
|
|
8731
8743
|
let t = '/v1/pricing/models',
|
|
8732
8744
|
i = e?.trim();
|
|
8733
8745
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
8734
8746
|
}
|
|
8735
|
-
var
|
|
8747
|
+
var tt = h(() => {
|
|
8736
8748
|
'use strict';
|
|
8737
8749
|
});
|
|
8738
|
-
function
|
|
8750
|
+
function Ti(e) {
|
|
8739
8751
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
8740
8752
|
}
|
|
8741
|
-
function
|
|
8753
|
+
function Mi(e) {
|
|
8742
8754
|
let t = ue().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8743
|
-
i = t.filter((s) =>
|
|
8744
|
-
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);
|
|
8745
8757
|
return [
|
|
8746
8758
|
...(i.length
|
|
8747
|
-
? [`${
|
|
8759
|
+
? [`${Ti(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
8748
8760
|
: []),
|
|
8749
|
-
...(a.length ? [`Not available yet on ${
|
|
8761
|
+
...(a.length ? [`Not available yet on ${Ti(a)}: ${ye}.`] : []),
|
|
8750
8762
|
'The Acceptable Use Policy applies.',
|
|
8751
8763
|
].join(' ');
|
|
8752
8764
|
}
|
|
8753
|
-
function
|
|
8754
|
-
if (
|
|
8765
|
+
function Kr(e) {
|
|
8766
|
+
if (Pr.has(e.name)) return e;
|
|
8755
8767
|
let t = e.inputSchema.properties;
|
|
8756
8768
|
return !t || t.callback_url
|
|
8757
8769
|
? e
|
|
8758
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8770
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: _r } } };
|
|
8759
8771
|
}
|
|
8760
|
-
function
|
|
8772
|
+
function Sr(e) {
|
|
8761
8773
|
let t = e.inputSchema.properties;
|
|
8762
8774
|
if (!t) return e;
|
|
8763
8775
|
let i = !1,
|
|
8764
8776
|
a = {};
|
|
8765
8777
|
for (let [n, s] of Object.entries(t))
|
|
8766
|
-
|
|
8778
|
+
Ki.has(n) && s.type === 'string' && !s.format
|
|
8767
8779
|
? ((a[n] = { ...s, format: 'uri' }), (i = !0))
|
|
8768
|
-
:
|
|
8780
|
+
: Ki.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8769
8781
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
8770
8782
|
: (a[n] = s);
|
|
8771
8783
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
8772
8784
|
}
|
|
8773
|
-
function
|
|
8785
|
+
function Cr(e) {
|
|
8774
8786
|
switch (e.type) {
|
|
8775
8787
|
case 'string':
|
|
8776
8788
|
return {
|
|
@@ -8825,11 +8837,11 @@ function Mr(e) {
|
|
|
8825
8837
|
return { type: 'string', description: e.description };
|
|
8826
8838
|
}
|
|
8827
8839
|
}
|
|
8828
|
-
function
|
|
8840
|
+
function $r(e, t) {
|
|
8829
8841
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
8830
8842
|
a = {},
|
|
8831
8843
|
n = [];
|
|
8832
|
-
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));
|
|
8833
8845
|
let s = {
|
|
8834
8846
|
type: 'object',
|
|
8835
8847
|
properties: a,
|
|
@@ -8842,7 +8854,7 @@ function Kr(e, t) {
|
|
|
8842
8854
|
inputSchema: s,
|
|
8843
8855
|
};
|
|
8844
8856
|
}
|
|
8845
|
-
function
|
|
8857
|
+
function Er() {
|
|
8846
8858
|
let e = D().filter((p) => p.category === 'Image' && !we(p)),
|
|
8847
8859
|
t = D().filter((p) => p.category === 'Video'),
|
|
8848
8860
|
i = D().filter((p) => p.category === 'Text'),
|
|
@@ -8933,7 +8945,7 @@ function Sr() {
|
|
|
8933
8945
|
maximum: 2147483647,
|
|
8934
8946
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
8935
8947
|
},
|
|
8936
|
-
creative_mode: { type: 'boolean', description:
|
|
8948
|
+
creative_mode: { type: 'boolean', description: Mi('image') },
|
|
8937
8949
|
},
|
|
8938
8950
|
required: ['prompt'],
|
|
8939
8951
|
additionalProperties: !0,
|
|
@@ -8970,7 +8982,7 @@ function Sr() {
|
|
|
8970
8982
|
description:
|
|
8971
8983
|
"Video resolution, where the model takes it (see each model tool). Left out: the model's own default, its lowest price.",
|
|
8972
8984
|
},
|
|
8973
|
-
creative_mode: { type: 'boolean', description:
|
|
8985
|
+
creative_mode: { type: 'boolean', description: Mi('video') },
|
|
8974
8986
|
priority: {
|
|
8975
8987
|
type: 'boolean',
|
|
8976
8988
|
description:
|
|
@@ -9106,10 +9118,10 @@ function Sr() {
|
|
|
9106
9118
|
additionalProperties: !0,
|
|
9107
9119
|
},
|
|
9108
9120
|
},
|
|
9109
|
-
d =
|
|
9110
|
-
return [n, s, o, u, l, d, c,
|
|
9121
|
+
d = Ar();
|
|
9122
|
+
return [n, s, o, u, l, d, c, Ir, ...Si];
|
|
9111
9123
|
}
|
|
9112
|
-
function
|
|
9124
|
+
function Ar() {
|
|
9113
9125
|
return {
|
|
9114
9126
|
name: 'upload_asset',
|
|
9115
9127
|
description:
|
|
@@ -9156,31 +9168,31 @@ function Cr() {
|
|
|
9156
9168
|
},
|
|
9157
9169
|
};
|
|
9158
9170
|
}
|
|
9159
|
-
function
|
|
9160
|
-
let e =
|
|
9161
|
-
t = D().map((i) =>
|
|
9162
|
-
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);
|
|
9163
9175
|
}
|
|
9164
|
-
var
|
|
9165
|
-
wr,
|
|
9166
|
-
xr,
|
|
9167
|
-
_r,
|
|
9176
|
+
var _r,
|
|
9168
9177
|
Pr,
|
|
9169
9178
|
Ir,
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9179
|
+
vr,
|
|
9180
|
+
Tr,
|
|
9181
|
+
Mr,
|
|
9182
|
+
Si,
|
|
9183
|
+
Rs,
|
|
9184
|
+
Ki,
|
|
9185
|
+
Ci = h(() => {
|
|
9174
9186
|
'use strict';
|
|
9175
9187
|
G();
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
((
|
|
9188
|
+
Be();
|
|
9189
|
+
te();
|
|
9190
|
+
((_r = {
|
|
9179
9191
|
type: 'string',
|
|
9180
9192
|
description:
|
|
9181
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.',
|
|
9182
9194
|
}),
|
|
9183
|
-
(
|
|
9195
|
+
(Pr = new Set([
|
|
9184
9196
|
'upload_asset',
|
|
9185
9197
|
'upload_media',
|
|
9186
9198
|
'upload_image',
|
|
@@ -9191,7 +9203,7 @@ var kr,
|
|
|
9191
9203
|
'get_usage',
|
|
9192
9204
|
'get_balance_history',
|
|
9193
9205
|
])),
|
|
9194
|
-
(
|
|
9206
|
+
(Ir = {
|
|
9195
9207
|
name: 'get_pricing',
|
|
9196
9208
|
description:
|
|
9197
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.',
|
|
@@ -9206,13 +9218,13 @@ var kr,
|
|
|
9206
9218
|
additionalProperties: !1,
|
|
9207
9219
|
},
|
|
9208
9220
|
}),
|
|
9209
|
-
(
|
|
9221
|
+
(vr = {
|
|
9210
9222
|
name: 'get_balance',
|
|
9211
9223
|
description:
|
|
9212
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.",
|
|
9213
9225
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9214
9226
|
}),
|
|
9215
|
-
(
|
|
9227
|
+
(Tr = {
|
|
9216
9228
|
name: 'get_usage',
|
|
9217
9229
|
description:
|
|
9218
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.",
|
|
@@ -9243,7 +9255,7 @@ var kr,
|
|
|
9243
9255
|
additionalProperties: !1,
|
|
9244
9256
|
},
|
|
9245
9257
|
}),
|
|
9246
|
-
(
|
|
9258
|
+
(Mr = {
|
|
9247
9259
|
name: 'get_balance_history',
|
|
9248
9260
|
description:
|
|
9249
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.",
|
|
@@ -9261,9 +9273,9 @@ var kr,
|
|
|
9261
9273
|
additionalProperties: !1,
|
|
9262
9274
|
},
|
|
9263
9275
|
}),
|
|
9264
|
-
(
|
|
9265
|
-
(
|
|
9266
|
-
|
|
9276
|
+
(Si = [vr, Tr, Mr]),
|
|
9277
|
+
(Rs = new Set(Si.map((e) => e.name))));
|
|
9278
|
+
Ki = new Set([
|
|
9267
9279
|
'image',
|
|
9268
9280
|
'images',
|
|
9269
9281
|
'image_url',
|
|
@@ -9280,19 +9292,19 @@ var kr,
|
|
|
9280
9292
|
'lipsyncing_audio',
|
|
9281
9293
|
]);
|
|
9282
9294
|
});
|
|
9283
|
-
var
|
|
9284
|
-
|
|
9285
|
-
forgetToolSchemas: () =>
|
|
9286
|
-
jsonRpcAnswer: () =>
|
|
9287
|
-
preprocessLocalFiles: () =>
|
|
9288
|
-
startStdioServer: () =>
|
|
9295
|
+
var Ni = {};
|
|
9296
|
+
Ji(Ni, {
|
|
9297
|
+
forgetToolSchemas: () => Dr,
|
|
9298
|
+
jsonRpcAnswer: () => Oi,
|
|
9299
|
+
preprocessLocalFiles: () => Di,
|
|
9300
|
+
startStdioServer: () => Vi,
|
|
9289
9301
|
});
|
|
9290
|
-
function
|
|
9302
|
+
function Or(e) {
|
|
9291
9303
|
let t = (i) =>
|
|
9292
9304
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
9293
9305
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
9294
9306
|
}
|
|
9295
|
-
function
|
|
9307
|
+
function Oi(e, t, i) {
|
|
9296
9308
|
let a = e?.id,
|
|
9297
9309
|
n = a == null,
|
|
9298
9310
|
s = null;
|
|
@@ -9301,7 +9313,7 @@ function $i(e, t, i) {
|
|
|
9301
9313
|
} catch {
|
|
9302
9314
|
s = null;
|
|
9303
9315
|
}
|
|
9304
|
-
if (s !== null &&
|
|
9316
|
+
if (s !== null && Or(s)) return n ? null : s;
|
|
9305
9317
|
if (n) return null;
|
|
9306
9318
|
if (!i && t >= 200 && t < 300) return;
|
|
9307
9319
|
let o = s?.error,
|
|
@@ -9322,12 +9334,12 @@ function $i(e, t, i) {
|
|
|
9322
9334
|
},
|
|
9323
9335
|
};
|
|
9324
9336
|
}
|
|
9325
|
-
function
|
|
9337
|
+
function qr() {
|
|
9326
9338
|
let e = process.argv.slice(2),
|
|
9327
9339
|
t = e.indexOf('--api-key');
|
|
9328
9340
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
9329
9341
|
}
|
|
9330
|
-
async function
|
|
9342
|
+
async function qi(e, t, i) {
|
|
9331
9343
|
let a = z.default.resolve(e);
|
|
9332
9344
|
if (!V.default.existsSync(a) || !V.default.statSync(a).isFile())
|
|
9333
9345
|
throw new Error(`File not found: ${e}`);
|
|
@@ -9356,15 +9368,15 @@ async function Ei(e, t, i) {
|
|
|
9356
9368
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
9357
9369
|
};
|
|
9358
9370
|
}
|
|
9359
|
-
function
|
|
9360
|
-
return
|
|
9371
|
+
function Ri(e) {
|
|
9372
|
+
return Rr.has(z.default.extname(e).toLowerCase());
|
|
9361
9373
|
}
|
|
9362
|
-
function
|
|
9374
|
+
function Li(e) {
|
|
9363
9375
|
return new Error(
|
|
9364
9376
|
`Tein uploads image, video and audio files only, and ${z.default.basename(e)} is not one.`,
|
|
9365
9377
|
);
|
|
9366
9378
|
}
|
|
9367
|
-
function
|
|
9379
|
+
function Lr(e) {
|
|
9368
9380
|
let t = e.trim();
|
|
9369
9381
|
if (
|
|
9370
9382
|
!t ||
|
|
@@ -9377,22 +9389,22 @@ function qr(e) {
|
|
|
9377
9389
|
let i = z.default.resolve(t);
|
|
9378
9390
|
return V.default.existsSync(i) && V.default.statSync(i).isFile() ? i : null;
|
|
9379
9391
|
}
|
|
9380
|
-
function
|
|
9392
|
+
function dt(e) {
|
|
9381
9393
|
if (Array.isArray(e))
|
|
9382
9394
|
for (let t of e) {
|
|
9383
9395
|
let i = t;
|
|
9384
9396
|
typeof i.name == 'string' &&
|
|
9385
9397
|
i.inputSchema &&
|
|
9386
9398
|
typeof i.inputSchema == 'object' &&
|
|
9387
|
-
|
|
9399
|
+
re.set(i.name, i.inputSchema);
|
|
9388
9400
|
}
|
|
9389
9401
|
}
|
|
9390
|
-
function
|
|
9391
|
-
(
|
|
9402
|
+
function Dr() {
|
|
9403
|
+
(re.clear(), (lt = 0));
|
|
9392
9404
|
}
|
|
9393
|
-
async function
|
|
9394
|
-
if (!(Date.now() -
|
|
9395
|
-
|
|
9405
|
+
async function Vr(e, t) {
|
|
9406
|
+
if (!(Date.now() - lt < 6e4)) {
|
|
9407
|
+
lt = Date.now();
|
|
9396
9408
|
try {
|
|
9397
9409
|
let a = await (
|
|
9398
9410
|
await fetch(e, {
|
|
@@ -9402,39 +9414,39 @@ async function Rr(e, t) {
|
|
|
9402
9414
|
signal: AbortSignal.timeout(1e4),
|
|
9403
9415
|
})
|
|
9404
9416
|
).json();
|
|
9405
|
-
|
|
9417
|
+
dt(a.result?.tools);
|
|
9406
9418
|
} catch {}
|
|
9407
9419
|
}
|
|
9408
9420
|
}
|
|
9409
|
-
function
|
|
9421
|
+
function Nr(e) {
|
|
9410
9422
|
return e
|
|
9411
9423
|
? e.type === 'string'
|
|
9412
9424
|
? e.format === 'uri'
|
|
9413
9425
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
9414
9426
|
: !1;
|
|
9415
9427
|
}
|
|
9416
|
-
async function
|
|
9428
|
+
async function $i(e, t, i) {
|
|
9417
9429
|
if (typeof e != 'string') return e;
|
|
9418
|
-
let a =
|
|
9430
|
+
let a = Lr(e);
|
|
9419
9431
|
if (!a) return e;
|
|
9420
|
-
if (!
|
|
9421
|
-
return (await
|
|
9432
|
+
if (!Ri(a)) throw Li(a);
|
|
9433
|
+
return (await qi(a, t, i)).url;
|
|
9422
9434
|
}
|
|
9423
|
-
async function
|
|
9424
|
-
(
|
|
9425
|
-
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;
|
|
9426
9438
|
if (!s) return t;
|
|
9427
9439
|
let o = { ...t };
|
|
9428
9440
|
for (let [u, l] of Object.entries(t))
|
|
9429
|
-
if (
|
|
9441
|
+
if (Nr(s[u]))
|
|
9430
9442
|
if (Array.isArray(l)) {
|
|
9431
9443
|
let c = [];
|
|
9432
|
-
for (let d of l) c.push(await
|
|
9444
|
+
for (let d of l) c.push(await $i(d, i, a));
|
|
9433
9445
|
o[u] = c;
|
|
9434
|
-
} else o[u] = await
|
|
9446
|
+
} else o[u] = await $i(l, i, a);
|
|
9435
9447
|
return o;
|
|
9436
9448
|
}
|
|
9437
|
-
function
|
|
9449
|
+
function Ur(e) {
|
|
9438
9450
|
let t = e.id ?? null;
|
|
9439
9451
|
switch (e.method) {
|
|
9440
9452
|
case 'initialize':
|
|
@@ -9452,7 +9464,7 @@ function Dr(e) {
|
|
|
9452
9464
|
case 'ping':
|
|
9453
9465
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
9454
9466
|
case 'tools/list':
|
|
9455
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9467
|
+
return { jsonrpc: '2.0', id: t, result: { tools: ot() } };
|
|
9456
9468
|
case 'tools/call':
|
|
9457
9469
|
return {
|
|
9458
9470
|
jsonrpc: '2.0',
|
|
@@ -9475,13 +9487,13 @@ function Dr(e) {
|
|
|
9475
9487
|
};
|
|
9476
9488
|
}
|
|
9477
9489
|
}
|
|
9478
|
-
async function
|
|
9479
|
-
if (
|
|
9480
|
-
|
|
9481
|
-
let e =
|
|
9490
|
+
async function Vi() {
|
|
9491
|
+
if (Ei) return;
|
|
9492
|
+
Ei = !0;
|
|
9493
|
+
let e = qr(),
|
|
9482
9494
|
t = w(),
|
|
9483
9495
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9484
|
-
(
|
|
9496
|
+
(Ai.default
|
|
9485
9497
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
9486
9498
|
.on('line', async (n) => {
|
|
9487
9499
|
let s = n.trim();
|
|
@@ -9542,8 +9554,8 @@ async function Ri() {
|
|
|
9542
9554
|
try {
|
|
9543
9555
|
let p = z.default.resolve(d.trim());
|
|
9544
9556
|
if (V.default.existsSync(p) && V.default.statSync(p).isFile() && e) {
|
|
9545
|
-
if (!
|
|
9546
|
-
let m = await
|
|
9557
|
+
if (!Ri(p)) throw Li(p);
|
|
9558
|
+
let m = await qi(p, e, t),
|
|
9547
9559
|
y = (m.sizeBytes / 1024).toFixed(1),
|
|
9548
9560
|
_e =
|
|
9549
9561
|
m.mimeType.startsWith('image/') ||
|
|
@@ -9599,7 +9611,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9599
9611
|
}
|
|
9600
9612
|
if (e)
|
|
9601
9613
|
try {
|
|
9602
|
-
o.params.arguments = await
|
|
9614
|
+
o.params.arguments = await Di(String(l), c, e, t, i);
|
|
9603
9615
|
} catch (d) {
|
|
9604
9616
|
let p = d instanceof Error ? d.message : String(d);
|
|
9605
9617
|
process.stdout.write(
|
|
@@ -9630,10 +9642,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9630
9642
|
body: JSON.stringify(o),
|
|
9631
9643
|
}),
|
|
9632
9644
|
c = await l.text(),
|
|
9633
|
-
d =
|
|
9645
|
+
d = Oi(o, l.status, c);
|
|
9634
9646
|
if (d === null) return;
|
|
9635
9647
|
if (d) {
|
|
9636
|
-
(o?.method === 'tools/list' &&
|
|
9648
|
+
(o?.method === 'tools/list' && dt(d.result?.tools),
|
|
9637
9649
|
process.stdout.write(
|
|
9638
9650
|
JSON.stringify(d) +
|
|
9639
9651
|
`
|
|
@@ -9642,7 +9654,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9642
9654
|
return;
|
|
9643
9655
|
}
|
|
9644
9656
|
} catch {}
|
|
9645
|
-
let u =
|
|
9657
|
+
let u = Ur(o);
|
|
9646
9658
|
u !== null &&
|
|
9647
9659
|
process.stdout.write(
|
|
9648
9660
|
JSON.stringify(u) +
|
|
@@ -9667,21 +9679,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
9667
9679
|
}
|
|
9668
9680
|
var V,
|
|
9669
9681
|
z,
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9682
|
+
Ai,
|
|
9683
|
+
Rr,
|
|
9684
|
+
re,
|
|
9685
|
+
lt,
|
|
9686
|
+
Ei,
|
|
9687
|
+
Ui = h(() => {
|
|
9676
9688
|
'use strict';
|
|
9677
9689
|
((V = T(require('node:fs'))),
|
|
9678
9690
|
(z = T(require('node:path'))),
|
|
9679
|
-
(
|
|
9680
|
-
|
|
9681
|
-
|
|
9691
|
+
(Ai = T(require('node:readline'))));
|
|
9692
|
+
tt();
|
|
9693
|
+
Ci();
|
|
9682
9694
|
E();
|
|
9683
|
-
|
|
9684
|
-
|
|
9695
|
+
ne();
|
|
9696
|
+
Rr = new Set([
|
|
9685
9697
|
'.png',
|
|
9686
9698
|
'.jpg',
|
|
9687
9699
|
'.jpeg',
|
|
@@ -9707,20 +9719,20 @@ var V,
|
|
|
9707
9719
|
'.flac',
|
|
9708
9720
|
'.opus',
|
|
9709
9721
|
]);
|
|
9710
|
-
((
|
|
9711
|
-
|
|
9722
|
+
((re = new Map()), (lt = 0));
|
|
9723
|
+
Ei = !1;
|
|
9712
9724
|
require.main === module &&
|
|
9713
|
-
|
|
9725
|
+
Vi().catch((e) => {
|
|
9714
9726
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
9715
9727
|
`),
|
|
9716
9728
|
process.exit(1));
|
|
9717
9729
|
});
|
|
9718
9730
|
});
|
|
9719
|
-
var
|
|
9731
|
+
var Yi =
|
|
9720
9732
|
!process.env.NO_COLOR &&
|
|
9721
9733
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
9722
9734
|
function x(e, t) {
|
|
9723
|
-
return (i) => (
|
|
9735
|
+
return (i) => (Yi ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
9724
9736
|
}
|
|
9725
9737
|
var r = {
|
|
9726
9738
|
bold: x(1, 22),
|
|
@@ -9805,12 +9817,12 @@ var r = {
|
|
|
9805
9817
|
}
|
|
9806
9818
|
};
|
|
9807
9819
|
var U = T(require('node:fs')),
|
|
9808
|
-
|
|
9809
|
-
var
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
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([
|
|
9814
9826
|
'account_suspended',
|
|
9815
9827
|
'account_terminated',
|
|
9816
9828
|
'creative_mode_restricted',
|
|
@@ -9818,7 +9830,7 @@ var Xi = new Set([
|
|
|
9818
9830
|
'workspace_paused',
|
|
9819
9831
|
]),
|
|
9820
9832
|
v = 1,
|
|
9821
|
-
|
|
9833
|
+
ta = 3,
|
|
9822
9834
|
b = class extends Error {
|
|
9823
9835
|
constructor(t, i, a, n = {}) {
|
|
9824
9836
|
(super(i),
|
|
@@ -9828,10 +9840,10 @@ var Xi = new Set([
|
|
|
9828
9840
|
(this.fields = n));
|
|
9829
9841
|
}
|
|
9830
9842
|
get exitCode() {
|
|
9831
|
-
return this.code &&
|
|
9843
|
+
return this.code && ea.has(this.code) ? ta : v;
|
|
9832
9844
|
}
|
|
9833
9845
|
};
|
|
9834
|
-
function
|
|
9846
|
+
function ia(e, t, i) {
|
|
9835
9847
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9836
9848
|
if (!i || typeof i != 'object') return new b(e, a);
|
|
9837
9849
|
let n = i;
|
|
@@ -9844,13 +9856,13 @@ function Zi(e, t, i) {
|
|
|
9844
9856
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
9845
9857
|
return new b(e, c, typeof o == 'string' ? o : void 0, l);
|
|
9846
9858
|
}
|
|
9847
|
-
function
|
|
9859
|
+
function ut(e) {
|
|
9848
9860
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
9849
9861
|
}
|
|
9850
9862
|
function K(e) {
|
|
9851
9863
|
let t = [e.message],
|
|
9852
|
-
i =
|
|
9853
|
-
a =
|
|
9864
|
+
i = ut(e.fields.required),
|
|
9865
|
+
a = ut(e.fields.balance);
|
|
9854
9866
|
(i || a) &&
|
|
9855
9867
|
t.push([i ? `Required: ${i}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
9856
9868
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -9858,19 +9870,19 @@ function K(e) {
|
|
|
9858
9870
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
9859
9871
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
9860
9872
|
}
|
|
9861
|
-
function
|
|
9873
|
+
function aa(e) {
|
|
9862
9874
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
9863
9875
|
? 'video'
|
|
9864
9876
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
9865
9877
|
? 'audio'
|
|
9866
9878
|
: 'image';
|
|
9867
9879
|
}
|
|
9868
|
-
function
|
|
9880
|
+
function mt(e) {
|
|
9869
9881
|
let t = [];
|
|
9870
9882
|
for (let i of e.data ?? [])
|
|
9871
9883
|
typeof i.message?.content == 'string'
|
|
9872
9884
|
? t.push({ type: 'text', text: i.message.content })
|
|
9873
|
-
: i.url && t.push({ type:
|
|
9885
|
+
: i.url && t.push({ type: aa(i.url), url: i.url, ...(i.layer ? { layer: i.layer } : {}) });
|
|
9874
9886
|
return t;
|
|
9875
9887
|
}
|
|
9876
9888
|
var M = class {
|
|
@@ -9896,7 +9908,7 @@ var M = class {
|
|
|
9896
9908
|
try {
|
|
9897
9909
|
s = await n.json();
|
|
9898
9910
|
} catch {}
|
|
9899
|
-
throw
|
|
9911
|
+
throw ia(n.status, n.statusText, s);
|
|
9900
9912
|
}
|
|
9901
9913
|
return await n.json();
|
|
9902
9914
|
}
|
|
@@ -9910,7 +9922,7 @@ var M = class {
|
|
|
9910
9922
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
9911
9923
|
? n
|
|
9912
9924
|
: 'processing',
|
|
9913
|
-
o =
|
|
9925
|
+
o = mt(a);
|
|
9914
9926
|
return {
|
|
9915
9927
|
request_id: a.request_id || a.id || '',
|
|
9916
9928
|
model: a.model,
|
|
@@ -9928,7 +9940,7 @@ var M = class {
|
|
|
9928
9940
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
9929
9941
|
? a
|
|
9930
9942
|
: 'processing',
|
|
9931
|
-
s =
|
|
9943
|
+
s = mt(i),
|
|
9932
9944
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
9933
9945
|
return {
|
|
9934
9946
|
request_id: i.id || t,
|
|
@@ -9957,10 +9969,10 @@ var M = class {
|
|
|
9957
9969
|
async downloadOutput(t, i) {
|
|
9958
9970
|
let a = await fetch(t);
|
|
9959
9971
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
9960
|
-
let n =
|
|
9961
|
-
|
|
9962
|
-
let s =
|
|
9963
|
-
return (await (0,
|
|
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);
|
|
9964
9976
|
}
|
|
9965
9977
|
};
|
|
9966
9978
|
E();
|
|
@@ -9972,43 +9984,43 @@ function Se(e) {
|
|
|
9972
9984
|
a = Math.round(Number((e * i).toFixed(6))) / i;
|
|
9973
9985
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
9974
9986
|
}
|
|
9975
|
-
|
|
9976
|
-
var
|
|
9977
|
-
function
|
|
9978
|
-
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]]);
|
|
9979
9991
|
}
|
|
9980
|
-
function
|
|
9992
|
+
function er(e) {
|
|
9981
9993
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
9982
|
-
let t =
|
|
9994
|
+
let t = O.default.resolve(e);
|
|
9983
9995
|
return U.default.existsSync(t) && U.default.statSync(t).isFile() ? t : null;
|
|
9984
9996
|
}
|
|
9985
|
-
async function
|
|
9986
|
-
for (let i of
|
|
9997
|
+
async function tr(e, t) {
|
|
9998
|
+
for (let i of di) {
|
|
9987
9999
|
if (!Array.isArray(e[i])) continue;
|
|
9988
10000
|
let a = [];
|
|
9989
10001
|
for (let n of e[i]) {
|
|
9990
10002
|
if (typeof n != 'string') continue;
|
|
9991
|
-
let s =
|
|
10003
|
+
let s = er(n);
|
|
9992
10004
|
a.push(s ? await t(s) : n);
|
|
9993
10005
|
}
|
|
9994
10006
|
e[i] = a;
|
|
9995
10007
|
}
|
|
9996
10008
|
}
|
|
9997
|
-
var
|
|
9998
|
-
function
|
|
10009
|
+
var ie = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10010
|
+
function ir(e) {
|
|
9999
10011
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
10000
10012
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
10001
|
-
i =
|
|
10013
|
+
i = ie.enterprise;
|
|
10002
10014
|
return (
|
|
10003
10015
|
(!Number.isInteger(t) || t < 1 || t > i) &&
|
|
10004
10016
|
(process.stderr
|
|
10005
|
-
.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.
|
|
10006
10018
|
`),
|
|
10007
10019
|
process.exit(1)),
|
|
10008
10020
|
t
|
|
10009
10021
|
);
|
|
10010
10022
|
}
|
|
10011
|
-
async function
|
|
10023
|
+
async function ar(e, t, i, a, n) {
|
|
10012
10024
|
n.isJson ||
|
|
10013
10025
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
10014
10026
|
`);
|
|
@@ -10083,12 +10095,12 @@ async function er(e, t, i, a, n) {
|
|
|
10083
10095
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10084
10096
|
process.exit(v);
|
|
10085
10097
|
}
|
|
10086
|
-
function
|
|
10098
|
+
function rr(e, t, i) {
|
|
10087
10099
|
if (i <= 1) return e;
|
|
10088
|
-
let a =
|
|
10100
|
+
let a = O.default.extname(e);
|
|
10089
10101
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
10090
10102
|
}
|
|
10091
|
-
function
|
|
10103
|
+
function pi(e) {
|
|
10092
10104
|
let t = {},
|
|
10093
10105
|
i = new Set(),
|
|
10094
10106
|
a = [];
|
|
@@ -10133,7 +10145,7 @@ function oi(e) {
|
|
|
10133
10145
|
}
|
|
10134
10146
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: i };
|
|
10135
10147
|
}
|
|
10136
|
-
async function
|
|
10148
|
+
async function Ze(e, t) {
|
|
10137
10149
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
10138
10150
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
10139
10151
|
(i ||
|
|
@@ -10155,7 +10167,7 @@ async function Qe(e, t) {
|
|
|
10155
10167
|
s = !!t.json,
|
|
10156
10168
|
o = !!(t.async || t.no_wait),
|
|
10157
10169
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
10158
|
-
l =
|
|
10170
|
+
l = ir(t),
|
|
10159
10171
|
c = { ...t };
|
|
10160
10172
|
(delete c.json,
|
|
10161
10173
|
delete c.async,
|
|
@@ -10164,8 +10176,8 @@ async function Qe(e, t) {
|
|
|
10164
10176
|
delete c.api_key,
|
|
10165
10177
|
delete c.api_url,
|
|
10166
10178
|
delete c.count);
|
|
10167
|
-
let d =
|
|
10168
|
-
(
|
|
10179
|
+
let d = li(n, c);
|
|
10180
|
+
(Za(d),
|
|
10169
10181
|
typeof d.image == 'string' && !d.images && !we(n) && ((d.images = [d.image]), delete d.image),
|
|
10170
10182
|
d.image_url &&
|
|
10171
10183
|
!d.first_frame_image &&
|
|
@@ -10186,35 +10198,35 @@ async function Qe(e, t) {
|
|
|
10186
10198
|
for (let k of m) {
|
|
10187
10199
|
let g = d[k];
|
|
10188
10200
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
10189
|
-
let P =
|
|
10201
|
+
let P = O.default.resolve(g);
|
|
10190
10202
|
if (U.default.existsSync(P) && U.default.statSync(P).isFile()) {
|
|
10191
|
-
let I = new $(`Uploading local file ${
|
|
10203
|
+
let I = new $(`Uploading local file ${O.default.basename(P)} to CDN...`);
|
|
10192
10204
|
s || I.start();
|
|
10193
10205
|
try {
|
|
10194
10206
|
let N = U.default.readFileSync(P),
|
|
10195
|
-
|
|
10196
|
-
((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`));
|
|
10197
10209
|
} catch (N) {
|
|
10198
|
-
let
|
|
10210
|
+
let q = N instanceof Error ? N.message : String(N);
|
|
10199
10211
|
(s
|
|
10200
10212
|
? process.stdout.write(
|
|
10201
|
-
JSON.stringify({ error:
|
|
10213
|
+
JSON.stringify({ error: q }) +
|
|
10202
10214
|
`
|
|
10203
10215
|
`,
|
|
10204
10216
|
)
|
|
10205
|
-
: I.fail(`Upload failed: ${
|
|
10217
|
+
: I.fail(`Upload failed: ${q}`),
|
|
10206
10218
|
process.exit(1));
|
|
10207
10219
|
}
|
|
10208
10220
|
}
|
|
10209
10221
|
}
|
|
10210
10222
|
}
|
|
10211
|
-
await
|
|
10212
|
-
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...`);
|
|
10213
10225
|
s || g.start();
|
|
10214
10226
|
try {
|
|
10215
10227
|
let P = U.default.readFileSync(k),
|
|
10216
10228
|
I = await p.uploadAsset(P.toString('base64'));
|
|
10217
|
-
return (s || g.succeed(`Uploaded ${
|
|
10229
|
+
return (s || g.succeed(`Uploaded ${O.default.basename(k)} to CDN`), I.url);
|
|
10218
10230
|
} catch (P) {
|
|
10219
10231
|
let I = P instanceof Error ? P.message : String(P);
|
|
10220
10232
|
(s
|
|
@@ -10232,7 +10244,7 @@ async function Qe(e, t) {
|
|
|
10232
10244
|
let f;
|
|
10233
10245
|
try {
|
|
10234
10246
|
if (l > 1) {
|
|
10235
|
-
await
|
|
10247
|
+
await ar(p, e, d, l, { isJson: s, isAsync: o });
|
|
10236
10248
|
return;
|
|
10237
10249
|
}
|
|
10238
10250
|
f = await p.queueJob(e, d);
|
|
@@ -10335,13 +10347,13 @@ ${r.bold('Outputs:')}
|
|
|
10335
10347
|
`),
|
|
10336
10348
|
u)
|
|
10337
10349
|
) {
|
|
10338
|
-
let
|
|
10339
|
-
|
|
10350
|
+
let q = rr(u, g++, k),
|
|
10351
|
+
pt = new $(`Downloading output to ${q}...`).start();
|
|
10340
10352
|
try {
|
|
10341
|
-
(await p.downloadOutput(I.url,
|
|
10342
|
-
|
|
10353
|
+
(await p.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
|
|
10354
|
+
pt.succeed(`Saved to ${r.bold(q)}`));
|
|
10343
10355
|
} catch (Ie) {
|
|
10344
|
-
|
|
10356
|
+
pt.fail(`Failed to download: ${Ie instanceof Error ? Ie.message : Ie}`);
|
|
10345
10357
|
}
|
|
10346
10358
|
}
|
|
10347
10359
|
} else
|
|
@@ -10354,9 +10366,9 @@ ${I.text}
|
|
|
10354
10366
|
process.stdout.write(`
|
|
10355
10367
|
`);
|
|
10356
10368
|
}
|
|
10357
|
-
var
|
|
10369
|
+
var ci = T(require('node:readline'));
|
|
10358
10370
|
E();
|
|
10359
|
-
async function
|
|
10371
|
+
async function nr(e) {
|
|
10360
10372
|
try {
|
|
10361
10373
|
return (await new M(e, w()).checkKey(), 'ok');
|
|
10362
10374
|
} catch (t) {
|
|
@@ -10367,15 +10379,15 @@ async function ir(e) {
|
|
|
10367
10379
|
return 'unchecked';
|
|
10368
10380
|
}
|
|
10369
10381
|
}
|
|
10370
|
-
function
|
|
10371
|
-
let t =
|
|
10382
|
+
function sr(e) {
|
|
10383
|
+
let t = ci.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10372
10384
|
return new Promise((i) => {
|
|
10373
10385
|
t.question(e, (a) => {
|
|
10374
10386
|
(t.close(), i(a.trim()));
|
|
10375
10387
|
});
|
|
10376
10388
|
});
|
|
10377
10389
|
}
|
|
10378
|
-
async function
|
|
10390
|
+
async function ae(e, t) {
|
|
10379
10391
|
switch (e) {
|
|
10380
10392
|
case 'login':
|
|
10381
10393
|
case 'set-key': {
|
|
@@ -10387,14 +10399,14 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10387
10399
|
process.stdout.write(`Get your API key at: ${r.cyan('https://tein.ai/dashboard/keys')}
|
|
10388
10400
|
|
|
10389
10401
|
`),
|
|
10390
|
-
(i = await
|
|
10402
|
+
(i = await sr('Enter your Tein API Key (sk_live_...): '))),
|
|
10391
10403
|
!i.startsWith('sk_live_') &&
|
|
10392
10404
|
!i.startsWith('sk_test_') &&
|
|
10393
10405
|
(process.stderr
|
|
10394
10406
|
.write(`${r.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10395
10407
|
`),
|
|
10396
10408
|
process.exit(1)));
|
|
10397
|
-
let a = await
|
|
10409
|
+
let a = await nr(i);
|
|
10398
10410
|
(a === 'invalid' &&
|
|
10399
10411
|
(process.stderr
|
|
10400
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.
|
|
@@ -10402,7 +10414,7 @@ ${r.bold('Tein AI Authentication')}
|
|
|
10402
10414
|
process.exit(1)),
|
|
10403
10415
|
Ke({ apiKey: i }),
|
|
10404
10416
|
process.stdout.write(`
|
|
10405
|
-
${r.green('\u2713')} API key saved to ${r.dim(
|
|
10417
|
+
${r.green('\u2713')} API key saved to ${r.dim(le())}
|
|
10406
10418
|
`),
|
|
10407
10419
|
a === 'blocked'
|
|
10408
10420
|
? process.stdout
|
|
@@ -10427,7 +10439,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10427
10439
|
}
|
|
10428
10440
|
(Ke({ apiKey: '' }),
|
|
10429
10441
|
process.stdout
|
|
10430
|
-
.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())}
|
|
10431
10443
|
`));
|
|
10432
10444
|
break;
|
|
10433
10445
|
}
|
|
@@ -10439,7 +10451,7 @@ ${r.green('\u2713')} API key saved to ${r.dim(oe())}
|
|
|
10439
10451
|
(process.stdout.write(`
|
|
10440
10452
|
${r.bold('Tein AI CLI Configuration')}
|
|
10441
10453
|
`),
|
|
10442
|
-
process.stdout.write(` Config file: ${r.dim(
|
|
10454
|
+
process.stdout.write(` Config file: ${r.dim(le())}
|
|
10443
10455
|
`),
|
|
10444
10456
|
process.stdout.write(` API URL: ${r.cyan(a)}
|
|
10445
10457
|
`),
|
|
@@ -10469,10 +10481,10 @@ function _(e) {
|
|
|
10469
10481
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10470
10482
|
: `$${e.toFixed(2)}`;
|
|
10471
10483
|
}
|
|
10472
|
-
function
|
|
10484
|
+
function ui(e) {
|
|
10473
10485
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10474
10486
|
}
|
|
10475
|
-
function
|
|
10487
|
+
function or(e) {
|
|
10476
10488
|
let t = [
|
|
10477
10489
|
['Balance', _(e.balance)],
|
|
10478
10490
|
['Available to this key', _(e.available)],
|
|
@@ -10492,8 +10504,8 @@ function rr(e) {
|
|
|
10492
10504
|
`${_(i.remaining)} left of ${_(i.amount)}${i.resets_at ? `, resets ${i.resets_at.slice(0, 10)}` : ''}`,
|
|
10493
10505
|
]),
|
|
10494
10506
|
t.push(
|
|
10495
|
-
['This month', `${_(e.usage.this_month.spend)} on ${
|
|
10496
|
-
['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)}`],
|
|
10497
10509
|
[
|
|
10498
10510
|
'Auto top up',
|
|
10499
10511
|
e.auto_top_up.enabled
|
|
@@ -10506,7 +10518,7 @@ function rr(e) {
|
|
|
10506
10518
|
let a = Math.max(...t.map(([n]) => n.length));
|
|
10507
10519
|
return t.map(([n, s]) => ` ${n.padEnd(a)} ${s}`);
|
|
10508
10520
|
}
|
|
10509
|
-
async function
|
|
10521
|
+
async function mi(e) {
|
|
10510
10522
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10511
10523
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10512
10524
|
a = !!e.json;
|
|
@@ -10550,13 +10562,13 @@ async function pi(e) {
|
|
|
10550
10562
|
}
|
|
10551
10563
|
process.stdout.write(`
|
|
10552
10564
|
${r.bold('Tein balance')}
|
|
10553
|
-
${
|
|
10565
|
+
${or(n).join(`
|
|
10554
10566
|
`)}
|
|
10555
10567
|
|
|
10556
10568
|
`);
|
|
10557
10569
|
}
|
|
10558
10570
|
E();
|
|
10559
|
-
function
|
|
10571
|
+
function fi(e) {
|
|
10560
10572
|
let t = S(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10561
10573
|
i = w(typeof e.api_url == 'string' ? e.api_url : void 0);
|
|
10562
10574
|
return (
|
|
@@ -10570,7 +10582,7 @@ function ci(e) {
|
|
|
10570
10582
|
new M(t, i)
|
|
10571
10583
|
);
|
|
10572
10584
|
}
|
|
10573
|
-
function
|
|
10585
|
+
function gi(e, t) {
|
|
10574
10586
|
let i = {};
|
|
10575
10587
|
for (let a of t) {
|
|
10576
10588
|
let n = e[a];
|
|
@@ -10578,7 +10590,7 @@ function ui(e, t) {
|
|
|
10578
10590
|
}
|
|
10579
10591
|
return i;
|
|
10580
10592
|
}
|
|
10581
|
-
async function
|
|
10593
|
+
async function hi(e, t) {
|
|
10582
10594
|
try {
|
|
10583
10595
|
return await t();
|
|
10584
10596
|
} catch (i) {
|
|
@@ -10602,7 +10614,7 @@ async function mi(e, t) {
|
|
|
10602
10614
|
process.exit(v));
|
|
10603
10615
|
}
|
|
10604
10616
|
}
|
|
10605
|
-
function
|
|
10617
|
+
function et(e) {
|
|
10606
10618
|
let t = e[0].map((a, n) => Math.max(...e.map((s) => s[n].length))),
|
|
10607
10619
|
i = (a) => e.slice(1).every((n) => /^[-+$\d]/.test(n[a]));
|
|
10608
10620
|
return e.map(
|
|
@@ -10613,7 +10625,7 @@ function Ze(e) {
|
|
|
10613
10625
|
.trimEnd()}`,
|
|
10614
10626
|
);
|
|
10615
10627
|
}
|
|
10616
|
-
function
|
|
10628
|
+
function lr(e) {
|
|
10617
10629
|
let t = e.summary,
|
|
10618
10630
|
i = [
|
|
10619
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}` : ''}`,
|
|
@@ -10625,7 +10637,7 @@ function nr(e) {
|
|
|
10625
10637
|
e.by_channel.length &&
|
|
10626
10638
|
(i.push('', r.bold('By channel')),
|
|
10627
10639
|
i.push(
|
|
10628
|
-
...
|
|
10640
|
+
...et([
|
|
10629
10641
|
['Channel', 'Spend', 'Requests'],
|
|
10630
10642
|
...e.by_channel.map((a) => [a.channel, _(a.spend), String(a.requests)]),
|
|
10631
10643
|
]),
|
|
@@ -10633,7 +10645,7 @@ function nr(e) {
|
|
|
10633
10645
|
e.by_model.length &&
|
|
10634
10646
|
(i.push('', r.bold('By model')),
|
|
10635
10647
|
i.push(
|
|
10636
|
-
...
|
|
10648
|
+
...et([
|
|
10637
10649
|
['Model', 'Spend', 'Requests', 'Failed'],
|
|
10638
10650
|
...e.by_model.map((a) => [a.name, _(a.spend), String(a.requests), String(a.failed)]),
|
|
10639
10651
|
]),
|
|
@@ -10641,10 +10653,10 @@ function nr(e) {
|
|
|
10641
10653
|
i
|
|
10642
10654
|
);
|
|
10643
10655
|
}
|
|
10644
|
-
async function
|
|
10656
|
+
async function yi(e) {
|
|
10645
10657
|
let t = !!e.json,
|
|
10646
|
-
i =
|
|
10647
|
-
a = await
|
|
10658
|
+
i = fi(e),
|
|
10659
|
+
a = await hi(t, () => i.getUsage(gi(e, ['range', 'from', 'to', 'model', 'channel'])));
|
|
10648
10660
|
if (t) {
|
|
10649
10661
|
process.stdout.write(
|
|
10650
10662
|
JSON.stringify(a, null, 2) +
|
|
@@ -10655,14 +10667,14 @@ async function fi(e) {
|
|
|
10655
10667
|
}
|
|
10656
10668
|
process.stdout.write(`
|
|
10657
10669
|
${r.bold('Tein usage')}
|
|
10658
|
-
${
|
|
10670
|
+
${lr(a).join(`
|
|
10659
10671
|
`)}
|
|
10660
10672
|
|
|
10661
10673
|
`);
|
|
10662
10674
|
}
|
|
10663
|
-
function
|
|
10675
|
+
function dr(e) {
|
|
10664
10676
|
return e.data.length
|
|
10665
|
-
?
|
|
10677
|
+
? et([
|
|
10666
10678
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
10667
10679
|
...e.data.map((t) => [
|
|
10668
10680
|
t.created_at.slice(0, 16).replace('T', ' '),
|
|
@@ -10673,10 +10685,10 @@ function sr(e) {
|
|
|
10673
10685
|
])
|
|
10674
10686
|
: [' No transactions yet.'];
|
|
10675
10687
|
}
|
|
10676
|
-
async function
|
|
10688
|
+
async function bi(e) {
|
|
10677
10689
|
let t = !!e.json,
|
|
10678
|
-
i =
|
|
10679
|
-
a = await
|
|
10690
|
+
i = fi(e),
|
|
10691
|
+
a = await hi(t, () => i.getTransactions(gi(e, ['limit', 'type', 'after'])));
|
|
10680
10692
|
if (t) {
|
|
10681
10693
|
process.stdout.write(
|
|
10682
10694
|
JSON.stringify(a, null, 2) +
|
|
@@ -10692,18 +10704,18 @@ async function gi(e) {
|
|
|
10692
10704
|
: '';
|
|
10693
10705
|
process.stdout.write(`
|
|
10694
10706
|
${r.bold('Tein balance history')}
|
|
10695
|
-
${
|
|
10707
|
+
${dr(a).join(`
|
|
10696
10708
|
`)}${n}
|
|
10697
10709
|
|
|
10698
10710
|
`);
|
|
10699
10711
|
}
|
|
10700
10712
|
E();
|
|
10701
10713
|
Ce();
|
|
10702
|
-
|
|
10703
|
-
var
|
|
10704
|
-
async function
|
|
10714
|
+
te();
|
|
10715
|
+
var pr = 3e3;
|
|
10716
|
+
async function ki(e) {
|
|
10705
10717
|
try {
|
|
10706
|
-
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
10718
|
+
let t = await fetch(`${w(e)}/v1/pricing`, { signal: AbortSignal.timeout(pr) });
|
|
10707
10719
|
if (!t.ok) return;
|
|
10708
10720
|
let i = await t.json(),
|
|
10709
10721
|
a = {};
|
|
@@ -10711,18 +10723,18 @@ async function hi(e) {
|
|
|
10711
10723
|
let s = String(n.modelSlug ?? '');
|
|
10712
10724
|
J.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
10713
10725
|
}
|
|
10714
|
-
|
|
10726
|
+
ii(a);
|
|
10715
10727
|
} catch {}
|
|
10716
10728
|
}
|
|
10717
|
-
var
|
|
10718
|
-
|
|
10719
|
-
async function
|
|
10720
|
-
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);
|
|
10721
10733
|
let i = D();
|
|
10722
10734
|
if (e) {
|
|
10723
10735
|
let s = e.toLowerCase(),
|
|
10724
|
-
o =
|
|
10725
|
-
i =
|
|
10736
|
+
o = ur[s] ?? s;
|
|
10737
|
+
i = cr.has(o)
|
|
10726
10738
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
10727
10739
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
10728
10740
|
}
|
|
@@ -10760,8 +10772,8 @@ ${r.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
10760
10772
|
|
|
10761
10773
|
`);
|
|
10762
10774
|
}
|
|
10763
|
-
async function
|
|
10764
|
-
J.has(e) && (await
|
|
10775
|
+
async function xi(e, t) {
|
|
10776
|
+
J.has(e) && (await ki(t));
|
|
10765
10777
|
let i = H(e);
|
|
10766
10778
|
(i ||
|
|
10767
10779
|
(process.stderr.write(`${r.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -10842,9 +10854,9 @@ ${r.bold(r.cyan(i.name))} (${r.bold(i.slug)})
|
|
|
10842
10854
|
`);
|
|
10843
10855
|
}
|
|
10844
10856
|
E();
|
|
10845
|
-
|
|
10846
|
-
var
|
|
10847
|
-
|
|
10857
|
+
tt();
|
|
10858
|
+
var mr = 1e4,
|
|
10859
|
+
at = {
|
|
10848
10860
|
price: '',
|
|
10849
10861
|
creativeMode: 'Creative mode',
|
|
10850
10862
|
priority: 'Priority',
|
|
@@ -10854,22 +10866,22 @@ var pr = 1e4,
|
|
|
10854
10866
|
priorityDraft: 'Priority + Draft',
|
|
10855
10867
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
10856
10868
|
},
|
|
10857
|
-
|
|
10858
|
-
|
|
10869
|
+
fr = Object.keys(at),
|
|
10870
|
+
gr = {
|
|
10859
10871
|
creativeMode: 'unfiltered',
|
|
10860
10872
|
creativeModePriority: 'unfilteredPriority',
|
|
10861
10873
|
creativeModeDraft: 'unfilteredDraft',
|
|
10862
10874
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
10863
10875
|
};
|
|
10864
|
-
function
|
|
10865
|
-
let i =
|
|
10876
|
+
function hr(e, t) {
|
|
10877
|
+
let i = gr[t];
|
|
10866
10878
|
return e[t] ?? (i ? e[i] : void 0);
|
|
10867
10879
|
}
|
|
10868
|
-
async function
|
|
10880
|
+
async function yr(e, t) {
|
|
10869
10881
|
let i = `${w(e)}${xe(t)}`,
|
|
10870
10882
|
a;
|
|
10871
10883
|
try {
|
|
10872
|
-
a = await fetch(i, { signal: AbortSignal.timeout(
|
|
10884
|
+
a = await fetch(i, { signal: AbortSignal.timeout(mr) });
|
|
10873
10885
|
} catch {
|
|
10874
10886
|
throw new Error(`Could not reach ${i}`);
|
|
10875
10887
|
}
|
|
@@ -10885,18 +10897,18 @@ async function fr(e, t) {
|
|
|
10885
10897
|
}
|
|
10886
10898
|
return n;
|
|
10887
10899
|
}
|
|
10888
|
-
function
|
|
10900
|
+
function it(e) {
|
|
10889
10901
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
10890
10902
|
[i, a = ''] = t.split('.');
|
|
10891
10903
|
return `$${i}.${a.padEnd(2, '0')}`;
|
|
10892
10904
|
}
|
|
10893
|
-
function
|
|
10905
|
+
function rt(e) {
|
|
10894
10906
|
if (!e || typeof e.starter != 'number') return null;
|
|
10895
10907
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
10896
10908
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
10897
|
-
return `Starter ${
|
|
10909
|
+
return `Starter ${it(e.starter)} Plus ${it(t)} Scale ${it(i)}`;
|
|
10898
10910
|
}
|
|
10899
|
-
function
|
|
10911
|
+
function br(e) {
|
|
10900
10912
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
10901
10913
|
let t = [];
|
|
10902
10914
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -10908,33 +10920,33 @@ function gr(e) {
|
|
|
10908
10920
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
10909
10921
|
);
|
|
10910
10922
|
}
|
|
10911
|
-
function
|
|
10912
|
-
let i =
|
|
10913
|
-
for (let a of
|
|
10914
|
-
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));
|
|
10915
10927
|
if (!n) continue;
|
|
10916
|
-
let s =
|
|
10928
|
+
let s = at[a] ? ` (${at[a]})` : '';
|
|
10917
10929
|
t.push(` ${i}${s} ${n}`);
|
|
10918
10930
|
}
|
|
10919
10931
|
}
|
|
10920
|
-
function
|
|
10932
|
+
function wr(e, t) {
|
|
10921
10933
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
10922
10934
|
t.push(
|
|
10923
10935
|
` ${r.bold(e.slug.padEnd(26))} ${r.gray(e.name)} ${r.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
10924
10936
|
);
|
|
10925
|
-
for (let n of e.variants ?? [])
|
|
10937
|
+
for (let n of e.variants ?? []) kr(n, t);
|
|
10926
10938
|
let a = e.addons;
|
|
10927
10939
|
if (Array.isArray(a))
|
|
10928
10940
|
for (let n of a) {
|
|
10929
10941
|
if (!n || typeof n != 'object') continue;
|
|
10930
10942
|
let s = n,
|
|
10931
10943
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
10932
|
-
u =
|
|
10944
|
+
u = rt(s.price);
|
|
10933
10945
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
10934
10946
|
}
|
|
10935
10947
|
t.push('');
|
|
10936
10948
|
}
|
|
10937
|
-
function
|
|
10949
|
+
function xr(e) {
|
|
10938
10950
|
let t = [],
|
|
10939
10951
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
10940
10952
|
(t.push(`${r.bold('Tein prices')} ${r.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -10956,7 +10968,7 @@ function br(e) {
|
|
|
10956
10968
|
});
|
|
10957
10969
|
for (let l of s) {
|
|
10958
10970
|
t.push(`${r.bold(r.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
10959
|
-
for (let c of a.get(l) ?? [])
|
|
10971
|
+
for (let c of a.get(l) ?? []) wr(c, t);
|
|
10960
10972
|
}
|
|
10961
10973
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
10962
10974
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -10973,7 +10985,7 @@ function br(e) {
|
|
|
10973
10985
|
t.push(` ${r.bold(c.padEnd(26))} ${r.gray(p)}`);
|
|
10974
10986
|
for (let m of d) {
|
|
10975
10987
|
let y = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
10976
|
-
f =
|
|
10988
|
+
f = rt(m.prices);
|
|
10977
10989
|
f && t.push(` ${y} ${f}`);
|
|
10978
10990
|
}
|
|
10979
10991
|
t.push('');
|
|
@@ -10986,10 +10998,10 @@ function br(e) {
|
|
|
10986
10998
|
`
|
|
10987
10999
|
);
|
|
10988
11000
|
}
|
|
10989
|
-
async function
|
|
11001
|
+
async function _i(e) {
|
|
10990
11002
|
let t;
|
|
10991
11003
|
try {
|
|
10992
|
-
t = await
|
|
11004
|
+
t = await yr(e.apiUrl, e.model);
|
|
10993
11005
|
} catch (i) {
|
|
10994
11006
|
let a = i instanceof Error ? i.message : String(i);
|
|
10995
11007
|
(process.stderr.write(`${r.red('Error:')} ${a}
|
|
@@ -11000,12 +11012,12 @@ async function ki(e) {
|
|
|
11000
11012
|
e.json
|
|
11001
11013
|
? `${JSON.stringify(t, null, 2)}
|
|
11002
11014
|
`
|
|
11003
|
-
:
|
|
11015
|
+
: xr(t),
|
|
11004
11016
|
);
|
|
11005
11017
|
}
|
|
11006
|
-
var
|
|
11018
|
+
var Pi = T(require('node:path'));
|
|
11007
11019
|
E();
|
|
11008
|
-
async function
|
|
11020
|
+
async function Ii(e, t) {
|
|
11009
11021
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11010
11022
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
11011
11023
|
(i ||
|
|
@@ -11100,7 +11112,7 @@ ${r.bold('Outputs:')}
|
|
|
11100
11112
|
) {
|
|
11101
11113
|
let p = new $(`Downloading output to ${o}...`).start();
|
|
11102
11114
|
try {
|
|
11103
|
-
(await u.downloadOutput(d.url,
|
|
11115
|
+
(await u.downloadOutput(d.url, Pi.default.resolve(process.cwd(), o)),
|
|
11104
11116
|
p.succeed(`Saved to ${r.bold(o)}`));
|
|
11105
11117
|
} catch (m) {
|
|
11106
11118
|
p.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -11115,10 +11127,10 @@ ${d.text}
|
|
|
11115
11127
|
process.stdout.write(`
|
|
11116
11128
|
`);
|
|
11117
11129
|
}
|
|
11118
|
-
var
|
|
11119
|
-
|
|
11130
|
+
var nt = T(require('node:fs')),
|
|
11131
|
+
st = T(require('node:path'));
|
|
11120
11132
|
E();
|
|
11121
|
-
async function
|
|
11133
|
+
async function vi(e, t = {}) {
|
|
11122
11134
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
11123
11135
|
a = w(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
11124
11136
|
n = !!t.json;
|
|
@@ -11135,13 +11147,13 @@ async function _i(e, t = {}) {
|
|
|
11135
11147
|
process.stderr.write(`Usage: ${r.cyan('tein upload <image.png|video.mp4>')}
|
|
11136
11148
|
`),
|
|
11137
11149
|
process.exit(1)));
|
|
11138
|
-
let s =
|
|
11139
|
-
|
|
11150
|
+
let s = st.default.resolve(e);
|
|
11151
|
+
nt.default.existsSync(s) ||
|
|
11140
11152
|
(process.stderr.write(`${r.red('Error:')} File not found: ${s}
|
|
11141
11153
|
`),
|
|
11142
11154
|
process.exit(1));
|
|
11143
|
-
let o =
|
|
11144
|
-
l =
|
|
11155
|
+
let o = st.default.basename(s),
|
|
11156
|
+
l = nt.default.readFileSync(s).toString('base64'),
|
|
11145
11157
|
c = new M(i, a),
|
|
11146
11158
|
d = new $(`Uploading ${r.bold(o)} to Tein AI CDN...`);
|
|
11147
11159
|
n || d.start();
|
|
@@ -11182,10 +11194,10 @@ ${r.bold('CDN URL:')} ${r.green(p.url)}
|
|
|
11182
11194
|
process.exit(m ? m.exitCode : v));
|
|
11183
11195
|
}
|
|
11184
11196
|
}
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
function
|
|
11197
|
+
ne();
|
|
11198
|
+
te();
|
|
11199
|
+
De();
|
|
11200
|
+
function Fi() {
|
|
11189
11201
|
process.stdout.write(`
|
|
11190
11202
|
${r.bold(r.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
11191
11203
|
|
|
@@ -11267,11 +11279,11 @@ ${r.bold('EXAMPLES:')}
|
|
|
11267
11279
|
|
|
11268
11280
|
`);
|
|
11269
11281
|
}
|
|
11270
|
-
async function
|
|
11282
|
+
async function Fr() {
|
|
11271
11283
|
let e = process.argv.slice(2),
|
|
11272
|
-
t =
|
|
11284
|
+
t = pi(e);
|
|
11273
11285
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
11274
|
-
|
|
11286
|
+
Fi();
|
|
11275
11287
|
return;
|
|
11276
11288
|
}
|
|
11277
11289
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -11281,31 +11293,31 @@ async function Vr() {
|
|
|
11281
11293
|
}
|
|
11282
11294
|
switch (t.command) {
|
|
11283
11295
|
case 'auth': {
|
|
11284
|
-
await
|
|
11296
|
+
await ae(t.subcommand, t.options.key);
|
|
11285
11297
|
break;
|
|
11286
11298
|
}
|
|
11287
11299
|
case 'login': {
|
|
11288
|
-
await
|
|
11300
|
+
await ae('login', t.options.key);
|
|
11289
11301
|
break;
|
|
11290
11302
|
}
|
|
11291
11303
|
case 'logout': {
|
|
11292
|
-
await
|
|
11304
|
+
await ae('logout');
|
|
11293
11305
|
break;
|
|
11294
11306
|
}
|
|
11295
11307
|
case 'whoami': {
|
|
11296
|
-
await
|
|
11308
|
+
await ae('status');
|
|
11297
11309
|
break;
|
|
11298
11310
|
}
|
|
11299
11311
|
case 'models':
|
|
11300
11312
|
case 'list': {
|
|
11301
|
-
await
|
|
11313
|
+
await wi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
11302
11314
|
break;
|
|
11303
11315
|
}
|
|
11304
11316
|
case 'pricing':
|
|
11305
11317
|
case 'prices': {
|
|
11306
11318
|
let i = t.options.model,
|
|
11307
11319
|
a = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
11308
|
-
await
|
|
11320
|
+
await _i({
|
|
11309
11321
|
model: a,
|
|
11310
11322
|
json: !!t.options.json,
|
|
11311
11323
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -11320,40 +11332,40 @@ async function Vr() {
|
|
|
11320
11332
|
process.stderr.write(`Usage: ${r.cyan('tein info <model-slug>')}
|
|
11321
11333
|
`),
|
|
11322
11334
|
process.exit(1)),
|
|
11323
|
-
await
|
|
11335
|
+
await xi(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
11324
11336
|
break;
|
|
11325
11337
|
}
|
|
11326
11338
|
case 'upload': {
|
|
11327
11339
|
let i = t.subcommand || '';
|
|
11328
|
-
await
|
|
11340
|
+
await vi(i, t.options);
|
|
11329
11341
|
break;
|
|
11330
11342
|
}
|
|
11331
11343
|
case 'run':
|
|
11332
11344
|
case 'generate': {
|
|
11333
11345
|
let i = t.subcommand || '';
|
|
11334
|
-
await
|
|
11346
|
+
await Ze(i, t.options);
|
|
11335
11347
|
break;
|
|
11336
11348
|
}
|
|
11337
11349
|
case 'status': {
|
|
11338
11350
|
let i = t.subcommand || '';
|
|
11339
|
-
await
|
|
11351
|
+
await Ii(i, t.options);
|
|
11340
11352
|
break;
|
|
11341
11353
|
}
|
|
11342
11354
|
case 'balance': {
|
|
11343
|
-
await
|
|
11355
|
+
await mi(t.options);
|
|
11344
11356
|
break;
|
|
11345
11357
|
}
|
|
11346
11358
|
case 'usage': {
|
|
11347
|
-
await
|
|
11359
|
+
await yi(t.options);
|
|
11348
11360
|
break;
|
|
11349
11361
|
}
|
|
11350
11362
|
case 'transactions':
|
|
11351
11363
|
case 'history': {
|
|
11352
|
-
await
|
|
11364
|
+
await bi(t.options);
|
|
11353
11365
|
break;
|
|
11354
11366
|
}
|
|
11355
11367
|
case 'mcp': {
|
|
11356
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
11368
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Ui(), Ni));
|
|
11357
11369
|
await i();
|
|
11358
11370
|
break;
|
|
11359
11371
|
}
|
|
@@ -11366,15 +11378,15 @@ ${r.red('Error:')} Unknown command or model "${t.command}".
|
|
|
11366
11378
|
Run ${r.cyan('tein --help')} for the commands, or ${r.cyan('tein models')} for the model slugs.
|
|
11367
11379
|
`),
|
|
11368
11380
|
process.exit(v)),
|
|
11369
|
-
await
|
|
11381
|
+
await Ze(t.command, t.options));
|
|
11370
11382
|
return;
|
|
11371
11383
|
}
|
|
11372
|
-
|
|
11384
|
+
Fi();
|
|
11373
11385
|
break;
|
|
11374
11386
|
}
|
|
11375
11387
|
}
|
|
11376
11388
|
}
|
|
11377
|
-
|
|
11389
|
+
Fr().catch((e) => {
|
|
11378
11390
|
(e instanceof b &&
|
|
11379
11391
|
(process.stderr.write(`
|
|
11380
11392
|
${r.red('Error:')} ${K(e).join(`
|