@teinai/cli 1.1.45 → 1.1.47
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 +490 -491
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
var wi = Object.create;
|
|
4
|
-
var
|
|
4
|
+
var Se = Object.defineProperty;
|
|
5
5
|
var xi = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var ki = Object.getOwnPropertyNames;
|
|
7
7
|
var _i = Object.getPrototypeOf,
|
|
@@ -15,19 +15,19 @@ var y = (e, t, r) => () => {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
var Ii = (e, t) => {
|
|
18
|
-
for (var r in t)
|
|
18
|
+
for (var r in t) Se(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
20
|
vi = (e, t, r, i) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
22
|
for (let n of ki(t))
|
|
23
23
|
!Pi.call(e, n) &&
|
|
24
24
|
n !== r &&
|
|
25
|
-
|
|
25
|
+
Se(e, n, { get: () => t[n], enumerable: !(i = xi(t, n)) || i.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
28
|
var M = (e, t, r) => (
|
|
29
29
|
(r = e != null ? wi(_i(e)) : {}),
|
|
30
|
-
vi(t || !e || !e.__esModule ?
|
|
30
|
+
vi(t || !e || !e.__esModule ? Se(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
32
|
function Si(e) {
|
|
33
33
|
for (let t of e)
|
|
@@ -41,68 +41,68 @@ function Si(e) {
|
|
|
41
41
|
function Ki() {
|
|
42
42
|
let e = typeof __dirname == 'string' ? __dirname : process.cwd();
|
|
43
43
|
return [
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
Ke.default.join(e, 'package.json'),
|
|
45
|
+
Ke.default.join(e, '..', '..', 'cli-package', 'package.json'),
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
48
|
var kt,
|
|
49
|
-
|
|
49
|
+
Ke,
|
|
50
50
|
Mi,
|
|
51
|
-
|
|
51
|
+
H,
|
|
52
52
|
oe = y(() => {
|
|
53
53
|
'use strict';
|
|
54
|
-
((kt = M(require('node:fs'))), (
|
|
55
|
-
|
|
54
|
+
((kt = M(require('node:fs'))), (Ke = M(require('node:path'))), (Mi = '0.0.0-dev'));
|
|
55
|
+
H = Si(Ki());
|
|
56
56
|
});
|
|
57
|
-
function
|
|
57
|
+
function W() {
|
|
58
58
|
try {
|
|
59
|
-
if (L.default.existsSync(
|
|
60
|
-
let e = L.default.readFileSync(
|
|
59
|
+
if (L.default.existsSync(z)) {
|
|
60
|
+
let e = L.default.readFileSync(z, 'utf-8');
|
|
61
61
|
return JSON.parse(e);
|
|
62
62
|
}
|
|
63
63
|
} catch {}
|
|
64
64
|
return {};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function $e(e) {
|
|
67
67
|
try {
|
|
68
68
|
L.default.existsSync(pe) || L.default.mkdirSync(pe, { recursive: !0, mode: 448 });
|
|
69
|
-
let r = { ...
|
|
70
|
-
(L.default.writeFileSync(
|
|
69
|
+
let r = { ...W(), ...e };
|
|
70
|
+
(L.default.writeFileSync(z, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
71
71
|
L.default.chmodSync(pe, 448),
|
|
72
|
-
L.default.chmodSync(
|
|
72
|
+
L.default.chmodSync(z, 384));
|
|
73
73
|
} catch (t) {
|
|
74
|
-
throw new Error(`Failed to save config to ${
|
|
74
|
+
throw new Error(`Failed to save config to ${z}: ${t}`);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
function _(e) {
|
|
78
78
|
if (e && e.trim()) return e.trim();
|
|
79
79
|
let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
|
|
80
80
|
if (t && t.trim()) return t.trim();
|
|
81
|
-
let r =
|
|
81
|
+
let r = W();
|
|
82
82
|
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
83
83
|
}
|
|
84
84
|
function x(e) {
|
|
85
85
|
if (e && e.trim()) return e.trim().replace(/\/+$/, '');
|
|
86
86
|
let t = process.env.TEIN_API_URL;
|
|
87
87
|
if (t && t.trim()) return t.trim().replace(/\/+$/, '');
|
|
88
|
-
let r =
|
|
88
|
+
let r = W();
|
|
89
89
|
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
90
90
|
}
|
|
91
91
|
function de() {
|
|
92
|
-
return
|
|
92
|
+
return z;
|
|
93
93
|
}
|
|
94
94
|
var L,
|
|
95
95
|
Tt,
|
|
96
|
-
|
|
96
|
+
Ee,
|
|
97
97
|
pe,
|
|
98
|
-
|
|
98
|
+
z,
|
|
99
99
|
R = y(() => {
|
|
100
100
|
'use strict';
|
|
101
101
|
((L = M(require('node:fs'))),
|
|
102
102
|
(Tt = M(require('node:os'))),
|
|
103
|
-
(
|
|
104
|
-
(pe =
|
|
105
|
-
(
|
|
103
|
+
(Ee = M(require('node:path'))),
|
|
104
|
+
(pe = Ee.default.join(Tt.default.homedir(), '.tein')),
|
|
105
|
+
(z = Ee.default.join(pe, 'config.json')));
|
|
106
106
|
});
|
|
107
107
|
var Ri,
|
|
108
108
|
Mt,
|
|
@@ -115,7 +115,7 @@ var Ri,
|
|
|
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 ce,
|
|
118
|
-
|
|
118
|
+
Ae = y(() => {
|
|
119
119
|
'use strict';
|
|
120
120
|
ce = new Set([]);
|
|
121
121
|
});
|
|
@@ -217,8 +217,12 @@ var ue,
|
|
|
217
217
|
],
|
|
218
218
|
},
|
|
219
219
|
{ slug: 'gemini-omni', name: 'Gemini Omni', models: ['gemini-omni-1.2-flash'] },
|
|
220
|
-
{ slug: 'magi', name: '
|
|
221
|
-
{
|
|
220
|
+
{ slug: 'magi', name: 'MAGIC', models: ['magi-2'] },
|
|
221
|
+
{
|
|
222
|
+
slug: 'kling',
|
|
223
|
+
name: 'Kling',
|
|
224
|
+
models: ['kling-v4', 'kling-v4-flash', 'kling-v3-video', 'kling-motion-control'],
|
|
225
|
+
},
|
|
222
226
|
{ slug: 'ltx', name: 'LTX', models: ['ltx-2.3-pro'] },
|
|
223
227
|
{ slug: 'vidu', name: 'Vidu', models: ['vidu-q4-preview'] },
|
|
224
228
|
{ slug: 'flux', name: 'FLUX', models: ['flux-2-dev'] },
|
|
@@ -5785,38 +5789,38 @@ var ue,
|
|
|
5785
5789
|
},
|
|
5786
5790
|
{
|
|
5787
5791
|
slug: 'magi-2',
|
|
5788
|
-
name: '
|
|
5792
|
+
name: 'MAGIC-2',
|
|
5789
5793
|
family: 'magi',
|
|
5790
|
-
vendor: '
|
|
5791
|
-
desc:
|
|
5794
|
+
vendor: 'Tein AI',
|
|
5795
|
+
desc: 'MAGIC-2: video with optional native sound from text, a start frame (with an optional end frame), or images, videos and audio clips as references.',
|
|
5792
5796
|
kind: 'video',
|
|
5793
|
-
unit: '/
|
|
5797
|
+
unit: '/frame',
|
|
5794
5798
|
api: { model: 'magi-2' },
|
|
5795
5799
|
variants: [
|
|
5796
5800
|
{
|
|
5797
5801
|
id: '720p',
|
|
5798
|
-
price: { starter: 0.
|
|
5802
|
+
price: { starter: 0.002, plus: 0.0019, scale: 0.0018 },
|
|
5799
5803
|
label: '720p',
|
|
5800
5804
|
resolution: '720p',
|
|
5801
5805
|
withVideo: !1,
|
|
5802
5806
|
},
|
|
5803
5807
|
{
|
|
5804
5808
|
id: '720p-with-video',
|
|
5805
|
-
price: { starter: 0.
|
|
5809
|
+
price: { starter: 0.00121, plus: 0.00115, scale: 0.00109 },
|
|
5806
5810
|
label: '720p \xB7 with reference video',
|
|
5807
5811
|
resolution: '720p',
|
|
5808
5812
|
withVideo: !0,
|
|
5809
5813
|
},
|
|
5810
5814
|
{
|
|
5811
5815
|
id: '1080p',
|
|
5812
|
-
price: { starter: 0.
|
|
5816
|
+
price: { starter: 0.00547, plus: 0.005, scale: 0.00481 },
|
|
5813
5817
|
label: '1080p',
|
|
5814
5818
|
resolution: '1080p',
|
|
5815
5819
|
withVideo: !1,
|
|
5816
5820
|
},
|
|
5817
5821
|
{
|
|
5818
5822
|
id: '1080p-with-video',
|
|
5819
|
-
price: { starter: 0.
|
|
5823
|
+
price: { starter: 0.01094, plus: 0.01, scale: 0.00962 },
|
|
5820
5824
|
label: '1080p \xB7 with reference video',
|
|
5821
5825
|
resolution: '1080p',
|
|
5822
5826
|
withVideo: !0,
|
|
@@ -5909,7 +5913,7 @@ var ue,
|
|
|
5909
5913
|
name: 'Kling Video 3.0',
|
|
5910
5914
|
family: 'kling',
|
|
5911
5915
|
vendor: 'Kuaishou',
|
|
5912
|
-
desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds
|
|
5916
|
+
desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds. Sound is optional; silent clips are the lower rate.',
|
|
5913
5917
|
kind: 'video',
|
|
5914
5918
|
unit: '/sec',
|
|
5915
5919
|
api: { model: 'kling-v3-video' },
|
|
@@ -5956,26 +5960,41 @@ var ue,
|
|
|
5956
5960
|
resolution: '4k',
|
|
5957
5961
|
quality: 'audio',
|
|
5958
5962
|
},
|
|
5963
|
+
],
|
|
5964
|
+
unfiltered: null,
|
|
5965
|
+
priority: null,
|
|
5966
|
+
draft: null,
|
|
5967
|
+
axes: { resolution: ['720p', '1080p', '4k'] },
|
|
5968
|
+
from: { variant: '720p-silent' },
|
|
5969
|
+
},
|
|
5970
|
+
{
|
|
5971
|
+
slug: 'kling-motion-control',
|
|
5972
|
+
name: 'Kling Motion Control',
|
|
5973
|
+
family: 'kling',
|
|
5974
|
+
vendor: 'Kuaishou',
|
|
5975
|
+
desc: "Moves the character in an image with the motion of a reference video (3 to 30 seconds), at 720p or 1080p. Keeps the video's sound unless turned off; billed per second of the reference video.",
|
|
5976
|
+
kind: 'video',
|
|
5977
|
+
unit: '/sec',
|
|
5978
|
+
api: { model: 'kling-motion-control' },
|
|
5979
|
+
variants: [
|
|
5959
5980
|
{
|
|
5960
|
-
id: '720p
|
|
5981
|
+
id: '720p',
|
|
5961
5982
|
price: { starter: 0.1575, plus: 0.1496, scale: 0.14 },
|
|
5962
|
-
label: '720p
|
|
5983
|
+
label: '720p',
|
|
5963
5984
|
resolution: '720p',
|
|
5964
|
-
quality: 'motion',
|
|
5965
5985
|
},
|
|
5966
5986
|
{
|
|
5967
|
-
id: '1080p
|
|
5987
|
+
id: '1080p',
|
|
5968
5988
|
price: { starter: 0.21, plus: 0.1995, scale: 0.1867 },
|
|
5969
|
-
label: '1080p
|
|
5989
|
+
label: '1080p',
|
|
5970
5990
|
resolution: '1080p',
|
|
5971
|
-
quality: 'motion',
|
|
5972
5991
|
},
|
|
5973
5992
|
],
|
|
5974
5993
|
unfiltered: null,
|
|
5975
5994
|
priority: null,
|
|
5976
5995
|
draft: null,
|
|
5977
|
-
axes: { resolution: ['720p', '1080p'
|
|
5978
|
-
from: { variant: '720p
|
|
5996
|
+
axes: { resolution: ['720p', '1080p'] },
|
|
5997
|
+
from: { variant: '720p' },
|
|
5979
5998
|
},
|
|
5980
5999
|
{
|
|
5981
6000
|
slug: 'minimax-h3-turbo',
|
|
@@ -6317,7 +6336,7 @@ var Ct,
|
|
|
6317
6336
|
});
|
|
6318
6337
|
var me,
|
|
6319
6338
|
Rt,
|
|
6320
|
-
|
|
6339
|
+
Re = y(() => {
|
|
6321
6340
|
'use strict';
|
|
6322
6341
|
((me = [
|
|
6323
6342
|
{
|
|
@@ -6396,7 +6415,7 @@ var me,
|
|
|
6396
6415
|
]),
|
|
6397
6416
|
(Rt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
6398
6417
|
});
|
|
6399
|
-
function
|
|
6418
|
+
function Le(e, t) {
|
|
6400
6419
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
6401
6420
|
}
|
|
6402
6421
|
function qi(e, t) {
|
|
@@ -6416,55 +6435,55 @@ function Li(e, t) {
|
|
|
6416
6435
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
6417
6436
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
6418
6437
|
let n = qi(r, t),
|
|
6419
|
-
s =
|
|
6438
|
+
s = Oe.get(Le('seedance-2', n));
|
|
6420
6439
|
return s ? s.slug : null;
|
|
6421
6440
|
}
|
|
6422
|
-
let i = fe.get(r) ??
|
|
6441
|
+
let i = fe.get(r) ?? Oe.get(Le(r));
|
|
6423
6442
|
return i ? i.slug : null;
|
|
6424
6443
|
}
|
|
6425
6444
|
function Ni(e, t) {
|
|
6426
6445
|
return fe.has(e) && !(Di.has(e) && t) ? e : Li(e, t);
|
|
6427
6446
|
}
|
|
6428
|
-
function
|
|
6447
|
+
function F(e, t) {
|
|
6429
6448
|
let r = Ni(e, t);
|
|
6430
6449
|
return r ? (fe.get(r) ?? null) : null;
|
|
6431
6450
|
}
|
|
6432
|
-
function
|
|
6451
|
+
function Ut(e, t) {
|
|
6433
6452
|
return `${e}/addon/${t}`;
|
|
6434
6453
|
}
|
|
6435
|
-
function
|
|
6454
|
+
function Vt(e) {
|
|
6436
6455
|
return Nt.get(e) ?? null;
|
|
6437
6456
|
}
|
|
6438
6457
|
function ge() {
|
|
6439
6458
|
return Dt;
|
|
6440
6459
|
}
|
|
6441
|
-
var
|
|
6460
|
+
var De,
|
|
6442
6461
|
qt,
|
|
6443
6462
|
Lt,
|
|
6444
6463
|
Dt,
|
|
6445
6464
|
Oi,
|
|
6446
6465
|
fe,
|
|
6447
|
-
|
|
6466
|
+
Oe,
|
|
6448
6467
|
Ot,
|
|
6449
6468
|
Nt,
|
|
6450
|
-
|
|
6469
|
+
qe,
|
|
6451
6470
|
Di,
|
|
6452
|
-
|
|
6471
|
+
B = y(() => {
|
|
6453
6472
|
'use strict';
|
|
6454
6473
|
Et();
|
|
6455
6474
|
$t();
|
|
6456
6475
|
At();
|
|
6457
|
-
|
|
6458
|
-
((
|
|
6476
|
+
Re();
|
|
6477
|
+
((De = {
|
|
6459
6478
|
...ue,
|
|
6460
6479
|
families: ue.families.map((e) => ({ ...e, models: e.models.filter((t) => !Z(t)) })),
|
|
6461
6480
|
models: ue.models.filter((e) => !Z(e.slug)),
|
|
6462
6481
|
}),
|
|
6463
6482
|
(qt = me.filter((e) => !Z(e.slug))),
|
|
6464
|
-
(Lt = Ct.filter((e) => !Z(e.slug) && !
|
|
6465
|
-
(Dt = [...
|
|
6483
|
+
(Lt = Ct.filter((e) => !Z(e.slug) && !De.models.some((t) => t.slug === e.slug))),
|
|
6484
|
+
(Dt = [...De.models, ...Lt, ...qt]),
|
|
6466
6485
|
(Oi = [
|
|
6467
|
-
...
|
|
6486
|
+
...De.families.map((e) => {
|
|
6468
6487
|
let t = Lt.filter((r) => r.family === e.slug).map((r) => r.slug);
|
|
6469
6488
|
return t.length ? { ...e, models: [...e.models, ...t] } : e;
|
|
6470
6489
|
}),
|
|
@@ -6474,26 +6493,26 @@ var Ne,
|
|
|
6474
6493
|
})).filter((e) => e.models.length > 0),
|
|
6475
6494
|
]),
|
|
6476
6495
|
(fe = new Map()),
|
|
6477
|
-
(
|
|
6496
|
+
(Oe = new Map()),
|
|
6478
6497
|
(Ot = new Map()),
|
|
6479
6498
|
(Nt = new Map()),
|
|
6480
|
-
(
|
|
6499
|
+
(qe = new Map()));
|
|
6481
6500
|
for (let e of Dt) {
|
|
6482
|
-
(fe.set(e.slug, e),
|
|
6501
|
+
(fe.set(e.slug, e), Oe.set(Le(e.api.model, e.api.quality), e));
|
|
6483
6502
|
for (let t of e.variants) Ot.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
6484
6503
|
for (let t of e.editVariants ?? [])
|
|
6485
6504
|
Ot.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6486
6505
|
for (let t of e.addons ?? []) Nt.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6487
|
-
|
|
6506
|
+
qe.set(e.slug, e.family);
|
|
6488
6507
|
}
|
|
6489
|
-
for (let e of Oi) for (let t of e.models)
|
|
6508
|
+
for (let e of Oi) for (let t of e.models) qe.has(t) || qe.set(t, e.slug);
|
|
6490
6509
|
Di = new Set(['seedance-2']);
|
|
6491
6510
|
});
|
|
6492
6511
|
function he(e) {
|
|
6493
6512
|
let t = e.from?.variant;
|
|
6494
6513
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
6495
6514
|
}
|
|
6496
|
-
function
|
|
6515
|
+
function Ne(e) {
|
|
6497
6516
|
if (e.endpoints?.length)
|
|
6498
6517
|
return e.editVariants?.length && e.endpoints.some((t) => t.id === Ft)
|
|
6499
6518
|
? Ft
|
|
@@ -6502,11 +6521,11 @@ function Ve(e) {
|
|
|
6502
6521
|
var Ft,
|
|
6503
6522
|
Ue = y(() => {
|
|
6504
6523
|
'use strict';
|
|
6505
|
-
|
|
6524
|
+
B();
|
|
6506
6525
|
Ft = 'dynamic';
|
|
6507
6526
|
});
|
|
6508
6527
|
function Fi(e) {
|
|
6509
|
-
return
|
|
6528
|
+
return Ut(e, Ui);
|
|
6510
6529
|
}
|
|
6511
6530
|
function ye(e) {
|
|
6512
6531
|
let t = e.toFixed(5).replace(/0+$/, '');
|
|
@@ -6515,21 +6534,21 @@ function ye(e) {
|
|
|
6515
6534
|
(t.split('.')[1] ?? '').length < 2 ? `$${e.toFixed(2)}` : `$${t}`
|
|
6516
6535
|
);
|
|
6517
6536
|
}
|
|
6518
|
-
function
|
|
6537
|
+
function Ve(e) {
|
|
6519
6538
|
return e.starter === e.plus && e.plus === e.scale
|
|
6520
6539
|
? `${ye(e.starter)} on every plan`
|
|
6521
6540
|
: `${ye(e.starter)} on Starter, ${ye(e.plus)} on Plus, ${ye(e.scale)} on Scale`;
|
|
6522
6541
|
}
|
|
6523
6542
|
function Bt(e) {
|
|
6524
6543
|
let t = [],
|
|
6525
|
-
r =
|
|
6526
|
-
i = r != null ?
|
|
6544
|
+
r = Vi[e],
|
|
6545
|
+
i = r != null ? Vt(Fi(e)) : null;
|
|
6527
6546
|
if (i && r != null) {
|
|
6528
6547
|
let n =
|
|
6529
|
-
i.addon.unfiltered &&
|
|
6548
|
+
i.addon.unfiltered && Ve(i.addon.unfiltered) === Ve(i.addon.price)
|
|
6530
6549
|
? ', Creative mode included'
|
|
6531
6550
|
: '';
|
|
6532
|
-
t.push(`Each reference image after the ${ji[r] ?? `${r}th`} adds ${
|
|
6551
|
+
t.push(`Each reference image after the ${ji[r] ?? `${r}th`} adds ${Ve(i.addon.price)}${n}.`);
|
|
6533
6552
|
}
|
|
6534
6553
|
return (
|
|
6535
6554
|
Bi.has(e) &&
|
|
@@ -6539,19 +6558,19 @@ function Bt(e) {
|
|
|
6539
6558
|
t
|
|
6540
6559
|
);
|
|
6541
6560
|
}
|
|
6542
|
-
var
|
|
6543
|
-
|
|
6561
|
+
var Ui,
|
|
6562
|
+
Vi,
|
|
6544
6563
|
Bi,
|
|
6545
6564
|
ji,
|
|
6546
6565
|
jt = y(() => {
|
|
6547
6566
|
'use strict';
|
|
6548
|
-
|
|
6549
|
-
((
|
|
6567
|
+
B();
|
|
6568
|
+
((Ui = 'extra-image-input'), (Vi = { 'seedream-5-pro': 1, 'minimax-h3': 5 }));
|
|
6550
6569
|
Bi = new Set(['minimax-h3']);
|
|
6551
6570
|
ji = { 1: 'first', 5: '5th' };
|
|
6552
6571
|
});
|
|
6553
6572
|
var be,
|
|
6554
|
-
|
|
6573
|
+
Fe = y(() => {
|
|
6555
6574
|
'use strict';
|
|
6556
6575
|
be = {
|
|
6557
6576
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -6572,7 +6591,7 @@ function Ht(e, t) {
|
|
|
6572
6591
|
var Gi,
|
|
6573
6592
|
zt = y(() => {
|
|
6574
6593
|
'use strict';
|
|
6575
|
-
|
|
6594
|
+
B();
|
|
6576
6595
|
Ue();
|
|
6577
6596
|
Gt();
|
|
6578
6597
|
Gi = {};
|
|
@@ -6695,8 +6714,8 @@ var Qt,
|
|
|
6695
6714
|
function er(e) {
|
|
6696
6715
|
return `$${e}`;
|
|
6697
6716
|
}
|
|
6698
|
-
function
|
|
6699
|
-
return
|
|
6717
|
+
function Be(e, t, r) {
|
|
6718
|
+
return F(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
6700
6719
|
}
|
|
6701
6720
|
function Wi(e) {
|
|
6702
6721
|
return [
|
|
@@ -6765,14 +6784,14 @@ function Wi(e) {
|
|
|
6765
6784
|
];
|
|
6766
6785
|
}
|
|
6767
6786
|
function tr(e) {
|
|
6768
|
-
let t =
|
|
6769
|
-
r =
|
|
6787
|
+
let t = Be(e, 'cheap', 'input'),
|
|
6788
|
+
r = Be(e, 'cheap', 'output');
|
|
6770
6789
|
return t != null && r != null ? `${er(t)}/M in \xB7 ${er(r)}/M out` : '';
|
|
6771
6790
|
}
|
|
6772
6791
|
function rr() {
|
|
6773
6792
|
return Object.fromEntries(
|
|
6774
6793
|
Qt.map((e) => {
|
|
6775
|
-
let t =
|
|
6794
|
+
let t = Be(e.slug, 'stable', 'input') != null,
|
|
6776
6795
|
r = tr(e.slug),
|
|
6777
6796
|
i = {
|
|
6778
6797
|
slug: e.slug,
|
|
@@ -6793,9 +6812,9 @@ function rr() {
|
|
|
6793
6812
|
var ir = y(() => {
|
|
6794
6813
|
'use strict';
|
|
6795
6814
|
Zt();
|
|
6796
|
-
|
|
6815
|
+
B();
|
|
6797
6816
|
});
|
|
6798
|
-
function
|
|
6817
|
+
function je(e) {
|
|
6799
6818
|
return e ? Yi.get(e) : void 0;
|
|
6800
6819
|
}
|
|
6801
6820
|
function or(e, t) {
|
|
@@ -6805,24 +6824,15 @@ function or(e, t) {
|
|
|
6805
6824
|
? [...e.aspects, 'adaptive']
|
|
6806
6825
|
: [...e.aspects];
|
|
6807
6826
|
}
|
|
6808
|
-
function lr(e, t, r) {
|
|
6809
|
-
return e.modes.includes('motion_control')
|
|
6810
|
-
? t === 'motion_control'
|
|
6811
|
-
? !Qi.includes(r)
|
|
6812
|
-
: !Xi.includes(r)
|
|
6813
|
-
: !0;
|
|
6814
|
-
}
|
|
6815
6827
|
var ar,
|
|
6816
6828
|
Ji,
|
|
6817
6829
|
nr,
|
|
6818
|
-
|
|
6830
|
+
ds,
|
|
6819
6831
|
Yi,
|
|
6820
6832
|
sr,
|
|
6821
6833
|
Ge,
|
|
6822
|
-
|
|
6834
|
+
cs,
|
|
6823
6835
|
He,
|
|
6824
|
-
Xi,
|
|
6825
|
-
Qi,
|
|
6826
6836
|
ze = y(() => {
|
|
6827
6837
|
'use strict';
|
|
6828
6838
|
((ar = ['16:9', '9:16', '1:1', '21:9']),
|
|
@@ -6880,13 +6890,12 @@ var ar,
|
|
|
6880
6890
|
{
|
|
6881
6891
|
slug: 'kling-v3-video',
|
|
6882
6892
|
kind: 'video',
|
|
6883
|
-
modes: ['text_to_video', 'image_to_video'
|
|
6893
|
+
modes: ['text_to_video', 'image_to_video'],
|
|
6884
6894
|
promptMax: 2500,
|
|
6885
|
-
promptOptionalModes: ['motion_control'],
|
|
6886
6895
|
duration: { min: 3, max: 15, default: 5 },
|
|
6887
6896
|
heights: { '720p': 720, '1080p': 1080, '4k': 2160 },
|
|
6888
6897
|
aspects: ['16:9', '9:16', '1:1'],
|
|
6889
|
-
sourceFramedModes: ['image_to_video'
|
|
6898
|
+
sourceFramedModes: ['image_to_video'],
|
|
6890
6899
|
fps: 30,
|
|
6891
6900
|
audio: 'priced',
|
|
6892
6901
|
seed: !1,
|
|
@@ -6974,7 +6983,7 @@ var ar,
|
|
|
6974
6983
|
seed: !0,
|
|
6975
6984
|
},
|
|
6976
6985
|
]),
|
|
6977
|
-
(
|
|
6986
|
+
(ds = nr.map((e) => e.slug)),
|
|
6978
6987
|
(Yi = new Map(nr.map((e) => [e.slug, e]))));
|
|
6979
6988
|
((sr = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6980
6989
|
(Ge = {
|
|
@@ -6999,7 +7008,7 @@ var ar,
|
|
|
6999
7008
|
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
7000
7009
|
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
7001
7010
|
}),
|
|
7002
|
-
(
|
|
7011
|
+
(cs = Object.keys(Ge)),
|
|
7003
7012
|
(He = [
|
|
7004
7013
|
'mp3_44100_128',
|
|
7005
7014
|
'mp3_22050_32',
|
|
@@ -7014,48 +7023,8 @@ var ar,
|
|
|
7014
7023
|
'opus_48000_128',
|
|
7015
7024
|
'opus_48000_192',
|
|
7016
7025
|
]));
|
|
7017
|
-
((Xi = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
7018
|
-
(Qi = [
|
|
7019
|
-
'duration',
|
|
7020
|
-
'aspect_ratio',
|
|
7021
|
-
'generate_audio',
|
|
7022
|
-
'seed',
|
|
7023
|
-
'first_frame_image',
|
|
7024
|
-
'last_frame_image',
|
|
7025
|
-
'images',
|
|
7026
|
-
'videos',
|
|
7027
|
-
'audios',
|
|
7028
|
-
]));
|
|
7029
7026
|
});
|
|
7030
|
-
function
|
|
7031
|
-
return [
|
|
7032
|
-
{
|
|
7033
|
-
name: 'image_url',
|
|
7034
|
-
type: 'string',
|
|
7035
|
-
description: `motion_control: the character to animate, one jpg or png (at least 300 px a side, aspect 1:2.5 to 2.5:1) with the head and upper or full body clearly visible, ${D}`,
|
|
7036
|
-
},
|
|
7037
|
-
{
|
|
7038
|
-
name: 'video_url',
|
|
7039
|
-
type: 'string',
|
|
7040
|
-
description: `motion_control: the motion to copy, one mp4 or mov of a single person in one continuous take, 3 to 30 s (up to 10 s when character_orientation is image). Billed per second of this video, rounded up, ${D}`,
|
|
7041
|
-
},
|
|
7042
|
-
{
|
|
7043
|
-
name: 'character_orientation',
|
|
7044
|
-
type: 'select',
|
|
7045
|
-
default: 'video',
|
|
7046
|
-
options: ['video', 'image'],
|
|
7047
|
-
description:
|
|
7048
|
-
'motion_control: video faces the character as in the video (complex motion, up to 30 s); image as in the image (camera moves, up to 10 s).',
|
|
7049
|
-
},
|
|
7050
|
-
{
|
|
7051
|
-
name: 'keep_original_sound',
|
|
7052
|
-
type: 'boolean',
|
|
7053
|
-
default: !0,
|
|
7054
|
-
description: "motion_control: keep the video's sound. Same price on or off.",
|
|
7055
|
-
},
|
|
7056
|
-
];
|
|
7057
|
-
}
|
|
7058
|
-
function ta(e) {
|
|
7027
|
+
function Qi(e) {
|
|
7059
7028
|
let t = e.duration,
|
|
7060
7029
|
r = Object.keys(e.heights),
|
|
7061
7030
|
i = e.sourceFramedModes?.length
|
|
@@ -7078,7 +7047,7 @@ function ta(e) {
|
|
|
7078
7047
|
type: 'select',
|
|
7079
7048
|
default: r[0],
|
|
7080
7049
|
options: r,
|
|
7081
|
-
description:
|
|
7050
|
+
description: 'Output resolution. Higher resolutions cost more per second.',
|
|
7082
7051
|
},
|
|
7083
7052
|
{
|
|
7084
7053
|
name: 'aspect_ratio',
|
|
@@ -7107,19 +7076,19 @@ function ta(e) {
|
|
|
7107
7076
|
o.push({
|
|
7108
7077
|
name: 'images',
|
|
7109
7078
|
type: 'string[]',
|
|
7110
|
-
description: `multi_reference: up to ${e.reference.maxImages} reference images.${e.referenceHandles ? ' In the prompt, name them @Image1, @Image2, ... in this order.' : ''} ${
|
|
7079
|
+
description: `multi_reference: up to ${e.reference.maxImages} reference images.${e.referenceHandles ? ' In the prompt, name them @Image1, @Image2, ... in this order.' : ''} ${J}`,
|
|
7111
7080
|
}),
|
|
7112
7081
|
(e.modes.includes('image_to_video') || e.modes.includes('first_n_last_frames')) &&
|
|
7113
7082
|
o.push({
|
|
7114
7083
|
name: 'first_frame_image',
|
|
7115
7084
|
type: 'string',
|
|
7116
|
-
description: `The start frame (image_to_video, first_n_last_frames), ${
|
|
7085
|
+
description: `The start frame (image_to_video, first_n_last_frames), ${J}`,
|
|
7117
7086
|
}),
|
|
7118
7087
|
(e.lastFrameOnImageToVideo || e.modes.includes('first_n_last_frames')) &&
|
|
7119
7088
|
o.push({
|
|
7120
7089
|
name: 'last_frame_image',
|
|
7121
7090
|
type: 'string',
|
|
7122
|
-
description: `Last frame (optional on image_to_video), ${
|
|
7091
|
+
description: `Last frame (optional on image_to_video), ${J}`,
|
|
7123
7092
|
}),
|
|
7124
7093
|
e.reference?.maxVideos)
|
|
7125
7094
|
) {
|
|
@@ -7130,7 +7099,7 @@ function ta(e) {
|
|
|
7130
7099
|
o.push({
|
|
7131
7100
|
name: 'videos',
|
|
7132
7101
|
type: 'string[]',
|
|
7133
|
-
description: `multi_reference: up to ${p.maxVideos} reference videos${p.videoClipMinSeconds ? `, each longer than ${p.videoClipMinSeconds} s` : ''}${p.videoSides ? `, ${p.videoSides.min} to ${p.videoSides.max} px tall and wide` : ''}${p.maxVideoSeconds ? `, ${p.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${l} ${
|
|
7102
|
+
description: `multi_reference: up to ${p.maxVideos} reference videos${p.videoClipMinSeconds ? `, each longer than ${p.videoClipMinSeconds} s` : ''}${p.videoSides ? `, ${p.videoSides.min} to ${p.videoSides.max} px tall and wide` : ''}${p.maxVideoSeconds ? `, ${p.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${l} ${J}`,
|
|
7134
7103
|
});
|
|
7135
7104
|
}
|
|
7136
7105
|
if (e.reference?.maxAudios) {
|
|
@@ -7143,12 +7112,12 @@ function ta(e) {
|
|
|
7143
7112
|
o.push({
|
|
7144
7113
|
name: 'audios',
|
|
7145
7114
|
type: 'string[]',
|
|
7146
|
-
description: `multi_reference: up to ${p.maxAudios} reference audios${l}, with at least one image or video. ${
|
|
7115
|
+
description: `multi_reference: up to ${p.maxAudios} reference audios${l}, with at least one image or video. ${J}`,
|
|
7147
7116
|
});
|
|
7148
7117
|
}
|
|
7149
7118
|
return o;
|
|
7150
7119
|
}
|
|
7151
|
-
function
|
|
7120
|
+
function Zi(e) {
|
|
7152
7121
|
let t = Object.keys(e.sizes);
|
|
7153
7122
|
return [
|
|
7154
7123
|
{
|
|
@@ -7161,17 +7130,17 @@ function ra(e) {
|
|
|
7161
7130
|
{
|
|
7162
7131
|
name: 'images',
|
|
7163
7132
|
type: 'string[]',
|
|
7164
|
-
description: `image_to_image: up to ${e.maxEditImages} images to edit, ${
|
|
7133
|
+
description: `image_to_image: up to ${e.maxEditImages} images to edit, ${J}`,
|
|
7165
7134
|
},
|
|
7166
7135
|
];
|
|
7167
7136
|
}
|
|
7168
|
-
function
|
|
7137
|
+
function ta() {
|
|
7169
7138
|
return [
|
|
7170
7139
|
{
|
|
7171
7140
|
name: 'voice_id',
|
|
7172
7141
|
type: 'string',
|
|
7173
7142
|
default: sr,
|
|
7174
|
-
description: `text_to_speech: the ElevenLabs voice id, one of: ${
|
|
7143
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${ea}.`,
|
|
7175
7144
|
},
|
|
7176
7145
|
{
|
|
7177
7146
|
name: 'turns',
|
|
@@ -7190,7 +7159,7 @@ function aa() {
|
|
|
7190
7159
|
},
|
|
7191
7160
|
];
|
|
7192
7161
|
}
|
|
7193
|
-
function
|
|
7162
|
+
function lr(e) {
|
|
7194
7163
|
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
7195
7164
|
r = [
|
|
7196
7165
|
{
|
|
@@ -7205,26 +7174,25 @@ function pr(e) {
|
|
|
7205
7174
|
required: !0,
|
|
7206
7175
|
...(e.modeRequired ? {} : { default: e.modes[0] }),
|
|
7207
7176
|
options: [...e.modes],
|
|
7208
|
-
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((i) =>
|
|
7177
|
+
description: `${e.modeRequired ? 'Required. ' : ''}${e.modes.map((i) => Xi[i]).join(' ')}`,
|
|
7209
7178
|
},
|
|
7210
7179
|
];
|
|
7211
7180
|
return (
|
|
7212
|
-
e.kind === 'video' ? r.push(...
|
|
7213
|
-
e.modes.includes('motion_control') && r.push(...ea()),
|
|
7181
|
+
e.kind === 'video' ? r.push(...Qi(e)) : e.kind === 'image' ? r.push(...Zi(e)) : r.push(...ta()),
|
|
7214
7182
|
e.seed &&
|
|
7215
7183
|
r.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
7216
7184
|
r
|
|
7217
7185
|
);
|
|
7218
7186
|
}
|
|
7219
|
-
var
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7187
|
+
var J,
|
|
7188
|
+
Xi,
|
|
7189
|
+
ea,
|
|
7190
|
+
pr = y(() => {
|
|
7223
7191
|
'use strict';
|
|
7224
7192
|
ze();
|
|
7225
|
-
((
|
|
7193
|
+
((J =
|
|
7226
7194
|
'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.'),
|
|
7227
|
-
(
|
|
7195
|
+
(Xi = {
|
|
7228
7196
|
text_to_video: 'text_to_video: from the prompt alone.',
|
|
7229
7197
|
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
7230
7198
|
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
@@ -7233,47 +7201,45 @@ var D,
|
|
|
7233
7201
|
image_to_image: 'image_to_image: edit the images in `images`.',
|
|
7234
7202
|
text_to_speech: 'text_to_speech: speaks the prompt in one voice.',
|
|
7235
7203
|
dialogue: 'dialogue: speaks `turns`, each with its own voice.',
|
|
7236
|
-
motion_control:
|
|
7237
|
-
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
7238
7204
|
}));
|
|
7239
|
-
|
|
7205
|
+
ea = Object.entries(Ge)
|
|
7240
7206
|
.map(([e, t]) => `${e} (${t})`)
|
|
7241
7207
|
.join(', ');
|
|
7242
7208
|
});
|
|
7243
|
-
function
|
|
7244
|
-
return e ===
|
|
7209
|
+
function ur(e) {
|
|
7210
|
+
return e === we || e === xe;
|
|
7245
7211
|
}
|
|
7246
|
-
var
|
|
7212
|
+
var we,
|
|
7213
|
+
dr,
|
|
7214
|
+
xe,
|
|
7247
7215
|
cr,
|
|
7248
|
-
ke,
|
|
7249
|
-
ur,
|
|
7250
7216
|
We,
|
|
7251
|
-
|
|
7217
|
+
mr,
|
|
7218
|
+
gs,
|
|
7219
|
+
hs,
|
|
7220
|
+
ys,
|
|
7252
7221
|
bs,
|
|
7253
|
-
|
|
7254
|
-
xs,
|
|
7255
|
-
ks,
|
|
7256
|
-
gr = y(() => {
|
|
7222
|
+
fr = y(() => {
|
|
7257
7223
|
'use strict';
|
|
7258
|
-
((
|
|
7259
|
-
(
|
|
7260
|
-
(
|
|
7261
|
-
(
|
|
7224
|
+
((we = 'enhancor-ultrafine'),
|
|
7225
|
+
(dr = 'Enhancor Ultrafine'),
|
|
7226
|
+
(xe = 'enhancor-deblur'),
|
|
7227
|
+
(cr = 'Enhancor Deblur'));
|
|
7262
7228
|
((We = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
7263
|
-
(
|
|
7264
|
-
(
|
|
7265
|
-
(
|
|
7266
|
-
(
|
|
7267
|
-
(
|
|
7229
|
+
(mr = 2),
|
|
7230
|
+
(gs = 24 * 1024 * 1024),
|
|
7231
|
+
(hs = 4096 * 4096),
|
|
7232
|
+
(ys = 30 * 6e4),
|
|
7233
|
+
(bs = 120 * 6e4));
|
|
7268
7234
|
});
|
|
7269
|
-
var
|
|
7270
|
-
|
|
7271
|
-
|
|
7235
|
+
var ra,
|
|
7236
|
+
gr,
|
|
7237
|
+
ia,
|
|
7272
7238
|
Je,
|
|
7273
|
-
|
|
7239
|
+
hr = y(() => {
|
|
7274
7240
|
'use strict';
|
|
7275
|
-
((
|
|
7276
|
-
(
|
|
7241
|
+
((ra = ['natural', 'pores', 'freckles', 'more_freckles', 'blemish', 'glow', 'unblur']),
|
|
7242
|
+
(gr = {
|
|
7277
7243
|
natural: 'Natural',
|
|
7278
7244
|
pores: 'Pores',
|
|
7279
7245
|
freckles: 'Freckles',
|
|
@@ -7282,11 +7248,11 @@ var na,
|
|
|
7282
7248
|
glow: 'Glow',
|
|
7283
7249
|
unblur: 'Unblur',
|
|
7284
7250
|
}),
|
|
7285
|
-
(
|
|
7286
|
-
(Je =
|
|
7251
|
+
(ia = 'unblur'),
|
|
7252
|
+
(Je = ra.filter((e) => e !== ia)));
|
|
7287
7253
|
});
|
|
7288
7254
|
var ee,
|
|
7289
|
-
|
|
7255
|
+
ke,
|
|
7290
7256
|
Ye = y(() => {
|
|
7291
7257
|
'use strict';
|
|
7292
7258
|
((ee = [
|
|
@@ -7301,13 +7267,13 @@ var ee,
|
|
|
7301
7267
|
'wan-2-5-image',
|
|
7302
7268
|
'doppel',
|
|
7303
7269
|
]),
|
|
7304
|
-
(
|
|
7270
|
+
(ke =
|
|
7305
7271
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
7306
7272
|
});
|
|
7307
|
-
function
|
|
7308
|
-
return
|
|
7273
|
+
function aa(e) {
|
|
7274
|
+
return yr.includes(e);
|
|
7309
7275
|
}
|
|
7310
|
-
function
|
|
7276
|
+
function _e(e = process.env) {
|
|
7311
7277
|
let t = String(e.IMAGE_PRIORITY_MODELS ?? ''),
|
|
7312
7278
|
r = new Set(
|
|
7313
7279
|
t
|
|
@@ -7315,18 +7281,18 @@ function Pe(e = process.env) {
|
|
|
7315
7281
|
.map((i) => i.trim().toLowerCase())
|
|
7316
7282
|
.filter(Boolean),
|
|
7317
7283
|
);
|
|
7318
|
-
return
|
|
7284
|
+
return yr.filter((i) => r.has(i));
|
|
7319
7285
|
}
|
|
7320
|
-
function
|
|
7321
|
-
return
|
|
7286
|
+
function br(e, t = process.env) {
|
|
7287
|
+
return aa(e) && _e(t).includes(e);
|
|
7322
7288
|
}
|
|
7323
|
-
function
|
|
7289
|
+
function wr(e) {
|
|
7324
7290
|
return e === 'nano-banana-pro' ? 'Nano Banana Pro' : 'Nano Banana 2.1';
|
|
7325
7291
|
}
|
|
7326
|
-
var
|
|
7292
|
+
var yr,
|
|
7327
7293
|
Xe = y(() => {
|
|
7328
7294
|
'use strict';
|
|
7329
|
-
|
|
7295
|
+
yr = ['nano-banana-2.1', 'nano-banana-pro'];
|
|
7330
7296
|
});
|
|
7331
7297
|
function te(e) {
|
|
7332
7298
|
return `$${Number(e.toFixed(5))}`;
|
|
@@ -7349,18 +7315,18 @@ function it(e) {
|
|
|
7349
7315
|
}
|
|
7350
7316
|
return `from ${te(he(e).price.starter)}${e.unit}`;
|
|
7351
7317
|
}
|
|
7352
|
-
function
|
|
7318
|
+
function oa(e, t) {
|
|
7353
7319
|
let r = t.filter((i) => Number.isFinite(i) && i > 0);
|
|
7354
7320
|
return r.length ? `from ${te(Math.min(...r))}${e}` : null;
|
|
7355
7321
|
}
|
|
7356
7322
|
function Ir(e) {
|
|
7357
7323
|
for (let t of ce) {
|
|
7358
7324
|
let r = Y[t],
|
|
7359
|
-
i = r ?
|
|
7325
|
+
i = r ? oa(r.unit, e[t] ?? []) : null;
|
|
7360
7326
|
r && i && (r.priceFormatted = i);
|
|
7361
7327
|
}
|
|
7362
7328
|
}
|
|
7363
|
-
function
|
|
7329
|
+
function C(e, t) {
|
|
7364
7330
|
let r = e.axes?.resolution ?? [
|
|
7365
7331
|
...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
|
|
7366
7332
|
];
|
|
@@ -7378,7 +7344,7 @@ function vr(e) {
|
|
|
7378
7344
|
return {
|
|
7379
7345
|
name: 'endpoint',
|
|
7380
7346
|
type: 'select',
|
|
7381
|
-
default:
|
|
7347
|
+
default: Ne(e),
|
|
7382
7348
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
7383
7349
|
description:
|
|
7384
7350
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -7387,20 +7353,20 @@ function vr(e) {
|
|
|
7387
7353
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
7388
7354
|
};
|
|
7389
7355
|
}
|
|
7390
|
-
function
|
|
7356
|
+
function pa(e, t) {
|
|
7391
7357
|
if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
|
|
7392
7358
|
let r = ee.includes(e.api.model);
|
|
7393
|
-
return [...t.filter((i) => !
|
|
7359
|
+
return [...t.filter((i) => !Pe.has(i.name)), r ? nt : la];
|
|
7394
7360
|
}
|
|
7395
7361
|
function Qe(e, t) {
|
|
7396
|
-
let r = e.filter((n) => !
|
|
7362
|
+
let r = e.filter((n) => !Pe.has(n.name)),
|
|
7397
7363
|
i = [nt, Tr];
|
|
7398
7364
|
return (i.push(st, ot), [...r, ...i]);
|
|
7399
7365
|
}
|
|
7400
|
-
function
|
|
7366
|
+
function ma(e) {
|
|
7401
7367
|
return [
|
|
7402
7368
|
...e
|
|
7403
|
-
.filter((t) => !
|
|
7369
|
+
.filter((t) => !ca.has(t.name) && !Pe.has(t.name))
|
|
7404
7370
|
.map((t) => {
|
|
7405
7371
|
if (t.name === 'resolution')
|
|
7406
7372
|
return {
|
|
@@ -7414,7 +7380,7 @@ function ha(e) {
|
|
|
7414
7380
|
: {}),
|
|
7415
7381
|
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${re}`,
|
|
7416
7382
|
};
|
|
7417
|
-
let r =
|
|
7383
|
+
let r = ua[t.name];
|
|
7418
7384
|
return r && typeof t.description == 'string'
|
|
7419
7385
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
|
|
7420
7386
|
: t;
|
|
@@ -7435,7 +7401,7 @@ function Mr(e) {
|
|
|
7435
7401
|
function kr(e, t = {}) {
|
|
7436
7402
|
return [
|
|
7437
7403
|
...e
|
|
7438
|
-
.filter((r) => !
|
|
7404
|
+
.filter((r) => !da.has(r.name) && !Pe.has(r.name))
|
|
7439
7405
|
.map((r) =>
|
|
7440
7406
|
r.name === 'prompt'
|
|
7441
7407
|
? { ...r, required: !0 }
|
|
@@ -7472,7 +7438,7 @@ function Ze(e, t) {
|
|
|
7472
7438
|
max: t.maxSec,
|
|
7473
7439
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
7474
7440
|
},
|
|
7475
|
-
|
|
7441
|
+
C(e),
|
|
7476
7442
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
7477
7443
|
...t.references.map((r) =>
|
|
7478
7444
|
r.endsWith('s')
|
|
@@ -7489,12 +7455,12 @@ function Ze(e, t) {
|
|
|
7489
7455
|
),
|
|
7490
7456
|
];
|
|
7491
7457
|
}
|
|
7492
|
-
function
|
|
7458
|
+
function fa(e, t) {
|
|
7493
7459
|
return e.map((r) =>
|
|
7494
7460
|
t[r.name] ? { ...r, description: `${r.description ?? ''} ${t[r.name]}`.trim() } : r,
|
|
7495
7461
|
);
|
|
7496
7462
|
}
|
|
7497
|
-
function
|
|
7463
|
+
function ga(e) {
|
|
7498
7464
|
let t = vr(e);
|
|
7499
7465
|
return [
|
|
7500
7466
|
S('Image prompt text. Supports complex composition and text instructions.'),
|
|
@@ -7505,7 +7471,7 @@ function ba(e) {
|
|
|
7505
7471
|
default: 'low',
|
|
7506
7472
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
7507
7473
|
},
|
|
7508
|
-
|
|
7474
|
+
C(
|
|
7509
7475
|
e,
|
|
7510
7476
|
e.slug === 'gpt-image-2'
|
|
7511
7477
|
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${St}`
|
|
@@ -7562,7 +7528,7 @@ function ba(e) {
|
|
|
7562
7528
|
},
|
|
7563
7529
|
];
|
|
7564
7530
|
}
|
|
7565
|
-
function
|
|
7531
|
+
function ha(e) {
|
|
7566
7532
|
return [
|
|
7567
7533
|
S('Image prompt text.'),
|
|
7568
7534
|
{
|
|
@@ -7571,7 +7537,7 @@ function wa(e) {
|
|
|
7571
7537
|
description: 'Images to edit or use as reference (up to 14).',
|
|
7572
7538
|
},
|
|
7573
7539
|
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Wt(e.slug)] },
|
|
7574
|
-
|
|
7540
|
+
C(e),
|
|
7575
7541
|
{
|
|
7576
7542
|
name: 'n',
|
|
7577
7543
|
type: 'slider',
|
|
@@ -7596,7 +7562,7 @@ function wa(e) {
|
|
|
7596
7562
|
},
|
|
7597
7563
|
];
|
|
7598
7564
|
}
|
|
7599
|
-
function
|
|
7565
|
+
function xa() {
|
|
7600
7566
|
let e = Yt,
|
|
7601
7567
|
t = [];
|
|
7602
7568
|
for (let r of lt(!0))
|
|
@@ -7621,7 +7587,7 @@ function Pa() {
|
|
|
7621
7587
|
}));
|
|
7622
7588
|
return t;
|
|
7623
7589
|
}
|
|
7624
|
-
function
|
|
7590
|
+
function ka() {
|
|
7625
7591
|
return lt(!0).map((e) =>
|
|
7626
7592
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
7627
7593
|
);
|
|
@@ -7721,17 +7687,17 @@ function lt(e) {
|
|
|
7721
7687
|
},
|
|
7722
7688
|
];
|
|
7723
7689
|
}
|
|
7724
|
-
function
|
|
7725
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
7690
|
+
function _a(e) {
|
|
7691
|
+
if (e.slug === 'seed-2-1-turbo') return ba;
|
|
7726
7692
|
let t = vr(e);
|
|
7727
7693
|
return [
|
|
7728
7694
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
7729
|
-
?
|
|
7695
|
+
? xa()
|
|
7730
7696
|
: e.slug === 'gemini-3.7-flash'
|
|
7731
|
-
?
|
|
7732
|
-
: e.slug === 'gpt-6-astra' ||
|
|
7697
|
+
? ka()
|
|
7698
|
+
: e.slug === 'gpt-6-astra' || wa.includes(e.slug)
|
|
7733
7699
|
? lt(e.slug !== 'gpt-6-astra')
|
|
7734
|
-
:
|
|
7700
|
+
: ya),
|
|
7735
7701
|
...(t ? [t] : []),
|
|
7736
7702
|
];
|
|
7737
7703
|
}
|
|
@@ -7743,7 +7709,7 @@ function et() {
|
|
|
7743
7709
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
7744
7710
|
};
|
|
7745
7711
|
}
|
|
7746
|
-
function
|
|
7712
|
+
function Ia(e) {
|
|
7747
7713
|
return [
|
|
7748
7714
|
{
|
|
7749
7715
|
name: 'video_url',
|
|
@@ -7752,7 +7718,7 @@ function Ma(e) {
|
|
|
7752
7718
|
description:
|
|
7753
7719
|
'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
|
|
7754
7720
|
},
|
|
7755
|
-
|
|
7721
|
+
C(
|
|
7756
7722
|
e,
|
|
7757
7723
|
'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
|
|
7758
7724
|
),
|
|
@@ -7765,7 +7731,7 @@ function Ma(e) {
|
|
|
7765
7731
|
},
|
|
7766
7732
|
];
|
|
7767
7733
|
}
|
|
7768
|
-
function
|
|
7734
|
+
function va() {
|
|
7769
7735
|
return [
|
|
7770
7736
|
{
|
|
7771
7737
|
name: 'mode',
|
|
@@ -7836,15 +7802,15 @@ function Sa() {
|
|
|
7836
7802
|
},
|
|
7837
7803
|
];
|
|
7838
7804
|
}
|
|
7839
|
-
function
|
|
7805
|
+
function Ta(e) {
|
|
7840
7806
|
let t = e.slug;
|
|
7841
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
7842
|
-
if (me.some((i) => i.slug === t)) return
|
|
7843
|
-
if (e.kind === 'llm') return
|
|
7844
|
-
if (e.editVariants?.length) return
|
|
7845
|
-
let r =
|
|
7846
|
-
if (r) return
|
|
7847
|
-
if (Mr(t)) return
|
|
7807
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return va();
|
|
7808
|
+
if (me.some((i) => i.slug === t)) return Ia(e);
|
|
7809
|
+
if (e.kind === 'llm') return _a(e);
|
|
7810
|
+
if (e.editVariants?.length) return ga(e);
|
|
7811
|
+
let r = je(t);
|
|
7812
|
+
if (r) return lr(r);
|
|
7813
|
+
if (Mr(t)) return ma(tt);
|
|
7848
7814
|
switch (t) {
|
|
7849
7815
|
case 'seedance-2-5':
|
|
7850
7816
|
return Qe(tt, t);
|
|
@@ -7855,11 +7821,11 @@ function Ka(e) {
|
|
|
7855
7821
|
case 'seedance-2-lite':
|
|
7856
7822
|
return kr(_r);
|
|
7857
7823
|
case 'seedance-2-mini':
|
|
7858
|
-
return Qe(
|
|
7824
|
+
return Qe(Ma, t);
|
|
7859
7825
|
case 'nano-banana-2':
|
|
7860
7826
|
case 'nano-banana-2.1':
|
|
7861
7827
|
case 'nano-banana-pro':
|
|
7862
|
-
return
|
|
7828
|
+
return ha(e);
|
|
7863
7829
|
case 'seedream-5-pro':
|
|
7864
7830
|
return [
|
|
7865
7831
|
S('Detailed description of the image to generate.'),
|
|
@@ -7869,7 +7835,7 @@ function Ka(e) {
|
|
|
7869
7835
|
description:
|
|
7870
7836
|
'Reference images. The first is free; each one after it adds the extra reference image charge (see the price).',
|
|
7871
7837
|
},
|
|
7872
|
-
|
|
7838
|
+
C(e),
|
|
7873
7839
|
{
|
|
7874
7840
|
name: 'aspect_ratio',
|
|
7875
7841
|
type: 'select',
|
|
@@ -7888,7 +7854,7 @@ function Ka(e) {
|
|
|
7888
7854
|
description:
|
|
7889
7855
|
'Reference images to edit or combine (up to 16). Leave empty for text to image. Each reference image is billed.',
|
|
7890
7856
|
},
|
|
7891
|
-
{ ...
|
|
7857
|
+
{ ...C(e, '1K, 2K or 4K (about 16 megapixels).'), default: '2K' },
|
|
7892
7858
|
{
|
|
7893
7859
|
name: 'aspect_ratio',
|
|
7894
7860
|
type: 'select',
|
|
@@ -7936,7 +7902,7 @@ function Ka(e) {
|
|
|
7936
7902
|
description:
|
|
7937
7903
|
'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
|
|
7938
7904
|
},
|
|
7939
|
-
|
|
7905
|
+
C(
|
|
7940
7906
|
e,
|
|
7941
7907
|
'1K and 1.5K are one price, 2K the next, 4K (up to 3840x2160 or 2880x2880) the top. 4K needs an aspect_ratio other than adaptive, or exact pixels in size. layer_decomposition takes 1K, 1.5K, 2K or auto (keep the input size), billed at the 2K price.',
|
|
7942
7908
|
),
|
|
@@ -7988,7 +7954,7 @@ function Ka(e) {
|
|
|
7988
7954
|
type: 'string[]',
|
|
7989
7955
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
7990
7956
|
},
|
|
7991
|
-
|
|
7957
|
+
C(e),
|
|
7992
7958
|
{
|
|
7993
7959
|
name: 'aspect_ratio',
|
|
7994
7960
|
type: 'select',
|
|
@@ -8007,7 +7973,7 @@ function Ka(e) {
|
|
|
8007
7973
|
case 'z-image-pro':
|
|
8008
7974
|
return [
|
|
8009
7975
|
S('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
8010
|
-
|
|
7976
|
+
C(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
8011
7977
|
{
|
|
8012
7978
|
name: 'aspect_ratio',
|
|
8013
7979
|
type: 'select',
|
|
@@ -8137,7 +8103,7 @@ function Ka(e) {
|
|
|
8137
8103
|
max: 0.4,
|
|
8138
8104
|
description: 'Portrait depth. Heavy only.',
|
|
8139
8105
|
},
|
|
8140
|
-
...
|
|
8106
|
+
...Pa,
|
|
8141
8107
|
];
|
|
8142
8108
|
case 'enhancor-skin-fix-v3':
|
|
8143
8109
|
return [
|
|
@@ -8210,6 +8176,42 @@ function Ka(e) {
|
|
|
8210
8176
|
description: 'How many freckles. Needs enhancement_strength freckle.',
|
|
8211
8177
|
},
|
|
8212
8178
|
];
|
|
8179
|
+
case 'kling-motion-control':
|
|
8180
|
+
return [
|
|
8181
|
+
{
|
|
8182
|
+
name: 'image_url',
|
|
8183
|
+
type: 'string',
|
|
8184
|
+
required: !0,
|
|
8185
|
+
description: `The character to animate: one jpg or png, at least 300 px a side, aspect 1:2.5 to 2.5:1, with the head and upper or full body clearly visible. ${xr}`,
|
|
8186
|
+
},
|
|
8187
|
+
{
|
|
8188
|
+
name: 'video_url',
|
|
8189
|
+
type: 'string',
|
|
8190
|
+
required: !0,
|
|
8191
|
+
description: `The motion to copy: one mp4 or mov of a single person in one continuous take, 3 to 30 s (up to 10 s when character_orientation is image). Billed per second of this video, rounded up. ${xr}`,
|
|
8192
|
+
},
|
|
8193
|
+
{
|
|
8194
|
+
name: 'prompt',
|
|
8195
|
+
type: 'string',
|
|
8196
|
+
description:
|
|
8197
|
+
'Optional: what to add or change (clothing, scene, effects). Up to 2500 characters.',
|
|
8198
|
+
},
|
|
8199
|
+
{
|
|
8200
|
+
name: 'character_orientation',
|
|
8201
|
+
type: 'select',
|
|
8202
|
+
default: 'video',
|
|
8203
|
+
options: ['video', 'image'],
|
|
8204
|
+
description:
|
|
8205
|
+
'video: the character faces as in the reference video (better for complex motion, up to 30 s). image: as in the image (better for following camera moves, up to 10 s).',
|
|
8206
|
+
},
|
|
8207
|
+
C(e),
|
|
8208
|
+
{
|
|
8209
|
+
name: 'keep_original_sound',
|
|
8210
|
+
type: 'boolean',
|
|
8211
|
+
default: !0,
|
|
8212
|
+
description: "Keep the reference video's sound. Same price on or off.",
|
|
8213
|
+
},
|
|
8214
|
+
];
|
|
8213
8215
|
case 'wan-3-0':
|
|
8214
8216
|
case 'wan-3-0-prime':
|
|
8215
8217
|
return Ze(e, {
|
|
@@ -8260,7 +8262,7 @@ function Ka(e) {
|
|
|
8260
8262
|
description:
|
|
8261
8263
|
'Video length in seconds (3 to 15). With a last frame 3 to 10; for video_extend the seconds added (3 to 10). Not taken by video_edit, which bills the input video length.',
|
|
8262
8264
|
},
|
|
8263
|
-
{ ...
|
|
8265
|
+
{ ...C(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
|
|
8264
8266
|
{
|
|
8265
8267
|
name: 'aspect_ratio',
|
|
8266
8268
|
type: 'select',
|
|
@@ -8314,7 +8316,7 @@ function Ka(e) {
|
|
|
8314
8316
|
description: 'Video length in whole seconds: 4 to 15 at 720p, 4 to 30 at 1080p.',
|
|
8315
8317
|
},
|
|
8316
8318
|
{
|
|
8317
|
-
...
|
|
8319
|
+
...C(
|
|
8318
8320
|
e,
|
|
8319
8321
|
'Sound is the same price on or off. A 1080p run takes 5 to 15 minutes, sometimes longer.',
|
|
8320
8322
|
),
|
|
@@ -8364,7 +8366,7 @@ function Ka(e) {
|
|
|
8364
8366
|
},
|
|
8365
8367
|
];
|
|
8366
8368
|
case 'minimax-h3':
|
|
8367
|
-
return
|
|
8369
|
+
return fa(
|
|
8368
8370
|
Ze(e, {
|
|
8369
8371
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
8370
8372
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
@@ -8412,10 +8414,10 @@ function $r(e) {
|
|
|
8412
8414
|
description: `The photo to ${e}: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.`,
|
|
8413
8415
|
};
|
|
8414
8416
|
}
|
|
8415
|
-
function
|
|
8417
|
+
function Sa() {
|
|
8416
8418
|
return {
|
|
8417
|
-
slug:
|
|
8418
|
-
name:
|
|
8419
|
+
slug: we,
|
|
8420
|
+
name: dr,
|
|
8419
8421
|
category: 'Image',
|
|
8420
8422
|
kind: 'Image-to-Image',
|
|
8421
8423
|
vendor: 'Enhancor',
|
|
@@ -8430,7 +8432,7 @@ function $a() {
|
|
|
8430
8432
|
name: 'preset',
|
|
8431
8433
|
type: 'select',
|
|
8432
8434
|
options: [...Je],
|
|
8433
|
-
description: `Skin preset, run before the upscale: ${Je.map((e) => `${e} (${
|
|
8435
|
+
description: `Skin preset, run before the upscale: ${Je.map((e) => `${e} (${gr[e]})`).join(', ')}. Seedream 5.5 redraws the skin at about the photo's own size and shape, keeping the person, the background and any text; that picture is brought back to the photo's size and upscaled, so the output is still the photo times the scale. Priced at the skin rate. Leave it out for a plain upscale.`,
|
|
8434
8436
|
},
|
|
8435
8437
|
{
|
|
8436
8438
|
name: 'skin_fix',
|
|
@@ -8444,10 +8446,10 @@ function $a() {
|
|
|
8444
8446
|
],
|
|
8445
8447
|
};
|
|
8446
8448
|
}
|
|
8447
|
-
function
|
|
8449
|
+
function Ka() {
|
|
8448
8450
|
return {
|
|
8449
|
-
slug:
|
|
8450
|
-
name:
|
|
8451
|
+
slug: xe,
|
|
8452
|
+
name: cr,
|
|
8451
8453
|
category: 'Image',
|
|
8452
8454
|
kind: 'Image-to-Image',
|
|
8453
8455
|
vendor: 'Enhancor',
|
|
@@ -8464,18 +8466,18 @@ function rt(e, t = e.api.model) {
|
|
|
8464
8466
|
return {
|
|
8465
8467
|
slug: t,
|
|
8466
8468
|
name: e.name,
|
|
8467
|
-
category:
|
|
8468
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
8469
|
+
category: na[e.kind],
|
|
8470
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : sa[e.kind],
|
|
8469
8471
|
vendor: e.vendor ?? '',
|
|
8470
8472
|
description: e.desc ?? e.name,
|
|
8471
8473
|
priceFormatted: it(e),
|
|
8472
8474
|
...(r.length ? { priceNotes: r } : {}),
|
|
8473
8475
|
unit: e.unit,
|
|
8474
8476
|
primaryToolName: at[e.kind],
|
|
8475
|
-
parameters:
|
|
8477
|
+
parameters: pa(e, Ta(e)),
|
|
8476
8478
|
};
|
|
8477
8479
|
}
|
|
8478
|
-
function
|
|
8480
|
+
function Ea() {
|
|
8479
8481
|
let e = {};
|
|
8480
8482
|
for (let t of ge())
|
|
8481
8483
|
if (t.slug !== 'seedance-2-fast') {
|
|
@@ -8486,19 +8488,19 @@ function Aa() {
|
|
|
8486
8488
|
if (t.slug === 'seedance-2') {
|
|
8487
8489
|
let r = rt(t);
|
|
8488
8490
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
8489
|
-
(r.priceFormatted =
|
|
8491
|
+
(r.priceFormatted = $a(t)),
|
|
8490
8492
|
(e['seedance-2'] = r));
|
|
8491
8493
|
continue;
|
|
8492
8494
|
}
|
|
8493
8495
|
t.slug.startsWith('claude-') || (e[t.api.model] = rt(t));
|
|
8494
8496
|
}
|
|
8495
|
-
(Object.assign(e, rr()), (e[
|
|
8497
|
+
(Object.assign(e, rr()), (e[we] = Sa()), (e[xe] = Ka()));
|
|
8496
8498
|
for (let [t, r] of Object.entries(be))
|
|
8497
8499
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
8498
8500
|
return e;
|
|
8499
8501
|
}
|
|
8500
|
-
function
|
|
8501
|
-
let t =
|
|
8502
|
+
function $a(e = F('seedance-2')) {
|
|
8503
|
+
let t = F('seedance-2-fast'),
|
|
8502
8504
|
r = e ? it(e) : '';
|
|
8503
8505
|
if (!t) return r;
|
|
8504
8506
|
let i = `Fast ${it(t)}`;
|
|
@@ -8511,22 +8513,22 @@ function Rr(e) {
|
|
|
8511
8513
|
i && typeof r == 'string' && r.trim() && (i.priceFormatted = r.trim());
|
|
8512
8514
|
}
|
|
8513
8515
|
}
|
|
8514
|
-
function
|
|
8516
|
+
function Ie(e) {
|
|
8515
8517
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
8516
8518
|
}
|
|
8517
|
-
function
|
|
8519
|
+
function j(e) {
|
|
8518
8520
|
let t = Y[e];
|
|
8519
8521
|
return t ? Or(t) : null;
|
|
8520
8522
|
}
|
|
8521
8523
|
function Or(e) {
|
|
8522
|
-
return !
|
|
8524
|
+
return !br(e.slug) || e.parameters.some((t) => t.name === 'priority')
|
|
8523
8525
|
? e
|
|
8524
|
-
: { ...e, parameters: [...e.parameters,
|
|
8526
|
+
: { ...e, parameters: [...e.parameters, Ca] };
|
|
8525
8527
|
}
|
|
8526
|
-
function
|
|
8528
|
+
function Aa(e, t, r) {
|
|
8527
8529
|
if (
|
|
8528
8530
|
e.startsWith('enhancor-skin-fix-') ||
|
|
8529
|
-
|
|
8531
|
+
ur(e) ||
|
|
8530
8532
|
(e === 'gemini-omni-1.2-flash' && (t === 'aspect_ratio' || t === 'duration')) ||
|
|
8531
8533
|
(e === 'magi-2' &&
|
|
8532
8534
|
t === 'aspect_ratio' &&
|
|
@@ -8535,8 +8537,8 @@ function qa(e, t, r) {
|
|
|
8535
8537
|
)
|
|
8536
8538
|
return !1;
|
|
8537
8539
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Mr(e)) && t === 'duration') {
|
|
8538
|
-
let
|
|
8539
|
-
if (
|
|
8540
|
+
let i = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
8541
|
+
if (i(r.mode) === 'edit' || i(r.omni_reference_task_type) === 'edit') return !1;
|
|
8540
8542
|
}
|
|
8541
8543
|
if (
|
|
8542
8544
|
(t === 'max_tokens' && Pr(r.max_completion_tokens)) ||
|
|
@@ -8544,19 +8546,13 @@ function qa(e, t, r) {
|
|
|
8544
8546
|
)
|
|
8545
8547
|
return !1;
|
|
8546
8548
|
if (t === 'aspect_ratio') {
|
|
8547
|
-
let
|
|
8548
|
-
if (
|
|
8549
|
-
let
|
|
8550
|
-
|
|
8551
|
-
if (
|
|
8549
|
+
let i = je(e);
|
|
8550
|
+
if (i) {
|
|
8551
|
+
let n = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
|
|
8552
|
+
s = n ? n.replace(/-/g, '_') : i.modes[0];
|
|
8553
|
+
if (i.modes.includes(s) && !or(i, s)) return !1;
|
|
8552
8554
|
}
|
|
8553
8555
|
}
|
|
8554
|
-
let i = we(e);
|
|
8555
|
-
if (i) {
|
|
8556
|
-
let n = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
|
|
8557
|
-
s = n ? n.replace(/-/g, '_') : i.modes[0];
|
|
8558
|
-
if (i.modes.includes(s) && !lr(i, s, t)) return !1;
|
|
8559
|
-
}
|
|
8560
8556
|
return !0;
|
|
8561
8557
|
}
|
|
8562
8558
|
function Pr(e) {
|
|
@@ -8566,80 +8562,83 @@ function qr(e, t) {
|
|
|
8566
8562
|
let r = { ...t };
|
|
8567
8563
|
if (e?.slug === 'seedance-2-5') {
|
|
8568
8564
|
let i = (n) => typeof n != 'string' || !n.trim();
|
|
8569
|
-
for (let n of
|
|
8565
|
+
for (let n of Ra) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
|
|
8570
8566
|
if (!i(r.finalize)) return r;
|
|
8571
8567
|
}
|
|
8572
8568
|
for (let i of e?.parameters ?? [])
|
|
8573
8569
|
i.default !== void 0 &&
|
|
8574
8570
|
r[i.name] === void 0 &&
|
|
8575
|
-
|
|
8571
|
+
Aa(e.slug, i.name, t) &&
|
|
8576
8572
|
(r[i.name] = i.default);
|
|
8577
8573
|
return r;
|
|
8578
8574
|
}
|
|
8579
|
-
function
|
|
8575
|
+
function D() {
|
|
8580
8576
|
return Object.values(Y).map(Or);
|
|
8581
8577
|
}
|
|
8582
|
-
var
|
|
8578
|
+
var na,
|
|
8583
8579
|
at,
|
|
8584
|
-
|
|
8580
|
+
sa,
|
|
8581
|
+
xr,
|
|
8585
8582
|
S,
|
|
8586
8583
|
nt,
|
|
8587
|
-
|
|
8584
|
+
la,
|
|
8588
8585
|
Tr,
|
|
8589
8586
|
st,
|
|
8590
8587
|
ot,
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8588
|
+
Pe,
|
|
8589
|
+
da,
|
|
8590
|
+
ca,
|
|
8591
|
+
ua,
|
|
8592
|
+
ya,
|
|
8593
|
+
ba,
|
|
8594
|
+
wa,
|
|
8595
|
+
Pa,
|
|
8599
8596
|
re,
|
|
8600
8597
|
tt,
|
|
8601
8598
|
Sr,
|
|
8602
8599
|
Kr,
|
|
8603
8600
|
_r,
|
|
8604
|
-
|
|
8601
|
+
Ma,
|
|
8605
8602
|
Cr,
|
|
8606
8603
|
Ar,
|
|
8607
8604
|
Y,
|
|
8608
|
-
|
|
8609
|
-
|
|
8605
|
+
Ca,
|
|
8606
|
+
Ra,
|
|
8610
8607
|
ie = y(() => {
|
|
8611
8608
|
'use strict';
|
|
8612
8609
|
Kt();
|
|
8613
|
-
|
|
8614
|
-
|
|
8610
|
+
Ae();
|
|
8611
|
+
B();
|
|
8615
8612
|
Ue();
|
|
8616
8613
|
jt();
|
|
8617
|
-
|
|
8618
|
-
|
|
8614
|
+
Re();
|
|
8615
|
+
Fe();
|
|
8619
8616
|
zt();
|
|
8620
8617
|
Jt();
|
|
8621
8618
|
Xt();
|
|
8622
8619
|
ir();
|
|
8623
8620
|
ze();
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8621
|
+
pr();
|
|
8622
|
+
fr();
|
|
8623
|
+
hr();
|
|
8627
8624
|
Ye();
|
|
8628
8625
|
Xe();
|
|
8629
|
-
((
|
|
8626
|
+
((na = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
8630
8627
|
(at = {
|
|
8631
8628
|
video: 'generate_video',
|
|
8632
8629
|
image: 'generate_image',
|
|
8633
8630
|
audio: 'generate_audio',
|
|
8634
8631
|
llm: 'run_task',
|
|
8635
8632
|
}),
|
|
8636
|
-
(
|
|
8633
|
+
(sa = {
|
|
8637
8634
|
video: 'Text-to-Video',
|
|
8638
8635
|
image: 'Text-to-Image',
|
|
8639
8636
|
audio: 'Text-to-Audio',
|
|
8640
8637
|
llm: 'Reasoning (LLM)',
|
|
8641
8638
|
}));
|
|
8642
|
-
|
|
8639
|
+
((xr =
|
|
8640
|
+
'A public http(s) URL or data URI. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
|
|
8641
|
+
(S = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e })));
|
|
8643
8642
|
((nt = {
|
|
8644
8643
|
name: 'creative_mode',
|
|
8645
8644
|
type: 'boolean',
|
|
@@ -8647,11 +8646,11 @@ var la,
|
|
|
8647
8646
|
description:
|
|
8648
8647
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
8649
8648
|
}),
|
|
8650
|
-
(
|
|
8649
|
+
(la = {
|
|
8651
8650
|
name: 'creative_mode',
|
|
8652
8651
|
type: 'boolean',
|
|
8653
8652
|
default: !1,
|
|
8654
|
-
description: `Not available yet on this model: ${
|
|
8653
|
+
description: `Not available yet on this model: ${ke}.`,
|
|
8655
8654
|
}),
|
|
8656
8655
|
(Tr = {
|
|
8657
8656
|
name: 'priority',
|
|
@@ -8670,8 +8669,8 @@ var la,
|
|
|
8670
8669
|
description:
|
|
8671
8670
|
'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.',
|
|
8672
8671
|
}),
|
|
8673
|
-
(
|
|
8674
|
-
((
|
|
8672
|
+
(Pe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
8673
|
+
((da = new Set([
|
|
8675
8674
|
'quality',
|
|
8676
8675
|
'bitrate_mode',
|
|
8677
8676
|
'draft',
|
|
@@ -8680,7 +8679,7 @@ var la,
|
|
|
8680
8679
|
'draft_generation_id',
|
|
8681
8680
|
'pass_faces',
|
|
8682
8681
|
])),
|
|
8683
|
-
(
|
|
8682
|
+
(ca = new Set([
|
|
8684
8683
|
'quality',
|
|
8685
8684
|
'bitrate_mode',
|
|
8686
8685
|
'draft',
|
|
@@ -8688,12 +8687,12 @@ var la,
|
|
|
8688
8687
|
'draft_task_id',
|
|
8689
8688
|
'draft_generation_id',
|
|
8690
8689
|
])),
|
|
8691
|
-
(
|
|
8690
|
+
(ua = {
|
|
8692
8691
|
images: 'up to 10',
|
|
8693
8692
|
videos: 'up to 5; combined duration < 30s',
|
|
8694
8693
|
audios: 'up to 5; combined duration < 30s',
|
|
8695
8694
|
}));
|
|
8696
|
-
((
|
|
8695
|
+
((ya = [
|
|
8697
8696
|
S('The user message or task.'),
|
|
8698
8697
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8699
8698
|
{
|
|
@@ -8711,7 +8710,7 @@ var la,
|
|
|
8711
8710
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
8712
8711
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
8713
8712
|
]),
|
|
8714
|
-
(
|
|
8713
|
+
(ba = [
|
|
8715
8714
|
S('The user message or task.'),
|
|
8716
8715
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
8717
8716
|
{
|
|
@@ -8793,8 +8792,8 @@ var la,
|
|
|
8793
8792
|
description: 'Video frames read a second.',
|
|
8794
8793
|
},
|
|
8795
8794
|
]),
|
|
8796
|
-
(
|
|
8797
|
-
|
|
8795
|
+
(wa = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8796
|
+
Pa = Object.entries({
|
|
8798
8797
|
background: !1,
|
|
8799
8798
|
skin: !1,
|
|
8800
8799
|
nose: !1,
|
|
@@ -9082,7 +9081,7 @@ var la,
|
|
|
9082
9081
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
9083
9082
|
},
|
|
9084
9083
|
]),
|
|
9085
|
-
(
|
|
9084
|
+
(Ma = [
|
|
9086
9085
|
{
|
|
9087
9086
|
name: 'prompt',
|
|
9088
9087
|
type: 'string',
|
|
@@ -9164,21 +9163,21 @@ var la,
|
|
|
9164
9163
|
(Ar = {
|
|
9165
9164
|
name: 'scale',
|
|
9166
9165
|
type: 'select',
|
|
9167
|
-
default: String(
|
|
9166
|
+
default: String(mr),
|
|
9168
9167
|
options: We.noSkin.map(String),
|
|
9169
9168
|
description: `Full only: ${We.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
|
|
9170
9169
|
}));
|
|
9171
|
-
Y =
|
|
9172
|
-
|
|
9170
|
+
Y = Ea();
|
|
9171
|
+
Ca = {
|
|
9173
9172
|
name: 'priority',
|
|
9174
9173
|
type: 'boolean',
|
|
9175
9174
|
default: !1,
|
|
9176
9175
|
description:
|
|
9177
9176
|
"Sent straight to Google's own API, skipping the shared queue, at Google's price + 10% (per output image and per input image, the same on every plan). If Google can not serve it, the request fails and nothing is charged.",
|
|
9178
9177
|
};
|
|
9179
|
-
|
|
9178
|
+
Ra = ['draft_task_id', 'draft_generation_id'];
|
|
9180
9179
|
});
|
|
9181
|
-
function
|
|
9180
|
+
function ve(e) {
|
|
9182
9181
|
let t = '/v1/pricing/models',
|
|
9183
9182
|
r = e?.trim();
|
|
9184
9183
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
@@ -9197,18 +9196,18 @@ function ii(e) {
|
|
|
9197
9196
|
...(r.length
|
|
9198
9197
|
? [`${ht(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
9199
9198
|
: []),
|
|
9200
|
-
...(i.length ? [`Not available yet on ${ht(i)}: ${
|
|
9199
|
+
...(i.length ? [`Not available yet on ${ht(i)}: ${ke}.`] : []),
|
|
9201
9200
|
'The Acceptable Use Policy applies.',
|
|
9202
9201
|
].join(' ');
|
|
9203
9202
|
}
|
|
9204
|
-
function
|
|
9205
|
-
if (
|
|
9203
|
+
function mn(e) {
|
|
9204
|
+
if (ln.has(e.name)) return e;
|
|
9206
9205
|
let t = e.inputSchema.properties;
|
|
9207
9206
|
return !t || t.callback_url
|
|
9208
9207
|
? e
|
|
9209
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
9208
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: on } } };
|
|
9210
9209
|
}
|
|
9211
|
-
function
|
|
9210
|
+
function fn(e) {
|
|
9212
9211
|
let t = e.inputSchema.properties;
|
|
9213
9212
|
if (!t) return e;
|
|
9214
9213
|
let r = !1,
|
|
@@ -9221,7 +9220,7 @@ function yn(e) {
|
|
|
9221
9220
|
: (i[n] = s);
|
|
9222
9221
|
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
|
|
9223
9222
|
}
|
|
9224
|
-
function
|
|
9223
|
+
function gn(e) {
|
|
9225
9224
|
switch (e.type) {
|
|
9226
9225
|
case 'string':
|
|
9227
9226
|
return {
|
|
@@ -9276,11 +9275,11 @@ function bn(e) {
|
|
|
9276
9275
|
return { type: 'string', description: e.description };
|
|
9277
9276
|
}
|
|
9278
9277
|
}
|
|
9279
|
-
function
|
|
9278
|
+
function hn(e, t) {
|
|
9280
9279
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
9281
9280
|
i = {},
|
|
9282
9281
|
n = [];
|
|
9283
|
-
for (let o of e.parameters) ((i[o.name] =
|
|
9282
|
+
for (let o of e.parameters) ((i[o.name] = gn(o)), o.required && n.push(o.name));
|
|
9284
9283
|
let s = {
|
|
9285
9284
|
type: 'object',
|
|
9286
9285
|
properties: i,
|
|
@@ -9293,11 +9292,11 @@ function wn(e, t) {
|
|
|
9293
9292
|
inputSchema: s,
|
|
9294
9293
|
};
|
|
9295
9294
|
}
|
|
9296
|
-
function
|
|
9297
|
-
let e =
|
|
9298
|
-
t =
|
|
9299
|
-
r =
|
|
9300
|
-
i =
|
|
9295
|
+
function yn() {
|
|
9296
|
+
let e = D().filter((u) => u.category === 'Image' && !Ie(u)),
|
|
9297
|
+
t = D().filter((u) => u.category === 'Video'),
|
|
9298
|
+
r = D().filter((u) => u.category === 'Text'),
|
|
9299
|
+
i = D().filter((u) => u.category === 'Audio'),
|
|
9301
9300
|
n = {
|
|
9302
9301
|
name: 'generate_image',
|
|
9303
9302
|
description:
|
|
@@ -9385,11 +9384,11 @@ function xn() {
|
|
|
9385
9384
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
9386
9385
|
},
|
|
9387
9386
|
creative_mode: { type: 'boolean', description: ii('image') },
|
|
9388
|
-
...(
|
|
9387
|
+
...(_e().length
|
|
9389
9388
|
? {
|
|
9390
9389
|
priority: {
|
|
9391
9390
|
type: 'boolean',
|
|
9392
|
-
description: `${ht(
|
|
9391
|
+
description: `${ht(_e().map(wr))} only: sent straight to Google's own API, skipping the shared queue, at Google's price + 10% (per output image and per input image, the same on every plan). If Google can not serve it, the request fails and nothing is charged.`,
|
|
9393
9392
|
},
|
|
9394
9393
|
}
|
|
9395
9394
|
: {}),
|
|
@@ -9565,10 +9564,10 @@ function xn() {
|
|
|
9565
9564
|
additionalProperties: !0,
|
|
9566
9565
|
},
|
|
9567
9566
|
},
|
|
9568
|
-
d =
|
|
9569
|
-
return [n, s, o, p, l, d, c,
|
|
9567
|
+
d = bn();
|
|
9568
|
+
return [n, s, o, p, l, d, c, pn, ...ni];
|
|
9570
9569
|
}
|
|
9571
|
-
function
|
|
9570
|
+
function bn() {
|
|
9572
9571
|
return {
|
|
9573
9572
|
name: 'upload_asset',
|
|
9574
9573
|
description:
|
|
@@ -9616,31 +9615,31 @@ function kn() {
|
|
|
9616
9615
|
};
|
|
9617
9616
|
}
|
|
9618
9617
|
function yt() {
|
|
9619
|
-
let e =
|
|
9620
|
-
t =
|
|
9621
|
-
return [...e, ...t].map(
|
|
9622
|
-
}
|
|
9623
|
-
var
|
|
9618
|
+
let e = yn(),
|
|
9619
|
+
t = D().map((r) => hn(r));
|
|
9620
|
+
return [...e, ...t].map(mn).map(fn);
|
|
9621
|
+
}
|
|
9622
|
+
var on,
|
|
9623
|
+
ln,
|
|
9624
|
+
pn,
|
|
9625
|
+
dn,
|
|
9624
9626
|
cn,
|
|
9625
9627
|
un,
|
|
9626
|
-
mn,
|
|
9627
|
-
fn,
|
|
9628
|
-
gn,
|
|
9629
9628
|
ni,
|
|
9630
|
-
|
|
9629
|
+
Eo,
|
|
9631
9630
|
ai,
|
|
9632
9631
|
si = y(() => {
|
|
9633
9632
|
'use strict';
|
|
9634
|
-
|
|
9633
|
+
B();
|
|
9635
9634
|
Xe();
|
|
9636
9635
|
Ye();
|
|
9637
9636
|
ie();
|
|
9638
|
-
((
|
|
9637
|
+
((on = {
|
|
9639
9638
|
type: 'string',
|
|
9640
9639
|
description:
|
|
9641
9640
|
'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.',
|
|
9642
9641
|
}),
|
|
9643
|
-
(
|
|
9642
|
+
(ln = new Set([
|
|
9644
9643
|
'upload_asset',
|
|
9645
9644
|
'upload_media',
|
|
9646
9645
|
'upload_image',
|
|
@@ -9651,7 +9650,7 @@ var dn,
|
|
|
9651
9650
|
'get_usage',
|
|
9652
9651
|
'get_balance_history',
|
|
9653
9652
|
])),
|
|
9654
|
-
(
|
|
9653
|
+
(pn = {
|
|
9655
9654
|
name: 'get_pricing',
|
|
9656
9655
|
description:
|
|
9657
9656
|
'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. price_texts has the current "from" price of each model. No API key is required; with one, your_prices lists the prices your workspace pays (Your price) next to the published price of each row on its price list. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
|
|
@@ -9666,13 +9665,13 @@ var dn,
|
|
|
9666
9665
|
additionalProperties: !1,
|
|
9667
9666
|
},
|
|
9668
9667
|
}),
|
|
9669
|
-
(
|
|
9668
|
+
(dn = {
|
|
9670
9669
|
name: 'get_balance',
|
|
9671
9670
|
description:
|
|
9672
9671
|
"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.",
|
|
9673
9672
|
inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
|
|
9674
9673
|
}),
|
|
9675
|
-
(
|
|
9674
|
+
(cn = {
|
|
9676
9675
|
name: 'get_usage',
|
|
9677
9676
|
description:
|
|
9678
9677
|
"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.",
|
|
@@ -9703,7 +9702,7 @@ var dn,
|
|
|
9703
9702
|
additionalProperties: !1,
|
|
9704
9703
|
},
|
|
9705
9704
|
}),
|
|
9706
|
-
(
|
|
9705
|
+
(un = {
|
|
9707
9706
|
name: 'get_balance_history',
|
|
9708
9707
|
description:
|
|
9709
9708
|
"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.",
|
|
@@ -9721,8 +9720,8 @@ var dn,
|
|
|
9721
9720
|
additionalProperties: !1,
|
|
9722
9721
|
},
|
|
9723
9722
|
}),
|
|
9724
|
-
(ni = [
|
|
9725
|
-
(
|
|
9723
|
+
(ni = [dn, cn, un]),
|
|
9724
|
+
(Eo = new Set(ni.map((e) => e.name))));
|
|
9726
9725
|
ai = new Set([
|
|
9727
9726
|
'image',
|
|
9728
9727
|
'images',
|
|
@@ -9742,12 +9741,12 @@ var dn,
|
|
|
9742
9741
|
});
|
|
9743
9742
|
var hi = {};
|
|
9744
9743
|
Ii(hi, {
|
|
9745
|
-
forgetToolSchemas: () =>
|
|
9744
|
+
forgetToolSchemas: () => Pn,
|
|
9746
9745
|
jsonRpcAnswer: () => di,
|
|
9747
9746
|
preprocessLocalFiles: () => fi,
|
|
9748
9747
|
startStdioServer: () => gi,
|
|
9749
9748
|
});
|
|
9750
|
-
function
|
|
9749
|
+
function wn(e) {
|
|
9751
9750
|
let t = (r) =>
|
|
9752
9751
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
9753
9752
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
@@ -9761,7 +9760,7 @@ function di(e, t, r) {
|
|
|
9761
9760
|
} catch {
|
|
9762
9761
|
s = null;
|
|
9763
9762
|
}
|
|
9764
|
-
if (s !== null &&
|
|
9763
|
+
if (s !== null && wn(s)) return n ? null : s;
|
|
9765
9764
|
if (n) return null;
|
|
9766
9765
|
if (!r && t >= 200 && t < 300) return;
|
|
9767
9766
|
let o = s?.error,
|
|
@@ -9782,16 +9781,16 @@ function di(e, t, r) {
|
|
|
9782
9781
|
},
|
|
9783
9782
|
};
|
|
9784
9783
|
}
|
|
9785
|
-
function
|
|
9784
|
+
function xn() {
|
|
9786
9785
|
let e = process.argv.slice(2),
|
|
9787
9786
|
t = e.indexOf('--api-key');
|
|
9788
9787
|
return _(t >= 0 ? e[t + 1] : void 0);
|
|
9789
9788
|
}
|
|
9790
9789
|
async function ci(e, t, r) {
|
|
9791
9790
|
let i = Q.default.resolve(e);
|
|
9792
|
-
if (!
|
|
9791
|
+
if (!N.default.existsSync(i) || !N.default.statSync(i).isFile())
|
|
9793
9792
|
throw new Error(`File not found: ${e}`);
|
|
9794
|
-
let n =
|
|
9793
|
+
let n = N.default.readFileSync(i),
|
|
9795
9794
|
s = n.toString('base64'),
|
|
9796
9795
|
o = n.length,
|
|
9797
9796
|
p = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
@@ -9817,14 +9816,14 @@ async function ci(e, t, r) {
|
|
|
9817
9816
|
};
|
|
9818
9817
|
}
|
|
9819
9818
|
function ui(e) {
|
|
9820
|
-
return
|
|
9819
|
+
return kn.has(Q.default.extname(e).toLowerCase());
|
|
9821
9820
|
}
|
|
9822
9821
|
function mi(e) {
|
|
9823
9822
|
return new Error(
|
|
9824
9823
|
`Tein uploads image, video and audio files only, and ${Q.default.basename(e)} is not one.`,
|
|
9825
9824
|
);
|
|
9826
9825
|
}
|
|
9827
|
-
function
|
|
9826
|
+
function _n(e) {
|
|
9828
9827
|
let t = e.trim();
|
|
9829
9828
|
if (
|
|
9830
9829
|
!t ||
|
|
@@ -9835,7 +9834,7 @@ function vn(e) {
|
|
|
9835
9834
|
)
|
|
9836
9835
|
return null;
|
|
9837
9836
|
let r = Q.default.resolve(t);
|
|
9838
|
-
return
|
|
9837
|
+
return N.default.existsSync(r) && N.default.statSync(r).isFile() ? r : null;
|
|
9839
9838
|
}
|
|
9840
9839
|
function wt(e) {
|
|
9841
9840
|
if (Array.isArray(e))
|
|
@@ -9847,10 +9846,10 @@ function wt(e) {
|
|
|
9847
9846
|
se.set(r.name, r.inputSchema);
|
|
9848
9847
|
}
|
|
9849
9848
|
}
|
|
9850
|
-
function
|
|
9849
|
+
function Pn() {
|
|
9851
9850
|
(se.clear(), (bt = 0));
|
|
9852
9851
|
}
|
|
9853
|
-
async function
|
|
9852
|
+
async function In(e, t) {
|
|
9854
9853
|
if (!(Date.now() - bt < 6e4)) {
|
|
9855
9854
|
bt = Date.now();
|
|
9856
9855
|
try {
|
|
@@ -9866,7 +9865,7 @@ async function Mn(e, t) {
|
|
|
9866
9865
|
} catch {}
|
|
9867
9866
|
}
|
|
9868
9867
|
}
|
|
9869
|
-
function
|
|
9868
|
+
function vn(e) {
|
|
9870
9869
|
return e
|
|
9871
9870
|
? e.type === 'string'
|
|
9872
9871
|
? e.format === 'uri'
|
|
@@ -9875,18 +9874,18 @@ function Sn(e) {
|
|
|
9875
9874
|
}
|
|
9876
9875
|
async function oi(e, t, r) {
|
|
9877
9876
|
if (typeof e != 'string') return e;
|
|
9878
|
-
let i =
|
|
9877
|
+
let i = _n(e);
|
|
9879
9878
|
if (!i) return e;
|
|
9880
9879
|
if (!ui(i)) throw mi(i);
|
|
9881
9880
|
return (await ci(i, t, r)).url;
|
|
9882
9881
|
}
|
|
9883
9882
|
async function fi(e, t, r, i, n) {
|
|
9884
|
-
(se.size === 0 && wt(yt()), se.has(e) || (await
|
|
9883
|
+
(se.size === 0 && wt(yt()), se.has(e) || (await In(n, r)));
|
|
9885
9884
|
let s = se.get(e)?.properties;
|
|
9886
9885
|
if (!s) return t;
|
|
9887
9886
|
let o = { ...t };
|
|
9888
9887
|
for (let [p, l] of Object.entries(t))
|
|
9889
|
-
if (
|
|
9888
|
+
if (vn(s[p]))
|
|
9890
9889
|
if (Array.isArray(l)) {
|
|
9891
9890
|
let c = [];
|
|
9892
9891
|
for (let d of l) c.push(await oi(d, r, i));
|
|
@@ -9894,7 +9893,7 @@ async function fi(e, t, r, i, n) {
|
|
|
9894
9893
|
} else o[p] = await oi(l, r, i);
|
|
9895
9894
|
return o;
|
|
9896
9895
|
}
|
|
9897
|
-
function
|
|
9896
|
+
function Tn(e) {
|
|
9898
9897
|
let t = e.id ?? null;
|
|
9899
9898
|
switch (e.method) {
|
|
9900
9899
|
case 'initialize':
|
|
@@ -9904,7 +9903,7 @@ function Kn(e) {
|
|
|
9904
9903
|
result: {
|
|
9905
9904
|
protocolVersion: '2024-11-05',
|
|
9906
9905
|
capabilities: { tools: { listChanged: !1 } },
|
|
9907
|
-
serverInfo: { name: 'tein-mcp', version:
|
|
9906
|
+
serverInfo: { name: 'tein-mcp', version: H },
|
|
9908
9907
|
},
|
|
9909
9908
|
};
|
|
9910
9909
|
case 'notifications/initialized':
|
|
@@ -9938,7 +9937,7 @@ function Kn(e) {
|
|
|
9938
9937
|
async function gi() {
|
|
9939
9938
|
if (li) return;
|
|
9940
9939
|
li = !0;
|
|
9941
|
-
let e =
|
|
9940
|
+
let e = xn(),
|
|
9942
9941
|
t = x(),
|
|
9943
9942
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
9944
9943
|
(pi.default
|
|
@@ -9953,7 +9952,7 @@ async function gi() {
|
|
|
9953
9952
|
c = o.params.arguments || {};
|
|
9954
9953
|
if (l === 'get_pricing') {
|
|
9955
9954
|
let d = typeof c.model == 'string' ? c.model.trim() : '',
|
|
9956
|
-
u = `${t.replace(/\/+$/, '')}${
|
|
9955
|
+
u = `${t.replace(/\/+$/, '')}${ve(d)}`;
|
|
9957
9956
|
try {
|
|
9958
9957
|
let m = await fetch(u, {
|
|
9959
9958
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -10004,11 +10003,11 @@ async function gi() {
|
|
|
10004
10003
|
)
|
|
10005
10004
|
try {
|
|
10006
10005
|
let u = Q.default.resolve(d.trim());
|
|
10007
|
-
if (
|
|
10006
|
+
if (N.default.existsSync(u) && N.default.statSync(u).isFile() && e) {
|
|
10008
10007
|
if (!ui(u)) throw mi(u);
|
|
10009
10008
|
let m = await ci(u, e, t),
|
|
10010
10009
|
g = (m.sizeBytes / 1024).toFixed(1),
|
|
10011
|
-
|
|
10010
|
+
A =
|
|
10012
10011
|
m.mimeType.startsWith('image/') ||
|
|
10013
10012
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
10014
10013
|
? `
|
|
@@ -10026,7 +10025,7 @@ async function gi() {
|
|
|
10026
10025
|
|
|
10027
10026
|
- **URL:** ${m.url}
|
|
10028
10027
|
- **Type:** \`${m.mimeType}\`
|
|
10029
|
-
- **Size:** ${g} KB${
|
|
10028
|
+
- **Size:** ${g} KB${A}
|
|
10030
10029
|
|
|
10031
10030
|
Pass this URL to any Tein generation tool.`,
|
|
10032
10031
|
},
|
|
@@ -10105,7 +10104,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
10105
10104
|
return;
|
|
10106
10105
|
}
|
|
10107
10106
|
} catch {}
|
|
10108
|
-
let p =
|
|
10107
|
+
let p = Tn(o);
|
|
10109
10108
|
p !== null &&
|
|
10110
10109
|
process.stdout.write(
|
|
10111
10110
|
JSON.stringify(p) +
|
|
@@ -10128,23 +10127,23 @@ Pass this URL to any Tein generation tool.`,
|
|
|
10128
10127
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
10129
10128
|
`));
|
|
10130
10129
|
}
|
|
10131
|
-
var
|
|
10130
|
+
var N,
|
|
10132
10131
|
Q,
|
|
10133
10132
|
pi,
|
|
10134
|
-
|
|
10133
|
+
kn,
|
|
10135
10134
|
se,
|
|
10136
10135
|
bt,
|
|
10137
10136
|
li,
|
|
10138
10137
|
yi = y(() => {
|
|
10139
10138
|
'use strict';
|
|
10140
|
-
((
|
|
10139
|
+
((N = M(require('node:fs'))),
|
|
10141
10140
|
(Q = M(require('node:path'))),
|
|
10142
10141
|
(pi = M(require('node:readline'))));
|
|
10143
10142
|
ct();
|
|
10144
10143
|
si();
|
|
10145
10144
|
R();
|
|
10146
10145
|
oe();
|
|
10147
|
-
|
|
10146
|
+
kn = new Set([
|
|
10148
10147
|
'.png',
|
|
10149
10148
|
'.jpg',
|
|
10150
10149
|
'.jpeg',
|
|
@@ -10267,7 +10266,7 @@ var a = {
|
|
|
10267
10266
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
10268
10267
|
}
|
|
10269
10268
|
};
|
|
10270
|
-
var
|
|
10269
|
+
var G = M(require('node:fs')),
|
|
10271
10270
|
O = M(require('node:path'));
|
|
10272
10271
|
var le = M(require('node:fs')),
|
|
10273
10272
|
It = M(require('node:path')),
|
|
@@ -10344,7 +10343,7 @@ var K = class {
|
|
|
10344
10343
|
return {
|
|
10345
10344
|
'Content-Type': 'application/json',
|
|
10346
10345
|
Authorization: `Bearer ${this.apiKey}`,
|
|
10347
|
-
'User-Agent': `Tein-CLI/${
|
|
10346
|
+
'User-Agent': `Tein-CLI/${H}`,
|
|
10348
10347
|
'X-Tein-Client': 'cli',
|
|
10349
10348
|
};
|
|
10350
10349
|
}
|
|
@@ -10427,7 +10426,7 @@ var K = class {
|
|
|
10427
10426
|
}
|
|
10428
10427
|
};
|
|
10429
10428
|
R();
|
|
10430
|
-
function
|
|
10429
|
+
function Ce(e) {
|
|
10431
10430
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
10432
10431
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
10433
10432
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -10437,28 +10436,28 @@ function Ae(e) {
|
|
|
10437
10436
|
}
|
|
10438
10437
|
ie();
|
|
10439
10438
|
var Lr = ['images', 'input_images', 'videos', 'audios'];
|
|
10440
|
-
function
|
|
10439
|
+
function Oa(e) {
|
|
10441
10440
|
for (let t of Lr) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
10442
10441
|
}
|
|
10443
|
-
function
|
|
10442
|
+
function qa(e) {
|
|
10444
10443
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
10445
10444
|
let t = O.default.resolve(e);
|
|
10446
|
-
return
|
|
10445
|
+
return G.default.existsSync(t) && G.default.statSync(t).isFile() ? t : null;
|
|
10447
10446
|
}
|
|
10448
|
-
async function
|
|
10447
|
+
async function La(e, t) {
|
|
10449
10448
|
for (let r of Lr) {
|
|
10450
10449
|
if (!Array.isArray(e[r])) continue;
|
|
10451
10450
|
let i = [];
|
|
10452
10451
|
for (let n of e[r]) {
|
|
10453
10452
|
if (typeof n != 'string') continue;
|
|
10454
|
-
let s =
|
|
10453
|
+
let s = qa(n);
|
|
10455
10454
|
i.push(s ? await t(s) : n);
|
|
10456
10455
|
}
|
|
10457
10456
|
e[r] = i;
|
|
10458
10457
|
}
|
|
10459
10458
|
}
|
|
10460
10459
|
var ae = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
10461
|
-
function
|
|
10460
|
+
function Da(e) {
|
|
10462
10461
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
10463
10462
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
10464
10463
|
r = ae.enterprise;
|
|
@@ -10471,7 +10470,7 @@ function Ua(e) {
|
|
|
10471
10470
|
t
|
|
10472
10471
|
);
|
|
10473
10472
|
}
|
|
10474
|
-
async function
|
|
10473
|
+
async function Na(e, t, r, i, n) {
|
|
10475
10474
|
n.isJson ||
|
|
10476
10475
|
process.stderr.write(`Starting ${i} ${t} jobs together...
|
|
10477
10476
|
`);
|
|
@@ -10534,7 +10533,7 @@ async function Fa(e, t, r, i, n) {
|
|
|
10534
10533
|
for (let l of o) {
|
|
10535
10534
|
if ((process.stdout.write(`${l.request_id} ${l.status}`), l.usage?.cost !== void 0)) {
|
|
10536
10535
|
let c = l.usage.estimated ? ' (estimated)' : '';
|
|
10537
|
-
process.stdout.write(` ${
|
|
10536
|
+
process.stdout.write(` ${Ce(l.usage.cost)}${c}`);
|
|
10538
10537
|
}
|
|
10539
10538
|
(l.error && process.stdout.write(` ${l.error}`),
|
|
10540
10539
|
process.stdout.write(`
|
|
@@ -10549,7 +10548,7 @@ async function Fa(e, t, r, i, n) {
|
|
|
10549
10548
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
10550
10549
|
process.exit(T);
|
|
10551
10550
|
}
|
|
10552
|
-
function
|
|
10551
|
+
function Ua(e, t, r) {
|
|
10553
10552
|
if (r <= 1) return e;
|
|
10554
10553
|
let i = O.default.extname(e);
|
|
10555
10554
|
return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
|
|
@@ -10617,11 +10616,11 @@ async function pt(e, t) {
|
|
|
10617
10616
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
10618
10617
|
`),
|
|
10619
10618
|
process.exit(1)));
|
|
10620
|
-
let n =
|
|
10619
|
+
let n = j(e),
|
|
10621
10620
|
s = !!t.json,
|
|
10622
10621
|
o = !!(t.async || t.no_wait),
|
|
10623
10622
|
p = typeof t.output == 'string' ? t.output : void 0,
|
|
10624
|
-
l =
|
|
10623
|
+
l = Da(t),
|
|
10625
10624
|
c = { ...t };
|
|
10626
10625
|
(delete c.json,
|
|
10627
10626
|
delete c.async,
|
|
@@ -10631,8 +10630,8 @@ async function pt(e, t) {
|
|
|
10631
10630
|
delete c.api_url,
|
|
10632
10631
|
delete c.count);
|
|
10633
10632
|
let d = qr(n, c);
|
|
10634
|
-
(
|
|
10635
|
-
typeof d.image == 'string' && !d.images && !
|
|
10633
|
+
(Oa(d),
|
|
10634
|
+
typeof d.image == 'string' && !d.images && !Ie(n) && ((d.images = [d.image]), delete d.image),
|
|
10636
10635
|
d.image_url &&
|
|
10637
10636
|
!d.first_frame_image &&
|
|
10638
10637
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
@@ -10653,15 +10652,15 @@ async function pt(e, t) {
|
|
|
10653
10652
|
let h = d[w];
|
|
10654
10653
|
if (typeof h == 'string' && !h.startsWith('http://') && !h.startsWith('https://')) {
|
|
10655
10654
|
let I = O.default.resolve(h);
|
|
10656
|
-
if (
|
|
10655
|
+
if (G.default.existsSync(I) && G.default.statSync(I).isFile()) {
|
|
10657
10656
|
let v = new $(`Uploading local file ${O.default.basename(I)} to CDN...`);
|
|
10658
10657
|
s || v.start();
|
|
10659
10658
|
try {
|
|
10660
|
-
let
|
|
10661
|
-
q = await u.uploadAsset(
|
|
10659
|
+
let V = G.default.readFileSync(I),
|
|
10660
|
+
q = await u.uploadAsset(V.toString('base64'));
|
|
10662
10661
|
((d[w] = q.url), s || v.succeed(`Uploaded ${O.default.basename(I)} to CDN`));
|
|
10663
|
-
} catch (
|
|
10664
|
-
let q =
|
|
10662
|
+
} catch (V) {
|
|
10663
|
+
let q = V instanceof Error ? V.message : String(V);
|
|
10665
10664
|
(s
|
|
10666
10665
|
? process.stdout.write(
|
|
10667
10666
|
JSON.stringify({ error: q }) +
|
|
@@ -10674,11 +10673,11 @@ async function pt(e, t) {
|
|
|
10674
10673
|
}
|
|
10675
10674
|
}
|
|
10676
10675
|
}
|
|
10677
|
-
await
|
|
10676
|
+
await La(d, async (w) => {
|
|
10678
10677
|
let h = new $(`Uploading local file ${O.default.basename(w)} to CDN...`);
|
|
10679
10678
|
s || h.start();
|
|
10680
10679
|
try {
|
|
10681
|
-
let I =
|
|
10680
|
+
let I = G.default.readFileSync(w),
|
|
10682
10681
|
v = await u.uploadAsset(I.toString('base64'));
|
|
10683
10682
|
return (s || h.succeed(`Uploaded ${O.default.basename(w)} to CDN`), v.url);
|
|
10684
10683
|
} catch (I) {
|
|
@@ -10698,7 +10697,7 @@ async function pt(e, t) {
|
|
|
10698
10697
|
let f;
|
|
10699
10698
|
try {
|
|
10700
10699
|
if (l > 1) {
|
|
10701
|
-
await
|
|
10700
|
+
await Na(u, e, d, l, { isJson: s, isAsync: o });
|
|
10702
10701
|
return;
|
|
10703
10702
|
}
|
|
10704
10703
|
f = await u.queueJob(e, d);
|
|
@@ -10736,10 +10735,10 @@ async function pt(e, t) {
|
|
|
10736
10735
|
`));
|
|
10737
10736
|
return;
|
|
10738
10737
|
}
|
|
10739
|
-
let
|
|
10738
|
+
let A = Date.now(),
|
|
10740
10739
|
U = 1500;
|
|
10741
10740
|
for (; f.status === 'processing';) {
|
|
10742
|
-
let w = Math.round((Date.now() -
|
|
10741
|
+
let w = Math.round((Date.now() - A) / 1e3);
|
|
10743
10742
|
(s || g.update(`Rendering ${a.bold(e)} (${w}s elapsed)... [ID: ${f.request_id}]`),
|
|
10744
10743
|
await new Promise((h) => setTimeout(h, U)));
|
|
10745
10744
|
try {
|
|
@@ -10783,7 +10782,7 @@ async function pt(e, t) {
|
|
|
10783
10782
|
process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
|
|
10784
10783
|
`),
|
|
10785
10784
|
f.usage?.cost !== void 0 &&
|
|
10786
|
-
process.stdout.write(` ${a.bold('Cost:')} ${
|
|
10785
|
+
process.stdout.write(` ${a.bold('Cost:')} ${Ce(f.usage.cost)}
|
|
10787
10786
|
`),
|
|
10788
10787
|
f.output && f.output.length > 0)
|
|
10789
10788
|
) {
|
|
@@ -10795,19 +10794,19 @@ ${a.bold('Outputs:')}
|
|
|
10795
10794
|
for (let I = 0; I < f.output.length; I++) {
|
|
10796
10795
|
let v = f.output[I];
|
|
10797
10796
|
if (v.url) {
|
|
10798
|
-
let
|
|
10797
|
+
let V = v.layer?.name ? ` ${a.bold(v.layer.name)}` : '';
|
|
10799
10798
|
if (
|
|
10800
|
-
(process.stdout.write(` [${v.type.toUpperCase()}]${
|
|
10799
|
+
(process.stdout.write(` [${v.type.toUpperCase()}]${V} ${a.cyan(a.underline(v.url))}
|
|
10801
10800
|
`),
|
|
10802
10801
|
p)
|
|
10803
10802
|
) {
|
|
10804
|
-
let q =
|
|
10803
|
+
let q = Ua(p, h++, w),
|
|
10805
10804
|
xt = new $(`Downloading output to ${q}...`).start();
|
|
10806
10805
|
try {
|
|
10807
10806
|
(await u.downloadOutput(v.url, O.default.resolve(process.cwd(), q)),
|
|
10808
10807
|
xt.succeed(`Saved to ${a.bold(q)}`));
|
|
10809
|
-
} catch (
|
|
10810
|
-
xt.fail(`Failed to download: ${
|
|
10808
|
+
} catch (Me) {
|
|
10809
|
+
xt.fail(`Failed to download: ${Me instanceof Error ? Me.message : Me}`);
|
|
10811
10810
|
}
|
|
10812
10811
|
}
|
|
10813
10812
|
} else
|
|
@@ -10822,7 +10821,7 @@ ${v.text}
|
|
|
10822
10821
|
}
|
|
10823
10822
|
var Nr = M(require('node:readline'));
|
|
10824
10823
|
R();
|
|
10825
|
-
async function
|
|
10824
|
+
async function Va(e) {
|
|
10826
10825
|
try {
|
|
10827
10826
|
return (await new K(e, x()).checkKey(), 'ok');
|
|
10828
10827
|
} catch (t) {
|
|
@@ -10833,7 +10832,7 @@ async function ja(e) {
|
|
|
10833
10832
|
return 'unchecked';
|
|
10834
10833
|
}
|
|
10835
10834
|
}
|
|
10836
|
-
function
|
|
10835
|
+
function Fa(e) {
|
|
10837
10836
|
let t = Nr.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
10838
10837
|
return new Promise((r) => {
|
|
10839
10838
|
t.question(e, (i) => {
|
|
@@ -10853,20 +10852,20 @@ ${a.bold('Tein AI Authentication')}
|
|
|
10853
10852
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
10854
10853
|
|
|
10855
10854
|
`),
|
|
10856
|
-
(r = await
|
|
10855
|
+
(r = await Fa('Enter your Tein API Key (sk_live_...): '))),
|
|
10857
10856
|
!r.startsWith('sk_live_') &&
|
|
10858
10857
|
!r.startsWith('sk_test_') &&
|
|
10859
10858
|
(process.stderr
|
|
10860
10859
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
10861
10860
|
`),
|
|
10862
10861
|
process.exit(1)));
|
|
10863
|
-
let i = await
|
|
10862
|
+
let i = await Va(r);
|
|
10864
10863
|
(i === 'invalid' &&
|
|
10865
10864
|
(process.stderr
|
|
10866
10865
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
10867
10866
|
`),
|
|
10868
10867
|
process.exit(1)),
|
|
10869
|
-
|
|
10868
|
+
$e({ apiKey: r }),
|
|
10870
10869
|
process.stdout.write(`
|
|
10871
10870
|
${a.green('\u2713')} API key saved to ${a.dim(de())}
|
|
10872
10871
|
`),
|
|
@@ -10885,13 +10884,13 @@ ${a.green('\u2713')} API key saved to ${a.dim(de())}
|
|
|
10885
10884
|
break;
|
|
10886
10885
|
}
|
|
10887
10886
|
case 'logout': {
|
|
10888
|
-
if (!
|
|
10887
|
+
if (!W().apiKey) {
|
|
10889
10888
|
process.stdout
|
|
10890
10889
|
.write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
|
|
10891
10890
|
`);
|
|
10892
10891
|
break;
|
|
10893
10892
|
}
|
|
10894
|
-
(
|
|
10893
|
+
($e({ apiKey: '' }),
|
|
10895
10894
|
process.stdout
|
|
10896
10895
|
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(de())}
|
|
10897
10896
|
`));
|
|
@@ -10900,7 +10899,7 @@ ${a.green('\u2713')} API key saved to ${a.dim(de())}
|
|
|
10900
10899
|
default: {
|
|
10901
10900
|
let r = _(),
|
|
10902
10901
|
i = x(),
|
|
10903
|
-
n =
|
|
10902
|
+
n = W();
|
|
10904
10903
|
if (
|
|
10905
10904
|
(process.stdout.write(`
|
|
10906
10905
|
${a.bold('Tein AI CLI Configuration')}
|
|
@@ -10935,10 +10934,10 @@ function P(e) {
|
|
|
10935
10934
|
? `$${e.toFixed(6).replace(/0+$/, '').replace(/\.$/, '')}`
|
|
10936
10935
|
: `$${e.toFixed(2)}`;
|
|
10937
10936
|
}
|
|
10938
|
-
function
|
|
10937
|
+
function Ur(e) {
|
|
10939
10938
|
return `${e} ${e === 1 ? 'request' : 'requests'}`;
|
|
10940
10939
|
}
|
|
10941
|
-
function
|
|
10940
|
+
function Ba(e) {
|
|
10942
10941
|
let t = [
|
|
10943
10942
|
['Balance', P(e.balance)],
|
|
10944
10943
|
['Available to this key', P(e.available)],
|
|
@@ -10958,8 +10957,8 @@ function Ha(e) {
|
|
|
10958
10957
|
`${P(r.remaining)} left of ${P(r.amount)}${r.resets_at ? `, resets ${r.resets_at.slice(0, 10)}` : ''}`,
|
|
10959
10958
|
]),
|
|
10960
10959
|
t.push(
|
|
10961
|
-
['This month', `${P(e.usage.this_month.spend)} on ${
|
|
10962
|
-
['Last 30 days', `${P(e.usage.last_30_days.spend)} on ${
|
|
10960
|
+
['This month', `${P(e.usage.this_month.spend)} on ${Ur(e.usage.this_month.requests)}`],
|
|
10961
|
+
['Last 30 days', `${P(e.usage.last_30_days.spend)} on ${Ur(e.usage.last_30_days.requests)}`],
|
|
10963
10962
|
[
|
|
10964
10963
|
'Auto top up',
|
|
10965
10964
|
e.auto_top_up.enabled
|
|
@@ -10972,7 +10971,7 @@ function Ha(e) {
|
|
|
10972
10971
|
let i = Math.max(...t.map(([n]) => n.length));
|
|
10973
10972
|
return t.map(([n, s]) => ` ${n.padEnd(i)} ${s}`);
|
|
10974
10973
|
}
|
|
10975
|
-
async function
|
|
10974
|
+
async function Vr(e) {
|
|
10976
10975
|
let t = _(typeof e.api_key == 'string' ? e.api_key : void 0),
|
|
10977
10976
|
r = x(typeof e.api_url == 'string' ? e.api_url : void 0),
|
|
10978
10977
|
i = !!e.json;
|
|
@@ -11016,7 +11015,7 @@ async function Ur(e) {
|
|
|
11016
11015
|
}
|
|
11017
11016
|
process.stdout.write(`
|
|
11018
11017
|
${a.bold('Tein balance')}
|
|
11019
|
-
${
|
|
11018
|
+
${Ba(n).join(`
|
|
11020
11019
|
`)}
|
|
11021
11020
|
|
|
11022
11021
|
`);
|
|
@@ -11079,7 +11078,7 @@ function dt(e) {
|
|
|
11079
11078
|
.trimEnd()}`,
|
|
11080
11079
|
);
|
|
11081
11080
|
}
|
|
11082
|
-
function
|
|
11081
|
+
function ja(e) {
|
|
11083
11082
|
let t = e.summary,
|
|
11084
11083
|
r = [
|
|
11085
11084
|
` 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}` : ''}`,
|
|
@@ -11121,12 +11120,12 @@ async function Gr(e) {
|
|
|
11121
11120
|
}
|
|
11122
11121
|
process.stdout.write(`
|
|
11123
11122
|
${a.bold('Tein usage')}
|
|
11124
|
-
${
|
|
11123
|
+
${ja(i).join(`
|
|
11125
11124
|
`)}
|
|
11126
11125
|
|
|
11127
11126
|
`);
|
|
11128
11127
|
}
|
|
11129
|
-
function
|
|
11128
|
+
function Ga(e) {
|
|
11130
11129
|
return e.data.length
|
|
11131
11130
|
? dt([
|
|
11132
11131
|
['When (UTC)', 'Amount', 'Balance after', 'What'],
|
|
@@ -11158,17 +11157,17 @@ async function Hr(e) {
|
|
|
11158
11157
|
: '';
|
|
11159
11158
|
process.stdout.write(`
|
|
11160
11159
|
${a.bold('Tein balance history')}
|
|
11161
|
-
${
|
|
11160
|
+
${Ga(i).join(`
|
|
11162
11161
|
`)}${n}
|
|
11163
11162
|
|
|
11164
11163
|
`);
|
|
11165
11164
|
}
|
|
11166
11165
|
R();
|
|
11167
|
-
|
|
11166
|
+
Ae();
|
|
11168
11167
|
ie();
|
|
11169
11168
|
R();
|
|
11170
11169
|
ct();
|
|
11171
|
-
var
|
|
11170
|
+
var Ha = 1e4,
|
|
11172
11171
|
zr = {
|
|
11173
11172
|
price: '',
|
|
11174
11173
|
creativeMode: 'Creative mode',
|
|
@@ -11179,23 +11178,23 @@ var Ja = 1e4,
|
|
|
11179
11178
|
priorityDraft: 'Priority + Draft',
|
|
11180
11179
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
11181
11180
|
},
|
|
11182
|
-
|
|
11183
|
-
|
|
11181
|
+
za = Object.keys(zr),
|
|
11182
|
+
Wa = {
|
|
11184
11183
|
creativeMode: 'unfiltered',
|
|
11185
11184
|
creativeModePriority: 'unfilteredPriority',
|
|
11186
11185
|
creativeModeDraft: 'unfilteredDraft',
|
|
11187
11186
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
11188
11187
|
};
|
|
11189
|
-
function
|
|
11190
|
-
let r =
|
|
11188
|
+
function Ja(e, t) {
|
|
11189
|
+
let r = Wa[t];
|
|
11191
11190
|
return e[t] ?? (r ? e[r] : void 0);
|
|
11192
11191
|
}
|
|
11193
|
-
async function
|
|
11194
|
-
let i = `${x(e)}${
|
|
11192
|
+
async function Ya(e, t, r = _()) {
|
|
11193
|
+
let i = `${x(e)}${ve(t)}`,
|
|
11195
11194
|
n;
|
|
11196
11195
|
try {
|
|
11197
11196
|
n = await fetch(i, {
|
|
11198
|
-
signal: AbortSignal.timeout(
|
|
11197
|
+
signal: AbortSignal.timeout(Ha),
|
|
11199
11198
|
...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
|
|
11200
11199
|
});
|
|
11201
11200
|
} catch {
|
|
@@ -11213,7 +11212,7 @@ async function Za(e, t, r = _()) {
|
|
|
11213
11212
|
}
|
|
11214
11213
|
return s;
|
|
11215
11214
|
}
|
|
11216
|
-
function
|
|
11215
|
+
function Te(e) {
|
|
11217
11216
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
11218
11217
|
[r, i = ''] = t.split('.');
|
|
11219
11218
|
return `$${r}.${i.padEnd(2, '0')}`;
|
|
@@ -11222,7 +11221,7 @@ function X(e) {
|
|
|
11222
11221
|
if (!e || typeof e.starter != 'number') return null;
|
|
11223
11222
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
11224
11223
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
11225
|
-
return `Starter ${
|
|
11224
|
+
return `Starter ${Te(e.starter)} Plus ${Te(t)} Scale ${Te(r)}`;
|
|
11226
11225
|
}
|
|
11227
11226
|
function Wr(e) {
|
|
11228
11227
|
let t = zr[e];
|
|
@@ -11230,13 +11229,13 @@ function Wr(e) {
|
|
|
11230
11229
|
}
|
|
11231
11230
|
function ut(e) {
|
|
11232
11231
|
let t = X(e.price) ?? '',
|
|
11233
|
-
r = e.public ? ` ${a.dim(`(published Starter ${
|
|
11232
|
+
r = e.public ? ` ${a.dim(`(published Starter ${Te(e.public.starter)})`)}` : '';
|
|
11234
11233
|
return `${e.label}${Wr(e.table)} ${t}${r}`;
|
|
11235
11234
|
}
|
|
11236
11235
|
function mt(e, t, r, i = !1) {
|
|
11237
11236
|
return `${e}|${i ? 'edit/' : ''}${t}|${r}`;
|
|
11238
11237
|
}
|
|
11239
|
-
function
|
|
11238
|
+
function Xa(e) {
|
|
11240
11239
|
let t = new Map();
|
|
11241
11240
|
for (let r of e ?? []) {
|
|
11242
11241
|
let i = r.addon ? `addon/${r.addon}` : (r.variant ?? '');
|
|
@@ -11244,7 +11243,7 @@ function en(e) {
|
|
|
11244
11243
|
}
|
|
11245
11244
|
return t;
|
|
11246
11245
|
}
|
|
11247
|
-
function
|
|
11246
|
+
function Qa(e) {
|
|
11248
11247
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
11249
11248
|
let t = [];
|
|
11250
11249
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -11256,10 +11255,10 @@ function tn(e) {
|
|
|
11256
11255
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
11257
11256
|
);
|
|
11258
11257
|
}
|
|
11259
|
-
function
|
|
11260
|
-
let s =
|
|
11261
|
-
for (let o of
|
|
11262
|
-
let p = X(
|
|
11258
|
+
function Za(e, t, r, i, n) {
|
|
11259
|
+
let s = Qa(t);
|
|
11260
|
+
for (let o of za) {
|
|
11261
|
+
let p = X(Ja(t, o));
|
|
11263
11262
|
if (!p) continue;
|
|
11264
11263
|
let l = Wr(o);
|
|
11265
11264
|
r.push(` ${s}${l} ${p}`);
|
|
@@ -11267,12 +11266,12 @@ function rn(e, t, r, i, n) {
|
|
|
11267
11266
|
c && (n.add(c), r.push(` ${a.yellow('Your price')} ${X(c.price) ?? ''}`));
|
|
11268
11267
|
}
|
|
11269
11268
|
}
|
|
11270
|
-
function
|
|
11269
|
+
function en(e, t, r, i) {
|
|
11271
11270
|
let n = e.quality ? ` quality=${e.quality}` : '';
|
|
11272
11271
|
t.push(
|
|
11273
11272
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${n}`)}`,
|
|
11274
11273
|
);
|
|
11275
|
-
for (let o of e.variants ?? [])
|
|
11274
|
+
for (let o of e.variants ?? []) Za(e.slug, o, t, r, i);
|
|
11276
11275
|
let s = e.addons;
|
|
11277
11276
|
if (Array.isArray(s))
|
|
11278
11277
|
for (let o of s) {
|
|
@@ -11288,7 +11287,7 @@ function an(e, t, r, i) {
|
|
|
11288
11287
|
typeof o == 'string' && o.trim() && t.push(` ${a.dim(o.trim())}`);
|
|
11289
11288
|
t.push('');
|
|
11290
11289
|
}
|
|
11291
|
-
function
|
|
11290
|
+
function tn(e) {
|
|
11292
11291
|
let t = [],
|
|
11293
11292
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
11294
11293
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
|
|
@@ -11301,7 +11300,7 @@ function nn(e) {
|
|
|
11301
11300
|
`${a.yellow('Your price')} ${a.dim('rows are the prices your workspace pays instead of the published ones.')}`,
|
|
11302
11301
|
),
|
|
11303
11302
|
t.push(''));
|
|
11304
|
-
let n =
|
|
11303
|
+
let n = Xa(i),
|
|
11305
11304
|
s = new Set(),
|
|
11306
11305
|
o = new Map();
|
|
11307
11306
|
for (let m of e.board.models) {
|
|
@@ -11312,12 +11311,12 @@ function nn(e) {
|
|
|
11312
11311
|
let p = ['video', 'image', 'audio', 'llm', 'text', '3d'],
|
|
11313
11312
|
l = [...o.keys()].sort((m, g) => {
|
|
11314
11313
|
let f = p.indexOf(m),
|
|
11315
|
-
|
|
11316
|
-
return (f === -1 ? 99 : f) - (
|
|
11314
|
+
A = p.indexOf(g);
|
|
11315
|
+
return (f === -1 ? 99 : f) - (A === -1 ? 99 : A);
|
|
11317
11316
|
});
|
|
11318
11317
|
for (let m of l) {
|
|
11319
11318
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${m} \u2500\u2500`))}`);
|
|
11320
|
-
for (let g of o.get(m) ?? [])
|
|
11319
|
+
for (let g of o.get(m) ?? []) en(g, t, n, s);
|
|
11321
11320
|
}
|
|
11322
11321
|
let c = i.filter((m) => !s.has(m));
|
|
11323
11322
|
if (c.length) {
|
|
@@ -11334,12 +11333,12 @@ function nn(e) {
|
|
|
11334
11333
|
let m = new Map();
|
|
11335
11334
|
for (let g of u) {
|
|
11336
11335
|
let f = String(g.modelSlug ?? ''),
|
|
11337
|
-
|
|
11338
|
-
(
|
|
11336
|
+
A = m.get(f) ?? [];
|
|
11337
|
+
(A.push(g), m.set(f, A));
|
|
11339
11338
|
}
|
|
11340
11339
|
for (let [g, f] of m) {
|
|
11341
|
-
let
|
|
11342
|
-
t.push(` ${a.bold(g.padEnd(26))} ${a.gray(
|
|
11340
|
+
let A = String(f[0]?.modelName ?? g);
|
|
11341
|
+
t.push(` ${a.bold(g.padEnd(26))} ${a.gray(A)}`);
|
|
11343
11342
|
for (let U of f) {
|
|
11344
11343
|
let w = String(U.displayLabel ?? U.billingUnit ?? 'price'),
|
|
11345
11344
|
h = X(U.prices);
|
|
@@ -11358,7 +11357,7 @@ function nn(e) {
|
|
|
11358
11357
|
async function Jr(e) {
|
|
11359
11358
|
let t;
|
|
11360
11359
|
try {
|
|
11361
|
-
t = await
|
|
11360
|
+
t = await Ya(e.apiUrl, e.model);
|
|
11362
11361
|
} catch (r) {
|
|
11363
11362
|
let i = r instanceof Error ? r.message : String(r);
|
|
11364
11363
|
(process.stderr.write(`${a.red('Error:')} ${i}
|
|
@@ -11369,15 +11368,15 @@ async function Jr(e) {
|
|
|
11369
11368
|
e.json
|
|
11370
11369
|
? `${JSON.stringify(t, null, 2)}
|
|
11371
11370
|
`
|
|
11372
|
-
:
|
|
11371
|
+
: tn(t),
|
|
11373
11372
|
);
|
|
11374
11373
|
}
|
|
11375
|
-
var
|
|
11374
|
+
var rn = 3e3;
|
|
11376
11375
|
async function Yr(e, t) {
|
|
11377
11376
|
let r = t ?? _();
|
|
11378
11377
|
try {
|
|
11379
11378
|
let i = await fetch(`${x(e)}/v1/pricing`, {
|
|
11380
|
-
signal: AbortSignal.timeout(
|
|
11379
|
+
signal: AbortSignal.timeout(rn),
|
|
11381
11380
|
...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
|
|
11382
11381
|
});
|
|
11383
11382
|
if (!i.ok) return { live: !1, yourPrices: null };
|
|
@@ -11394,21 +11393,21 @@ async function Yr(e, t) {
|
|
|
11394
11393
|
return { live: !1, yourPrices: null };
|
|
11395
11394
|
}
|
|
11396
11395
|
}
|
|
11397
|
-
function
|
|
11398
|
-
return
|
|
11396
|
+
function an(e) {
|
|
11397
|
+
return j(e.slug) ? e.slug : e.model;
|
|
11399
11398
|
}
|
|
11400
11399
|
function Xr(e, t) {
|
|
11401
|
-
return (t ?? []).filter((r) => r &&
|
|
11400
|
+
return (t ?? []).filter((r) => r && an(r) === e);
|
|
11402
11401
|
}
|
|
11403
|
-
var
|
|
11404
|
-
|
|
11402
|
+
var nn = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
11403
|
+
sn = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
11405
11404
|
async function Qr(e, t) {
|
|
11406
11405
|
let r = await Yr(t),
|
|
11407
|
-
i =
|
|
11406
|
+
i = D();
|
|
11408
11407
|
if (e) {
|
|
11409
11408
|
let o = e.toLowerCase(),
|
|
11410
|
-
p =
|
|
11411
|
-
i =
|
|
11409
|
+
p = sn[o] ?? o;
|
|
11410
|
+
i = nn.has(p)
|
|
11412
11411
|
? i.filter((l) => l.category.toLowerCase() === p)
|
|
11413
11412
|
: i.filter((l) => l.kind.toLowerCase().includes(o) || l.slug.toLowerCase().includes(o));
|
|
11414
11413
|
}
|
|
@@ -11456,7 +11455,7 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
11456
11455
|
`));
|
|
11457
11456
|
}
|
|
11458
11457
|
async function Zr(e, t) {
|
|
11459
|
-
let r =
|
|
11458
|
+
let r = j(e);
|
|
11460
11459
|
r ||
|
|
11461
11460
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
11462
11461
|
`),
|
|
@@ -11729,7 +11728,7 @@ ${a.bold('CDN URL:')} ${a.green(u.url)}
|
|
|
11729
11728
|
}
|
|
11730
11729
|
oe();
|
|
11731
11730
|
ie();
|
|
11732
|
-
|
|
11731
|
+
Fe();
|
|
11733
11732
|
function bi() {
|
|
11734
11733
|
process.stdout.write(`
|
|
11735
11734
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
@@ -11812,7 +11811,7 @@ ${a.bold('EXAMPLES:')}
|
|
|
11812
11811
|
|
|
11813
11812
|
`);
|
|
11814
11813
|
}
|
|
11815
|
-
async function
|
|
11814
|
+
async function Mn() {
|
|
11816
11815
|
let e = process.argv.slice(2),
|
|
11817
11816
|
t = Dr(e);
|
|
11818
11817
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
@@ -11820,7 +11819,7 @@ async function En() {
|
|
|
11820
11819
|
return;
|
|
11821
11820
|
}
|
|
11822
11821
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
11823
|
-
process.stdout.write(`tein version ${
|
|
11822
|
+
process.stdout.write(`tein version ${H}
|
|
11824
11823
|
`);
|
|
11825
11824
|
return;
|
|
11826
11825
|
}
|
|
@@ -11885,7 +11884,7 @@ async function En() {
|
|
|
11885
11884
|
break;
|
|
11886
11885
|
}
|
|
11887
11886
|
case 'balance': {
|
|
11888
|
-
await
|
|
11887
|
+
await Vr(t.options);
|
|
11889
11888
|
break;
|
|
11890
11889
|
}
|
|
11891
11890
|
case 'usage': {
|
|
@@ -11904,7 +11903,7 @@ async function En() {
|
|
|
11904
11903
|
}
|
|
11905
11904
|
default: {
|
|
11906
11905
|
if (t.command && !t.command.startsWith('-')) {
|
|
11907
|
-
(!
|
|
11906
|
+
(!j(t.command) &&
|
|
11908
11907
|
!be[t.command] &&
|
|
11909
11908
|
(process.stderr.write(`
|
|
11910
11909
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
@@ -11919,7 +11918,7 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
|
|
|
11919
11918
|
}
|
|
11920
11919
|
}
|
|
11921
11920
|
}
|
|
11922
|
-
|
|
11921
|
+
Mn().catch((e) => {
|
|
11923
11922
|
(e instanceof b &&
|
|
11924
11923
|
(process.stderr.write(`
|
|
11925
11924
|
${a.red('Error:')} ${E(e).join(`
|