@teinai/cli 1.1.13 → 1.1.14
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 +463 -455
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
3
|
+
var Qt = Object.create;
|
|
4
4
|
var fe = Object.defineProperty;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
5
|
+
var Xt = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var Zt = Object.getOwnPropertyNames;
|
|
7
|
+
var ei = Object.getPrototypeOf,
|
|
8
|
+
ti = Object.prototype.hasOwnProperty;
|
|
9
9
|
var b = (e, t, i) => () => {
|
|
10
10
|
if (i) throw i[0];
|
|
11
11
|
try {
|
|
@@ -14,20 +14,20 @@ var b = (e, t, i) => () => {
|
|
|
14
14
|
throw ((i = [r]), r);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var ii = (e, t) => {
|
|
18
18
|
for (var i in t) fe(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
ri = (e, t, i, r) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let n of
|
|
23
|
-
!
|
|
22
|
+
for (let n of Zt(t))
|
|
23
|
+
!ti.call(e, n) &&
|
|
24
24
|
n !== i &&
|
|
25
|
-
fe(e, n, { get: () => t[n], enumerable: !(r =
|
|
25
|
+
fe(e, n, { get: () => t[n], enumerable: !(r = Xt(t, n)) || r.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
28
|
var I = (e, t, i) => (
|
|
29
|
-
(i = e != null ?
|
|
30
|
-
|
|
29
|
+
(i = e != null ? Qt(ei(e)) : {}),
|
|
30
|
+
ri(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
32
|
function L() {
|
|
33
33
|
try {
|
|
@@ -67,41 +67,41 @@ function ie() {
|
|
|
67
67
|
return D;
|
|
68
68
|
}
|
|
69
69
|
var C,
|
|
70
|
-
|
|
70
|
+
He,
|
|
71
71
|
ge,
|
|
72
72
|
te,
|
|
73
73
|
D,
|
|
74
74
|
E = b(() => {
|
|
75
75
|
'use strict';
|
|
76
76
|
((C = I(require('node:fs'))),
|
|
77
|
-
(
|
|
77
|
+
(He = I(require('node:os'))),
|
|
78
78
|
(ge = I(require('node:path'))),
|
|
79
|
-
(te = ge.default.join(
|
|
79
|
+
(te = ge.default.join(He.default.homedir(), '.tein')),
|
|
80
80
|
(D = ge.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
He,
|
|
82
|
+
var pi,
|
|
84
83
|
ze,
|
|
85
|
-
We
|
|
84
|
+
We,
|
|
85
|
+
Ye = b(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
87
|
+
((pi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(ze = [...pi, 'auto']),
|
|
89
|
+
(We =
|
|
90
90
|
'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
|
|
91
91
|
});
|
|
92
92
|
var B,
|
|
93
|
-
|
|
93
|
+
be = b(() => {
|
|
94
94
|
'use strict';
|
|
95
95
|
B = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function we(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var Qe = b(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var re,
|
|
104
|
-
|
|
104
|
+
Xe = b(() => {
|
|
105
105
|
'use strict';
|
|
106
106
|
re = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
@@ -192,108 +192,108 @@ var re,
|
|
|
192
192
|
variants: [
|
|
193
193
|
{
|
|
194
194
|
id: '4k-with-video',
|
|
195
|
-
price: { starter: 0.
|
|
195
|
+
price: { starter: 0.8103, plus: 0.709, scale: 0.6673 },
|
|
196
196
|
label: '4K \xB7 Omni Reference \xB7 with reference video',
|
|
197
197
|
resolution: '4k',
|
|
198
198
|
task: 'omni',
|
|
199
199
|
withVideo: !0,
|
|
200
|
-
unfiltered: { starter: 0.
|
|
201
|
-
priority: { starter: 0.
|
|
202
|
-
unfilteredPriority: { starter: 0.
|
|
203
|
-
draft: { starter: 0.
|
|
204
|
-
unfilteredDraft: { starter: 0.
|
|
205
|
-
priorityDraft: { starter: 0.
|
|
206
|
-
unfilteredPriorityDraft: { starter: 0.
|
|
200
|
+
unfiltered: { starter: 0.8508, plus: 0.7444, scale: 0.7006 },
|
|
201
|
+
priority: { starter: 0.8589, plus: 0.7515, scale: 0.7073 },
|
|
202
|
+
unfilteredPriority: { starter: 0.9018, plus: 0.789, scale: 0.7426 },
|
|
203
|
+
draft: { starter: 0.8103, plus: 0.709, scale: 0.6673 },
|
|
204
|
+
unfilteredDraft: { starter: 0.8508, plus: 0.7444, scale: 0.7006 },
|
|
205
|
+
priorityDraft: { starter: 0.8589, plus: 0.7515, scale: 0.7073 },
|
|
206
|
+
unfilteredPriorityDraft: { starter: 0.9018, plus: 0.789, scale: 0.7426 },
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
id: '4k-no-video',
|
|
210
|
-
price: { starter: 1.
|
|
210
|
+
price: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
|
|
211
211
|
label: '4K \xB7 Text to Video',
|
|
212
212
|
resolution: '4k',
|
|
213
213
|
task: 't2v',
|
|
214
214
|
withVideo: !1,
|
|
215
|
-
unfiltered: { starter: 1.
|
|
216
|
-
priority: { starter: 1.
|
|
217
|
-
unfilteredPriority: { starter: 1.
|
|
218
|
-
draft: { starter: 1.
|
|
219
|
-
unfilteredDraft: { starter: 1.
|
|
220
|
-
priorityDraft: { starter: 1.
|
|
221
|
-
unfilteredPriorityDraft: { starter: 1.
|
|
215
|
+
unfiltered: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
|
|
216
|
+
priority: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
|
|
217
|
+
unfilteredPriority: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
|
|
218
|
+
draft: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
|
|
219
|
+
unfilteredDraft: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
|
|
220
|
+
priorityDraft: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
|
|
221
|
+
unfilteredPriorityDraft: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
224
|
id: '4k-with-video-extend',
|
|
225
|
-
price: { starter: 0.
|
|
225
|
+
price: { starter: 0.8105, plus: 0.7092, scale: 0.6673 },
|
|
226
226
|
label: '4K \xB7 Extend \xB7 with reference video',
|
|
227
227
|
resolution: '4k',
|
|
228
228
|
task: 'extend',
|
|
229
229
|
withVideo: !0,
|
|
230
|
-
unfiltered: { starter: 0.
|
|
231
|
-
priority: { starter: 0.
|
|
232
|
-
unfilteredPriority: { starter: 0.
|
|
233
|
-
draft: { starter: 0.
|
|
234
|
-
unfilteredDraft: { starter: 0.
|
|
235
|
-
priorityDraft: { starter: 0.
|
|
236
|
-
unfilteredPriorityDraft: { starter: 0.
|
|
230
|
+
unfiltered: { starter: 0.851, plus: 0.7446, scale: 0.7006 },
|
|
231
|
+
priority: { starter: 0.8591, plus: 0.7517, scale: 0.7073 },
|
|
232
|
+
unfilteredPriority: { starter: 0.902, plus: 0.7892, scale: 0.7426 },
|
|
233
|
+
draft: { starter: 0.8105, plus: 0.7092, scale: 0.6673 },
|
|
234
|
+
unfilteredDraft: { starter: 0.851, plus: 0.7446, scale: 0.7006 },
|
|
235
|
+
priorityDraft: { starter: 0.8591, plus: 0.7517, scale: 0.7073 },
|
|
236
|
+
unfilteredPriorityDraft: { starter: 0.902, plus: 0.7892, scale: 0.7426 },
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
id: '4k-with-video-edit',
|
|
240
|
-
price: { starter: 0.
|
|
240
|
+
price: { starter: 0.8109, plus: 0.7096, scale: 0.6673 },
|
|
241
241
|
label: '4K \xB7 Edit \xB7 with reference video',
|
|
242
242
|
resolution: '4k',
|
|
243
243
|
task: 'edit',
|
|
244
244
|
withVideo: !0,
|
|
245
|
-
unfiltered: { starter: 0.
|
|
246
|
-
priority: { starter: 0.
|
|
247
|
-
unfilteredPriority: { starter: 0.
|
|
248
|
-
draft: { starter: 0.
|
|
249
|
-
unfilteredDraft: { starter: 0.
|
|
250
|
-
priorityDraft: { starter: 0.
|
|
251
|
-
unfilteredPriorityDraft: { starter: 0.
|
|
245
|
+
unfiltered: { starter: 0.8514, plus: 0.745, scale: 0.7006 },
|
|
246
|
+
priority: { starter: 0.8595, plus: 0.7521, scale: 0.7073 },
|
|
247
|
+
unfilteredPriority: { starter: 0.9024, plus: 0.7897, scale: 0.7426 },
|
|
248
|
+
draft: { starter: 0.8109, plus: 0.7096, scale: 0.6673 },
|
|
249
|
+
unfilteredDraft: { starter: 0.8514, plus: 0.745, scale: 0.7006 },
|
|
250
|
+
priorityDraft: { starter: 0.8595, plus: 0.7521, scale: 0.7073 },
|
|
251
|
+
unfilteredPriorityDraft: { starter: 0.9024, plus: 0.7897, scale: 0.7426 },
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
id: '4k-no-video-i2v',
|
|
255
|
-
price: { starter: 1.
|
|
255
|
+
price: { starter: 1.3195, plus: 1.1546, scale: 1.0862 },
|
|
256
256
|
label: '4K \xB7 Image to Video',
|
|
257
257
|
resolution: '4k',
|
|
258
258
|
task: 'i2v',
|
|
259
259
|
withVideo: !1,
|
|
260
|
-
unfiltered: { starter: 1.
|
|
261
|
-
priority: { starter: 1.
|
|
262
|
-
unfilteredPriority: { starter: 1.
|
|
263
|
-
draft: { starter: 1.
|
|
264
|
-
unfilteredDraft: { starter: 1.
|
|
265
|
-
priorityDraft: { starter: 1.
|
|
266
|
-
unfilteredPriorityDraft: { starter: 1.
|
|
260
|
+
unfiltered: { starter: 1.3854, plus: 1.2123, scale: 1.1405 },
|
|
261
|
+
priority: { starter: 1.3986, plus: 1.2238, scale: 1.1513 },
|
|
262
|
+
unfilteredPriority: { starter: 1.4685, plus: 1.285, scale: 1.2089 },
|
|
263
|
+
draft: { starter: 1.3195, plus: 1.1546, scale: 1.0862 },
|
|
264
|
+
unfilteredDraft: { starter: 1.3854, plus: 1.2123, scale: 1.1405 },
|
|
265
|
+
priorityDraft: { starter: 1.3986, plus: 1.2238, scale: 1.1513 },
|
|
266
|
+
unfilteredPriorityDraft: { starter: 1.4685, plus: 1.285, scale: 1.2089 },
|
|
267
267
|
},
|
|
268
268
|
{
|
|
269
269
|
id: '4k-no-video-frames',
|
|
270
|
-
price: { starter: 1.
|
|
270
|
+
price: { starter: 1.3199, plus: 1.1549, scale: 1.0862 },
|
|
271
271
|
label: '4K \xB7 First & Last Frame',
|
|
272
272
|
resolution: '4k',
|
|
273
273
|
task: 'frames',
|
|
274
274
|
withVideo: !1,
|
|
275
|
-
unfiltered: { starter: 1.
|
|
276
|
-
priority: { starter: 1.
|
|
277
|
-
unfilteredPriority: { starter: 1.
|
|
278
|
-
draft: { starter: 1.
|
|
279
|
-
unfilteredDraft: { starter: 1.
|
|
280
|
-
priorityDraft: { starter: 1.
|
|
281
|
-
unfilteredPriorityDraft: { starter: 1.
|
|
275
|
+
unfiltered: { starter: 1.3858, plus: 1.2126, scale: 1.1405 },
|
|
276
|
+
priority: { starter: 1.399, plus: 1.2241, scale: 1.1513 },
|
|
277
|
+
unfilteredPriority: { starter: 1.4689, plus: 1.2853, scale: 1.2089 },
|
|
278
|
+
draft: { starter: 1.3199, plus: 1.1549, scale: 1.0862 },
|
|
279
|
+
unfilteredDraft: { starter: 1.3858, plus: 1.2126, scale: 1.1405 },
|
|
280
|
+
priorityDraft: { starter: 1.399, plus: 1.2241, scale: 1.1513 },
|
|
281
|
+
unfilteredPriorityDraft: { starter: 1.4689, plus: 1.2853, scale: 1.2089 },
|
|
282
282
|
},
|
|
283
283
|
{
|
|
284
284
|
id: '4k-no-video-omni',
|
|
285
|
-
price: { starter: 1.
|
|
285
|
+
price: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
|
|
286
286
|
label: '4K \xB7 Omni Reference',
|
|
287
287
|
resolution: '4k',
|
|
288
288
|
task: 'omni',
|
|
289
289
|
withVideo: !1,
|
|
290
|
-
unfiltered: { starter: 1.
|
|
291
|
-
priority: { starter: 1.
|
|
292
|
-
unfilteredPriority: { starter: 1.
|
|
293
|
-
draft: { starter: 1.
|
|
294
|
-
unfilteredDraft: { starter: 1.
|
|
295
|
-
priorityDraft: { starter: 1.
|
|
296
|
-
unfilteredPriorityDraft: { starter: 1.
|
|
290
|
+
unfiltered: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
|
|
291
|
+
priority: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
|
|
292
|
+
unfilteredPriority: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
|
|
293
|
+
draft: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
|
|
294
|
+
unfilteredDraft: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
|
|
295
|
+
priorityDraft: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
|
|
296
|
+
unfilteredPriorityDraft: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
id: '1080p-with-video',
|
|
@@ -4627,10 +4627,10 @@ var re,
|
|
|
4627
4627
|
],
|
|
4628
4628
|
};
|
|
4629
4629
|
});
|
|
4630
|
-
function
|
|
4630
|
+
function ve(e, t) {
|
|
4631
4631
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4632
4632
|
}
|
|
4633
|
-
function
|
|
4633
|
+
function ci(e, t) {
|
|
4634
4634
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4635
4635
|
if (e !== 'seedance-2') return;
|
|
4636
4636
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -4640,79 +4640,79 @@ function di(e, t) {
|
|
|
4640
4640
|
? 'fast'
|
|
4641
4641
|
: 'standard';
|
|
4642
4642
|
}
|
|
4643
|
-
function
|
|
4643
|
+
function ui(e, t) {
|
|
4644
4644
|
let i = e
|
|
4645
4645
|
.trim()
|
|
4646
4646
|
.toLowerCase()
|
|
4647
4647
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4648
4648
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
4649
|
-
let n =
|
|
4650
|
-
s =
|
|
4649
|
+
let n = ci(i, t),
|
|
4650
|
+
s = ke.get(ve('seedance-2', n));
|
|
4651
4651
|
return s ? s.slug : null;
|
|
4652
4652
|
}
|
|
4653
|
-
let r = ae.get(i) ??
|
|
4653
|
+
let r = ae.get(i) ?? ke.get(ve(i));
|
|
4654
4654
|
return r ? r.slug : null;
|
|
4655
4655
|
}
|
|
4656
|
-
function
|
|
4657
|
-
return ae.has(e) && !(
|
|
4656
|
+
function fi(e, t) {
|
|
4657
|
+
return ae.has(e) && !(mi.has(e) && t) ? e : ui(e, t);
|
|
4658
4658
|
}
|
|
4659
4659
|
function F(e, t) {
|
|
4660
|
-
let i =
|
|
4660
|
+
let i = fi(e, t);
|
|
4661
4661
|
return i ? (ae.get(i) ?? null) : null;
|
|
4662
4662
|
}
|
|
4663
4663
|
function ne() {
|
|
4664
|
-
return
|
|
4664
|
+
return Ie.models;
|
|
4665
4665
|
}
|
|
4666
|
-
var
|
|
4666
|
+
var Ie,
|
|
4667
4667
|
ae,
|
|
4668
|
-
we,
|
|
4669
|
-
Xe,
|
|
4670
|
-
pi,
|
|
4671
4668
|
ke,
|
|
4672
|
-
|
|
4669
|
+
Ze,
|
|
4670
|
+
di,
|
|
4671
|
+
xe,
|
|
4672
|
+
mi,
|
|
4673
4673
|
V = b(() => {
|
|
4674
4674
|
'use strict';
|
|
4675
|
-
Ye();
|
|
4676
4675
|
Qe();
|
|
4677
|
-
(
|
|
4676
|
+
Xe();
|
|
4677
|
+
((Ie = {
|
|
4678
4678
|
...re,
|
|
4679
|
-
families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !
|
|
4680
|
-
models: re.models.filter((e) => !
|
|
4679
|
+
families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
|
|
4680
|
+
models: re.models.filter((e) => !we(e.slug)),
|
|
4681
4681
|
}),
|
|
4682
4682
|
(ae = new Map()),
|
|
4683
|
-
(
|
|
4684
|
-
(
|
|
4685
|
-
(
|
|
4686
|
-
(
|
|
4687
|
-
for (let e of
|
|
4688
|
-
(ae.set(e.slug, e),
|
|
4689
|
-
for (let t of e.variants)
|
|
4683
|
+
(ke = new Map()),
|
|
4684
|
+
(Ze = new Map()),
|
|
4685
|
+
(di = new Map()),
|
|
4686
|
+
(xe = new Map()));
|
|
4687
|
+
for (let e of Ie.models) {
|
|
4688
|
+
(ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
|
|
4689
|
+
for (let t of e.variants) Ze.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4690
4690
|
for (let t of e.editVariants ?? [])
|
|
4691
|
-
|
|
4692
|
-
for (let t of e.addons ?? [])
|
|
4693
|
-
|
|
4691
|
+
Ze.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4692
|
+
for (let t of e.addons ?? []) di.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4693
|
+
xe.set(e.slug, e.family);
|
|
4694
4694
|
}
|
|
4695
|
-
for (let e of
|
|
4696
|
-
|
|
4695
|
+
for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
|
|
4696
|
+
mi = new Set(['seedance-2']);
|
|
4697
4697
|
});
|
|
4698
4698
|
function se(e) {
|
|
4699
4699
|
let t = e.from?.variant;
|
|
4700
4700
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
4701
4701
|
}
|
|
4702
|
-
function
|
|
4702
|
+
function _e(e) {
|
|
4703
4703
|
if (e.endpoints?.length)
|
|
4704
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
4705
|
-
?
|
|
4704
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === et)
|
|
4705
|
+
? et
|
|
4706
4706
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4707
4707
|
}
|
|
4708
|
-
var
|
|
4709
|
-
|
|
4708
|
+
var et,
|
|
4709
|
+
Pe = b(() => {
|
|
4710
4710
|
'use strict';
|
|
4711
4711
|
V();
|
|
4712
|
-
|
|
4712
|
+
et = 'dynamic';
|
|
4713
4713
|
});
|
|
4714
4714
|
var oe,
|
|
4715
|
-
|
|
4715
|
+
Te = b(() => {
|
|
4716
4716
|
'use strict';
|
|
4717
4717
|
oe = {
|
|
4718
4718
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -4722,29 +4722,29 @@ var oe,
|
|
|
4722
4722
|
'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
|
|
4723
4723
|
};
|
|
4724
4724
|
});
|
|
4725
|
-
var
|
|
4725
|
+
var tt = b(() => {
|
|
4726
4726
|
'use strict';
|
|
4727
4727
|
});
|
|
4728
|
-
function
|
|
4729
|
-
return typeof t == 'string' && (
|
|
4728
|
+
function it(e, t) {
|
|
4729
|
+
return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
|
|
4730
4730
|
}
|
|
4731
|
-
var
|
|
4732
|
-
|
|
4731
|
+
var gi,
|
|
4732
|
+
rt = b(() => {
|
|
4733
4733
|
'use strict';
|
|
4734
4734
|
V();
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4735
|
+
Pe();
|
|
4736
|
+
tt();
|
|
4737
|
+
gi = {};
|
|
4738
4738
|
});
|
|
4739
|
-
function
|
|
4740
|
-
return e === 'nano-banana-pro' ?
|
|
4739
|
+
function at(e) {
|
|
4740
|
+
return e === 'nano-banana-pro' ? hi : yi;
|
|
4741
4741
|
}
|
|
4742
|
-
var
|
|
4743
|
-
|
|
4744
|
-
|
|
4742
|
+
var hi,
|
|
4743
|
+
yi,
|
|
4744
|
+
nt = b(() => {
|
|
4745
4745
|
'use strict';
|
|
4746
|
-
((
|
|
4747
|
-
(
|
|
4746
|
+
((hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
4747
|
+
(yi = [
|
|
4748
4748
|
'auto',
|
|
4749
4749
|
'1:1',
|
|
4750
4750
|
'1:4',
|
|
@@ -4762,10 +4762,10 @@ var gi,
|
|
|
4762
4762
|
'21:9',
|
|
4763
4763
|
]));
|
|
4764
4764
|
});
|
|
4765
|
-
var
|
|
4766
|
-
|
|
4765
|
+
var st,
|
|
4766
|
+
ot = b(() => {
|
|
4767
4767
|
'use strict';
|
|
4768
|
-
|
|
4768
|
+
st = [
|
|
4769
4769
|
'prompt',
|
|
4770
4770
|
'system',
|
|
4771
4771
|
'messages',
|
|
@@ -4779,10 +4779,10 @@ var nt,
|
|
|
4779
4779
|
'endpoint',
|
|
4780
4780
|
];
|
|
4781
4781
|
});
|
|
4782
|
-
var
|
|
4783
|
-
|
|
4782
|
+
var lt,
|
|
4783
|
+
pt = b(() => {
|
|
4784
4784
|
'use strict';
|
|
4785
|
-
|
|
4785
|
+
lt = [
|
|
4786
4786
|
{
|
|
4787
4787
|
slug: 'claude-fable-5-1',
|
|
4788
4788
|
family: 'fable-5-1',
|
|
@@ -4851,13 +4851,13 @@ var ot,
|
|
|
4851
4851
|
},
|
|
4852
4852
|
];
|
|
4853
4853
|
});
|
|
4854
|
-
function
|
|
4854
|
+
function dt(e) {
|
|
4855
4855
|
return `$${e}`;
|
|
4856
4856
|
}
|
|
4857
|
-
function
|
|
4857
|
+
function Me(e, t, i) {
|
|
4858
4858
|
return F(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
4859
4859
|
}
|
|
4860
|
-
function
|
|
4860
|
+
function bi(e) {
|
|
4861
4861
|
return [
|
|
4862
4862
|
{
|
|
4863
4863
|
name: 'prompt',
|
|
@@ -4923,13 +4923,13 @@ function yi(e) {
|
|
|
4923
4923
|
},
|
|
4924
4924
|
];
|
|
4925
4925
|
}
|
|
4926
|
-
function
|
|
4926
|
+
function ct() {
|
|
4927
4927
|
return Object.fromEntries(
|
|
4928
|
-
|
|
4929
|
-
let t =
|
|
4930
|
-
i =
|
|
4931
|
-
r =
|
|
4932
|
-
n = t != null && i != null ? `${
|
|
4928
|
+
lt.map((e) => {
|
|
4929
|
+
let t = Me(e.slug, 'cheap', 'input'),
|
|
4930
|
+
i = Me(e.slug, 'cheap', 'output'),
|
|
4931
|
+
r = Me(e.slug, 'stable', 'input') != null,
|
|
4932
|
+
n = t != null && i != null ? `${dt(t)}/M in \xB7 ${dt(i)}/M out` : '',
|
|
4933
4933
|
s = {
|
|
4934
4934
|
slug: e.slug,
|
|
4935
4935
|
name: e.name,
|
|
@@ -4940,20 +4940,20 @@ function dt() {
|
|
|
4940
4940
|
priceFormatted: n,
|
|
4941
4941
|
unit: '/M tokens',
|
|
4942
4942
|
primaryToolName: 'run_task',
|
|
4943
|
-
parameters:
|
|
4943
|
+
parameters: bi(r),
|
|
4944
4944
|
};
|
|
4945
4945
|
return [e.slug, s];
|
|
4946
4946
|
}),
|
|
4947
4947
|
);
|
|
4948
4948
|
}
|
|
4949
|
-
var
|
|
4949
|
+
var ut = b(() => {
|
|
4950
4950
|
'use strict';
|
|
4951
|
-
|
|
4951
|
+
pt();
|
|
4952
4952
|
V();
|
|
4953
4953
|
});
|
|
4954
4954
|
var G,
|
|
4955
4955
|
le,
|
|
4956
|
-
|
|
4956
|
+
Ke = b(() => {
|
|
4957
4957
|
'use strict';
|
|
4958
4958
|
((G = ['seedance-2-5', 'seedance-2', 'seedance-2-mini', 'seedream-5-pro', 'wan-3-0']),
|
|
4959
4959
|
(le =
|
|
@@ -4962,7 +4962,7 @@ var G,
|
|
|
4962
4962
|
function J(e) {
|
|
4963
4963
|
return `$${Number(e.toFixed(5))}`;
|
|
4964
4964
|
}
|
|
4965
|
-
function
|
|
4965
|
+
function vi(e) {
|
|
4966
4966
|
if (e.kind === 'llm') {
|
|
4967
4967
|
let t = e.defaultEndpoint,
|
|
4968
4968
|
i = (s) =>
|
|
@@ -4980,14 +4980,14 @@ function xi(e) {
|
|
|
4980
4980
|
}
|
|
4981
4981
|
return `from ${J(se(e).price.starter)}${e.unit}`;
|
|
4982
4982
|
}
|
|
4983
|
-
function
|
|
4983
|
+
function Ii(e, t) {
|
|
4984
4984
|
let i = t.filter((r) => Number.isFinite(r) && r > 0);
|
|
4985
4985
|
return i.length ? `from ${J(Math.min(...i))}${e}` : null;
|
|
4986
4986
|
}
|
|
4987
|
-
function
|
|
4987
|
+
function ht(e) {
|
|
4988
4988
|
for (let t of B) {
|
|
4989
4989
|
let i = de[t],
|
|
4990
|
-
r = i ?
|
|
4990
|
+
r = i ? Ii(i.unit, e[t] ?? []) : null;
|
|
4991
4991
|
i && r && (i.priceFormatted = r);
|
|
4992
4992
|
}
|
|
4993
4993
|
}
|
|
@@ -5003,13 +5003,13 @@ function H(e, t) {
|
|
|
5003
5003
|
...(t ? { description: t } : {}),
|
|
5004
5004
|
};
|
|
5005
5005
|
}
|
|
5006
|
-
function
|
|
5006
|
+
function yt(e) {
|
|
5007
5007
|
if (!e.endpoints?.length) return null;
|
|
5008
|
-
let t = e.endpoints.filter((i) =>
|
|
5008
|
+
let t = e.endpoints.filter((i) => it(e.slug, i.id));
|
|
5009
5009
|
return {
|
|
5010
5010
|
name: 'endpoint',
|
|
5011
5011
|
type: 'select',
|
|
5012
|
-
default:
|
|
5012
|
+
default: _e(e),
|
|
5013
5013
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
5014
5014
|
description:
|
|
5015
5015
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -5018,20 +5018,20 @@ function ht(e) {
|
|
|
5018
5018
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
5019
5019
|
};
|
|
5020
5020
|
}
|
|
5021
|
-
function
|
|
5021
|
+
function Ti(e, t) {
|
|
5022
5022
|
if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
|
|
5023
5023
|
let i = G.includes(e.api.model);
|
|
5024
|
-
return [...t.filter((r) => !
|
|
5024
|
+
return [...t.filter((r) => !Ee.has(r.name)), i ? bt : _i];
|
|
5025
5025
|
}
|
|
5026
|
-
function
|
|
5027
|
-
let i = e.filter((n) => !
|
|
5028
|
-
r = [
|
|
5029
|
-
return (r.push(
|
|
5026
|
+
function Se(e, t) {
|
|
5027
|
+
let i = e.filter((n) => !Ee.has(n.name)),
|
|
5028
|
+
r = [bt, Pi];
|
|
5029
|
+
return (r.push(wt, kt), [...i, ...r]);
|
|
5030
5030
|
}
|
|
5031
|
-
function
|
|
5031
|
+
function mt(e, t = {}) {
|
|
5032
5032
|
return [
|
|
5033
5033
|
...e
|
|
5034
|
-
.filter((i) => !
|
|
5034
|
+
.filter((i) => !Mi.has(i.name) && !Ee.has(i.name))
|
|
5035
5035
|
.map((i) =>
|
|
5036
5036
|
i.name === 'prompt'
|
|
5037
5037
|
? { ...i, required: !0 }
|
|
@@ -5052,11 +5052,11 @@ function ut(e, t = {}) {
|
|
|
5052
5052
|
options: ['standard'],
|
|
5053
5053
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5054
5054
|
},
|
|
5055
|
-
bt,
|
|
5056
5055
|
wt,
|
|
5056
|
+
kt,
|
|
5057
5057
|
];
|
|
5058
5058
|
}
|
|
5059
|
-
function
|
|
5059
|
+
function $e(e, t) {
|
|
5060
5060
|
return [
|
|
5061
5061
|
$('Text prompt describing the video.'),
|
|
5062
5062
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -5085,8 +5085,8 @@ function Se(e, t) {
|
|
|
5085
5085
|
),
|
|
5086
5086
|
];
|
|
5087
5087
|
}
|
|
5088
|
-
function
|
|
5089
|
-
let t =
|
|
5088
|
+
function Ki(e) {
|
|
5089
|
+
let t = yt(e);
|
|
5090
5090
|
return [
|
|
5091
5091
|
$('Image prompt text. Supports complex composition and text instructions.'),
|
|
5092
5092
|
...(t ? [t] : []),
|
|
@@ -5099,14 +5099,14 @@ function Mi(e) {
|
|
|
5099
5099
|
H(
|
|
5100
5100
|
e,
|
|
5101
5101
|
e.slug === 'gpt-image-2'
|
|
5102
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
5102
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${We}`
|
|
5103
5103
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
5104
5104
|
),
|
|
5105
5105
|
{
|
|
5106
5106
|
name: 'aspect_ratio',
|
|
5107
5107
|
type: 'select',
|
|
5108
5108
|
default: 'auto',
|
|
5109
|
-
options: [...
|
|
5109
|
+
options: [...ze],
|
|
5110
5110
|
description:
|
|
5111
5111
|
"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.",
|
|
5112
5112
|
},
|
|
@@ -5153,7 +5153,7 @@ function Mi(e) {
|
|
|
5153
5153
|
},
|
|
5154
5154
|
];
|
|
5155
5155
|
}
|
|
5156
|
-
function
|
|
5156
|
+
function Si(e) {
|
|
5157
5157
|
return [
|
|
5158
5158
|
$('Image prompt text.'),
|
|
5159
5159
|
{
|
|
@@ -5161,7 +5161,7 @@ function Ki(e) {
|
|
|
5161
5161
|
type: 'string[]',
|
|
5162
5162
|
description: 'Images to edit or use as reference (up to 14).',
|
|
5163
5163
|
},
|
|
5164
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
5164
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...at(e.slug)] },
|
|
5165
5165
|
H(e),
|
|
5166
5166
|
{
|
|
5167
5167
|
name: 'n',
|
|
@@ -5187,10 +5187,10 @@ function Ki(e) {
|
|
|
5187
5187
|
},
|
|
5188
5188
|
];
|
|
5189
5189
|
}
|
|
5190
|
-
function
|
|
5191
|
-
let e =
|
|
5190
|
+
function qi() {
|
|
5191
|
+
let e = st,
|
|
5192
5192
|
t = [];
|
|
5193
|
-
for (let i of
|
|
5193
|
+
for (let i of xt(!0))
|
|
5194
5194
|
e.includes(i.name) &&
|
|
5195
5195
|
(t.push({
|
|
5196
5196
|
...i,
|
|
@@ -5212,7 +5212,7 @@ function Ei() {
|
|
|
5212
5212
|
}));
|
|
5213
5213
|
return t;
|
|
5214
5214
|
}
|
|
5215
|
-
function
|
|
5215
|
+
function xt(e) {
|
|
5216
5216
|
return [
|
|
5217
5217
|
$('The user message or task.'),
|
|
5218
5218
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -5307,37 +5307,37 @@ function kt(e) {
|
|
|
5307
5307
|
},
|
|
5308
5308
|
];
|
|
5309
5309
|
}
|
|
5310
|
-
function
|
|
5311
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5312
|
-
let t =
|
|
5310
|
+
function Ai(e) {
|
|
5311
|
+
if (e.slug === 'seed-2-1-turbo') return Ci;
|
|
5312
|
+
let t = yt(e);
|
|
5313
5313
|
return [
|
|
5314
5314
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5315
|
-
?
|
|
5316
|
-
: e.slug === 'gpt-6-astra' ||
|
|
5317
|
-
?
|
|
5318
|
-
:
|
|
5315
|
+
? qi()
|
|
5316
|
+
: e.slug === 'gpt-6-astra' || Ei.includes(e.slug)
|
|
5317
|
+
? xt(e.slug !== 'gpt-6-astra')
|
|
5318
|
+
: $i),
|
|
5319
5319
|
...(t ? [t] : []),
|
|
5320
5320
|
];
|
|
5321
5321
|
}
|
|
5322
|
-
function
|
|
5322
|
+
function Ri(e) {
|
|
5323
5323
|
let t = e.slug;
|
|
5324
|
-
if (e.kind === 'llm') return
|
|
5325
|
-
if (e.editVariants?.length) return
|
|
5324
|
+
if (e.kind === 'llm') return Ai(e);
|
|
5325
|
+
if (e.editVariants?.length) return Ki(e);
|
|
5326
5326
|
switch (t) {
|
|
5327
5327
|
case 'seedance-2-5':
|
|
5328
|
-
return
|
|
5328
|
+
return Se(ft, t);
|
|
5329
5329
|
case 'seedance-2-5-lite':
|
|
5330
|
-
return
|
|
5330
|
+
return mt(ft, { no4k: !0 });
|
|
5331
5331
|
case 'seedance-2':
|
|
5332
|
-
return
|
|
5332
|
+
return Se(gt, t);
|
|
5333
5333
|
case 'seedance-2-lite':
|
|
5334
|
-
return
|
|
5334
|
+
return mt(gt);
|
|
5335
5335
|
case 'seedance-2-mini':
|
|
5336
|
-
return
|
|
5336
|
+
return Se(Oi, t);
|
|
5337
5337
|
case 'nano-banana-2':
|
|
5338
5338
|
case 'nano-banana-2.1':
|
|
5339
5339
|
case 'nano-banana-pro':
|
|
5340
|
-
return
|
|
5340
|
+
return Si(e);
|
|
5341
5341
|
case 'seedream-5-pro':
|
|
5342
5342
|
return [
|
|
5343
5343
|
$('Detailed description of the image to generate.'),
|
|
@@ -5400,7 +5400,7 @@ function Ai(e) {
|
|
|
5400
5400
|
];
|
|
5401
5401
|
case 'wan-3-0':
|
|
5402
5402
|
case 'wan-3-0-prime':
|
|
5403
|
-
return
|
|
5403
|
+
return $e(e, {
|
|
5404
5404
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5405
5405
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
5406
5406
|
minSec: 2,
|
|
@@ -5410,7 +5410,7 @@ function Ai(e) {
|
|
|
5410
5410
|
});
|
|
5411
5411
|
case 'happy-horse-1-1':
|
|
5412
5412
|
case 'happy-horse-1-0':
|
|
5413
|
-
return
|
|
5413
|
+
return $e(e, {
|
|
5414
5414
|
modes:
|
|
5415
5415
|
t === 'happy-horse-1-0'
|
|
5416
5416
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -5421,7 +5421,7 @@ function Ai(e) {
|
|
|
5421
5421
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
5422
5422
|
});
|
|
5423
5423
|
case 'minimax-h3':
|
|
5424
|
-
return
|
|
5424
|
+
return $e(e, {
|
|
5425
5425
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5426
5426
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
5427
5427
|
minSec: 4,
|
|
@@ -5432,37 +5432,37 @@ function Ai(e) {
|
|
|
5432
5432
|
return [$('Prompt text.')];
|
|
5433
5433
|
}
|
|
5434
5434
|
}
|
|
5435
|
-
function
|
|
5435
|
+
function Ce(e, t = e.api.model) {
|
|
5436
5436
|
return {
|
|
5437
5437
|
slug: t,
|
|
5438
5438
|
name: e.name,
|
|
5439
|
-
category:
|
|
5440
|
-
kind:
|
|
5439
|
+
category: wi[e.kind],
|
|
5440
|
+
kind: xi[e.kind],
|
|
5441
5441
|
vendor: e.vendor ?? '',
|
|
5442
5442
|
description: e.desc ?? e.name,
|
|
5443
|
-
priceFormatted:
|
|
5443
|
+
priceFormatted: vi(e),
|
|
5444
5444
|
unit: e.unit,
|
|
5445
|
-
primaryToolName:
|
|
5446
|
-
parameters:
|
|
5445
|
+
primaryToolName: ki[e.kind],
|
|
5446
|
+
parameters: Ti(e, Ri(e)),
|
|
5447
5447
|
};
|
|
5448
5448
|
}
|
|
5449
|
-
function
|
|
5449
|
+
function Di() {
|
|
5450
5450
|
let e = {};
|
|
5451
5451
|
for (let t of ne())
|
|
5452
5452
|
if (t.slug !== 'seedance-2-fast') {
|
|
5453
5453
|
if (t.slug === 'seedance-2-mini') {
|
|
5454
|
-
e['seedance-2-mini'] =
|
|
5454
|
+
e['seedance-2-mini'] = Ce(t, 'seedance-2-mini');
|
|
5455
5455
|
continue;
|
|
5456
5456
|
}
|
|
5457
5457
|
if (t.slug === 'seedance-2') {
|
|
5458
|
-
let i =
|
|
5458
|
+
let i = Ce(t);
|
|
5459
5459
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
5460
5460
|
(e['seedance-2'] = i));
|
|
5461
5461
|
continue;
|
|
5462
5462
|
}
|
|
5463
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
5463
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
|
|
5464
5464
|
}
|
|
5465
|
-
Object.assign(e,
|
|
5465
|
+
Object.assign(e, ct());
|
|
5466
5466
|
for (let [t, i] of Object.entries(oe))
|
|
5467
5467
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
5468
5468
|
return e;
|
|
@@ -5470,111 +5470,111 @@ function Oi() {
|
|
|
5470
5470
|
function N(e) {
|
|
5471
5471
|
return de[e] ?? null;
|
|
5472
5472
|
}
|
|
5473
|
-
function
|
|
5473
|
+
function Li(e, t, i) {
|
|
5474
5474
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5475
5475
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5476
5476
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
5477
5477
|
}
|
|
5478
5478
|
return !0;
|
|
5479
5479
|
}
|
|
5480
|
-
function
|
|
5480
|
+
function _t(e, t) {
|
|
5481
5481
|
let i = { ...t };
|
|
5482
5482
|
if (e?.slug === 'seedance-2-5') {
|
|
5483
5483
|
let r = (n) => typeof n != 'string' || !n.trim();
|
|
5484
|
-
for (let n of
|
|
5484
|
+
for (let n of Vi) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
5485
5485
|
if (!r(i.finalize)) return i;
|
|
5486
5486
|
}
|
|
5487
5487
|
for (let r of e?.parameters ?? [])
|
|
5488
5488
|
r.default !== void 0 &&
|
|
5489
5489
|
i[r.name] === void 0 &&
|
|
5490
|
-
|
|
5490
|
+
Li(e.slug, r.name, t) &&
|
|
5491
5491
|
(i[r.name] = r.default);
|
|
5492
5492
|
return i;
|
|
5493
5493
|
}
|
|
5494
5494
|
function q() {
|
|
5495
5495
|
return Object.values(de);
|
|
5496
5496
|
}
|
|
5497
|
-
var
|
|
5498
|
-
wi,
|
|
5497
|
+
var wi,
|
|
5499
5498
|
ki,
|
|
5499
|
+
xi,
|
|
5500
5500
|
$,
|
|
5501
|
-
yt,
|
|
5502
|
-
Ii,
|
|
5503
|
-
_i,
|
|
5504
5501
|
bt,
|
|
5502
|
+
_i,
|
|
5503
|
+
Pi,
|
|
5505
5504
|
wt,
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5505
|
+
kt,
|
|
5506
|
+
Ee,
|
|
5507
|
+
Mi,
|
|
5509
5508
|
$i,
|
|
5510
5509
|
Ci,
|
|
5510
|
+
Ei,
|
|
5511
5511
|
pe,
|
|
5512
|
-
mt,
|
|
5513
|
-
xt,
|
|
5514
|
-
vt,
|
|
5515
5512
|
ft,
|
|
5516
|
-
|
|
5513
|
+
vt,
|
|
5514
|
+
It,
|
|
5515
|
+
gt,
|
|
5516
|
+
Oi,
|
|
5517
5517
|
de,
|
|
5518
|
-
|
|
5518
|
+
Vi,
|
|
5519
5519
|
z = b(() => {
|
|
5520
5520
|
'use strict';
|
|
5521
|
-
|
|
5522
|
-
|
|
5521
|
+
Ye();
|
|
5522
|
+
be();
|
|
5523
5523
|
V();
|
|
5524
|
-
_e();
|
|
5525
5524
|
Pe();
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
(
|
|
5532
|
-
|
|
5525
|
+
Te();
|
|
5526
|
+
rt();
|
|
5527
|
+
nt();
|
|
5528
|
+
ot();
|
|
5529
|
+
ut();
|
|
5530
|
+
Ke();
|
|
5531
|
+
((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5532
|
+
(ki = {
|
|
5533
5533
|
video: 'generate_video',
|
|
5534
5534
|
image: 'generate_image',
|
|
5535
5535
|
audio: 'generate_audio',
|
|
5536
5536
|
llm: 'run_task',
|
|
5537
5537
|
}),
|
|
5538
|
-
(
|
|
5538
|
+
(xi = {
|
|
5539
5539
|
video: 'Text-to-Video',
|
|
5540
5540
|
image: 'Text-to-Image',
|
|
5541
5541
|
audio: 'Text-to-Audio',
|
|
5542
5542
|
llm: 'Reasoning (LLM)',
|
|
5543
5543
|
}));
|
|
5544
5544
|
$ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5545
|
-
((
|
|
5545
|
+
((bt = {
|
|
5546
5546
|
name: 'creative_mode',
|
|
5547
5547
|
type: 'boolean',
|
|
5548
5548
|
default: !1,
|
|
5549
5549
|
description:
|
|
5550
5550
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5551
5551
|
}),
|
|
5552
|
-
(
|
|
5552
|
+
(_i = {
|
|
5553
5553
|
name: 'creative_mode',
|
|
5554
5554
|
type: 'boolean',
|
|
5555
5555
|
default: !1,
|
|
5556
5556
|
description: `Not available yet on this model: ${le}.`,
|
|
5557
5557
|
}),
|
|
5558
|
-
(
|
|
5558
|
+
(Pi = {
|
|
5559
5559
|
name: 'priority',
|
|
5560
5560
|
type: 'boolean',
|
|
5561
5561
|
default: !1,
|
|
5562
5562
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5563
5563
|
}),
|
|
5564
|
-
(
|
|
5564
|
+
(wt = {
|
|
5565
5565
|
name: 'reference_roles',
|
|
5566
5566
|
type: 'json',
|
|
5567
5567
|
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).`,
|
|
5568
5568
|
}),
|
|
5569
|
-
(
|
|
5569
|
+
(kt = {
|
|
5570
5570
|
name: 'auto_fit_images',
|
|
5571
5571
|
type: 'boolean',
|
|
5572
5572
|
default: !1,
|
|
5573
5573
|
description:
|
|
5574
5574
|
'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.',
|
|
5575
5575
|
}),
|
|
5576
|
-
(
|
|
5577
|
-
|
|
5576
|
+
(Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5577
|
+
Mi = new Set([
|
|
5578
5578
|
'quality',
|
|
5579
5579
|
'bitrate_mode',
|
|
5580
5580
|
'draft',
|
|
@@ -5583,7 +5583,7 @@ var bi,
|
|
|
5583
5583
|
'draft_generation_id',
|
|
5584
5584
|
'pass_faces',
|
|
5585
5585
|
]);
|
|
5586
|
-
((
|
|
5586
|
+
(($i = [
|
|
5587
5587
|
$('The user message or task.'),
|
|
5588
5588
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5589
5589
|
{
|
|
@@ -5601,7 +5601,7 @@ var bi,
|
|
|
5601
5601
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5602
5602
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5603
5603
|
]),
|
|
5604
|
-
(
|
|
5604
|
+
(Ci = [
|
|
5605
5605
|
$('The user message or task.'),
|
|
5606
5606
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5607
5607
|
{
|
|
@@ -5683,9 +5683,9 @@ var bi,
|
|
|
5683
5683
|
description: 'Video frames read a second.',
|
|
5684
5684
|
},
|
|
5685
5685
|
]),
|
|
5686
|
-
(
|
|
5686
|
+
(Ei = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5687
5687
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5688
|
-
(
|
|
5688
|
+
(ft = [
|
|
5689
5689
|
{
|
|
5690
5690
|
name: 'prompt',
|
|
5691
5691
|
type: 'string',
|
|
@@ -5834,19 +5834,19 @@ var bi,
|
|
|
5834
5834
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5835
5835
|
},
|
|
5836
5836
|
]),
|
|
5837
|
-
(
|
|
5837
|
+
(vt = {
|
|
5838
5838
|
name: 'images',
|
|
5839
5839
|
type: 'string[]',
|
|
5840
5840
|
description:
|
|
5841
5841
|
'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.',
|
|
5842
5842
|
}),
|
|
5843
|
-
(
|
|
5843
|
+
(It = {
|
|
5844
5844
|
name: 'audios',
|
|
5845
5845
|
type: 'string[]',
|
|
5846
5846
|
description:
|
|
5847
5847
|
'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.',
|
|
5848
5848
|
}),
|
|
5849
|
-
(
|
|
5849
|
+
(gt = [
|
|
5850
5850
|
{
|
|
5851
5851
|
name: 'prompt',
|
|
5852
5852
|
type: 'string',
|
|
@@ -5924,8 +5924,8 @@ var bi,
|
|
|
5924
5924
|
description:
|
|
5925
5925
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
5926
5926
|
},
|
|
5927
|
-
xt,
|
|
5928
5927
|
vt,
|
|
5928
|
+
It,
|
|
5929
5929
|
{
|
|
5930
5930
|
name: 'first_frame_image',
|
|
5931
5931
|
type: 'string',
|
|
@@ -5946,7 +5946,7 @@ var bi,
|
|
|
5946
5946
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5947
5947
|
},
|
|
5948
5948
|
]),
|
|
5949
|
-
(
|
|
5949
|
+
(Oi = [
|
|
5950
5950
|
{
|
|
5951
5951
|
name: 'prompt',
|
|
5952
5952
|
type: 'string',
|
|
@@ -6001,8 +6001,8 @@ var bi,
|
|
|
6001
6001
|
description:
|
|
6002
6002
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6003
6003
|
},
|
|
6004
|
-
xt,
|
|
6005
6004
|
vt,
|
|
6005
|
+
It,
|
|
6006
6006
|
{
|
|
6007
6007
|
name: 'first_frame_image',
|
|
6008
6008
|
type: 'string',
|
|
@@ -6017,53 +6017,53 @@ var bi,
|
|
|
6017
6017
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6018
6018
|
},
|
|
6019
6019
|
]));
|
|
6020
|
-
de =
|
|
6021
|
-
|
|
6020
|
+
de = Di();
|
|
6021
|
+
Vi = ['draft_task_id', 'draft_generation_id'];
|
|
6022
6022
|
});
|
|
6023
6023
|
function ce(e) {
|
|
6024
6024
|
let t = '/v1/pricing/models',
|
|
6025
6025
|
i = e?.trim();
|
|
6026
6026
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
6027
6027
|
}
|
|
6028
|
-
var
|
|
6028
|
+
var Ae = b(() => {
|
|
6029
6029
|
'use strict';
|
|
6030
6030
|
});
|
|
6031
|
-
function
|
|
6031
|
+
function Rt(e) {
|
|
6032
6032
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6033
6033
|
}
|
|
6034
|
-
function
|
|
6034
|
+
function Ot(e) {
|
|
6035
6035
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
6036
6036
|
i = t.filter((s) => G.includes(s.api.model)).map((s) => s.name),
|
|
6037
6037
|
r = t.filter((s) => !G.includes(s.api.model)).map((s) => s.name);
|
|
6038
6038
|
return [
|
|
6039
6039
|
...(i.length
|
|
6040
|
-
? [`${
|
|
6040
|
+
? [`${Rt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6041
6041
|
: []),
|
|
6042
|
-
...(r.length ? [`Not available yet on ${
|
|
6042
|
+
...(r.length ? [`Not available yet on ${Rt(r)}: ${le}.`] : []),
|
|
6043
6043
|
'The Acceptable Use Policy applies.',
|
|
6044
6044
|
].join(' ');
|
|
6045
6045
|
}
|
|
6046
|
-
function
|
|
6047
|
-
if (
|
|
6046
|
+
function lr(e) {
|
|
6047
|
+
if (sr.has(e.name)) return e;
|
|
6048
6048
|
let t = e.inputSchema.properties;
|
|
6049
6049
|
return !t || t.callback_url
|
|
6050
6050
|
? e
|
|
6051
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
6051
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: nr } } };
|
|
6052
6052
|
}
|
|
6053
|
-
function
|
|
6053
|
+
function pr(e) {
|
|
6054
6054
|
let t = e.inputSchema.properties;
|
|
6055
6055
|
if (!t) return e;
|
|
6056
6056
|
let i = !1,
|
|
6057
6057
|
r = {};
|
|
6058
6058
|
for (let [n, s] of Object.entries(t))
|
|
6059
|
-
|
|
6059
|
+
Dt.has(n) && s.type === 'string' && !s.format
|
|
6060
6060
|
? ((r[n] = { ...s, format: 'uri' }), (i = !0))
|
|
6061
|
-
:
|
|
6061
|
+
: Dt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
6062
6062
|
? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
6063
6063
|
: (r[n] = s);
|
|
6064
6064
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
6065
6065
|
}
|
|
6066
|
-
function
|
|
6066
|
+
function dr(e) {
|
|
6067
6067
|
switch (e.type) {
|
|
6068
6068
|
case 'string':
|
|
6069
6069
|
return {
|
|
@@ -6118,11 +6118,11 @@ function pr(e) {
|
|
|
6118
6118
|
return { type: 'string', description: e.description };
|
|
6119
6119
|
}
|
|
6120
6120
|
}
|
|
6121
|
-
function
|
|
6121
|
+
function cr(e, t) {
|
|
6122
6122
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
6123
6123
|
r = {},
|
|
6124
6124
|
n = [];
|
|
6125
|
-
for (let o of e.parameters) ((r[o.name] =
|
|
6125
|
+
for (let o of e.parameters) ((r[o.name] = dr(o)), o.required && n.push(o.name));
|
|
6126
6126
|
let s = {
|
|
6127
6127
|
type: 'object',
|
|
6128
6128
|
properties: r,
|
|
@@ -6135,7 +6135,7 @@ function dr(e, t) {
|
|
|
6135
6135
|
inputSchema: s,
|
|
6136
6136
|
};
|
|
6137
6137
|
}
|
|
6138
|
-
function
|
|
6138
|
+
function ur() {
|
|
6139
6139
|
let e = q().filter((d) => d.category === 'Image'),
|
|
6140
6140
|
t = q().filter((d) => d.category === 'Video'),
|
|
6141
6141
|
i = q().filter((d) => d.category === 'Text'),
|
|
@@ -6231,7 +6231,7 @@ function cr() {
|
|
|
6231
6231
|
maximum: 2147483647,
|
|
6232
6232
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
6233
6233
|
},
|
|
6234
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6234
|
+
creative_mode: { type: 'boolean', default: !1, description: Ot('image') },
|
|
6235
6235
|
},
|
|
6236
6236
|
required: ['prompt'],
|
|
6237
6237
|
additionalProperties: !0,
|
|
@@ -6268,7 +6268,7 @@ function cr() {
|
|
|
6268
6268
|
default: '480p',
|
|
6269
6269
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
6270
6270
|
},
|
|
6271
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6271
|
+
creative_mode: { type: 'boolean', default: !1, description: Ot('video') },
|
|
6272
6272
|
priority: {
|
|
6273
6273
|
type: 'boolean',
|
|
6274
6274
|
default: !1,
|
|
@@ -6390,10 +6390,10 @@ function cr() {
|
|
|
6390
6390
|
additionalProperties: !0,
|
|
6391
6391
|
},
|
|
6392
6392
|
},
|
|
6393
|
-
p =
|
|
6394
|
-
return [n, s, o, u, l, p, c,
|
|
6393
|
+
p = mr();
|
|
6394
|
+
return [n, s, o, u, l, p, c, or];
|
|
6395
6395
|
}
|
|
6396
|
-
function
|
|
6396
|
+
function mr() {
|
|
6397
6397
|
return {
|
|
6398
6398
|
name: 'upload_asset',
|
|
6399
6399
|
description:
|
|
@@ -6440,26 +6440,26 @@ function ur() {
|
|
|
6440
6440
|
},
|
|
6441
6441
|
};
|
|
6442
6442
|
}
|
|
6443
|
-
function
|
|
6444
|
-
let e =
|
|
6445
|
-
t = q().map((i) =>
|
|
6446
|
-
return [...e, ...t].map(
|
|
6443
|
+
function Ne() {
|
|
6444
|
+
let e = ur(),
|
|
6445
|
+
t = q().map((i) => cr(i));
|
|
6446
|
+
return [...e, ...t].map(lr).map(pr);
|
|
6447
6447
|
}
|
|
6448
|
-
var
|
|
6449
|
-
nr,
|
|
6448
|
+
var nr,
|
|
6450
6449
|
sr,
|
|
6451
|
-
|
|
6452
|
-
Dt
|
|
6450
|
+
or,
|
|
6451
|
+
Dt,
|
|
6452
|
+
Lt = b(() => {
|
|
6453
6453
|
'use strict';
|
|
6454
6454
|
V();
|
|
6455
|
-
|
|
6455
|
+
Ke();
|
|
6456
6456
|
z();
|
|
6457
|
-
((
|
|
6457
|
+
((nr = {
|
|
6458
6458
|
type: 'string',
|
|
6459
6459
|
description:
|
|
6460
6460
|
'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.',
|
|
6461
6461
|
}),
|
|
6462
|
-
(
|
|
6462
|
+
(sr = new Set([
|
|
6463
6463
|
'upload_asset',
|
|
6464
6464
|
'upload_media',
|
|
6465
6465
|
'upload_image',
|
|
@@ -6467,7 +6467,7 @@ var ar,
|
|
|
6467
6467
|
'check_status',
|
|
6468
6468
|
'get_pricing',
|
|
6469
6469
|
])),
|
|
6470
|
-
(
|
|
6470
|
+
(or = {
|
|
6471
6471
|
name: 'get_pricing',
|
|
6472
6472
|
description:
|
|
6473
6473
|
'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.',
|
|
@@ -6482,7 +6482,7 @@ var ar,
|
|
|
6482
6482
|
additionalProperties: !1,
|
|
6483
6483
|
},
|
|
6484
6484
|
}));
|
|
6485
|
-
|
|
6485
|
+
Dt = new Set([
|
|
6486
6486
|
'image',
|
|
6487
6487
|
'images',
|
|
6488
6488
|
'image_url',
|
|
@@ -6499,19 +6499,19 @@ var ar,
|
|
|
6499
6499
|
'lipsyncing_audio',
|
|
6500
6500
|
]);
|
|
6501
6501
|
});
|
|
6502
|
-
var
|
|
6503
|
-
|
|
6504
|
-
forgetToolSchemas: () =>
|
|
6505
|
-
jsonRpcAnswer: () =>
|
|
6506
|
-
preprocessLocalFiles: () =>
|
|
6507
|
-
startStdioServer: () =>
|
|
6502
|
+
var zt = {};
|
|
6503
|
+
ii(zt, {
|
|
6504
|
+
forgetToolSchemas: () => br,
|
|
6505
|
+
jsonRpcAnswer: () => jt,
|
|
6506
|
+
preprocessLocalFiles: () => Jt,
|
|
6507
|
+
startStdioServer: () => Ht,
|
|
6508
6508
|
});
|
|
6509
|
-
function
|
|
6509
|
+
function fr(e) {
|
|
6510
6510
|
let t = (i) =>
|
|
6511
6511
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6512
6512
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6513
6513
|
}
|
|
6514
|
-
function
|
|
6514
|
+
function jt(e, t, i) {
|
|
6515
6515
|
let r = e?.id,
|
|
6516
6516
|
n = r == null,
|
|
6517
6517
|
s = null;
|
|
@@ -6520,7 +6520,7 @@ function Ut(e, t, i) {
|
|
|
6520
6520
|
} catch {
|
|
6521
6521
|
s = null;
|
|
6522
6522
|
}
|
|
6523
|
-
if (s !== null &&
|
|
6523
|
+
if (s !== null && fr(s)) return n ? null : s;
|
|
6524
6524
|
if (n) return null;
|
|
6525
6525
|
if (!i && t >= 200 && t < 300) return;
|
|
6526
6526
|
let o = s?.error,
|
|
@@ -6541,12 +6541,12 @@ function Ut(e, t, i) {
|
|
|
6541
6541
|
},
|
|
6542
6542
|
};
|
|
6543
6543
|
}
|
|
6544
|
-
function
|
|
6544
|
+
function gr() {
|
|
6545
6545
|
let e = process.argv.slice(2),
|
|
6546
6546
|
t = e.indexOf('--api-key');
|
|
6547
6547
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6548
6548
|
}
|
|
6549
|
-
async function
|
|
6549
|
+
async function Bt(e, t, i) {
|
|
6550
6550
|
let r = U.default.resolve(e);
|
|
6551
6551
|
if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
|
|
6552
6552
|
throw new Error(`File not found: ${e}`);
|
|
@@ -6575,15 +6575,15 @@ async function jt(e, t, i) {
|
|
|
6575
6575
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
6576
6576
|
};
|
|
6577
6577
|
}
|
|
6578
|
-
function Bt(e) {
|
|
6579
|
-
return gr.has(U.default.extname(e).toLowerCase());
|
|
6580
|
-
}
|
|
6581
6578
|
function Ft(e) {
|
|
6579
|
+
return hr.has(U.default.extname(e).toLowerCase());
|
|
6580
|
+
}
|
|
6581
|
+
function Gt(e) {
|
|
6582
6582
|
return new Error(
|
|
6583
6583
|
`Tein uploads image, video and audio files only, and ${U.default.basename(e)} is not one.`,
|
|
6584
6584
|
);
|
|
6585
6585
|
}
|
|
6586
|
-
function
|
|
6586
|
+
function yr(e) {
|
|
6587
6587
|
let t = e.trim();
|
|
6588
6588
|
if (
|
|
6589
6589
|
!t ||
|
|
@@ -6596,7 +6596,7 @@ function hr(e) {
|
|
|
6596
6596
|
let i = U.default.resolve(t);
|
|
6597
6597
|
return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
|
|
6598
6598
|
}
|
|
6599
|
-
function
|
|
6599
|
+
function je(e) {
|
|
6600
6600
|
if (Array.isArray(e))
|
|
6601
6601
|
for (let t of e) {
|
|
6602
6602
|
let i = t;
|
|
@@ -6606,12 +6606,12 @@ function Ue(e) {
|
|
|
6606
6606
|
Q.set(i.name, i.inputSchema);
|
|
6607
6607
|
}
|
|
6608
6608
|
}
|
|
6609
|
-
function
|
|
6610
|
-
(Q.clear(), (
|
|
6609
|
+
function br() {
|
|
6610
|
+
(Q.clear(), (Ue = 0));
|
|
6611
6611
|
}
|
|
6612
|
-
async function
|
|
6613
|
-
if (!(Date.now() -
|
|
6614
|
-
|
|
6612
|
+
async function wr(e, t) {
|
|
6613
|
+
if (!(Date.now() - Ue < 6e4)) {
|
|
6614
|
+
Ue = Date.now();
|
|
6615
6615
|
try {
|
|
6616
6616
|
let r = await (
|
|
6617
6617
|
await fetch(e, {
|
|
@@ -6621,39 +6621,39 @@ async function br(e, t) {
|
|
|
6621
6621
|
signal: AbortSignal.timeout(1e4),
|
|
6622
6622
|
})
|
|
6623
6623
|
).json();
|
|
6624
|
-
|
|
6624
|
+
je(r.result?.tools);
|
|
6625
6625
|
} catch {}
|
|
6626
6626
|
}
|
|
6627
6627
|
}
|
|
6628
|
-
function
|
|
6628
|
+
function kr(e) {
|
|
6629
6629
|
return e
|
|
6630
6630
|
? e.type === 'string'
|
|
6631
6631
|
? e.format === 'uri'
|
|
6632
6632
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6633
6633
|
: !1;
|
|
6634
6634
|
}
|
|
6635
|
-
async function
|
|
6635
|
+
async function Vt(e, t, i) {
|
|
6636
6636
|
if (typeof e != 'string') return e;
|
|
6637
|
-
let r =
|
|
6637
|
+
let r = yr(e);
|
|
6638
6638
|
if (!r) return e;
|
|
6639
|
-
if (!
|
|
6640
|
-
return (await
|
|
6639
|
+
if (!Ft(r)) throw Gt(r);
|
|
6640
|
+
return (await Bt(r, t, i)).url;
|
|
6641
6641
|
}
|
|
6642
|
-
async function
|
|
6643
|
-
(Q.size === 0 &&
|
|
6642
|
+
async function Jt(e, t, i, r, n) {
|
|
6643
|
+
(Q.size === 0 && je(Ne()), Q.has(e) || (await wr(n, i)));
|
|
6644
6644
|
let s = Q.get(e)?.properties;
|
|
6645
6645
|
if (!s) return t;
|
|
6646
6646
|
let o = { ...t };
|
|
6647
6647
|
for (let [u, l] of Object.entries(t))
|
|
6648
|
-
if (
|
|
6648
|
+
if (kr(s[u]))
|
|
6649
6649
|
if (Array.isArray(l)) {
|
|
6650
6650
|
let c = [];
|
|
6651
|
-
for (let p of l) c.push(await
|
|
6651
|
+
for (let p of l) c.push(await Vt(p, i, r));
|
|
6652
6652
|
o[u] = c;
|
|
6653
|
-
} else o[u] = await
|
|
6653
|
+
} else o[u] = await Vt(l, i, r);
|
|
6654
6654
|
return o;
|
|
6655
6655
|
}
|
|
6656
|
-
function
|
|
6656
|
+
function xr(e) {
|
|
6657
6657
|
let t = e.id ?? null;
|
|
6658
6658
|
switch (e.method) {
|
|
6659
6659
|
case 'initialize':
|
|
@@ -6671,7 +6671,7 @@ function kr(e) {
|
|
|
6671
6671
|
case 'ping':
|
|
6672
6672
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
6673
6673
|
case 'tools/list':
|
|
6674
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
6674
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ne() } };
|
|
6675
6675
|
case 'tools/call':
|
|
6676
6676
|
return {
|
|
6677
6677
|
jsonrpc: '2.0',
|
|
@@ -6694,13 +6694,13 @@ function kr(e) {
|
|
|
6694
6694
|
};
|
|
6695
6695
|
}
|
|
6696
6696
|
}
|
|
6697
|
-
async function
|
|
6698
|
-
if (
|
|
6699
|
-
|
|
6700
|
-
let e =
|
|
6697
|
+
async function Ht() {
|
|
6698
|
+
if (Nt) return;
|
|
6699
|
+
Nt = !0;
|
|
6700
|
+
let e = gr(),
|
|
6701
6701
|
t = x(),
|
|
6702
6702
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6703
|
-
(
|
|
6703
|
+
(Ut.default
|
|
6704
6704
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6705
6705
|
.on('line', async (n) => {
|
|
6706
6706
|
let s = n.trim();
|
|
@@ -6761,8 +6761,8 @@ async function Jt() {
|
|
|
6761
6761
|
try {
|
|
6762
6762
|
let d = U.default.resolve(p.trim());
|
|
6763
6763
|
if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
|
|
6764
|
-
if (!
|
|
6765
|
-
let m = await
|
|
6764
|
+
if (!Ft(d)) throw Gt(d);
|
|
6765
|
+
let m = await Bt(d, e, t),
|
|
6766
6766
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
6767
6767
|
ue =
|
|
6768
6768
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6818,7 +6818,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6818
6818
|
}
|
|
6819
6819
|
if (e)
|
|
6820
6820
|
try {
|
|
6821
|
-
o.params.arguments = await
|
|
6821
|
+
o.params.arguments = await Jt(String(l), c, e, t, i);
|
|
6822
6822
|
} catch (p) {
|
|
6823
6823
|
let d = p instanceof Error ? p.message : String(p);
|
|
6824
6824
|
process.stdout.write(
|
|
@@ -6849,10 +6849,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6849
6849
|
body: JSON.stringify(o),
|
|
6850
6850
|
}),
|
|
6851
6851
|
c = await l.text(),
|
|
6852
|
-
p =
|
|
6852
|
+
p = jt(o, l.status, c);
|
|
6853
6853
|
if (p === null) return;
|
|
6854
6854
|
if (p) {
|
|
6855
|
-
(o?.method === 'tools/list' &&
|
|
6855
|
+
(o?.method === 'tools/list' && je(p.result?.tools),
|
|
6856
6856
|
process.stdout.write(
|
|
6857
6857
|
JSON.stringify(p) +
|
|
6858
6858
|
`
|
|
@@ -6861,7 +6861,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6861
6861
|
return;
|
|
6862
6862
|
}
|
|
6863
6863
|
} catch {}
|
|
6864
|
-
let u =
|
|
6864
|
+
let u = xr(o);
|
|
6865
6865
|
u !== null &&
|
|
6866
6866
|
process.stdout.write(
|
|
6867
6867
|
JSON.stringify(u) +
|
|
@@ -6886,20 +6886,20 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6886
6886
|
}
|
|
6887
6887
|
var R,
|
|
6888
6888
|
U,
|
|
6889
|
-
|
|
6890
|
-
|
|
6889
|
+
Ut,
|
|
6890
|
+
hr,
|
|
6891
6891
|
Q,
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6892
|
+
Ue,
|
|
6893
|
+
Nt,
|
|
6894
|
+
Wt = b(() => {
|
|
6895
6895
|
'use strict';
|
|
6896
6896
|
((R = I(require('node:fs'))),
|
|
6897
6897
|
(U = I(require('node:path'))),
|
|
6898
|
-
(
|
|
6899
|
-
|
|
6900
|
-
|
|
6898
|
+
(Ut = I(require('node:readline'))));
|
|
6899
|
+
Ae();
|
|
6900
|
+
Lt();
|
|
6901
6901
|
E();
|
|
6902
|
-
|
|
6902
|
+
hr = new Set([
|
|
6903
6903
|
'.png',
|
|
6904
6904
|
'.jpg',
|
|
6905
6905
|
'.jpeg',
|
|
@@ -6925,20 +6925,20 @@ var R,
|
|
|
6925
6925
|
'.flac',
|
|
6926
6926
|
'.opus',
|
|
6927
6927
|
]);
|
|
6928
|
-
((Q = new Map()), (
|
|
6929
|
-
|
|
6928
|
+
((Q = new Map()), (Ue = 0));
|
|
6929
|
+
Nt = !1;
|
|
6930
6930
|
require.main === module &&
|
|
6931
|
-
|
|
6931
|
+
Ht().catch((e) => {
|
|
6932
6932
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
6933
6933
|
`),
|
|
6934
6934
|
process.exit(1));
|
|
6935
6935
|
});
|
|
6936
6936
|
});
|
|
6937
|
-
var
|
|
6937
|
+
var ai =
|
|
6938
6938
|
!process.env.NO_COLOR &&
|
|
6939
6939
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
6940
6940
|
function w(e, t) {
|
|
6941
|
-
return (i) => (
|
|
6941
|
+
return (i) => (ai ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
6942
6942
|
}
|
|
6943
6943
|
var a = {
|
|
6944
6944
|
bold: w(1, 22),
|
|
@@ -7025,10 +7025,10 @@ var a = {
|
|
|
7025
7025
|
var O = I(require('node:fs')),
|
|
7026
7026
|
A = I(require('node:path'));
|
|
7027
7027
|
var ee = I(require('node:fs')),
|
|
7028
|
-
|
|
7029
|
-
|
|
7028
|
+
Ge = I(require('node:path')),
|
|
7029
|
+
Je = require('node:stream/promises');
|
|
7030
7030
|
var Z = '1.1.7';
|
|
7031
|
-
var
|
|
7031
|
+
var ni = new Set([
|
|
7032
7032
|
'account_suspended',
|
|
7033
7033
|
'account_terminated',
|
|
7034
7034
|
'creative_mode_restricted',
|
|
@@ -7036,7 +7036,7 @@ var ai = new Set([
|
|
|
7036
7036
|
'workspace_paused',
|
|
7037
7037
|
]),
|
|
7038
7038
|
_ = 1,
|
|
7039
|
-
|
|
7039
|
+
si = 3,
|
|
7040
7040
|
k = class extends Error {
|
|
7041
7041
|
constructor(t, i, r, n = {}) {
|
|
7042
7042
|
(super(i),
|
|
@@ -7046,10 +7046,10 @@ var ai = new Set([
|
|
|
7046
7046
|
(this.fields = n));
|
|
7047
7047
|
}
|
|
7048
7048
|
get exitCode() {
|
|
7049
|
-
return this.code &&
|
|
7049
|
+
return this.code && ni.has(this.code) ? si : _;
|
|
7050
7050
|
}
|
|
7051
7051
|
};
|
|
7052
|
-
function
|
|
7052
|
+
function oi(e, t, i) {
|
|
7053
7053
|
let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
7054
7054
|
if (!i || typeof i != 'object') return new k(e, r);
|
|
7055
7055
|
let n = i;
|
|
@@ -7062,13 +7062,13 @@ function si(e, t, i) {
|
|
|
7062
7062
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
|
|
7063
7063
|
return new k(e, c, typeof o == 'string' ? o : void 0, l);
|
|
7064
7064
|
}
|
|
7065
|
-
function
|
|
7065
|
+
function Be(e) {
|
|
7066
7066
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
7067
7067
|
}
|
|
7068
7068
|
function K(e) {
|
|
7069
7069
|
let t = [e.message],
|
|
7070
|
-
i =
|
|
7071
|
-
r =
|
|
7070
|
+
i = Be(e.fields.required),
|
|
7071
|
+
r = Be(e.fields.balance);
|
|
7072
7072
|
(i || r) &&
|
|
7073
7073
|
t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
|
|
7074
7074
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -7076,19 +7076,19 @@ function K(e) {
|
|
|
7076
7076
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
7077
7077
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
7078
7078
|
}
|
|
7079
|
-
function
|
|
7079
|
+
function li(e) {
|
|
7080
7080
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7081
7081
|
? 'video'
|
|
7082
7082
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
7083
7083
|
? 'audio'
|
|
7084
7084
|
: 'image';
|
|
7085
7085
|
}
|
|
7086
|
-
function
|
|
7086
|
+
function Fe(e) {
|
|
7087
7087
|
let t = [];
|
|
7088
7088
|
for (let i of e.data ?? [])
|
|
7089
7089
|
typeof i.message?.content == 'string'
|
|
7090
7090
|
? t.push({ type: 'text', text: i.message.content })
|
|
7091
|
-
: i.url && t.push({ type:
|
|
7091
|
+
: i.url && t.push({ type: li(i.url), url: i.url });
|
|
7092
7092
|
return t;
|
|
7093
7093
|
}
|
|
7094
7094
|
var M = class {
|
|
@@ -7114,7 +7114,7 @@ var M = class {
|
|
|
7114
7114
|
try {
|
|
7115
7115
|
s = await n.json();
|
|
7116
7116
|
} catch {}
|
|
7117
|
-
throw
|
|
7117
|
+
throw oi(n.status, n.statusText, s);
|
|
7118
7118
|
}
|
|
7119
7119
|
return await n.json();
|
|
7120
7120
|
}
|
|
@@ -7128,7 +7128,7 @@ var M = class {
|
|
|
7128
7128
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
7129
7129
|
? n
|
|
7130
7130
|
: 'processing',
|
|
7131
|
-
o =
|
|
7131
|
+
o = Fe(r);
|
|
7132
7132
|
return {
|
|
7133
7133
|
request_id: r.request_id || r.id || '',
|
|
7134
7134
|
model: r.model,
|
|
@@ -7146,7 +7146,7 @@ var M = class {
|
|
|
7146
7146
|
r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
|
|
7147
7147
|
? r
|
|
7148
7148
|
: 'processing',
|
|
7149
|
-
s =
|
|
7149
|
+
s = Fe(i),
|
|
7150
7150
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
7151
7151
|
return {
|
|
7152
7152
|
request_id: i.id || t,
|
|
@@ -7164,37 +7164,45 @@ var M = class {
|
|
|
7164
7164
|
async downloadOutput(t, i) {
|
|
7165
7165
|
let r = await fetch(t);
|
|
7166
7166
|
if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
|
|
7167
|
-
let n =
|
|
7167
|
+
let n = Ge.default.dirname(i);
|
|
7168
7168
|
ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
|
|
7169
7169
|
let s = ee.default.createWriteStream(i);
|
|
7170
|
-
return (await (0,
|
|
7170
|
+
return (await (0, Je.pipeline)(r.body, s), i);
|
|
7171
7171
|
}
|
|
7172
7172
|
};
|
|
7173
7173
|
E();
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7174
|
+
function ye(e) {
|
|
7175
|
+
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
7176
|
+
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
7177
|
+
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
7178
|
+
i = 10 ** t,
|
|
7179
|
+
r = Math.round(Number((e * i).toFixed(6))) / i;
|
|
7180
|
+
return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
|
|
7178
7181
|
}
|
|
7182
|
+
z();
|
|
7183
|
+
var Pt = ['images', 'input_images', 'videos', 'audios'];
|
|
7179
7184
|
function Ni(e) {
|
|
7185
|
+
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7186
|
+
}
|
|
7187
|
+
function Ui(e) {
|
|
7180
7188
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7181
7189
|
let t = A.default.resolve(e);
|
|
7182
7190
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7183
7191
|
}
|
|
7184
|
-
async function
|
|
7185
|
-
for (let i of
|
|
7192
|
+
async function ji(e, t) {
|
|
7193
|
+
for (let i of Pt) {
|
|
7186
7194
|
if (!Array.isArray(e[i])) continue;
|
|
7187
7195
|
let r = [];
|
|
7188
7196
|
for (let n of e[i]) {
|
|
7189
7197
|
if (typeof n != 'string') continue;
|
|
7190
|
-
let s =
|
|
7198
|
+
let s = Ui(n);
|
|
7191
7199
|
r.push(s ? await t(s) : n);
|
|
7192
7200
|
}
|
|
7193
7201
|
e[i] = r;
|
|
7194
7202
|
}
|
|
7195
7203
|
}
|
|
7196
7204
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7197
|
-
function
|
|
7205
|
+
function Bi(e) {
|
|
7198
7206
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7199
7207
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7200
7208
|
i = W.enterprise;
|
|
@@ -7207,7 +7215,7 @@ function ji(e) {
|
|
|
7207
7215
|
t
|
|
7208
7216
|
);
|
|
7209
7217
|
}
|
|
7210
|
-
async function
|
|
7218
|
+
async function Fi(e, t, i, r, n) {
|
|
7211
7219
|
n.isJson ||
|
|
7212
7220
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7213
7221
|
`);
|
|
@@ -7269,7 +7277,7 @@ async function Bi(e, t, i, r, n) {
|
|
|
7269
7277
|
else {
|
|
7270
7278
|
for (let l of o)
|
|
7271
7279
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
7272
|
-
l.usage?.cost !== void 0 && process.stdout.write(`
|
|
7280
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${ye(l.usage.cost)}`),
|
|
7273
7281
|
l.error && process.stdout.write(` ${l.error}`),
|
|
7274
7282
|
process.stdout.write(`
|
|
7275
7283
|
`));
|
|
@@ -7282,7 +7290,7 @@ async function Bi(e, t, i, r, n) {
|
|
|
7282
7290
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7283
7291
|
process.exit(_);
|
|
7284
7292
|
}
|
|
7285
|
-
function
|
|
7293
|
+
function Tt(e) {
|
|
7286
7294
|
let t = {},
|
|
7287
7295
|
i = new Set(),
|
|
7288
7296
|
r = [];
|
|
@@ -7327,7 +7335,7 @@ function Pt(e) {
|
|
|
7327
7335
|
}
|
|
7328
7336
|
return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
|
|
7329
7337
|
}
|
|
7330
|
-
async function
|
|
7338
|
+
async function qe(e, t) {
|
|
7331
7339
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7332
7340
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7333
7341
|
(i ||
|
|
@@ -7349,7 +7357,7 @@ async function Ee(e, t) {
|
|
|
7349
7357
|
s = !!t.json,
|
|
7350
7358
|
o = !!(t.async || t.no_wait),
|
|
7351
7359
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7352
|
-
l =
|
|
7360
|
+
l = Bi(t),
|
|
7353
7361
|
c = { ...t };
|
|
7354
7362
|
(delete c.json,
|
|
7355
7363
|
delete c.async,
|
|
@@ -7358,8 +7366,8 @@ async function Ee(e, t) {
|
|
|
7358
7366
|
delete c.api_key,
|
|
7359
7367
|
delete c.api_url,
|
|
7360
7368
|
delete c.count);
|
|
7361
|
-
let p =
|
|
7362
|
-
(
|
|
7369
|
+
let p = _t(n, c);
|
|
7370
|
+
(Ni(p),
|
|
7363
7371
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7364
7372
|
p.image_url &&
|
|
7365
7373
|
!p.first_frame_image &&
|
|
@@ -7392,7 +7400,7 @@ async function Ee(e, t) {
|
|
|
7392
7400
|
}
|
|
7393
7401
|
}
|
|
7394
7402
|
}
|
|
7395
|
-
await
|
|
7403
|
+
await ji(p, async (y) => {
|
|
7396
7404
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7397
7405
|
s || f.start();
|
|
7398
7406
|
try {
|
|
@@ -7416,7 +7424,7 @@ async function Ee(e, t) {
|
|
|
7416
7424
|
let g;
|
|
7417
7425
|
try {
|
|
7418
7426
|
if (l > 1) {
|
|
7419
|
-
await
|
|
7427
|
+
await Fi(d, e, p, l, { isJson: s, isAsync: o });
|
|
7420
7428
|
return;
|
|
7421
7429
|
}
|
|
7422
7430
|
g = await d.queueJob(e, p);
|
|
@@ -7501,7 +7509,7 @@ async function Ee(e, t) {
|
|
|
7501
7509
|
process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
|
|
7502
7510
|
`),
|
|
7503
7511
|
g.usage?.cost !== void 0 &&
|
|
7504
|
-
process.stdout.write(` ${a.bold('Cost:')}
|
|
7512
|
+
process.stdout.write(` ${a.bold('Cost:')} ${ye(g.usage.cost)}
|
|
7505
7513
|
`),
|
|
7506
7514
|
g.output && g.output.length > 0)
|
|
7507
7515
|
) {
|
|
@@ -7534,9 +7542,9 @@ ${f.text}
|
|
|
7534
7542
|
process.stdout.write(`
|
|
7535
7543
|
`);
|
|
7536
7544
|
}
|
|
7537
|
-
var
|
|
7545
|
+
var Mt = I(require('node:readline'));
|
|
7538
7546
|
E();
|
|
7539
|
-
async function
|
|
7547
|
+
async function Gi(e) {
|
|
7540
7548
|
try {
|
|
7541
7549
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7542
7550
|
} catch (t) {
|
|
@@ -7547,8 +7555,8 @@ async function Fi(e) {
|
|
|
7547
7555
|
return 'unchecked';
|
|
7548
7556
|
}
|
|
7549
7557
|
}
|
|
7550
|
-
function
|
|
7551
|
-
let t =
|
|
7558
|
+
function Ji(e) {
|
|
7559
|
+
let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7552
7560
|
return new Promise((i) => {
|
|
7553
7561
|
t.question(e, (r) => {
|
|
7554
7562
|
(t.close(), i(r.trim()));
|
|
@@ -7567,14 +7575,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7567
7575
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7568
7576
|
|
|
7569
7577
|
`),
|
|
7570
|
-
(i = await
|
|
7578
|
+
(i = await Ji('Enter your Tein API Key (sk_live_...): '))),
|
|
7571
7579
|
!i.startsWith('sk_live_') &&
|
|
7572
7580
|
!i.startsWith('sk_test_') &&
|
|
7573
7581
|
(process.stderr
|
|
7574
7582
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7575
7583
|
`),
|
|
7576
7584
|
process.exit(1)));
|
|
7577
|
-
let r = await
|
|
7585
|
+
let r = await Gi(i);
|
|
7578
7586
|
(r === 'invalid' &&
|
|
7579
7587
|
(process.stderr
|
|
7580
7588
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -7644,12 +7652,12 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7644
7652
|
}
|
|
7645
7653
|
}
|
|
7646
7654
|
E();
|
|
7647
|
-
|
|
7655
|
+
be();
|
|
7648
7656
|
z();
|
|
7649
|
-
var
|
|
7650
|
-
async function
|
|
7657
|
+
var Hi = 3e3;
|
|
7658
|
+
async function Kt(e) {
|
|
7651
7659
|
try {
|
|
7652
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
7660
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Hi) });
|
|
7653
7661
|
if (!t.ok) return;
|
|
7654
7662
|
let i = await t.json(),
|
|
7655
7663
|
r = {};
|
|
@@ -7657,18 +7665,18 @@ async function Mt(e) {
|
|
|
7657
7665
|
let s = String(n.modelSlug ?? '');
|
|
7658
7666
|
B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7659
7667
|
}
|
|
7660
|
-
|
|
7668
|
+
ht(r);
|
|
7661
7669
|
} catch {}
|
|
7662
7670
|
}
|
|
7663
|
-
var
|
|
7664
|
-
|
|
7665
|
-
async function
|
|
7666
|
-
await
|
|
7671
|
+
var zi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7672
|
+
Wi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7673
|
+
async function St(e, t) {
|
|
7674
|
+
await Kt(t);
|
|
7667
7675
|
let i = q();
|
|
7668
7676
|
if (e) {
|
|
7669
7677
|
let s = e.toLowerCase(),
|
|
7670
|
-
o =
|
|
7671
|
-
i =
|
|
7678
|
+
o = Wi[s] ?? s;
|
|
7679
|
+
i = zi.has(o)
|
|
7672
7680
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7673
7681
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7674
7682
|
}
|
|
@@ -7706,8 +7714,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7706
7714
|
|
|
7707
7715
|
`);
|
|
7708
7716
|
}
|
|
7709
|
-
async function
|
|
7710
|
-
B.has(e) && (await
|
|
7717
|
+
async function $t(e, t) {
|
|
7718
|
+
B.has(e) && (await Kt(t));
|
|
7711
7719
|
let i = N(e);
|
|
7712
7720
|
(i ||
|
|
7713
7721
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -7788,9 +7796,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7788
7796
|
`);
|
|
7789
7797
|
}
|
|
7790
7798
|
E();
|
|
7791
|
-
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7799
|
+
Ae();
|
|
7800
|
+
var Yi = 1e4,
|
|
7801
|
+
Oe = {
|
|
7794
7802
|
price: '',
|
|
7795
7803
|
creativeMode: 'Creative mode',
|
|
7796
7804
|
priority: 'Priority',
|
|
@@ -7800,22 +7808,22 @@ var Wi = 1e4,
|
|
|
7800
7808
|
priorityDraft: 'Priority + Draft',
|
|
7801
7809
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7802
7810
|
},
|
|
7803
|
-
|
|
7804
|
-
|
|
7811
|
+
Qi = Object.keys(Oe),
|
|
7812
|
+
Xi = {
|
|
7805
7813
|
creativeMode: 'unfiltered',
|
|
7806
7814
|
creativeModePriority: 'unfilteredPriority',
|
|
7807
7815
|
creativeModeDraft: 'unfilteredDraft',
|
|
7808
7816
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7809
7817
|
};
|
|
7810
|
-
function
|
|
7811
|
-
let i =
|
|
7818
|
+
function Zi(e, t) {
|
|
7819
|
+
let i = Xi[t];
|
|
7812
7820
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7813
7821
|
}
|
|
7814
|
-
async function
|
|
7822
|
+
async function er(e, t) {
|
|
7815
7823
|
let i = `${x(e)}${ce(t)}`,
|
|
7816
7824
|
r;
|
|
7817
7825
|
try {
|
|
7818
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7826
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Yi) });
|
|
7819
7827
|
} catch {
|
|
7820
7828
|
throw new Error(`Could not reach ${i}`);
|
|
7821
7829
|
}
|
|
@@ -7831,18 +7839,18 @@ async function Zi(e, t) {
|
|
|
7831
7839
|
}
|
|
7832
7840
|
return n;
|
|
7833
7841
|
}
|
|
7834
|
-
function
|
|
7842
|
+
function Re(e) {
|
|
7835
7843
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7836
7844
|
[i, r = ''] = t.split('.');
|
|
7837
7845
|
return `$${i}.${r.padEnd(2, '0')}`;
|
|
7838
7846
|
}
|
|
7839
|
-
function
|
|
7847
|
+
function De(e) {
|
|
7840
7848
|
if (!e || typeof e.starter != 'number') return null;
|
|
7841
7849
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7842
7850
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7843
|
-
return `Starter ${
|
|
7851
|
+
return `Starter ${Re(e.starter)} Plus ${Re(t)} Scale ${Re(i)}`;
|
|
7844
7852
|
}
|
|
7845
|
-
function
|
|
7853
|
+
function tr(e) {
|
|
7846
7854
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7847
7855
|
let t = [];
|
|
7848
7856
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7854,33 +7862,33 @@ function er(e) {
|
|
|
7854
7862
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7855
7863
|
);
|
|
7856
7864
|
}
|
|
7857
|
-
function
|
|
7858
|
-
let i =
|
|
7859
|
-
for (let r of
|
|
7860
|
-
let n =
|
|
7865
|
+
function ir(e, t) {
|
|
7866
|
+
let i = tr(e);
|
|
7867
|
+
for (let r of Qi) {
|
|
7868
|
+
let n = De(Zi(e, r));
|
|
7861
7869
|
if (!n) continue;
|
|
7862
|
-
let s =
|
|
7870
|
+
let s = Oe[r] ? ` (${Oe[r]})` : '';
|
|
7863
7871
|
t.push(` ${i}${s} ${n}`);
|
|
7864
7872
|
}
|
|
7865
7873
|
}
|
|
7866
|
-
function
|
|
7874
|
+
function rr(e, t) {
|
|
7867
7875
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7868
7876
|
t.push(
|
|
7869
7877
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7870
7878
|
);
|
|
7871
|
-
for (let n of e.variants ?? [])
|
|
7879
|
+
for (let n of e.variants ?? []) ir(n, t);
|
|
7872
7880
|
let r = e.addons;
|
|
7873
7881
|
if (Array.isArray(r))
|
|
7874
7882
|
for (let n of r) {
|
|
7875
7883
|
if (!n || typeof n != 'object') continue;
|
|
7876
7884
|
let s = n,
|
|
7877
7885
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
7878
|
-
u =
|
|
7886
|
+
u = De(s.price);
|
|
7879
7887
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
7880
7888
|
}
|
|
7881
7889
|
t.push('');
|
|
7882
7890
|
}
|
|
7883
|
-
function
|
|
7891
|
+
function ar(e) {
|
|
7884
7892
|
let t = [],
|
|
7885
7893
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7886
7894
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7902,7 +7910,7 @@ function rr(e) {
|
|
|
7902
7910
|
});
|
|
7903
7911
|
for (let l of s) {
|
|
7904
7912
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7905
|
-
for (let c of r.get(l) ?? [])
|
|
7913
|
+
for (let c of r.get(l) ?? []) rr(c, t);
|
|
7906
7914
|
}
|
|
7907
7915
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7908
7916
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -7919,7 +7927,7 @@ function rr(e) {
|
|
|
7919
7927
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
7920
7928
|
for (let m of p) {
|
|
7921
7929
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
7922
|
-
g =
|
|
7930
|
+
g = De(m.prices);
|
|
7923
7931
|
g && t.push(` ${h} ${g}`);
|
|
7924
7932
|
}
|
|
7925
7933
|
t.push('');
|
|
@@ -7932,10 +7940,10 @@ function rr(e) {
|
|
|
7932
7940
|
`
|
|
7933
7941
|
);
|
|
7934
7942
|
}
|
|
7935
|
-
async function
|
|
7943
|
+
async function Ct(e) {
|
|
7936
7944
|
let t;
|
|
7937
7945
|
try {
|
|
7938
|
-
t = await
|
|
7946
|
+
t = await er(e.apiUrl, e.model);
|
|
7939
7947
|
} catch (i) {
|
|
7940
7948
|
let r = i instanceof Error ? i.message : String(i);
|
|
7941
7949
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7946,12 +7954,12 @@ async function $t(e) {
|
|
|
7946
7954
|
e.json
|
|
7947
7955
|
? `${JSON.stringify(t, null, 2)}
|
|
7948
7956
|
`
|
|
7949
|
-
:
|
|
7957
|
+
: ar(t),
|
|
7950
7958
|
);
|
|
7951
7959
|
}
|
|
7952
|
-
var
|
|
7960
|
+
var Et = I(require('node:path'));
|
|
7953
7961
|
E();
|
|
7954
|
-
async function
|
|
7962
|
+
async function qt(e, t) {
|
|
7955
7963
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7956
7964
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7957
7965
|
(i ||
|
|
@@ -8046,7 +8054,7 @@ ${a.bold('Outputs:')}
|
|
|
8046
8054
|
) {
|
|
8047
8055
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
8048
8056
|
try {
|
|
8049
|
-
(await u.downloadOutput(p.url,
|
|
8057
|
+
(await u.downloadOutput(p.url, Et.default.resolve(process.cwd(), o)),
|
|
8050
8058
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
8051
8059
|
} catch (m) {
|
|
8052
8060
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -8061,10 +8069,10 @@ ${p.text}
|
|
|
8061
8069
|
process.stdout.write(`
|
|
8062
8070
|
`);
|
|
8063
8071
|
}
|
|
8064
|
-
var
|
|
8065
|
-
|
|
8072
|
+
var Le = I(require('node:fs')),
|
|
8073
|
+
Ve = I(require('node:path'));
|
|
8066
8074
|
E();
|
|
8067
|
-
async function
|
|
8075
|
+
async function At(e, t = {}) {
|
|
8068
8076
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8069
8077
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
8070
8078
|
n = !!t.json;
|
|
@@ -8081,13 +8089,13 @@ async function qt(e, t = {}) {
|
|
|
8081
8089
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8082
8090
|
`),
|
|
8083
8091
|
process.exit(1)));
|
|
8084
|
-
let s =
|
|
8085
|
-
|
|
8092
|
+
let s = Ve.default.resolve(e);
|
|
8093
|
+
Le.default.existsSync(s) ||
|
|
8086
8094
|
(process.stderr.write(`${a.red('Error:')} File not found: ${s}
|
|
8087
8095
|
`),
|
|
8088
8096
|
process.exit(1));
|
|
8089
|
-
let o =
|
|
8090
|
-
l =
|
|
8097
|
+
let o = Ve.default.basename(s),
|
|
8098
|
+
l = Le.default.readFileSync(s).toString('base64'),
|
|
8091
8099
|
c = new M(i, r),
|
|
8092
8100
|
p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
8093
8101
|
n || p.start();
|
|
@@ -8129,8 +8137,8 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8129
8137
|
}
|
|
8130
8138
|
}
|
|
8131
8139
|
z();
|
|
8132
|
-
|
|
8133
|
-
function
|
|
8140
|
+
Te();
|
|
8141
|
+
function Yt() {
|
|
8134
8142
|
process.stdout.write(`
|
|
8135
8143
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8136
8144
|
|
|
@@ -8190,11 +8198,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8190
8198
|
|
|
8191
8199
|
`);
|
|
8192
8200
|
}
|
|
8193
|
-
async function
|
|
8201
|
+
async function vr() {
|
|
8194
8202
|
let e = process.argv.slice(2),
|
|
8195
|
-
t =
|
|
8203
|
+
t = Tt(e);
|
|
8196
8204
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8197
|
-
|
|
8205
|
+
Yt();
|
|
8198
8206
|
return;
|
|
8199
8207
|
}
|
|
8200
8208
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8221,14 +8229,14 @@ async function xr() {
|
|
|
8221
8229
|
}
|
|
8222
8230
|
case 'models':
|
|
8223
8231
|
case 'list': {
|
|
8224
|
-
await
|
|
8232
|
+
await St(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8225
8233
|
break;
|
|
8226
8234
|
}
|
|
8227
8235
|
case 'pricing':
|
|
8228
8236
|
case 'prices': {
|
|
8229
8237
|
let i = t.options.model,
|
|
8230
8238
|
r = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
8231
|
-
await
|
|
8239
|
+
await Ct({
|
|
8232
8240
|
model: r,
|
|
8233
8241
|
json: !!t.options.json,
|
|
8234
8242
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -8243,27 +8251,27 @@ async function xr() {
|
|
|
8243
8251
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8244
8252
|
`),
|
|
8245
8253
|
process.exit(1)),
|
|
8246
|
-
await
|
|
8254
|
+
await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8247
8255
|
break;
|
|
8248
8256
|
}
|
|
8249
8257
|
case 'upload': {
|
|
8250
8258
|
let i = t.subcommand || '';
|
|
8251
|
-
await
|
|
8259
|
+
await At(i, t.options);
|
|
8252
8260
|
break;
|
|
8253
8261
|
}
|
|
8254
8262
|
case 'run':
|
|
8255
8263
|
case 'generate': {
|
|
8256
8264
|
let i = t.subcommand || '';
|
|
8257
|
-
await
|
|
8265
|
+
await qe(i, t.options);
|
|
8258
8266
|
break;
|
|
8259
8267
|
}
|
|
8260
8268
|
case 'status': {
|
|
8261
8269
|
let i = t.subcommand || '';
|
|
8262
|
-
await
|
|
8270
|
+
await qt(i, t.options);
|
|
8263
8271
|
break;
|
|
8264
8272
|
}
|
|
8265
8273
|
case 'mcp': {
|
|
8266
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
8274
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(), zt));
|
|
8267
8275
|
await i();
|
|
8268
8276
|
break;
|
|
8269
8277
|
}
|
|
@@ -8276,15 +8284,15 @@ ${a.red('Error:')} Unknown command or model "${t.command}".
|
|
|
8276
8284
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8277
8285
|
`),
|
|
8278
8286
|
process.exit(_)),
|
|
8279
|
-
await
|
|
8287
|
+
await qe(t.command, t.options));
|
|
8280
8288
|
return;
|
|
8281
8289
|
}
|
|
8282
|
-
|
|
8290
|
+
Yt();
|
|
8283
8291
|
break;
|
|
8284
8292
|
}
|
|
8285
8293
|
}
|
|
8286
8294
|
}
|
|
8287
|
-
|
|
8295
|
+
vr().catch((e) => {
|
|
8288
8296
|
(e instanceof k &&
|
|
8289
8297
|
(process.stderr.write(`
|
|
8290
8298
|
${a.red('Error:')} ${K(e).join(`
|