@teinai/cli 1.1.25 → 1.1.27
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 +771 -621
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var gr = Object.create;
|
|
4
|
+
var xe = Object.defineProperty;
|
|
5
|
+
var hr = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var yr = Object.getOwnPropertyNames;
|
|
7
|
+
var br = Object.getPrototypeOf,
|
|
8
|
+
kr = Object.prototype.hasOwnProperty;
|
|
9
9
|
var y = (e, t, r) => () => {
|
|
10
10
|
if (r) throw r[0];
|
|
11
11
|
try {
|
|
@@ -14,96 +14,96 @@ var y = (e, t, r) => () => {
|
|
|
14
14
|
throw ((r = [a]), a);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var r in t)
|
|
17
|
+
var wr = (e, t) => {
|
|
18
|
+
for (var r in t) xe(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
xr = (e, t, r, a) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let n of
|
|
23
|
-
!
|
|
22
|
+
for (let n of yr(t))
|
|
23
|
+
!kr.call(e, n) &&
|
|
24
24
|
n !== r &&
|
|
25
|
-
|
|
25
|
+
xe(e, n, { get: () => t[n], enumerable: !(a = hr(t, n)) || a.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
28
|
var _ = (e, t, r) => (
|
|
29
|
-
(r = e != null ?
|
|
30
|
-
|
|
29
|
+
(r = e != null ? gr(br(e)) : {}),
|
|
30
|
+
xr(t || !e || !e.__esModule ? xe(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function V() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if ($.default.existsSync(U)) {
|
|
35
|
+
let e = $.default.readFileSync(U, 'utf-8');
|
|
36
36
|
return JSON.parse(e);
|
|
37
37
|
}
|
|
38
38
|
} catch {}
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Ie(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let r = { ...
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
$.default.existsSync(ae) || $.default.mkdirSync(ae, { recursive: !0, mode: 448 });
|
|
44
|
+
let r = { ...V(), ...e };
|
|
45
|
+
($.default.writeFileSync(U, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
$.default.chmodSync(ae, 448),
|
|
47
|
+
$.default.chmodSync(U, 384));
|
|
48
48
|
} catch (t) {
|
|
49
|
-
throw new Error(`Failed to save config to ${
|
|
49
|
+
throw new Error(`Failed to save config to ${U}: ${t}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function E(e) {
|
|
53
53
|
if (e && e.trim()) return e.trim();
|
|
54
54
|
let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
|
|
55
55
|
if (t && t.trim()) return t.trim();
|
|
56
|
-
let r =
|
|
56
|
+
let r = V();
|
|
57
57
|
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function I(e) {
|
|
60
60
|
if (e && e.trim()) return e.trim().replace(/\/+$/, '');
|
|
61
61
|
let t = process.env.TEIN_API_URL;
|
|
62
62
|
if (t && t.trim()) return t.trim().replace(/\/+$/, '');
|
|
63
|
-
let r =
|
|
63
|
+
let r = V();
|
|
64
64
|
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function ie() {
|
|
67
|
+
return U;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
var $,
|
|
70
|
+
nt,
|
|
71
|
+
Pe,
|
|
72
|
+
ae,
|
|
73
|
+
U,
|
|
74
74
|
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(
|
|
80
|
-
(
|
|
76
|
+
(($ = _(require('node:fs'))),
|
|
77
|
+
(nt = _(require('node:os'))),
|
|
78
|
+
(Pe = _(require('node:path'))),
|
|
79
|
+
(ae = Pe.default.join(nt.default.homedir(), '.tein')),
|
|
80
|
+
(U = Pe.default.join(ae, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var Mr,
|
|
83
|
+
st,
|
|
84
|
+
ot,
|
|
85
|
+
lt = y(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
87
|
+
((Mr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(st = [...Mr, 'auto']),
|
|
89
|
+
(ot =
|
|
90
90
|
'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.'));
|
|
91
91
|
});
|
|
92
92
|
var G,
|
|
93
|
-
|
|
93
|
+
ve = y(() => {
|
|
94
94
|
'use strict';
|
|
95
95
|
G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function ne(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var pt = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
|
-
var
|
|
104
|
-
|
|
103
|
+
var se,
|
|
104
|
+
dt = y(() => {
|
|
105
105
|
'use strict';
|
|
106
|
-
|
|
106
|
+
se = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
108
108
|
checked: '17 Sep 2026',
|
|
109
109
|
generated: '2026-10-01',
|
|
@@ -5842,11 +5842,11 @@ var ie,
|
|
|
5842
5842
|
],
|
|
5843
5843
|
};
|
|
5844
5844
|
});
|
|
5845
|
-
var
|
|
5846
|
-
|
|
5847
|
-
|
|
5845
|
+
var oe,
|
|
5846
|
+
ct,
|
|
5847
|
+
Te = y(() => {
|
|
5848
5848
|
'use strict';
|
|
5849
|
-
((
|
|
5849
|
+
((oe = [
|
|
5850
5850
|
{
|
|
5851
5851
|
slug: 'tein-video-upscaler',
|
|
5852
5852
|
name: 'Tein Video Upscaler',
|
|
@@ -5882,13 +5882,48 @@ var ne,
|
|
|
5882
5882
|
axes: { resolution: ['1080p', '2k', '4k'] },
|
|
5883
5883
|
from: { variant: '1080p' },
|
|
5884
5884
|
},
|
|
5885
|
+
{
|
|
5886
|
+
slug: 'doppel',
|
|
5887
|
+
name: 'Doppel',
|
|
5888
|
+
family: 'tein-labs',
|
|
5889
|
+
vendor: 'Tein Labs',
|
|
5890
|
+
desc: 'Puts you into any photo. Swap: your face, and if you like your outfit, in the photo you pick, with things to add. New scene: the pose and camera of a photo, rebuilt around you in a new place.',
|
|
5891
|
+
kind: 'image',
|
|
5892
|
+
unit: '/run',
|
|
5893
|
+
api: { model: 'doppel' },
|
|
5894
|
+
variants: [
|
|
5895
|
+
{
|
|
5896
|
+
id: 'swap',
|
|
5897
|
+
label: 'Swap',
|
|
5898
|
+
resolution: 'run',
|
|
5899
|
+
price: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
|
|
5900
|
+
},
|
|
5901
|
+
{
|
|
5902
|
+
id: 'swap-4-items',
|
|
5903
|
+
label: 'Swap, 4 things to add',
|
|
5904
|
+
resolution: 'run',
|
|
5905
|
+
price: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
|
|
5906
|
+
},
|
|
5907
|
+
{
|
|
5908
|
+
id: 'new_scene',
|
|
5909
|
+
label: 'New scene',
|
|
5910
|
+
resolution: 'run',
|
|
5911
|
+
price: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
|
|
5912
|
+
},
|
|
5913
|
+
],
|
|
5914
|
+
unfiltered: null,
|
|
5915
|
+
priority: null,
|
|
5916
|
+
draft: null,
|
|
5917
|
+
axes: { mode: ['swap', 'new_scene'] },
|
|
5918
|
+
from: { variant: 'swap' },
|
|
5919
|
+
},
|
|
5885
5920
|
]),
|
|
5886
|
-
(
|
|
5921
|
+
(ct = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
5887
5922
|
});
|
|
5888
|
-
function
|
|
5923
|
+
function Se(e, t) {
|
|
5889
5924
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5890
5925
|
}
|
|
5891
|
-
function
|
|
5926
|
+
function Er(e, t) {
|
|
5892
5927
|
if (e === 'seedance-2-mini') return 'mini';
|
|
5893
5928
|
if (e !== 'seedance-2') return;
|
|
5894
5929
|
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -5898,93 +5933,93 @@ function Ir(e, t) {
|
|
|
5898
5933
|
? 'fast'
|
|
5899
5934
|
: 'standard';
|
|
5900
5935
|
}
|
|
5901
|
-
function
|
|
5936
|
+
function qr(e, t) {
|
|
5902
5937
|
let r = e
|
|
5903
5938
|
.trim()
|
|
5904
5939
|
.toLowerCase()
|
|
5905
5940
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5906
5941
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5907
|
-
let n =
|
|
5908
|
-
s =
|
|
5942
|
+
let n = Er(r, t),
|
|
5943
|
+
s = Me.get(Se('seedance-2', n));
|
|
5909
5944
|
return s ? s.slug : null;
|
|
5910
5945
|
}
|
|
5911
|
-
let a =
|
|
5946
|
+
let a = le.get(r) ?? Me.get(Se(r));
|
|
5912
5947
|
return a ? a.slug : null;
|
|
5913
5948
|
}
|
|
5914
|
-
function
|
|
5915
|
-
return
|
|
5949
|
+
function $r(e, t) {
|
|
5950
|
+
return le.has(e) && !(Cr.has(e) && t) ? e : qr(e, t);
|
|
5916
5951
|
}
|
|
5917
|
-
function
|
|
5918
|
-
let r =
|
|
5919
|
-
return r ? (
|
|
5952
|
+
function H(e, t) {
|
|
5953
|
+
let r = $r(e, t);
|
|
5954
|
+
return r ? (le.get(r) ?? null) : null;
|
|
5920
5955
|
}
|
|
5921
|
-
function
|
|
5922
|
-
return
|
|
5956
|
+
function pe() {
|
|
5957
|
+
return gt;
|
|
5923
5958
|
}
|
|
5924
|
-
var
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5959
|
+
var mt,
|
|
5960
|
+
ft,
|
|
5961
|
+
gt,
|
|
5962
|
+
Kr,
|
|
5963
|
+
le,
|
|
5964
|
+
Me,
|
|
5965
|
+
ut,
|
|
5966
|
+
Sr,
|
|
5967
|
+
Ke,
|
|
5968
|
+
Cr,
|
|
5969
|
+
F = y(() => {
|
|
5935
5970
|
'use strict';
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
((
|
|
5940
|
-
...
|
|
5941
|
-
families:
|
|
5942
|
-
models:
|
|
5971
|
+
pt();
|
|
5972
|
+
dt();
|
|
5973
|
+
Te();
|
|
5974
|
+
((mt = {
|
|
5975
|
+
...se,
|
|
5976
|
+
families: se.families.map((e) => ({ ...e, models: e.models.filter((t) => !ne(t)) })),
|
|
5977
|
+
models: se.models.filter((e) => !ne(e.slug)),
|
|
5943
5978
|
}),
|
|
5944
|
-
(
|
|
5945
|
-
(
|
|
5946
|
-
(
|
|
5947
|
-
...
|
|
5948
|
-
...
|
|
5949
|
-
.map((e) => ({ ...e, models:
|
|
5979
|
+
(ft = oe.filter((e) => !ne(e.slug))),
|
|
5980
|
+
(gt = [...mt.models, ...ft]),
|
|
5981
|
+
(Kr = [
|
|
5982
|
+
...mt.families,
|
|
5983
|
+
...ct
|
|
5984
|
+
.map((e) => ({ ...e, models: ft.filter((t) => t.family === e.slug).map((t) => t.slug) }))
|
|
5950
5985
|
.filter((e) => e.models.length > 0),
|
|
5951
5986
|
]),
|
|
5952
|
-
(
|
|
5953
|
-
(
|
|
5954
|
-
(
|
|
5955
|
-
(
|
|
5956
|
-
(
|
|
5957
|
-
for (let e of
|
|
5958
|
-
(
|
|
5959
|
-
for (let t of e.variants)
|
|
5987
|
+
(le = new Map()),
|
|
5988
|
+
(Me = new Map()),
|
|
5989
|
+
(ut = new Map()),
|
|
5990
|
+
(Sr = new Map()),
|
|
5991
|
+
(Ke = new Map()));
|
|
5992
|
+
for (let e of gt) {
|
|
5993
|
+
(le.set(e.slug, e), Me.set(Se(e.api.model, e.api.quality), e));
|
|
5994
|
+
for (let t of e.variants) ut.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
5960
5995
|
for (let t of e.editVariants ?? [])
|
|
5961
|
-
|
|
5962
|
-
for (let t of e.addons ?? [])
|
|
5963
|
-
|
|
5996
|
+
ut.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
5997
|
+
for (let t of e.addons ?? []) Sr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
5998
|
+
Ke.set(e.slug, e.family);
|
|
5964
5999
|
}
|
|
5965
|
-
for (let e of
|
|
5966
|
-
|
|
6000
|
+
for (let e of Kr) for (let t of e.models) Ke.has(t) || Ke.set(t, e.slug);
|
|
6001
|
+
Cr = new Set(['seedance-2']);
|
|
5967
6002
|
});
|
|
5968
|
-
function
|
|
6003
|
+
function de(e) {
|
|
5969
6004
|
let t = e.from?.variant;
|
|
5970
6005
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
5971
6006
|
}
|
|
5972
|
-
function
|
|
6007
|
+
function Ee(e) {
|
|
5973
6008
|
if (e.endpoints?.length)
|
|
5974
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
5975
|
-
?
|
|
6009
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === ht)
|
|
6010
|
+
? ht
|
|
5976
6011
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
5977
6012
|
}
|
|
5978
|
-
var
|
|
5979
|
-
|
|
6013
|
+
var ht,
|
|
6014
|
+
qe = y(() => {
|
|
5980
6015
|
'use strict';
|
|
5981
|
-
|
|
5982
|
-
|
|
6016
|
+
F();
|
|
6017
|
+
ht = 'dynamic';
|
|
5983
6018
|
});
|
|
5984
|
-
var
|
|
5985
|
-
|
|
6019
|
+
var ce,
|
|
6020
|
+
Ce = y(() => {
|
|
5986
6021
|
'use strict';
|
|
5987
|
-
|
|
6022
|
+
ce = {
|
|
5988
6023
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
5989
6024
|
'gemini-3-7-flash': 'gemini-3.7-flash',
|
|
5990
6025
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
@@ -5994,29 +6029,29 @@ var pe,
|
|
|
5994
6029
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
5995
6030
|
};
|
|
5996
6031
|
});
|
|
5997
|
-
var
|
|
6032
|
+
var yt = y(() => {
|
|
5998
6033
|
'use strict';
|
|
5999
6034
|
});
|
|
6000
|
-
function
|
|
6001
|
-
return typeof t == 'string' && (
|
|
6035
|
+
function bt(e, t) {
|
|
6036
|
+
return typeof t == 'string' && (Ar[e]?.includes(t) ?? !1);
|
|
6002
6037
|
}
|
|
6003
|
-
var
|
|
6004
|
-
|
|
6038
|
+
var Ar,
|
|
6039
|
+
kt = y(() => {
|
|
6005
6040
|
'use strict';
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6041
|
+
F();
|
|
6042
|
+
qe();
|
|
6043
|
+
yt();
|
|
6044
|
+
Ar = {};
|
|
6010
6045
|
});
|
|
6011
|
-
function
|
|
6012
|
-
return e === 'nano-banana-pro' ?
|
|
6046
|
+
function wt(e) {
|
|
6047
|
+
return e === 'nano-banana-pro' ? Rr : Or;
|
|
6013
6048
|
}
|
|
6014
|
-
var
|
|
6015
|
-
|
|
6016
|
-
|
|
6049
|
+
var Rr,
|
|
6050
|
+
Or,
|
|
6051
|
+
xt = y(() => {
|
|
6017
6052
|
'use strict';
|
|
6018
|
-
((
|
|
6019
|
-
(
|
|
6053
|
+
((Rr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6054
|
+
(Or = [
|
|
6020
6055
|
'auto',
|
|
6021
6056
|
'1:1',
|
|
6022
6057
|
'1:4',
|
|
@@ -6034,10 +6069,10 @@ var Mr,
|
|
|
6034
6069
|
'21:9',
|
|
6035
6070
|
]));
|
|
6036
6071
|
});
|
|
6037
|
-
var
|
|
6038
|
-
|
|
6072
|
+
var Pt,
|
|
6073
|
+
It = y(() => {
|
|
6039
6074
|
'use strict';
|
|
6040
|
-
|
|
6075
|
+
Pt = [
|
|
6041
6076
|
'prompt',
|
|
6042
6077
|
'system',
|
|
6043
6078
|
'messages',
|
|
@@ -6051,10 +6086,10 @@ var ht,
|
|
|
6051
6086
|
'endpoint',
|
|
6052
6087
|
];
|
|
6053
6088
|
});
|
|
6054
|
-
var
|
|
6055
|
-
|
|
6089
|
+
var _t,
|
|
6090
|
+
vt = y(() => {
|
|
6056
6091
|
'use strict';
|
|
6057
|
-
|
|
6092
|
+
_t = [
|
|
6058
6093
|
{
|
|
6059
6094
|
slug: 'claude-fable-5-1',
|
|
6060
6095
|
family: 'fable-5-1',
|
|
@@ -6123,13 +6158,13 @@ var bt,
|
|
|
6123
6158
|
},
|
|
6124
6159
|
];
|
|
6125
6160
|
});
|
|
6126
|
-
function
|
|
6161
|
+
function Tt(e) {
|
|
6127
6162
|
return `$${e}`;
|
|
6128
6163
|
}
|
|
6129
|
-
function
|
|
6130
|
-
return
|
|
6164
|
+
function $e(e, t, r) {
|
|
6165
|
+
return H(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
6131
6166
|
}
|
|
6132
|
-
function
|
|
6167
|
+
function Dr(e) {
|
|
6133
6168
|
return [
|
|
6134
6169
|
{
|
|
6135
6170
|
name: 'prompt',
|
|
@@ -6195,13 +6230,13 @@ function Sr(e) {
|
|
|
6195
6230
|
},
|
|
6196
6231
|
];
|
|
6197
6232
|
}
|
|
6198
|
-
function
|
|
6233
|
+
function Mt() {
|
|
6199
6234
|
return Object.fromEntries(
|
|
6200
|
-
|
|
6201
|
-
let t =
|
|
6202
|
-
r =
|
|
6203
|
-
a =
|
|
6204
|
-
n = t != null && r != null ? `${
|
|
6235
|
+
_t.map((e) => {
|
|
6236
|
+
let t = $e(e.slug, 'cheap', 'input'),
|
|
6237
|
+
r = $e(e.slug, 'cheap', 'output'),
|
|
6238
|
+
a = $e(e.slug, 'stable', 'input') != null,
|
|
6239
|
+
n = t != null && r != null ? `${Tt(t)}/M in \xB7 ${Tt(r)}/M out` : '',
|
|
6205
6240
|
s = {
|
|
6206
6241
|
slug: e.slug,
|
|
6207
6242
|
name: e.name,
|
|
@@ -6212,22 +6247,41 @@ function xt() {
|
|
|
6212
6247
|
priceFormatted: n,
|
|
6213
6248
|
unit: '/M tokens',
|
|
6214
6249
|
primaryToolName: 'run_task',
|
|
6215
|
-
parameters:
|
|
6250
|
+
parameters: Dr(a),
|
|
6216
6251
|
};
|
|
6217
6252
|
return [e.slug, s];
|
|
6218
6253
|
}),
|
|
6219
6254
|
);
|
|
6220
6255
|
}
|
|
6221
|
-
var
|
|
6256
|
+
var Kt = y(() => {
|
|
6222
6257
|
'use strict';
|
|
6223
|
-
|
|
6224
|
-
|
|
6258
|
+
vt();
|
|
6259
|
+
F();
|
|
6225
6260
|
});
|
|
6226
|
-
var
|
|
6227
|
-
|
|
6228
|
-
|
|
6261
|
+
var ue,
|
|
6262
|
+
St,
|
|
6263
|
+
z,
|
|
6264
|
+
Et,
|
|
6265
|
+
Mi,
|
|
6266
|
+
Ki,
|
|
6267
|
+
Si,
|
|
6268
|
+
Ei,
|
|
6269
|
+
qt = y(() => {
|
|
6270
|
+
'use strict';
|
|
6271
|
+
((ue = 'enhancor-ultrafine'),
|
|
6272
|
+
(St = 'Enhancor Ultrafine'),
|
|
6273
|
+
(z = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
6274
|
+
(Et = 2),
|
|
6275
|
+
(Mi = 24 * 1024 * 1024),
|
|
6276
|
+
(Ki = 4096 * 4096),
|
|
6277
|
+
(Si = 30 * 6e4),
|
|
6278
|
+
(Ei = 120 * 6e4));
|
|
6279
|
+
});
|
|
6280
|
+
var J,
|
|
6281
|
+
me,
|
|
6282
|
+
Ae = y(() => {
|
|
6229
6283
|
'use strict';
|
|
6230
|
-
((
|
|
6284
|
+
((J = [
|
|
6231
6285
|
'seedance-2-5',
|
|
6232
6286
|
'seedance-2',
|
|
6233
6287
|
'seedance-2-mini',
|
|
@@ -6236,13 +6290,13 @@ var H,
|
|
|
6236
6290
|
'wan-3-0',
|
|
6237
6291
|
'z-image-pro',
|
|
6238
6292
|
]),
|
|
6239
|
-
(
|
|
6293
|
+
(me =
|
|
6240
6294
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
6241
6295
|
});
|
|
6242
|
-
function
|
|
6296
|
+
function W(e) {
|
|
6243
6297
|
return `$${Number(e.toFixed(5))}`;
|
|
6244
6298
|
}
|
|
6245
|
-
function
|
|
6299
|
+
function Ur(e) {
|
|
6246
6300
|
if (e.kind === 'llm') {
|
|
6247
6301
|
let t = e.defaultEndpoint,
|
|
6248
6302
|
r = (s) =>
|
|
@@ -6255,41 +6309,41 @@ function Er(e) {
|
|
|
6255
6309
|
a = r('input'),
|
|
6256
6310
|
n = r('output');
|
|
6257
6311
|
return a && n
|
|
6258
|
-
? `${
|
|
6259
|
-
: `from ${
|
|
6312
|
+
? `${W(a.price.starter)}/M in \xB7 ${W(n.price.starter)}/M out`
|
|
6313
|
+
: `from ${W(de(e).price.starter)}/M tokens`;
|
|
6260
6314
|
}
|
|
6261
|
-
return `from ${
|
|
6315
|
+
return `from ${W(de(e).price.starter)}${e.unit}`;
|
|
6262
6316
|
}
|
|
6263
|
-
function
|
|
6317
|
+
function Vr(e, t) {
|
|
6264
6318
|
let r = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
6265
|
-
return r.length ? `from ${
|
|
6319
|
+
return r.length ? `from ${W(Math.min(...r))}${e}` : null;
|
|
6266
6320
|
}
|
|
6267
|
-
function
|
|
6321
|
+
function Ot(e) {
|
|
6268
6322
|
for (let t of G) {
|
|
6269
|
-
let r =
|
|
6270
|
-
a = r ?
|
|
6323
|
+
let r = ge[t],
|
|
6324
|
+
a = r ? Vr(r.unit, e[t] ?? []) : null;
|
|
6271
6325
|
r && a && (r.priceFormatted = a);
|
|
6272
6326
|
}
|
|
6273
6327
|
}
|
|
6274
|
-
function
|
|
6328
|
+
function R(e, t) {
|
|
6275
6329
|
let r = e.axes?.resolution ?? [
|
|
6276
6330
|
...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
|
|
6277
6331
|
];
|
|
6278
6332
|
return {
|
|
6279
6333
|
name: 'resolution',
|
|
6280
6334
|
type: 'select',
|
|
6281
|
-
default:
|
|
6335
|
+
default: de(e).resolution ?? r[0],
|
|
6282
6336
|
options: r,
|
|
6283
6337
|
...(t ? { description: t } : {}),
|
|
6284
6338
|
};
|
|
6285
6339
|
}
|
|
6286
|
-
function
|
|
6340
|
+
function Dt(e) {
|
|
6287
6341
|
if (!e.endpoints?.length) return null;
|
|
6288
|
-
let t = e.endpoints.filter((r) =>
|
|
6342
|
+
let t = e.endpoints.filter((r) => bt(e.slug, r.id));
|
|
6289
6343
|
return {
|
|
6290
6344
|
name: 'endpoint',
|
|
6291
6345
|
type: 'select',
|
|
6292
|
-
default:
|
|
6346
|
+
default: Ee(e),
|
|
6293
6347
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6294
6348
|
description:
|
|
6295
6349
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6298,20 +6352,55 @@ function Kt(e) {
|
|
|
6298
6352
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
6299
6353
|
};
|
|
6300
6354
|
}
|
|
6301
|
-
function
|
|
6355
|
+
function Br(e, t) {
|
|
6302
6356
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
6303
|
-
let r =
|
|
6304
|
-
return [...t.filter((a) => !
|
|
6357
|
+
let r = J.includes(e.api.model);
|
|
6358
|
+
return [...t.filter((a) => !fe.has(a.name)), r ? Ue : Fr];
|
|
6359
|
+
}
|
|
6360
|
+
function Re(e, t) {
|
|
6361
|
+
let r = e.filter((n) => !fe.has(n.name)),
|
|
6362
|
+
a = [Ue, Lt];
|
|
6363
|
+
return (a.push(Ve, Fe), [...r, ...a]);
|
|
6364
|
+
}
|
|
6365
|
+
function zr(e) {
|
|
6366
|
+
return [
|
|
6367
|
+
...e
|
|
6368
|
+
.filter((t) => !Gr.has(t.name) && !fe.has(t.name))
|
|
6369
|
+
.map((t) => {
|
|
6370
|
+
if (t.name === 'resolution')
|
|
6371
|
+
return {
|
|
6372
|
+
...t,
|
|
6373
|
+
...(t.options
|
|
6374
|
+
? {
|
|
6375
|
+
options: t.options.filter((a) =>
|
|
6376
|
+
['480p', '720p'].includes(String(a).toLowerCase()),
|
|
6377
|
+
),
|
|
6378
|
+
}
|
|
6379
|
+
: {}),
|
|
6380
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Y}`,
|
|
6381
|
+
};
|
|
6382
|
+
let r = Hr[t.name];
|
|
6383
|
+
return r && typeof t.description == 'string'
|
|
6384
|
+
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
|
|
6385
|
+
: t;
|
|
6386
|
+
}),
|
|
6387
|
+
Ue,
|
|
6388
|
+
Lt,
|
|
6389
|
+
Ve,
|
|
6390
|
+
Fe,
|
|
6391
|
+
];
|
|
6305
6392
|
}
|
|
6306
|
-
function
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6393
|
+
function Nt(e) {
|
|
6394
|
+
return (
|
|
6395
|
+
e.startsWith('seedance-2-5-') &&
|
|
6396
|
+
e !== 'seedance-2-5-lite' &&
|
|
6397
|
+
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
6398
|
+
);
|
|
6310
6399
|
}
|
|
6311
|
-
function
|
|
6400
|
+
function Ct(e, t = {}) {
|
|
6312
6401
|
return [
|
|
6313
6402
|
...e
|
|
6314
|
-
.filter((r) => !
|
|
6403
|
+
.filter((r) => !jr.has(r.name) && !fe.has(r.name))
|
|
6315
6404
|
.map((r) =>
|
|
6316
6405
|
r.name === 'prompt'
|
|
6317
6406
|
? { ...r, required: !0 }
|
|
@@ -6321,7 +6410,7 @@ function Pt(e, t = {}) {
|
|
|
6321
6410
|
...(t.no4k && r.options
|
|
6322
6411
|
? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
6323
6412
|
: {}),
|
|
6324
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
6413
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Y}`,
|
|
6325
6414
|
}
|
|
6326
6415
|
: r,
|
|
6327
6416
|
),
|
|
@@ -6332,11 +6421,11 @@ function Pt(e, t = {}) {
|
|
|
6332
6421
|
options: ['standard'],
|
|
6333
6422
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
6334
6423
|
},
|
|
6335
|
-
|
|
6336
|
-
|
|
6424
|
+
Ve,
|
|
6425
|
+
Fe,
|
|
6337
6426
|
];
|
|
6338
6427
|
}
|
|
6339
|
-
function
|
|
6428
|
+
function Oe(e, t) {
|
|
6340
6429
|
return [
|
|
6341
6430
|
M('Text prompt describing the video.'),
|
|
6342
6431
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -6348,7 +6437,7 @@ function Ee(e, t) {
|
|
|
6348
6437
|
max: t.maxSec,
|
|
6349
6438
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
6350
6439
|
},
|
|
6351
|
-
|
|
6440
|
+
R(e),
|
|
6352
6441
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
6353
6442
|
...t.references.map((r) =>
|
|
6354
6443
|
r.endsWith('s')
|
|
@@ -6365,8 +6454,8 @@ function Ee(e, t) {
|
|
|
6365
6454
|
),
|
|
6366
6455
|
];
|
|
6367
6456
|
}
|
|
6368
|
-
function
|
|
6369
|
-
let t =
|
|
6457
|
+
function Jr(e) {
|
|
6458
|
+
let t = Dt(e);
|
|
6370
6459
|
return [
|
|
6371
6460
|
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
6372
6461
|
...(t ? [t] : []),
|
|
@@ -6376,17 +6465,17 @@ function Vr(e) {
|
|
|
6376
6465
|
default: 'low',
|
|
6377
6466
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
6378
6467
|
},
|
|
6379
|
-
|
|
6468
|
+
R(
|
|
6380
6469
|
e,
|
|
6381
6470
|
e.slug === 'gpt-image-2'
|
|
6382
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
6471
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ot}`
|
|
6383
6472
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6384
6473
|
),
|
|
6385
6474
|
{
|
|
6386
6475
|
name: 'aspect_ratio',
|
|
6387
6476
|
type: 'select',
|
|
6388
6477
|
default: 'auto',
|
|
6389
|
-
options: [...
|
|
6478
|
+
options: [...st],
|
|
6390
6479
|
description:
|
|
6391
6480
|
"The frame. auto: an edit keeps its first input image's ratio (the nearest listed one), text to image is 1:1. The image is delivered at exactly the size for the ratio and resolution.",
|
|
6392
6481
|
},
|
|
@@ -6433,7 +6522,7 @@ function Vr(e) {
|
|
|
6433
6522
|
},
|
|
6434
6523
|
];
|
|
6435
6524
|
}
|
|
6436
|
-
function
|
|
6525
|
+
function Wr(e) {
|
|
6437
6526
|
return [
|
|
6438
6527
|
M('Image prompt text.'),
|
|
6439
6528
|
{
|
|
@@ -6441,8 +6530,8 @@ function Nr(e) {
|
|
|
6441
6530
|
type: 'string[]',
|
|
6442
6531
|
description: 'Images to edit or use as reference (up to 14).',
|
|
6443
6532
|
},
|
|
6444
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
6445
|
-
|
|
6533
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...wt(e.slug)] },
|
|
6534
|
+
R(e),
|
|
6446
6535
|
{
|
|
6447
6536
|
name: 'n',
|
|
6448
6537
|
type: 'slider',
|
|
@@ -6467,10 +6556,10 @@ function Nr(e) {
|
|
|
6467
6556
|
},
|
|
6468
6557
|
];
|
|
6469
6558
|
}
|
|
6470
|
-
function
|
|
6471
|
-
let e =
|
|
6559
|
+
function Zr() {
|
|
6560
|
+
let e = Pt,
|
|
6472
6561
|
t = [];
|
|
6473
|
-
for (let r of
|
|
6562
|
+
for (let r of Be(!0))
|
|
6474
6563
|
e.includes(r.name) &&
|
|
6475
6564
|
(t.push({
|
|
6476
6565
|
...r,
|
|
@@ -6492,12 +6581,12 @@ function jr() {
|
|
|
6492
6581
|
}));
|
|
6493
6582
|
return t;
|
|
6494
6583
|
}
|
|
6495
|
-
function
|
|
6496
|
-
return
|
|
6584
|
+
function ea() {
|
|
6585
|
+
return Be(!0).map((e) =>
|
|
6497
6586
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6498
6587
|
);
|
|
6499
6588
|
}
|
|
6500
|
-
function
|
|
6589
|
+
function Be(e) {
|
|
6501
6590
|
return [
|
|
6502
6591
|
M('The user message or task.'),
|
|
6503
6592
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -6592,21 +6681,21 @@ function De(e) {
|
|
|
6592
6681
|
},
|
|
6593
6682
|
];
|
|
6594
6683
|
}
|
|
6595
|
-
function
|
|
6596
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6597
|
-
let t =
|
|
6684
|
+
function ta(e) {
|
|
6685
|
+
if (e.slug === 'seed-2-1-turbo') return Xr;
|
|
6686
|
+
let t = Dt(e);
|
|
6598
6687
|
return [
|
|
6599
6688
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
6600
|
-
?
|
|
6689
|
+
? Zr()
|
|
6601
6690
|
: e.slug === 'gemini-3.7-flash'
|
|
6602
|
-
?
|
|
6603
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6604
|
-
?
|
|
6605
|
-
:
|
|
6691
|
+
? ea()
|
|
6692
|
+
: e.slug === 'gpt-6-astra' || Qr.includes(e.slug)
|
|
6693
|
+
? Be(e.slug !== 'gpt-6-astra')
|
|
6694
|
+
: Yr),
|
|
6606
6695
|
...(t ? [t] : []),
|
|
6607
6696
|
];
|
|
6608
6697
|
}
|
|
6609
|
-
function
|
|
6698
|
+
function De() {
|
|
6610
6699
|
return {
|
|
6611
6700
|
name: 'image',
|
|
6612
6701
|
type: 'string',
|
|
@@ -6614,7 +6703,7 @@ function Ae() {
|
|
|
6614
6703
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
6615
6704
|
};
|
|
6616
6705
|
}
|
|
6617
|
-
function
|
|
6706
|
+
function aa(e) {
|
|
6618
6707
|
return [
|
|
6619
6708
|
{
|
|
6620
6709
|
name: 'video_url',
|
|
@@ -6623,7 +6712,7 @@ function Jr(e) {
|
|
|
6623
6712
|
description:
|
|
6624
6713
|
'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
|
|
6625
6714
|
},
|
|
6626
|
-
|
|
6715
|
+
R(
|
|
6627
6716
|
e,
|
|
6628
6717
|
'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
|
|
6629
6718
|
),
|
|
@@ -6636,7 +6725,7 @@ function Jr(e) {
|
|
|
6636
6725
|
},
|
|
6637
6726
|
];
|
|
6638
6727
|
}
|
|
6639
|
-
function
|
|
6728
|
+
function ia() {
|
|
6640
6729
|
return [
|
|
6641
6730
|
{
|
|
6642
6731
|
name: 'mode',
|
|
@@ -6700,32 +6789,33 @@ function Wr() {
|
|
|
6700
6789
|
},
|
|
6701
6790
|
];
|
|
6702
6791
|
}
|
|
6703
|
-
function
|
|
6792
|
+
function na(e) {
|
|
6704
6793
|
let t = e.slug;
|
|
6705
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
6706
|
-
if (
|
|
6707
|
-
if (e.kind === 'llm') return
|
|
6708
|
-
if (e.editVariants?.length) return
|
|
6794
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return ia();
|
|
6795
|
+
if (oe.some((r) => r.slug === t)) return aa(e);
|
|
6796
|
+
if (e.kind === 'llm') return ta(e);
|
|
6797
|
+
if (e.editVariants?.length) return Jr(e);
|
|
6798
|
+
if (Nt(t)) return zr(Le);
|
|
6709
6799
|
switch (t) {
|
|
6710
6800
|
case 'seedance-2-5':
|
|
6711
|
-
return
|
|
6801
|
+
return Re(Le, t);
|
|
6712
6802
|
case 'seedance-2-5-lite':
|
|
6713
|
-
return
|
|
6803
|
+
return Ct(Le, { no4k: !0 });
|
|
6714
6804
|
case 'seedance-2':
|
|
6715
|
-
return
|
|
6805
|
+
return Re($t, t);
|
|
6716
6806
|
case 'seedance-2-lite':
|
|
6717
|
-
return
|
|
6807
|
+
return Ct($t);
|
|
6718
6808
|
case 'seedance-2-mini':
|
|
6719
|
-
return
|
|
6809
|
+
return Re(sa, t);
|
|
6720
6810
|
case 'nano-banana-2':
|
|
6721
6811
|
case 'nano-banana-2.1':
|
|
6722
6812
|
case 'nano-banana-pro':
|
|
6723
|
-
return
|
|
6813
|
+
return Wr(e);
|
|
6724
6814
|
case 'seedream-5-pro':
|
|
6725
6815
|
return [
|
|
6726
6816
|
M('Detailed description of the image to generate.'),
|
|
6727
6817
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
6728
|
-
|
|
6818
|
+
R(e),
|
|
6729
6819
|
{
|
|
6730
6820
|
name: 'aspect_ratio',
|
|
6731
6821
|
type: 'select',
|
|
@@ -6753,7 +6843,7 @@ function Yr(e) {
|
|
|
6753
6843
|
description:
|
|
6754
6844
|
'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
|
|
6755
6845
|
},
|
|
6756
|
-
|
|
6846
|
+
R(
|
|
6757
6847
|
e,
|
|
6758
6848
|
'1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
|
|
6759
6849
|
),
|
|
@@ -6799,7 +6889,7 @@ function Yr(e) {
|
|
|
6799
6889
|
type: 'string[]',
|
|
6800
6890
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
6801
6891
|
},
|
|
6802
|
-
|
|
6892
|
+
R(e),
|
|
6803
6893
|
{
|
|
6804
6894
|
name: 'aspect_ratio',
|
|
6805
6895
|
type: 'select',
|
|
@@ -6818,7 +6908,7 @@ function Yr(e) {
|
|
|
6818
6908
|
case 'z-image-pro':
|
|
6819
6909
|
return [
|
|
6820
6910
|
M('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
6821
|
-
|
|
6911
|
+
R(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
6822
6912
|
{
|
|
6823
6913
|
name: 'aspect_ratio',
|
|
6824
6914
|
type: 'select',
|
|
@@ -6871,7 +6961,7 @@ function Yr(e) {
|
|
|
6871
6961
|
];
|
|
6872
6962
|
case 'enhancor-skin-fix-v1':
|
|
6873
6963
|
return [
|
|
6874
|
-
|
|
6964
|
+
De(),
|
|
6875
6965
|
{
|
|
6876
6966
|
name: 'mode',
|
|
6877
6967
|
type: 'select',
|
|
@@ -6904,11 +6994,11 @@ function Yr(e) {
|
|
|
6904
6994
|
max: 0.4,
|
|
6905
6995
|
description: 'Portrait depth. Heavy only.',
|
|
6906
6996
|
},
|
|
6907
|
-
...
|
|
6997
|
+
...ra,
|
|
6908
6998
|
];
|
|
6909
6999
|
case 'enhancor-skin-fix-v3':
|
|
6910
7000
|
return [
|
|
6911
|
-
|
|
7001
|
+
De(),
|
|
6912
7002
|
{
|
|
6913
7003
|
name: 'mask_image',
|
|
6914
7004
|
type: 'string',
|
|
@@ -6948,7 +7038,7 @@ function Yr(e) {
|
|
|
6948
7038
|
];
|
|
6949
7039
|
case 'enhancor-skin-fix-v4':
|
|
6950
7040
|
return [
|
|
6951
|
-
|
|
7041
|
+
De(),
|
|
6952
7042
|
{
|
|
6953
7043
|
name: 'mode',
|
|
6954
7044
|
type: 'select',
|
|
@@ -6979,7 +7069,7 @@ function Yr(e) {
|
|
|
6979
7069
|
];
|
|
6980
7070
|
case 'wan-3-0':
|
|
6981
7071
|
case 'wan-3-0-prime':
|
|
6982
|
-
return
|
|
7072
|
+
return Oe(e, {
|
|
6983
7073
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6984
7074
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
6985
7075
|
minSec: 2,
|
|
@@ -6989,7 +7079,7 @@ function Yr(e) {
|
|
|
6989
7079
|
});
|
|
6990
7080
|
case 'happy-horse-1-1':
|
|
6991
7081
|
case 'happy-horse-1-0':
|
|
6992
|
-
return
|
|
7082
|
+
return Oe(e, {
|
|
6993
7083
|
modes:
|
|
6994
7084
|
t === 'happy-horse-1-0'
|
|
6995
7085
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -7000,7 +7090,7 @@ function Yr(e) {
|
|
|
7000
7090
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
7001
7091
|
});
|
|
7002
7092
|
case 'minimax-h3':
|
|
7003
|
-
return
|
|
7093
|
+
return Oe(e, {
|
|
7004
7094
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7005
7095
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
7006
7096
|
minSec: 4,
|
|
@@ -7011,161 +7101,208 @@ function Yr(e) {
|
|
|
7011
7101
|
return [M('Prompt text.')];
|
|
7012
7102
|
}
|
|
7013
7103
|
}
|
|
7014
|
-
function
|
|
7104
|
+
function oa() {
|
|
7105
|
+
return {
|
|
7106
|
+
slug: ue,
|
|
7107
|
+
name: St,
|
|
7108
|
+
category: 'Image',
|
|
7109
|
+
kind: 'Image-to-Image',
|
|
7110
|
+
vendor: 'Enhancor',
|
|
7111
|
+
description:
|
|
7112
|
+
'Upscales a photo, with an optional skin fix. Full makes the photo its size times the scale; Fast makes a fixed size (long side 2432 px).',
|
|
7113
|
+
priceFormatted: '',
|
|
7114
|
+
unit: '/img',
|
|
7115
|
+
primaryToolName: Rt.image,
|
|
7116
|
+
parameters: [
|
|
7117
|
+
{
|
|
7118
|
+
name: 'image',
|
|
7119
|
+
type: 'string',
|
|
7120
|
+
required: !0,
|
|
7121
|
+
description:
|
|
7122
|
+
"The photo to upscale: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.",
|
|
7123
|
+
},
|
|
7124
|
+
{
|
|
7125
|
+
name: 'skin_fix',
|
|
7126
|
+
type: 'boolean',
|
|
7127
|
+
default: !1,
|
|
7128
|
+
description: 'Also fixes the skin. Off by default.',
|
|
7129
|
+
},
|
|
7130
|
+
{
|
|
7131
|
+
name: 'mode',
|
|
7132
|
+
type: 'select',
|
|
7133
|
+
default: 'full',
|
|
7134
|
+
options: ['full', 'fast'],
|
|
7135
|
+
description:
|
|
7136
|
+
'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum.',
|
|
7137
|
+
},
|
|
7138
|
+
{
|
|
7139
|
+
name: 'scale',
|
|
7140
|
+
type: 'select',
|
|
7141
|
+
default: String(Et),
|
|
7142
|
+
options: z.noSkin.map(String),
|
|
7143
|
+
description: `Full only. ${z.skin.join(', ')} with skin_fix on; also ${z.noSkin.filter((e) => !z.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
|
|
7144
|
+
},
|
|
7145
|
+
],
|
|
7146
|
+
};
|
|
7147
|
+
}
|
|
7148
|
+
function Ne(e, t = e.api.model) {
|
|
7015
7149
|
return {
|
|
7016
7150
|
slug: t,
|
|
7017
7151
|
name: e.name,
|
|
7018
|
-
category:
|
|
7019
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
7152
|
+
category: Lr[e.kind],
|
|
7153
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Nr[e.kind],
|
|
7020
7154
|
vendor: e.vendor ?? '',
|
|
7021
7155
|
description: e.desc ?? e.name,
|
|
7022
|
-
priceFormatted:
|
|
7156
|
+
priceFormatted: Ur(e),
|
|
7023
7157
|
unit: e.unit,
|
|
7024
|
-
primaryToolName:
|
|
7025
|
-
parameters:
|
|
7158
|
+
primaryToolName: Rt[e.kind],
|
|
7159
|
+
parameters: Br(e, na(e)),
|
|
7026
7160
|
};
|
|
7027
7161
|
}
|
|
7028
|
-
function
|
|
7162
|
+
function la() {
|
|
7029
7163
|
let e = {};
|
|
7030
|
-
for (let t of
|
|
7164
|
+
for (let t of pe())
|
|
7031
7165
|
if (t.slug !== 'seedance-2-fast') {
|
|
7032
7166
|
if (t.slug === 'seedance-2-mini') {
|
|
7033
|
-
e['seedance-2-mini'] =
|
|
7167
|
+
e['seedance-2-mini'] = Ne(t, 'seedance-2-mini');
|
|
7034
7168
|
continue;
|
|
7035
7169
|
}
|
|
7036
7170
|
if (t.slug === 'seedance-2') {
|
|
7037
|
-
let r =
|
|
7171
|
+
let r = Ne(t);
|
|
7038
7172
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
7039
7173
|
(e['seedance-2'] = r));
|
|
7040
7174
|
continue;
|
|
7041
7175
|
}
|
|
7042
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
7176
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Ne(t));
|
|
7043
7177
|
}
|
|
7044
|
-
Object.assign(e,
|
|
7045
|
-
for (let [t, r] of Object.entries(
|
|
7178
|
+
(Object.assign(e, Mt()), (e[ue] = oa()));
|
|
7179
|
+
for (let [t, r] of Object.entries(ce))
|
|
7046
7180
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
7047
7181
|
return e;
|
|
7048
7182
|
}
|
|
7049
|
-
function
|
|
7183
|
+
function he(e) {
|
|
7050
7184
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
7051
7185
|
}
|
|
7052
|
-
function
|
|
7053
|
-
return
|
|
7186
|
+
function B(e) {
|
|
7187
|
+
return ge[e] ?? null;
|
|
7054
7188
|
}
|
|
7055
|
-
function
|
|
7056
|
-
if (e.startsWith('enhancor-skin-fix-')) return !1;
|
|
7057
|
-
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
7189
|
+
function pa(e, t, r) {
|
|
7190
|
+
if (e.startsWith('enhancor-skin-fix-') || e === ue) return !1;
|
|
7191
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Nt(e)) && t === 'duration') {
|
|
7058
7192
|
let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
7059
7193
|
if (a(r.mode) === 'edit' || a(r.omni_reference_task_type) === 'edit') return !1;
|
|
7060
7194
|
}
|
|
7061
7195
|
return !(
|
|
7062
|
-
(t === 'max_tokens' &&
|
|
7063
|
-
(t === 'max_completion_tokens' &&
|
|
7196
|
+
(t === 'max_tokens' && At(r.max_completion_tokens)) ||
|
|
7197
|
+
(t === 'max_completion_tokens' && At(r.max_tokens))
|
|
7064
7198
|
);
|
|
7065
7199
|
}
|
|
7066
|
-
function
|
|
7200
|
+
function At(e) {
|
|
7067
7201
|
return e != null && e !== '';
|
|
7068
7202
|
}
|
|
7069
|
-
function
|
|
7203
|
+
function Ft(e, t) {
|
|
7070
7204
|
let r = { ...t };
|
|
7071
7205
|
if (e?.slug === 'seedance-2-5') {
|
|
7072
7206
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
7073
|
-
for (let n of
|
|
7207
|
+
for (let n of da) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
|
|
7074
7208
|
if (!a(r.finalize)) return r;
|
|
7075
7209
|
}
|
|
7076
7210
|
for (let a of e?.parameters ?? [])
|
|
7077
7211
|
a.default !== void 0 &&
|
|
7078
7212
|
r[a.name] === void 0 &&
|
|
7079
|
-
|
|
7213
|
+
pa(e.slug, a.name, t) &&
|
|
7080
7214
|
(r[a.name] = a.default);
|
|
7081
7215
|
return r;
|
|
7082
7216
|
}
|
|
7083
|
-
function
|
|
7084
|
-
return Object.values(
|
|
7217
|
+
function O() {
|
|
7218
|
+
return Object.values(ge);
|
|
7085
7219
|
}
|
|
7086
|
-
var
|
|
7087
|
-
|
|
7088
|
-
|
|
7220
|
+
var Lr,
|
|
7221
|
+
Rt,
|
|
7222
|
+
Nr,
|
|
7089
7223
|
M,
|
|
7090
|
-
|
|
7091
|
-
Or,
|
|
7092
|
-
Rr,
|
|
7093
|
-
qt,
|
|
7094
|
-
$t,
|
|
7095
|
-
Re,
|
|
7096
|
-
Lr,
|
|
7097
|
-
Ur,
|
|
7098
|
-
Br,
|
|
7224
|
+
Ue,
|
|
7099
7225
|
Fr,
|
|
7226
|
+
Lt,
|
|
7227
|
+
Ve,
|
|
7228
|
+
Fe,
|
|
7229
|
+
fe,
|
|
7230
|
+
jr,
|
|
7231
|
+
Gr,
|
|
7100
7232
|
Hr,
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
Ct,
|
|
7104
|
-
Et,
|
|
7105
|
-
vt,
|
|
7233
|
+
Yr,
|
|
7234
|
+
Xr,
|
|
7106
7235
|
Qr,
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7236
|
+
ra,
|
|
7237
|
+
Y,
|
|
7238
|
+
Le,
|
|
7239
|
+
Ut,
|
|
7240
|
+
Vt,
|
|
7241
|
+
$t,
|
|
7242
|
+
sa,
|
|
7243
|
+
ge,
|
|
7244
|
+
da,
|
|
7245
|
+
X = y(() => {
|
|
7110
7246
|
'use strict';
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
yt();
|
|
7247
|
+
lt();
|
|
7248
|
+
ve();
|
|
7249
|
+
F();
|
|
7250
|
+
qe();
|
|
7251
|
+
Te();
|
|
7252
|
+
Ce();
|
|
7253
|
+
kt();
|
|
7254
|
+
xt();
|
|
7120
7255
|
It();
|
|
7121
|
-
|
|
7122
|
-
(
|
|
7123
|
-
|
|
7256
|
+
Kt();
|
|
7257
|
+
qt();
|
|
7258
|
+
Ae();
|
|
7259
|
+
((Lr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
7260
|
+
(Rt = {
|
|
7124
7261
|
video: 'generate_video',
|
|
7125
7262
|
image: 'generate_image',
|
|
7126
7263
|
audio: 'generate_audio',
|
|
7127
7264
|
llm: 'run_task',
|
|
7128
7265
|
}),
|
|
7129
|
-
(
|
|
7266
|
+
(Nr = {
|
|
7130
7267
|
video: 'Text-to-Video',
|
|
7131
7268
|
image: 'Text-to-Image',
|
|
7132
7269
|
audio: 'Text-to-Audio',
|
|
7133
7270
|
llm: 'Reasoning (LLM)',
|
|
7134
7271
|
}));
|
|
7135
7272
|
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
7136
|
-
((
|
|
7273
|
+
((Ue = {
|
|
7137
7274
|
name: 'creative_mode',
|
|
7138
7275
|
type: 'boolean',
|
|
7139
7276
|
default: !1,
|
|
7140
7277
|
description:
|
|
7141
7278
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
7142
7279
|
}),
|
|
7143
|
-
(
|
|
7280
|
+
(Fr = {
|
|
7144
7281
|
name: 'creative_mode',
|
|
7145
7282
|
type: 'boolean',
|
|
7146
7283
|
default: !1,
|
|
7147
|
-
description: `Not available yet on this model: ${
|
|
7284
|
+
description: `Not available yet on this model: ${me}.`,
|
|
7148
7285
|
}),
|
|
7149
|
-
(
|
|
7286
|
+
(Lt = {
|
|
7150
7287
|
name: 'priority',
|
|
7151
7288
|
type: 'boolean',
|
|
7152
7289
|
default: !1,
|
|
7153
7290
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
7154
7291
|
}),
|
|
7155
|
-
(
|
|
7292
|
+
(Ve = {
|
|
7156
7293
|
name: 'reference_roles',
|
|
7157
7294
|
type: 'json',
|
|
7158
7295
|
description: `Omni Reference only. Role of each reference, by tag { "@Image1": "prop" } or by kind { "image": ["prop"] }. Image: appearance, clothing, prop, scene_layout, lighting, first_frame, last_frame; Seedance 2.5 also keyframe, storyboard. Video: motion, camera, style; Seedance 2.5 also blockout_coarse, blockout_fine. Audio: voice, ambience, music, sound_effect. On a tag, the value image, video or audio uses that kind's default (appearance, motion, voice).`,
|
|
7159
7296
|
}),
|
|
7160
|
-
(
|
|
7297
|
+
(Fe = {
|
|
7161
7298
|
name: 'auto_fit_images',
|
|
7162
7299
|
type: 'boolean',
|
|
7163
7300
|
default: !1,
|
|
7164
7301
|
description:
|
|
7165
7302
|
'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.',
|
|
7166
7303
|
}),
|
|
7167
|
-
(
|
|
7168
|
-
|
|
7304
|
+
(fe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
7305
|
+
((jr = new Set([
|
|
7169
7306
|
'quality',
|
|
7170
7307
|
'bitrate_mode',
|
|
7171
7308
|
'draft',
|
|
@@ -7173,8 +7310,21 @@ var qr,
|
|
|
7173
7310
|
'draft_task_id',
|
|
7174
7311
|
'draft_generation_id',
|
|
7175
7312
|
'pass_faces',
|
|
7176
|
-
])
|
|
7177
|
-
|
|
7313
|
+
])),
|
|
7314
|
+
(Gr = new Set([
|
|
7315
|
+
'quality',
|
|
7316
|
+
'bitrate_mode',
|
|
7317
|
+
'draft',
|
|
7318
|
+
'finalize',
|
|
7319
|
+
'draft_task_id',
|
|
7320
|
+
'draft_generation_id',
|
|
7321
|
+
])),
|
|
7322
|
+
(Hr = {
|
|
7323
|
+
images: 'up to 10',
|
|
7324
|
+
videos: 'up to 5; combined duration < 30s',
|
|
7325
|
+
audios: 'up to 5; combined duration < 30s',
|
|
7326
|
+
}));
|
|
7327
|
+
((Yr = [
|
|
7178
7328
|
M('The user message or task.'),
|
|
7179
7329
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7180
7330
|
{
|
|
@@ -7192,7 +7342,7 @@ var qr,
|
|
|
7192
7342
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
7193
7343
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
7194
7344
|
]),
|
|
7195
|
-
(
|
|
7345
|
+
(Xr = [
|
|
7196
7346
|
M('The user message or task.'),
|
|
7197
7347
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7198
7348
|
{
|
|
@@ -7274,8 +7424,8 @@ var qr,
|
|
|
7274
7424
|
description: 'Video frames read a second.',
|
|
7275
7425
|
},
|
|
7276
7426
|
]),
|
|
7277
|
-
(
|
|
7278
|
-
|
|
7427
|
+
(Qr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
7428
|
+
ra = Object.entries({
|
|
7279
7429
|
background: !1,
|
|
7280
7430
|
skin: !1,
|
|
7281
7431
|
nose: !1,
|
|
@@ -7301,8 +7451,8 @@ var qr,
|
|
|
7301
7451
|
default: t,
|
|
7302
7452
|
description: 'Keep this part out of the fix. Standard only.',
|
|
7303
7453
|
}));
|
|
7304
|
-
((
|
|
7305
|
-
(
|
|
7454
|
+
((Y = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
7455
|
+
(Le = [
|
|
7306
7456
|
{
|
|
7307
7457
|
name: 'prompt',
|
|
7308
7458
|
type: 'string',
|
|
@@ -7340,7 +7490,7 @@ var qr,
|
|
|
7340
7490
|
type: 'select',
|
|
7341
7491
|
default: '480p',
|
|
7342
7492
|
options: ['480p', '720p', '1080p', '4k'],
|
|
7343
|
-
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${
|
|
7493
|
+
description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${Y}`,
|
|
7344
7494
|
},
|
|
7345
7495
|
{
|
|
7346
7496
|
name: 'aspect_ratio',
|
|
@@ -7451,19 +7601,19 @@ var qr,
|
|
|
7451
7601
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7452
7602
|
},
|
|
7453
7603
|
]),
|
|
7454
|
-
(
|
|
7604
|
+
(Ut = {
|
|
7455
7605
|
name: 'images',
|
|
7456
7606
|
type: 'string[]',
|
|
7457
7607
|
description:
|
|
7458
7608
|
'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
7459
7609
|
}),
|
|
7460
|
-
(
|
|
7610
|
+
(Vt = {
|
|
7461
7611
|
name: 'audios',
|
|
7462
7612
|
type: 'string[]',
|
|
7463
7613
|
description:
|
|
7464
7614
|
'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
7465
7615
|
}),
|
|
7466
|
-
(
|
|
7616
|
+
($t = [
|
|
7467
7617
|
{
|
|
7468
7618
|
name: 'prompt',
|
|
7469
7619
|
type: 'string',
|
|
@@ -7507,7 +7657,7 @@ var qr,
|
|
|
7507
7657
|
type: 'select',
|
|
7508
7658
|
default: '480p',
|
|
7509
7659
|
options: ['480p', '720p', '1080p', '4k'],
|
|
7510
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
7660
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Y}`,
|
|
7511
7661
|
},
|
|
7512
7662
|
{
|
|
7513
7663
|
name: 'bitrate_mode',
|
|
@@ -7541,8 +7691,8 @@ var qr,
|
|
|
7541
7691
|
description:
|
|
7542
7692
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7543
7693
|
},
|
|
7544
|
-
|
|
7545
|
-
|
|
7694
|
+
Ut,
|
|
7695
|
+
Vt,
|
|
7546
7696
|
{
|
|
7547
7697
|
name: 'first_frame_image',
|
|
7548
7698
|
type: 'string',
|
|
@@ -7563,7 +7713,7 @@ var qr,
|
|
|
7563
7713
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7564
7714
|
},
|
|
7565
7715
|
]),
|
|
7566
|
-
(
|
|
7716
|
+
(sa = [
|
|
7567
7717
|
{
|
|
7568
7718
|
name: 'prompt',
|
|
7569
7719
|
type: 'string',
|
|
@@ -7584,7 +7734,7 @@ var qr,
|
|
|
7584
7734
|
type: 'select',
|
|
7585
7735
|
default: '480p',
|
|
7586
7736
|
options: ['480p', '720p'],
|
|
7587
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
7737
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Y}`,
|
|
7588
7738
|
},
|
|
7589
7739
|
{
|
|
7590
7740
|
name: 'bitrate_mode',
|
|
@@ -7618,8 +7768,8 @@ var qr,
|
|
|
7618
7768
|
description:
|
|
7619
7769
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7620
7770
|
},
|
|
7621
|
-
|
|
7622
|
-
|
|
7771
|
+
Ut,
|
|
7772
|
+
Vt,
|
|
7623
7773
|
{
|
|
7624
7774
|
name: 'first_frame_image',
|
|
7625
7775
|
type: 'string',
|
|
@@ -7634,53 +7784,53 @@ var qr,
|
|
|
7634
7784
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7635
7785
|
},
|
|
7636
7786
|
]));
|
|
7637
|
-
|
|
7638
|
-
|
|
7787
|
+
ge = la();
|
|
7788
|
+
da = ['draft_task_id', 'draft_generation_id'];
|
|
7639
7789
|
});
|
|
7640
|
-
function
|
|
7790
|
+
function ye(e) {
|
|
7641
7791
|
let t = '/v1/pricing/models',
|
|
7642
7792
|
r = e?.trim();
|
|
7643
7793
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7644
7794
|
}
|
|
7645
|
-
var
|
|
7795
|
+
var Ge = y(() => {
|
|
7646
7796
|
'use strict';
|
|
7647
7797
|
});
|
|
7648
|
-
function
|
|
7798
|
+
function Zt(e) {
|
|
7649
7799
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
7650
7800
|
}
|
|
7651
|
-
function
|
|
7652
|
-
let t =
|
|
7653
|
-
r = t.filter((s) =>
|
|
7654
|
-
a = t.filter((s) => !
|
|
7801
|
+
function er(e) {
|
|
7802
|
+
let t = pe().filter((s) => s.kind === e && s.unfiltered != null),
|
|
7803
|
+
r = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
|
|
7804
|
+
a = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
|
|
7655
7805
|
return [
|
|
7656
7806
|
...(r.length
|
|
7657
|
-
? [`${
|
|
7807
|
+
? [`${Zt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7658
7808
|
: []),
|
|
7659
|
-
...(a.length ? [`Not available yet on ${
|
|
7809
|
+
...(a.length ? [`Not available yet on ${Zt(a)}: ${me}.`] : []),
|
|
7660
7810
|
'The Acceptable Use Policy applies.',
|
|
7661
7811
|
].join(' ');
|
|
7662
7812
|
}
|
|
7663
|
-
function
|
|
7664
|
-
if (
|
|
7813
|
+
function Aa(e) {
|
|
7814
|
+
if (Ca.has(e.name)) return e;
|
|
7665
7815
|
let t = e.inputSchema.properties;
|
|
7666
7816
|
return !t || t.callback_url
|
|
7667
7817
|
? e
|
|
7668
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7818
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: qa } } };
|
|
7669
7819
|
}
|
|
7670
|
-
function
|
|
7820
|
+
function Ra(e) {
|
|
7671
7821
|
let t = e.inputSchema.properties;
|
|
7672
7822
|
if (!t) return e;
|
|
7673
7823
|
let r = !1,
|
|
7674
7824
|
a = {};
|
|
7675
7825
|
for (let [n, s] of Object.entries(t))
|
|
7676
|
-
|
|
7826
|
+
tr.has(n) && s.type === 'string' && !s.format
|
|
7677
7827
|
? ((a[n] = { ...s, format: 'uri' }), (r = !0))
|
|
7678
|
-
:
|
|
7828
|
+
: tr.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
7679
7829
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
|
|
7680
7830
|
: (a[n] = s);
|
|
7681
7831
|
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
7682
7832
|
}
|
|
7683
|
-
function
|
|
7833
|
+
function Oa(e) {
|
|
7684
7834
|
switch (e.type) {
|
|
7685
7835
|
case 'string':
|
|
7686
7836
|
return {
|
|
@@ -7735,11 +7885,11 @@ function Ta(e) {
|
|
|
7735
7885
|
return { type: 'string', description: e.description };
|
|
7736
7886
|
}
|
|
7737
7887
|
}
|
|
7738
|
-
function
|
|
7888
|
+
function Da(e, t) {
|
|
7739
7889
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7740
7890
|
a = {},
|
|
7741
7891
|
n = [];
|
|
7742
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
7892
|
+
for (let o of e.parameters) ((a[o.name] = Oa(o)), o.required && n.push(o.name));
|
|
7743
7893
|
let s = {
|
|
7744
7894
|
type: 'object',
|
|
7745
7895
|
properties: a,
|
|
@@ -7752,11 +7902,11 @@ function Ma(e, t) {
|
|
|
7752
7902
|
inputSchema: s,
|
|
7753
7903
|
};
|
|
7754
7904
|
}
|
|
7755
|
-
function
|
|
7756
|
-
let e =
|
|
7757
|
-
t =
|
|
7758
|
-
r =
|
|
7759
|
-
a =
|
|
7905
|
+
function La() {
|
|
7906
|
+
let e = O().filter((d) => d.category === 'Image' && !he(d)),
|
|
7907
|
+
t = O().filter((d) => d.category === 'Video'),
|
|
7908
|
+
r = O().filter((d) => d.category === 'Text'),
|
|
7909
|
+
a = O().filter((d) => d.category === 'Audio'),
|
|
7760
7910
|
n = {
|
|
7761
7911
|
name: 'generate_image',
|
|
7762
7912
|
description:
|
|
@@ -7848,7 +7998,7 @@ function Ka() {
|
|
|
7848
7998
|
maximum: 2147483647,
|
|
7849
7999
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
7850
8000
|
},
|
|
7851
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8001
|
+
creative_mode: { type: 'boolean', default: !1, description: er('image') },
|
|
7852
8002
|
},
|
|
7853
8003
|
required: ['prompt'],
|
|
7854
8004
|
additionalProperties: !0,
|
|
@@ -7885,7 +8035,7 @@ function Ka() {
|
|
|
7885
8035
|
default: '480p',
|
|
7886
8036
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
7887
8037
|
},
|
|
7888
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8038
|
+
creative_mode: { type: 'boolean', default: !1, description: er('video') },
|
|
7889
8039
|
priority: {
|
|
7890
8040
|
type: 'boolean',
|
|
7891
8041
|
default: !1,
|
|
@@ -8023,10 +8173,10 @@ function Ka() {
|
|
|
8023
8173
|
additionalProperties: !0,
|
|
8024
8174
|
},
|
|
8025
8175
|
},
|
|
8026
|
-
p =
|
|
8027
|
-
return [n, s, o, u, l, p, c,
|
|
8176
|
+
p = Na();
|
|
8177
|
+
return [n, s, o, u, l, p, c, $a];
|
|
8028
8178
|
}
|
|
8029
|
-
function
|
|
8179
|
+
function Na() {
|
|
8030
8180
|
return {
|
|
8031
8181
|
name: 'upload_asset',
|
|
8032
8182
|
description:
|
|
@@ -8073,26 +8223,26 @@ function Sa() {
|
|
|
8073
8223
|
},
|
|
8074
8224
|
};
|
|
8075
8225
|
}
|
|
8076
|
-
function
|
|
8077
|
-
let e =
|
|
8078
|
-
t =
|
|
8079
|
-
return [...e, ...t].map(
|
|
8226
|
+
function Xe() {
|
|
8227
|
+
let e = La(),
|
|
8228
|
+
t = O().map((r) => Da(r));
|
|
8229
|
+
return [...e, ...t].map(Aa).map(Ra);
|
|
8080
8230
|
}
|
|
8081
|
-
var
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8231
|
+
var qa,
|
|
8232
|
+
Ca,
|
|
8233
|
+
$a,
|
|
8234
|
+
tr,
|
|
8235
|
+
rr = y(() => {
|
|
8086
8236
|
'use strict';
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
((
|
|
8237
|
+
F();
|
|
8238
|
+
Ae();
|
|
8239
|
+
X();
|
|
8240
|
+
((qa = {
|
|
8091
8241
|
type: 'string',
|
|
8092
8242
|
description:
|
|
8093
8243
|
'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.',
|
|
8094
8244
|
}),
|
|
8095
|
-
(
|
|
8245
|
+
(Ca = new Set([
|
|
8096
8246
|
'upload_asset',
|
|
8097
8247
|
'upload_media',
|
|
8098
8248
|
'upload_image',
|
|
@@ -8100,7 +8250,7 @@ var xa,
|
|
|
8100
8250
|
'check_status',
|
|
8101
8251
|
'get_pricing',
|
|
8102
8252
|
])),
|
|
8103
|
-
(
|
|
8253
|
+
($a = {
|
|
8104
8254
|
name: 'get_pricing',
|
|
8105
8255
|
description:
|
|
8106
8256
|
'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
|
|
@@ -8115,7 +8265,7 @@ var xa,
|
|
|
8115
8265
|
additionalProperties: !1,
|
|
8116
8266
|
},
|
|
8117
8267
|
}));
|
|
8118
|
-
|
|
8268
|
+
tr = new Set([
|
|
8119
8269
|
'image',
|
|
8120
8270
|
'images',
|
|
8121
8271
|
'image_url',
|
|
@@ -8132,19 +8282,19 @@ var xa,
|
|
|
8132
8282
|
'lipsyncing_audio',
|
|
8133
8283
|
]);
|
|
8134
8284
|
});
|
|
8135
|
-
var
|
|
8136
|
-
ur
|
|
8137
|
-
forgetToolSchemas: () =>
|
|
8138
|
-
jsonRpcAnswer: () =>
|
|
8139
|
-
preprocessLocalFiles: () =>
|
|
8140
|
-
startStdioServer: () =>
|
|
8285
|
+
var ur = {};
|
|
8286
|
+
wr(ur, {
|
|
8287
|
+
forgetToolSchemas: () => ja,
|
|
8288
|
+
jsonRpcAnswer: () => sr,
|
|
8289
|
+
preprocessLocalFiles: () => dr,
|
|
8290
|
+
startStdioServer: () => cr,
|
|
8141
8291
|
});
|
|
8142
|
-
function
|
|
8292
|
+
function Ua(e) {
|
|
8143
8293
|
let t = (r) =>
|
|
8144
8294
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
8145
8295
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
8146
8296
|
}
|
|
8147
|
-
function
|
|
8297
|
+
function sr(e, t, r) {
|
|
8148
8298
|
let a = e?.id,
|
|
8149
8299
|
n = a == null,
|
|
8150
8300
|
s = null;
|
|
@@ -8153,7 +8303,7 @@ function Xt(e, t, r) {
|
|
|
8153
8303
|
} catch {
|
|
8154
8304
|
s = null;
|
|
8155
8305
|
}
|
|
8156
|
-
if (s !== null &&
|
|
8306
|
+
if (s !== null && Ua(s)) return n ? null : s;
|
|
8157
8307
|
if (n) return null;
|
|
8158
8308
|
if (!r && t >= 200 && t < 300) return;
|
|
8159
8309
|
let o = s?.error,
|
|
@@ -8174,12 +8324,12 @@ function Xt(e, t, r) {
|
|
|
8174
8324
|
},
|
|
8175
8325
|
};
|
|
8176
8326
|
}
|
|
8177
|
-
function
|
|
8327
|
+
function Va() {
|
|
8178
8328
|
let e = process.argv.slice(2),
|
|
8179
8329
|
t = e.indexOf('--api-key');
|
|
8180
|
-
return
|
|
8330
|
+
return E(t >= 0 ? e[t + 1] : void 0);
|
|
8181
8331
|
}
|
|
8182
|
-
async function
|
|
8332
|
+
async function or(e, t, r) {
|
|
8183
8333
|
let a = j.default.resolve(e);
|
|
8184
8334
|
if (!D.default.existsSync(a) || !D.default.statSync(a).isFile())
|
|
8185
8335
|
throw new Error(`File not found: ${e}`);
|
|
@@ -8208,15 +8358,15 @@ async function Zt(e, t, r) {
|
|
|
8208
8358
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
8209
8359
|
};
|
|
8210
8360
|
}
|
|
8211
|
-
function
|
|
8212
|
-
return
|
|
8361
|
+
function lr(e) {
|
|
8362
|
+
return Fa.has(j.default.extname(e).toLowerCase());
|
|
8213
8363
|
}
|
|
8214
|
-
function
|
|
8364
|
+
function pr(e) {
|
|
8215
8365
|
return new Error(
|
|
8216
8366
|
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
8217
8367
|
);
|
|
8218
8368
|
}
|
|
8219
|
-
function
|
|
8369
|
+
function Ba(e) {
|
|
8220
8370
|
let t = e.trim();
|
|
8221
8371
|
if (
|
|
8222
8372
|
!t ||
|
|
@@ -8229,22 +8379,22 @@ function Ea(e) {
|
|
|
8229
8379
|
let r = j.default.resolve(t);
|
|
8230
8380
|
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
8231
8381
|
}
|
|
8232
|
-
function
|
|
8382
|
+
function Ze(e) {
|
|
8233
8383
|
if (Array.isArray(e))
|
|
8234
8384
|
for (let t of e) {
|
|
8235
8385
|
let r = t;
|
|
8236
8386
|
typeof r.name == 'string' &&
|
|
8237
8387
|
r.inputSchema &&
|
|
8238
8388
|
typeof r.inputSchema == 'object' &&
|
|
8239
|
-
|
|
8389
|
+
ee.set(r.name, r.inputSchema);
|
|
8240
8390
|
}
|
|
8241
8391
|
}
|
|
8242
|
-
function
|
|
8243
|
-
(
|
|
8392
|
+
function ja() {
|
|
8393
|
+
(ee.clear(), (Qe = 0));
|
|
8244
8394
|
}
|
|
8245
|
-
async function
|
|
8246
|
-
if (!(Date.now() -
|
|
8247
|
-
|
|
8395
|
+
async function Ga(e, t) {
|
|
8396
|
+
if (!(Date.now() - Qe < 6e4)) {
|
|
8397
|
+
Qe = Date.now();
|
|
8248
8398
|
try {
|
|
8249
8399
|
let a = await (
|
|
8250
8400
|
await fetch(e, {
|
|
@@ -8254,39 +8404,39 @@ async function Oa(e, t) {
|
|
|
8254
8404
|
signal: AbortSignal.timeout(1e4),
|
|
8255
8405
|
})
|
|
8256
8406
|
).json();
|
|
8257
|
-
|
|
8407
|
+
Ze(a.result?.tools);
|
|
8258
8408
|
} catch {}
|
|
8259
8409
|
}
|
|
8260
8410
|
}
|
|
8261
|
-
function
|
|
8411
|
+
function Ha(e) {
|
|
8262
8412
|
return e
|
|
8263
8413
|
? e.type === 'string'
|
|
8264
8414
|
? e.format === 'uri'
|
|
8265
8415
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
8266
8416
|
: !1;
|
|
8267
8417
|
}
|
|
8268
|
-
async function
|
|
8418
|
+
async function ar(e, t, r) {
|
|
8269
8419
|
if (typeof e != 'string') return e;
|
|
8270
|
-
let a =
|
|
8420
|
+
let a = Ba(e);
|
|
8271
8421
|
if (!a) return e;
|
|
8272
|
-
if (!
|
|
8273
|
-
return (await
|
|
8422
|
+
if (!lr(a)) throw pr(a);
|
|
8423
|
+
return (await or(a, t, r)).url;
|
|
8274
8424
|
}
|
|
8275
|
-
async function
|
|
8276
|
-
(
|
|
8277
|
-
let s =
|
|
8425
|
+
async function dr(e, t, r, a, n) {
|
|
8426
|
+
(ee.size === 0 && Ze(Xe()), ee.has(e) || (await Ga(n, r)));
|
|
8427
|
+
let s = ee.get(e)?.properties;
|
|
8278
8428
|
if (!s) return t;
|
|
8279
8429
|
let o = { ...t };
|
|
8280
8430
|
for (let [u, l] of Object.entries(t))
|
|
8281
|
-
if (
|
|
8431
|
+
if (Ha(s[u]))
|
|
8282
8432
|
if (Array.isArray(l)) {
|
|
8283
8433
|
let c = [];
|
|
8284
|
-
for (let p of l) c.push(await
|
|
8434
|
+
for (let p of l) c.push(await ar(p, r, a));
|
|
8285
8435
|
o[u] = c;
|
|
8286
|
-
} else o[u] = await
|
|
8436
|
+
} else o[u] = await ar(l, r, a);
|
|
8287
8437
|
return o;
|
|
8288
8438
|
}
|
|
8289
|
-
function
|
|
8439
|
+
function za(e) {
|
|
8290
8440
|
let t = e.id ?? null;
|
|
8291
8441
|
switch (e.method) {
|
|
8292
8442
|
case 'initialize':
|
|
@@ -8304,7 +8454,7 @@ function Da(e) {
|
|
|
8304
8454
|
case 'ping':
|
|
8305
8455
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
8306
8456
|
case 'tools/list':
|
|
8307
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
8457
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Xe() } };
|
|
8308
8458
|
case 'tools/call':
|
|
8309
8459
|
return {
|
|
8310
8460
|
jsonrpc: '2.0',
|
|
@@ -8327,13 +8477,13 @@ function Da(e) {
|
|
|
8327
8477
|
};
|
|
8328
8478
|
}
|
|
8329
8479
|
}
|
|
8330
|
-
async function
|
|
8331
|
-
if (
|
|
8332
|
-
|
|
8333
|
-
let e =
|
|
8334
|
-
t =
|
|
8480
|
+
async function cr() {
|
|
8481
|
+
if (ir) return;
|
|
8482
|
+
ir = !0;
|
|
8483
|
+
let e = Va(),
|
|
8484
|
+
t = I(),
|
|
8335
8485
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
8336
|
-
(
|
|
8486
|
+
(nr.default
|
|
8337
8487
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
8338
8488
|
.on('line', async (n) => {
|
|
8339
8489
|
let s = n.trim();
|
|
@@ -8345,7 +8495,7 @@ async function ar() {
|
|
|
8345
8495
|
c = o.params.arguments || {};
|
|
8346
8496
|
if (l === 'get_pricing') {
|
|
8347
8497
|
let p = typeof c.model == 'string' ? c.model.trim() : '',
|
|
8348
|
-
d = `${t.replace(/\/+$/, '')}${
|
|
8498
|
+
d = `${t.replace(/\/+$/, '')}${ye(p)}`;
|
|
8349
8499
|
try {
|
|
8350
8500
|
let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
|
|
8351
8501
|
h = await m.text();
|
|
@@ -8394,17 +8544,17 @@ async function ar() {
|
|
|
8394
8544
|
try {
|
|
8395
8545
|
let d = j.default.resolve(p.trim());
|
|
8396
8546
|
if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
|
|
8397
|
-
if (!
|
|
8398
|
-
let m = await
|
|
8547
|
+
if (!lr(d)) throw pr(d);
|
|
8548
|
+
let m = await or(d, e, t),
|
|
8399
8549
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
8400
|
-
|
|
8550
|
+
be =
|
|
8401
8551
|
m.mimeType.startsWith('image/') ||
|
|
8402
8552
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
8403
8553
|
? `
|
|
8404
8554
|
|
|
8405
8555
|
`
|
|
8406
8556
|
: '',
|
|
8407
|
-
|
|
8557
|
+
ke = {
|
|
8408
8558
|
jsonrpc: '2.0',
|
|
8409
8559
|
id: o.id,
|
|
8410
8560
|
result: {
|
|
@@ -8415,7 +8565,7 @@ async function ar() {
|
|
|
8415
8565
|
|
|
8416
8566
|
- **URL:** ${m.url}
|
|
8417
8567
|
- **Type:** \`${m.mimeType}\`
|
|
8418
|
-
- **Size:** ${h} KB${
|
|
8568
|
+
- **Size:** ${h} KB${be}
|
|
8419
8569
|
|
|
8420
8570
|
Pass this URL to any Tein generation tool.`,
|
|
8421
8571
|
},
|
|
@@ -8424,7 +8574,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8424
8574
|
},
|
|
8425
8575
|
};
|
|
8426
8576
|
process.stdout.write(
|
|
8427
|
-
JSON.stringify(
|
|
8577
|
+
JSON.stringify(ke) +
|
|
8428
8578
|
`
|
|
8429
8579
|
`,
|
|
8430
8580
|
);
|
|
@@ -8451,7 +8601,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8451
8601
|
}
|
|
8452
8602
|
if (e)
|
|
8453
8603
|
try {
|
|
8454
|
-
o.params.arguments = await
|
|
8604
|
+
o.params.arguments = await dr(String(l), c, e, t, r);
|
|
8455
8605
|
} catch (p) {
|
|
8456
8606
|
let d = p instanceof Error ? p.message : String(p);
|
|
8457
8607
|
process.stdout.write(
|
|
@@ -8482,10 +8632,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8482
8632
|
body: JSON.stringify(o),
|
|
8483
8633
|
}),
|
|
8484
8634
|
c = await l.text(),
|
|
8485
|
-
p =
|
|
8635
|
+
p = sr(o, l.status, c);
|
|
8486
8636
|
if (p === null) return;
|
|
8487
8637
|
if (p) {
|
|
8488
|
-
(o?.method === 'tools/list' &&
|
|
8638
|
+
(o?.method === 'tools/list' && Ze(p.result?.tools),
|
|
8489
8639
|
process.stdout.write(
|
|
8490
8640
|
JSON.stringify(p) +
|
|
8491
8641
|
`
|
|
@@ -8494,7 +8644,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8494
8644
|
return;
|
|
8495
8645
|
}
|
|
8496
8646
|
} catch {}
|
|
8497
|
-
let u =
|
|
8647
|
+
let u = za(o);
|
|
8498
8648
|
u !== null &&
|
|
8499
8649
|
process.stdout.write(
|
|
8500
8650
|
JSON.stringify(u) +
|
|
@@ -8519,20 +8669,20 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8519
8669
|
}
|
|
8520
8670
|
var D,
|
|
8521
8671
|
j,
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8672
|
+
nr,
|
|
8673
|
+
Fa,
|
|
8674
|
+
ee,
|
|
8675
|
+
Qe,
|
|
8676
|
+
ir,
|
|
8677
|
+
mr = y(() => {
|
|
8528
8678
|
'use strict';
|
|
8529
8679
|
((D = _(require('node:fs'))),
|
|
8530
8680
|
(j = _(require('node:path'))),
|
|
8531
|
-
(
|
|
8532
|
-
|
|
8533
|
-
|
|
8681
|
+
(nr = _(require('node:readline'))));
|
|
8682
|
+
Ge();
|
|
8683
|
+
rr();
|
|
8534
8684
|
A();
|
|
8535
|
-
|
|
8685
|
+
Fa = new Set([
|
|
8536
8686
|
'.png',
|
|
8537
8687
|
'.jpg',
|
|
8538
8688
|
'.jpeg',
|
|
@@ -8558,20 +8708,20 @@ var D,
|
|
|
8558
8708
|
'.flac',
|
|
8559
8709
|
'.opus',
|
|
8560
8710
|
]);
|
|
8561
|
-
((
|
|
8562
|
-
|
|
8711
|
+
((ee = new Map()), (Qe = 0));
|
|
8712
|
+
ir = !1;
|
|
8563
8713
|
require.main === module &&
|
|
8564
|
-
|
|
8714
|
+
cr().catch((e) => {
|
|
8565
8715
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
8566
8716
|
`),
|
|
8567
8717
|
process.exit(1));
|
|
8568
8718
|
});
|
|
8569
8719
|
});
|
|
8570
|
-
var
|
|
8720
|
+
var Pr =
|
|
8571
8721
|
!process.env.NO_COLOR &&
|
|
8572
8722
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
8573
8723
|
function k(e, t) {
|
|
8574
|
-
return (r) => (
|
|
8724
|
+
return (r) => (Pr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
8575
8725
|
}
|
|
8576
8726
|
var i = {
|
|
8577
8727
|
bold: k(1, 22),
|
|
@@ -8655,13 +8805,13 @@ var i = {
|
|
|
8655
8805
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
8656
8806
|
}
|
|
8657
8807
|
};
|
|
8658
|
-
var
|
|
8659
|
-
|
|
8660
|
-
var
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
var
|
|
8664
|
-
var
|
|
8808
|
+
var N = _(require('node:fs')),
|
|
8809
|
+
q = _(require('node:path'));
|
|
8810
|
+
var re = _(require('node:fs')),
|
|
8811
|
+
at = _(require('node:path')),
|
|
8812
|
+
it = require('node:stream/promises');
|
|
8813
|
+
var te = '1.1.7';
|
|
8814
|
+
var Ir = new Set([
|
|
8665
8815
|
'account_suspended',
|
|
8666
8816
|
'account_terminated',
|
|
8667
8817
|
'creative_mode_restricted',
|
|
@@ -8669,7 +8819,7 @@ var gr = new Set([
|
|
|
8669
8819
|
'workspace_paused',
|
|
8670
8820
|
]),
|
|
8671
8821
|
v = 1,
|
|
8672
|
-
|
|
8822
|
+
_r = 3,
|
|
8673
8823
|
w = class extends Error {
|
|
8674
8824
|
constructor(t, r, a, n = {}) {
|
|
8675
8825
|
(super(r),
|
|
@@ -8679,10 +8829,10 @@ var gr = new Set([
|
|
|
8679
8829
|
(this.fields = n));
|
|
8680
8830
|
}
|
|
8681
8831
|
get exitCode() {
|
|
8682
|
-
return this.code &&
|
|
8832
|
+
return this.code && Ir.has(this.code) ? _r : v;
|
|
8683
8833
|
}
|
|
8684
8834
|
};
|
|
8685
|
-
function
|
|
8835
|
+
function vr(e, t, r) {
|
|
8686
8836
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
8687
8837
|
if (!r || typeof r != 'object') return new w(e, a);
|
|
8688
8838
|
let n = r;
|
|
@@ -8695,13 +8845,13 @@ function yr(e, t, r) {
|
|
|
8695
8845
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
8696
8846
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8697
8847
|
}
|
|
8698
|
-
function
|
|
8848
|
+
function tt(e) {
|
|
8699
8849
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8700
8850
|
}
|
|
8701
8851
|
function S(e) {
|
|
8702
8852
|
let t = [e.message],
|
|
8703
|
-
r =
|
|
8704
|
-
a =
|
|
8853
|
+
r = tt(e.fields.required),
|
|
8854
|
+
a = tt(e.fields.balance);
|
|
8705
8855
|
(r || a) &&
|
|
8706
8856
|
t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
8707
8857
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -8709,19 +8859,19 @@ function S(e) {
|
|
|
8709
8859
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8710
8860
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
8711
8861
|
}
|
|
8712
|
-
function
|
|
8862
|
+
function Tr(e) {
|
|
8713
8863
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
8714
8864
|
? 'video'
|
|
8715
8865
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
8716
8866
|
? 'audio'
|
|
8717
8867
|
: 'image';
|
|
8718
8868
|
}
|
|
8719
|
-
function
|
|
8869
|
+
function rt(e) {
|
|
8720
8870
|
let t = [];
|
|
8721
8871
|
for (let r of e.data ?? [])
|
|
8722
8872
|
typeof r.message?.content == 'string'
|
|
8723
8873
|
? t.push({ type: 'text', text: r.message.content })
|
|
8724
|
-
: r.url && t.push({ type:
|
|
8874
|
+
: r.url && t.push({ type: Tr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
8725
8875
|
return t;
|
|
8726
8876
|
}
|
|
8727
8877
|
var K = class {
|
|
@@ -8732,7 +8882,7 @@ var K = class {
|
|
|
8732
8882
|
return {
|
|
8733
8883
|
'Content-Type': 'application/json',
|
|
8734
8884
|
Authorization: `Bearer ${this.apiKey}`,
|
|
8735
|
-
'User-Agent': `Tein-CLI/${
|
|
8885
|
+
'User-Agent': `Tein-CLI/${te}`,
|
|
8736
8886
|
'X-Tein-Client': 'cli',
|
|
8737
8887
|
};
|
|
8738
8888
|
}
|
|
@@ -8747,7 +8897,7 @@ var K = class {
|
|
|
8747
8897
|
try {
|
|
8748
8898
|
s = await n.json();
|
|
8749
8899
|
} catch {}
|
|
8750
|
-
throw
|
|
8900
|
+
throw vr(n.status, n.statusText, s);
|
|
8751
8901
|
}
|
|
8752
8902
|
return await n.json();
|
|
8753
8903
|
}
|
|
@@ -8761,7 +8911,7 @@ var K = class {
|
|
|
8761
8911
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
8762
8912
|
? n
|
|
8763
8913
|
: 'processing',
|
|
8764
|
-
o =
|
|
8914
|
+
o = rt(a);
|
|
8765
8915
|
return {
|
|
8766
8916
|
request_id: a.request_id || a.id || '',
|
|
8767
8917
|
model: a.model,
|
|
@@ -8779,7 +8929,7 @@ var K = class {
|
|
|
8779
8929
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
8780
8930
|
? a
|
|
8781
8931
|
: 'processing',
|
|
8782
|
-
s =
|
|
8932
|
+
s = rt(r),
|
|
8783
8933
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8784
8934
|
return {
|
|
8785
8935
|
request_id: r.id || t,
|
|
@@ -8797,14 +8947,14 @@ var K = class {
|
|
|
8797
8947
|
async downloadOutput(t, r) {
|
|
8798
8948
|
let a = await fetch(t);
|
|
8799
8949
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
8800
|
-
let n =
|
|
8801
|
-
|
|
8802
|
-
let s =
|
|
8803
|
-
return (await (0,
|
|
8950
|
+
let n = at.default.dirname(r);
|
|
8951
|
+
re.default.existsSync(n) || re.default.mkdirSync(n, { recursive: !0 });
|
|
8952
|
+
let s = re.default.createWriteStream(r);
|
|
8953
|
+
return (await (0, it.pipeline)(a.body, s), r);
|
|
8804
8954
|
}
|
|
8805
8955
|
};
|
|
8806
8956
|
A();
|
|
8807
|
-
function
|
|
8957
|
+
function _e(e) {
|
|
8808
8958
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
8809
8959
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
8810
8960
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -8812,43 +8962,43 @@ function xe(e) {
|
|
|
8812
8962
|
a = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8813
8963
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
8814
8964
|
}
|
|
8815
|
-
|
|
8816
|
-
var
|
|
8817
|
-
function
|
|
8818
|
-
for (let t of
|
|
8965
|
+
X();
|
|
8966
|
+
var Bt = ['images', 'input_images', 'videos', 'audios'];
|
|
8967
|
+
function ca(e) {
|
|
8968
|
+
for (let t of Bt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
8819
8969
|
}
|
|
8820
|
-
function
|
|
8970
|
+
function ua(e) {
|
|
8821
8971
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8822
|
-
let t =
|
|
8823
|
-
return
|
|
8972
|
+
let t = q.default.resolve(e);
|
|
8973
|
+
return N.default.existsSync(t) && N.default.statSync(t).isFile() ? t : null;
|
|
8824
8974
|
}
|
|
8825
|
-
async function
|
|
8826
|
-
for (let r of
|
|
8975
|
+
async function ma(e, t) {
|
|
8976
|
+
for (let r of Bt) {
|
|
8827
8977
|
if (!Array.isArray(e[r])) continue;
|
|
8828
8978
|
let a = [];
|
|
8829
8979
|
for (let n of e[r]) {
|
|
8830
8980
|
if (typeof n != 'string') continue;
|
|
8831
|
-
let s =
|
|
8981
|
+
let s = ua(n);
|
|
8832
8982
|
a.push(s ? await t(s) : n);
|
|
8833
8983
|
}
|
|
8834
8984
|
e[r] = a;
|
|
8835
8985
|
}
|
|
8836
8986
|
}
|
|
8837
|
-
var
|
|
8838
|
-
function
|
|
8987
|
+
var Q = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
8988
|
+
function fa(e) {
|
|
8839
8989
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
8840
8990
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
8841
|
-
r =
|
|
8991
|
+
r = Q.enterprise;
|
|
8842
8992
|
return (
|
|
8843
8993
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
8844
8994
|
(process.stderr
|
|
8845
|
-
.write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${
|
|
8995
|
+
.write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Q.starter}, Plus ${Q.plus}, Scale ${Q.scale}, Enterprise ${Q.enterprise} at once, including polling.
|
|
8846
8996
|
`),
|
|
8847
8997
|
process.exit(1)),
|
|
8848
8998
|
t
|
|
8849
8999
|
);
|
|
8850
9000
|
}
|
|
8851
|
-
async function
|
|
9001
|
+
async function ga(e, t, r, a, n) {
|
|
8852
9002
|
n.isJson ||
|
|
8853
9003
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
8854
9004
|
`);
|
|
@@ -8910,7 +9060,7 @@ async function na(e, t, r, a, n) {
|
|
|
8910
9060
|
else {
|
|
8911
9061
|
for (let l of o)
|
|
8912
9062
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
8913
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
9063
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${_e(l.usage.cost)}`),
|
|
8914
9064
|
l.error && process.stdout.write(` ${l.error}`),
|
|
8915
9065
|
process.stdout.write(`
|
|
8916
9066
|
`));
|
|
@@ -8923,12 +9073,12 @@ async function na(e, t, r, a, n) {
|
|
|
8923
9073
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
8924
9074
|
process.exit(v);
|
|
8925
9075
|
}
|
|
8926
|
-
function
|
|
9076
|
+
function ha(e, t, r) {
|
|
8927
9077
|
if (r <= 1) return e;
|
|
8928
|
-
let a =
|
|
9078
|
+
let a = q.default.extname(e);
|
|
8929
9079
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
8930
9080
|
}
|
|
8931
|
-
function
|
|
9081
|
+
function jt(e) {
|
|
8932
9082
|
let t = {},
|
|
8933
9083
|
r = new Set(),
|
|
8934
9084
|
a = [];
|
|
@@ -8973,9 +9123,9 @@ function Rt(e) {
|
|
|
8973
9123
|
}
|
|
8974
9124
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
|
|
8975
9125
|
}
|
|
8976
|
-
async function
|
|
8977
|
-
let r =
|
|
8978
|
-
a =
|
|
9126
|
+
async function je(e, t) {
|
|
9127
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9128
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8979
9129
|
(r ||
|
|
8980
9130
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
8981
9131
|
`),
|
|
@@ -8991,11 +9141,11 @@ async function Le(e, t) {
|
|
|
8991
9141
|
process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
|
|
8992
9142
|
`),
|
|
8993
9143
|
process.exit(1)));
|
|
8994
|
-
let n =
|
|
9144
|
+
let n = B(e),
|
|
8995
9145
|
s = !!t.json,
|
|
8996
9146
|
o = !!(t.async || t.no_wait),
|
|
8997
9147
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
8998
|
-
l =
|
|
9148
|
+
l = fa(t),
|
|
8999
9149
|
c = { ...t };
|
|
9000
9150
|
(delete c.json,
|
|
9001
9151
|
delete c.async,
|
|
@@ -9004,9 +9154,9 @@ async function Le(e, t) {
|
|
|
9004
9154
|
delete c.api_key,
|
|
9005
9155
|
delete c.api_url,
|
|
9006
9156
|
delete c.count);
|
|
9007
|
-
let p =
|
|
9008
|
-
(
|
|
9009
|
-
typeof p.image == 'string' && !p.images && !
|
|
9157
|
+
let p = Ft(n, c);
|
|
9158
|
+
(ca(p),
|
|
9159
|
+
typeof p.image == 'string' && !p.images && !he(n) && ((p.images = [p.image]), delete p.image),
|
|
9010
9160
|
p.image_url &&
|
|
9011
9161
|
!p.first_frame_image &&
|
|
9012
9162
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
@@ -9024,14 +9174,14 @@ async function Le(e, t) {
|
|
|
9024
9174
|
for (let b of m) {
|
|
9025
9175
|
let g = p[b];
|
|
9026
9176
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
9027
|
-
let x =
|
|
9028
|
-
if (
|
|
9029
|
-
let
|
|
9030
|
-
s ||
|
|
9177
|
+
let x = q.default.resolve(g);
|
|
9178
|
+
if (N.default.existsSync(x) && N.default.statSync(x).isFile()) {
|
|
9179
|
+
let P = new T(`Uploading local file ${q.default.basename(x)} to CDN...`);
|
|
9180
|
+
s || P.start();
|
|
9031
9181
|
try {
|
|
9032
|
-
let L =
|
|
9182
|
+
let L = N.default.readFileSync(x),
|
|
9033
9183
|
C = await d.uploadAsset(L.toString('base64'));
|
|
9034
|
-
((p[b] = C.url), s ||
|
|
9184
|
+
((p[b] = C.url), s || P.succeed(`Uploaded ${q.default.basename(x)} to CDN`));
|
|
9035
9185
|
} catch (L) {
|
|
9036
9186
|
let C = L instanceof Error ? L.message : String(L);
|
|
9037
9187
|
(s
|
|
@@ -9040,28 +9190,28 @@ async function Le(e, t) {
|
|
|
9040
9190
|
`
|
|
9041
9191
|
`,
|
|
9042
9192
|
)
|
|
9043
|
-
:
|
|
9193
|
+
: P.fail(`Upload failed: ${C}`),
|
|
9044
9194
|
process.exit(1));
|
|
9045
9195
|
}
|
|
9046
9196
|
}
|
|
9047
9197
|
}
|
|
9048
9198
|
}
|
|
9049
|
-
await
|
|
9050
|
-
let g = new T(`Uploading local file ${
|
|
9199
|
+
await ma(p, async (b) => {
|
|
9200
|
+
let g = new T(`Uploading local file ${q.default.basename(b)} to CDN...`);
|
|
9051
9201
|
s || g.start();
|
|
9052
9202
|
try {
|
|
9053
|
-
let x =
|
|
9054
|
-
|
|
9055
|
-
return (s || g.succeed(`Uploaded ${
|
|
9203
|
+
let x = N.default.readFileSync(b),
|
|
9204
|
+
P = await d.uploadAsset(x.toString('base64'));
|
|
9205
|
+
return (s || g.succeed(`Uploaded ${q.default.basename(b)} to CDN`), P.url);
|
|
9056
9206
|
} catch (x) {
|
|
9057
|
-
let
|
|
9207
|
+
let P = x instanceof Error ? x.message : String(x);
|
|
9058
9208
|
(s
|
|
9059
9209
|
? process.stdout.write(
|
|
9060
|
-
JSON.stringify({ error:
|
|
9210
|
+
JSON.stringify({ error: P }) +
|
|
9061
9211
|
`
|
|
9062
9212
|
`,
|
|
9063
9213
|
)
|
|
9064
|
-
: g.fail(`Upload failed: ${
|
|
9214
|
+
: g.fail(`Upload failed: ${P}`),
|
|
9065
9215
|
process.exit(1));
|
|
9066
9216
|
}
|
|
9067
9217
|
});
|
|
@@ -9070,7 +9220,7 @@ async function Le(e, t) {
|
|
|
9070
9220
|
let f;
|
|
9071
9221
|
try {
|
|
9072
9222
|
if (l > 1) {
|
|
9073
|
-
await
|
|
9223
|
+
await ga(d, e, p, l, { isJson: s, isAsync: o });
|
|
9074
9224
|
return;
|
|
9075
9225
|
}
|
|
9076
9226
|
f = await d.queueJob(e, p);
|
|
@@ -9108,12 +9258,12 @@ async function Le(e, t) {
|
|
|
9108
9258
|
`));
|
|
9109
9259
|
return;
|
|
9110
9260
|
}
|
|
9111
|
-
let
|
|
9112
|
-
|
|
9261
|
+
let be = Date.now(),
|
|
9262
|
+
ke = 1500;
|
|
9113
9263
|
for (; f.status === 'processing';) {
|
|
9114
|
-
let b = Math.round((Date.now() -
|
|
9264
|
+
let b = Math.round((Date.now() - be) / 1e3);
|
|
9115
9265
|
(s || h.update(`Rendering ${i.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
|
|
9116
|
-
await new Promise((g) => setTimeout(g,
|
|
9266
|
+
await new Promise((g) => setTimeout(g, ke)));
|
|
9117
9267
|
try {
|
|
9118
9268
|
f = await d.getStatus(f.request_id);
|
|
9119
9269
|
} catch (g) {
|
|
@@ -9155,7 +9305,7 @@ async function Le(e, t) {
|
|
|
9155
9305
|
process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
|
|
9156
9306
|
`),
|
|
9157
9307
|
f.usage?.cost !== void 0 &&
|
|
9158
|
-
process.stdout.write(` ${i.bold('Cost:')} ${
|
|
9308
|
+
process.stdout.write(` ${i.bold('Cost:')} ${_e(f.usage.cost)}
|
|
9159
9309
|
`),
|
|
9160
9310
|
f.output && f.output.length > 0)
|
|
9161
9311
|
) {
|
|
@@ -9165,38 +9315,38 @@ ${i.bold('Outputs:')}
|
|
|
9165
9315
|
let b = f.output.filter((x) => x.url).length,
|
|
9166
9316
|
g = 0;
|
|
9167
9317
|
for (let x = 0; x < f.output.length; x++) {
|
|
9168
|
-
let
|
|
9169
|
-
if (
|
|
9170
|
-
let L =
|
|
9318
|
+
let P = f.output[x];
|
|
9319
|
+
if (P.url) {
|
|
9320
|
+
let L = P.layer?.name ? ` ${i.bold(P.layer.name)}` : '';
|
|
9171
9321
|
if (
|
|
9172
|
-
(process.stdout.write(` [${
|
|
9322
|
+
(process.stdout.write(` [${P.type.toUpperCase()}]${L} ${i.cyan(i.underline(P.url))}
|
|
9173
9323
|
`),
|
|
9174
9324
|
u)
|
|
9175
9325
|
) {
|
|
9176
|
-
let C =
|
|
9177
|
-
|
|
9326
|
+
let C = ha(u, g++, b),
|
|
9327
|
+
et = new T(`Downloading output to ${C}...`).start();
|
|
9178
9328
|
try {
|
|
9179
|
-
(await d.downloadOutput(
|
|
9180
|
-
|
|
9181
|
-
} catch (
|
|
9182
|
-
|
|
9329
|
+
(await d.downloadOutput(P.url, q.default.resolve(process.cwd(), C)),
|
|
9330
|
+
et.succeed(`Saved to ${i.bold(C)}`));
|
|
9331
|
+
} catch (we) {
|
|
9332
|
+
et.fail(`Failed to download: ${we instanceof Error ? we.message : we}`);
|
|
9183
9333
|
}
|
|
9184
9334
|
}
|
|
9185
9335
|
} else
|
|
9186
|
-
|
|
9336
|
+
P.text &&
|
|
9187
9337
|
process.stdout.write(`
|
|
9188
|
-
${
|
|
9338
|
+
${P.text}
|
|
9189
9339
|
`);
|
|
9190
9340
|
}
|
|
9191
9341
|
}
|
|
9192
9342
|
process.stdout.write(`
|
|
9193
9343
|
`);
|
|
9194
9344
|
}
|
|
9195
|
-
var
|
|
9345
|
+
var Gt = _(require('node:readline'));
|
|
9196
9346
|
A();
|
|
9197
|
-
async function
|
|
9347
|
+
async function ya(e) {
|
|
9198
9348
|
try {
|
|
9199
|
-
return (await new K(e,
|
|
9349
|
+
return (await new K(e, I()).checkKey(), 'ok');
|
|
9200
9350
|
} catch (t) {
|
|
9201
9351
|
if (t instanceof w) {
|
|
9202
9352
|
if (t.status === 401) return 'invalid';
|
|
@@ -9205,15 +9355,15 @@ async function oa(e) {
|
|
|
9205
9355
|
return 'unchecked';
|
|
9206
9356
|
}
|
|
9207
9357
|
}
|
|
9208
|
-
function
|
|
9209
|
-
let t =
|
|
9358
|
+
function ba(e) {
|
|
9359
|
+
let t = Gt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
9210
9360
|
return new Promise((r) => {
|
|
9211
9361
|
t.question(e, (a) => {
|
|
9212
9362
|
(t.close(), r(a.trim()));
|
|
9213
9363
|
});
|
|
9214
9364
|
});
|
|
9215
9365
|
}
|
|
9216
|
-
async function
|
|
9366
|
+
async function Z(e, t) {
|
|
9217
9367
|
switch (e) {
|
|
9218
9368
|
case 'login':
|
|
9219
9369
|
case 'set-key': {
|
|
@@ -9225,22 +9375,22 @@ ${i.bold('Tein AI Authentication')}
|
|
|
9225
9375
|
process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
|
|
9226
9376
|
|
|
9227
9377
|
`),
|
|
9228
|
-
(r = await
|
|
9378
|
+
(r = await ba('Enter your Tein API Key (sk_live_...): '))),
|
|
9229
9379
|
!r.startsWith('sk_live_') &&
|
|
9230
9380
|
!r.startsWith('sk_test_') &&
|
|
9231
9381
|
(process.stderr
|
|
9232
9382
|
.write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
9233
9383
|
`),
|
|
9234
9384
|
process.exit(1)));
|
|
9235
|
-
let a = await
|
|
9385
|
+
let a = await ya(r);
|
|
9236
9386
|
(a === 'invalid' &&
|
|
9237
9387
|
(process.stderr
|
|
9238
9388
|
.write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
9239
9389
|
`),
|
|
9240
9390
|
process.exit(1)),
|
|
9241
|
-
|
|
9391
|
+
Ie({ apiKey: r }),
|
|
9242
9392
|
process.stdout.write(`
|
|
9243
|
-
${i.green('\u2713')} API key saved to ${i.dim(
|
|
9393
|
+
${i.green('\u2713')} API key saved to ${i.dim(ie())}
|
|
9244
9394
|
`),
|
|
9245
9395
|
a === 'blocked'
|
|
9246
9396
|
? process.stdout
|
|
@@ -9257,27 +9407,27 @@ ${i.green('\u2713')} API key saved to ${i.dim(re())}
|
|
|
9257
9407
|
break;
|
|
9258
9408
|
}
|
|
9259
9409
|
case 'logout': {
|
|
9260
|
-
if (!
|
|
9410
|
+
if (!V().apiKey) {
|
|
9261
9411
|
process.stdout
|
|
9262
9412
|
.write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
|
|
9263
9413
|
`);
|
|
9264
9414
|
break;
|
|
9265
9415
|
}
|
|
9266
|
-
(
|
|
9416
|
+
(Ie({ apiKey: '' }),
|
|
9267
9417
|
process.stdout
|
|
9268
|
-
.write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(
|
|
9418
|
+
.write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(ie())}
|
|
9269
9419
|
`));
|
|
9270
9420
|
break;
|
|
9271
9421
|
}
|
|
9272
9422
|
default: {
|
|
9273
|
-
let r =
|
|
9274
|
-
a =
|
|
9275
|
-
n =
|
|
9423
|
+
let r = E(),
|
|
9424
|
+
a = I(),
|
|
9425
|
+
n = V();
|
|
9276
9426
|
if (
|
|
9277
9427
|
(process.stdout.write(`
|
|
9278
9428
|
${i.bold('Tein AI CLI Configuration')}
|
|
9279
9429
|
`),
|
|
9280
|
-
process.stdout.write(` Config file: ${i.dim(
|
|
9430
|
+
process.stdout.write(` Config file: ${i.dim(ie())}
|
|
9281
9431
|
`),
|
|
9282
9432
|
process.stdout.write(` API URL: ${i.cyan(a)}
|
|
9283
9433
|
`),
|
|
@@ -9302,12 +9452,12 @@ ${i.bold('Tein AI CLI Configuration')}
|
|
|
9302
9452
|
}
|
|
9303
9453
|
}
|
|
9304
9454
|
A();
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
var
|
|
9308
|
-
async function
|
|
9455
|
+
ve();
|
|
9456
|
+
X();
|
|
9457
|
+
var ka = 3e3;
|
|
9458
|
+
async function Ht(e) {
|
|
9309
9459
|
try {
|
|
9310
|
-
let t = await fetch(`${
|
|
9460
|
+
let t = await fetch(`${I(e)}/v1/pricing`, { signal: AbortSignal.timeout(ka) });
|
|
9311
9461
|
if (!t.ok) return;
|
|
9312
9462
|
let r = await t.json(),
|
|
9313
9463
|
a = {};
|
|
@@ -9315,18 +9465,18 @@ async function Lt(e) {
|
|
|
9315
9465
|
let s = String(n.modelSlug ?? '');
|
|
9316
9466
|
G.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
9317
9467
|
}
|
|
9318
|
-
|
|
9468
|
+
Ot(a);
|
|
9319
9469
|
} catch {}
|
|
9320
9470
|
}
|
|
9321
|
-
var
|
|
9322
|
-
|
|
9323
|
-
async function
|
|
9324
|
-
await
|
|
9325
|
-
let r =
|
|
9471
|
+
var wa = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
9472
|
+
xa = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
9473
|
+
async function zt(e, t) {
|
|
9474
|
+
await Ht(t);
|
|
9475
|
+
let r = O();
|
|
9326
9476
|
if (e) {
|
|
9327
9477
|
let s = e.toLowerCase(),
|
|
9328
|
-
o =
|
|
9329
|
-
r =
|
|
9478
|
+
o = xa[s] ?? s;
|
|
9479
|
+
r = wa.has(o)
|
|
9330
9480
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
9331
9481
|
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
9332
9482
|
}
|
|
@@ -9364,9 +9514,9 @@ ${i.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
|
9364
9514
|
|
|
9365
9515
|
`);
|
|
9366
9516
|
}
|
|
9367
|
-
async function
|
|
9368
|
-
G.has(e) && (await
|
|
9369
|
-
let r =
|
|
9517
|
+
async function Jt(e, t) {
|
|
9518
|
+
G.has(e) && (await Ht(t));
|
|
9519
|
+
let r = B(e);
|
|
9370
9520
|
(r ||
|
|
9371
9521
|
(process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
9372
9522
|
`),
|
|
@@ -9446,9 +9596,9 @@ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
|
|
|
9446
9596
|
`);
|
|
9447
9597
|
}
|
|
9448
9598
|
A();
|
|
9449
|
-
|
|
9450
|
-
var
|
|
9451
|
-
|
|
9599
|
+
Ge();
|
|
9600
|
+
var Pa = 1e4,
|
|
9601
|
+
ze = {
|
|
9452
9602
|
price: '',
|
|
9453
9603
|
creativeMode: 'Creative mode',
|
|
9454
9604
|
priority: 'Priority',
|
|
@@ -9458,22 +9608,22 @@ var ua = 1e4,
|
|
|
9458
9608
|
priorityDraft: 'Priority + Draft',
|
|
9459
9609
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
9460
9610
|
},
|
|
9461
|
-
|
|
9462
|
-
|
|
9611
|
+
Ia = Object.keys(ze),
|
|
9612
|
+
_a = {
|
|
9463
9613
|
creativeMode: 'unfiltered',
|
|
9464
9614
|
creativeModePriority: 'unfilteredPriority',
|
|
9465
9615
|
creativeModeDraft: 'unfilteredDraft',
|
|
9466
9616
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
9467
9617
|
};
|
|
9468
|
-
function
|
|
9469
|
-
let r =
|
|
9618
|
+
function va(e, t) {
|
|
9619
|
+
let r = _a[t];
|
|
9470
9620
|
return e[t] ?? (r ? e[r] : void 0);
|
|
9471
9621
|
}
|
|
9472
|
-
async function
|
|
9473
|
-
let r = `${
|
|
9622
|
+
async function Ta(e, t) {
|
|
9623
|
+
let r = `${I(e)}${ye(t)}`,
|
|
9474
9624
|
a;
|
|
9475
9625
|
try {
|
|
9476
|
-
a = await fetch(r, { signal: AbortSignal.timeout(
|
|
9626
|
+
a = await fetch(r, { signal: AbortSignal.timeout(Pa) });
|
|
9477
9627
|
} catch {
|
|
9478
9628
|
throw new Error(`Could not reach ${r}`);
|
|
9479
9629
|
}
|
|
@@ -9489,18 +9639,18 @@ async function ha(e, t) {
|
|
|
9489
9639
|
}
|
|
9490
9640
|
return n;
|
|
9491
9641
|
}
|
|
9492
|
-
function
|
|
9642
|
+
function He(e) {
|
|
9493
9643
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
9494
9644
|
[r, a = ''] = t.split('.');
|
|
9495
9645
|
return `$${r}.${a.padEnd(2, '0')}`;
|
|
9496
9646
|
}
|
|
9497
|
-
function
|
|
9647
|
+
function Je(e) {
|
|
9498
9648
|
if (!e || typeof e.starter != 'number') return null;
|
|
9499
9649
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
9500
9650
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9501
|
-
return `Starter ${
|
|
9651
|
+
return `Starter ${He(e.starter)} Plus ${He(t)} Scale ${He(r)}`;
|
|
9502
9652
|
}
|
|
9503
|
-
function
|
|
9653
|
+
function Ma(e) {
|
|
9504
9654
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
9505
9655
|
let t = [];
|
|
9506
9656
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -9512,33 +9662,33 @@ function ya(e) {
|
|
|
9512
9662
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
9513
9663
|
);
|
|
9514
9664
|
}
|
|
9515
|
-
function
|
|
9516
|
-
let r =
|
|
9517
|
-
for (let a of
|
|
9518
|
-
let n =
|
|
9665
|
+
function Ka(e, t) {
|
|
9666
|
+
let r = Ma(e);
|
|
9667
|
+
for (let a of Ia) {
|
|
9668
|
+
let n = Je(va(e, a));
|
|
9519
9669
|
if (!n) continue;
|
|
9520
|
-
let s =
|
|
9670
|
+
let s = ze[a] ? ` (${ze[a]})` : '';
|
|
9521
9671
|
t.push(` ${r}${s} ${n}`);
|
|
9522
9672
|
}
|
|
9523
9673
|
}
|
|
9524
|
-
function
|
|
9674
|
+
function Sa(e, t) {
|
|
9525
9675
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
9526
9676
|
t.push(
|
|
9527
9677
|
` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
9528
9678
|
);
|
|
9529
|
-
for (let n of e.variants ?? [])
|
|
9679
|
+
for (let n of e.variants ?? []) Ka(n, t);
|
|
9530
9680
|
let a = e.addons;
|
|
9531
9681
|
if (Array.isArray(a))
|
|
9532
9682
|
for (let n of a) {
|
|
9533
9683
|
if (!n || typeof n != 'object') continue;
|
|
9534
9684
|
let s = n,
|
|
9535
9685
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
9536
|
-
u =
|
|
9686
|
+
u = Je(s.price);
|
|
9537
9687
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
9538
9688
|
}
|
|
9539
9689
|
t.push('');
|
|
9540
9690
|
}
|
|
9541
|
-
function
|
|
9691
|
+
function Ea(e) {
|
|
9542
9692
|
let t = [],
|
|
9543
9693
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9544
9694
|
(t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
|
|
@@ -9560,7 +9710,7 @@ function wa(e) {
|
|
|
9560
9710
|
});
|
|
9561
9711
|
for (let l of s) {
|
|
9562
9712
|
t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
9563
|
-
for (let c of a.get(l) ?? [])
|
|
9713
|
+
for (let c of a.get(l) ?? []) Sa(c, t);
|
|
9564
9714
|
}
|
|
9565
9715
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
9566
9716
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -9577,7 +9727,7 @@ function wa(e) {
|
|
|
9577
9727
|
t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
|
|
9578
9728
|
for (let m of p) {
|
|
9579
9729
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
9580
|
-
f =
|
|
9730
|
+
f = Je(m.prices);
|
|
9581
9731
|
f && t.push(` ${h} ${f}`);
|
|
9582
9732
|
}
|
|
9583
9733
|
t.push('');
|
|
@@ -9590,10 +9740,10 @@ function wa(e) {
|
|
|
9590
9740
|
`
|
|
9591
9741
|
);
|
|
9592
9742
|
}
|
|
9593
|
-
async function
|
|
9743
|
+
async function Wt(e) {
|
|
9594
9744
|
let t;
|
|
9595
9745
|
try {
|
|
9596
|
-
t = await
|
|
9746
|
+
t = await Ta(e.apiUrl, e.model);
|
|
9597
9747
|
} catch (r) {
|
|
9598
9748
|
let a = r instanceof Error ? r.message : String(r);
|
|
9599
9749
|
(process.stderr.write(`${i.red('Error:')} ${a}
|
|
@@ -9604,14 +9754,14 @@ async function Ut(e) {
|
|
|
9604
9754
|
e.json
|
|
9605
9755
|
? `${JSON.stringify(t, null, 2)}
|
|
9606
9756
|
`
|
|
9607
|
-
:
|
|
9757
|
+
: Ea(t),
|
|
9608
9758
|
);
|
|
9609
9759
|
}
|
|
9610
|
-
var
|
|
9760
|
+
var Yt = _(require('node:path'));
|
|
9611
9761
|
A();
|
|
9612
|
-
async function
|
|
9613
|
-
let r =
|
|
9614
|
-
a =
|
|
9762
|
+
async function Xt(e, t) {
|
|
9763
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9764
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9615
9765
|
(r ||
|
|
9616
9766
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9617
9767
|
`),
|
|
@@ -9704,7 +9854,7 @@ ${i.bold('Outputs:')}
|
|
|
9704
9854
|
) {
|
|
9705
9855
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
9706
9856
|
try {
|
|
9707
|
-
(await u.downloadOutput(p.url,
|
|
9857
|
+
(await u.downloadOutput(p.url, Yt.default.resolve(process.cwd(), o)),
|
|
9708
9858
|
d.succeed(`Saved to ${i.bold(o)}`));
|
|
9709
9859
|
} catch (m) {
|
|
9710
9860
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -9719,12 +9869,12 @@ ${p.text}
|
|
|
9719
9869
|
process.stdout.write(`
|
|
9720
9870
|
`);
|
|
9721
9871
|
}
|
|
9722
|
-
var
|
|
9723
|
-
|
|
9872
|
+
var We = _(require('node:fs')),
|
|
9873
|
+
Ye = _(require('node:path'));
|
|
9724
9874
|
A();
|
|
9725
|
-
async function
|
|
9726
|
-
let r =
|
|
9727
|
-
a =
|
|
9875
|
+
async function Qt(e, t = {}) {
|
|
9876
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9877
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9728
9878
|
n = !!t.json;
|
|
9729
9879
|
(r ||
|
|
9730
9880
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
@@ -9739,13 +9889,13 @@ async function jt(e, t = {}) {
|
|
|
9739
9889
|
process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
|
|
9740
9890
|
`),
|
|
9741
9891
|
process.exit(1)));
|
|
9742
|
-
let s =
|
|
9743
|
-
|
|
9892
|
+
let s = Ye.default.resolve(e);
|
|
9893
|
+
We.default.existsSync(s) ||
|
|
9744
9894
|
(process.stderr.write(`${i.red('Error:')} File not found: ${s}
|
|
9745
9895
|
`),
|
|
9746
9896
|
process.exit(1));
|
|
9747
|
-
let o =
|
|
9748
|
-
l =
|
|
9897
|
+
let o = Ye.default.basename(s),
|
|
9898
|
+
l = We.default.readFileSync(s).toString('base64'),
|
|
9749
9899
|
c = new K(r, a),
|
|
9750
9900
|
p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
|
|
9751
9901
|
n || p.start();
|
|
@@ -9786,9 +9936,9 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
|
9786
9936
|
process.exit(m ? m.exitCode : v));
|
|
9787
9937
|
}
|
|
9788
9938
|
}
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
function
|
|
9939
|
+
X();
|
|
9940
|
+
Ce();
|
|
9941
|
+
function fr() {
|
|
9792
9942
|
process.stdout.write(`
|
|
9793
9943
|
${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9794
9944
|
|
|
@@ -9848,45 +9998,45 @@ ${i.bold('EXAMPLES:')}
|
|
|
9848
9998
|
|
|
9849
9999
|
`);
|
|
9850
10000
|
}
|
|
9851
|
-
async function
|
|
10001
|
+
async function Ja() {
|
|
9852
10002
|
let e = process.argv.slice(2),
|
|
9853
|
-
t =
|
|
10003
|
+
t = jt(e);
|
|
9854
10004
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
9855
|
-
|
|
10005
|
+
fr();
|
|
9856
10006
|
return;
|
|
9857
10007
|
}
|
|
9858
10008
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
9859
|
-
process.stdout.write(`tein version ${
|
|
10009
|
+
process.stdout.write(`tein version ${te}
|
|
9860
10010
|
`);
|
|
9861
10011
|
return;
|
|
9862
10012
|
}
|
|
9863
10013
|
switch (t.command) {
|
|
9864
10014
|
case 'auth': {
|
|
9865
|
-
await
|
|
10015
|
+
await Z(t.subcommand, t.options.key);
|
|
9866
10016
|
break;
|
|
9867
10017
|
}
|
|
9868
10018
|
case 'login': {
|
|
9869
|
-
await
|
|
10019
|
+
await Z('login', t.options.key);
|
|
9870
10020
|
break;
|
|
9871
10021
|
}
|
|
9872
10022
|
case 'logout': {
|
|
9873
|
-
await
|
|
10023
|
+
await Z('logout');
|
|
9874
10024
|
break;
|
|
9875
10025
|
}
|
|
9876
10026
|
case 'whoami': {
|
|
9877
|
-
await
|
|
10027
|
+
await Z('status');
|
|
9878
10028
|
break;
|
|
9879
10029
|
}
|
|
9880
10030
|
case 'models':
|
|
9881
10031
|
case 'list': {
|
|
9882
|
-
await
|
|
10032
|
+
await zt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
9883
10033
|
break;
|
|
9884
10034
|
}
|
|
9885
10035
|
case 'pricing':
|
|
9886
10036
|
case 'prices': {
|
|
9887
10037
|
let r = t.options.model,
|
|
9888
10038
|
a = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
9889
|
-
await
|
|
10039
|
+
await Wt({
|
|
9890
10040
|
model: a,
|
|
9891
10041
|
json: !!t.options.json,
|
|
9892
10042
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -9901,48 +10051,48 @@ async function La() {
|
|
|
9901
10051
|
process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
|
|
9902
10052
|
`),
|
|
9903
10053
|
process.exit(1)),
|
|
9904
|
-
await
|
|
10054
|
+
await Jt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
9905
10055
|
break;
|
|
9906
10056
|
}
|
|
9907
10057
|
case 'upload': {
|
|
9908
10058
|
let r = t.subcommand || '';
|
|
9909
|
-
await
|
|
10059
|
+
await Qt(r, t.options);
|
|
9910
10060
|
break;
|
|
9911
10061
|
}
|
|
9912
10062
|
case 'run':
|
|
9913
10063
|
case 'generate': {
|
|
9914
10064
|
let r = t.subcommand || '';
|
|
9915
|
-
await
|
|
10065
|
+
await je(r, t.options);
|
|
9916
10066
|
break;
|
|
9917
10067
|
}
|
|
9918
10068
|
case 'status': {
|
|
9919
10069
|
let r = t.subcommand || '';
|
|
9920
|
-
await
|
|
10070
|
+
await Xt(r, t.options);
|
|
9921
10071
|
break;
|
|
9922
10072
|
}
|
|
9923
10073
|
case 'mcp': {
|
|
9924
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
10074
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (mr(), ur));
|
|
9925
10075
|
await r();
|
|
9926
10076
|
break;
|
|
9927
10077
|
}
|
|
9928
10078
|
default: {
|
|
9929
10079
|
if (t.command && !t.command.startsWith('-')) {
|
|
9930
|
-
(!
|
|
9931
|
-
!
|
|
10080
|
+
(!B(t.command) &&
|
|
10081
|
+
!ce[t.command] &&
|
|
9932
10082
|
(process.stderr.write(`
|
|
9933
10083
|
${i.red('Error:')} Unknown command or model "${t.command}".
|
|
9934
10084
|
Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
|
|
9935
10085
|
`),
|
|
9936
10086
|
process.exit(v)),
|
|
9937
|
-
await
|
|
10087
|
+
await je(t.command, t.options));
|
|
9938
10088
|
return;
|
|
9939
10089
|
}
|
|
9940
|
-
|
|
10090
|
+
fr();
|
|
9941
10091
|
break;
|
|
9942
10092
|
}
|
|
9943
10093
|
}
|
|
9944
10094
|
}
|
|
9945
|
-
|
|
10095
|
+
Ja().catch((e) => {
|
|
9946
10096
|
(e instanceof w &&
|
|
9947
10097
|
(process.stderr.write(`
|
|
9948
10098
|
${i.red('Error:')} ${S(e).join(`
|