@teinai/cli 1.1.26 → 1.1.28
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 +748 -622
- 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',
|
|
@@ -5897,33 +5897,36 @@ var ne,
|
|
|
5897
5897
|
label: 'Swap',
|
|
5898
5898
|
resolution: 'run',
|
|
5899
5899
|
price: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
|
|
5900
|
+
unfiltered: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
|
|
5900
5901
|
},
|
|
5901
5902
|
{
|
|
5902
5903
|
id: 'swap-4-items',
|
|
5903
5904
|
label: 'Swap, 4 things to add',
|
|
5904
5905
|
resolution: 'run',
|
|
5905
5906
|
price: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
|
|
5907
|
+
unfiltered: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
|
|
5906
5908
|
},
|
|
5907
5909
|
{
|
|
5908
5910
|
id: 'new_scene',
|
|
5909
5911
|
label: 'New scene',
|
|
5910
5912
|
resolution: 'run',
|
|
5911
5913
|
price: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
|
|
5914
|
+
unfiltered: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
|
|
5912
5915
|
},
|
|
5913
5916
|
],
|
|
5914
|
-
unfiltered:
|
|
5917
|
+
unfiltered: 0,
|
|
5915
5918
|
priority: null,
|
|
5916
5919
|
draft: null,
|
|
5917
5920
|
axes: { mode: ['swap', 'new_scene'] },
|
|
5918
5921
|
from: { variant: 'swap' },
|
|
5919
5922
|
},
|
|
5920
5923
|
]),
|
|
5921
|
-
(
|
|
5924
|
+
(ct = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
5922
5925
|
});
|
|
5923
|
-
function
|
|
5926
|
+
function Se(e, t) {
|
|
5924
5927
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5925
5928
|
}
|
|
5926
|
-
function
|
|
5929
|
+
function Er(e, t) {
|
|
5927
5930
|
if (e === 'seedance-2-mini') return 'mini';
|
|
5928
5931
|
if (e !== 'seedance-2') return;
|
|
5929
5932
|
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -5933,93 +5936,93 @@ function Ir(e, t) {
|
|
|
5933
5936
|
? 'fast'
|
|
5934
5937
|
: 'standard';
|
|
5935
5938
|
}
|
|
5936
|
-
function
|
|
5939
|
+
function qr(e, t) {
|
|
5937
5940
|
let r = e
|
|
5938
5941
|
.trim()
|
|
5939
5942
|
.toLowerCase()
|
|
5940
5943
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5941
5944
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5942
|
-
let n =
|
|
5943
|
-
s =
|
|
5945
|
+
let n = Er(r, t),
|
|
5946
|
+
s = Me.get(Se('seedance-2', n));
|
|
5944
5947
|
return s ? s.slug : null;
|
|
5945
5948
|
}
|
|
5946
|
-
let a =
|
|
5949
|
+
let a = le.get(r) ?? Me.get(Se(r));
|
|
5947
5950
|
return a ? a.slug : null;
|
|
5948
5951
|
}
|
|
5949
|
-
function
|
|
5950
|
-
return
|
|
5952
|
+
function $r(e, t) {
|
|
5953
|
+
return le.has(e) && !(Cr.has(e) && t) ? e : qr(e, t);
|
|
5951
5954
|
}
|
|
5952
|
-
function
|
|
5953
|
-
let r =
|
|
5954
|
-
return r ? (
|
|
5955
|
+
function H(e, t) {
|
|
5956
|
+
let r = $r(e, t);
|
|
5957
|
+
return r ? (le.get(r) ?? null) : null;
|
|
5955
5958
|
}
|
|
5956
|
-
function
|
|
5957
|
-
return
|
|
5959
|
+
function pe() {
|
|
5960
|
+
return gt;
|
|
5958
5961
|
}
|
|
5959
|
-
var
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5962
|
+
var mt,
|
|
5963
|
+
ft,
|
|
5964
|
+
gt,
|
|
5965
|
+
Kr,
|
|
5966
|
+
le,
|
|
5967
|
+
Me,
|
|
5968
|
+
ut,
|
|
5969
|
+
Sr,
|
|
5970
|
+
Ke,
|
|
5971
|
+
Cr,
|
|
5972
|
+
F = y(() => {
|
|
5970
5973
|
'use strict';
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
((
|
|
5975
|
-
...
|
|
5976
|
-
families:
|
|
5977
|
-
models:
|
|
5974
|
+
pt();
|
|
5975
|
+
dt();
|
|
5976
|
+
Te();
|
|
5977
|
+
((mt = {
|
|
5978
|
+
...se,
|
|
5979
|
+
families: se.families.map((e) => ({ ...e, models: e.models.filter((t) => !ne(t)) })),
|
|
5980
|
+
models: se.models.filter((e) => !ne(e.slug)),
|
|
5978
5981
|
}),
|
|
5979
|
-
(
|
|
5980
|
-
(
|
|
5981
|
-
(
|
|
5982
|
-
...
|
|
5983
|
-
...
|
|
5984
|
-
.map((e) => ({ ...e, models:
|
|
5982
|
+
(ft = oe.filter((e) => !ne(e.slug))),
|
|
5983
|
+
(gt = [...mt.models, ...ft]),
|
|
5984
|
+
(Kr = [
|
|
5985
|
+
...mt.families,
|
|
5986
|
+
...ct
|
|
5987
|
+
.map((e) => ({ ...e, models: ft.filter((t) => t.family === e.slug).map((t) => t.slug) }))
|
|
5985
5988
|
.filter((e) => e.models.length > 0),
|
|
5986
5989
|
]),
|
|
5987
|
-
(
|
|
5988
|
-
(
|
|
5989
|
-
(
|
|
5990
|
-
(
|
|
5991
|
-
(
|
|
5992
|
-
for (let e of
|
|
5993
|
-
(
|
|
5994
|
-
for (let t of e.variants)
|
|
5990
|
+
(le = new Map()),
|
|
5991
|
+
(Me = new Map()),
|
|
5992
|
+
(ut = new Map()),
|
|
5993
|
+
(Sr = new Map()),
|
|
5994
|
+
(Ke = new Map()));
|
|
5995
|
+
for (let e of gt) {
|
|
5996
|
+
(le.set(e.slug, e), Me.set(Se(e.api.model, e.api.quality), e));
|
|
5997
|
+
for (let t of e.variants) ut.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
5995
5998
|
for (let t of e.editVariants ?? [])
|
|
5996
|
-
|
|
5997
|
-
for (let t of e.addons ?? [])
|
|
5998
|
-
|
|
5999
|
+
ut.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6000
|
+
for (let t of e.addons ?? []) Sr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6001
|
+
Ke.set(e.slug, e.family);
|
|
5999
6002
|
}
|
|
6000
|
-
for (let e of
|
|
6001
|
-
|
|
6003
|
+
for (let e of Kr) for (let t of e.models) Ke.has(t) || Ke.set(t, e.slug);
|
|
6004
|
+
Cr = new Set(['seedance-2']);
|
|
6002
6005
|
});
|
|
6003
|
-
function
|
|
6006
|
+
function de(e) {
|
|
6004
6007
|
let t = e.from?.variant;
|
|
6005
6008
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
6006
6009
|
}
|
|
6007
|
-
function
|
|
6010
|
+
function Ee(e) {
|
|
6008
6011
|
if (e.endpoints?.length)
|
|
6009
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6010
|
-
?
|
|
6012
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === ht)
|
|
6013
|
+
? ht
|
|
6011
6014
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6012
6015
|
}
|
|
6013
|
-
var
|
|
6014
|
-
|
|
6016
|
+
var ht,
|
|
6017
|
+
qe = y(() => {
|
|
6015
6018
|
'use strict';
|
|
6016
|
-
|
|
6017
|
-
|
|
6019
|
+
F();
|
|
6020
|
+
ht = 'dynamic';
|
|
6018
6021
|
});
|
|
6019
|
-
var
|
|
6020
|
-
|
|
6022
|
+
var ce,
|
|
6023
|
+
Ce = y(() => {
|
|
6021
6024
|
'use strict';
|
|
6022
|
-
|
|
6025
|
+
ce = {
|
|
6023
6026
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
6024
6027
|
'gemini-3-7-flash': 'gemini-3.7-flash',
|
|
6025
6028
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
@@ -6029,29 +6032,29 @@ var pe,
|
|
|
6029
6032
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
6030
6033
|
};
|
|
6031
6034
|
});
|
|
6032
|
-
var
|
|
6035
|
+
var yt = y(() => {
|
|
6033
6036
|
'use strict';
|
|
6034
6037
|
});
|
|
6035
|
-
function
|
|
6036
|
-
return typeof t == 'string' && (
|
|
6038
|
+
function bt(e, t) {
|
|
6039
|
+
return typeof t == 'string' && (Ar[e]?.includes(t) ?? !1);
|
|
6037
6040
|
}
|
|
6038
|
-
var
|
|
6039
|
-
|
|
6041
|
+
var Ar,
|
|
6042
|
+
kt = y(() => {
|
|
6040
6043
|
'use strict';
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6044
|
+
F();
|
|
6045
|
+
qe();
|
|
6046
|
+
yt();
|
|
6047
|
+
Ar = {};
|
|
6045
6048
|
});
|
|
6046
|
-
function
|
|
6047
|
-
return e === 'nano-banana-pro' ?
|
|
6049
|
+
function wt(e) {
|
|
6050
|
+
return e === 'nano-banana-pro' ? Rr : Or;
|
|
6048
6051
|
}
|
|
6049
|
-
var
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
+
var Rr,
|
|
6053
|
+
Or,
|
|
6054
|
+
xt = y(() => {
|
|
6052
6055
|
'use strict';
|
|
6053
|
-
((
|
|
6054
|
-
(
|
|
6056
|
+
((Rr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6057
|
+
(Or = [
|
|
6055
6058
|
'auto',
|
|
6056
6059
|
'1:1',
|
|
6057
6060
|
'1:4',
|
|
@@ -6069,10 +6072,10 @@ var Mr,
|
|
|
6069
6072
|
'21:9',
|
|
6070
6073
|
]));
|
|
6071
6074
|
});
|
|
6072
|
-
var
|
|
6073
|
-
|
|
6075
|
+
var Pt,
|
|
6076
|
+
It = y(() => {
|
|
6074
6077
|
'use strict';
|
|
6075
|
-
|
|
6078
|
+
Pt = [
|
|
6076
6079
|
'prompt',
|
|
6077
6080
|
'system',
|
|
6078
6081
|
'messages',
|
|
@@ -6086,10 +6089,10 @@ var ht,
|
|
|
6086
6089
|
'endpoint',
|
|
6087
6090
|
];
|
|
6088
6091
|
});
|
|
6089
|
-
var
|
|
6090
|
-
|
|
6092
|
+
var _t,
|
|
6093
|
+
vt = y(() => {
|
|
6091
6094
|
'use strict';
|
|
6092
|
-
|
|
6095
|
+
_t = [
|
|
6093
6096
|
{
|
|
6094
6097
|
slug: 'claude-fable-5-1',
|
|
6095
6098
|
family: 'fable-5-1',
|
|
@@ -6158,13 +6161,13 @@ var bt,
|
|
|
6158
6161
|
},
|
|
6159
6162
|
];
|
|
6160
6163
|
});
|
|
6161
|
-
function
|
|
6164
|
+
function Tt(e) {
|
|
6162
6165
|
return `$${e}`;
|
|
6163
6166
|
}
|
|
6164
|
-
function
|
|
6165
|
-
return
|
|
6167
|
+
function $e(e, t, r) {
|
|
6168
|
+
return H(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
6166
6169
|
}
|
|
6167
|
-
function
|
|
6170
|
+
function Dr(e) {
|
|
6168
6171
|
return [
|
|
6169
6172
|
{
|
|
6170
6173
|
name: 'prompt',
|
|
@@ -6230,13 +6233,13 @@ function Sr(e) {
|
|
|
6230
6233
|
},
|
|
6231
6234
|
];
|
|
6232
6235
|
}
|
|
6233
|
-
function
|
|
6236
|
+
function Mt() {
|
|
6234
6237
|
return Object.fromEntries(
|
|
6235
|
-
|
|
6236
|
-
let t =
|
|
6237
|
-
r =
|
|
6238
|
-
a =
|
|
6239
|
-
n = t != null && r != null ? `${
|
|
6238
|
+
_t.map((e) => {
|
|
6239
|
+
let t = $e(e.slug, 'cheap', 'input'),
|
|
6240
|
+
r = $e(e.slug, 'cheap', 'output'),
|
|
6241
|
+
a = $e(e.slug, 'stable', 'input') != null,
|
|
6242
|
+
n = t != null && r != null ? `${Tt(t)}/M in \xB7 ${Tt(r)}/M out` : '',
|
|
6240
6243
|
s = {
|
|
6241
6244
|
slug: e.slug,
|
|
6242
6245
|
name: e.name,
|
|
@@ -6247,22 +6250,41 @@ function xt() {
|
|
|
6247
6250
|
priceFormatted: n,
|
|
6248
6251
|
unit: '/M tokens',
|
|
6249
6252
|
primaryToolName: 'run_task',
|
|
6250
|
-
parameters:
|
|
6253
|
+
parameters: Dr(a),
|
|
6251
6254
|
};
|
|
6252
6255
|
return [e.slug, s];
|
|
6253
6256
|
}),
|
|
6254
6257
|
);
|
|
6255
6258
|
}
|
|
6256
|
-
var
|
|
6259
|
+
var Kt = y(() => {
|
|
6257
6260
|
'use strict';
|
|
6258
|
-
|
|
6259
|
-
|
|
6261
|
+
vt();
|
|
6262
|
+
F();
|
|
6260
6263
|
});
|
|
6261
|
-
var
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
+
var ue,
|
|
6265
|
+
St,
|
|
6266
|
+
z,
|
|
6267
|
+
Et,
|
|
6268
|
+
Mi,
|
|
6269
|
+
Ki,
|
|
6270
|
+
Si,
|
|
6271
|
+
Ei,
|
|
6272
|
+
qt = y(() => {
|
|
6273
|
+
'use strict';
|
|
6274
|
+
((ue = 'enhancor-ultrafine'),
|
|
6275
|
+
(St = 'Enhancor Ultrafine'),
|
|
6276
|
+
(z = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
6277
|
+
(Et = 2),
|
|
6278
|
+
(Mi = 24 * 1024 * 1024),
|
|
6279
|
+
(Ki = 4096 * 4096),
|
|
6280
|
+
(Si = 30 * 6e4),
|
|
6281
|
+
(Ei = 120 * 6e4));
|
|
6282
|
+
});
|
|
6283
|
+
var J,
|
|
6284
|
+
me,
|
|
6285
|
+
Ae = y(() => {
|
|
6264
6286
|
'use strict';
|
|
6265
|
-
((
|
|
6287
|
+
((J = [
|
|
6266
6288
|
'seedance-2-5',
|
|
6267
6289
|
'seedance-2',
|
|
6268
6290
|
'seedance-2-mini',
|
|
@@ -6270,14 +6292,15 @@ var H,
|
|
|
6270
6292
|
'seedream-5-5',
|
|
6271
6293
|
'wan-3-0',
|
|
6272
6294
|
'z-image-pro',
|
|
6295
|
+
'doppel',
|
|
6273
6296
|
]),
|
|
6274
|
-
(
|
|
6297
|
+
(me =
|
|
6275
6298
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
6276
6299
|
});
|
|
6277
|
-
function
|
|
6300
|
+
function W(e) {
|
|
6278
6301
|
return `$${Number(e.toFixed(5))}`;
|
|
6279
6302
|
}
|
|
6280
|
-
function
|
|
6303
|
+
function Ur(e) {
|
|
6281
6304
|
if (e.kind === 'llm') {
|
|
6282
6305
|
let t = e.defaultEndpoint,
|
|
6283
6306
|
r = (s) =>
|
|
@@ -6290,41 +6313,41 @@ function Er(e) {
|
|
|
6290
6313
|
a = r('input'),
|
|
6291
6314
|
n = r('output');
|
|
6292
6315
|
return a && n
|
|
6293
|
-
? `${
|
|
6294
|
-
: `from ${
|
|
6316
|
+
? `${W(a.price.starter)}/M in \xB7 ${W(n.price.starter)}/M out`
|
|
6317
|
+
: `from ${W(de(e).price.starter)}/M tokens`;
|
|
6295
6318
|
}
|
|
6296
|
-
return `from ${
|
|
6319
|
+
return `from ${W(de(e).price.starter)}${e.unit}`;
|
|
6297
6320
|
}
|
|
6298
|
-
function
|
|
6321
|
+
function Vr(e, t) {
|
|
6299
6322
|
let r = t.filter((a) => Number.isFinite(a) && a > 0);
|
|
6300
|
-
return r.length ? `from ${
|
|
6323
|
+
return r.length ? `from ${W(Math.min(...r))}${e}` : null;
|
|
6301
6324
|
}
|
|
6302
|
-
function
|
|
6325
|
+
function Ot(e) {
|
|
6303
6326
|
for (let t of G) {
|
|
6304
|
-
let r =
|
|
6305
|
-
a = r ?
|
|
6327
|
+
let r = ge[t],
|
|
6328
|
+
a = r ? Vr(r.unit, e[t] ?? []) : null;
|
|
6306
6329
|
r && a && (r.priceFormatted = a);
|
|
6307
6330
|
}
|
|
6308
6331
|
}
|
|
6309
|
-
function
|
|
6332
|
+
function R(e, t) {
|
|
6310
6333
|
let r = e.axes?.resolution ?? [
|
|
6311
6334
|
...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
|
|
6312
6335
|
];
|
|
6313
6336
|
return {
|
|
6314
6337
|
name: 'resolution',
|
|
6315
6338
|
type: 'select',
|
|
6316
|
-
default:
|
|
6339
|
+
default: de(e).resolution ?? r[0],
|
|
6317
6340
|
options: r,
|
|
6318
6341
|
...(t ? { description: t } : {}),
|
|
6319
6342
|
};
|
|
6320
6343
|
}
|
|
6321
|
-
function
|
|
6344
|
+
function Dt(e) {
|
|
6322
6345
|
if (!e.endpoints?.length) return null;
|
|
6323
|
-
let t = e.endpoints.filter((r) =>
|
|
6346
|
+
let t = e.endpoints.filter((r) => bt(e.slug, r.id));
|
|
6324
6347
|
return {
|
|
6325
6348
|
name: 'endpoint',
|
|
6326
6349
|
type: 'select',
|
|
6327
|
-
default:
|
|
6350
|
+
default: Ee(e),
|
|
6328
6351
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6329
6352
|
description:
|
|
6330
6353
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6333,20 +6356,55 @@ function Kt(e) {
|
|
|
6333
6356
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
6334
6357
|
};
|
|
6335
6358
|
}
|
|
6336
|
-
function
|
|
6359
|
+
function Br(e, t) {
|
|
6337
6360
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
6338
|
-
let r =
|
|
6339
|
-
return [...t.filter((a) => !
|
|
6361
|
+
let r = J.includes(e.api.model);
|
|
6362
|
+
return [...t.filter((a) => !fe.has(a.name)), r ? Ue : Fr];
|
|
6340
6363
|
}
|
|
6341
|
-
function
|
|
6342
|
-
let r = e.filter((n) => !
|
|
6343
|
-
a = [
|
|
6344
|
-
return (a.push(
|
|
6364
|
+
function Re(e, t) {
|
|
6365
|
+
let r = e.filter((n) => !fe.has(n.name)),
|
|
6366
|
+
a = [Ue, Lt];
|
|
6367
|
+
return (a.push(Ve, Fe), [...r, ...a]);
|
|
6345
6368
|
}
|
|
6346
|
-
function
|
|
6369
|
+
function zr(e) {
|
|
6347
6370
|
return [
|
|
6348
6371
|
...e
|
|
6349
|
-
.filter((
|
|
6372
|
+
.filter((t) => !Gr.has(t.name) && !fe.has(t.name))
|
|
6373
|
+
.map((t) => {
|
|
6374
|
+
if (t.name === 'resolution')
|
|
6375
|
+
return {
|
|
6376
|
+
...t,
|
|
6377
|
+
...(t.options
|
|
6378
|
+
? {
|
|
6379
|
+
options: t.options.filter((a) =>
|
|
6380
|
+
['480p', '720p'].includes(String(a).toLowerCase()),
|
|
6381
|
+
),
|
|
6382
|
+
}
|
|
6383
|
+
: {}),
|
|
6384
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Y}`,
|
|
6385
|
+
};
|
|
6386
|
+
let r = Hr[t.name];
|
|
6387
|
+
return r && typeof t.description == 'string'
|
|
6388
|
+
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
|
|
6389
|
+
: t;
|
|
6390
|
+
}),
|
|
6391
|
+
Ue,
|
|
6392
|
+
Lt,
|
|
6393
|
+
Ve,
|
|
6394
|
+
Fe,
|
|
6395
|
+
];
|
|
6396
|
+
}
|
|
6397
|
+
function Nt(e) {
|
|
6398
|
+
return (
|
|
6399
|
+
e.startsWith('seedance-2-5-') &&
|
|
6400
|
+
e !== 'seedance-2-5-lite' &&
|
|
6401
|
+
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
6402
|
+
);
|
|
6403
|
+
}
|
|
6404
|
+
function Ct(e, t = {}) {
|
|
6405
|
+
return [
|
|
6406
|
+
...e
|
|
6407
|
+
.filter((r) => !jr.has(r.name) && !fe.has(r.name))
|
|
6350
6408
|
.map((r) =>
|
|
6351
6409
|
r.name === 'prompt'
|
|
6352
6410
|
? { ...r, required: !0 }
|
|
@@ -6356,7 +6414,7 @@ function Pt(e, t = {}) {
|
|
|
6356
6414
|
...(t.no4k && r.options
|
|
6357
6415
|
? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
|
|
6358
6416
|
: {}),
|
|
6359
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
6417
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Y}`,
|
|
6360
6418
|
}
|
|
6361
6419
|
: r,
|
|
6362
6420
|
),
|
|
@@ -6367,11 +6425,11 @@ function Pt(e, t = {}) {
|
|
|
6367
6425
|
options: ['standard'],
|
|
6368
6426
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
6369
6427
|
},
|
|
6370
|
-
|
|
6371
|
-
|
|
6428
|
+
Ve,
|
|
6429
|
+
Fe,
|
|
6372
6430
|
];
|
|
6373
6431
|
}
|
|
6374
|
-
function
|
|
6432
|
+
function Oe(e, t) {
|
|
6375
6433
|
return [
|
|
6376
6434
|
M('Text prompt describing the video.'),
|
|
6377
6435
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -6383,7 +6441,7 @@ function Ee(e, t) {
|
|
|
6383
6441
|
max: t.maxSec,
|
|
6384
6442
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
6385
6443
|
},
|
|
6386
|
-
|
|
6444
|
+
R(e),
|
|
6387
6445
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
6388
6446
|
...t.references.map((r) =>
|
|
6389
6447
|
r.endsWith('s')
|
|
@@ -6400,8 +6458,8 @@ function Ee(e, t) {
|
|
|
6400
6458
|
),
|
|
6401
6459
|
];
|
|
6402
6460
|
}
|
|
6403
|
-
function
|
|
6404
|
-
let t =
|
|
6461
|
+
function Jr(e) {
|
|
6462
|
+
let t = Dt(e);
|
|
6405
6463
|
return [
|
|
6406
6464
|
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
6407
6465
|
...(t ? [t] : []),
|
|
@@ -6411,17 +6469,17 @@ function Vr(e) {
|
|
|
6411
6469
|
default: 'low',
|
|
6412
6470
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
6413
6471
|
},
|
|
6414
|
-
|
|
6472
|
+
R(
|
|
6415
6473
|
e,
|
|
6416
6474
|
e.slug === 'gpt-image-2'
|
|
6417
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
6475
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ot}`
|
|
6418
6476
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6419
6477
|
),
|
|
6420
6478
|
{
|
|
6421
6479
|
name: 'aspect_ratio',
|
|
6422
6480
|
type: 'select',
|
|
6423
6481
|
default: 'auto',
|
|
6424
|
-
options: [...
|
|
6482
|
+
options: [...st],
|
|
6425
6483
|
description:
|
|
6426
6484
|
"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.",
|
|
6427
6485
|
},
|
|
@@ -6468,7 +6526,7 @@ function Vr(e) {
|
|
|
6468
6526
|
},
|
|
6469
6527
|
];
|
|
6470
6528
|
}
|
|
6471
|
-
function
|
|
6529
|
+
function Wr(e) {
|
|
6472
6530
|
return [
|
|
6473
6531
|
M('Image prompt text.'),
|
|
6474
6532
|
{
|
|
@@ -6476,8 +6534,8 @@ function Nr(e) {
|
|
|
6476
6534
|
type: 'string[]',
|
|
6477
6535
|
description: 'Images to edit or use as reference (up to 14).',
|
|
6478
6536
|
},
|
|
6479
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
6480
|
-
|
|
6537
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...wt(e.slug)] },
|
|
6538
|
+
R(e),
|
|
6481
6539
|
{
|
|
6482
6540
|
name: 'n',
|
|
6483
6541
|
type: 'slider',
|
|
@@ -6502,10 +6560,10 @@ function Nr(e) {
|
|
|
6502
6560
|
},
|
|
6503
6561
|
];
|
|
6504
6562
|
}
|
|
6505
|
-
function
|
|
6506
|
-
let e =
|
|
6563
|
+
function Zr() {
|
|
6564
|
+
let e = Pt,
|
|
6507
6565
|
t = [];
|
|
6508
|
-
for (let r of
|
|
6566
|
+
for (let r of Be(!0))
|
|
6509
6567
|
e.includes(r.name) &&
|
|
6510
6568
|
(t.push({
|
|
6511
6569
|
...r,
|
|
@@ -6527,12 +6585,12 @@ function jr() {
|
|
|
6527
6585
|
}));
|
|
6528
6586
|
return t;
|
|
6529
6587
|
}
|
|
6530
|
-
function
|
|
6531
|
-
return
|
|
6588
|
+
function ea() {
|
|
6589
|
+
return Be(!0).map((e) =>
|
|
6532
6590
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6533
6591
|
);
|
|
6534
6592
|
}
|
|
6535
|
-
function
|
|
6593
|
+
function Be(e) {
|
|
6536
6594
|
return [
|
|
6537
6595
|
M('The user message or task.'),
|
|
6538
6596
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -6627,21 +6685,21 @@ function De(e) {
|
|
|
6627
6685
|
},
|
|
6628
6686
|
];
|
|
6629
6687
|
}
|
|
6630
|
-
function
|
|
6631
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6632
|
-
let t =
|
|
6688
|
+
function ta(e) {
|
|
6689
|
+
if (e.slug === 'seed-2-1-turbo') return Xr;
|
|
6690
|
+
let t = Dt(e);
|
|
6633
6691
|
return [
|
|
6634
6692
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
6635
|
-
?
|
|
6693
|
+
? Zr()
|
|
6636
6694
|
: e.slug === 'gemini-3.7-flash'
|
|
6637
|
-
?
|
|
6638
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6639
|
-
?
|
|
6640
|
-
:
|
|
6695
|
+
? ea()
|
|
6696
|
+
: e.slug === 'gpt-6-astra' || Qr.includes(e.slug)
|
|
6697
|
+
? Be(e.slug !== 'gpt-6-astra')
|
|
6698
|
+
: Yr),
|
|
6641
6699
|
...(t ? [t] : []),
|
|
6642
6700
|
];
|
|
6643
6701
|
}
|
|
6644
|
-
function
|
|
6702
|
+
function De() {
|
|
6645
6703
|
return {
|
|
6646
6704
|
name: 'image',
|
|
6647
6705
|
type: 'string',
|
|
@@ -6649,7 +6707,7 @@ function Ae() {
|
|
|
6649
6707
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
6650
6708
|
};
|
|
6651
6709
|
}
|
|
6652
|
-
function
|
|
6710
|
+
function aa(e) {
|
|
6653
6711
|
return [
|
|
6654
6712
|
{
|
|
6655
6713
|
name: 'video_url',
|
|
@@ -6658,7 +6716,7 @@ function Jr(e) {
|
|
|
6658
6716
|
description:
|
|
6659
6717
|
'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
|
|
6660
6718
|
},
|
|
6661
|
-
|
|
6719
|
+
R(
|
|
6662
6720
|
e,
|
|
6663
6721
|
'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
|
|
6664
6722
|
),
|
|
@@ -6671,7 +6729,7 @@ function Jr(e) {
|
|
|
6671
6729
|
},
|
|
6672
6730
|
];
|
|
6673
6731
|
}
|
|
6674
|
-
function
|
|
6732
|
+
function ia() {
|
|
6675
6733
|
return [
|
|
6676
6734
|
{
|
|
6677
6735
|
name: 'mode',
|
|
@@ -6726,6 +6784,13 @@ function Wr() {
|
|
|
6726
6784
|
description:
|
|
6727
6785
|
'true: your character takes the facial expression of the person in the photo. false: they keep the expression from their own picture.',
|
|
6728
6786
|
},
|
|
6787
|
+
{
|
|
6788
|
+
name: 'creative_mode',
|
|
6789
|
+
type: 'boolean',
|
|
6790
|
+
default: !1,
|
|
6791
|
+
description:
|
|
6792
|
+
'Runs the Creative mode checkpoint, at the same price as a standard run. The Acceptable Use Policy applies.',
|
|
6793
|
+
},
|
|
6729
6794
|
{
|
|
6730
6795
|
name: 'aspect_ratio',
|
|
6731
6796
|
type: 'select',
|
|
@@ -6735,32 +6800,33 @@ function Wr() {
|
|
|
6735
6800
|
},
|
|
6736
6801
|
];
|
|
6737
6802
|
}
|
|
6738
|
-
function
|
|
6803
|
+
function na(e) {
|
|
6739
6804
|
let t = e.slug;
|
|
6740
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
6741
|
-
if (
|
|
6742
|
-
if (e.kind === 'llm') return
|
|
6743
|
-
if (e.editVariants?.length) return
|
|
6805
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return ia();
|
|
6806
|
+
if (oe.some((r) => r.slug === t)) return aa(e);
|
|
6807
|
+
if (e.kind === 'llm') return ta(e);
|
|
6808
|
+
if (e.editVariants?.length) return Jr(e);
|
|
6809
|
+
if (Nt(t)) return zr(Le);
|
|
6744
6810
|
switch (t) {
|
|
6745
6811
|
case 'seedance-2-5':
|
|
6746
|
-
return
|
|
6812
|
+
return Re(Le, t);
|
|
6747
6813
|
case 'seedance-2-5-lite':
|
|
6748
|
-
return
|
|
6814
|
+
return Ct(Le, { no4k: !0 });
|
|
6749
6815
|
case 'seedance-2':
|
|
6750
|
-
return
|
|
6816
|
+
return Re($t, t);
|
|
6751
6817
|
case 'seedance-2-lite':
|
|
6752
|
-
return
|
|
6818
|
+
return Ct($t);
|
|
6753
6819
|
case 'seedance-2-mini':
|
|
6754
|
-
return
|
|
6820
|
+
return Re(sa, t);
|
|
6755
6821
|
case 'nano-banana-2':
|
|
6756
6822
|
case 'nano-banana-2.1':
|
|
6757
6823
|
case 'nano-banana-pro':
|
|
6758
|
-
return
|
|
6824
|
+
return Wr(e);
|
|
6759
6825
|
case 'seedream-5-pro':
|
|
6760
6826
|
return [
|
|
6761
6827
|
M('Detailed description of the image to generate.'),
|
|
6762
6828
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
6763
|
-
|
|
6829
|
+
R(e),
|
|
6764
6830
|
{
|
|
6765
6831
|
name: 'aspect_ratio',
|
|
6766
6832
|
type: 'select',
|
|
@@ -6788,7 +6854,7 @@ function Yr(e) {
|
|
|
6788
6854
|
description:
|
|
6789
6855
|
'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
|
|
6790
6856
|
},
|
|
6791
|
-
|
|
6857
|
+
R(
|
|
6792
6858
|
e,
|
|
6793
6859
|
'1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
|
|
6794
6860
|
),
|
|
@@ -6834,7 +6900,7 @@ function Yr(e) {
|
|
|
6834
6900
|
type: 'string[]',
|
|
6835
6901
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
6836
6902
|
},
|
|
6837
|
-
|
|
6903
|
+
R(e),
|
|
6838
6904
|
{
|
|
6839
6905
|
name: 'aspect_ratio',
|
|
6840
6906
|
type: 'select',
|
|
@@ -6853,7 +6919,7 @@ function Yr(e) {
|
|
|
6853
6919
|
case 'z-image-pro':
|
|
6854
6920
|
return [
|
|
6855
6921
|
M('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
6856
|
-
|
|
6922
|
+
R(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
6857
6923
|
{
|
|
6858
6924
|
name: 'aspect_ratio',
|
|
6859
6925
|
type: 'select',
|
|
@@ -6906,7 +6972,7 @@ function Yr(e) {
|
|
|
6906
6972
|
];
|
|
6907
6973
|
case 'enhancor-skin-fix-v1':
|
|
6908
6974
|
return [
|
|
6909
|
-
|
|
6975
|
+
De(),
|
|
6910
6976
|
{
|
|
6911
6977
|
name: 'mode',
|
|
6912
6978
|
type: 'select',
|
|
@@ -6939,11 +7005,11 @@ function Yr(e) {
|
|
|
6939
7005
|
max: 0.4,
|
|
6940
7006
|
description: 'Portrait depth. Heavy only.',
|
|
6941
7007
|
},
|
|
6942
|
-
...
|
|
7008
|
+
...ra,
|
|
6943
7009
|
];
|
|
6944
7010
|
case 'enhancor-skin-fix-v3':
|
|
6945
7011
|
return [
|
|
6946
|
-
|
|
7012
|
+
De(),
|
|
6947
7013
|
{
|
|
6948
7014
|
name: 'mask_image',
|
|
6949
7015
|
type: 'string',
|
|
@@ -6983,7 +7049,7 @@ function Yr(e) {
|
|
|
6983
7049
|
];
|
|
6984
7050
|
case 'enhancor-skin-fix-v4':
|
|
6985
7051
|
return [
|
|
6986
|
-
|
|
7052
|
+
De(),
|
|
6987
7053
|
{
|
|
6988
7054
|
name: 'mode',
|
|
6989
7055
|
type: 'select',
|
|
@@ -7014,7 +7080,7 @@ function Yr(e) {
|
|
|
7014
7080
|
];
|
|
7015
7081
|
case 'wan-3-0':
|
|
7016
7082
|
case 'wan-3-0-prime':
|
|
7017
|
-
return
|
|
7083
|
+
return Oe(e, {
|
|
7018
7084
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7019
7085
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
7020
7086
|
minSec: 2,
|
|
@@ -7024,7 +7090,7 @@ function Yr(e) {
|
|
|
7024
7090
|
});
|
|
7025
7091
|
case 'happy-horse-1-1':
|
|
7026
7092
|
case 'happy-horse-1-0':
|
|
7027
|
-
return
|
|
7093
|
+
return Oe(e, {
|
|
7028
7094
|
modes:
|
|
7029
7095
|
t === 'happy-horse-1-0'
|
|
7030
7096
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -7035,7 +7101,7 @@ function Yr(e) {
|
|
|
7035
7101
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
7036
7102
|
});
|
|
7037
7103
|
case 'minimax-h3':
|
|
7038
|
-
return
|
|
7104
|
+
return Oe(e, {
|
|
7039
7105
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7040
7106
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
7041
7107
|
minSec: 4,
|
|
@@ -7046,161 +7112,208 @@ function Yr(e) {
|
|
|
7046
7112
|
return [M('Prompt text.')];
|
|
7047
7113
|
}
|
|
7048
7114
|
}
|
|
7049
|
-
function
|
|
7115
|
+
function oa() {
|
|
7116
|
+
return {
|
|
7117
|
+
slug: ue,
|
|
7118
|
+
name: St,
|
|
7119
|
+
category: 'Image',
|
|
7120
|
+
kind: 'Image-to-Image',
|
|
7121
|
+
vendor: 'Enhancor',
|
|
7122
|
+
description:
|
|
7123
|
+
'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).',
|
|
7124
|
+
priceFormatted: '',
|
|
7125
|
+
unit: '/img',
|
|
7126
|
+
primaryToolName: Rt.image,
|
|
7127
|
+
parameters: [
|
|
7128
|
+
{
|
|
7129
|
+
name: 'image',
|
|
7130
|
+
type: 'string',
|
|
7131
|
+
required: !0,
|
|
7132
|
+
description:
|
|
7133
|
+
"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.",
|
|
7134
|
+
},
|
|
7135
|
+
{
|
|
7136
|
+
name: 'skin_fix',
|
|
7137
|
+
type: 'boolean',
|
|
7138
|
+
default: !1,
|
|
7139
|
+
description: 'Also fixes the skin. Off by default.',
|
|
7140
|
+
},
|
|
7141
|
+
{
|
|
7142
|
+
name: 'mode',
|
|
7143
|
+
type: 'select',
|
|
7144
|
+
default: 'full',
|
|
7145
|
+
options: ['full', 'fast'],
|
|
7146
|
+
description:
|
|
7147
|
+
'Full: the photo times the scale. Fast: long side 2432 px. Both are priced per output megapixel, no minimum.',
|
|
7148
|
+
},
|
|
7149
|
+
{
|
|
7150
|
+
name: 'scale',
|
|
7151
|
+
type: 'select',
|
|
7152
|
+
default: String(Et),
|
|
7153
|
+
options: z.noSkin.map(String),
|
|
7154
|
+
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.`,
|
|
7155
|
+
},
|
|
7156
|
+
],
|
|
7157
|
+
};
|
|
7158
|
+
}
|
|
7159
|
+
function Ne(e, t = e.api.model) {
|
|
7050
7160
|
return {
|
|
7051
7161
|
slug: t,
|
|
7052
7162
|
name: e.name,
|
|
7053
|
-
category:
|
|
7054
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
7163
|
+
category: Lr[e.kind],
|
|
7164
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Nr[e.kind],
|
|
7055
7165
|
vendor: e.vendor ?? '',
|
|
7056
7166
|
description: e.desc ?? e.name,
|
|
7057
|
-
priceFormatted:
|
|
7167
|
+
priceFormatted: Ur(e),
|
|
7058
7168
|
unit: e.unit,
|
|
7059
|
-
primaryToolName:
|
|
7060
|
-
parameters:
|
|
7169
|
+
primaryToolName: Rt[e.kind],
|
|
7170
|
+
parameters: Br(e, na(e)),
|
|
7061
7171
|
};
|
|
7062
7172
|
}
|
|
7063
|
-
function
|
|
7173
|
+
function la() {
|
|
7064
7174
|
let e = {};
|
|
7065
|
-
for (let t of
|
|
7175
|
+
for (let t of pe())
|
|
7066
7176
|
if (t.slug !== 'seedance-2-fast') {
|
|
7067
7177
|
if (t.slug === 'seedance-2-mini') {
|
|
7068
|
-
e['seedance-2-mini'] =
|
|
7178
|
+
e['seedance-2-mini'] = Ne(t, 'seedance-2-mini');
|
|
7069
7179
|
continue;
|
|
7070
7180
|
}
|
|
7071
7181
|
if (t.slug === 'seedance-2') {
|
|
7072
|
-
let r =
|
|
7182
|
+
let r = Ne(t);
|
|
7073
7183
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
7074
7184
|
(e['seedance-2'] = r));
|
|
7075
7185
|
continue;
|
|
7076
7186
|
}
|
|
7077
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
7187
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Ne(t));
|
|
7078
7188
|
}
|
|
7079
|
-
Object.assign(e,
|
|
7080
|
-
for (let [t, r] of Object.entries(
|
|
7189
|
+
(Object.assign(e, Mt()), (e[ue] = oa()));
|
|
7190
|
+
for (let [t, r] of Object.entries(ce))
|
|
7081
7191
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
7082
7192
|
return e;
|
|
7083
7193
|
}
|
|
7084
|
-
function
|
|
7194
|
+
function he(e) {
|
|
7085
7195
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
7086
7196
|
}
|
|
7087
|
-
function
|
|
7088
|
-
return
|
|
7197
|
+
function B(e) {
|
|
7198
|
+
return ge[e] ?? null;
|
|
7089
7199
|
}
|
|
7090
|
-
function
|
|
7091
|
-
if (e.startsWith('enhancor-skin-fix-')) return !1;
|
|
7092
|
-
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
7200
|
+
function pa(e, t, r) {
|
|
7201
|
+
if (e.startsWith('enhancor-skin-fix-') || e === ue) return !1;
|
|
7202
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Nt(e)) && t === 'duration') {
|
|
7093
7203
|
let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
7094
7204
|
if (a(r.mode) === 'edit' || a(r.omni_reference_task_type) === 'edit') return !1;
|
|
7095
7205
|
}
|
|
7096
7206
|
return !(
|
|
7097
|
-
(t === 'max_tokens' &&
|
|
7098
|
-
(t === 'max_completion_tokens' &&
|
|
7207
|
+
(t === 'max_tokens' && At(r.max_completion_tokens)) ||
|
|
7208
|
+
(t === 'max_completion_tokens' && At(r.max_tokens))
|
|
7099
7209
|
);
|
|
7100
7210
|
}
|
|
7101
|
-
function
|
|
7211
|
+
function At(e) {
|
|
7102
7212
|
return e != null && e !== '';
|
|
7103
7213
|
}
|
|
7104
|
-
function
|
|
7214
|
+
function Ft(e, t) {
|
|
7105
7215
|
let r = { ...t };
|
|
7106
7216
|
if (e?.slug === 'seedance-2-5') {
|
|
7107
7217
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
7108
|
-
for (let n of
|
|
7218
|
+
for (let n of da) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
|
|
7109
7219
|
if (!a(r.finalize)) return r;
|
|
7110
7220
|
}
|
|
7111
7221
|
for (let a of e?.parameters ?? [])
|
|
7112
7222
|
a.default !== void 0 &&
|
|
7113
7223
|
r[a.name] === void 0 &&
|
|
7114
|
-
|
|
7224
|
+
pa(e.slug, a.name, t) &&
|
|
7115
7225
|
(r[a.name] = a.default);
|
|
7116
7226
|
return r;
|
|
7117
7227
|
}
|
|
7118
|
-
function
|
|
7119
|
-
return Object.values(
|
|
7228
|
+
function O() {
|
|
7229
|
+
return Object.values(ge);
|
|
7120
7230
|
}
|
|
7121
|
-
var
|
|
7122
|
-
|
|
7123
|
-
|
|
7231
|
+
var Lr,
|
|
7232
|
+
Rt,
|
|
7233
|
+
Nr,
|
|
7124
7234
|
M,
|
|
7125
|
-
|
|
7126
|
-
Or,
|
|
7127
|
-
Rr,
|
|
7128
|
-
qt,
|
|
7129
|
-
$t,
|
|
7130
|
-
Re,
|
|
7131
|
-
Lr,
|
|
7132
|
-
Ur,
|
|
7133
|
-
Br,
|
|
7235
|
+
Ue,
|
|
7134
7236
|
Fr,
|
|
7237
|
+
Lt,
|
|
7238
|
+
Ve,
|
|
7239
|
+
Fe,
|
|
7240
|
+
fe,
|
|
7241
|
+
jr,
|
|
7242
|
+
Gr,
|
|
7135
7243
|
Hr,
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
Ct,
|
|
7139
|
-
Et,
|
|
7140
|
-
vt,
|
|
7244
|
+
Yr,
|
|
7245
|
+
Xr,
|
|
7141
7246
|
Qr,
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7247
|
+
ra,
|
|
7248
|
+
Y,
|
|
7249
|
+
Le,
|
|
7250
|
+
Ut,
|
|
7251
|
+
Vt,
|
|
7252
|
+
$t,
|
|
7253
|
+
sa,
|
|
7254
|
+
ge,
|
|
7255
|
+
da,
|
|
7256
|
+
X = y(() => {
|
|
7145
7257
|
'use strict';
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
yt();
|
|
7258
|
+
lt();
|
|
7259
|
+
ve();
|
|
7260
|
+
F();
|
|
7261
|
+
qe();
|
|
7262
|
+
Te();
|
|
7263
|
+
Ce();
|
|
7264
|
+
kt();
|
|
7265
|
+
xt();
|
|
7155
7266
|
It();
|
|
7156
|
-
|
|
7157
|
-
(
|
|
7158
|
-
|
|
7267
|
+
Kt();
|
|
7268
|
+
qt();
|
|
7269
|
+
Ae();
|
|
7270
|
+
((Lr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
7271
|
+
(Rt = {
|
|
7159
7272
|
video: 'generate_video',
|
|
7160
7273
|
image: 'generate_image',
|
|
7161
7274
|
audio: 'generate_audio',
|
|
7162
7275
|
llm: 'run_task',
|
|
7163
7276
|
}),
|
|
7164
|
-
(
|
|
7277
|
+
(Nr = {
|
|
7165
7278
|
video: 'Text-to-Video',
|
|
7166
7279
|
image: 'Text-to-Image',
|
|
7167
7280
|
audio: 'Text-to-Audio',
|
|
7168
7281
|
llm: 'Reasoning (LLM)',
|
|
7169
7282
|
}));
|
|
7170
7283
|
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
7171
|
-
((
|
|
7284
|
+
((Ue = {
|
|
7172
7285
|
name: 'creative_mode',
|
|
7173
7286
|
type: 'boolean',
|
|
7174
7287
|
default: !1,
|
|
7175
7288
|
description:
|
|
7176
7289
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
7177
7290
|
}),
|
|
7178
|
-
(
|
|
7291
|
+
(Fr = {
|
|
7179
7292
|
name: 'creative_mode',
|
|
7180
7293
|
type: 'boolean',
|
|
7181
7294
|
default: !1,
|
|
7182
|
-
description: `Not available yet on this model: ${
|
|
7295
|
+
description: `Not available yet on this model: ${me}.`,
|
|
7183
7296
|
}),
|
|
7184
|
-
(
|
|
7297
|
+
(Lt = {
|
|
7185
7298
|
name: 'priority',
|
|
7186
7299
|
type: 'boolean',
|
|
7187
7300
|
default: !1,
|
|
7188
7301
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
7189
7302
|
}),
|
|
7190
|
-
(
|
|
7303
|
+
(Ve = {
|
|
7191
7304
|
name: 'reference_roles',
|
|
7192
7305
|
type: 'json',
|
|
7193
7306
|
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).`,
|
|
7194
7307
|
}),
|
|
7195
|
-
(
|
|
7308
|
+
(Fe = {
|
|
7196
7309
|
name: 'auto_fit_images',
|
|
7197
7310
|
type: 'boolean',
|
|
7198
7311
|
default: !1,
|
|
7199
7312
|
description:
|
|
7200
7313
|
'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.',
|
|
7201
7314
|
}),
|
|
7202
|
-
(
|
|
7203
|
-
|
|
7315
|
+
(fe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
7316
|
+
((jr = new Set([
|
|
7204
7317
|
'quality',
|
|
7205
7318
|
'bitrate_mode',
|
|
7206
7319
|
'draft',
|
|
@@ -7208,8 +7321,21 @@ var qr,
|
|
|
7208
7321
|
'draft_task_id',
|
|
7209
7322
|
'draft_generation_id',
|
|
7210
7323
|
'pass_faces',
|
|
7211
|
-
])
|
|
7212
|
-
|
|
7324
|
+
])),
|
|
7325
|
+
(Gr = new Set([
|
|
7326
|
+
'quality',
|
|
7327
|
+
'bitrate_mode',
|
|
7328
|
+
'draft',
|
|
7329
|
+
'finalize',
|
|
7330
|
+
'draft_task_id',
|
|
7331
|
+
'draft_generation_id',
|
|
7332
|
+
])),
|
|
7333
|
+
(Hr = {
|
|
7334
|
+
images: 'up to 10',
|
|
7335
|
+
videos: 'up to 5; combined duration < 30s',
|
|
7336
|
+
audios: 'up to 5; combined duration < 30s',
|
|
7337
|
+
}));
|
|
7338
|
+
((Yr = [
|
|
7213
7339
|
M('The user message or task.'),
|
|
7214
7340
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7215
7341
|
{
|
|
@@ -7227,7 +7353,7 @@ var qr,
|
|
|
7227
7353
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
7228
7354
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
7229
7355
|
]),
|
|
7230
|
-
(
|
|
7356
|
+
(Xr = [
|
|
7231
7357
|
M('The user message or task.'),
|
|
7232
7358
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7233
7359
|
{
|
|
@@ -7309,8 +7435,8 @@ var qr,
|
|
|
7309
7435
|
description: 'Video frames read a second.',
|
|
7310
7436
|
},
|
|
7311
7437
|
]),
|
|
7312
|
-
(
|
|
7313
|
-
|
|
7438
|
+
(Qr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
7439
|
+
ra = Object.entries({
|
|
7314
7440
|
background: !1,
|
|
7315
7441
|
skin: !1,
|
|
7316
7442
|
nose: !1,
|
|
@@ -7336,8 +7462,8 @@ var qr,
|
|
|
7336
7462
|
default: t,
|
|
7337
7463
|
description: 'Keep this part out of the fix. Standard only.',
|
|
7338
7464
|
}));
|
|
7339
|
-
((
|
|
7340
|
-
(
|
|
7465
|
+
((Y = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
7466
|
+
(Le = [
|
|
7341
7467
|
{
|
|
7342
7468
|
name: 'prompt',
|
|
7343
7469
|
type: 'string',
|
|
@@ -7375,7 +7501,7 @@ var qr,
|
|
|
7375
7501
|
type: 'select',
|
|
7376
7502
|
default: '480p',
|
|
7377
7503
|
options: ['480p', '720p', '1080p', '4k'],
|
|
7378
|
-
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. ${
|
|
7504
|
+
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}`,
|
|
7379
7505
|
},
|
|
7380
7506
|
{
|
|
7381
7507
|
name: 'aspect_ratio',
|
|
@@ -7486,19 +7612,19 @@ var qr,
|
|
|
7486
7612
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7487
7613
|
},
|
|
7488
7614
|
]),
|
|
7489
|
-
(
|
|
7615
|
+
(Ut = {
|
|
7490
7616
|
name: 'images',
|
|
7491
7617
|
type: 'string[]',
|
|
7492
7618
|
description:
|
|
7493
7619
|
'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.',
|
|
7494
7620
|
}),
|
|
7495
|
-
(
|
|
7621
|
+
(Vt = {
|
|
7496
7622
|
name: 'audios',
|
|
7497
7623
|
type: 'string[]',
|
|
7498
7624
|
description:
|
|
7499
7625
|
'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.',
|
|
7500
7626
|
}),
|
|
7501
|
-
(
|
|
7627
|
+
($t = [
|
|
7502
7628
|
{
|
|
7503
7629
|
name: 'prompt',
|
|
7504
7630
|
type: 'string',
|
|
@@ -7542,7 +7668,7 @@ var qr,
|
|
|
7542
7668
|
type: 'select',
|
|
7543
7669
|
default: '480p',
|
|
7544
7670
|
options: ['480p', '720p', '1080p', '4k'],
|
|
7545
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
7671
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Y}`,
|
|
7546
7672
|
},
|
|
7547
7673
|
{
|
|
7548
7674
|
name: 'bitrate_mode',
|
|
@@ -7576,8 +7702,8 @@ var qr,
|
|
|
7576
7702
|
description:
|
|
7577
7703
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7578
7704
|
},
|
|
7579
|
-
|
|
7580
|
-
|
|
7705
|
+
Ut,
|
|
7706
|
+
Vt,
|
|
7581
7707
|
{
|
|
7582
7708
|
name: 'first_frame_image',
|
|
7583
7709
|
type: 'string',
|
|
@@ -7598,7 +7724,7 @@ var qr,
|
|
|
7598
7724
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7599
7725
|
},
|
|
7600
7726
|
]),
|
|
7601
|
-
(
|
|
7727
|
+
(sa = [
|
|
7602
7728
|
{
|
|
7603
7729
|
name: 'prompt',
|
|
7604
7730
|
type: 'string',
|
|
@@ -7619,7 +7745,7 @@ var qr,
|
|
|
7619
7745
|
type: 'select',
|
|
7620
7746
|
default: '480p',
|
|
7621
7747
|
options: ['480p', '720p'],
|
|
7622
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
7748
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Y}`,
|
|
7623
7749
|
},
|
|
7624
7750
|
{
|
|
7625
7751
|
name: 'bitrate_mode',
|
|
@@ -7653,8 +7779,8 @@ var qr,
|
|
|
7653
7779
|
description:
|
|
7654
7780
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7655
7781
|
},
|
|
7656
|
-
|
|
7657
|
-
|
|
7782
|
+
Ut,
|
|
7783
|
+
Vt,
|
|
7658
7784
|
{
|
|
7659
7785
|
name: 'first_frame_image',
|
|
7660
7786
|
type: 'string',
|
|
@@ -7669,53 +7795,53 @@ var qr,
|
|
|
7669
7795
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7670
7796
|
},
|
|
7671
7797
|
]));
|
|
7672
|
-
|
|
7673
|
-
|
|
7798
|
+
ge = la();
|
|
7799
|
+
da = ['draft_task_id', 'draft_generation_id'];
|
|
7674
7800
|
});
|
|
7675
|
-
function
|
|
7801
|
+
function ye(e) {
|
|
7676
7802
|
let t = '/v1/pricing/models',
|
|
7677
7803
|
r = e?.trim();
|
|
7678
7804
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7679
7805
|
}
|
|
7680
|
-
var
|
|
7806
|
+
var Ge = y(() => {
|
|
7681
7807
|
'use strict';
|
|
7682
7808
|
});
|
|
7683
|
-
function
|
|
7809
|
+
function Zt(e) {
|
|
7684
7810
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
7685
7811
|
}
|
|
7686
|
-
function
|
|
7687
|
-
let t =
|
|
7688
|
-
r = t.filter((s) =>
|
|
7689
|
-
a = t.filter((s) => !
|
|
7812
|
+
function er(e) {
|
|
7813
|
+
let t = pe().filter((s) => s.kind === e && s.unfiltered != null),
|
|
7814
|
+
r = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
|
|
7815
|
+
a = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
|
|
7690
7816
|
return [
|
|
7691
7817
|
...(r.length
|
|
7692
|
-
? [`${
|
|
7818
|
+
? [`${Zt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7693
7819
|
: []),
|
|
7694
|
-
...(a.length ? [`Not available yet on ${
|
|
7820
|
+
...(a.length ? [`Not available yet on ${Zt(a)}: ${me}.`] : []),
|
|
7695
7821
|
'The Acceptable Use Policy applies.',
|
|
7696
7822
|
].join(' ');
|
|
7697
7823
|
}
|
|
7698
|
-
function
|
|
7699
|
-
if (
|
|
7824
|
+
function Aa(e) {
|
|
7825
|
+
if (Ca.has(e.name)) return e;
|
|
7700
7826
|
let t = e.inputSchema.properties;
|
|
7701
7827
|
return !t || t.callback_url
|
|
7702
7828
|
? e
|
|
7703
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7829
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: qa } } };
|
|
7704
7830
|
}
|
|
7705
|
-
function
|
|
7831
|
+
function Ra(e) {
|
|
7706
7832
|
let t = e.inputSchema.properties;
|
|
7707
7833
|
if (!t) return e;
|
|
7708
7834
|
let r = !1,
|
|
7709
7835
|
a = {};
|
|
7710
7836
|
for (let [n, s] of Object.entries(t))
|
|
7711
|
-
|
|
7837
|
+
tr.has(n) && s.type === 'string' && !s.format
|
|
7712
7838
|
? ((a[n] = { ...s, format: 'uri' }), (r = !0))
|
|
7713
|
-
:
|
|
7839
|
+
: tr.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
7714
7840
|
? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
|
|
7715
7841
|
: (a[n] = s);
|
|
7716
7842
|
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
7717
7843
|
}
|
|
7718
|
-
function
|
|
7844
|
+
function Oa(e) {
|
|
7719
7845
|
switch (e.type) {
|
|
7720
7846
|
case 'string':
|
|
7721
7847
|
return {
|
|
@@ -7770,11 +7896,11 @@ function Ta(e) {
|
|
|
7770
7896
|
return { type: 'string', description: e.description };
|
|
7771
7897
|
}
|
|
7772
7898
|
}
|
|
7773
|
-
function
|
|
7899
|
+
function Da(e, t) {
|
|
7774
7900
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7775
7901
|
a = {},
|
|
7776
7902
|
n = [];
|
|
7777
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
7903
|
+
for (let o of e.parameters) ((a[o.name] = Oa(o)), o.required && n.push(o.name));
|
|
7778
7904
|
let s = {
|
|
7779
7905
|
type: 'object',
|
|
7780
7906
|
properties: a,
|
|
@@ -7787,11 +7913,11 @@ function Ma(e, t) {
|
|
|
7787
7913
|
inputSchema: s,
|
|
7788
7914
|
};
|
|
7789
7915
|
}
|
|
7790
|
-
function
|
|
7791
|
-
let e =
|
|
7792
|
-
t =
|
|
7793
|
-
r =
|
|
7794
|
-
a =
|
|
7916
|
+
function La() {
|
|
7917
|
+
let e = O().filter((d) => d.category === 'Image' && !he(d)),
|
|
7918
|
+
t = O().filter((d) => d.category === 'Video'),
|
|
7919
|
+
r = O().filter((d) => d.category === 'Text'),
|
|
7920
|
+
a = O().filter((d) => d.category === 'Audio'),
|
|
7795
7921
|
n = {
|
|
7796
7922
|
name: 'generate_image',
|
|
7797
7923
|
description:
|
|
@@ -7883,7 +8009,7 @@ function Ka() {
|
|
|
7883
8009
|
maximum: 2147483647,
|
|
7884
8010
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
7885
8011
|
},
|
|
7886
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8012
|
+
creative_mode: { type: 'boolean', default: !1, description: er('image') },
|
|
7887
8013
|
},
|
|
7888
8014
|
required: ['prompt'],
|
|
7889
8015
|
additionalProperties: !0,
|
|
@@ -7920,7 +8046,7 @@ function Ka() {
|
|
|
7920
8046
|
default: '480p',
|
|
7921
8047
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
7922
8048
|
},
|
|
7923
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8049
|
+
creative_mode: { type: 'boolean', default: !1, description: er('video') },
|
|
7924
8050
|
priority: {
|
|
7925
8051
|
type: 'boolean',
|
|
7926
8052
|
default: !1,
|
|
@@ -8058,10 +8184,10 @@ function Ka() {
|
|
|
8058
8184
|
additionalProperties: !0,
|
|
8059
8185
|
},
|
|
8060
8186
|
},
|
|
8061
|
-
p =
|
|
8062
|
-
return [n, s, o, u, l, p, c,
|
|
8187
|
+
p = Na();
|
|
8188
|
+
return [n, s, o, u, l, p, c, $a];
|
|
8063
8189
|
}
|
|
8064
|
-
function
|
|
8190
|
+
function Na() {
|
|
8065
8191
|
return {
|
|
8066
8192
|
name: 'upload_asset',
|
|
8067
8193
|
description:
|
|
@@ -8108,26 +8234,26 @@ function Sa() {
|
|
|
8108
8234
|
},
|
|
8109
8235
|
};
|
|
8110
8236
|
}
|
|
8111
|
-
function
|
|
8112
|
-
let e =
|
|
8113
|
-
t =
|
|
8114
|
-
return [...e, ...t].map(
|
|
8237
|
+
function Xe() {
|
|
8238
|
+
let e = La(),
|
|
8239
|
+
t = O().map((r) => Da(r));
|
|
8240
|
+
return [...e, ...t].map(Aa).map(Ra);
|
|
8115
8241
|
}
|
|
8116
|
-
var
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8242
|
+
var qa,
|
|
8243
|
+
Ca,
|
|
8244
|
+
$a,
|
|
8245
|
+
tr,
|
|
8246
|
+
rr = y(() => {
|
|
8121
8247
|
'use strict';
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
((
|
|
8248
|
+
F();
|
|
8249
|
+
Ae();
|
|
8250
|
+
X();
|
|
8251
|
+
((qa = {
|
|
8126
8252
|
type: 'string',
|
|
8127
8253
|
description:
|
|
8128
8254
|
'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.',
|
|
8129
8255
|
}),
|
|
8130
|
-
(
|
|
8256
|
+
(Ca = new Set([
|
|
8131
8257
|
'upload_asset',
|
|
8132
8258
|
'upload_media',
|
|
8133
8259
|
'upload_image',
|
|
@@ -8135,7 +8261,7 @@ var xa,
|
|
|
8135
8261
|
'check_status',
|
|
8136
8262
|
'get_pricing',
|
|
8137
8263
|
])),
|
|
8138
|
-
(
|
|
8264
|
+
($a = {
|
|
8139
8265
|
name: 'get_pricing',
|
|
8140
8266
|
description:
|
|
8141
8267
|
'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.',
|
|
@@ -8150,7 +8276,7 @@ var xa,
|
|
|
8150
8276
|
additionalProperties: !1,
|
|
8151
8277
|
},
|
|
8152
8278
|
}));
|
|
8153
|
-
|
|
8279
|
+
tr = new Set([
|
|
8154
8280
|
'image',
|
|
8155
8281
|
'images',
|
|
8156
8282
|
'image_url',
|
|
@@ -8167,19 +8293,19 @@ var xa,
|
|
|
8167
8293
|
'lipsyncing_audio',
|
|
8168
8294
|
]);
|
|
8169
8295
|
});
|
|
8170
|
-
var
|
|
8171
|
-
ur
|
|
8172
|
-
forgetToolSchemas: () =>
|
|
8173
|
-
jsonRpcAnswer: () =>
|
|
8174
|
-
preprocessLocalFiles: () =>
|
|
8175
|
-
startStdioServer: () =>
|
|
8296
|
+
var ur = {};
|
|
8297
|
+
wr(ur, {
|
|
8298
|
+
forgetToolSchemas: () => ja,
|
|
8299
|
+
jsonRpcAnswer: () => sr,
|
|
8300
|
+
preprocessLocalFiles: () => dr,
|
|
8301
|
+
startStdioServer: () => cr,
|
|
8176
8302
|
});
|
|
8177
|
-
function
|
|
8303
|
+
function Ua(e) {
|
|
8178
8304
|
let t = (r) =>
|
|
8179
8305
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
8180
8306
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
8181
8307
|
}
|
|
8182
|
-
function
|
|
8308
|
+
function sr(e, t, r) {
|
|
8183
8309
|
let a = e?.id,
|
|
8184
8310
|
n = a == null,
|
|
8185
8311
|
s = null;
|
|
@@ -8188,7 +8314,7 @@ function Xt(e, t, r) {
|
|
|
8188
8314
|
} catch {
|
|
8189
8315
|
s = null;
|
|
8190
8316
|
}
|
|
8191
|
-
if (s !== null &&
|
|
8317
|
+
if (s !== null && Ua(s)) return n ? null : s;
|
|
8192
8318
|
if (n) return null;
|
|
8193
8319
|
if (!r && t >= 200 && t < 300) return;
|
|
8194
8320
|
let o = s?.error,
|
|
@@ -8209,12 +8335,12 @@ function Xt(e, t, r) {
|
|
|
8209
8335
|
},
|
|
8210
8336
|
};
|
|
8211
8337
|
}
|
|
8212
|
-
function
|
|
8338
|
+
function Va() {
|
|
8213
8339
|
let e = process.argv.slice(2),
|
|
8214
8340
|
t = e.indexOf('--api-key');
|
|
8215
|
-
return
|
|
8341
|
+
return E(t >= 0 ? e[t + 1] : void 0);
|
|
8216
8342
|
}
|
|
8217
|
-
async function
|
|
8343
|
+
async function or(e, t, r) {
|
|
8218
8344
|
let a = j.default.resolve(e);
|
|
8219
8345
|
if (!D.default.existsSync(a) || !D.default.statSync(a).isFile())
|
|
8220
8346
|
throw new Error(`File not found: ${e}`);
|
|
@@ -8243,15 +8369,15 @@ async function Zt(e, t, r) {
|
|
|
8243
8369
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
8244
8370
|
};
|
|
8245
8371
|
}
|
|
8246
|
-
function
|
|
8247
|
-
return
|
|
8372
|
+
function lr(e) {
|
|
8373
|
+
return Fa.has(j.default.extname(e).toLowerCase());
|
|
8248
8374
|
}
|
|
8249
|
-
function
|
|
8375
|
+
function pr(e) {
|
|
8250
8376
|
return new Error(
|
|
8251
8377
|
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
8252
8378
|
);
|
|
8253
8379
|
}
|
|
8254
|
-
function
|
|
8380
|
+
function Ba(e) {
|
|
8255
8381
|
let t = e.trim();
|
|
8256
8382
|
if (
|
|
8257
8383
|
!t ||
|
|
@@ -8264,22 +8390,22 @@ function Ea(e) {
|
|
|
8264
8390
|
let r = j.default.resolve(t);
|
|
8265
8391
|
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
8266
8392
|
}
|
|
8267
|
-
function
|
|
8393
|
+
function Ze(e) {
|
|
8268
8394
|
if (Array.isArray(e))
|
|
8269
8395
|
for (let t of e) {
|
|
8270
8396
|
let r = t;
|
|
8271
8397
|
typeof r.name == 'string' &&
|
|
8272
8398
|
r.inputSchema &&
|
|
8273
8399
|
typeof r.inputSchema == 'object' &&
|
|
8274
|
-
|
|
8400
|
+
ee.set(r.name, r.inputSchema);
|
|
8275
8401
|
}
|
|
8276
8402
|
}
|
|
8277
|
-
function
|
|
8278
|
-
(
|
|
8403
|
+
function ja() {
|
|
8404
|
+
(ee.clear(), (Qe = 0));
|
|
8279
8405
|
}
|
|
8280
|
-
async function
|
|
8281
|
-
if (!(Date.now() -
|
|
8282
|
-
|
|
8406
|
+
async function Ga(e, t) {
|
|
8407
|
+
if (!(Date.now() - Qe < 6e4)) {
|
|
8408
|
+
Qe = Date.now();
|
|
8283
8409
|
try {
|
|
8284
8410
|
let a = await (
|
|
8285
8411
|
await fetch(e, {
|
|
@@ -8289,39 +8415,39 @@ async function Oa(e, t) {
|
|
|
8289
8415
|
signal: AbortSignal.timeout(1e4),
|
|
8290
8416
|
})
|
|
8291
8417
|
).json();
|
|
8292
|
-
|
|
8418
|
+
Ze(a.result?.tools);
|
|
8293
8419
|
} catch {}
|
|
8294
8420
|
}
|
|
8295
8421
|
}
|
|
8296
|
-
function
|
|
8422
|
+
function Ha(e) {
|
|
8297
8423
|
return e
|
|
8298
8424
|
? e.type === 'string'
|
|
8299
8425
|
? e.format === 'uri'
|
|
8300
8426
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
8301
8427
|
: !1;
|
|
8302
8428
|
}
|
|
8303
|
-
async function
|
|
8429
|
+
async function ar(e, t, r) {
|
|
8304
8430
|
if (typeof e != 'string') return e;
|
|
8305
|
-
let a =
|
|
8431
|
+
let a = Ba(e);
|
|
8306
8432
|
if (!a) return e;
|
|
8307
|
-
if (!
|
|
8308
|
-
return (await
|
|
8433
|
+
if (!lr(a)) throw pr(a);
|
|
8434
|
+
return (await or(a, t, r)).url;
|
|
8309
8435
|
}
|
|
8310
|
-
async function
|
|
8311
|
-
(
|
|
8312
|
-
let s =
|
|
8436
|
+
async function dr(e, t, r, a, n) {
|
|
8437
|
+
(ee.size === 0 && Ze(Xe()), ee.has(e) || (await Ga(n, r)));
|
|
8438
|
+
let s = ee.get(e)?.properties;
|
|
8313
8439
|
if (!s) return t;
|
|
8314
8440
|
let o = { ...t };
|
|
8315
8441
|
for (let [u, l] of Object.entries(t))
|
|
8316
|
-
if (
|
|
8442
|
+
if (Ha(s[u]))
|
|
8317
8443
|
if (Array.isArray(l)) {
|
|
8318
8444
|
let c = [];
|
|
8319
|
-
for (let p of l) c.push(await
|
|
8445
|
+
for (let p of l) c.push(await ar(p, r, a));
|
|
8320
8446
|
o[u] = c;
|
|
8321
|
-
} else o[u] = await
|
|
8447
|
+
} else o[u] = await ar(l, r, a);
|
|
8322
8448
|
return o;
|
|
8323
8449
|
}
|
|
8324
|
-
function
|
|
8450
|
+
function za(e) {
|
|
8325
8451
|
let t = e.id ?? null;
|
|
8326
8452
|
switch (e.method) {
|
|
8327
8453
|
case 'initialize':
|
|
@@ -8339,7 +8465,7 @@ function Da(e) {
|
|
|
8339
8465
|
case 'ping':
|
|
8340
8466
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
8341
8467
|
case 'tools/list':
|
|
8342
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
8468
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Xe() } };
|
|
8343
8469
|
case 'tools/call':
|
|
8344
8470
|
return {
|
|
8345
8471
|
jsonrpc: '2.0',
|
|
@@ -8362,13 +8488,13 @@ function Da(e) {
|
|
|
8362
8488
|
};
|
|
8363
8489
|
}
|
|
8364
8490
|
}
|
|
8365
|
-
async function
|
|
8366
|
-
if (
|
|
8367
|
-
|
|
8368
|
-
let e =
|
|
8369
|
-
t =
|
|
8491
|
+
async function cr() {
|
|
8492
|
+
if (ir) return;
|
|
8493
|
+
ir = !0;
|
|
8494
|
+
let e = Va(),
|
|
8495
|
+
t = I(),
|
|
8370
8496
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
8371
|
-
(
|
|
8497
|
+
(nr.default
|
|
8372
8498
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
8373
8499
|
.on('line', async (n) => {
|
|
8374
8500
|
let s = n.trim();
|
|
@@ -8380,7 +8506,7 @@ async function ar() {
|
|
|
8380
8506
|
c = o.params.arguments || {};
|
|
8381
8507
|
if (l === 'get_pricing') {
|
|
8382
8508
|
let p = typeof c.model == 'string' ? c.model.trim() : '',
|
|
8383
|
-
d = `${t.replace(/\/+$/, '')}${
|
|
8509
|
+
d = `${t.replace(/\/+$/, '')}${ye(p)}`;
|
|
8384
8510
|
try {
|
|
8385
8511
|
let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
|
|
8386
8512
|
h = await m.text();
|
|
@@ -8429,17 +8555,17 @@ async function ar() {
|
|
|
8429
8555
|
try {
|
|
8430
8556
|
let d = j.default.resolve(p.trim());
|
|
8431
8557
|
if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
|
|
8432
|
-
if (!
|
|
8433
|
-
let m = await
|
|
8558
|
+
if (!lr(d)) throw pr(d);
|
|
8559
|
+
let m = await or(d, e, t),
|
|
8434
8560
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
8435
|
-
|
|
8561
|
+
be =
|
|
8436
8562
|
m.mimeType.startsWith('image/') ||
|
|
8437
8563
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
8438
8564
|
? `
|
|
8439
8565
|
|
|
8440
8566
|
`
|
|
8441
8567
|
: '',
|
|
8442
|
-
|
|
8568
|
+
ke = {
|
|
8443
8569
|
jsonrpc: '2.0',
|
|
8444
8570
|
id: o.id,
|
|
8445
8571
|
result: {
|
|
@@ -8450,7 +8576,7 @@ async function ar() {
|
|
|
8450
8576
|
|
|
8451
8577
|
- **URL:** ${m.url}
|
|
8452
8578
|
- **Type:** \`${m.mimeType}\`
|
|
8453
|
-
- **Size:** ${h} KB${
|
|
8579
|
+
- **Size:** ${h} KB${be}
|
|
8454
8580
|
|
|
8455
8581
|
Pass this URL to any Tein generation tool.`,
|
|
8456
8582
|
},
|
|
@@ -8459,7 +8585,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8459
8585
|
},
|
|
8460
8586
|
};
|
|
8461
8587
|
process.stdout.write(
|
|
8462
|
-
JSON.stringify(
|
|
8588
|
+
JSON.stringify(ke) +
|
|
8463
8589
|
`
|
|
8464
8590
|
`,
|
|
8465
8591
|
);
|
|
@@ -8486,7 +8612,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8486
8612
|
}
|
|
8487
8613
|
if (e)
|
|
8488
8614
|
try {
|
|
8489
|
-
o.params.arguments = await
|
|
8615
|
+
o.params.arguments = await dr(String(l), c, e, t, r);
|
|
8490
8616
|
} catch (p) {
|
|
8491
8617
|
let d = p instanceof Error ? p.message : String(p);
|
|
8492
8618
|
process.stdout.write(
|
|
@@ -8517,10 +8643,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8517
8643
|
body: JSON.stringify(o),
|
|
8518
8644
|
}),
|
|
8519
8645
|
c = await l.text(),
|
|
8520
|
-
p =
|
|
8646
|
+
p = sr(o, l.status, c);
|
|
8521
8647
|
if (p === null) return;
|
|
8522
8648
|
if (p) {
|
|
8523
|
-
(o?.method === 'tools/list' &&
|
|
8649
|
+
(o?.method === 'tools/list' && Ze(p.result?.tools),
|
|
8524
8650
|
process.stdout.write(
|
|
8525
8651
|
JSON.stringify(p) +
|
|
8526
8652
|
`
|
|
@@ -8529,7 +8655,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8529
8655
|
return;
|
|
8530
8656
|
}
|
|
8531
8657
|
} catch {}
|
|
8532
|
-
let u =
|
|
8658
|
+
let u = za(o);
|
|
8533
8659
|
u !== null &&
|
|
8534
8660
|
process.stdout.write(
|
|
8535
8661
|
JSON.stringify(u) +
|
|
@@ -8554,20 +8680,20 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8554
8680
|
}
|
|
8555
8681
|
var D,
|
|
8556
8682
|
j,
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8683
|
+
nr,
|
|
8684
|
+
Fa,
|
|
8685
|
+
ee,
|
|
8686
|
+
Qe,
|
|
8687
|
+
ir,
|
|
8688
|
+
mr = y(() => {
|
|
8563
8689
|
'use strict';
|
|
8564
8690
|
((D = _(require('node:fs'))),
|
|
8565
8691
|
(j = _(require('node:path'))),
|
|
8566
|
-
(
|
|
8567
|
-
|
|
8568
|
-
|
|
8692
|
+
(nr = _(require('node:readline'))));
|
|
8693
|
+
Ge();
|
|
8694
|
+
rr();
|
|
8569
8695
|
A();
|
|
8570
|
-
|
|
8696
|
+
Fa = new Set([
|
|
8571
8697
|
'.png',
|
|
8572
8698
|
'.jpg',
|
|
8573
8699
|
'.jpeg',
|
|
@@ -8593,20 +8719,20 @@ var D,
|
|
|
8593
8719
|
'.flac',
|
|
8594
8720
|
'.opus',
|
|
8595
8721
|
]);
|
|
8596
|
-
((
|
|
8597
|
-
|
|
8722
|
+
((ee = new Map()), (Qe = 0));
|
|
8723
|
+
ir = !1;
|
|
8598
8724
|
require.main === module &&
|
|
8599
|
-
|
|
8725
|
+
cr().catch((e) => {
|
|
8600
8726
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
8601
8727
|
`),
|
|
8602
8728
|
process.exit(1));
|
|
8603
8729
|
});
|
|
8604
8730
|
});
|
|
8605
|
-
var
|
|
8731
|
+
var Pr =
|
|
8606
8732
|
!process.env.NO_COLOR &&
|
|
8607
8733
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
8608
8734
|
function k(e, t) {
|
|
8609
|
-
return (r) => (
|
|
8735
|
+
return (r) => (Pr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
8610
8736
|
}
|
|
8611
8737
|
var i = {
|
|
8612
8738
|
bold: k(1, 22),
|
|
@@ -8690,13 +8816,13 @@ var i = {
|
|
|
8690
8816
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
8691
8817
|
}
|
|
8692
8818
|
};
|
|
8693
|
-
var
|
|
8694
|
-
|
|
8695
|
-
var
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
var
|
|
8699
|
-
var
|
|
8819
|
+
var N = _(require('node:fs')),
|
|
8820
|
+
q = _(require('node:path'));
|
|
8821
|
+
var re = _(require('node:fs')),
|
|
8822
|
+
at = _(require('node:path')),
|
|
8823
|
+
it = require('node:stream/promises');
|
|
8824
|
+
var te = '1.1.7';
|
|
8825
|
+
var Ir = new Set([
|
|
8700
8826
|
'account_suspended',
|
|
8701
8827
|
'account_terminated',
|
|
8702
8828
|
'creative_mode_restricted',
|
|
@@ -8704,7 +8830,7 @@ var gr = new Set([
|
|
|
8704
8830
|
'workspace_paused',
|
|
8705
8831
|
]),
|
|
8706
8832
|
v = 1,
|
|
8707
|
-
|
|
8833
|
+
_r = 3,
|
|
8708
8834
|
w = class extends Error {
|
|
8709
8835
|
constructor(t, r, a, n = {}) {
|
|
8710
8836
|
(super(r),
|
|
@@ -8714,10 +8840,10 @@ var gr = new Set([
|
|
|
8714
8840
|
(this.fields = n));
|
|
8715
8841
|
}
|
|
8716
8842
|
get exitCode() {
|
|
8717
|
-
return this.code &&
|
|
8843
|
+
return this.code && Ir.has(this.code) ? _r : v;
|
|
8718
8844
|
}
|
|
8719
8845
|
};
|
|
8720
|
-
function
|
|
8846
|
+
function vr(e, t, r) {
|
|
8721
8847
|
let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
8722
8848
|
if (!r || typeof r != 'object') return new w(e, a);
|
|
8723
8849
|
let n = r;
|
|
@@ -8730,13 +8856,13 @@ function yr(e, t, r) {
|
|
|
8730
8856
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
8731
8857
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8732
8858
|
}
|
|
8733
|
-
function
|
|
8859
|
+
function tt(e) {
|
|
8734
8860
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8735
8861
|
}
|
|
8736
8862
|
function S(e) {
|
|
8737
8863
|
let t = [e.message],
|
|
8738
|
-
r =
|
|
8739
|
-
a =
|
|
8864
|
+
r = tt(e.fields.required),
|
|
8865
|
+
a = tt(e.fields.balance);
|
|
8740
8866
|
(r || a) &&
|
|
8741
8867
|
t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
8742
8868
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -8744,19 +8870,19 @@ function S(e) {
|
|
|
8744
8870
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8745
8871
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
8746
8872
|
}
|
|
8747
|
-
function
|
|
8873
|
+
function Tr(e) {
|
|
8748
8874
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
8749
8875
|
? 'video'
|
|
8750
8876
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
8751
8877
|
? 'audio'
|
|
8752
8878
|
: 'image';
|
|
8753
8879
|
}
|
|
8754
|
-
function
|
|
8880
|
+
function rt(e) {
|
|
8755
8881
|
let t = [];
|
|
8756
8882
|
for (let r of e.data ?? [])
|
|
8757
8883
|
typeof r.message?.content == 'string'
|
|
8758
8884
|
? t.push({ type: 'text', text: r.message.content })
|
|
8759
|
-
: r.url && t.push({ type:
|
|
8885
|
+
: r.url && t.push({ type: Tr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
8760
8886
|
return t;
|
|
8761
8887
|
}
|
|
8762
8888
|
var K = class {
|
|
@@ -8767,7 +8893,7 @@ var K = class {
|
|
|
8767
8893
|
return {
|
|
8768
8894
|
'Content-Type': 'application/json',
|
|
8769
8895
|
Authorization: `Bearer ${this.apiKey}`,
|
|
8770
|
-
'User-Agent': `Tein-CLI/${
|
|
8896
|
+
'User-Agent': `Tein-CLI/${te}`,
|
|
8771
8897
|
'X-Tein-Client': 'cli',
|
|
8772
8898
|
};
|
|
8773
8899
|
}
|
|
@@ -8782,7 +8908,7 @@ var K = class {
|
|
|
8782
8908
|
try {
|
|
8783
8909
|
s = await n.json();
|
|
8784
8910
|
} catch {}
|
|
8785
|
-
throw
|
|
8911
|
+
throw vr(n.status, n.statusText, s);
|
|
8786
8912
|
}
|
|
8787
8913
|
return await n.json();
|
|
8788
8914
|
}
|
|
@@ -8796,7 +8922,7 @@ var K = class {
|
|
|
8796
8922
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
8797
8923
|
? n
|
|
8798
8924
|
: 'processing',
|
|
8799
|
-
o =
|
|
8925
|
+
o = rt(a);
|
|
8800
8926
|
return {
|
|
8801
8927
|
request_id: a.request_id || a.id || '',
|
|
8802
8928
|
model: a.model,
|
|
@@ -8814,7 +8940,7 @@ var K = class {
|
|
|
8814
8940
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
8815
8941
|
? a
|
|
8816
8942
|
: 'processing',
|
|
8817
|
-
s =
|
|
8943
|
+
s = rt(r),
|
|
8818
8944
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8819
8945
|
return {
|
|
8820
8946
|
request_id: r.id || t,
|
|
@@ -8832,14 +8958,14 @@ var K = class {
|
|
|
8832
8958
|
async downloadOutput(t, r) {
|
|
8833
8959
|
let a = await fetch(t);
|
|
8834
8960
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
8835
|
-
let n =
|
|
8836
|
-
|
|
8837
|
-
let s =
|
|
8838
|
-
return (await (0,
|
|
8961
|
+
let n = at.default.dirname(r);
|
|
8962
|
+
re.default.existsSync(n) || re.default.mkdirSync(n, { recursive: !0 });
|
|
8963
|
+
let s = re.default.createWriteStream(r);
|
|
8964
|
+
return (await (0, it.pipeline)(a.body, s), r);
|
|
8839
8965
|
}
|
|
8840
8966
|
};
|
|
8841
8967
|
A();
|
|
8842
|
-
function
|
|
8968
|
+
function _e(e) {
|
|
8843
8969
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
8844
8970
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
8845
8971
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
@@ -8847,43 +8973,43 @@ function xe(e) {
|
|
|
8847
8973
|
a = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8848
8974
|
return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
|
|
8849
8975
|
}
|
|
8850
|
-
|
|
8851
|
-
var
|
|
8852
|
-
function
|
|
8853
|
-
for (let t of
|
|
8976
|
+
X();
|
|
8977
|
+
var Bt = ['images', 'input_images', 'videos', 'audios'];
|
|
8978
|
+
function ca(e) {
|
|
8979
|
+
for (let t of Bt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
8854
8980
|
}
|
|
8855
|
-
function
|
|
8981
|
+
function ua(e) {
|
|
8856
8982
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8857
|
-
let t =
|
|
8858
|
-
return
|
|
8983
|
+
let t = q.default.resolve(e);
|
|
8984
|
+
return N.default.existsSync(t) && N.default.statSync(t).isFile() ? t : null;
|
|
8859
8985
|
}
|
|
8860
|
-
async function
|
|
8861
|
-
for (let r of
|
|
8986
|
+
async function ma(e, t) {
|
|
8987
|
+
for (let r of Bt) {
|
|
8862
8988
|
if (!Array.isArray(e[r])) continue;
|
|
8863
8989
|
let a = [];
|
|
8864
8990
|
for (let n of e[r]) {
|
|
8865
8991
|
if (typeof n != 'string') continue;
|
|
8866
|
-
let s =
|
|
8992
|
+
let s = ua(n);
|
|
8867
8993
|
a.push(s ? await t(s) : n);
|
|
8868
8994
|
}
|
|
8869
8995
|
e[r] = a;
|
|
8870
8996
|
}
|
|
8871
8997
|
}
|
|
8872
|
-
var
|
|
8873
|
-
function
|
|
8998
|
+
var Q = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
8999
|
+
function fa(e) {
|
|
8874
9000
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
8875
9001
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
8876
|
-
r =
|
|
9002
|
+
r = Q.enterprise;
|
|
8877
9003
|
return (
|
|
8878
9004
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
8879
9005
|
(process.stderr
|
|
8880
|
-
.write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${
|
|
9006
|
+
.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.
|
|
8881
9007
|
`),
|
|
8882
9008
|
process.exit(1)),
|
|
8883
9009
|
t
|
|
8884
9010
|
);
|
|
8885
9011
|
}
|
|
8886
|
-
async function
|
|
9012
|
+
async function ga(e, t, r, a, n) {
|
|
8887
9013
|
n.isJson ||
|
|
8888
9014
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
8889
9015
|
`);
|
|
@@ -8945,7 +9071,7 @@ async function na(e, t, r, a, n) {
|
|
|
8945
9071
|
else {
|
|
8946
9072
|
for (let l of o)
|
|
8947
9073
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
8948
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
9074
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${_e(l.usage.cost)}`),
|
|
8949
9075
|
l.error && process.stdout.write(` ${l.error}`),
|
|
8950
9076
|
process.stdout.write(`
|
|
8951
9077
|
`));
|
|
@@ -8958,12 +9084,12 @@ async function na(e, t, r, a, n) {
|
|
|
8958
9084
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
8959
9085
|
process.exit(v);
|
|
8960
9086
|
}
|
|
8961
|
-
function
|
|
9087
|
+
function ha(e, t, r) {
|
|
8962
9088
|
if (r <= 1) return e;
|
|
8963
|
-
let a =
|
|
9089
|
+
let a = q.default.extname(e);
|
|
8964
9090
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
8965
9091
|
}
|
|
8966
|
-
function
|
|
9092
|
+
function jt(e) {
|
|
8967
9093
|
let t = {},
|
|
8968
9094
|
r = new Set(),
|
|
8969
9095
|
a = [];
|
|
@@ -9008,9 +9134,9 @@ function Rt(e) {
|
|
|
9008
9134
|
}
|
|
9009
9135
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
|
|
9010
9136
|
}
|
|
9011
|
-
async function
|
|
9012
|
-
let r =
|
|
9013
|
-
a =
|
|
9137
|
+
async function je(e, t) {
|
|
9138
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9139
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9014
9140
|
(r ||
|
|
9015
9141
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9016
9142
|
`),
|
|
@@ -9026,11 +9152,11 @@ async function Le(e, t) {
|
|
|
9026
9152
|
process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
|
|
9027
9153
|
`),
|
|
9028
9154
|
process.exit(1)));
|
|
9029
|
-
let n =
|
|
9155
|
+
let n = B(e),
|
|
9030
9156
|
s = !!t.json,
|
|
9031
9157
|
o = !!(t.async || t.no_wait),
|
|
9032
9158
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
9033
|
-
l =
|
|
9159
|
+
l = fa(t),
|
|
9034
9160
|
c = { ...t };
|
|
9035
9161
|
(delete c.json,
|
|
9036
9162
|
delete c.async,
|
|
@@ -9039,9 +9165,9 @@ async function Le(e, t) {
|
|
|
9039
9165
|
delete c.api_key,
|
|
9040
9166
|
delete c.api_url,
|
|
9041
9167
|
delete c.count);
|
|
9042
|
-
let p =
|
|
9043
|
-
(
|
|
9044
|
-
typeof p.image == 'string' && !p.images && !
|
|
9168
|
+
let p = Ft(n, c);
|
|
9169
|
+
(ca(p),
|
|
9170
|
+
typeof p.image == 'string' && !p.images && !he(n) && ((p.images = [p.image]), delete p.image),
|
|
9045
9171
|
p.image_url &&
|
|
9046
9172
|
!p.first_frame_image &&
|
|
9047
9173
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
@@ -9059,14 +9185,14 @@ async function Le(e, t) {
|
|
|
9059
9185
|
for (let b of m) {
|
|
9060
9186
|
let g = p[b];
|
|
9061
9187
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
9062
|
-
let x =
|
|
9063
|
-
if (
|
|
9064
|
-
let
|
|
9065
|
-
s ||
|
|
9188
|
+
let x = q.default.resolve(g);
|
|
9189
|
+
if (N.default.existsSync(x) && N.default.statSync(x).isFile()) {
|
|
9190
|
+
let P = new T(`Uploading local file ${q.default.basename(x)} to CDN...`);
|
|
9191
|
+
s || P.start();
|
|
9066
9192
|
try {
|
|
9067
|
-
let L =
|
|
9193
|
+
let L = N.default.readFileSync(x),
|
|
9068
9194
|
C = await d.uploadAsset(L.toString('base64'));
|
|
9069
|
-
((p[b] = C.url), s ||
|
|
9195
|
+
((p[b] = C.url), s || P.succeed(`Uploaded ${q.default.basename(x)} to CDN`));
|
|
9070
9196
|
} catch (L) {
|
|
9071
9197
|
let C = L instanceof Error ? L.message : String(L);
|
|
9072
9198
|
(s
|
|
@@ -9075,28 +9201,28 @@ async function Le(e, t) {
|
|
|
9075
9201
|
`
|
|
9076
9202
|
`,
|
|
9077
9203
|
)
|
|
9078
|
-
:
|
|
9204
|
+
: P.fail(`Upload failed: ${C}`),
|
|
9079
9205
|
process.exit(1));
|
|
9080
9206
|
}
|
|
9081
9207
|
}
|
|
9082
9208
|
}
|
|
9083
9209
|
}
|
|
9084
|
-
await
|
|
9085
|
-
let g = new T(`Uploading local file ${
|
|
9210
|
+
await ma(p, async (b) => {
|
|
9211
|
+
let g = new T(`Uploading local file ${q.default.basename(b)} to CDN...`);
|
|
9086
9212
|
s || g.start();
|
|
9087
9213
|
try {
|
|
9088
|
-
let x =
|
|
9089
|
-
|
|
9090
|
-
return (s || g.succeed(`Uploaded ${
|
|
9214
|
+
let x = N.default.readFileSync(b),
|
|
9215
|
+
P = await d.uploadAsset(x.toString('base64'));
|
|
9216
|
+
return (s || g.succeed(`Uploaded ${q.default.basename(b)} to CDN`), P.url);
|
|
9091
9217
|
} catch (x) {
|
|
9092
|
-
let
|
|
9218
|
+
let P = x instanceof Error ? x.message : String(x);
|
|
9093
9219
|
(s
|
|
9094
9220
|
? process.stdout.write(
|
|
9095
|
-
JSON.stringify({ error:
|
|
9221
|
+
JSON.stringify({ error: P }) +
|
|
9096
9222
|
`
|
|
9097
9223
|
`,
|
|
9098
9224
|
)
|
|
9099
|
-
: g.fail(`Upload failed: ${
|
|
9225
|
+
: g.fail(`Upload failed: ${P}`),
|
|
9100
9226
|
process.exit(1));
|
|
9101
9227
|
}
|
|
9102
9228
|
});
|
|
@@ -9105,7 +9231,7 @@ async function Le(e, t) {
|
|
|
9105
9231
|
let f;
|
|
9106
9232
|
try {
|
|
9107
9233
|
if (l > 1) {
|
|
9108
|
-
await
|
|
9234
|
+
await ga(d, e, p, l, { isJson: s, isAsync: o });
|
|
9109
9235
|
return;
|
|
9110
9236
|
}
|
|
9111
9237
|
f = await d.queueJob(e, p);
|
|
@@ -9143,12 +9269,12 @@ async function Le(e, t) {
|
|
|
9143
9269
|
`));
|
|
9144
9270
|
return;
|
|
9145
9271
|
}
|
|
9146
|
-
let
|
|
9147
|
-
|
|
9272
|
+
let be = Date.now(),
|
|
9273
|
+
ke = 1500;
|
|
9148
9274
|
for (; f.status === 'processing';) {
|
|
9149
|
-
let b = Math.round((Date.now() -
|
|
9275
|
+
let b = Math.round((Date.now() - be) / 1e3);
|
|
9150
9276
|
(s || h.update(`Rendering ${i.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
|
|
9151
|
-
await new Promise((g) => setTimeout(g,
|
|
9277
|
+
await new Promise((g) => setTimeout(g, ke)));
|
|
9152
9278
|
try {
|
|
9153
9279
|
f = await d.getStatus(f.request_id);
|
|
9154
9280
|
} catch (g) {
|
|
@@ -9190,7 +9316,7 @@ async function Le(e, t) {
|
|
|
9190
9316
|
process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
|
|
9191
9317
|
`),
|
|
9192
9318
|
f.usage?.cost !== void 0 &&
|
|
9193
|
-
process.stdout.write(` ${i.bold('Cost:')} ${
|
|
9319
|
+
process.stdout.write(` ${i.bold('Cost:')} ${_e(f.usage.cost)}
|
|
9194
9320
|
`),
|
|
9195
9321
|
f.output && f.output.length > 0)
|
|
9196
9322
|
) {
|
|
@@ -9200,38 +9326,38 @@ ${i.bold('Outputs:')}
|
|
|
9200
9326
|
let b = f.output.filter((x) => x.url).length,
|
|
9201
9327
|
g = 0;
|
|
9202
9328
|
for (let x = 0; x < f.output.length; x++) {
|
|
9203
|
-
let
|
|
9204
|
-
if (
|
|
9205
|
-
let L =
|
|
9329
|
+
let P = f.output[x];
|
|
9330
|
+
if (P.url) {
|
|
9331
|
+
let L = P.layer?.name ? ` ${i.bold(P.layer.name)}` : '';
|
|
9206
9332
|
if (
|
|
9207
|
-
(process.stdout.write(` [${
|
|
9333
|
+
(process.stdout.write(` [${P.type.toUpperCase()}]${L} ${i.cyan(i.underline(P.url))}
|
|
9208
9334
|
`),
|
|
9209
9335
|
u)
|
|
9210
9336
|
) {
|
|
9211
|
-
let C =
|
|
9212
|
-
|
|
9337
|
+
let C = ha(u, g++, b),
|
|
9338
|
+
et = new T(`Downloading output to ${C}...`).start();
|
|
9213
9339
|
try {
|
|
9214
|
-
(await d.downloadOutput(
|
|
9215
|
-
|
|
9216
|
-
} catch (
|
|
9217
|
-
|
|
9340
|
+
(await d.downloadOutput(P.url, q.default.resolve(process.cwd(), C)),
|
|
9341
|
+
et.succeed(`Saved to ${i.bold(C)}`));
|
|
9342
|
+
} catch (we) {
|
|
9343
|
+
et.fail(`Failed to download: ${we instanceof Error ? we.message : we}`);
|
|
9218
9344
|
}
|
|
9219
9345
|
}
|
|
9220
9346
|
} else
|
|
9221
|
-
|
|
9347
|
+
P.text &&
|
|
9222
9348
|
process.stdout.write(`
|
|
9223
|
-
${
|
|
9349
|
+
${P.text}
|
|
9224
9350
|
`);
|
|
9225
9351
|
}
|
|
9226
9352
|
}
|
|
9227
9353
|
process.stdout.write(`
|
|
9228
9354
|
`);
|
|
9229
9355
|
}
|
|
9230
|
-
var
|
|
9356
|
+
var Gt = _(require('node:readline'));
|
|
9231
9357
|
A();
|
|
9232
|
-
async function
|
|
9358
|
+
async function ya(e) {
|
|
9233
9359
|
try {
|
|
9234
|
-
return (await new K(e,
|
|
9360
|
+
return (await new K(e, I()).checkKey(), 'ok');
|
|
9235
9361
|
} catch (t) {
|
|
9236
9362
|
if (t instanceof w) {
|
|
9237
9363
|
if (t.status === 401) return 'invalid';
|
|
@@ -9240,15 +9366,15 @@ async function oa(e) {
|
|
|
9240
9366
|
return 'unchecked';
|
|
9241
9367
|
}
|
|
9242
9368
|
}
|
|
9243
|
-
function
|
|
9244
|
-
let t =
|
|
9369
|
+
function ba(e) {
|
|
9370
|
+
let t = Gt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
9245
9371
|
return new Promise((r) => {
|
|
9246
9372
|
t.question(e, (a) => {
|
|
9247
9373
|
(t.close(), r(a.trim()));
|
|
9248
9374
|
});
|
|
9249
9375
|
});
|
|
9250
9376
|
}
|
|
9251
|
-
async function
|
|
9377
|
+
async function Z(e, t) {
|
|
9252
9378
|
switch (e) {
|
|
9253
9379
|
case 'login':
|
|
9254
9380
|
case 'set-key': {
|
|
@@ -9260,22 +9386,22 @@ ${i.bold('Tein AI Authentication')}
|
|
|
9260
9386
|
process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
|
|
9261
9387
|
|
|
9262
9388
|
`),
|
|
9263
|
-
(r = await
|
|
9389
|
+
(r = await ba('Enter your Tein API Key (sk_live_...): '))),
|
|
9264
9390
|
!r.startsWith('sk_live_') &&
|
|
9265
9391
|
!r.startsWith('sk_test_') &&
|
|
9266
9392
|
(process.stderr
|
|
9267
9393
|
.write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
9268
9394
|
`),
|
|
9269
9395
|
process.exit(1)));
|
|
9270
|
-
let a = await
|
|
9396
|
+
let a = await ya(r);
|
|
9271
9397
|
(a === 'invalid' &&
|
|
9272
9398
|
(process.stderr
|
|
9273
9399
|
.write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
9274
9400
|
`),
|
|
9275
9401
|
process.exit(1)),
|
|
9276
|
-
|
|
9402
|
+
Ie({ apiKey: r }),
|
|
9277
9403
|
process.stdout.write(`
|
|
9278
|
-
${i.green('\u2713')} API key saved to ${i.dim(
|
|
9404
|
+
${i.green('\u2713')} API key saved to ${i.dim(ie())}
|
|
9279
9405
|
`),
|
|
9280
9406
|
a === 'blocked'
|
|
9281
9407
|
? process.stdout
|
|
@@ -9292,27 +9418,27 @@ ${i.green('\u2713')} API key saved to ${i.dim(re())}
|
|
|
9292
9418
|
break;
|
|
9293
9419
|
}
|
|
9294
9420
|
case 'logout': {
|
|
9295
|
-
if (!
|
|
9421
|
+
if (!V().apiKey) {
|
|
9296
9422
|
process.stdout
|
|
9297
9423
|
.write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
|
|
9298
9424
|
`);
|
|
9299
9425
|
break;
|
|
9300
9426
|
}
|
|
9301
|
-
(
|
|
9427
|
+
(Ie({ apiKey: '' }),
|
|
9302
9428
|
process.stdout
|
|
9303
|
-
.write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(
|
|
9429
|
+
.write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(ie())}
|
|
9304
9430
|
`));
|
|
9305
9431
|
break;
|
|
9306
9432
|
}
|
|
9307
9433
|
default: {
|
|
9308
|
-
let r =
|
|
9309
|
-
a =
|
|
9310
|
-
n =
|
|
9434
|
+
let r = E(),
|
|
9435
|
+
a = I(),
|
|
9436
|
+
n = V();
|
|
9311
9437
|
if (
|
|
9312
9438
|
(process.stdout.write(`
|
|
9313
9439
|
${i.bold('Tein AI CLI Configuration')}
|
|
9314
9440
|
`),
|
|
9315
|
-
process.stdout.write(` Config file: ${i.dim(
|
|
9441
|
+
process.stdout.write(` Config file: ${i.dim(ie())}
|
|
9316
9442
|
`),
|
|
9317
9443
|
process.stdout.write(` API URL: ${i.cyan(a)}
|
|
9318
9444
|
`),
|
|
@@ -9337,12 +9463,12 @@ ${i.bold('Tein AI CLI Configuration')}
|
|
|
9337
9463
|
}
|
|
9338
9464
|
}
|
|
9339
9465
|
A();
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
var
|
|
9343
|
-
async function
|
|
9466
|
+
ve();
|
|
9467
|
+
X();
|
|
9468
|
+
var ka = 3e3;
|
|
9469
|
+
async function Ht(e) {
|
|
9344
9470
|
try {
|
|
9345
|
-
let t = await fetch(`${
|
|
9471
|
+
let t = await fetch(`${I(e)}/v1/pricing`, { signal: AbortSignal.timeout(ka) });
|
|
9346
9472
|
if (!t.ok) return;
|
|
9347
9473
|
let r = await t.json(),
|
|
9348
9474
|
a = {};
|
|
@@ -9350,18 +9476,18 @@ async function Lt(e) {
|
|
|
9350
9476
|
let s = String(n.modelSlug ?? '');
|
|
9351
9477
|
G.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
|
|
9352
9478
|
}
|
|
9353
|
-
|
|
9479
|
+
Ot(a);
|
|
9354
9480
|
} catch {}
|
|
9355
9481
|
}
|
|
9356
|
-
var
|
|
9357
|
-
|
|
9358
|
-
async function
|
|
9359
|
-
await
|
|
9360
|
-
let r =
|
|
9482
|
+
var wa = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
9483
|
+
xa = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
9484
|
+
async function zt(e, t) {
|
|
9485
|
+
await Ht(t);
|
|
9486
|
+
let r = O();
|
|
9361
9487
|
if (e) {
|
|
9362
9488
|
let s = e.toLowerCase(),
|
|
9363
|
-
o =
|
|
9364
|
-
r =
|
|
9489
|
+
o = xa[s] ?? s;
|
|
9490
|
+
r = wa.has(o)
|
|
9365
9491
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
9366
9492
|
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
9367
9493
|
}
|
|
@@ -9399,9 +9525,9 @@ ${i.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
|
9399
9525
|
|
|
9400
9526
|
`);
|
|
9401
9527
|
}
|
|
9402
|
-
async function
|
|
9403
|
-
G.has(e) && (await
|
|
9404
|
-
let r =
|
|
9528
|
+
async function Jt(e, t) {
|
|
9529
|
+
G.has(e) && (await Ht(t));
|
|
9530
|
+
let r = B(e);
|
|
9405
9531
|
(r ||
|
|
9406
9532
|
(process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
9407
9533
|
`),
|
|
@@ -9481,9 +9607,9 @@ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
|
|
|
9481
9607
|
`);
|
|
9482
9608
|
}
|
|
9483
9609
|
A();
|
|
9484
|
-
|
|
9485
|
-
var
|
|
9486
|
-
|
|
9610
|
+
Ge();
|
|
9611
|
+
var Pa = 1e4,
|
|
9612
|
+
ze = {
|
|
9487
9613
|
price: '',
|
|
9488
9614
|
creativeMode: 'Creative mode',
|
|
9489
9615
|
priority: 'Priority',
|
|
@@ -9493,22 +9619,22 @@ var ua = 1e4,
|
|
|
9493
9619
|
priorityDraft: 'Priority + Draft',
|
|
9494
9620
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
9495
9621
|
},
|
|
9496
|
-
|
|
9497
|
-
|
|
9622
|
+
Ia = Object.keys(ze),
|
|
9623
|
+
_a = {
|
|
9498
9624
|
creativeMode: 'unfiltered',
|
|
9499
9625
|
creativeModePriority: 'unfilteredPriority',
|
|
9500
9626
|
creativeModeDraft: 'unfilteredDraft',
|
|
9501
9627
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
9502
9628
|
};
|
|
9503
|
-
function
|
|
9504
|
-
let r =
|
|
9629
|
+
function va(e, t) {
|
|
9630
|
+
let r = _a[t];
|
|
9505
9631
|
return e[t] ?? (r ? e[r] : void 0);
|
|
9506
9632
|
}
|
|
9507
|
-
async function
|
|
9508
|
-
let r = `${
|
|
9633
|
+
async function Ta(e, t) {
|
|
9634
|
+
let r = `${I(e)}${ye(t)}`,
|
|
9509
9635
|
a;
|
|
9510
9636
|
try {
|
|
9511
|
-
a = await fetch(r, { signal: AbortSignal.timeout(
|
|
9637
|
+
a = await fetch(r, { signal: AbortSignal.timeout(Pa) });
|
|
9512
9638
|
} catch {
|
|
9513
9639
|
throw new Error(`Could not reach ${r}`);
|
|
9514
9640
|
}
|
|
@@ -9524,18 +9650,18 @@ async function ha(e, t) {
|
|
|
9524
9650
|
}
|
|
9525
9651
|
return n;
|
|
9526
9652
|
}
|
|
9527
|
-
function
|
|
9653
|
+
function He(e) {
|
|
9528
9654
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
9529
9655
|
[r, a = ''] = t.split('.');
|
|
9530
9656
|
return `$${r}.${a.padEnd(2, '0')}`;
|
|
9531
9657
|
}
|
|
9532
|
-
function
|
|
9658
|
+
function Je(e) {
|
|
9533
9659
|
if (!e || typeof e.starter != 'number') return null;
|
|
9534
9660
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
9535
9661
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9536
|
-
return `Starter ${
|
|
9662
|
+
return `Starter ${He(e.starter)} Plus ${He(t)} Scale ${He(r)}`;
|
|
9537
9663
|
}
|
|
9538
|
-
function
|
|
9664
|
+
function Ma(e) {
|
|
9539
9665
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
9540
9666
|
let t = [];
|
|
9541
9667
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -9547,33 +9673,33 @@ function ya(e) {
|
|
|
9547
9673
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
9548
9674
|
);
|
|
9549
9675
|
}
|
|
9550
|
-
function
|
|
9551
|
-
let r =
|
|
9552
|
-
for (let a of
|
|
9553
|
-
let n =
|
|
9676
|
+
function Ka(e, t) {
|
|
9677
|
+
let r = Ma(e);
|
|
9678
|
+
for (let a of Ia) {
|
|
9679
|
+
let n = Je(va(e, a));
|
|
9554
9680
|
if (!n) continue;
|
|
9555
|
-
let s =
|
|
9681
|
+
let s = ze[a] ? ` (${ze[a]})` : '';
|
|
9556
9682
|
t.push(` ${r}${s} ${n}`);
|
|
9557
9683
|
}
|
|
9558
9684
|
}
|
|
9559
|
-
function
|
|
9685
|
+
function Sa(e, t) {
|
|
9560
9686
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
9561
9687
|
t.push(
|
|
9562
9688
|
` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
9563
9689
|
);
|
|
9564
|
-
for (let n of e.variants ?? [])
|
|
9690
|
+
for (let n of e.variants ?? []) Ka(n, t);
|
|
9565
9691
|
let a = e.addons;
|
|
9566
9692
|
if (Array.isArray(a))
|
|
9567
9693
|
for (let n of a) {
|
|
9568
9694
|
if (!n || typeof n != 'object') continue;
|
|
9569
9695
|
let s = n,
|
|
9570
9696
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
9571
|
-
u =
|
|
9697
|
+
u = Je(s.price);
|
|
9572
9698
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
9573
9699
|
}
|
|
9574
9700
|
t.push('');
|
|
9575
9701
|
}
|
|
9576
|
-
function
|
|
9702
|
+
function Ea(e) {
|
|
9577
9703
|
let t = [],
|
|
9578
9704
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9579
9705
|
(t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
|
|
@@ -9595,7 +9721,7 @@ function wa(e) {
|
|
|
9595
9721
|
});
|
|
9596
9722
|
for (let l of s) {
|
|
9597
9723
|
t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
9598
|
-
for (let c of a.get(l) ?? [])
|
|
9724
|
+
for (let c of a.get(l) ?? []) Sa(c, t);
|
|
9599
9725
|
}
|
|
9600
9726
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
9601
9727
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -9612,7 +9738,7 @@ function wa(e) {
|
|
|
9612
9738
|
t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
|
|
9613
9739
|
for (let m of p) {
|
|
9614
9740
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
9615
|
-
f =
|
|
9741
|
+
f = Je(m.prices);
|
|
9616
9742
|
f && t.push(` ${h} ${f}`);
|
|
9617
9743
|
}
|
|
9618
9744
|
t.push('');
|
|
@@ -9625,10 +9751,10 @@ function wa(e) {
|
|
|
9625
9751
|
`
|
|
9626
9752
|
);
|
|
9627
9753
|
}
|
|
9628
|
-
async function
|
|
9754
|
+
async function Wt(e) {
|
|
9629
9755
|
let t;
|
|
9630
9756
|
try {
|
|
9631
|
-
t = await
|
|
9757
|
+
t = await Ta(e.apiUrl, e.model);
|
|
9632
9758
|
} catch (r) {
|
|
9633
9759
|
let a = r instanceof Error ? r.message : String(r);
|
|
9634
9760
|
(process.stderr.write(`${i.red('Error:')} ${a}
|
|
@@ -9639,14 +9765,14 @@ async function Ut(e) {
|
|
|
9639
9765
|
e.json
|
|
9640
9766
|
? `${JSON.stringify(t, null, 2)}
|
|
9641
9767
|
`
|
|
9642
|
-
:
|
|
9768
|
+
: Ea(t),
|
|
9643
9769
|
);
|
|
9644
9770
|
}
|
|
9645
|
-
var
|
|
9771
|
+
var Yt = _(require('node:path'));
|
|
9646
9772
|
A();
|
|
9647
|
-
async function
|
|
9648
|
-
let r =
|
|
9649
|
-
a =
|
|
9773
|
+
async function Xt(e, t) {
|
|
9774
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9775
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9650
9776
|
(r ||
|
|
9651
9777
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
9652
9778
|
`),
|
|
@@ -9739,7 +9865,7 @@ ${i.bold('Outputs:')}
|
|
|
9739
9865
|
) {
|
|
9740
9866
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
9741
9867
|
try {
|
|
9742
|
-
(await u.downloadOutput(p.url,
|
|
9868
|
+
(await u.downloadOutput(p.url, Yt.default.resolve(process.cwd(), o)),
|
|
9743
9869
|
d.succeed(`Saved to ${i.bold(o)}`));
|
|
9744
9870
|
} catch (m) {
|
|
9745
9871
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -9754,12 +9880,12 @@ ${p.text}
|
|
|
9754
9880
|
process.stdout.write(`
|
|
9755
9881
|
`);
|
|
9756
9882
|
}
|
|
9757
|
-
var
|
|
9758
|
-
|
|
9883
|
+
var We = _(require('node:fs')),
|
|
9884
|
+
Ye = _(require('node:path'));
|
|
9759
9885
|
A();
|
|
9760
|
-
async function
|
|
9761
|
-
let r =
|
|
9762
|
-
a =
|
|
9886
|
+
async function Qt(e, t = {}) {
|
|
9887
|
+
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9888
|
+
a = I(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9763
9889
|
n = !!t.json;
|
|
9764
9890
|
(r ||
|
|
9765
9891
|
(process.stderr.write(`${i.red('Error:')} Authentication required.
|
|
@@ -9774,13 +9900,13 @@ async function jt(e, t = {}) {
|
|
|
9774
9900
|
process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
|
|
9775
9901
|
`),
|
|
9776
9902
|
process.exit(1)));
|
|
9777
|
-
let s =
|
|
9778
|
-
|
|
9903
|
+
let s = Ye.default.resolve(e);
|
|
9904
|
+
We.default.existsSync(s) ||
|
|
9779
9905
|
(process.stderr.write(`${i.red('Error:')} File not found: ${s}
|
|
9780
9906
|
`),
|
|
9781
9907
|
process.exit(1));
|
|
9782
|
-
let o =
|
|
9783
|
-
l =
|
|
9908
|
+
let o = Ye.default.basename(s),
|
|
9909
|
+
l = We.default.readFileSync(s).toString('base64'),
|
|
9784
9910
|
c = new K(r, a),
|
|
9785
9911
|
p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
|
|
9786
9912
|
n || p.start();
|
|
@@ -9821,9 +9947,9 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
|
9821
9947
|
process.exit(m ? m.exitCode : v));
|
|
9822
9948
|
}
|
|
9823
9949
|
}
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
function
|
|
9950
|
+
X();
|
|
9951
|
+
Ce();
|
|
9952
|
+
function fr() {
|
|
9827
9953
|
process.stdout.write(`
|
|
9828
9954
|
${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9829
9955
|
|
|
@@ -9883,45 +10009,45 @@ ${i.bold('EXAMPLES:')}
|
|
|
9883
10009
|
|
|
9884
10010
|
`);
|
|
9885
10011
|
}
|
|
9886
|
-
async function
|
|
10012
|
+
async function Ja() {
|
|
9887
10013
|
let e = process.argv.slice(2),
|
|
9888
|
-
t =
|
|
10014
|
+
t = jt(e);
|
|
9889
10015
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
9890
|
-
|
|
10016
|
+
fr();
|
|
9891
10017
|
return;
|
|
9892
10018
|
}
|
|
9893
10019
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
9894
|
-
process.stdout.write(`tein version ${
|
|
10020
|
+
process.stdout.write(`tein version ${te}
|
|
9895
10021
|
`);
|
|
9896
10022
|
return;
|
|
9897
10023
|
}
|
|
9898
10024
|
switch (t.command) {
|
|
9899
10025
|
case 'auth': {
|
|
9900
|
-
await
|
|
10026
|
+
await Z(t.subcommand, t.options.key);
|
|
9901
10027
|
break;
|
|
9902
10028
|
}
|
|
9903
10029
|
case 'login': {
|
|
9904
|
-
await
|
|
10030
|
+
await Z('login', t.options.key);
|
|
9905
10031
|
break;
|
|
9906
10032
|
}
|
|
9907
10033
|
case 'logout': {
|
|
9908
|
-
await
|
|
10034
|
+
await Z('logout');
|
|
9909
10035
|
break;
|
|
9910
10036
|
}
|
|
9911
10037
|
case 'whoami': {
|
|
9912
|
-
await
|
|
10038
|
+
await Z('status');
|
|
9913
10039
|
break;
|
|
9914
10040
|
}
|
|
9915
10041
|
case 'models':
|
|
9916
10042
|
case 'list': {
|
|
9917
|
-
await
|
|
10043
|
+
await zt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
9918
10044
|
break;
|
|
9919
10045
|
}
|
|
9920
10046
|
case 'pricing':
|
|
9921
10047
|
case 'prices': {
|
|
9922
10048
|
let r = t.options.model,
|
|
9923
10049
|
a = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
9924
|
-
await
|
|
10050
|
+
await Wt({
|
|
9925
10051
|
model: a,
|
|
9926
10052
|
json: !!t.options.json,
|
|
9927
10053
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -9936,48 +10062,48 @@ async function La() {
|
|
|
9936
10062
|
process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
|
|
9937
10063
|
`),
|
|
9938
10064
|
process.exit(1)),
|
|
9939
|
-
await
|
|
10065
|
+
await Jt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
9940
10066
|
break;
|
|
9941
10067
|
}
|
|
9942
10068
|
case 'upload': {
|
|
9943
10069
|
let r = t.subcommand || '';
|
|
9944
|
-
await
|
|
10070
|
+
await Qt(r, t.options);
|
|
9945
10071
|
break;
|
|
9946
10072
|
}
|
|
9947
10073
|
case 'run':
|
|
9948
10074
|
case 'generate': {
|
|
9949
10075
|
let r = t.subcommand || '';
|
|
9950
|
-
await
|
|
10076
|
+
await je(r, t.options);
|
|
9951
10077
|
break;
|
|
9952
10078
|
}
|
|
9953
10079
|
case 'status': {
|
|
9954
10080
|
let r = t.subcommand || '';
|
|
9955
|
-
await
|
|
10081
|
+
await Xt(r, t.options);
|
|
9956
10082
|
break;
|
|
9957
10083
|
}
|
|
9958
10084
|
case 'mcp': {
|
|
9959
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
10085
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (mr(), ur));
|
|
9960
10086
|
await r();
|
|
9961
10087
|
break;
|
|
9962
10088
|
}
|
|
9963
10089
|
default: {
|
|
9964
10090
|
if (t.command && !t.command.startsWith('-')) {
|
|
9965
|
-
(!
|
|
9966
|
-
!
|
|
10091
|
+
(!B(t.command) &&
|
|
10092
|
+
!ce[t.command] &&
|
|
9967
10093
|
(process.stderr.write(`
|
|
9968
10094
|
${i.red('Error:')} Unknown command or model "${t.command}".
|
|
9969
10095
|
Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
|
|
9970
10096
|
`),
|
|
9971
10097
|
process.exit(v)),
|
|
9972
|
-
await
|
|
10098
|
+
await je(t.command, t.options));
|
|
9973
10099
|
return;
|
|
9974
10100
|
}
|
|
9975
|
-
|
|
10101
|
+
fr();
|
|
9976
10102
|
break;
|
|
9977
10103
|
}
|
|
9978
10104
|
}
|
|
9979
10105
|
}
|
|
9980
|
-
|
|
10106
|
+
Ja().catch((e) => {
|
|
9981
10107
|
(e instanceof w &&
|
|
9982
10108
|
(process.stderr.write(`
|
|
9983
10109
|
${i.red('Error:')} ${S(e).join(`
|