@teinai/cli 1.1.28 → 1.1.29
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 +1529 -902
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var Tr = Object.create;
|
|
4
|
+
var Pe = Object.defineProperty;
|
|
5
|
+
var Mr = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var Kr = Object.getOwnPropertyNames;
|
|
7
|
+
var Sr = Object.getPrototypeOf,
|
|
8
|
+
Er = Object.prototype.hasOwnProperty;
|
|
9
9
|
var y = (e, t, r) => () => {
|
|
10
10
|
if (r) throw r[0];
|
|
11
11
|
try {
|
|
12
12
|
return (e && (t = e((e = 0))), t);
|
|
13
|
-
} catch (
|
|
14
|
-
throw ((r = [
|
|
13
|
+
} catch (i) {
|
|
14
|
+
throw ((r = [i]), i);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var r in t)
|
|
17
|
+
var Cr = (e, t) => {
|
|
18
|
+
for (var r in t) Pe(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
$r = (e, t, r, i) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let n of
|
|
23
|
-
!
|
|
22
|
+
for (let n of Kr(t))
|
|
23
|
+
!Er.call(e, n) &&
|
|
24
24
|
n !== r &&
|
|
25
|
-
|
|
25
|
+
Pe(e, n, { get: () => t[n], enumerable: !(i = Mr(t, n)) || i.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
(r = e != null ?
|
|
30
|
-
|
|
28
|
+
var I = (e, t, r) => (
|
|
29
|
+
(r = e != null ? Tr(Sr(e)) : {}),
|
|
30
|
+
$r(t || !e || !e.__esModule ? Pe(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function F() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if (q.default.existsSync(U)) {
|
|
35
|
+
let e = q.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 ve(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let r = { ...
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
q.default.existsSync(ae) || q.default.mkdirSync(ae, { recursive: !0, mode: 448 });
|
|
44
|
+
let r = { ...F(), ...e };
|
|
45
|
+
(q.default.writeFileSync(U, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
q.default.chmodSync(ae, 448),
|
|
47
|
+
q.default.chmodSync(U, 384));
|
|
48
48
|
} catch (t) {
|
|
49
49
|
throw new Error(`Failed to save config to ${U}: ${t}`);
|
|
50
50
|
}
|
|
@@ -53,57 +53,57 @@ 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 = F();
|
|
57
57
|
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function P(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 = F();
|
|
64
64
|
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ne() {
|
|
67
67
|
return U;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
var q,
|
|
70
|
+
dt,
|
|
71
|
+
Ie,
|
|
72
72
|
ae,
|
|
73
73
|
U,
|
|
74
74
|
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(ae =
|
|
80
|
-
(U =
|
|
76
|
+
((q = I(require('node:fs'))),
|
|
77
|
+
(dt = I(require('node:os'))),
|
|
78
|
+
(Ie = I(require('node:path'))),
|
|
79
|
+
(ae = Ie.default.join(dt.default.homedir(), '.tein')),
|
|
80
|
+
(U = Ie.default.join(ae, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var Lr,
|
|
83
|
+
ct,
|
|
84
|
+
ut,
|
|
85
|
+
mt = y(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
87
|
+
((Lr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(ct = [...Lr, 'auto']),
|
|
89
|
+
(ut =
|
|
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
|
-
var
|
|
93
|
-
|
|
92
|
+
var H,
|
|
93
|
+
Me = y(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
H = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function se(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var ft = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
|
-
var
|
|
104
|
-
|
|
103
|
+
var oe,
|
|
104
|
+
gt = y(() => {
|
|
105
105
|
'use strict';
|
|
106
|
-
|
|
106
|
+
oe = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
108
108
|
checked: '17 Sep 2026',
|
|
109
109
|
generated: '2026-10-01',
|
|
@@ -128,6 +128,7 @@ var se,
|
|
|
128
128
|
models: [
|
|
129
129
|
'seedance-2-5',
|
|
130
130
|
'seedance-2-5-lite',
|
|
131
|
+
'seedance-2-5-flash',
|
|
131
132
|
'seedance-2',
|
|
132
133
|
'seedance-2-lite',
|
|
133
134
|
'seedance-2-fast',
|
|
@@ -666,6 +667,177 @@ var se,
|
|
|
666
667
|
axes: { resolution: ['480p', '720p', '1080p'] },
|
|
667
668
|
from: { variant: '480p-no-video' },
|
|
668
669
|
},
|
|
670
|
+
{
|
|
671
|
+
slug: 'seedance-2-5-flash',
|
|
672
|
+
name: 'Seedance 2.5 Flash',
|
|
673
|
+
family: 'seedance',
|
|
674
|
+
vendor: 'ByteDance',
|
|
675
|
+
desc: 'The fast, lower-priced Seedance 2.5: the same tasks, audio and up to 30 seconds, at 480P or 720P.',
|
|
676
|
+
kind: 'video',
|
|
677
|
+
unit: '/sec',
|
|
678
|
+
api: { model: 'seedance-2-5-flash' },
|
|
679
|
+
variants: [
|
|
680
|
+
{
|
|
681
|
+
id: '720p-with-video',
|
|
682
|
+
price: { starter: 0.1344, plus: 0.1176, scale: 0.1107 },
|
|
683
|
+
label: '720P \xB7 Omni Reference \xB7 with reference video',
|
|
684
|
+
resolution: '720p',
|
|
685
|
+
task: 'omni',
|
|
686
|
+
withVideo: !0,
|
|
687
|
+
unfiltered: { starter: 0.1411, plus: 0.1234, scale: 0.1162 },
|
|
688
|
+
priority: { starter: 0.1424, plus: 0.1246, scale: 0.1173 },
|
|
689
|
+
unfilteredPriority: { starter: 0.1495, plus: 0.1308, scale: 0.1231 },
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
id: '720p-no-video',
|
|
693
|
+
price: { starter: 0.2197, plus: 0.1922, scale: 0.1809 },
|
|
694
|
+
label: '720P \xB7 Text to Video',
|
|
695
|
+
resolution: '720p',
|
|
696
|
+
task: 't2v',
|
|
697
|
+
withVideo: !1,
|
|
698
|
+
unfiltered: { starter: 0.2306, plus: 0.2018, scale: 0.1899 },
|
|
699
|
+
priority: { starter: 0.2328, plus: 0.2037, scale: 0.1917 },
|
|
700
|
+
unfilteredPriority: { starter: 0.2444, plus: 0.2139, scale: 0.2012 },
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
id: '720p-with-video-extend',
|
|
704
|
+
price: { starter: 0.1345, plus: 0.1179, scale: 0.1107 },
|
|
705
|
+
label: '720P \xB7 Extend \xB7 with reference video',
|
|
706
|
+
resolution: '720p',
|
|
707
|
+
task: 'extend',
|
|
708
|
+
withVideo: !0,
|
|
709
|
+
unfiltered: { starter: 0.1412, plus: 0.1237, scale: 0.1162 },
|
|
710
|
+
priority: { starter: 0.1425, plus: 0.1249, scale: 0.1173 },
|
|
711
|
+
unfilteredPriority: { starter: 0.1496, plus: 0.1311, scale: 0.1231 },
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
id: '720p-with-video-edit',
|
|
715
|
+
price: { starter: 0.1349, plus: 0.1185, scale: 0.1107 },
|
|
716
|
+
label: '720P \xB7 Edit \xB7 with reference video',
|
|
717
|
+
resolution: '720p',
|
|
718
|
+
task: 'edit',
|
|
719
|
+
withVideo: !0,
|
|
720
|
+
unfiltered: { starter: 0.1416, plus: 0.1244, scale: 0.1162 },
|
|
721
|
+
priority: { starter: 0.1429, plus: 0.1256, scale: 0.1173 },
|
|
722
|
+
unfilteredPriority: { starter: 0.15, plus: 0.1318, scale: 0.1231 },
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
id: '720p-no-video-i2v',
|
|
726
|
+
price: { starter: 0.2199, plus: 0.1925, scale: 0.1809 },
|
|
727
|
+
label: '720P \xB7 Image to Video',
|
|
728
|
+
resolution: '720p',
|
|
729
|
+
task: 'i2v',
|
|
730
|
+
withVideo: !1,
|
|
731
|
+
unfiltered: { starter: 0.2308, plus: 0.2021, scale: 0.1899 },
|
|
732
|
+
priority: { starter: 0.233, plus: 0.204, scale: 0.1917 },
|
|
733
|
+
unfilteredPriority: { starter: 0.2446, plus: 0.2142, scale: 0.2012 },
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
id: '720p-no-video-frames',
|
|
737
|
+
price: { starter: 0.2205, plus: 0.1929, scale: 0.1809 },
|
|
738
|
+
label: '720P \xB7 First & Last Frame',
|
|
739
|
+
resolution: '720p',
|
|
740
|
+
task: 'frames',
|
|
741
|
+
withVideo: !1,
|
|
742
|
+
unfiltered: { starter: 0.2315, plus: 0.2025, scale: 0.1899 },
|
|
743
|
+
priority: { starter: 0.2337, plus: 0.2044, scale: 0.1917 },
|
|
744
|
+
unfilteredPriority: { starter: 0.2453, plus: 0.2146, scale: 0.2012 },
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
id: '720p-no-video-omni',
|
|
748
|
+
price: { starter: 0.2197, plus: 0.1922, scale: 0.1809 },
|
|
749
|
+
label: '720P \xB7 Omni Reference',
|
|
750
|
+
resolution: '720p',
|
|
751
|
+
task: 'omni',
|
|
752
|
+
withVideo: !1,
|
|
753
|
+
unfiltered: { starter: 0.2306, plus: 0.2018, scale: 0.1899 },
|
|
754
|
+
priority: { starter: 0.2328, plus: 0.2037, scale: 0.1917 },
|
|
755
|
+
unfilteredPriority: { starter: 0.2444, plus: 0.2139, scale: 0.2012 },
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
id: '480p-with-video',
|
|
759
|
+
price: { starter: 0.0621, plus: 0.0544, scale: 0.0512 },
|
|
760
|
+
label: '480P \xB7 Omni Reference \xB7 with reference video',
|
|
761
|
+
resolution: '480p',
|
|
762
|
+
task: 'omni',
|
|
763
|
+
withVideo: !0,
|
|
764
|
+
unfiltered: { starter: 0.0652, plus: 0.0571, scale: 0.0537 },
|
|
765
|
+
priority: { starter: 0.0658, plus: 0.0576, scale: 0.0542 },
|
|
766
|
+
unfilteredPriority: { starter: 0.0691, plus: 0.0605, scale: 0.0569 },
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
id: '480p-no-video',
|
|
770
|
+
price: { starter: 0.1015, plus: 0.0889, scale: 0.0836 },
|
|
771
|
+
label: '480P \xB7 Text to Video',
|
|
772
|
+
resolution: '480p',
|
|
773
|
+
task: 't2v',
|
|
774
|
+
withVideo: !1,
|
|
775
|
+
unfiltered: { starter: 0.1065, plus: 0.0933, scale: 0.0877 },
|
|
776
|
+
priority: { starter: 0.1075, plus: 0.0942, scale: 0.0886 },
|
|
777
|
+
unfilteredPriority: { starter: 0.1128, plus: 0.0988, scale: 0.0929 },
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
id: '480p-with-video-extend',
|
|
781
|
+
price: { starter: 0.0625, plus: 0.0545, scale: 0.0512 },
|
|
782
|
+
label: '480P \xB7 Extend \xB7 with reference video',
|
|
783
|
+
resolution: '480p',
|
|
784
|
+
task: 'extend',
|
|
785
|
+
withVideo: !0,
|
|
786
|
+
unfiltered: { starter: 0.0656, plus: 0.0572, scale: 0.0537 },
|
|
787
|
+
priority: { starter: 0.0662, plus: 0.0577, scale: 0.0542 },
|
|
788
|
+
unfilteredPriority: { starter: 0.0695, plus: 0.0606, scale: 0.0569 },
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
id: '480p-with-video-edit',
|
|
792
|
+
price: { starter: 0.0629, plus: 0.0549, scale: 0.0512 },
|
|
793
|
+
label: '480P \xB7 Edit \xB7 with reference video',
|
|
794
|
+
resolution: '480p',
|
|
795
|
+
task: 'edit',
|
|
796
|
+
withVideo: !0,
|
|
797
|
+
unfiltered: { starter: 0.066, plus: 0.0576, scale: 0.0537 },
|
|
798
|
+
priority: { starter: 0.0666, plus: 0.0581, scale: 0.0542 },
|
|
799
|
+
unfilteredPriority: { starter: 0.0699, plus: 0.061, scale: 0.0569 },
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
id: '480p-no-video-i2v',
|
|
803
|
+
price: { starter: 0.1019, plus: 0.0895, scale: 0.0836 },
|
|
804
|
+
label: '480P \xB7 Image to Video',
|
|
805
|
+
resolution: '480p',
|
|
806
|
+
task: 'i2v',
|
|
807
|
+
withVideo: !1,
|
|
808
|
+
unfiltered: { starter: 0.1069, plus: 0.0939, scale: 0.0877 },
|
|
809
|
+
priority: { starter: 0.108, plus: 0.0948, scale: 0.0886 },
|
|
810
|
+
unfilteredPriority: { starter: 0.1133, plus: 0.0995, scale: 0.0929 },
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
id: '480p-no-video-frames',
|
|
814
|
+
price: { starter: 0.1025, plus: 0.0899, scale: 0.0836 },
|
|
815
|
+
label: '480P \xB7 First & Last Frame',
|
|
816
|
+
resolution: '480p',
|
|
817
|
+
task: 'frames',
|
|
818
|
+
withVideo: !1,
|
|
819
|
+
unfiltered: { starter: 0.1076, plus: 0.0943, scale: 0.0877 },
|
|
820
|
+
priority: { starter: 0.1086, plus: 0.0952, scale: 0.0886 },
|
|
821
|
+
unfilteredPriority: { starter: 0.114, plus: 0.0999, scale: 0.0929 },
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
id: '480p-no-video-omni',
|
|
825
|
+
price: { starter: 0.1015, plus: 0.0889, scale: 0.0836 },
|
|
826
|
+
label: '480P \xB7 Omni Reference',
|
|
827
|
+
resolution: '480p',
|
|
828
|
+
task: 'omni',
|
|
829
|
+
withVideo: !1,
|
|
830
|
+
unfiltered: { starter: 0.1065, plus: 0.0933, scale: 0.0877 },
|
|
831
|
+
priority: { starter: 0.1075, plus: 0.0942, scale: 0.0886 },
|
|
832
|
+
unfilteredPriority: { starter: 0.1128, plus: 0.0988, scale: 0.0929 },
|
|
833
|
+
},
|
|
834
|
+
],
|
|
835
|
+
unfiltered: 0.05,
|
|
836
|
+
priority: 0.06,
|
|
837
|
+
draft: null,
|
|
838
|
+
axes: { resolution: ['480p', '720p'] },
|
|
839
|
+
from: { variant: '480p-no-video-omni' },
|
|
840
|
+
},
|
|
669
841
|
{
|
|
670
842
|
slug: 'seedance-2',
|
|
671
843
|
name: 'Seedance 2.0',
|
|
@@ -5455,7 +5627,7 @@ var se,
|
|
|
5455
5627
|
name: 'Kling Video 3.0',
|
|
5456
5628
|
family: 'kling',
|
|
5457
5629
|
vendor: 'Kuaishou',
|
|
5458
|
-
desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds. Sound is optional; silent clips are the lower rate.',
|
|
5630
|
+
desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds, and motion control: a character image moved by a reference video. Sound is optional; silent clips are the lower rate.',
|
|
5459
5631
|
kind: 'video',
|
|
5460
5632
|
unit: '/sec',
|
|
5461
5633
|
api: { model: 'kling-v3-video' },
|
|
@@ -5502,6 +5674,20 @@ var se,
|
|
|
5502
5674
|
resolution: '4k',
|
|
5503
5675
|
quality: 'audio',
|
|
5504
5676
|
},
|
|
5677
|
+
{
|
|
5678
|
+
id: '720p-motion',
|
|
5679
|
+
price: { starter: 0.1575, plus: 0.1496, scale: 0.14 },
|
|
5680
|
+
label: '720p \xB7 motion control',
|
|
5681
|
+
resolution: '720p',
|
|
5682
|
+
quality: 'motion',
|
|
5683
|
+
},
|
|
5684
|
+
{
|
|
5685
|
+
id: '1080p-motion',
|
|
5686
|
+
price: { starter: 0.21, plus: 0.1995, scale: 0.1867 },
|
|
5687
|
+
label: '1080p \xB7 motion control',
|
|
5688
|
+
resolution: '1080p',
|
|
5689
|
+
quality: 'motion',
|
|
5690
|
+
},
|
|
5505
5691
|
],
|
|
5506
5692
|
unfiltered: null,
|
|
5507
5693
|
priority: null,
|
|
@@ -5632,31 +5818,31 @@ var se,
|
|
|
5632
5818
|
variants: [
|
|
5633
5819
|
{
|
|
5634
5820
|
id: '1024x768',
|
|
5635
|
-
price: { starter: 0.
|
|
5821
|
+
price: { starter: 0.0046, plus: 0.0043, scale: 0.0041 },
|
|
5636
5822
|
label: '1024\xD7768',
|
|
5637
5823
|
resolution: '1024x768',
|
|
5638
5824
|
},
|
|
5639
5825
|
{
|
|
5640
5826
|
id: '1024x1024',
|
|
5641
|
-
price: { starter: 0.
|
|
5827
|
+
price: { starter: 0.0059, plus: 0.0056, scale: 0.0053 },
|
|
5642
5828
|
label: '1024\xD71024',
|
|
5643
5829
|
resolution: '1024x1024',
|
|
5644
5830
|
},
|
|
5645
5831
|
{
|
|
5646
5832
|
id: '1024x1808',
|
|
5647
|
-
price: { starter: 0.
|
|
5833
|
+
price: { starter: 0.0099, plus: 0.0094, scale: 0.0088 },
|
|
5648
5834
|
label: '1024\xD71808',
|
|
5649
5835
|
resolution: '1024x1808',
|
|
5650
5836
|
},
|
|
5651
5837
|
{
|
|
5652
5838
|
id: '2048x1536',
|
|
5653
|
-
price: { starter: 0.
|
|
5839
|
+
price: { starter: 0.0164, plus: 0.0155, scale: 0.0146 },
|
|
5654
5840
|
label: '2048\xD71536',
|
|
5655
5841
|
resolution: '2048x1536',
|
|
5656
5842
|
},
|
|
5657
5843
|
{
|
|
5658
5844
|
id: '2048x2048',
|
|
5659
|
-
price: { starter: 0.
|
|
5845
|
+
price: { starter: 0.0216, plus: 0.0205, scale: 0.0192 },
|
|
5660
5846
|
label: '2048\xD72048',
|
|
5661
5847
|
resolution: '2048x2048',
|
|
5662
5848
|
},
|
|
@@ -5842,11 +6028,11 @@ var se,
|
|
|
5842
6028
|
],
|
|
5843
6029
|
};
|
|
5844
6030
|
});
|
|
5845
|
-
var
|
|
5846
|
-
|
|
5847
|
-
|
|
6031
|
+
var le,
|
|
6032
|
+
ht,
|
|
6033
|
+
Ke = y(() => {
|
|
5848
6034
|
'use strict';
|
|
5849
|
-
((
|
|
6035
|
+
((le = [
|
|
5850
6036
|
{
|
|
5851
6037
|
slug: 'tein-video-upscaler',
|
|
5852
6038
|
name: 'Tein Video Upscaler',
|
|
@@ -5921,12 +6107,12 @@ var oe,
|
|
|
5921
6107
|
from: { variant: 'swap' },
|
|
5922
6108
|
},
|
|
5923
6109
|
]),
|
|
5924
|
-
(
|
|
6110
|
+
(ht = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
|
|
5925
6111
|
});
|
|
5926
|
-
function
|
|
6112
|
+
function Ce(e, t) {
|
|
5927
6113
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5928
6114
|
}
|
|
5929
|
-
function
|
|
6115
|
+
function Ur(e, t) {
|
|
5930
6116
|
if (e === 'seedance-2-mini') return 'mini';
|
|
5931
6117
|
if (e !== 'seedance-2') return;
|
|
5932
6118
|
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -5936,93 +6122,93 @@ function Er(e, t) {
|
|
|
5936
6122
|
? 'fast'
|
|
5937
6123
|
: 'standard';
|
|
5938
6124
|
}
|
|
5939
|
-
function
|
|
6125
|
+
function Fr(e, t) {
|
|
5940
6126
|
let r = e
|
|
5941
6127
|
.trim()
|
|
5942
6128
|
.toLowerCase()
|
|
5943
6129
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5944
6130
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5945
|
-
let n =
|
|
5946
|
-
s =
|
|
6131
|
+
let n = Ur(r, t),
|
|
6132
|
+
s = Se.get(Ce('seedance-2', n));
|
|
5947
6133
|
return s ? s.slug : null;
|
|
5948
6134
|
}
|
|
5949
|
-
let
|
|
5950
|
-
return
|
|
6135
|
+
let i = pe.get(r) ?? Se.get(Ce(r));
|
|
6136
|
+
return i ? i.slug : null;
|
|
5951
6137
|
}
|
|
5952
|
-
function
|
|
5953
|
-
return
|
|
6138
|
+
function jr(e, t) {
|
|
6139
|
+
return pe.has(e) && !(Br.has(e) && t) ? e : Fr(e, t);
|
|
5954
6140
|
}
|
|
5955
|
-
function
|
|
5956
|
-
let r =
|
|
5957
|
-
return r ? (
|
|
6141
|
+
function z(e, t) {
|
|
6142
|
+
let r = jr(e, t);
|
|
6143
|
+
return r ? (pe.get(r) ?? null) : null;
|
|
5958
6144
|
}
|
|
5959
|
-
function
|
|
5960
|
-
return
|
|
6145
|
+
function de() {
|
|
6146
|
+
return wt;
|
|
5961
6147
|
}
|
|
5962
|
-
var
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
6148
|
+
var bt,
|
|
6149
|
+
kt,
|
|
6150
|
+
wt,
|
|
6151
|
+
Vr,
|
|
6152
|
+
pe,
|
|
6153
|
+
Se,
|
|
6154
|
+
yt,
|
|
6155
|
+
Nr,
|
|
6156
|
+
Ee,
|
|
6157
|
+
Br,
|
|
6158
|
+
B = y(() => {
|
|
5973
6159
|
'use strict';
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
((
|
|
5978
|
-
...
|
|
5979
|
-
families:
|
|
5980
|
-
models:
|
|
6160
|
+
ft();
|
|
6161
|
+
gt();
|
|
6162
|
+
Ke();
|
|
6163
|
+
((bt = {
|
|
6164
|
+
...oe,
|
|
6165
|
+
families: oe.families.map((e) => ({ ...e, models: e.models.filter((t) => !se(t)) })),
|
|
6166
|
+
models: oe.models.filter((e) => !se(e.slug)),
|
|
5981
6167
|
}),
|
|
5982
|
-
(
|
|
5983
|
-
(
|
|
5984
|
-
(
|
|
5985
|
-
...
|
|
5986
|
-
...
|
|
5987
|
-
.map((e) => ({ ...e, models:
|
|
6168
|
+
(kt = le.filter((e) => !se(e.slug))),
|
|
6169
|
+
(wt = [...bt.models, ...kt]),
|
|
6170
|
+
(Vr = [
|
|
6171
|
+
...bt.families,
|
|
6172
|
+
...ht
|
|
6173
|
+
.map((e) => ({ ...e, models: kt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
|
|
5988
6174
|
.filter((e) => e.models.length > 0),
|
|
5989
6175
|
]),
|
|
5990
|
-
(
|
|
5991
|
-
(
|
|
5992
|
-
(
|
|
5993
|
-
(
|
|
5994
|
-
(
|
|
5995
|
-
for (let e of
|
|
5996
|
-
(
|
|
5997
|
-
for (let t of e.variants)
|
|
6176
|
+
(pe = new Map()),
|
|
6177
|
+
(Se = new Map()),
|
|
6178
|
+
(yt = new Map()),
|
|
6179
|
+
(Nr = new Map()),
|
|
6180
|
+
(Ee = new Map()));
|
|
6181
|
+
for (let e of wt) {
|
|
6182
|
+
(pe.set(e.slug, e), Se.set(Ce(e.api.model, e.api.quality), e));
|
|
6183
|
+
for (let t of e.variants) yt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
5998
6184
|
for (let t of e.editVariants ?? [])
|
|
5999
|
-
|
|
6000
|
-
for (let t of e.addons ?? [])
|
|
6001
|
-
|
|
6185
|
+
yt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
6186
|
+
for (let t of e.addons ?? []) Nr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
6187
|
+
Ee.set(e.slug, e.family);
|
|
6002
6188
|
}
|
|
6003
|
-
for (let e of
|
|
6004
|
-
|
|
6189
|
+
for (let e of Vr) for (let t of e.models) Ee.has(t) || Ee.set(t, e.slug);
|
|
6190
|
+
Br = new Set(['seedance-2']);
|
|
6005
6191
|
});
|
|
6006
|
-
function
|
|
6192
|
+
function ce(e) {
|
|
6007
6193
|
let t = e.from?.variant;
|
|
6008
6194
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
6009
6195
|
}
|
|
6010
|
-
function
|
|
6196
|
+
function $e(e) {
|
|
6011
6197
|
if (e.endpoints?.length)
|
|
6012
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
6013
|
-
?
|
|
6198
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === xt)
|
|
6199
|
+
? xt
|
|
6014
6200
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
6015
6201
|
}
|
|
6016
|
-
var
|
|
6202
|
+
var xt,
|
|
6017
6203
|
qe = y(() => {
|
|
6018
6204
|
'use strict';
|
|
6019
|
-
|
|
6020
|
-
|
|
6205
|
+
B();
|
|
6206
|
+
xt = 'dynamic';
|
|
6021
6207
|
});
|
|
6022
|
-
var
|
|
6023
|
-
|
|
6208
|
+
var ue,
|
|
6209
|
+
Ae = y(() => {
|
|
6024
6210
|
'use strict';
|
|
6025
|
-
|
|
6211
|
+
ue = {
|
|
6026
6212
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
6027
6213
|
'gemini-3-7-flash': 'gemini-3.7-flash',
|
|
6028
6214
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
@@ -6032,29 +6218,29 @@ var ce,
|
|
|
6032
6218
|
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
6033
6219
|
};
|
|
6034
6220
|
});
|
|
6035
|
-
var
|
|
6221
|
+
var _t = y(() => {
|
|
6036
6222
|
'use strict';
|
|
6037
6223
|
});
|
|
6038
|
-
function
|
|
6039
|
-
return typeof t == 'string' && (
|
|
6224
|
+
function Pt(e, t) {
|
|
6225
|
+
return typeof t == 'string' && (Gr[e]?.includes(t) ?? !1);
|
|
6040
6226
|
}
|
|
6041
|
-
var
|
|
6042
|
-
|
|
6227
|
+
var Gr,
|
|
6228
|
+
It = y(() => {
|
|
6043
6229
|
'use strict';
|
|
6044
|
-
|
|
6230
|
+
B();
|
|
6045
6231
|
qe();
|
|
6046
|
-
|
|
6047
|
-
|
|
6232
|
+
_t();
|
|
6233
|
+
Gr = {};
|
|
6048
6234
|
});
|
|
6049
|
-
function
|
|
6050
|
-
return e === 'nano-banana-pro' ?
|
|
6235
|
+
function vt(e) {
|
|
6236
|
+
return e === 'nano-banana-pro' ? Hr : zr;
|
|
6051
6237
|
}
|
|
6052
|
-
var
|
|
6053
|
-
|
|
6054
|
-
|
|
6238
|
+
var Hr,
|
|
6239
|
+
zr,
|
|
6240
|
+
Tt = y(() => {
|
|
6055
6241
|
'use strict';
|
|
6056
|
-
((
|
|
6057
|
-
(
|
|
6242
|
+
((Hr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
6243
|
+
(zr = [
|
|
6058
6244
|
'auto',
|
|
6059
6245
|
'1:1',
|
|
6060
6246
|
'1:4',
|
|
@@ -6072,10 +6258,10 @@ var Rr,
|
|
|
6072
6258
|
'21:9',
|
|
6073
6259
|
]));
|
|
6074
6260
|
});
|
|
6075
|
-
var
|
|
6076
|
-
|
|
6261
|
+
var Mt,
|
|
6262
|
+
Kt = y(() => {
|
|
6077
6263
|
'use strict';
|
|
6078
|
-
|
|
6264
|
+
Mt = [
|
|
6079
6265
|
'prompt',
|
|
6080
6266
|
'system',
|
|
6081
6267
|
'messages',
|
|
@@ -6089,10 +6275,10 @@ var Pt,
|
|
|
6089
6275
|
'endpoint',
|
|
6090
6276
|
];
|
|
6091
6277
|
});
|
|
6092
|
-
var
|
|
6093
|
-
|
|
6278
|
+
var St,
|
|
6279
|
+
Et = y(() => {
|
|
6094
6280
|
'use strict';
|
|
6095
|
-
|
|
6281
|
+
St = [
|
|
6096
6282
|
{
|
|
6097
6283
|
slug: 'claude-fable-5-1',
|
|
6098
6284
|
family: 'fable-5-1',
|
|
@@ -6161,13 +6347,13 @@ var _t,
|
|
|
6161
6347
|
},
|
|
6162
6348
|
];
|
|
6163
6349
|
});
|
|
6164
|
-
function
|
|
6350
|
+
function Ct(e) {
|
|
6165
6351
|
return `$${e}`;
|
|
6166
6352
|
}
|
|
6167
|
-
function
|
|
6168
|
-
return
|
|
6353
|
+
function Oe(e, t, r) {
|
|
6354
|
+
return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
6169
6355
|
}
|
|
6170
|
-
function
|
|
6356
|
+
function Jr(e) {
|
|
6171
6357
|
return [
|
|
6172
6358
|
{
|
|
6173
6359
|
name: 'prompt',
|
|
@@ -6233,13 +6419,13 @@ function Dr(e) {
|
|
|
6233
6419
|
},
|
|
6234
6420
|
];
|
|
6235
6421
|
}
|
|
6236
|
-
function
|
|
6422
|
+
function $t() {
|
|
6237
6423
|
return Object.fromEntries(
|
|
6238
|
-
|
|
6239
|
-
let t =
|
|
6240
|
-
r =
|
|
6241
|
-
|
|
6242
|
-
n = t != null && r != null ? `${
|
|
6424
|
+
St.map((e) => {
|
|
6425
|
+
let t = Oe(e.slug, 'cheap', 'input'),
|
|
6426
|
+
r = Oe(e.slug, 'cheap', 'output'),
|
|
6427
|
+
i = Oe(e.slug, 'stable', 'input') != null,
|
|
6428
|
+
n = t != null && r != null ? `${Ct(t)}/M in \xB7 ${Ct(r)}/M out` : '',
|
|
6243
6429
|
s = {
|
|
6244
6430
|
slug: e.slug,
|
|
6245
6431
|
name: e.name,
|
|
@@ -6250,42 +6436,461 @@ function Mt() {
|
|
|
6250
6436
|
priceFormatted: n,
|
|
6251
6437
|
unit: '/M tokens',
|
|
6252
6438
|
primaryToolName: 'run_task',
|
|
6253
|
-
parameters:
|
|
6439
|
+
parameters: Jr(i),
|
|
6254
6440
|
};
|
|
6255
6441
|
return [e.slug, s];
|
|
6256
6442
|
}),
|
|
6257
6443
|
);
|
|
6258
6444
|
}
|
|
6259
|
-
var
|
|
6445
|
+
var qt = y(() => {
|
|
6260
6446
|
'use strict';
|
|
6261
|
-
|
|
6262
|
-
|
|
6447
|
+
Et();
|
|
6448
|
+
B();
|
|
6263
6449
|
});
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6450
|
+
function me(e) {
|
|
6451
|
+
return e ? Xr.get(e) : void 0;
|
|
6452
|
+
}
|
|
6453
|
+
function Rt(e, t) {
|
|
6454
|
+
return !e.aspects?.length || e.sourceFramedModes?.includes(t)
|
|
6455
|
+
? null
|
|
6456
|
+
: e.adaptiveModes?.includes(t)
|
|
6457
|
+
? [...e.aspects, 'adaptive']
|
|
6458
|
+
: [...e.aspects];
|
|
6459
|
+
}
|
|
6460
|
+
function Dt(e, t, r) {
|
|
6461
|
+
return e.modes.includes('motion_control')
|
|
6462
|
+
? t === 'motion_control'
|
|
6463
|
+
? !Zr.includes(r)
|
|
6464
|
+
: !Qr.includes(r)
|
|
6465
|
+
: !0;
|
|
6466
|
+
}
|
|
6467
|
+
var Wr,
|
|
6468
|
+
Yr,
|
|
6469
|
+
At,
|
|
6470
|
+
Wa,
|
|
6471
|
+
Xr,
|
|
6472
|
+
Ot,
|
|
6473
|
+
Re,
|
|
6474
|
+
Ya,
|
|
6475
|
+
De,
|
|
6476
|
+
Qr,
|
|
6477
|
+
Zr,
|
|
6478
|
+
Le = y(() => {
|
|
6479
|
+
'use strict';
|
|
6480
|
+
((Wr = ['16:9', '9:16', '1:1', '21:9']),
|
|
6481
|
+
(Yr = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
|
|
6482
|
+
(At = [
|
|
6483
|
+
{
|
|
6484
|
+
slug: 'kling-v4',
|
|
6485
|
+
kind: 'video',
|
|
6486
|
+
modes: ['text_to_video', 'image_to_video', 'multi_reference'],
|
|
6487
|
+
promptMax: 26e3,
|
|
6488
|
+
duration: { min: 3, max: 30, default: 5 },
|
|
6489
|
+
heights: { '720p': 720, '1080p': 1080 },
|
|
6490
|
+
aspects: Wr,
|
|
6491
|
+
sourceFramedModes: ['image_to_video'],
|
|
6492
|
+
adaptiveModes: ['multi_reference'],
|
|
6493
|
+
fps: 24,
|
|
6494
|
+
audio: 'none',
|
|
6495
|
+
seed: !1,
|
|
6496
|
+
lastFrameOnImageToVideo: !0,
|
|
6497
|
+
referenceHandles: !0,
|
|
6498
|
+
reference: {
|
|
6499
|
+
maxImages: 10,
|
|
6500
|
+
maxVideos: 5,
|
|
6501
|
+
maxAudios: 0,
|
|
6502
|
+
maxFiles: 15,
|
|
6503
|
+
maxVideoSeconds: 30,
|
|
6504
|
+
},
|
|
6505
|
+
videoInputBilling: { minOutputMultiple: 2, withVideoRows: !0 },
|
|
6506
|
+
},
|
|
6507
|
+
{
|
|
6508
|
+
slug: 'kling-v3-video',
|
|
6509
|
+
kind: 'video',
|
|
6510
|
+
modes: ['text_to_video', 'image_to_video', 'motion_control'],
|
|
6511
|
+
promptMax: 2500,
|
|
6512
|
+
promptOptionalModes: ['motion_control'],
|
|
6513
|
+
duration: { min: 3, max: 15, default: 5 },
|
|
6514
|
+
heights: { '720p': 720, '1080p': 1080, '4k': 2160 },
|
|
6515
|
+
aspects: ['16:9', '9:16', '1:1'],
|
|
6516
|
+
sourceFramedModes: ['image_to_video', 'motion_control'],
|
|
6517
|
+
fps: 30,
|
|
6518
|
+
audio: 'priced',
|
|
6519
|
+
seed: !1,
|
|
6520
|
+
lastFrameOnImageToVideo: !0,
|
|
6521
|
+
},
|
|
6522
|
+
{
|
|
6523
|
+
slug: 'minimax-h3-turbo',
|
|
6524
|
+
kind: 'video',
|
|
6525
|
+
modes: ['text_to_video', 'image_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6526
|
+
promptMax: 65535,
|
|
6527
|
+
duration: { min: 5, max: 15, default: 5 },
|
|
6528
|
+
heights: { '480p': 480, '768p': 768 },
|
|
6529
|
+
aspects: Yr,
|
|
6530
|
+
fps: 24,
|
|
6531
|
+
audio: 'free',
|
|
6532
|
+
seed: !0,
|
|
6533
|
+
lastFrameOnImageToVideo: !0,
|
|
6534
|
+
reference: {
|
|
6535
|
+
maxImages: 9,
|
|
6536
|
+
maxVideos: 3,
|
|
6537
|
+
maxAudios: 3,
|
|
6538
|
+
maxFiles: 15,
|
|
6539
|
+
maxVideoSeconds: 15,
|
|
6540
|
+
maxAudioSeconds: 15,
|
|
6541
|
+
},
|
|
6542
|
+
videoInputBilling: { minOutputMultiple: 1, withVideoRows: !1 },
|
|
6543
|
+
},
|
|
6544
|
+
{
|
|
6545
|
+
slug: 'ltx-2.3-pro',
|
|
6546
|
+
kind: 'video',
|
|
6547
|
+
modes: ['text_to_video', 'image_to_video', 'first_n_last_frames'],
|
|
6548
|
+
promptMax: 1e4,
|
|
6549
|
+
duration: { min: 6, max: 10, default: 6, allowed: [6, 8, 10] },
|
|
6550
|
+
heights: { '1080p': 1080, '1440p': 1440, '4k': 2160 },
|
|
6551
|
+
aspects: ['16:9'],
|
|
6552
|
+
fps: 24,
|
|
6553
|
+
audio: 'free',
|
|
6554
|
+
seed: !0,
|
|
6555
|
+
},
|
|
6556
|
+
{
|
|
6557
|
+
slug: 'vidu-q4-preview',
|
|
6558
|
+
kind: 'video',
|
|
6559
|
+
modes: ['image_to_video', 'multi_reference'],
|
|
6560
|
+
promptMax: 2e4,
|
|
6561
|
+
promptOptionalModes: ['image_to_video'],
|
|
6562
|
+
duration: { min: 3, max: 16, default: 5 },
|
|
6563
|
+
heights: { '540p': 540, '720p': 720, '1080p': 1080, '1440p': 1440, '4k': 2160 },
|
|
6564
|
+
aspects: ['16:9', '9:16', '1:1', '4:3', '3:4'],
|
|
6565
|
+
sourceFramedModes: ['image_to_video'],
|
|
6566
|
+
fps: 24,
|
|
6567
|
+
audio: 'free',
|
|
6568
|
+
seed: !0,
|
|
6569
|
+
referenceHandles: !0,
|
|
6570
|
+
reference: {
|
|
6571
|
+
maxImages: 15,
|
|
6572
|
+
maxVideos: 0,
|
|
6573
|
+
maxAudios: 3,
|
|
6574
|
+
maxFiles: 18,
|
|
6575
|
+
audioClipSeconds: { min: 3, max: 12 },
|
|
6576
|
+
},
|
|
6577
|
+
},
|
|
6578
|
+
{
|
|
6579
|
+
slug: 'flux-2-dev',
|
|
6580
|
+
kind: 'image',
|
|
6581
|
+
modes: ['text_to_image', 'image_to_image'],
|
|
6582
|
+
promptMax: 1e4,
|
|
6583
|
+
sizes: {
|
|
6584
|
+
'1024x768': { width: 1024, height: 768 },
|
|
6585
|
+
'1024x1024': { width: 1024, height: 1024 },
|
|
6586
|
+
'1024x1808': { width: 1024, height: 1808 },
|
|
6587
|
+
'2048x1536': { width: 2048, height: 1536 },
|
|
6588
|
+
'2048x2048': { width: 2048, height: 2048 },
|
|
6589
|
+
},
|
|
6590
|
+
audio: 'none',
|
|
6591
|
+
seed: !0,
|
|
6592
|
+
maxEditImages: 3,
|
|
6593
|
+
},
|
|
6594
|
+
{
|
|
6595
|
+
slug: 'eleven-v4',
|
|
6596
|
+
kind: 'audio',
|
|
6597
|
+
modes: ['text_to_speech', 'dialogue'],
|
|
6598
|
+
modeRequired: !0,
|
|
6599
|
+
promptMax: 1e4,
|
|
6600
|
+
audio: 'none',
|
|
6601
|
+
seed: !0,
|
|
6602
|
+
},
|
|
6603
|
+
]),
|
|
6604
|
+
(Wa = At.map((e) => e.slug)),
|
|
6605
|
+
(Xr = new Map(At.map((e) => [e.slug, e]))));
|
|
6606
|
+
((Ot = 'EXAVITQu4vr4xnSDxMaL'),
|
|
6607
|
+
(Re = {
|
|
6608
|
+
hpp4J3VqNfWAUOO0d1Us: 'Bella',
|
|
6609
|
+
CwhRBWXzGAHq8TQ4Fs17: 'Roger',
|
|
6610
|
+
EXAVITQu4vr4xnSDxMaL: 'Sarah',
|
|
6611
|
+
FGY2WhTYpPnrIDTdsKH5: 'Laura',
|
|
6612
|
+
IKne3meq5aSn9XLyUdCD: 'Charlie',
|
|
6613
|
+
JBFqnCBsd6RMkjVDRZzb: 'George',
|
|
6614
|
+
N2lVS1w4EtoT3dr4eOWO: 'Callum',
|
|
6615
|
+
SAz9YHcvj6GT2YYXdXww: 'River',
|
|
6616
|
+
TX3LPaxmHKxFdv7VOQHJ: 'Liam',
|
|
6617
|
+
Xb7hH8MSUJpSbSDYk0k2: 'Alice',
|
|
6618
|
+
XrExE9yKIg1WjnnlVkGX: 'Matilda',
|
|
6619
|
+
bIHbv24MWmeRgasZH58o: 'Will',
|
|
6620
|
+
cgSgspJ2msm6clMCkdW9: 'Jessica',
|
|
6621
|
+
cjVigY5qzO86Huf0OWal: 'Eric',
|
|
6622
|
+
iP95p4xoKVk53GoZ742B: 'Chris',
|
|
6623
|
+
nPczCjzI2devNBz1zQrb: 'Brian',
|
|
6624
|
+
onwK4e9ZLuTAKqWW03F9: 'Daniel',
|
|
6625
|
+
pFZP5JQG7iQjIQuC4Bku: 'Lily',
|
|
6626
|
+
pqHfZKP75CvOlQylNhV4: 'Bill',
|
|
6627
|
+
pNInz6obpgDQGcFmaJgB: 'Adam',
|
|
6628
|
+
}),
|
|
6629
|
+
(Ya = Object.keys(Re)),
|
|
6630
|
+
(De = [
|
|
6631
|
+
'mp3_44100_128',
|
|
6632
|
+
'mp3_22050_32',
|
|
6633
|
+
'mp3_24000_48',
|
|
6634
|
+
'mp3_44100_32',
|
|
6635
|
+
'mp3_44100_64',
|
|
6636
|
+
'mp3_44100_96',
|
|
6637
|
+
'mp3_44100_192',
|
|
6638
|
+
'opus_48000_32',
|
|
6639
|
+
'opus_48000_64',
|
|
6640
|
+
'opus_48000_96',
|
|
6641
|
+
'opus_48000_128',
|
|
6642
|
+
'opus_48000_192',
|
|
6643
|
+
]));
|
|
6644
|
+
((Qr = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
|
|
6645
|
+
(Zr = [
|
|
6646
|
+
'duration',
|
|
6647
|
+
'aspect_ratio',
|
|
6648
|
+
'generate_audio',
|
|
6649
|
+
'seed',
|
|
6650
|
+
'first_frame_image',
|
|
6651
|
+
'last_frame_image',
|
|
6652
|
+
'images',
|
|
6653
|
+
'videos',
|
|
6654
|
+
'audios',
|
|
6655
|
+
]));
|
|
6656
|
+
});
|
|
6657
|
+
function ti() {
|
|
6658
|
+
return [
|
|
6659
|
+
{
|
|
6660
|
+
name: 'image_url',
|
|
6661
|
+
type: 'string',
|
|
6662
|
+
description: `motion_control: the character to animate, one jpg or png (at least 300 px a side, aspect 1:2.5 to 2.5:1) with the head and upper or full body clearly visible, ${O}`,
|
|
6663
|
+
},
|
|
6664
|
+
{
|
|
6665
|
+
name: 'video_url',
|
|
6666
|
+
type: 'string',
|
|
6667
|
+
description: `motion_control: the motion to copy, one mp4 or mov of a single person in one continuous take, 3 to 30 s (up to 10 s when character_orientation is image). Billed per second of this video, rounded up, ${O}`,
|
|
6668
|
+
},
|
|
6669
|
+
{
|
|
6670
|
+
name: 'character_orientation',
|
|
6671
|
+
type: 'select',
|
|
6672
|
+
default: 'video',
|
|
6673
|
+
options: ['video', 'image'],
|
|
6674
|
+
description:
|
|
6675
|
+
'motion_control: video faces the character as in the video (complex motion, up to 30 s); image as in the image (camera moves, up to 10 s).',
|
|
6676
|
+
},
|
|
6677
|
+
{
|
|
6678
|
+
name: 'keep_original_sound',
|
|
6679
|
+
type: 'boolean',
|
|
6680
|
+
default: !0,
|
|
6681
|
+
description: "motion_control: keep the video's sound. Same price on or off.",
|
|
6682
|
+
},
|
|
6683
|
+
];
|
|
6684
|
+
}
|
|
6685
|
+
function ri(e) {
|
|
6686
|
+
let t = e.duration,
|
|
6687
|
+
r = Object.keys(e.heights),
|
|
6688
|
+
i = e.sourceFramedModes?.length
|
|
6689
|
+
? ` Not taken by ${e.sourceFramedModes.join(', ')}: the source image sets the frame.`
|
|
6690
|
+
: '',
|
|
6691
|
+
n = [
|
|
6692
|
+
{
|
|
6693
|
+
name: 'duration',
|
|
6694
|
+
type: t.allowed ? 'select' : 'slider',
|
|
6695
|
+
default: t.default,
|
|
6696
|
+
...(t.allowed ? { options: t.allowed.map(String) } : { min: t.min, max: t.max }),
|
|
6697
|
+
description: t.allowed
|
|
6698
|
+
? `Video length in seconds: ${t.allowed.join(', ')}.`
|
|
6699
|
+
: `Video length in seconds (${t.min} to ${t.max}).`,
|
|
6700
|
+
},
|
|
6701
|
+
{
|
|
6702
|
+
name: 'resolution',
|
|
6703
|
+
type: 'select',
|
|
6704
|
+
default: r[0],
|
|
6705
|
+
options: r,
|
|
6706
|
+
description: `Output resolution. Higher resolutions cost more per second.${e.modes.includes('motion_control') ? ' motion_control: 720p or 1080p.' : ''}`,
|
|
6707
|
+
},
|
|
6708
|
+
{
|
|
6709
|
+
name: 'aspect_ratio',
|
|
6710
|
+
type: 'select',
|
|
6711
|
+
default: e.aspects[0],
|
|
6712
|
+
options: [...e.aspects, ...(e.adaptiveModes?.length ? ['adaptive'] : [])],
|
|
6713
|
+
description: `The frame.${e.adaptiveModes?.length ? ` adaptive: ${e.adaptiveModes.join(', ')} only.` : ''}${i}`,
|
|
6714
|
+
},
|
|
6715
|
+
];
|
|
6716
|
+
if (
|
|
6717
|
+
(e.audio === 'priced'
|
|
6718
|
+
? n.push({
|
|
6719
|
+
name: 'generate_audio',
|
|
6720
|
+
type: 'boolean',
|
|
6721
|
+
default: !1,
|
|
6722
|
+
description: 'Add sound. Clips with sound are billed at the higher rate.',
|
|
6723
|
+
})
|
|
6724
|
+
: e.audio === 'free' &&
|
|
6725
|
+
n.push({
|
|
6726
|
+
name: 'generate_audio',
|
|
6727
|
+
type: 'boolean',
|
|
6728
|
+
default: !0,
|
|
6729
|
+
description: 'Add sound. Same price on or off.',
|
|
6730
|
+
}),
|
|
6731
|
+
e.reference?.maxImages &&
|
|
6732
|
+
n.push({
|
|
6733
|
+
name: 'images',
|
|
6734
|
+
type: 'string[]',
|
|
6735
|
+
description: `multi_reference: up to ${e.reference.maxImages} reference images.${e.referenceHandles ? ' In the prompt, name them @Image1, @Image2, ... in this order.' : ''} ${O}`,
|
|
6736
|
+
}),
|
|
6737
|
+
(e.modes.includes('image_to_video') || e.modes.includes('first_n_last_frames')) &&
|
|
6738
|
+
n.push({
|
|
6739
|
+
name: 'first_frame_image',
|
|
6740
|
+
type: 'string',
|
|
6741
|
+
description: `The start frame (image_to_video, first_n_last_frames), ${O}`,
|
|
6742
|
+
}),
|
|
6743
|
+
(e.lastFrameOnImageToVideo || e.modes.includes('first_n_last_frames')) &&
|
|
6744
|
+
n.push({
|
|
6745
|
+
name: 'last_frame_image',
|
|
6746
|
+
type: 'string',
|
|
6747
|
+
description: `Last frame (optional on image_to_video), ${O}`,
|
|
6748
|
+
}),
|
|
6749
|
+
e.reference?.maxVideos)
|
|
6750
|
+
) {
|
|
6751
|
+
let s = e.reference,
|
|
6752
|
+
o = e.videoInputBilling
|
|
6753
|
+
? ` Billed as input plus output seconds${e.videoInputBilling.minOutputMultiple > 1 ? `, at least ${e.videoInputBilling.minOutputMultiple}x the output` : ''}.`
|
|
6754
|
+
: '';
|
|
6755
|
+
n.push({
|
|
6756
|
+
name: 'videos',
|
|
6757
|
+
type: 'string[]',
|
|
6758
|
+
description: `multi_reference: up to ${s.maxVideos} reference videos${s.maxVideoSeconds ? `, ${s.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${o} ${O}`,
|
|
6759
|
+
});
|
|
6760
|
+
}
|
|
6761
|
+
if (e.reference?.maxAudios) {
|
|
6762
|
+
let s = e.reference,
|
|
6763
|
+
o = s.audioClipSeconds
|
|
6764
|
+
? `, each ${s.audioClipSeconds.min} to ${s.audioClipSeconds.max} s`
|
|
6765
|
+
: s.maxAudioSeconds
|
|
6766
|
+
? `, ${s.maxAudioSeconds} s in all`
|
|
6767
|
+
: '';
|
|
6768
|
+
n.push({
|
|
6769
|
+
name: 'audios',
|
|
6770
|
+
type: 'string[]',
|
|
6771
|
+
description: `multi_reference: up to ${s.maxAudios} reference audios${o}, with at least one image or video. ${O}`,
|
|
6772
|
+
});
|
|
6773
|
+
}
|
|
6774
|
+
return n;
|
|
6775
|
+
}
|
|
6776
|
+
function ii(e) {
|
|
6777
|
+
let t = Object.keys(e.sizes);
|
|
6778
|
+
return [
|
|
6779
|
+
{
|
|
6780
|
+
name: 'resolution',
|
|
6781
|
+
type: 'select',
|
|
6782
|
+
default: t[0],
|
|
6783
|
+
options: t,
|
|
6784
|
+
description: 'Output size, width x height. Priced by size.',
|
|
6785
|
+
},
|
|
6786
|
+
{
|
|
6787
|
+
name: 'images',
|
|
6788
|
+
type: 'string[]',
|
|
6789
|
+
description: `image_to_image: up to ${e.maxEditImages} images to edit, ${O}`,
|
|
6790
|
+
},
|
|
6791
|
+
];
|
|
6792
|
+
}
|
|
6793
|
+
function ni() {
|
|
6794
|
+
return [
|
|
6795
|
+
{
|
|
6796
|
+
name: 'voice_id',
|
|
6797
|
+
type: 'string',
|
|
6798
|
+
default: Ot,
|
|
6799
|
+
description: `text_to_speech: the ElevenLabs voice id, one of: ${ai}.`,
|
|
6800
|
+
},
|
|
6801
|
+
{
|
|
6802
|
+
name: 'turns',
|
|
6803
|
+
type: 'json',
|
|
6804
|
+
description:
|
|
6805
|
+
'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
|
|
6806
|
+
},
|
|
6807
|
+
{ name: 'output_format', type: 'select', default: De[0], options: [...De] },
|
|
6808
|
+
{ name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
|
|
6809
|
+
{
|
|
6810
|
+
name: 'similarity_boost',
|
|
6811
|
+
type: 'number',
|
|
6812
|
+
min: 0,
|
|
6813
|
+
max: 1,
|
|
6814
|
+
description: 'How closely to match the voice, 0 to 1.',
|
|
6815
|
+
},
|
|
6816
|
+
];
|
|
6817
|
+
}
|
|
6818
|
+
function Lt(e) {
|
|
6819
|
+
let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
|
|
6820
|
+
r = [
|
|
6821
|
+
{
|
|
6822
|
+
name: 'prompt',
|
|
6823
|
+
type: 'string',
|
|
6824
|
+
required: e.kind !== 'audio' && !e.promptOptionalModes?.length,
|
|
6825
|
+
description: `${e.kind === 'audio' ? 'Text to speak (text_to_speech), billed per character.' : 'Text prompt.'} Up to ${e.promptMax} characters.${t}`,
|
|
6826
|
+
},
|
|
6827
|
+
{
|
|
6828
|
+
name: 'mode',
|
|
6829
|
+
type: 'select',
|
|
6830
|
+
required: !0,
|
|
6831
|
+
default: e.modes[0],
|
|
6832
|
+
options: [...e.modes],
|
|
6833
|
+
description: e.modes.map((i) => ei[i]).join(' '),
|
|
6834
|
+
},
|
|
6835
|
+
];
|
|
6836
|
+
return (
|
|
6837
|
+
e.kind === 'video' ? r.push(...ri(e)) : e.kind === 'image' ? r.push(...ii(e)) : r.push(...ni()),
|
|
6838
|
+
e.modes.includes('motion_control') && r.push(...ti()),
|
|
6839
|
+
e.seed &&
|
|
6840
|
+
r.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
|
|
6841
|
+
r
|
|
6842
|
+
);
|
|
6843
|
+
}
|
|
6844
|
+
var O,
|
|
6845
|
+
ei,
|
|
6846
|
+
ai,
|
|
6847
|
+
Vt = y(() => {
|
|
6273
6848
|
'use strict';
|
|
6274
|
-
(
|
|
6275
|
-
|
|
6276
|
-
(
|
|
6277
|
-
(
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6849
|
+
Le();
|
|
6850
|
+
((O =
|
|
6851
|
+
'as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
|
|
6852
|
+
(ei = {
|
|
6853
|
+
text_to_video: 'text_to_video: from the prompt alone.',
|
|
6854
|
+
image_to_video: 'image_to_video: a start image in first_frame_image.',
|
|
6855
|
+
first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
|
|
6856
|
+
multi_reference: 'multi_reference: reference images, videos or audios.',
|
|
6857
|
+
text_to_image: 'text_to_image: from the prompt alone.',
|
|
6858
|
+
image_to_image: 'image_to_image: edit the images in `images`.',
|
|
6859
|
+
text_to_speech: 'text_to_speech: speaks the prompt in one voice.',
|
|
6860
|
+
dialogue: 'dialogue: speaks `turns`, each with its own voice.',
|
|
6861
|
+
motion_control:
|
|
6862
|
+
'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
|
|
6863
|
+
}));
|
|
6864
|
+
ai = Object.entries(Re)
|
|
6865
|
+
.map(([e, t]) => `${e} (${t})`)
|
|
6866
|
+
.join(', ');
|
|
6282
6867
|
});
|
|
6283
|
-
var
|
|
6284
|
-
|
|
6285
|
-
|
|
6868
|
+
var fe,
|
|
6869
|
+
Nt,
|
|
6870
|
+
J,
|
|
6871
|
+
Ut,
|
|
6872
|
+
en,
|
|
6873
|
+
tn,
|
|
6874
|
+
rn,
|
|
6875
|
+
an,
|
|
6876
|
+
Ft = y(() => {
|
|
6286
6877
|
'use strict';
|
|
6287
|
-
((
|
|
6878
|
+
((fe = 'enhancor-ultrafine'),
|
|
6879
|
+
(Nt = 'Enhancor Ultrafine'),
|
|
6880
|
+
(J = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
|
|
6881
|
+
(Ut = 2),
|
|
6882
|
+
(en = 24 * 1024 * 1024),
|
|
6883
|
+
(tn = 4096 * 4096),
|
|
6884
|
+
(rn = 30 * 6e4),
|
|
6885
|
+
(an = 120 * 6e4));
|
|
6886
|
+
});
|
|
6887
|
+
var W,
|
|
6888
|
+
ge,
|
|
6889
|
+
Ve = y(() => {
|
|
6890
|
+
'use strict';
|
|
6891
|
+
((W = [
|
|
6288
6892
|
'seedance-2-5',
|
|
6893
|
+
'seedance-2-5-flash',
|
|
6289
6894
|
'seedance-2',
|
|
6290
6895
|
'seedance-2-mini',
|
|
6291
6896
|
'seedream-5-pro',
|
|
@@ -6294,13 +6899,13 @@ var J,
|
|
|
6294
6899
|
'z-image-pro',
|
|
6295
6900
|
'doppel',
|
|
6296
6901
|
]),
|
|
6297
|
-
(
|
|
6902
|
+
(ge =
|
|
6298
6903
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
6299
6904
|
});
|
|
6300
|
-
function
|
|
6905
|
+
function Y(e) {
|
|
6301
6906
|
return `$${Number(e.toFixed(5))}`;
|
|
6302
6907
|
}
|
|
6303
|
-
function
|
|
6908
|
+
function li(e) {
|
|
6304
6909
|
if (e.kind === 'llm') {
|
|
6305
6910
|
let t = e.defaultEndpoint,
|
|
6306
6911
|
r = (s) =>
|
|
@@ -6310,44 +6915,44 @@ function Ur(e) {
|
|
|
6310
6915
|
(!t || !o.endpoint || o.endpoint === t) &&
|
|
6311
6916
|
(!o.context || o.context === '0\u201332K'),
|
|
6312
6917
|
),
|
|
6313
|
-
|
|
6918
|
+
i = r('input'),
|
|
6314
6919
|
n = r('output');
|
|
6315
|
-
return
|
|
6316
|
-
? `${
|
|
6317
|
-
: `from ${
|
|
6920
|
+
return i && n
|
|
6921
|
+
? `${Y(i.price.starter)}/M in \xB7 ${Y(n.price.starter)}/M out`
|
|
6922
|
+
: `from ${Y(ce(e).price.starter)}/M tokens`;
|
|
6318
6923
|
}
|
|
6319
|
-
return `from ${
|
|
6924
|
+
return `from ${Y(ce(e).price.starter)}${e.unit}`;
|
|
6320
6925
|
}
|
|
6321
|
-
function
|
|
6322
|
-
let r = t.filter((
|
|
6323
|
-
return r.length ? `from ${
|
|
6926
|
+
function pi(e, t) {
|
|
6927
|
+
let r = t.filter((i) => Number.isFinite(i) && i > 0);
|
|
6928
|
+
return r.length ? `from ${Y(Math.min(...r))}${e}` : null;
|
|
6324
6929
|
}
|
|
6325
|
-
function
|
|
6326
|
-
for (let t of
|
|
6327
|
-
let r =
|
|
6328
|
-
|
|
6329
|
-
r &&
|
|
6930
|
+
function zt(e) {
|
|
6931
|
+
for (let t of H) {
|
|
6932
|
+
let r = ye[t],
|
|
6933
|
+
i = r ? pi(r.unit, e[t] ?? []) : null;
|
|
6934
|
+
r && i && (r.priceFormatted = i);
|
|
6330
6935
|
}
|
|
6331
6936
|
}
|
|
6332
6937
|
function R(e, t) {
|
|
6333
6938
|
let r = e.axes?.resolution ?? [
|
|
6334
|
-
...new Set(e.variants.map((
|
|
6939
|
+
...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
|
|
6335
6940
|
];
|
|
6336
6941
|
return {
|
|
6337
6942
|
name: 'resolution',
|
|
6338
6943
|
type: 'select',
|
|
6339
|
-
default:
|
|
6944
|
+
default: ce(e).resolution ?? r[0],
|
|
6340
6945
|
options: r,
|
|
6341
6946
|
...(t ? { description: t } : {}),
|
|
6342
6947
|
};
|
|
6343
6948
|
}
|
|
6344
|
-
function
|
|
6949
|
+
function Jt(e) {
|
|
6345
6950
|
if (!e.endpoints?.length) return null;
|
|
6346
|
-
let t = e.endpoints.filter((r) =>
|
|
6951
|
+
let t = e.endpoints.filter((r) => Pt(e.slug, r.id));
|
|
6347
6952
|
return {
|
|
6348
6953
|
name: 'endpoint',
|
|
6349
6954
|
type: 'select',
|
|
6350
|
-
default:
|
|
6955
|
+
default: $e(e),
|
|
6351
6956
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6352
6957
|
description:
|
|
6353
6958
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6356,55 +6961,55 @@ function Dt(e) {
|
|
|
6356
6961
|
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
6357
6962
|
};
|
|
6358
6963
|
}
|
|
6359
|
-
function
|
|
6360
|
-
if (e.unfiltered == null || t.some((
|
|
6361
|
-
let r =
|
|
6362
|
-
return [...t.filter((
|
|
6964
|
+
function ci(e, t) {
|
|
6965
|
+
if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
|
|
6966
|
+
let r = W.includes(e.api.model);
|
|
6967
|
+
return [...t.filter((i) => !he.has(i.name)), r ? Ge : di];
|
|
6363
6968
|
}
|
|
6364
|
-
function
|
|
6365
|
-
let r = e.filter((n) => !
|
|
6366
|
-
|
|
6367
|
-
return (
|
|
6969
|
+
function Ne(e, t) {
|
|
6970
|
+
let r = e.filter((n) => !he.has(n.name)),
|
|
6971
|
+
i = [Ge, Wt];
|
|
6972
|
+
return (i.push(He, ze), [...r, ...i]);
|
|
6368
6973
|
}
|
|
6369
|
-
function
|
|
6974
|
+
function gi(e) {
|
|
6370
6975
|
return [
|
|
6371
6976
|
...e
|
|
6372
|
-
.filter((t) => !
|
|
6977
|
+
.filter((t) => !mi.has(t.name) && !he.has(t.name))
|
|
6373
6978
|
.map((t) => {
|
|
6374
6979
|
if (t.name === 'resolution')
|
|
6375
6980
|
return {
|
|
6376
6981
|
...t,
|
|
6377
6982
|
...(t.options
|
|
6378
6983
|
? {
|
|
6379
|
-
options: t.options.filter((
|
|
6380
|
-
['480p', '720p'].includes(String(
|
|
6984
|
+
options: t.options.filter((i) =>
|
|
6985
|
+
['480p', '720p'].includes(String(i).toLowerCase()),
|
|
6381
6986
|
),
|
|
6382
6987
|
}
|
|
6383
6988
|
: {}),
|
|
6384
|
-
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${
|
|
6989
|
+
description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${X}`,
|
|
6385
6990
|
};
|
|
6386
|
-
let r =
|
|
6991
|
+
let r = fi[t.name];
|
|
6387
6992
|
return r && typeof t.description == 'string'
|
|
6388
6993
|
? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
|
|
6389
6994
|
: t;
|
|
6390
6995
|
}),
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6996
|
+
Ge,
|
|
6997
|
+
Wt,
|
|
6998
|
+
He,
|
|
6999
|
+
ze,
|
|
6395
7000
|
];
|
|
6396
7001
|
}
|
|
6397
|
-
function
|
|
7002
|
+
function Yt(e) {
|
|
6398
7003
|
return (
|
|
6399
7004
|
e.startsWith('seedance-2-5-') &&
|
|
6400
7005
|
e !== 'seedance-2-5-lite' &&
|
|
6401
7006
|
!/-(creative-mode|unfiltered|uncensored)$/.test(e)
|
|
6402
7007
|
);
|
|
6403
7008
|
}
|
|
6404
|
-
function
|
|
7009
|
+
function Bt(e, t = {}) {
|
|
6405
7010
|
return [
|
|
6406
7011
|
...e
|
|
6407
|
-
.filter((r) => !
|
|
7012
|
+
.filter((r) => !ui.has(r.name) && !he.has(r.name))
|
|
6408
7013
|
.map((r) =>
|
|
6409
7014
|
r.name === 'prompt'
|
|
6410
7015
|
? { ...r, required: !0 }
|
|
@@ -6412,9 +7017,9 @@ function Ct(e, t = {}) {
|
|
|
6412
7017
|
? {
|
|
6413
7018
|
...r,
|
|
6414
7019
|
...(t.no4k && r.options
|
|
6415
|
-
? { options: r.options.filter((
|
|
7020
|
+
? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
|
|
6416
7021
|
: {}),
|
|
6417
|
-
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${
|
|
7022
|
+
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${X}`,
|
|
6418
7023
|
}
|
|
6419
7024
|
: r,
|
|
6420
7025
|
),
|
|
@@ -6425,11 +7030,11 @@ function Ct(e, t = {}) {
|
|
|
6425
7030
|
options: ['standard'],
|
|
6426
7031
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
6427
7032
|
},
|
|
6428
|
-
|
|
6429
|
-
|
|
7033
|
+
He,
|
|
7034
|
+
ze,
|
|
6430
7035
|
];
|
|
6431
7036
|
}
|
|
6432
|
-
function
|
|
7037
|
+
function Ue(e, t) {
|
|
6433
7038
|
return [
|
|
6434
7039
|
M('Text prompt describing the video.'),
|
|
6435
7040
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -6458,8 +7063,8 @@ function Oe(e, t) {
|
|
|
6458
7063
|
),
|
|
6459
7064
|
];
|
|
6460
7065
|
}
|
|
6461
|
-
function
|
|
6462
|
-
let t =
|
|
7066
|
+
function hi(e) {
|
|
7067
|
+
let t = Jt(e);
|
|
6463
7068
|
return [
|
|
6464
7069
|
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
6465
7070
|
...(t ? [t] : []),
|
|
@@ -6472,14 +7077,14 @@ function Jr(e) {
|
|
|
6472
7077
|
R(
|
|
6473
7078
|
e,
|
|
6474
7079
|
e.slug === 'gpt-image-2'
|
|
6475
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
7080
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ut}`
|
|
6476
7081
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6477
7082
|
),
|
|
6478
7083
|
{
|
|
6479
7084
|
name: 'aspect_ratio',
|
|
6480
7085
|
type: 'select',
|
|
6481
7086
|
default: 'auto',
|
|
6482
|
-
options: [...
|
|
7087
|
+
options: [...ct],
|
|
6483
7088
|
description:
|
|
6484
7089
|
"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.",
|
|
6485
7090
|
},
|
|
@@ -6526,7 +7131,7 @@ function Jr(e) {
|
|
|
6526
7131
|
},
|
|
6527
7132
|
];
|
|
6528
7133
|
}
|
|
6529
|
-
function
|
|
7134
|
+
function yi(e) {
|
|
6530
7135
|
return [
|
|
6531
7136
|
M('Image prompt text.'),
|
|
6532
7137
|
{
|
|
@@ -6534,7 +7139,7 @@ function Wr(e) {
|
|
|
6534
7139
|
type: 'string[]',
|
|
6535
7140
|
description: 'Images to edit or use as reference (up to 14).',
|
|
6536
7141
|
},
|
|
6537
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
7142
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...vt(e.slug)] },
|
|
6538
7143
|
R(e),
|
|
6539
7144
|
{
|
|
6540
7145
|
name: 'n',
|
|
@@ -6560,10 +7165,10 @@ function Wr(e) {
|
|
|
6560
7165
|
},
|
|
6561
7166
|
];
|
|
6562
7167
|
}
|
|
6563
|
-
function
|
|
6564
|
-
let e =
|
|
7168
|
+
function xi() {
|
|
7169
|
+
let e = Mt,
|
|
6565
7170
|
t = [];
|
|
6566
|
-
for (let r of
|
|
7171
|
+
for (let r of Je(!0))
|
|
6567
7172
|
e.includes(r.name) &&
|
|
6568
7173
|
(t.push({
|
|
6569
7174
|
...r,
|
|
@@ -6585,12 +7190,12 @@ function Zr() {
|
|
|
6585
7190
|
}));
|
|
6586
7191
|
return t;
|
|
6587
7192
|
}
|
|
6588
|
-
function
|
|
6589
|
-
return
|
|
7193
|
+
function _i() {
|
|
7194
|
+
return Je(!0).map((e) =>
|
|
6590
7195
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6591
7196
|
);
|
|
6592
7197
|
}
|
|
6593
|
-
function
|
|
7198
|
+
function Je(e) {
|
|
6594
7199
|
return [
|
|
6595
7200
|
M('The user message or task.'),
|
|
6596
7201
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -6685,21 +7290,21 @@ function Be(e) {
|
|
|
6685
7290
|
},
|
|
6686
7291
|
];
|
|
6687
7292
|
}
|
|
6688
|
-
function
|
|
6689
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
6690
|
-
let t =
|
|
7293
|
+
function Pi(e) {
|
|
7294
|
+
if (e.slug === 'seed-2-1-turbo') return ki;
|
|
7295
|
+
let t = Jt(e);
|
|
6691
7296
|
return [
|
|
6692
7297
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
6693
|
-
?
|
|
7298
|
+
? xi()
|
|
6694
7299
|
: e.slug === 'gemini-3.7-flash'
|
|
6695
|
-
?
|
|
6696
|
-
: e.slug === 'gpt-6-astra' ||
|
|
6697
|
-
?
|
|
6698
|
-
:
|
|
7300
|
+
? _i()
|
|
7301
|
+
: e.slug === 'gpt-6-astra' || wi.includes(e.slug)
|
|
7302
|
+
? Je(e.slug !== 'gpt-6-astra')
|
|
7303
|
+
: bi),
|
|
6699
7304
|
...(t ? [t] : []),
|
|
6700
7305
|
];
|
|
6701
7306
|
}
|
|
6702
|
-
function
|
|
7307
|
+
function Fe() {
|
|
6703
7308
|
return {
|
|
6704
7309
|
name: 'image',
|
|
6705
7310
|
type: 'string',
|
|
@@ -6707,7 +7312,7 @@ function De() {
|
|
|
6707
7312
|
description: 'The photo to fix: one JPEG or PNG URL.',
|
|
6708
7313
|
};
|
|
6709
7314
|
}
|
|
6710
|
-
function
|
|
7315
|
+
function vi(e) {
|
|
6711
7316
|
return [
|
|
6712
7317
|
{
|
|
6713
7318
|
name: 'video_url',
|
|
@@ -6729,7 +7334,7 @@ function aa(e) {
|
|
|
6729
7334
|
},
|
|
6730
7335
|
];
|
|
6731
7336
|
}
|
|
6732
|
-
function
|
|
7337
|
+
function Ti() {
|
|
6733
7338
|
return [
|
|
6734
7339
|
{
|
|
6735
7340
|
name: 'mode',
|
|
@@ -6800,28 +7405,30 @@ function ia() {
|
|
|
6800
7405
|
},
|
|
6801
7406
|
];
|
|
6802
7407
|
}
|
|
6803
|
-
function
|
|
7408
|
+
function Mi(e) {
|
|
6804
7409
|
let t = e.slug;
|
|
6805
|
-
if (e.family === 'tein-labs' && e.kind === 'image') return
|
|
6806
|
-
if (
|
|
6807
|
-
if (e.kind === 'llm') return
|
|
6808
|
-
if (e.editVariants?.length) return
|
|
6809
|
-
|
|
7410
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return Ti();
|
|
7411
|
+
if (le.some((i) => i.slug === t)) return vi(e);
|
|
7412
|
+
if (e.kind === 'llm') return Pi(e);
|
|
7413
|
+
if (e.editVariants?.length) return hi(e);
|
|
7414
|
+
let r = me(t);
|
|
7415
|
+
if (r) return Lt(r);
|
|
7416
|
+
if (Yt(t)) return gi(Be);
|
|
6810
7417
|
switch (t) {
|
|
6811
7418
|
case 'seedance-2-5':
|
|
6812
|
-
return
|
|
7419
|
+
return Ne(Be, t);
|
|
6813
7420
|
case 'seedance-2-5-lite':
|
|
6814
|
-
return
|
|
7421
|
+
return Bt(Be, { no4k: !0 });
|
|
6815
7422
|
case 'seedance-2':
|
|
6816
|
-
return
|
|
7423
|
+
return Ne(jt, t);
|
|
6817
7424
|
case 'seedance-2-lite':
|
|
6818
|
-
return
|
|
7425
|
+
return Bt(jt);
|
|
6819
7426
|
case 'seedance-2-mini':
|
|
6820
|
-
return
|
|
7427
|
+
return Ne(Ki, t);
|
|
6821
7428
|
case 'nano-banana-2':
|
|
6822
7429
|
case 'nano-banana-2.1':
|
|
6823
7430
|
case 'nano-banana-pro':
|
|
6824
|
-
return
|
|
7431
|
+
return yi(e);
|
|
6825
7432
|
case 'seedream-5-pro':
|
|
6826
7433
|
return [
|
|
6827
7434
|
M('Detailed description of the image to generate.'),
|
|
@@ -6972,7 +7579,7 @@ function na(e) {
|
|
|
6972
7579
|
];
|
|
6973
7580
|
case 'enhancor-skin-fix-v1':
|
|
6974
7581
|
return [
|
|
6975
|
-
|
|
7582
|
+
Fe(),
|
|
6976
7583
|
{
|
|
6977
7584
|
name: 'mode',
|
|
6978
7585
|
type: 'select',
|
|
@@ -7005,11 +7612,11 @@ function na(e) {
|
|
|
7005
7612
|
max: 0.4,
|
|
7006
7613
|
description: 'Portrait depth. Heavy only.',
|
|
7007
7614
|
},
|
|
7008
|
-
...
|
|
7615
|
+
...Ii,
|
|
7009
7616
|
];
|
|
7010
7617
|
case 'enhancor-skin-fix-v3':
|
|
7011
7618
|
return [
|
|
7012
|
-
|
|
7619
|
+
Fe(),
|
|
7013
7620
|
{
|
|
7014
7621
|
name: 'mask_image',
|
|
7015
7622
|
type: 'string',
|
|
@@ -7049,7 +7656,7 @@ function na(e) {
|
|
|
7049
7656
|
];
|
|
7050
7657
|
case 'enhancor-skin-fix-v4':
|
|
7051
7658
|
return [
|
|
7052
|
-
|
|
7659
|
+
Fe(),
|
|
7053
7660
|
{
|
|
7054
7661
|
name: 'mode',
|
|
7055
7662
|
type: 'select',
|
|
@@ -7080,7 +7687,7 @@ function na(e) {
|
|
|
7080
7687
|
];
|
|
7081
7688
|
case 'wan-3-0':
|
|
7082
7689
|
case 'wan-3-0-prime':
|
|
7083
|
-
return
|
|
7690
|
+
return Ue(e, {
|
|
7084
7691
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7085
7692
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
7086
7693
|
minSec: 2,
|
|
@@ -7090,7 +7697,7 @@ function na(e) {
|
|
|
7090
7697
|
});
|
|
7091
7698
|
case 'happy-horse-1-1':
|
|
7092
7699
|
case 'happy-horse-1-0':
|
|
7093
|
-
return
|
|
7700
|
+
return Ue(e, {
|
|
7094
7701
|
modes:
|
|
7095
7702
|
t === 'happy-horse-1-0'
|
|
7096
7703
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -7101,7 +7708,7 @@ function na(e) {
|
|
|
7101
7708
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
7102
7709
|
});
|
|
7103
7710
|
case 'minimax-h3':
|
|
7104
|
-
return
|
|
7711
|
+
return Ue(e, {
|
|
7105
7712
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
7106
7713
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
7107
7714
|
minSec: 4,
|
|
@@ -7112,10 +7719,10 @@ function na(e) {
|
|
|
7112
7719
|
return [M('Prompt text.')];
|
|
7113
7720
|
}
|
|
7114
7721
|
}
|
|
7115
|
-
function
|
|
7722
|
+
function Si() {
|
|
7116
7723
|
return {
|
|
7117
|
-
slug:
|
|
7118
|
-
name:
|
|
7724
|
+
slug: fe,
|
|
7725
|
+
name: Nt,
|
|
7119
7726
|
category: 'Image',
|
|
7120
7727
|
kind: 'Image-to-Image',
|
|
7121
7728
|
vendor: 'Enhancor',
|
|
@@ -7123,7 +7730,7 @@ function oa() {
|
|
|
7123
7730
|
'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
7731
|
priceFormatted: '',
|
|
7125
7732
|
unit: '/img',
|
|
7126
|
-
primaryToolName:
|
|
7733
|
+
primaryToolName: Ht.image,
|
|
7127
7734
|
parameters: [
|
|
7128
7735
|
{
|
|
7129
7736
|
name: 'image',
|
|
@@ -7149,171 +7756,189 @@ function oa() {
|
|
|
7149
7756
|
{
|
|
7150
7757
|
name: 'scale',
|
|
7151
7758
|
type: 'select',
|
|
7152
|
-
default: String(
|
|
7153
|
-
options:
|
|
7154
|
-
description: `Full only. ${
|
|
7759
|
+
default: String(Ut),
|
|
7760
|
+
options: J.noSkin.map(String),
|
|
7761
|
+
description: `Full only. ${J.skin.join(', ')} with skin_fix on; also ${J.noSkin.filter((e) => !J.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
|
|
7155
7762
|
},
|
|
7156
7763
|
],
|
|
7157
7764
|
};
|
|
7158
7765
|
}
|
|
7159
|
-
function
|
|
7766
|
+
function je(e, t = e.api.model) {
|
|
7160
7767
|
return {
|
|
7161
7768
|
slug: t,
|
|
7162
7769
|
name: e.name,
|
|
7163
|
-
category:
|
|
7164
|
-
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' :
|
|
7770
|
+
category: si[e.kind],
|
|
7771
|
+
kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : oi[e.kind],
|
|
7165
7772
|
vendor: e.vendor ?? '',
|
|
7166
7773
|
description: e.desc ?? e.name,
|
|
7167
|
-
priceFormatted:
|
|
7774
|
+
priceFormatted: li(e),
|
|
7168
7775
|
unit: e.unit,
|
|
7169
|
-
primaryToolName:
|
|
7170
|
-
parameters:
|
|
7776
|
+
primaryToolName: Ht[e.kind],
|
|
7777
|
+
parameters: ci(e, Mi(e)),
|
|
7171
7778
|
};
|
|
7172
7779
|
}
|
|
7173
|
-
function
|
|
7780
|
+
function Ei() {
|
|
7174
7781
|
let e = {};
|
|
7175
|
-
for (let t of
|
|
7782
|
+
for (let t of de())
|
|
7176
7783
|
if (t.slug !== 'seedance-2-fast') {
|
|
7177
7784
|
if (t.slug === 'seedance-2-mini') {
|
|
7178
|
-
e['seedance-2-mini'] =
|
|
7785
|
+
e['seedance-2-mini'] = je(t, 'seedance-2-mini');
|
|
7179
7786
|
continue;
|
|
7180
7787
|
}
|
|
7181
7788
|
if (t.slug === 'seedance-2') {
|
|
7182
|
-
let r =
|
|
7789
|
+
let r = je(t);
|
|
7183
7790
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
7184
7791
|
(e['seedance-2'] = r));
|
|
7185
7792
|
continue;
|
|
7186
7793
|
}
|
|
7187
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
7794
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = je(t));
|
|
7188
7795
|
}
|
|
7189
|
-
(Object.assign(e,
|
|
7190
|
-
for (let [t, r] of Object.entries(
|
|
7796
|
+
(Object.assign(e, $t()), (e[fe] = Si()));
|
|
7797
|
+
for (let [t, r] of Object.entries(ue))
|
|
7191
7798
|
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
7192
7799
|
return e;
|
|
7193
7800
|
}
|
|
7194
|
-
function
|
|
7801
|
+
function be(e) {
|
|
7195
7802
|
return !!e?.parameters.some((t) => t.name === 'image');
|
|
7196
7803
|
}
|
|
7197
|
-
function
|
|
7198
|
-
return
|
|
7804
|
+
function j(e) {
|
|
7805
|
+
return ye[e] ?? null;
|
|
7199
7806
|
}
|
|
7200
|
-
function
|
|
7201
|
-
if (e.startsWith('enhancor-skin-fix-') || e ===
|
|
7202
|
-
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' ||
|
|
7203
|
-
let
|
|
7204
|
-
if (
|
|
7807
|
+
function Ci(e, t, r) {
|
|
7808
|
+
if (e.startsWith('enhancor-skin-fix-') || e === fe) return !1;
|
|
7809
|
+
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Yt(e)) && t === 'duration') {
|
|
7810
|
+
let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
7811
|
+
if (n(r.mode) === 'edit' || n(r.omni_reference_task_type) === 'edit') return !1;
|
|
7205
7812
|
}
|
|
7206
|
-
|
|
7207
|
-
(t === 'max_tokens' &&
|
|
7208
|
-
(t === 'max_completion_tokens' &&
|
|
7209
|
-
)
|
|
7813
|
+
if (
|
|
7814
|
+
(t === 'max_tokens' && Gt(r.max_completion_tokens)) ||
|
|
7815
|
+
(t === 'max_completion_tokens' && Gt(r.max_tokens))
|
|
7816
|
+
)
|
|
7817
|
+
return !1;
|
|
7818
|
+
if (t === 'aspect_ratio') {
|
|
7819
|
+
let n = me(e);
|
|
7820
|
+
if (n) {
|
|
7821
|
+
let s = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
|
|
7822
|
+
o = s ? s.replace(/-/g, '_') : n.modes[0];
|
|
7823
|
+
if (n.modes.includes(o) && !Rt(n, o)) return !1;
|
|
7824
|
+
}
|
|
7825
|
+
}
|
|
7826
|
+
let i = me(e);
|
|
7827
|
+
if (i) {
|
|
7828
|
+
let n = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
|
|
7829
|
+
s = n ? n.replace(/-/g, '_') : i.modes[0];
|
|
7830
|
+
if (i.modes.includes(s) && !Dt(i, s, t)) return !1;
|
|
7831
|
+
}
|
|
7832
|
+
return !0;
|
|
7210
7833
|
}
|
|
7211
|
-
function
|
|
7834
|
+
function Gt(e) {
|
|
7212
7835
|
return e != null && e !== '';
|
|
7213
7836
|
}
|
|
7214
|
-
function
|
|
7837
|
+
function Zt(e, t) {
|
|
7215
7838
|
let r = { ...t };
|
|
7216
7839
|
if (e?.slug === 'seedance-2-5') {
|
|
7217
|
-
let
|
|
7218
|
-
for (let n of
|
|
7219
|
-
if (!
|
|
7840
|
+
let i = (n) => typeof n != 'string' || !n.trim();
|
|
7841
|
+
for (let n of $i) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
|
|
7842
|
+
if (!i(r.finalize)) return r;
|
|
7220
7843
|
}
|
|
7221
|
-
for (let
|
|
7222
|
-
|
|
7223
|
-
r[
|
|
7224
|
-
|
|
7225
|
-
(r[
|
|
7844
|
+
for (let i of e?.parameters ?? [])
|
|
7845
|
+
i.default !== void 0 &&
|
|
7846
|
+
r[i.name] === void 0 &&
|
|
7847
|
+
Ci(e.slug, i.name, t) &&
|
|
7848
|
+
(r[i.name] = i.default);
|
|
7226
7849
|
return r;
|
|
7227
7850
|
}
|
|
7228
|
-
function
|
|
7229
|
-
return Object.values(
|
|
7851
|
+
function D() {
|
|
7852
|
+
return Object.values(ye);
|
|
7230
7853
|
}
|
|
7231
|
-
var
|
|
7232
|
-
|
|
7233
|
-
|
|
7854
|
+
var si,
|
|
7855
|
+
Ht,
|
|
7856
|
+
oi,
|
|
7234
7857
|
M,
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7858
|
+
Ge,
|
|
7859
|
+
di,
|
|
7860
|
+
Wt,
|
|
7861
|
+
He,
|
|
7862
|
+
ze,
|
|
7863
|
+
he,
|
|
7864
|
+
ui,
|
|
7865
|
+
mi,
|
|
7866
|
+
fi,
|
|
7867
|
+
bi,
|
|
7868
|
+
ki,
|
|
7869
|
+
wi,
|
|
7870
|
+
Ii,
|
|
7871
|
+
X,
|
|
7872
|
+
Be,
|
|
7873
|
+
Xt,
|
|
7874
|
+
Qt,
|
|
7875
|
+
jt,
|
|
7876
|
+
Ki,
|
|
7877
|
+
ye,
|
|
7878
|
+
$i,
|
|
7879
|
+
Q = y(() => {
|
|
7257
7880
|
'use strict';
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7881
|
+
mt();
|
|
7882
|
+
Me();
|
|
7883
|
+
B();
|
|
7261
7884
|
qe();
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
kt();
|
|
7265
|
-
xt();
|
|
7885
|
+
Ke();
|
|
7886
|
+
Ae();
|
|
7266
7887
|
It();
|
|
7888
|
+
Tt();
|
|
7267
7889
|
Kt();
|
|
7268
7890
|
qt();
|
|
7269
|
-
|
|
7270
|
-
(
|
|
7271
|
-
|
|
7891
|
+
Le();
|
|
7892
|
+
Vt();
|
|
7893
|
+
Ft();
|
|
7894
|
+
Ve();
|
|
7895
|
+
((si = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
7896
|
+
(Ht = {
|
|
7272
7897
|
video: 'generate_video',
|
|
7273
7898
|
image: 'generate_image',
|
|
7274
7899
|
audio: 'generate_audio',
|
|
7275
7900
|
llm: 'run_task',
|
|
7276
7901
|
}),
|
|
7277
|
-
(
|
|
7902
|
+
(oi = {
|
|
7278
7903
|
video: 'Text-to-Video',
|
|
7279
7904
|
image: 'Text-to-Image',
|
|
7280
7905
|
audio: 'Text-to-Audio',
|
|
7281
7906
|
llm: 'Reasoning (LLM)',
|
|
7282
7907
|
}));
|
|
7283
7908
|
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
7284
|
-
((
|
|
7909
|
+
((Ge = {
|
|
7285
7910
|
name: 'creative_mode',
|
|
7286
7911
|
type: 'boolean',
|
|
7287
7912
|
default: !1,
|
|
7288
7913
|
description:
|
|
7289
7914
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
7290
7915
|
}),
|
|
7291
|
-
(
|
|
7916
|
+
(di = {
|
|
7292
7917
|
name: 'creative_mode',
|
|
7293
7918
|
type: 'boolean',
|
|
7294
7919
|
default: !1,
|
|
7295
|
-
description: `Not available yet on this model: ${
|
|
7920
|
+
description: `Not available yet on this model: ${ge}.`,
|
|
7296
7921
|
}),
|
|
7297
|
-
(
|
|
7922
|
+
(Wt = {
|
|
7298
7923
|
name: 'priority',
|
|
7299
7924
|
type: 'boolean',
|
|
7300
7925
|
default: !1,
|
|
7301
7926
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
7302
7927
|
}),
|
|
7303
|
-
(
|
|
7928
|
+
(He = {
|
|
7304
7929
|
name: 'reference_roles',
|
|
7305
7930
|
type: 'json',
|
|
7306
7931
|
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).`,
|
|
7307
7932
|
}),
|
|
7308
|
-
(
|
|
7933
|
+
(ze = {
|
|
7309
7934
|
name: 'auto_fit_images',
|
|
7310
7935
|
type: 'boolean',
|
|
7311
7936
|
default: !1,
|
|
7312
7937
|
description:
|
|
7313
7938
|
'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.',
|
|
7314
7939
|
}),
|
|
7315
|
-
(
|
|
7316
|
-
((
|
|
7940
|
+
(he = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
7941
|
+
((ui = new Set([
|
|
7317
7942
|
'quality',
|
|
7318
7943
|
'bitrate_mode',
|
|
7319
7944
|
'draft',
|
|
@@ -7322,7 +7947,7 @@ var Lr,
|
|
|
7322
7947
|
'draft_generation_id',
|
|
7323
7948
|
'pass_faces',
|
|
7324
7949
|
])),
|
|
7325
|
-
(
|
|
7950
|
+
(mi = new Set([
|
|
7326
7951
|
'quality',
|
|
7327
7952
|
'bitrate_mode',
|
|
7328
7953
|
'draft',
|
|
@@ -7330,12 +7955,12 @@ var Lr,
|
|
|
7330
7955
|
'draft_task_id',
|
|
7331
7956
|
'draft_generation_id',
|
|
7332
7957
|
])),
|
|
7333
|
-
(
|
|
7958
|
+
(fi = {
|
|
7334
7959
|
images: 'up to 10',
|
|
7335
7960
|
videos: 'up to 5; combined duration < 30s',
|
|
7336
7961
|
audios: 'up to 5; combined duration < 30s',
|
|
7337
7962
|
}));
|
|
7338
|
-
((
|
|
7963
|
+
((bi = [
|
|
7339
7964
|
M('The user message or task.'),
|
|
7340
7965
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7341
7966
|
{
|
|
@@ -7353,7 +7978,7 @@ var Lr,
|
|
|
7353
7978
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
7354
7979
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
7355
7980
|
]),
|
|
7356
|
-
(
|
|
7981
|
+
(ki = [
|
|
7357
7982
|
M('The user message or task.'),
|
|
7358
7983
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
7359
7984
|
{
|
|
@@ -7435,8 +8060,8 @@ var Lr,
|
|
|
7435
8060
|
description: 'Video frames read a second.',
|
|
7436
8061
|
},
|
|
7437
8062
|
]),
|
|
7438
|
-
(
|
|
7439
|
-
|
|
8063
|
+
(wi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
8064
|
+
Ii = Object.entries({
|
|
7440
8065
|
background: !1,
|
|
7441
8066
|
skin: !1,
|
|
7442
8067
|
nose: !1,
|
|
@@ -7462,8 +8087,8 @@ var Lr,
|
|
|
7462
8087
|
default: t,
|
|
7463
8088
|
description: 'Keep this part out of the fix. Standard only.',
|
|
7464
8089
|
}));
|
|
7465
|
-
((
|
|
7466
|
-
(
|
|
8090
|
+
((X = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
8091
|
+
(Be = [
|
|
7467
8092
|
{
|
|
7468
8093
|
name: 'prompt',
|
|
7469
8094
|
type: 'string',
|
|
@@ -7501,7 +8126,7 @@ var Lr,
|
|
|
7501
8126
|
type: 'select',
|
|
7502
8127
|
default: '480p',
|
|
7503
8128
|
options: ['480p', '720p', '1080p', '4k'],
|
|
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. ${
|
|
8129
|
+
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. ${X}`,
|
|
7505
8130
|
},
|
|
7506
8131
|
{
|
|
7507
8132
|
name: 'aspect_ratio',
|
|
@@ -7612,19 +8237,19 @@ var Lr,
|
|
|
7612
8237
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7613
8238
|
},
|
|
7614
8239
|
]),
|
|
7615
|
-
(
|
|
8240
|
+
(Xt = {
|
|
7616
8241
|
name: 'images',
|
|
7617
8242
|
type: 'string[]',
|
|
7618
8243
|
description:
|
|
7619
8244
|
'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.',
|
|
7620
8245
|
}),
|
|
7621
|
-
(
|
|
8246
|
+
(Qt = {
|
|
7622
8247
|
name: 'audios',
|
|
7623
8248
|
type: 'string[]',
|
|
7624
8249
|
description:
|
|
7625
8250
|
'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.',
|
|
7626
8251
|
}),
|
|
7627
|
-
(
|
|
8252
|
+
(jt = [
|
|
7628
8253
|
{
|
|
7629
8254
|
name: 'prompt',
|
|
7630
8255
|
type: 'string',
|
|
@@ -7668,7 +8293,7 @@ var Lr,
|
|
|
7668
8293
|
type: 'select',
|
|
7669
8294
|
default: '480p',
|
|
7670
8295
|
options: ['480p', '720p', '1080p', '4k'],
|
|
7671
|
-
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${
|
|
8296
|
+
description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${X}`,
|
|
7672
8297
|
},
|
|
7673
8298
|
{
|
|
7674
8299
|
name: 'bitrate_mode',
|
|
@@ -7702,8 +8327,8 @@ var Lr,
|
|
|
7702
8327
|
description:
|
|
7703
8328
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7704
8329
|
},
|
|
7705
|
-
|
|
7706
|
-
|
|
8330
|
+
Xt,
|
|
8331
|
+
Qt,
|
|
7707
8332
|
{
|
|
7708
8333
|
name: 'first_frame_image',
|
|
7709
8334
|
type: 'string',
|
|
@@ -7724,7 +8349,7 @@ var Lr,
|
|
|
7724
8349
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7725
8350
|
},
|
|
7726
8351
|
]),
|
|
7727
|
-
(
|
|
8352
|
+
(Ki = [
|
|
7728
8353
|
{
|
|
7729
8354
|
name: 'prompt',
|
|
7730
8355
|
type: 'string',
|
|
@@ -7745,7 +8370,7 @@ var Lr,
|
|
|
7745
8370
|
type: 'select',
|
|
7746
8371
|
default: '480p',
|
|
7747
8372
|
options: ['480p', '720p'],
|
|
7748
|
-
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${
|
|
8373
|
+
description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${X}`,
|
|
7749
8374
|
},
|
|
7750
8375
|
{
|
|
7751
8376
|
name: 'bitrate_mode',
|
|
@@ -7779,8 +8404,8 @@ var Lr,
|
|
|
7779
8404
|
description:
|
|
7780
8405
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
7781
8406
|
},
|
|
7782
|
-
|
|
7783
|
-
|
|
8407
|
+
Xt,
|
|
8408
|
+
Qt,
|
|
7784
8409
|
{
|
|
7785
8410
|
name: 'first_frame_image',
|
|
7786
8411
|
type: 'string',
|
|
@@ -7795,53 +8420,53 @@ var Lr,
|
|
|
7795
8420
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7796
8421
|
},
|
|
7797
8422
|
]));
|
|
7798
|
-
|
|
7799
|
-
|
|
8423
|
+
ye = Ei();
|
|
8424
|
+
$i = ['draft_task_id', 'draft_generation_id'];
|
|
7800
8425
|
});
|
|
7801
|
-
function
|
|
8426
|
+
function ke(e) {
|
|
7802
8427
|
let t = '/v1/pricing/models',
|
|
7803
8428
|
r = e?.trim();
|
|
7804
8429
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7805
8430
|
}
|
|
7806
|
-
var
|
|
8431
|
+
var Ye = y(() => {
|
|
7807
8432
|
'use strict';
|
|
7808
8433
|
});
|
|
7809
|
-
function
|
|
8434
|
+
function dr(e) {
|
|
7810
8435
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
7811
8436
|
}
|
|
7812
|
-
function
|
|
7813
|
-
let t =
|
|
7814
|
-
r = t.filter((s) =>
|
|
7815
|
-
|
|
8437
|
+
function cr(e) {
|
|
8438
|
+
let t = de().filter((s) => s.kind === e && s.unfiltered != null),
|
|
8439
|
+
r = t.filter((s) => W.includes(s.api.model)).map((s) => s.name),
|
|
8440
|
+
i = t.filter((s) => !W.includes(s.api.model)).map((s) => s.name);
|
|
7816
8441
|
return [
|
|
7817
8442
|
...(r.length
|
|
7818
|
-
? [`${
|
|
8443
|
+
? [`${dr(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
7819
8444
|
: []),
|
|
7820
|
-
...(
|
|
8445
|
+
...(i.length ? [`Not available yet on ${dr(i)}: ${ge}.`] : []),
|
|
7821
8446
|
'The Acceptable Use Policy applies.',
|
|
7822
8447
|
].join(' ');
|
|
7823
8448
|
}
|
|
7824
|
-
function
|
|
7825
|
-
if (
|
|
8449
|
+
function ra(e) {
|
|
8450
|
+
if (ea.has(e.name)) return e;
|
|
7826
8451
|
let t = e.inputSchema.properties;
|
|
7827
8452
|
return !t || t.callback_url
|
|
7828
8453
|
? e
|
|
7829
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
8454
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: Zi } } };
|
|
7830
8455
|
}
|
|
7831
|
-
function
|
|
8456
|
+
function ia(e) {
|
|
7832
8457
|
let t = e.inputSchema.properties;
|
|
7833
8458
|
if (!t) return e;
|
|
7834
8459
|
let r = !1,
|
|
7835
|
-
|
|
8460
|
+
i = {};
|
|
7836
8461
|
for (let [n, s] of Object.entries(t))
|
|
7837
|
-
|
|
7838
|
-
? ((
|
|
7839
|
-
:
|
|
7840
|
-
? ((
|
|
7841
|
-
: (
|
|
7842
|
-
return r ? { ...e, inputSchema: { ...e.inputSchema, properties:
|
|
8462
|
+
ur.has(n) && s.type === 'string' && !s.format
|
|
8463
|
+
? ((i[n] = { ...s, format: 'uri' }), (r = !0))
|
|
8464
|
+
: ur.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
8465
|
+
? ((i[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
|
|
8466
|
+
: (i[n] = s);
|
|
8467
|
+
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
|
|
7843
8468
|
}
|
|
7844
|
-
function
|
|
8469
|
+
function aa(e) {
|
|
7845
8470
|
switch (e.type) {
|
|
7846
8471
|
case 'string':
|
|
7847
8472
|
return {
|
|
@@ -7896,14 +8521,14 @@ function Oa(e) {
|
|
|
7896
8521
|
return { type: 'string', description: e.description };
|
|
7897
8522
|
}
|
|
7898
8523
|
}
|
|
7899
|
-
function
|
|
8524
|
+
function na(e, t) {
|
|
7900
8525
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7901
|
-
|
|
8526
|
+
i = {},
|
|
7902
8527
|
n = [];
|
|
7903
|
-
for (let o of e.parameters) ((
|
|
8528
|
+
for (let o of e.parameters) ((i[o.name] = aa(o)), o.required && n.push(o.name));
|
|
7904
8529
|
let s = {
|
|
7905
8530
|
type: 'object',
|
|
7906
|
-
properties:
|
|
8531
|
+
properties: i,
|
|
7907
8532
|
...(n.length > 0 ? { required: n } : {}),
|
|
7908
8533
|
additionalProperties: !0,
|
|
7909
8534
|
};
|
|
@@ -7913,11 +8538,11 @@ function Da(e, t) {
|
|
|
7913
8538
|
inputSchema: s,
|
|
7914
8539
|
};
|
|
7915
8540
|
}
|
|
7916
|
-
function
|
|
7917
|
-
let e =
|
|
7918
|
-
t =
|
|
7919
|
-
r =
|
|
7920
|
-
|
|
8541
|
+
function sa() {
|
|
8542
|
+
let e = D().filter((d) => d.category === 'Image' && !be(d)),
|
|
8543
|
+
t = D().filter((d) => d.category === 'Video'),
|
|
8544
|
+
r = D().filter((d) => d.category === 'Text'),
|
|
8545
|
+
i = D().filter((d) => d.category === 'Audio'),
|
|
7921
8546
|
n = {
|
|
7922
8547
|
name: 'generate_image',
|
|
7923
8548
|
description:
|
|
@@ -8009,7 +8634,7 @@ function La() {
|
|
|
8009
8634
|
maximum: 2147483647,
|
|
8010
8635
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
8011
8636
|
},
|
|
8012
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8637
|
+
creative_mode: { type: 'boolean', default: !1, description: cr('image') },
|
|
8013
8638
|
},
|
|
8014
8639
|
required: ['prompt'],
|
|
8015
8640
|
additionalProperties: !0,
|
|
@@ -8046,7 +8671,7 @@ function La() {
|
|
|
8046
8671
|
default: '480p',
|
|
8047
8672
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
8048
8673
|
},
|
|
8049
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
8674
|
+
creative_mode: { type: 'boolean', default: !1, description: cr('video') },
|
|
8050
8675
|
priority: {
|
|
8051
8676
|
type: 'boolean',
|
|
8052
8677
|
default: !1,
|
|
@@ -8184,10 +8809,10 @@ function La() {
|
|
|
8184
8809
|
additionalProperties: !0,
|
|
8185
8810
|
},
|
|
8186
8811
|
},
|
|
8187
|
-
p =
|
|
8188
|
-
return [n, s, o, u, l, p, c,
|
|
8812
|
+
p = oa();
|
|
8813
|
+
return [n, s, o, u, l, p, c, ta];
|
|
8189
8814
|
}
|
|
8190
|
-
function
|
|
8815
|
+
function oa() {
|
|
8191
8816
|
return {
|
|
8192
8817
|
name: 'upload_asset',
|
|
8193
8818
|
description:
|
|
@@ -8234,26 +8859,26 @@ function Na() {
|
|
|
8234
8859
|
},
|
|
8235
8860
|
};
|
|
8236
8861
|
}
|
|
8237
|
-
function
|
|
8238
|
-
let e =
|
|
8239
|
-
t =
|
|
8240
|
-
return [...e, ...t].map(
|
|
8862
|
+
function rt() {
|
|
8863
|
+
let e = sa(),
|
|
8864
|
+
t = D().map((r) => na(r));
|
|
8865
|
+
return [...e, ...t].map(ra).map(ia);
|
|
8241
8866
|
}
|
|
8242
|
-
var
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8867
|
+
var Zi,
|
|
8868
|
+
ea,
|
|
8869
|
+
ta,
|
|
8870
|
+
ur,
|
|
8871
|
+
mr = y(() => {
|
|
8247
8872
|
'use strict';
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
((
|
|
8873
|
+
B();
|
|
8874
|
+
Ve();
|
|
8875
|
+
Q();
|
|
8876
|
+
((Zi = {
|
|
8252
8877
|
type: 'string',
|
|
8253
8878
|
description:
|
|
8254
8879
|
'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.',
|
|
8255
8880
|
}),
|
|
8256
|
-
(
|
|
8881
|
+
(ea = new Set([
|
|
8257
8882
|
'upload_asset',
|
|
8258
8883
|
'upload_media',
|
|
8259
8884
|
'upload_image',
|
|
@@ -8261,7 +8886,7 @@ var qa,
|
|
|
8261
8886
|
'check_status',
|
|
8262
8887
|
'get_pricing',
|
|
8263
8888
|
])),
|
|
8264
|
-
(
|
|
8889
|
+
(ta = {
|
|
8265
8890
|
name: 'get_pricing',
|
|
8266
8891
|
description:
|
|
8267
8892
|
'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.',
|
|
@@ -8276,7 +8901,7 @@ var qa,
|
|
|
8276
8901
|
additionalProperties: !1,
|
|
8277
8902
|
},
|
|
8278
8903
|
}));
|
|
8279
|
-
|
|
8904
|
+
ur = new Set([
|
|
8280
8905
|
'image',
|
|
8281
8906
|
'images',
|
|
8282
8907
|
'image_url',
|
|
@@ -8293,28 +8918,28 @@ var qa,
|
|
|
8293
8918
|
'lipsyncing_audio',
|
|
8294
8919
|
]);
|
|
8295
8920
|
});
|
|
8296
|
-
var
|
|
8297
|
-
|
|
8298
|
-
forgetToolSchemas: () =>
|
|
8299
|
-
jsonRpcAnswer: () =>
|
|
8300
|
-
preprocessLocalFiles: () =>
|
|
8301
|
-
startStdioServer: () =>
|
|
8921
|
+
var Pr = {};
|
|
8922
|
+
Cr(Pr, {
|
|
8923
|
+
forgetToolSchemas: () => ua,
|
|
8924
|
+
jsonRpcAnswer: () => yr,
|
|
8925
|
+
preprocessLocalFiles: () => xr,
|
|
8926
|
+
startStdioServer: () => _r,
|
|
8302
8927
|
});
|
|
8303
|
-
function
|
|
8928
|
+
function la(e) {
|
|
8304
8929
|
let t = (r) =>
|
|
8305
8930
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
8306
8931
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
8307
8932
|
}
|
|
8308
|
-
function
|
|
8309
|
-
let
|
|
8310
|
-
n =
|
|
8933
|
+
function yr(e, t, r) {
|
|
8934
|
+
let i = e?.id,
|
|
8935
|
+
n = i == null,
|
|
8311
8936
|
s = null;
|
|
8312
8937
|
try {
|
|
8313
8938
|
s = r ? JSON.parse(r) : null;
|
|
8314
8939
|
} catch {
|
|
8315
8940
|
s = null;
|
|
8316
8941
|
}
|
|
8317
|
-
if (s !== null &&
|
|
8942
|
+
if (s !== null && la(s)) return n ? null : s;
|
|
8318
8943
|
if (n) return null;
|
|
8319
8944
|
if (!r && t >= 200 && t < 300) return;
|
|
8320
8945
|
let o = s?.error,
|
|
@@ -8327,7 +8952,7 @@ function sr(e, t, r) {
|
|
|
8327
8952
|
l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
|
|
8328
8953
|
return {
|
|
8329
8954
|
jsonrpc: '2.0',
|
|
8330
|
-
id:
|
|
8955
|
+
id: i,
|
|
8331
8956
|
error: {
|
|
8332
8957
|
code: t === 401 ? -32001 : -32603,
|
|
8333
8958
|
message: u,
|
|
@@ -8335,16 +8960,16 @@ function sr(e, t, r) {
|
|
|
8335
8960
|
},
|
|
8336
8961
|
};
|
|
8337
8962
|
}
|
|
8338
|
-
function
|
|
8963
|
+
function pa() {
|
|
8339
8964
|
let e = process.argv.slice(2),
|
|
8340
8965
|
t = e.indexOf('--api-key');
|
|
8341
8966
|
return E(t >= 0 ? e[t + 1] : void 0);
|
|
8342
8967
|
}
|
|
8343
|
-
async function
|
|
8344
|
-
let
|
|
8345
|
-
if (!
|
|
8968
|
+
async function br(e, t, r) {
|
|
8969
|
+
let i = G.default.resolve(e);
|
|
8970
|
+
if (!L.default.existsSync(i) || !L.default.statSync(i).isFile())
|
|
8346
8971
|
throw new Error(`File not found: ${e}`);
|
|
8347
|
-
let n =
|
|
8972
|
+
let n = L.default.readFileSync(i),
|
|
8348
8973
|
s = n.toString('base64'),
|
|
8349
8974
|
o = n.length,
|
|
8350
8975
|
u = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
@@ -8369,15 +8994,15 @@ async function or(e, t, r) {
|
|
|
8369
8994
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
8370
8995
|
};
|
|
8371
8996
|
}
|
|
8372
|
-
function
|
|
8373
|
-
return
|
|
8997
|
+
function kr(e) {
|
|
8998
|
+
return da.has(G.default.extname(e).toLowerCase());
|
|
8374
8999
|
}
|
|
8375
|
-
function
|
|
9000
|
+
function wr(e) {
|
|
8376
9001
|
return new Error(
|
|
8377
|
-
`Tein uploads image, video and audio files only, and ${
|
|
9002
|
+
`Tein uploads image, video and audio files only, and ${G.default.basename(e)} is not one.`,
|
|
8378
9003
|
);
|
|
8379
9004
|
}
|
|
8380
|
-
function
|
|
9005
|
+
function ca(e) {
|
|
8381
9006
|
let t = e.trim();
|
|
8382
9007
|
if (
|
|
8383
9008
|
!t ||
|
|
@@ -8387,27 +9012,27 @@ function Ba(e) {
|
|
|
8387
9012
|
`)
|
|
8388
9013
|
)
|
|
8389
9014
|
return null;
|
|
8390
|
-
let r =
|
|
8391
|
-
return
|
|
9015
|
+
let r = G.default.resolve(t);
|
|
9016
|
+
return L.default.existsSync(r) && L.default.statSync(r).isFile() ? r : null;
|
|
8392
9017
|
}
|
|
8393
|
-
function
|
|
9018
|
+
function at(e) {
|
|
8394
9019
|
if (Array.isArray(e))
|
|
8395
9020
|
for (let t of e) {
|
|
8396
9021
|
let r = t;
|
|
8397
9022
|
typeof r.name == 'string' &&
|
|
8398
9023
|
r.inputSchema &&
|
|
8399
9024
|
typeof r.inputSchema == 'object' &&
|
|
8400
|
-
|
|
9025
|
+
te.set(r.name, r.inputSchema);
|
|
8401
9026
|
}
|
|
8402
9027
|
}
|
|
8403
|
-
function
|
|
8404
|
-
(
|
|
9028
|
+
function ua() {
|
|
9029
|
+
(te.clear(), (it = 0));
|
|
8405
9030
|
}
|
|
8406
|
-
async function
|
|
8407
|
-
if (!(Date.now() -
|
|
8408
|
-
|
|
9031
|
+
async function ma(e, t) {
|
|
9032
|
+
if (!(Date.now() - it < 6e4)) {
|
|
9033
|
+
it = Date.now();
|
|
8409
9034
|
try {
|
|
8410
|
-
let
|
|
9035
|
+
let i = await (
|
|
8411
9036
|
await fetch(e, {
|
|
8412
9037
|
method: 'POST',
|
|
8413
9038
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
@@ -8415,39 +9040,39 @@ async function Ga(e, t) {
|
|
|
8415
9040
|
signal: AbortSignal.timeout(1e4),
|
|
8416
9041
|
})
|
|
8417
9042
|
).json();
|
|
8418
|
-
|
|
9043
|
+
at(i.result?.tools);
|
|
8419
9044
|
} catch {}
|
|
8420
9045
|
}
|
|
8421
9046
|
}
|
|
8422
|
-
function
|
|
9047
|
+
function fa(e) {
|
|
8423
9048
|
return e
|
|
8424
9049
|
? e.type === 'string'
|
|
8425
9050
|
? e.format === 'uri'
|
|
8426
9051
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
8427
9052
|
: !1;
|
|
8428
9053
|
}
|
|
8429
|
-
async function
|
|
9054
|
+
async function fr(e, t, r) {
|
|
8430
9055
|
if (typeof e != 'string') return e;
|
|
8431
|
-
let
|
|
8432
|
-
if (!
|
|
8433
|
-
if (!
|
|
8434
|
-
return (await
|
|
9056
|
+
let i = ca(e);
|
|
9057
|
+
if (!i) return e;
|
|
9058
|
+
if (!kr(i)) throw wr(i);
|
|
9059
|
+
return (await br(i, t, r)).url;
|
|
8435
9060
|
}
|
|
8436
|
-
async function
|
|
8437
|
-
(
|
|
8438
|
-
let s =
|
|
9061
|
+
async function xr(e, t, r, i, n) {
|
|
9062
|
+
(te.size === 0 && at(rt()), te.has(e) || (await ma(n, r)));
|
|
9063
|
+
let s = te.get(e)?.properties;
|
|
8439
9064
|
if (!s) return t;
|
|
8440
9065
|
let o = { ...t };
|
|
8441
9066
|
for (let [u, l] of Object.entries(t))
|
|
8442
|
-
if (
|
|
9067
|
+
if (fa(s[u]))
|
|
8443
9068
|
if (Array.isArray(l)) {
|
|
8444
9069
|
let c = [];
|
|
8445
|
-
for (let p of l) c.push(await
|
|
9070
|
+
for (let p of l) c.push(await fr(p, r, i));
|
|
8446
9071
|
o[u] = c;
|
|
8447
|
-
} else o[u] = await
|
|
9072
|
+
} else o[u] = await fr(l, r, i);
|
|
8448
9073
|
return o;
|
|
8449
9074
|
}
|
|
8450
|
-
function
|
|
9075
|
+
function ga(e) {
|
|
8451
9076
|
let t = e.id ?? null;
|
|
8452
9077
|
switch (e.method) {
|
|
8453
9078
|
case 'initialize':
|
|
@@ -8465,7 +9090,7 @@ function za(e) {
|
|
|
8465
9090
|
case 'ping':
|
|
8466
9091
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
8467
9092
|
case 'tools/list':
|
|
8468
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
9093
|
+
return { jsonrpc: '2.0', id: t, result: { tools: rt() } };
|
|
8469
9094
|
case 'tools/call':
|
|
8470
9095
|
return {
|
|
8471
9096
|
jsonrpc: '2.0',
|
|
@@ -8488,13 +9113,13 @@ function za(e) {
|
|
|
8488
9113
|
};
|
|
8489
9114
|
}
|
|
8490
9115
|
}
|
|
8491
|
-
async function
|
|
8492
|
-
if (
|
|
8493
|
-
|
|
8494
|
-
let e =
|
|
8495
|
-
t =
|
|
9116
|
+
async function _r() {
|
|
9117
|
+
if (gr) return;
|
|
9118
|
+
gr = !0;
|
|
9119
|
+
let e = pa(),
|
|
9120
|
+
t = P(),
|
|
8496
9121
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
8497
|
-
(
|
|
9122
|
+
(hr.default
|
|
8498
9123
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
8499
9124
|
.on('line', async (n) => {
|
|
8500
9125
|
let s = n.trim();
|
|
@@ -8506,7 +9131,7 @@ async function cr() {
|
|
|
8506
9131
|
c = o.params.arguments || {};
|
|
8507
9132
|
if (l === 'get_pricing') {
|
|
8508
9133
|
let p = typeof c.model == 'string' ? c.model.trim() : '',
|
|
8509
|
-
d = `${t.replace(/\/+$/, '')}${
|
|
9134
|
+
d = `${t.replace(/\/+$/, '')}${ke(p)}`;
|
|
8510
9135
|
try {
|
|
8511
9136
|
let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
|
|
8512
9137
|
h = await m.text();
|
|
@@ -8553,19 +9178,19 @@ async function cr() {
|
|
|
8553
9178
|
!p.startsWith('data:')
|
|
8554
9179
|
)
|
|
8555
9180
|
try {
|
|
8556
|
-
let d =
|
|
8557
|
-
if (
|
|
8558
|
-
if (!
|
|
8559
|
-
let m = await
|
|
9181
|
+
let d = G.default.resolve(p.trim());
|
|
9182
|
+
if (L.default.existsSync(d) && L.default.statSync(d).isFile() && e) {
|
|
9183
|
+
if (!kr(d)) throw wr(d);
|
|
9184
|
+
let m = await br(d, e, t),
|
|
8560
9185
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
8561
|
-
|
|
9186
|
+
we =
|
|
8562
9187
|
m.mimeType.startsWith('image/') ||
|
|
8563
9188
|
/\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
|
|
8564
9189
|
? `
|
|
8565
9190
|
|
|
8566
9191
|
`
|
|
8567
9192
|
: '',
|
|
8568
|
-
|
|
9193
|
+
xe = {
|
|
8569
9194
|
jsonrpc: '2.0',
|
|
8570
9195
|
id: o.id,
|
|
8571
9196
|
result: {
|
|
@@ -8576,7 +9201,7 @@ async function cr() {
|
|
|
8576
9201
|
|
|
8577
9202
|
- **URL:** ${m.url}
|
|
8578
9203
|
- **Type:** \`${m.mimeType}\`
|
|
8579
|
-
- **Size:** ${h} KB${
|
|
9204
|
+
- **Size:** ${h} KB${we}
|
|
8580
9205
|
|
|
8581
9206
|
Pass this URL to any Tein generation tool.`,
|
|
8582
9207
|
},
|
|
@@ -8585,7 +9210,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8585
9210
|
},
|
|
8586
9211
|
};
|
|
8587
9212
|
process.stdout.write(
|
|
8588
|
-
JSON.stringify(
|
|
9213
|
+
JSON.stringify(xe) +
|
|
8589
9214
|
`
|
|
8590
9215
|
`,
|
|
8591
9216
|
);
|
|
@@ -8612,7 +9237,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8612
9237
|
}
|
|
8613
9238
|
if (e)
|
|
8614
9239
|
try {
|
|
8615
|
-
o.params.arguments = await
|
|
9240
|
+
o.params.arguments = await xr(String(l), c, e, t, r);
|
|
8616
9241
|
} catch (p) {
|
|
8617
9242
|
let d = p instanceof Error ? p.message : String(p);
|
|
8618
9243
|
process.stdout.write(
|
|
@@ -8643,10 +9268,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8643
9268
|
body: JSON.stringify(o),
|
|
8644
9269
|
}),
|
|
8645
9270
|
c = await l.text(),
|
|
8646
|
-
p =
|
|
9271
|
+
p = yr(o, l.status, c);
|
|
8647
9272
|
if (p === null) return;
|
|
8648
9273
|
if (p) {
|
|
8649
|
-
(o?.method === 'tools/list' &&
|
|
9274
|
+
(o?.method === 'tools/list' && at(p.result?.tools),
|
|
8650
9275
|
process.stdout.write(
|
|
8651
9276
|
JSON.stringify(p) +
|
|
8652
9277
|
`
|
|
@@ -8655,7 +9280,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8655
9280
|
return;
|
|
8656
9281
|
}
|
|
8657
9282
|
} catch {}
|
|
8658
|
-
let u =
|
|
9283
|
+
let u = ga(o);
|
|
8659
9284
|
u !== null &&
|
|
8660
9285
|
process.stdout.write(
|
|
8661
9286
|
JSON.stringify(u) +
|
|
@@ -8678,22 +9303,22 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8678
9303
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
8679
9304
|
`));
|
|
8680
9305
|
}
|
|
8681
|
-
var
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
9306
|
+
var L,
|
|
9307
|
+
G,
|
|
9308
|
+
hr,
|
|
9309
|
+
da,
|
|
9310
|
+
te,
|
|
9311
|
+
it,
|
|
9312
|
+
gr,
|
|
9313
|
+
Ir = y(() => {
|
|
8689
9314
|
'use strict';
|
|
8690
|
-
((
|
|
8691
|
-
(
|
|
8692
|
-
(
|
|
8693
|
-
|
|
8694
|
-
|
|
9315
|
+
((L = I(require('node:fs'))),
|
|
9316
|
+
(G = I(require('node:path'))),
|
|
9317
|
+
(hr = I(require('node:readline'))));
|
|
9318
|
+
Ye();
|
|
9319
|
+
mr();
|
|
8695
9320
|
A();
|
|
8696
|
-
|
|
9321
|
+
da = new Set([
|
|
8697
9322
|
'.png',
|
|
8698
9323
|
'.jpg',
|
|
8699
9324
|
'.jpeg',
|
|
@@ -8719,22 +9344,22 @@ var D,
|
|
|
8719
9344
|
'.flac',
|
|
8720
9345
|
'.opus',
|
|
8721
9346
|
]);
|
|
8722
|
-
((
|
|
8723
|
-
|
|
9347
|
+
((te = new Map()), (it = 0));
|
|
9348
|
+
gr = !1;
|
|
8724
9349
|
require.main === module &&
|
|
8725
|
-
|
|
9350
|
+
_r().catch((e) => {
|
|
8726
9351
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
8727
9352
|
`),
|
|
8728
9353
|
process.exit(1));
|
|
8729
9354
|
});
|
|
8730
9355
|
});
|
|
8731
|
-
var
|
|
9356
|
+
var qr =
|
|
8732
9357
|
!process.env.NO_COLOR &&
|
|
8733
9358
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
8734
9359
|
function k(e, t) {
|
|
8735
|
-
return (r) => (
|
|
9360
|
+
return (r) => (qr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
8736
9361
|
}
|
|
8737
|
-
var
|
|
9362
|
+
var a = {
|
|
8738
9363
|
bold: k(1, 22),
|
|
8739
9364
|
dim: k(2, 22),
|
|
8740
9365
|
italic: k(3, 23),
|
|
@@ -8778,7 +9403,7 @@ var i = {
|
|
|
8778
9403
|
process.stdout.isTTY
|
|
8779
9404
|
? (this.stop(),
|
|
8780
9405
|
(this.timer = setInterval(() => {
|
|
8781
|
-
let r =
|
|
9406
|
+
let r = a.cyan(this.frames[this.current]);
|
|
8782
9407
|
(process.stdout.write(`\r${r} ${this.text} `),
|
|
8783
9408
|
(this.current = (this.current + 1) % this.frames.length));
|
|
8784
9409
|
}, 80)),
|
|
@@ -8795,7 +9420,7 @@ var i = {
|
|
|
8795
9420
|
this.stop();
|
|
8796
9421
|
let r = t || this.text;
|
|
8797
9422
|
process.stdout.isTTY
|
|
8798
|
-
? process.stdout.write(`\r${
|
|
9423
|
+
? process.stdout.write(`\r${a.green('\u2713')} ${r}
|
|
8799
9424
|
`)
|
|
8800
9425
|
: process.stdout.write(`[\u2713] ${r}
|
|
8801
9426
|
`);
|
|
@@ -8804,7 +9429,7 @@ var i = {
|
|
|
8804
9429
|
this.stop();
|
|
8805
9430
|
let r = t || this.text;
|
|
8806
9431
|
process.stdout.isTTY
|
|
8807
|
-
? process.stdout.write(`\r${
|
|
9432
|
+
? process.stdout.write(`\r${a.red('\u2717')} ${r}
|
|
8808
9433
|
`)
|
|
8809
9434
|
: process.stdout.write(`[\u2717] ${r}
|
|
8810
9435
|
`);
|
|
@@ -8816,13 +9441,13 @@ var i = {
|
|
|
8816
9441
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
8817
9442
|
}
|
|
8818
9443
|
};
|
|
8819
|
-
var N =
|
|
8820
|
-
|
|
8821
|
-
var
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
var
|
|
8825
|
-
var
|
|
9444
|
+
var N = I(require('node:fs')),
|
|
9445
|
+
C = I(require('node:path'));
|
|
9446
|
+
var ie = I(require('node:fs')),
|
|
9447
|
+
lt = I(require('node:path')),
|
|
9448
|
+
pt = require('node:stream/promises');
|
|
9449
|
+
var re = '1.1.7';
|
|
9450
|
+
var Ar = new Set([
|
|
8826
9451
|
'account_suspended',
|
|
8827
9452
|
'account_terminated',
|
|
8828
9453
|
'creative_mode_restricted',
|
|
@@ -8830,59 +9455,59 @@ var Ir = new Set([
|
|
|
8830
9455
|
'workspace_paused',
|
|
8831
9456
|
]),
|
|
8832
9457
|
v = 1,
|
|
8833
|
-
|
|
9458
|
+
Or = 3,
|
|
8834
9459
|
w = class extends Error {
|
|
8835
|
-
constructor(t, r,
|
|
9460
|
+
constructor(t, r, i, n = {}) {
|
|
8836
9461
|
(super(r),
|
|
8837
9462
|
(this.name = 'TeinApiError'),
|
|
8838
9463
|
(this.status = t),
|
|
8839
|
-
|
|
9464
|
+
i && (this.code = i),
|
|
8840
9465
|
(this.fields = n));
|
|
8841
9466
|
}
|
|
8842
9467
|
get exitCode() {
|
|
8843
|
-
return this.code &&
|
|
9468
|
+
return this.code && Ar.has(this.code) ? Or : v;
|
|
8844
9469
|
}
|
|
8845
9470
|
};
|
|
8846
|
-
function
|
|
8847
|
-
let
|
|
8848
|
-
if (!r || typeof r != 'object') return new w(e,
|
|
9471
|
+
function Rr(e, t, r) {
|
|
9472
|
+
let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
9473
|
+
if (!r || typeof r != 'object') return new w(e, i);
|
|
8849
9474
|
let n = r;
|
|
8850
9475
|
if (n.error && typeof n.error == 'object' && !Array.isArray(n.error)) {
|
|
8851
9476
|
let p = n.error,
|
|
8852
9477
|
{ code: d, message: m, ...h } = p;
|
|
8853
|
-
return new w(e, typeof m == 'string' && m ? m :
|
|
9478
|
+
return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
|
|
8854
9479
|
}
|
|
8855
9480
|
let { error: s, code: o, message: u, ...l } = n,
|
|
8856
|
-
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) ||
|
|
9481
|
+
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || i;
|
|
8857
9482
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8858
9483
|
}
|
|
8859
|
-
function
|
|
9484
|
+
function st(e) {
|
|
8860
9485
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8861
9486
|
}
|
|
8862
9487
|
function S(e) {
|
|
8863
9488
|
let t = [e.message],
|
|
8864
|
-
r =
|
|
8865
|
-
|
|
8866
|
-
(r ||
|
|
8867
|
-
t.push([r ? `Required: ${r}` : '',
|
|
9489
|
+
r = st(e.fields.required),
|
|
9490
|
+
i = st(e.fields.balance);
|
|
9491
|
+
(r || i) &&
|
|
9492
|
+
t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
|
|
8868
9493
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
8869
9494
|
typeof n == 'string' && n && t.push(`Workspace: ${n}`);
|
|
8870
9495
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8871
9496
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
8872
9497
|
}
|
|
8873
|
-
function
|
|
9498
|
+
function Dr(e) {
|
|
8874
9499
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
8875
9500
|
? 'video'
|
|
8876
9501
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
8877
9502
|
? 'audio'
|
|
8878
9503
|
: 'image';
|
|
8879
9504
|
}
|
|
8880
|
-
function
|
|
9505
|
+
function ot(e) {
|
|
8881
9506
|
let t = [];
|
|
8882
9507
|
for (let r of e.data ?? [])
|
|
8883
9508
|
typeof r.message?.content == 'string'
|
|
8884
9509
|
? t.push({ type: 'text', text: r.message.content })
|
|
8885
|
-
: r.url && t.push({ type:
|
|
9510
|
+
: r.url && t.push({ type: Dr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
8886
9511
|
return t;
|
|
8887
9512
|
}
|
|
8888
9513
|
var K = class {
|
|
@@ -8893,22 +9518,22 @@ var K = class {
|
|
|
8893
9518
|
return {
|
|
8894
9519
|
'Content-Type': 'application/json',
|
|
8895
9520
|
Authorization: `Bearer ${this.apiKey}`,
|
|
8896
|
-
'User-Agent': `Tein-CLI/${
|
|
9521
|
+
'User-Agent': `Tein-CLI/${re}`,
|
|
8897
9522
|
'X-Tein-Client': 'cli',
|
|
8898
9523
|
};
|
|
8899
9524
|
}
|
|
8900
|
-
async send(t, r,
|
|
9525
|
+
async send(t, r, i) {
|
|
8901
9526
|
let n = await fetch(`${this.baseUrl}${r}`, {
|
|
8902
9527
|
method: t,
|
|
8903
9528
|
headers: this.getHeaders(),
|
|
8904
|
-
...(
|
|
9529
|
+
...(i === void 0 ? {} : { body: JSON.stringify(i) }),
|
|
8905
9530
|
});
|
|
8906
9531
|
if (!n.ok) {
|
|
8907
9532
|
let s = null;
|
|
8908
9533
|
try {
|
|
8909
9534
|
s = await n.json();
|
|
8910
9535
|
} catch {}
|
|
8911
|
-
throw
|
|
9536
|
+
throw Rr(n.status, n.statusText, s);
|
|
8912
9537
|
}
|
|
8913
9538
|
return await n.json();
|
|
8914
9539
|
}
|
|
@@ -8916,31 +9541,31 @@ var K = class {
|
|
|
8916
9541
|
await this.send('GET', '/v1/jobs?limit=1');
|
|
8917
9542
|
}
|
|
8918
9543
|
queueJob(t, r) {
|
|
8919
|
-
return this.send('POST', '/v1/generate', { model: t, ...r }).then((
|
|
8920
|
-
let n =
|
|
9544
|
+
return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
|
|
9545
|
+
let n = i.status,
|
|
8921
9546
|
s =
|
|
8922
9547
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
8923
9548
|
? n
|
|
8924
9549
|
: 'processing',
|
|
8925
|
-
o =
|
|
9550
|
+
o = ot(i);
|
|
8926
9551
|
return {
|
|
8927
|
-
request_id:
|
|
8928
|
-
model:
|
|
9552
|
+
request_id: i.request_id || i.id || '',
|
|
9553
|
+
model: i.model,
|
|
8929
9554
|
status: s,
|
|
8930
9555
|
...(o.length ? { output: o } : {}),
|
|
8931
|
-
error:
|
|
8932
|
-
...(
|
|
9556
|
+
error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
|
|
9557
|
+
...(i.usage ? { usage: i.usage } : {}),
|
|
8933
9558
|
};
|
|
8934
9559
|
});
|
|
8935
9560
|
}
|
|
8936
9561
|
getStatus(t) {
|
|
8937
9562
|
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
|
|
8938
|
-
let
|
|
9563
|
+
let i = r.status,
|
|
8939
9564
|
n =
|
|
8940
|
-
|
|
8941
|
-
?
|
|
9565
|
+
i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
|
|
9566
|
+
? i
|
|
8942
9567
|
: 'processing',
|
|
8943
|
-
s =
|
|
9568
|
+
s = ot(r),
|
|
8944
9569
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8945
9570
|
return {
|
|
8946
9571
|
request_id: r.id || t,
|
|
@@ -8956,65 +9581,65 @@ var K = class {
|
|
|
8956
9581
|
return this.send('POST', '/v1/upload', { data: t });
|
|
8957
9582
|
}
|
|
8958
9583
|
async downloadOutput(t, r) {
|
|
8959
|
-
let
|
|
8960
|
-
if (!
|
|
8961
|
-
let n =
|
|
8962
|
-
|
|
8963
|
-
let s =
|
|
8964
|
-
return (await (0,
|
|
9584
|
+
let i = await fetch(t);
|
|
9585
|
+
if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
|
|
9586
|
+
let n = lt.default.dirname(r);
|
|
9587
|
+
ie.default.existsSync(n) || ie.default.mkdirSync(n, { recursive: !0 });
|
|
9588
|
+
let s = ie.default.createWriteStream(r);
|
|
9589
|
+
return (await (0, pt.pipeline)(i.body, s), r);
|
|
8965
9590
|
}
|
|
8966
9591
|
};
|
|
8967
9592
|
A();
|
|
8968
|
-
function
|
|
9593
|
+
function Te(e) {
|
|
8969
9594
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
8970
9595
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
8971
9596
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
8972
9597
|
r = 10 ** t,
|
|
8973
|
-
|
|
8974
|
-
return
|
|
9598
|
+
i = Math.round(Number((e * r).toFixed(6))) / r;
|
|
9599
|
+
return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
|
|
8975
9600
|
}
|
|
8976
|
-
|
|
8977
|
-
var
|
|
8978
|
-
function
|
|
8979
|
-
for (let t of
|
|
9601
|
+
Q();
|
|
9602
|
+
var er = ['images', 'input_images', 'videos', 'audios'];
|
|
9603
|
+
function qi(e) {
|
|
9604
|
+
for (let t of er) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
8980
9605
|
}
|
|
8981
|
-
function
|
|
9606
|
+
function Ai(e) {
|
|
8982
9607
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8983
|
-
let t =
|
|
9608
|
+
let t = C.default.resolve(e);
|
|
8984
9609
|
return N.default.existsSync(t) && N.default.statSync(t).isFile() ? t : null;
|
|
8985
9610
|
}
|
|
8986
|
-
async function
|
|
8987
|
-
for (let r of
|
|
9611
|
+
async function Oi(e, t) {
|
|
9612
|
+
for (let r of er) {
|
|
8988
9613
|
if (!Array.isArray(e[r])) continue;
|
|
8989
|
-
let
|
|
9614
|
+
let i = [];
|
|
8990
9615
|
for (let n of e[r]) {
|
|
8991
9616
|
if (typeof n != 'string') continue;
|
|
8992
|
-
let s =
|
|
8993
|
-
|
|
9617
|
+
let s = Ai(n);
|
|
9618
|
+
i.push(s ? await t(s) : n);
|
|
8994
9619
|
}
|
|
8995
|
-
e[r] =
|
|
9620
|
+
e[r] = i;
|
|
8996
9621
|
}
|
|
8997
9622
|
}
|
|
8998
|
-
var
|
|
8999
|
-
function
|
|
9623
|
+
var Z = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
9624
|
+
function Ri(e) {
|
|
9000
9625
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
9001
9626
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
9002
|
-
r =
|
|
9627
|
+
r = Z.enterprise;
|
|
9003
9628
|
return (
|
|
9004
9629
|
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
9005
9630
|
(process.stderr
|
|
9006
|
-
.write(`${
|
|
9631
|
+
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Z.starter}, Plus ${Z.plus}, Scale ${Z.scale}, Enterprise ${Z.enterprise} at once, including polling.
|
|
9007
9632
|
`),
|
|
9008
9633
|
process.exit(1)),
|
|
9009
9634
|
t
|
|
9010
9635
|
);
|
|
9011
9636
|
}
|
|
9012
|
-
async function
|
|
9637
|
+
async function Di(e, t, r, i, n) {
|
|
9013
9638
|
n.isJson ||
|
|
9014
|
-
process.stderr.write(`Starting ${
|
|
9639
|
+
process.stderr.write(`Starting ${i} ${t} jobs together...
|
|
9015
9640
|
`);
|
|
9016
9641
|
let s = await Promise.all(
|
|
9017
|
-
Array.from({ length:
|
|
9642
|
+
Array.from({ length: i }, async () => {
|
|
9018
9643
|
try {
|
|
9019
9644
|
return { job: await e.queueJob(t, r) };
|
|
9020
9645
|
} catch (l) {
|
|
@@ -9039,7 +9664,7 @@ async function ga(e, t, r, a, n) {
|
|
|
9039
9664
|
for (; c.length;) {
|
|
9040
9665
|
if ((await new Promise((d) => setTimeout(d, 2e3)), !n.isJson)) {
|
|
9041
9666
|
let d = Math.round((Date.now() - l) / 1e3);
|
|
9042
|
-
process.stderr.write(`Waiting on ${c.length} of ${
|
|
9667
|
+
process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
|
|
9043
9668
|
`);
|
|
9044
9669
|
}
|
|
9045
9670
|
let p = await Promise.all(
|
|
@@ -9071,7 +9696,7 @@ async function ga(e, t, r, a, n) {
|
|
|
9071
9696
|
else {
|
|
9072
9697
|
for (let l of o)
|
|
9073
9698
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
9074
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
9699
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${Te(l.usage.cost)}`),
|
|
9075
9700
|
l.error && process.stdout.write(` ${l.error}`),
|
|
9076
9701
|
process.stdout.write(`
|
|
9077
9702
|
`));
|
|
@@ -9084,15 +9709,15 @@ async function ga(e, t, r, a, n) {
|
|
|
9084
9709
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
9085
9710
|
process.exit(v);
|
|
9086
9711
|
}
|
|
9087
|
-
function
|
|
9712
|
+
function Li(e, t, r) {
|
|
9088
9713
|
if (r <= 1) return e;
|
|
9089
|
-
let
|
|
9090
|
-
return `${e.slice(0, e.length -
|
|
9714
|
+
let i = C.default.extname(e);
|
|
9715
|
+
return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
|
|
9091
9716
|
}
|
|
9092
|
-
function
|
|
9717
|
+
function tr(e) {
|
|
9093
9718
|
let t = {},
|
|
9094
9719
|
r = new Set(),
|
|
9095
|
-
|
|
9720
|
+
i = [];
|
|
9096
9721
|
for (let n = 0; n < e.length; n++) {
|
|
9097
9722
|
let s = e[n];
|
|
9098
9723
|
if (s.startsWith('--')) {
|
|
@@ -9130,33 +9755,33 @@ function jt(e) {
|
|
|
9130
9755
|
: n + 1 < e.length && !e[n + 1].startsWith('-')
|
|
9131
9756
|
? ((t[l] = e[n + 1]), n++)
|
|
9132
9757
|
: (t[l] = !0);
|
|
9133
|
-
} else
|
|
9758
|
+
} else i.push(s);
|
|
9134
9759
|
}
|
|
9135
|
-
return { command:
|
|
9760
|
+
return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
|
|
9136
9761
|
}
|
|
9137
|
-
async function
|
|
9762
|
+
async function We(e, t) {
|
|
9138
9763
|
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9139
|
-
|
|
9764
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9140
9765
|
(r ||
|
|
9141
|
-
(process.stderr.write(`${
|
|
9766
|
+
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
9142
9767
|
`),
|
|
9143
9768
|
process.stderr
|
|
9144
|
-
.write(`Please run ${
|
|
9769
|
+
.write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
|
|
9145
9770
|
`),
|
|
9146
9771
|
process.exit(1)),
|
|
9147
9772
|
e ||
|
|
9148
|
-
(process.stderr.write(`${
|
|
9773
|
+
(process.stderr.write(`${a.red('Error:')} Missing model slug.
|
|
9149
9774
|
`),
|
|
9150
|
-
process.stderr.write(`Usage: ${
|
|
9775
|
+
process.stderr.write(`Usage: ${a.cyan('tein run <model-slug> --prompt "..."')}
|
|
9151
9776
|
`),
|
|
9152
|
-
process.stderr.write(`Run ${
|
|
9777
|
+
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
9153
9778
|
`),
|
|
9154
9779
|
process.exit(1)));
|
|
9155
|
-
let n =
|
|
9780
|
+
let n = j(e),
|
|
9156
9781
|
s = !!t.json,
|
|
9157
9782
|
o = !!(t.async || t.no_wait),
|
|
9158
9783
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
9159
|
-
l =
|
|
9784
|
+
l = Ri(t),
|
|
9160
9785
|
c = { ...t };
|
|
9161
9786
|
(delete c.json,
|
|
9162
9787
|
delete c.async,
|
|
@@ -9165,14 +9790,14 @@ async function je(e, t) {
|
|
|
9165
9790
|
delete c.api_key,
|
|
9166
9791
|
delete c.api_url,
|
|
9167
9792
|
delete c.count);
|
|
9168
|
-
let p =
|
|
9169
|
-
(
|
|
9170
|
-
typeof p.image == 'string' && !p.images && !
|
|
9793
|
+
let p = Zt(n, c);
|
|
9794
|
+
(qi(p),
|
|
9795
|
+
typeof p.image == 'string' && !p.images && !be(n) && ((p.images = [p.image]), delete p.image),
|
|
9171
9796
|
p.image_url &&
|
|
9172
9797
|
!p.first_frame_image &&
|
|
9173
9798
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
9174
9799
|
(p.first_frame_image = p.image_url));
|
|
9175
|
-
let d = new K(r,
|
|
9800
|
+
let d = new K(r, i),
|
|
9176
9801
|
m = [
|
|
9177
9802
|
'image',
|
|
9178
9803
|
'mask_image',
|
|
@@ -9181,57 +9806,59 @@ async function je(e, t) {
|
|
|
9181
9806
|
'lipsyncing_audio',
|
|
9182
9807
|
'audio',
|
|
9183
9808
|
'video',
|
|
9809
|
+
'image_url',
|
|
9810
|
+
'video_url',
|
|
9184
9811
|
];
|
|
9185
9812
|
for (let b of m) {
|
|
9186
9813
|
let g = p[b];
|
|
9187
9814
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
9188
|
-
let x =
|
|
9815
|
+
let x = C.default.resolve(g);
|
|
9189
9816
|
if (N.default.existsSync(x) && N.default.statSync(x).isFile()) {
|
|
9190
|
-
let
|
|
9191
|
-
s ||
|
|
9817
|
+
let _ = new T(`Uploading local file ${C.default.basename(x)} to CDN...`);
|
|
9818
|
+
s || _.start();
|
|
9192
9819
|
try {
|
|
9193
|
-
let
|
|
9194
|
-
|
|
9195
|
-
((p[b] =
|
|
9196
|
-
} catch (
|
|
9197
|
-
let
|
|
9820
|
+
let V = N.default.readFileSync(x),
|
|
9821
|
+
$ = await d.uploadAsset(V.toString('base64'));
|
|
9822
|
+
((p[b] = $.url), s || _.succeed(`Uploaded ${C.default.basename(x)} to CDN`));
|
|
9823
|
+
} catch (V) {
|
|
9824
|
+
let $ = V instanceof Error ? V.message : String(V);
|
|
9198
9825
|
(s
|
|
9199
9826
|
? process.stdout.write(
|
|
9200
|
-
JSON.stringify({ error:
|
|
9827
|
+
JSON.stringify({ error: $ }) +
|
|
9201
9828
|
`
|
|
9202
9829
|
`,
|
|
9203
9830
|
)
|
|
9204
|
-
:
|
|
9831
|
+
: _.fail(`Upload failed: ${$}`),
|
|
9205
9832
|
process.exit(1));
|
|
9206
9833
|
}
|
|
9207
9834
|
}
|
|
9208
9835
|
}
|
|
9209
9836
|
}
|
|
9210
|
-
await
|
|
9211
|
-
let g = new T(`Uploading local file ${
|
|
9837
|
+
await Oi(p, async (b) => {
|
|
9838
|
+
let g = new T(`Uploading local file ${C.default.basename(b)} to CDN...`);
|
|
9212
9839
|
s || g.start();
|
|
9213
9840
|
try {
|
|
9214
9841
|
let x = N.default.readFileSync(b),
|
|
9215
|
-
|
|
9216
|
-
return (s || g.succeed(`Uploaded ${
|
|
9842
|
+
_ = await d.uploadAsset(x.toString('base64'));
|
|
9843
|
+
return (s || g.succeed(`Uploaded ${C.default.basename(b)} to CDN`), _.url);
|
|
9217
9844
|
} catch (x) {
|
|
9218
|
-
let
|
|
9845
|
+
let _ = x instanceof Error ? x.message : String(x);
|
|
9219
9846
|
(s
|
|
9220
9847
|
? process.stdout.write(
|
|
9221
|
-
JSON.stringify({ error:
|
|
9848
|
+
JSON.stringify({ error: _ }) +
|
|
9222
9849
|
`
|
|
9223
9850
|
`,
|
|
9224
9851
|
)
|
|
9225
|
-
: g.fail(`Upload failed: ${
|
|
9852
|
+
: g.fail(`Upload failed: ${_}`),
|
|
9226
9853
|
process.exit(1));
|
|
9227
9854
|
}
|
|
9228
9855
|
});
|
|
9229
|
-
let h = new T(`Submitting task for ${
|
|
9856
|
+
let h = new T(`Submitting task for ${a.bold(e)}...`);
|
|
9230
9857
|
s || h.start();
|
|
9231
9858
|
let f;
|
|
9232
9859
|
try {
|
|
9233
9860
|
if (l > 1) {
|
|
9234
|
-
await
|
|
9861
|
+
await Di(d, e, p, l, { isJson: s, isAsync: o });
|
|
9235
9862
|
return;
|
|
9236
9863
|
}
|
|
9237
9864
|
f = await d.queueJob(e, p);
|
|
@@ -9264,17 +9891,17 @@ async function je(e, t) {
|
|
|
9264
9891
|
`
|
|
9265
9892
|
`,
|
|
9266
9893
|
)
|
|
9267
|
-
: (h.succeed(`Queued successfully! Request ID: ${
|
|
9268
|
-
process.stdout.write(`Check status anytime with: ${
|
|
9894
|
+
: (h.succeed(`Queued successfully! Request ID: ${a.bold(f.request_id)}`),
|
|
9895
|
+
process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${f.request_id}`)}
|
|
9269
9896
|
`));
|
|
9270
9897
|
return;
|
|
9271
9898
|
}
|
|
9272
|
-
let
|
|
9273
|
-
|
|
9899
|
+
let we = Date.now(),
|
|
9900
|
+
xe = 1500;
|
|
9274
9901
|
for (; f.status === 'processing';) {
|
|
9275
|
-
let b = Math.round((Date.now() -
|
|
9276
|
-
(s || h.update(`Rendering ${
|
|
9277
|
-
await new Promise((g) => setTimeout(g,
|
|
9902
|
+
let b = Math.round((Date.now() - we) / 1e3);
|
|
9903
|
+
(s || h.update(`Rendering ${a.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
|
|
9904
|
+
await new Promise((g) => setTimeout(g, xe)));
|
|
9278
9905
|
try {
|
|
9279
9906
|
f = await d.getStatus(f.request_id);
|
|
9280
9907
|
} catch (g) {
|
|
@@ -9298,7 +9925,7 @@ async function je(e, t) {
|
|
|
9298
9925
|
)
|
|
9299
9926
|
: h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
|
|
9300
9927
|
process.exit(v)),
|
|
9301
|
-
s || h.succeed(`Generation completed for ${
|
|
9928
|
+
s || h.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
|
|
9302
9929
|
s)
|
|
9303
9930
|
) {
|
|
9304
9931
|
process.stdout.write(
|
|
@@ -9311,53 +9938,53 @@ async function je(e, t) {
|
|
|
9311
9938
|
if (
|
|
9312
9939
|
(process.stdout.write(`
|
|
9313
9940
|
`),
|
|
9314
|
-
process.stdout.write(` ${
|
|
9941
|
+
process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
|
|
9315
9942
|
`),
|
|
9316
|
-
process.stdout.write(` ${
|
|
9943
|
+
process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
|
|
9317
9944
|
`),
|
|
9318
9945
|
f.usage?.cost !== void 0 &&
|
|
9319
|
-
process.stdout.write(` ${
|
|
9946
|
+
process.stdout.write(` ${a.bold('Cost:')} ${Te(f.usage.cost)}
|
|
9320
9947
|
`),
|
|
9321
9948
|
f.output && f.output.length > 0)
|
|
9322
9949
|
) {
|
|
9323
9950
|
process.stdout.write(`
|
|
9324
|
-
${
|
|
9951
|
+
${a.bold('Outputs:')}
|
|
9325
9952
|
`);
|
|
9326
9953
|
let b = f.output.filter((x) => x.url).length,
|
|
9327
9954
|
g = 0;
|
|
9328
9955
|
for (let x = 0; x < f.output.length; x++) {
|
|
9329
|
-
let
|
|
9330
|
-
if (
|
|
9331
|
-
let
|
|
9956
|
+
let _ = f.output[x];
|
|
9957
|
+
if (_.url) {
|
|
9958
|
+
let V = _.layer?.name ? ` ${a.bold(_.layer.name)}` : '';
|
|
9332
9959
|
if (
|
|
9333
|
-
(process.stdout.write(` [${
|
|
9960
|
+
(process.stdout.write(` [${_.type.toUpperCase()}]${V} ${a.cyan(a.underline(_.url))}
|
|
9334
9961
|
`),
|
|
9335
9962
|
u)
|
|
9336
9963
|
) {
|
|
9337
|
-
let
|
|
9338
|
-
|
|
9964
|
+
let $ = Li(u, g++, b),
|
|
9965
|
+
nt = new T(`Downloading output to ${$}...`).start();
|
|
9339
9966
|
try {
|
|
9340
|
-
(await d.downloadOutput(
|
|
9341
|
-
|
|
9342
|
-
} catch (
|
|
9343
|
-
|
|
9967
|
+
(await d.downloadOutput(_.url, C.default.resolve(process.cwd(), $)),
|
|
9968
|
+
nt.succeed(`Saved to ${a.bold($)}`));
|
|
9969
|
+
} catch (_e) {
|
|
9970
|
+
nt.fail(`Failed to download: ${_e instanceof Error ? _e.message : _e}`);
|
|
9344
9971
|
}
|
|
9345
9972
|
}
|
|
9346
9973
|
} else
|
|
9347
|
-
|
|
9974
|
+
_.text &&
|
|
9348
9975
|
process.stdout.write(`
|
|
9349
|
-
${
|
|
9976
|
+
${_.text}
|
|
9350
9977
|
`);
|
|
9351
9978
|
}
|
|
9352
9979
|
}
|
|
9353
9980
|
process.stdout.write(`
|
|
9354
9981
|
`);
|
|
9355
9982
|
}
|
|
9356
|
-
var
|
|
9983
|
+
var rr = I(require('node:readline'));
|
|
9357
9984
|
A();
|
|
9358
|
-
async function
|
|
9985
|
+
async function Vi(e) {
|
|
9359
9986
|
try {
|
|
9360
|
-
return (await new K(e,
|
|
9987
|
+
return (await new K(e, P()).checkKey(), 'ok');
|
|
9361
9988
|
} catch (t) {
|
|
9362
9989
|
if (t instanceof w) {
|
|
9363
9990
|
if (t.status === 401) return 'invalid';
|
|
@@ -9366,95 +9993,95 @@ async function ya(e) {
|
|
|
9366
9993
|
return 'unchecked';
|
|
9367
9994
|
}
|
|
9368
9995
|
}
|
|
9369
|
-
function
|
|
9370
|
-
let t =
|
|
9996
|
+
function Ni(e) {
|
|
9997
|
+
let t = rr.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
9371
9998
|
return new Promise((r) => {
|
|
9372
|
-
t.question(e, (
|
|
9373
|
-
(t.close(), r(
|
|
9999
|
+
t.question(e, (i) => {
|
|
10000
|
+
(t.close(), r(i.trim()));
|
|
9374
10001
|
});
|
|
9375
10002
|
});
|
|
9376
10003
|
}
|
|
9377
|
-
async function
|
|
10004
|
+
async function ee(e, t) {
|
|
9378
10005
|
switch (e) {
|
|
9379
10006
|
case 'login':
|
|
9380
10007
|
case 'set-key': {
|
|
9381
10008
|
let r = t?.trim() || '';
|
|
9382
10009
|
(r ||
|
|
9383
10010
|
(process.stdout.write(`
|
|
9384
|
-
${
|
|
10011
|
+
${a.bold('Tein AI Authentication')}
|
|
9385
10012
|
`),
|
|
9386
|
-
process.stdout.write(`Get your API key at: ${
|
|
10013
|
+
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
9387
10014
|
|
|
9388
10015
|
`),
|
|
9389
|
-
(r = await
|
|
10016
|
+
(r = await Ni('Enter your Tein API Key (sk_live_...): '))),
|
|
9390
10017
|
!r.startsWith('sk_live_') &&
|
|
9391
10018
|
!r.startsWith('sk_test_') &&
|
|
9392
10019
|
(process.stderr
|
|
9393
|
-
.write(`${
|
|
10020
|
+
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
9394
10021
|
`),
|
|
9395
10022
|
process.exit(1)));
|
|
9396
|
-
let
|
|
9397
|
-
(
|
|
10023
|
+
let i = await Vi(r);
|
|
10024
|
+
(i === 'invalid' &&
|
|
9398
10025
|
(process.stderr
|
|
9399
|
-
.write(`${
|
|
10026
|
+
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
9400
10027
|
`),
|
|
9401
10028
|
process.exit(1)),
|
|
9402
|
-
|
|
10029
|
+
ve({ apiKey: r }),
|
|
9403
10030
|
process.stdout.write(`
|
|
9404
|
-
${
|
|
10031
|
+
${a.green('\u2713')} API key saved to ${a.dim(ne())}
|
|
9405
10032
|
`),
|
|
9406
|
-
|
|
10033
|
+
i === 'blocked'
|
|
9407
10034
|
? process.stdout
|
|
9408
|
-
.write(`${
|
|
10035
|
+
.write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
|
|
9409
10036
|
`)
|
|
9410
|
-
:
|
|
10037
|
+
: i === 'unchecked' &&
|
|
9411
10038
|
process.stdout
|
|
9412
|
-
.write(`${
|
|
10039
|
+
.write(`${a.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${a.cyan('tein auth set-key')} again once you are online to check it.
|
|
9413
10040
|
`),
|
|
9414
10041
|
process.stdout
|
|
9415
|
-
.write(`You can now run models directly using: ${
|
|
10042
|
+
.write(`You can now run models directly using: ${a.cyan('tein run <model-slug> --prompt "..."')}
|
|
9416
10043
|
|
|
9417
10044
|
`));
|
|
9418
10045
|
break;
|
|
9419
10046
|
}
|
|
9420
10047
|
case 'logout': {
|
|
9421
|
-
if (!
|
|
10048
|
+
if (!F().apiKey) {
|
|
9422
10049
|
process.stdout
|
|
9423
|
-
.write(`${
|
|
10050
|
+
.write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
|
|
9424
10051
|
`);
|
|
9425
10052
|
break;
|
|
9426
10053
|
}
|
|
9427
|
-
(
|
|
10054
|
+
(ve({ apiKey: '' }),
|
|
9428
10055
|
process.stdout
|
|
9429
|
-
.write(`${
|
|
10056
|
+
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(ne())}
|
|
9430
10057
|
`));
|
|
9431
10058
|
break;
|
|
9432
10059
|
}
|
|
9433
10060
|
default: {
|
|
9434
10061
|
let r = E(),
|
|
9435
|
-
|
|
9436
|
-
n =
|
|
10062
|
+
i = P(),
|
|
10063
|
+
n = F();
|
|
9437
10064
|
if (
|
|
9438
10065
|
(process.stdout.write(`
|
|
9439
|
-
${
|
|
10066
|
+
${a.bold('Tein AI CLI Configuration')}
|
|
9440
10067
|
`),
|
|
9441
|
-
process.stdout.write(` Config file: ${
|
|
10068
|
+
process.stdout.write(` Config file: ${a.dim(ne())}
|
|
9442
10069
|
`),
|
|
9443
|
-
process.stdout.write(` API URL: ${
|
|
10070
|
+
process.stdout.write(` API URL: ${a.cyan(i)}
|
|
9444
10071
|
`),
|
|
9445
10072
|
!r)
|
|
9446
10073
|
)
|
|
9447
|
-
(process.stdout.write(` API Key: ${
|
|
10074
|
+
(process.stdout.write(` API Key: ${a.red('Not configured')}
|
|
9448
10075
|
|
|
9449
10076
|
`),
|
|
9450
10077
|
process.stdout
|
|
9451
|
-
.write(`Run ${
|
|
10078
|
+
.write(`Run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
|
|
9452
10079
|
|
|
9453
10080
|
`));
|
|
9454
10081
|
else {
|
|
9455
10082
|
let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
|
|
9456
10083
|
process.stdout
|
|
9457
|
-
.write(` API Key: ${
|
|
10084
|
+
.write(` API Key: ${a.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
|
|
9458
10085
|
|
|
9459
10086
|
`);
|
|
9460
10087
|
}
|
|
@@ -9463,57 +10090,57 @@ ${i.bold('Tein AI CLI Configuration')}
|
|
|
9463
10090
|
}
|
|
9464
10091
|
}
|
|
9465
10092
|
A();
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
var
|
|
9469
|
-
async function
|
|
10093
|
+
Me();
|
|
10094
|
+
Q();
|
|
10095
|
+
var Ui = 3e3;
|
|
10096
|
+
async function ir(e) {
|
|
9470
10097
|
try {
|
|
9471
|
-
let t = await fetch(`${
|
|
10098
|
+
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(Ui) });
|
|
9472
10099
|
if (!t.ok) return;
|
|
9473
10100
|
let r = await t.json(),
|
|
9474
|
-
|
|
10101
|
+
i = {};
|
|
9475
10102
|
for (let n of r.configs ?? []) {
|
|
9476
10103
|
let s = String(n.modelSlug ?? '');
|
|
9477
|
-
|
|
10104
|
+
H.has(s) && (i[s] ??= []).push(Number(n.starterPrice));
|
|
9478
10105
|
}
|
|
9479
|
-
|
|
10106
|
+
zt(i);
|
|
9480
10107
|
} catch {}
|
|
9481
10108
|
}
|
|
9482
|
-
var
|
|
9483
|
-
|
|
9484
|
-
async function
|
|
9485
|
-
await
|
|
9486
|
-
let r =
|
|
10109
|
+
var Fi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
10110
|
+
Bi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
10111
|
+
async function ar(e, t) {
|
|
10112
|
+
await ir(t);
|
|
10113
|
+
let r = D();
|
|
9487
10114
|
if (e) {
|
|
9488
10115
|
let s = e.toLowerCase(),
|
|
9489
|
-
o =
|
|
9490
|
-
r =
|
|
10116
|
+
o = Bi[s] ?? s;
|
|
10117
|
+
r = Fi.has(o)
|
|
9491
10118
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
9492
10119
|
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
9493
10120
|
}
|
|
9494
10121
|
(process.stdout.write(`
|
|
9495
|
-
${
|
|
10122
|
+
${a.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
9496
10123
|
`),
|
|
9497
10124
|
process.stdout
|
|
9498
|
-
.write(`${
|
|
10125
|
+
.write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
|
|
9499
10126
|
|
|
9500
10127
|
`));
|
|
9501
|
-
let
|
|
10128
|
+
let i = {};
|
|
9502
10129
|
for (let s of r) {
|
|
9503
10130
|
let o = s.category;
|
|
9504
|
-
(
|
|
10131
|
+
(i[o] || (i[o] = []), i[o].push(s));
|
|
9505
10132
|
}
|
|
9506
10133
|
let n = ['Video', 'Image', 'Text', 'Audio', '3D'];
|
|
9507
10134
|
for (let s of n) {
|
|
9508
|
-
let o =
|
|
10135
|
+
let o = i[s];
|
|
9509
10136
|
if (!(!o || o.length === 0)) {
|
|
9510
|
-
process.stdout.write(`${
|
|
10137
|
+
process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
|
|
9511
10138
|
`);
|
|
9512
10139
|
for (let u of o) {
|
|
9513
10140
|
let l = u.slug.padEnd(24),
|
|
9514
10141
|
c = u.name.padEnd(22),
|
|
9515
10142
|
p = u.priceFormatted.padEnd(22);
|
|
9516
|
-
process.stdout.write(` ${
|
|
10143
|
+
process.stdout.write(` ${a.bold(l)} ${a.gray(c)} ${a.green(p)} ${a.dim(u.vendor)}
|
|
9517
10144
|
`);
|
|
9518
10145
|
}
|
|
9519
10146
|
process.stdout.write(`
|
|
@@ -9521,95 +10148,95 @@ ${i.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
|
9521
10148
|
}
|
|
9522
10149
|
}
|
|
9523
10150
|
process.stdout
|
|
9524
|
-
.write(`${
|
|
10151
|
+
.write(`${a.dim('Tip:')} Generate directly with ${a.cyan('tein run <model-slug> --prompt "..."')}
|
|
9525
10152
|
|
|
9526
10153
|
`);
|
|
9527
10154
|
}
|
|
9528
|
-
async function
|
|
9529
|
-
|
|
9530
|
-
let r =
|
|
10155
|
+
async function nr(e, t) {
|
|
10156
|
+
H.has(e) && (await ir(t));
|
|
10157
|
+
let r = j(e);
|
|
9531
10158
|
(r ||
|
|
9532
|
-
(process.stderr.write(`${
|
|
10159
|
+
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
9533
10160
|
`),
|
|
9534
|
-
process.stderr.write(`Run ${
|
|
10161
|
+
process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
|
|
9535
10162
|
`),
|
|
9536
10163
|
process.exit(1)),
|
|
9537
10164
|
process.stdout.write(`
|
|
9538
|
-
${
|
|
10165
|
+
${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
|
|
9539
10166
|
`),
|
|
9540
|
-
process.stdout.write(` ${
|
|
10167
|
+
process.stdout.write(` ${a.gray(r.description)}
|
|
9541
10168
|
|
|
9542
10169
|
`),
|
|
9543
|
-
process.stdout.write(`${
|
|
10170
|
+
process.stdout.write(`${a.bold('Metadata:')}
|
|
9544
10171
|
`),
|
|
9545
|
-
process.stdout.write(` Category: ${
|
|
10172
|
+
process.stdout.write(` Category: ${a.yellow(r.category)}
|
|
9546
10173
|
`),
|
|
9547
10174
|
process.stdout.write(` Kind: ${r.kind}
|
|
9548
10175
|
`),
|
|
9549
10176
|
process.stdout.write(` Vendor: ${r.vendor}
|
|
9550
10177
|
`),
|
|
9551
|
-
process.stdout.write(` Pricing: ${
|
|
10178
|
+
process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
|
|
9552
10179
|
|
|
9553
10180
|
`),
|
|
9554
|
-
process.stdout.write(`${
|
|
10181
|
+
process.stdout.write(`${a.bold('Parameters:')}
|
|
9555
10182
|
`));
|
|
9556
|
-
for (let
|
|
9557
|
-
let n =
|
|
9558
|
-
s =
|
|
10183
|
+
for (let i of r.parameters) {
|
|
10184
|
+
let n = i.required ? a.red('(required)') : a.dim('(optional)'),
|
|
10185
|
+
s = i.default !== void 0 ? a.dim(` [default: ${i.default}]`) : '';
|
|
9559
10186
|
(process.stdout
|
|
9560
|
-
.write(` ${
|
|
10187
|
+
.write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${n}${s}
|
|
9561
10188
|
`),
|
|
9562
|
-
|
|
9563
|
-
process.stdout.write(` ${
|
|
10189
|
+
i.description &&
|
|
10190
|
+
process.stdout.write(` ${a.gray(i.description)}
|
|
9564
10191
|
`),
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
process.stdout.write(` Allowed values: ${
|
|
10192
|
+
i.options &&
|
|
10193
|
+
i.options.length > 0 &&
|
|
10194
|
+
process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
|
|
9568
10195
|
`),
|
|
9569
|
-
(
|
|
9570
|
-
process.stdout.write(` Range: ${
|
|
10196
|
+
(i.min !== void 0 || i.max !== void 0) &&
|
|
10197
|
+
process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
|
|
9571
10198
|
`),
|
|
9572
10199
|
process.stdout.write(`
|
|
9573
10200
|
`));
|
|
9574
10201
|
}
|
|
9575
10202
|
if (
|
|
9576
|
-
(r.parameters.some((
|
|
10203
|
+
(r.parameters.some((i) => i.name === 'callback_url') ||
|
|
9577
10204
|
(process.stdout
|
|
9578
|
-
.write(` ${
|
|
10205
|
+
.write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
|
|
9579
10206
|
`),
|
|
9580
10207
|
process.stdout
|
|
9581
|
-
.write(` ${
|
|
10208
|
+
.write(` ${a.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
|
|
9582
10209
|
|
|
9583
10210
|
`)),
|
|
9584
|
-
process.stdout.write(`${
|
|
10211
|
+
process.stdout.write(`${a.bold('Sample CLI Usage:')}
|
|
9585
10212
|
`),
|
|
9586
10213
|
r.category === 'Video')
|
|
9587
10214
|
)
|
|
9588
10215
|
process.stdout
|
|
9589
|
-
.write(` ${
|
|
10216
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
|
|
9590
10217
|
|
|
9591
10218
|
`);
|
|
9592
10219
|
else if (r.category === 'Image') {
|
|
9593
|
-
let
|
|
10220
|
+
let i = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
|
|
9594
10221
|
process.stdout
|
|
9595
|
-
.write(` ${
|
|
10222
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
|
|
9596
10223
|
|
|
9597
10224
|
`);
|
|
9598
10225
|
} else
|
|
9599
10226
|
r.category === 'Audio'
|
|
9600
10227
|
? process.stdout
|
|
9601
|
-
.write(` ${
|
|
10228
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
|
|
9602
10229
|
|
|
9603
10230
|
`)
|
|
9604
10231
|
: process.stdout
|
|
9605
|
-
.write(` ${
|
|
10232
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
|
|
9606
10233
|
|
|
9607
10234
|
`);
|
|
9608
10235
|
}
|
|
9609
10236
|
A();
|
|
9610
|
-
|
|
9611
|
-
var
|
|
9612
|
-
|
|
10237
|
+
Ye();
|
|
10238
|
+
var ji = 1e4,
|
|
10239
|
+
Qe = {
|
|
9613
10240
|
price: '',
|
|
9614
10241
|
creativeMode: 'Creative mode',
|
|
9615
10242
|
priority: 'Priority',
|
|
@@ -9619,114 +10246,114 @@ var Pa = 1e4,
|
|
|
9619
10246
|
priorityDraft: 'Priority + Draft',
|
|
9620
10247
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
9621
10248
|
},
|
|
9622
|
-
|
|
9623
|
-
|
|
10249
|
+
Gi = Object.keys(Qe),
|
|
10250
|
+
Hi = {
|
|
9624
10251
|
creativeMode: 'unfiltered',
|
|
9625
10252
|
creativeModePriority: 'unfilteredPriority',
|
|
9626
10253
|
creativeModeDraft: 'unfilteredDraft',
|
|
9627
10254
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
9628
10255
|
};
|
|
9629
|
-
function
|
|
9630
|
-
let r =
|
|
10256
|
+
function zi(e, t) {
|
|
10257
|
+
let r = Hi[t];
|
|
9631
10258
|
return e[t] ?? (r ? e[r] : void 0);
|
|
9632
10259
|
}
|
|
9633
|
-
async function
|
|
9634
|
-
let r = `${
|
|
9635
|
-
|
|
10260
|
+
async function Ji(e, t) {
|
|
10261
|
+
let r = `${P(e)}${ke(t)}`,
|
|
10262
|
+
i;
|
|
9636
10263
|
try {
|
|
9637
|
-
|
|
10264
|
+
i = await fetch(r, { signal: AbortSignal.timeout(ji) });
|
|
9638
10265
|
} catch {
|
|
9639
10266
|
throw new Error(`Could not reach ${r}`);
|
|
9640
10267
|
}
|
|
9641
|
-
let n = await
|
|
9642
|
-
if (!
|
|
10268
|
+
let n = await i.json().catch(() => null);
|
|
10269
|
+
if (!i.ok || !n || n.object !== 'list' || !n.board) {
|
|
9643
10270
|
let s =
|
|
9644
10271
|
n && typeof n.error == 'string'
|
|
9645
10272
|
? n.error
|
|
9646
10273
|
: n && typeof n.error == 'object' && n.error?.message
|
|
9647
10274
|
? n.error.message
|
|
9648
|
-
: `Pricing request failed (${
|
|
10275
|
+
: `Pricing request failed (${i.status})`;
|
|
9649
10276
|
throw new Error(s);
|
|
9650
10277
|
}
|
|
9651
10278
|
return n;
|
|
9652
10279
|
}
|
|
9653
|
-
function
|
|
10280
|
+
function Xe(e) {
|
|
9654
10281
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
9655
|
-
[r,
|
|
9656
|
-
return `$${r}.${
|
|
10282
|
+
[r, i = ''] = t.split('.');
|
|
10283
|
+
return `$${r}.${i.padEnd(2, '0')}`;
|
|
9657
10284
|
}
|
|
9658
|
-
function
|
|
10285
|
+
function Ze(e) {
|
|
9659
10286
|
if (!e || typeof e.starter != 'number') return null;
|
|
9660
10287
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
9661
10288
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9662
|
-
return `Starter ${
|
|
10289
|
+
return `Starter ${Xe(e.starter)} Plus ${Xe(t)} Scale ${Xe(r)}`;
|
|
9663
10290
|
}
|
|
9664
|
-
function
|
|
10291
|
+
function Wi(e) {
|
|
9665
10292
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
9666
10293
|
let t = [];
|
|
9667
10294
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
9668
|
-
let
|
|
9669
|
-
|
|
10295
|
+
let i = e[r];
|
|
10296
|
+
i != null && i !== '' && t.push(String(i));
|
|
9670
10297
|
}
|
|
9671
10298
|
return (
|
|
9672
10299
|
e.withVideo === !0 && t.push('with video'),
|
|
9673
10300
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
9674
10301
|
);
|
|
9675
10302
|
}
|
|
9676
|
-
function
|
|
9677
|
-
let r =
|
|
9678
|
-
for (let
|
|
9679
|
-
let n =
|
|
10303
|
+
function Yi(e, t) {
|
|
10304
|
+
let r = Wi(e);
|
|
10305
|
+
for (let i of Gi) {
|
|
10306
|
+
let n = Ze(zi(e, i));
|
|
9680
10307
|
if (!n) continue;
|
|
9681
|
-
let s =
|
|
10308
|
+
let s = Qe[i] ? ` (${Qe[i]})` : '';
|
|
9682
10309
|
t.push(` ${r}${s} ${n}`);
|
|
9683
10310
|
}
|
|
9684
10311
|
}
|
|
9685
|
-
function
|
|
10312
|
+
function Xi(e, t) {
|
|
9686
10313
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
9687
10314
|
t.push(
|
|
9688
|
-
` ${
|
|
10315
|
+
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
9689
10316
|
);
|
|
9690
|
-
for (let n of e.variants ?? [])
|
|
9691
|
-
let
|
|
9692
|
-
if (Array.isArray(
|
|
9693
|
-
for (let n of
|
|
10317
|
+
for (let n of e.variants ?? []) Yi(n, t);
|
|
10318
|
+
let i = e.addons;
|
|
10319
|
+
if (Array.isArray(i))
|
|
10320
|
+
for (let n of i) {
|
|
9694
10321
|
if (!n || typeof n != 'object') continue;
|
|
9695
10322
|
let s = n,
|
|
9696
10323
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
9697
|
-
u =
|
|
10324
|
+
u = Ze(s.price);
|
|
9698
10325
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
9699
10326
|
}
|
|
9700
10327
|
t.push('');
|
|
9701
10328
|
}
|
|
9702
|
-
function
|
|
10329
|
+
function Qi(e) {
|
|
9703
10330
|
let t = [],
|
|
9704
10331
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9705
|
-
(t.push(`${
|
|
10332
|
+
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
|
|
9706
10333
|
t.push(
|
|
9707
|
-
`${
|
|
10334
|
+
`${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
|
|
9708
10335
|
),
|
|
9709
10336
|
t.push(''));
|
|
9710
|
-
let
|
|
10337
|
+
let i = new Map();
|
|
9711
10338
|
for (let l of e.board.models) {
|
|
9712
10339
|
let c = l.kind || 'other',
|
|
9713
|
-
p =
|
|
9714
|
-
(p.push(l),
|
|
10340
|
+
p = i.get(c) ?? [];
|
|
10341
|
+
(p.push(l), i.set(c, p));
|
|
9715
10342
|
}
|
|
9716
10343
|
let n = ['video', 'image', 'audio', 'llm', 'text', '3d'],
|
|
9717
|
-
s = [...
|
|
10344
|
+
s = [...i.keys()].sort((l, c) => {
|
|
9718
10345
|
let p = n.indexOf(l),
|
|
9719
10346
|
d = n.indexOf(c);
|
|
9720
10347
|
return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
|
|
9721
10348
|
});
|
|
9722
10349
|
for (let l of s) {
|
|
9723
|
-
t.push(`${
|
|
9724
|
-
for (let c of
|
|
10350
|
+
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
10351
|
+
for (let c of i.get(l) ?? []) Xi(c, t);
|
|
9725
10352
|
}
|
|
9726
10353
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
9727
10354
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
9728
10355
|
if (u.length) {
|
|
9729
|
-
t.push(`${
|
|
10356
|
+
t.push(`${a.bold(a.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
|
|
9730
10357
|
let l = new Map();
|
|
9731
10358
|
for (let c of u) {
|
|
9732
10359
|
let p = String(c.modelSlug ?? ''),
|
|
@@ -9735,29 +10362,29 @@ function Ea(e) {
|
|
|
9735
10362
|
}
|
|
9736
10363
|
for (let [c, p] of l) {
|
|
9737
10364
|
let d = String(p[0]?.modelName ?? c);
|
|
9738
|
-
t.push(` ${
|
|
10365
|
+
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
9739
10366
|
for (let m of p) {
|
|
9740
10367
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
9741
|
-
f =
|
|
10368
|
+
f = Ze(m.prices);
|
|
9742
10369
|
f && t.push(` ${h} ${f}`);
|
|
9743
10370
|
}
|
|
9744
10371
|
t.push('');
|
|
9745
10372
|
}
|
|
9746
10373
|
}
|
|
9747
10374
|
return (
|
|
9748
|
-
t.push(`${
|
|
10375
|
+
t.push(`${a.dim('JSON:')} ${a.cyan('tein pricing --json')}`),
|
|
9749
10376
|
`${t.join(`
|
|
9750
10377
|
`)}
|
|
9751
10378
|
`
|
|
9752
10379
|
);
|
|
9753
10380
|
}
|
|
9754
|
-
async function
|
|
10381
|
+
async function sr(e) {
|
|
9755
10382
|
let t;
|
|
9756
10383
|
try {
|
|
9757
|
-
t = await
|
|
10384
|
+
t = await Ji(e.apiUrl, e.model);
|
|
9758
10385
|
} catch (r) {
|
|
9759
|
-
let
|
|
9760
|
-
(process.stderr.write(`${
|
|
10386
|
+
let i = r instanceof Error ? r.message : String(r);
|
|
10387
|
+
(process.stderr.write(`${a.red('Error:')} ${i}
|
|
9761
10388
|
`),
|
|
9762
10389
|
process.exit(1));
|
|
9763
10390
|
}
|
|
@@ -9765,32 +10392,32 @@ async function Wt(e) {
|
|
|
9765
10392
|
e.json
|
|
9766
10393
|
? `${JSON.stringify(t, null, 2)}
|
|
9767
10394
|
`
|
|
9768
|
-
:
|
|
10395
|
+
: Qi(t),
|
|
9769
10396
|
);
|
|
9770
10397
|
}
|
|
9771
|
-
var
|
|
10398
|
+
var or = I(require('node:path'));
|
|
9772
10399
|
A();
|
|
9773
|
-
async function
|
|
10400
|
+
async function lr(e, t) {
|
|
9774
10401
|
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9775
|
-
|
|
10402
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9776
10403
|
(r ||
|
|
9777
|
-
(process.stderr.write(`${
|
|
10404
|
+
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
9778
10405
|
`),
|
|
9779
10406
|
process.stderr
|
|
9780
|
-
.write(`Please run ${
|
|
10407
|
+
.write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
|
|
9781
10408
|
`),
|
|
9782
10409
|
process.exit(1)),
|
|
9783
10410
|
e ||
|
|
9784
|
-
(process.stderr.write(`${
|
|
10411
|
+
(process.stderr.write(`${a.red('Error:')} Missing request ID.
|
|
9785
10412
|
`),
|
|
9786
|
-
process.stderr.write(`Usage: ${
|
|
10413
|
+
process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
|
|
9787
10414
|
`),
|
|
9788
10415
|
process.exit(1)));
|
|
9789
10416
|
let n = !!t.json,
|
|
9790
10417
|
s = !!t.wait,
|
|
9791
10418
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
9792
|
-
u = new K(r,
|
|
9793
|
-
l = new T(`Checking status of ${
|
|
10419
|
+
u = new K(r, i),
|
|
10420
|
+
l = new T(`Checking status of ${a.bold(e)}...`);
|
|
9794
10421
|
n || l.start();
|
|
9795
10422
|
let c;
|
|
9796
10423
|
try {
|
|
@@ -9819,7 +10446,7 @@ async function Xt(e, t) {
|
|
|
9819
10446
|
let p = Date.now();
|
|
9820
10447
|
for (; c.status === 'processing';) {
|
|
9821
10448
|
let d = Math.round((Date.now() - p) / 1e3);
|
|
9822
|
-
(n || l.update(`Waiting for ${
|
|
10449
|
+
(n || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
|
|
9823
10450
|
await new Promise((m) => setTimeout(m, 1500)));
|
|
9824
10451
|
try {
|
|
9825
10452
|
c = await u.getStatus(e);
|
|
@@ -9844,29 +10471,29 @@ async function Xt(e, t) {
|
|
|
9844
10471
|
}
|
|
9845
10472
|
if (
|
|
9846
10473
|
(process.stdout.write(`
|
|
9847
|
-
${
|
|
10474
|
+
${a.bold('Model:')} ${c.model}
|
|
9848
10475
|
`),
|
|
9849
10476
|
process.stdout
|
|
9850
|
-
.write(` ${
|
|
10477
|
+
.write(` ${a.bold('Status:')} ${c.status === 'succeeded' ? a.green(c.status) : c.status === 'processing' ? a.yellow(c.status) : a.red(c.status)}
|
|
9851
10478
|
`),
|
|
9852
|
-
process.stdout.write(` ${
|
|
10479
|
+
process.stdout.write(` ${a.bold('Request ID:')} ${c.request_id}
|
|
9853
10480
|
`),
|
|
9854
10481
|
c.output && c.output.length > 0)
|
|
9855
10482
|
) {
|
|
9856
10483
|
process.stdout.write(`
|
|
9857
|
-
${
|
|
10484
|
+
${a.bold('Outputs:')}
|
|
9858
10485
|
`);
|
|
9859
10486
|
for (let p of c.output)
|
|
9860
10487
|
if (p.url) {
|
|
9861
10488
|
if (
|
|
9862
|
-
(process.stdout.write(` [${p.type.toUpperCase()}] ${
|
|
10489
|
+
(process.stdout.write(` [${p.type.toUpperCase()}] ${a.cyan(a.underline(p.url))}
|
|
9863
10490
|
`),
|
|
9864
10491
|
o)
|
|
9865
10492
|
) {
|
|
9866
10493
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
9867
10494
|
try {
|
|
9868
|
-
(await u.downloadOutput(p.url,
|
|
9869
|
-
d.succeed(`Saved to ${
|
|
10495
|
+
(await u.downloadOutput(p.url, or.default.resolve(process.cwd(), o)),
|
|
10496
|
+
d.succeed(`Saved to ${a.bold(o)}`));
|
|
9870
10497
|
} catch (m) {
|
|
9871
10498
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
9872
10499
|
}
|
|
@@ -9880,35 +10507,35 @@ ${p.text}
|
|
|
9880
10507
|
process.stdout.write(`
|
|
9881
10508
|
`);
|
|
9882
10509
|
}
|
|
9883
|
-
var
|
|
9884
|
-
|
|
10510
|
+
var et = I(require('node:fs')),
|
|
10511
|
+
tt = I(require('node:path'));
|
|
9885
10512
|
A();
|
|
9886
|
-
async function
|
|
10513
|
+
async function pr(e, t = {}) {
|
|
9887
10514
|
let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9888
|
-
|
|
10515
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9889
10516
|
n = !!t.json;
|
|
9890
10517
|
(r ||
|
|
9891
|
-
(process.stderr.write(`${
|
|
10518
|
+
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
9892
10519
|
`),
|
|
9893
10520
|
process.stderr
|
|
9894
|
-
.write(`Please run ${
|
|
10521
|
+
.write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
|
|
9895
10522
|
`),
|
|
9896
10523
|
process.exit(1)),
|
|
9897
10524
|
e ||
|
|
9898
|
-
(process.stderr.write(`${
|
|
10525
|
+
(process.stderr.write(`${a.red('Error:')} Missing file path.
|
|
9899
10526
|
`),
|
|
9900
|
-
process.stderr.write(`Usage: ${
|
|
10527
|
+
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
9901
10528
|
`),
|
|
9902
10529
|
process.exit(1)));
|
|
9903
|
-
let s =
|
|
9904
|
-
|
|
9905
|
-
(process.stderr.write(`${
|
|
10530
|
+
let s = tt.default.resolve(e);
|
|
10531
|
+
et.default.existsSync(s) ||
|
|
10532
|
+
(process.stderr.write(`${a.red('Error:')} File not found: ${s}
|
|
9906
10533
|
`),
|
|
9907
10534
|
process.exit(1));
|
|
9908
|
-
let o =
|
|
9909
|
-
l =
|
|
9910
|
-
c = new K(r,
|
|
9911
|
-
p = new T(`Uploading ${
|
|
10535
|
+
let o = tt.default.basename(s),
|
|
10536
|
+
l = et.default.readFileSync(s).toString('base64'),
|
|
10537
|
+
c = new K(r, i),
|
|
10538
|
+
p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
9912
10539
|
n || p.start();
|
|
9913
10540
|
try {
|
|
9914
10541
|
let d = await c.uploadAsset(l);
|
|
@@ -9920,13 +10547,13 @@ async function Qt(e, t = {}) {
|
|
|
9920
10547
|
)
|
|
9921
10548
|
: (p.succeed('Upload successful!'),
|
|
9922
10549
|
process.stdout.write(`
|
|
9923
|
-
${
|
|
10550
|
+
${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
9924
10551
|
`),
|
|
9925
|
-
process.stdout.write(`${
|
|
10552
|
+
process.stdout.write(`${a.dim(`Key: ${d.key}`)}
|
|
9926
10553
|
|
|
9927
10554
|
`),
|
|
9928
10555
|
process.stdout.write(`Use this CDN URL directly in your CLI runs:
|
|
9929
|
-
${
|
|
10556
|
+
${a.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
|
|
9930
10557
|
|
|
9931
10558
|
`));
|
|
9932
10559
|
} catch (d) {
|
|
@@ -9947,108 +10574,108 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
|
9947
10574
|
process.exit(m ? m.exitCode : v));
|
|
9948
10575
|
}
|
|
9949
10576
|
}
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
function
|
|
10577
|
+
Q();
|
|
10578
|
+
Ae();
|
|
10579
|
+
function vr() {
|
|
9953
10580
|
process.stdout.write(`
|
|
9954
|
-
${
|
|
10581
|
+
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
9955
10582
|
|
|
9956
|
-
${
|
|
9957
|
-
${
|
|
10583
|
+
${a.bold('USAGE:')}
|
|
10584
|
+
${a.cyan('tein')} <command> [arguments] [options]
|
|
9958
10585
|
|
|
9959
|
-
${
|
|
9960
|
-
${
|
|
9961
|
-
${
|
|
9962
|
-
${
|
|
9963
|
-
${
|
|
9964
|
-
${
|
|
9965
|
-
${
|
|
9966
|
-
${
|
|
9967
|
-
${
|
|
10586
|
+
${a.bold('COMMANDS:')}
|
|
10587
|
+
${a.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
|
|
10588
|
+
${a.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
|
|
10589
|
+
${a.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
|
|
10590
|
+
${a.bold('info')} <model-slug> View parameter schemas, pricing, and options
|
|
10591
|
+
${a.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
|
|
10592
|
+
${a.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
|
|
10593
|
+
${a.bold('status')} <request-id> [options] Check generation progress and retrieve output files
|
|
10594
|
+
${a.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
|
|
9968
10595
|
|
|
9969
|
-
${
|
|
9970
|
-
${
|
|
9971
|
-
${
|
|
9972
|
-
${
|
|
9973
|
-
${
|
|
9974
|
-
${
|
|
9975
|
-
${
|
|
9976
|
-
${
|
|
9977
|
-
${
|
|
9978
|
-
${
|
|
9979
|
-
${
|
|
9980
|
-
${
|
|
9981
|
-
${
|
|
9982
|
-
${
|
|
9983
|
-
${
|
|
10596
|
+
${a.bold('GENERATION OPTIONS (for `tein run`):')}
|
|
10597
|
+
${a.cyan('-p, --prompt')} <text> Text prompt for generation ${a.red('(required)')}
|
|
10598
|
+
${a.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
|
|
10599
|
+
${a.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
|
|
10600
|
+
${a.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
|
|
10601
|
+
${a.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
|
|
10602
|
+
${a.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
|
|
10603
|
+
${a.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
|
|
10604
|
+
${a.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
|
|
10605
|
+
${a.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
|
|
10606
|
+
${a.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
|
|
10607
|
+
${a.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
|
|
10608
|
+
${a.cyan('--async, --no-wait')} Queue task and return request ID immediately
|
|
10609
|
+
${a.cyan('--json')} Output response in raw JSON format
|
|
10610
|
+
${a.cyan('--api-key')} <key> Override API key for this request
|
|
9984
10611
|
|
|
9985
|
-
${
|
|
9986
|
-
${
|
|
9987
|
-
${
|
|
10612
|
+
${a.bold('EXAMPLES:')}
|
|
10613
|
+
${a.dim('# 1. Authenticate with your Tein API key')}
|
|
10614
|
+
${a.cyan('tein auth login')}
|
|
9988
10615
|
|
|
9989
|
-
${
|
|
9990
|
-
${
|
|
10616
|
+
${a.dim('# 2. List all Video models')}
|
|
10617
|
+
${a.cyan('tein models video')}
|
|
9991
10618
|
|
|
9992
|
-
${
|
|
9993
|
-
${
|
|
9994
|
-
${
|
|
10619
|
+
${a.dim('# 3. Every published price, or one model as JSON')}
|
|
10620
|
+
${a.cyan('tein pricing')}
|
|
10621
|
+
${a.cyan('tein pricing seedance-2-5 --json')}
|
|
9995
10622
|
|
|
9996
|
-
${
|
|
9997
|
-
${
|
|
10623
|
+
${a.dim('# 4. Generate a high-quality 2K image and download it')}
|
|
10624
|
+
${a.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
|
|
9998
10625
|
|
|
9999
|
-
${
|
|
10000
|
-
${
|
|
10001
|
-
${
|
|
10002
|
-
${
|
|
10626
|
+
${a.dim('# 5. Generate a video using Seedance 2.5 with audio')}
|
|
10627
|
+
${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
|
|
10628
|
+
${a.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
|
|
10629
|
+
${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
|
|
10003
10630
|
|
|
10004
|
-
${
|
|
10005
|
-
${
|
|
10631
|
+
${a.dim('# 6. Generate speech with Seed Audio 1.0')}
|
|
10632
|
+
${a.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
|
|
10006
10633
|
|
|
10007
|
-
${
|
|
10008
|
-
${
|
|
10634
|
+
${a.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
|
|
10635
|
+
${a.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
|
|
10009
10636
|
|
|
10010
10637
|
`);
|
|
10011
10638
|
}
|
|
10012
|
-
async function
|
|
10639
|
+
async function ha() {
|
|
10013
10640
|
let e = process.argv.slice(2),
|
|
10014
|
-
t =
|
|
10641
|
+
t = tr(e);
|
|
10015
10642
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
10016
|
-
|
|
10643
|
+
vr();
|
|
10017
10644
|
return;
|
|
10018
10645
|
}
|
|
10019
10646
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
10020
|
-
process.stdout.write(`tein version ${
|
|
10647
|
+
process.stdout.write(`tein version ${re}
|
|
10021
10648
|
`);
|
|
10022
10649
|
return;
|
|
10023
10650
|
}
|
|
10024
10651
|
switch (t.command) {
|
|
10025
10652
|
case 'auth': {
|
|
10026
|
-
await
|
|
10653
|
+
await ee(t.subcommand, t.options.key);
|
|
10027
10654
|
break;
|
|
10028
10655
|
}
|
|
10029
10656
|
case 'login': {
|
|
10030
|
-
await
|
|
10657
|
+
await ee('login', t.options.key);
|
|
10031
10658
|
break;
|
|
10032
10659
|
}
|
|
10033
10660
|
case 'logout': {
|
|
10034
|
-
await
|
|
10661
|
+
await ee('logout');
|
|
10035
10662
|
break;
|
|
10036
10663
|
}
|
|
10037
10664
|
case 'whoami': {
|
|
10038
|
-
await
|
|
10665
|
+
await ee('status');
|
|
10039
10666
|
break;
|
|
10040
10667
|
}
|
|
10041
10668
|
case 'models':
|
|
10042
10669
|
case 'list': {
|
|
10043
|
-
await
|
|
10670
|
+
await ar(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
10044
10671
|
break;
|
|
10045
10672
|
}
|
|
10046
10673
|
case 'pricing':
|
|
10047
10674
|
case 'prices': {
|
|
10048
10675
|
let r = t.options.model,
|
|
10049
|
-
|
|
10050
|
-
await
|
|
10051
|
-
model:
|
|
10676
|
+
i = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
10677
|
+
await sr({
|
|
10678
|
+
model: i,
|
|
10052
10679
|
json: !!t.options.json,
|
|
10053
10680
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
10054
10681
|
});
|
|
@@ -10057,61 +10684,61 @@ async function Ja() {
|
|
|
10057
10684
|
case 'info':
|
|
10058
10685
|
case 'show': {
|
|
10059
10686
|
(t.subcommand ||
|
|
10060
|
-
(process.stderr.write(`${
|
|
10687
|
+
(process.stderr.write(`${a.red('Error:')} Missing model slug.
|
|
10061
10688
|
`),
|
|
10062
|
-
process.stderr.write(`Usage: ${
|
|
10689
|
+
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
10063
10690
|
`),
|
|
10064
10691
|
process.exit(1)),
|
|
10065
|
-
await
|
|
10692
|
+
await nr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
10066
10693
|
break;
|
|
10067
10694
|
}
|
|
10068
10695
|
case 'upload': {
|
|
10069
10696
|
let r = t.subcommand || '';
|
|
10070
|
-
await
|
|
10697
|
+
await pr(r, t.options);
|
|
10071
10698
|
break;
|
|
10072
10699
|
}
|
|
10073
10700
|
case 'run':
|
|
10074
10701
|
case 'generate': {
|
|
10075
10702
|
let r = t.subcommand || '';
|
|
10076
|
-
await
|
|
10703
|
+
await We(r, t.options);
|
|
10077
10704
|
break;
|
|
10078
10705
|
}
|
|
10079
10706
|
case 'status': {
|
|
10080
10707
|
let r = t.subcommand || '';
|
|
10081
|
-
await
|
|
10708
|
+
await lr(r, t.options);
|
|
10082
10709
|
break;
|
|
10083
10710
|
}
|
|
10084
10711
|
case 'mcp': {
|
|
10085
|
-
let { startStdioServer: r } = await Promise.resolve().then(() => (
|
|
10712
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (Ir(), Pr));
|
|
10086
10713
|
await r();
|
|
10087
10714
|
break;
|
|
10088
10715
|
}
|
|
10089
10716
|
default: {
|
|
10090
10717
|
if (t.command && !t.command.startsWith('-')) {
|
|
10091
|
-
(!
|
|
10092
|
-
!
|
|
10718
|
+
(!j(t.command) &&
|
|
10719
|
+
!ue[t.command] &&
|
|
10093
10720
|
(process.stderr.write(`
|
|
10094
|
-
${
|
|
10095
|
-
Run ${
|
|
10721
|
+
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
10722
|
+
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
10096
10723
|
`),
|
|
10097
10724
|
process.exit(v)),
|
|
10098
|
-
await
|
|
10725
|
+
await We(t.command, t.options));
|
|
10099
10726
|
return;
|
|
10100
10727
|
}
|
|
10101
|
-
|
|
10728
|
+
vr();
|
|
10102
10729
|
break;
|
|
10103
10730
|
}
|
|
10104
10731
|
}
|
|
10105
10732
|
}
|
|
10106
|
-
|
|
10733
|
+
ha().catch((e) => {
|
|
10107
10734
|
(e instanceof w &&
|
|
10108
10735
|
(process.stderr.write(`
|
|
10109
|
-
${
|
|
10736
|
+
${a.red('Error:')} ${S(e).join(`
|
|
10110
10737
|
`)}
|
|
10111
10738
|
`),
|
|
10112
10739
|
process.exit(e.exitCode)),
|
|
10113
10740
|
process.stderr.write(`
|
|
10114
|
-
${
|
|
10741
|
+
${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
10115
10742
|
`),
|
|
10116
10743
|
process.exit(v));
|
|
10117
10744
|
});
|