@teinai/cli 1.1.13 → 1.1.15
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 +473 -458
- 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
|
+
ze,
|
|
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
|
+
(ze = I(require('node:os'))),
|
|
78
78
|
(ge = I(require('node:path'))),
|
|
79
|
-
(te = ge.default.join(
|
|
79
|
+
(te = ge.default.join(ze.default.homedir(), '.tein')),
|
|
80
80
|
(D = ge.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var pi,
|
|
83
|
+
We,
|
|
84
|
+
Ye,
|
|
85
|
+
Qe = 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
|
+
(We = [...pi, 'auto']),
|
|
89
|
+
(Ye =
|
|
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 Xe = b(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var re,
|
|
104
|
-
|
|
104
|
+
Ze = 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
|
+
et,
|
|
4670
|
+
di,
|
|
4671
|
+
xe,
|
|
4672
|
+
mi,
|
|
4673
4673
|
V = b(() => {
|
|
4674
4674
|
'use strict';
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
((
|
|
4675
|
+
Xe();
|
|
4676
|
+
Ze();
|
|
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
|
+
(et = 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) et.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
|
+
et.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 === tt)
|
|
4705
|
+
? tt
|
|
4706
4706
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4707
4707
|
}
|
|
4708
|
-
var
|
|
4709
|
-
|
|
4708
|
+
var tt,
|
|
4709
|
+
Pe = b(() => {
|
|
4710
4710
|
'use strict';
|
|
4711
4711
|
V();
|
|
4712
|
-
|
|
4712
|
+
tt = '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 it = b(() => {
|
|
4726
4726
|
'use strict';
|
|
4727
4727
|
});
|
|
4728
|
-
function
|
|
4729
|
-
return typeof t == 'string' && (
|
|
4728
|
+
function rt(e, t) {
|
|
4729
|
+
return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
|
|
4730
4730
|
}
|
|
4731
|
-
var
|
|
4732
|
-
|
|
4731
|
+
var gi,
|
|
4732
|
+
at = b(() => {
|
|
4733
4733
|
'use strict';
|
|
4734
4734
|
V();
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4735
|
+
Pe();
|
|
4736
|
+
it();
|
|
4737
|
+
gi = {};
|
|
4738
4738
|
});
|
|
4739
|
-
function
|
|
4740
|
-
return e === 'nano-banana-pro' ?
|
|
4739
|
+
function nt(e) {
|
|
4740
|
+
return e === 'nano-banana-pro' ? hi : yi;
|
|
4741
4741
|
}
|
|
4742
|
-
var
|
|
4743
|
-
|
|
4744
|
-
|
|
4742
|
+
var hi,
|
|
4743
|
+
yi,
|
|
4744
|
+
st = 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 ot,
|
|
4766
|
+
lt = b(() => {
|
|
4767
4767
|
'use strict';
|
|
4768
|
-
|
|
4768
|
+
ot = [
|
|
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 pt,
|
|
4783
|
+
dt = b(() => {
|
|
4784
4784
|
'use strict';
|
|
4785
|
-
|
|
4785
|
+
pt = [
|
|
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 ct(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 ut() {
|
|
4927
4927
|
return Object.fromEntries(
|
|
4928
|
-
|
|
4929
|
-
let t =
|
|
4930
|
-
i =
|
|
4931
|
-
r =
|
|
4932
|
-
n = t != null && i != null ? `${
|
|
4928
|
+
pt.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 ? `${ct(t)}/M in \xB7 ${ct(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 mt = b(() => {
|
|
4950
4950
|
'use strict';
|
|
4951
|
-
|
|
4951
|
+
dt();
|
|
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 yt(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 bt(e) {
|
|
5007
5007
|
if (!e.endpoints?.length) return null;
|
|
5008
|
-
let t = e.endpoints.filter((i) =>
|
|
5008
|
+
let t = e.endpoints.filter((i) => rt(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 ? wt : _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 = [wt, Pi];
|
|
5029
|
+
return (r.push(kt, xt), [...i, ...r]);
|
|
5030
5030
|
}
|
|
5031
|
-
function
|
|
5031
|
+
function ft(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
|
-
|
|
5056
|
-
|
|
5055
|
+
kt,
|
|
5056
|
+
xt,
|
|
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 = bt(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. ${Ye}`
|
|
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: [...We],
|
|
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: [...nt(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 = ot,
|
|
5192
5192
|
t = [];
|
|
5193
|
-
for (let i of
|
|
5193
|
+
for (let i of qe(!0))
|
|
5194
5194
|
e.includes(i.name) &&
|
|
5195
5195
|
(t.push({
|
|
5196
5196
|
...i,
|
|
@@ -5212,7 +5212,12 @@ function Ei() {
|
|
|
5212
5212
|
}));
|
|
5213
5213
|
return t;
|
|
5214
5214
|
}
|
|
5215
|
-
function
|
|
5215
|
+
function Ai() {
|
|
5216
|
+
return qe(!0).map((e) =>
|
|
5217
|
+
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5218
|
+
);
|
|
5219
|
+
}
|
|
5220
|
+
function qe(e) {
|
|
5216
5221
|
return [
|
|
5217
5222
|
$('The user message or task.'),
|
|
5218
5223
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -5307,37 +5312,39 @@ function kt(e) {
|
|
|
5307
5312
|
},
|
|
5308
5313
|
];
|
|
5309
5314
|
}
|
|
5310
|
-
function
|
|
5311
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5312
|
-
let t =
|
|
5315
|
+
function Ri(e) {
|
|
5316
|
+
if (e.slug === 'seed-2-1-turbo') return Ci;
|
|
5317
|
+
let t = bt(e);
|
|
5313
5318
|
return [
|
|
5314
5319
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5315
|
-
?
|
|
5316
|
-
: e.slug === '
|
|
5317
|
-
?
|
|
5318
|
-
:
|
|
5320
|
+
? qi()
|
|
5321
|
+
: e.slug === 'gemini-3.7-flash'
|
|
5322
|
+
? Ai()
|
|
5323
|
+
: e.slug === 'gpt-6-astra' || Ei.includes(e.slug)
|
|
5324
|
+
? qe(e.slug !== 'gpt-6-astra')
|
|
5325
|
+
: $i),
|
|
5319
5326
|
...(t ? [t] : []),
|
|
5320
5327
|
];
|
|
5321
5328
|
}
|
|
5322
|
-
function
|
|
5329
|
+
function Oi(e) {
|
|
5323
5330
|
let t = e.slug;
|
|
5324
|
-
if (e.kind === 'llm') return
|
|
5325
|
-
if (e.editVariants?.length) return
|
|
5331
|
+
if (e.kind === 'llm') return Ri(e);
|
|
5332
|
+
if (e.editVariants?.length) return Ki(e);
|
|
5326
5333
|
switch (t) {
|
|
5327
5334
|
case 'seedance-2-5':
|
|
5328
|
-
return
|
|
5335
|
+
return Se(gt, t);
|
|
5329
5336
|
case 'seedance-2-5-lite':
|
|
5330
|
-
return
|
|
5337
|
+
return ft(gt, { no4k: !0 });
|
|
5331
5338
|
case 'seedance-2':
|
|
5332
|
-
return
|
|
5339
|
+
return Se(ht, t);
|
|
5333
5340
|
case 'seedance-2-lite':
|
|
5334
|
-
return
|
|
5341
|
+
return ft(ht);
|
|
5335
5342
|
case 'seedance-2-mini':
|
|
5336
|
-
return
|
|
5343
|
+
return Se(Di, t);
|
|
5337
5344
|
case 'nano-banana-2':
|
|
5338
5345
|
case 'nano-banana-2.1':
|
|
5339
5346
|
case 'nano-banana-pro':
|
|
5340
|
-
return
|
|
5347
|
+
return Si(e);
|
|
5341
5348
|
case 'seedream-5-pro':
|
|
5342
5349
|
return [
|
|
5343
5350
|
$('Detailed description of the image to generate.'),
|
|
@@ -5400,7 +5407,7 @@ function Ai(e) {
|
|
|
5400
5407
|
];
|
|
5401
5408
|
case 'wan-3-0':
|
|
5402
5409
|
case 'wan-3-0-prime':
|
|
5403
|
-
return
|
|
5410
|
+
return $e(e, {
|
|
5404
5411
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5405
5412
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
5406
5413
|
minSec: 2,
|
|
@@ -5410,7 +5417,7 @@ function Ai(e) {
|
|
|
5410
5417
|
});
|
|
5411
5418
|
case 'happy-horse-1-1':
|
|
5412
5419
|
case 'happy-horse-1-0':
|
|
5413
|
-
return
|
|
5420
|
+
return $e(e, {
|
|
5414
5421
|
modes:
|
|
5415
5422
|
t === 'happy-horse-1-0'
|
|
5416
5423
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -5421,7 +5428,7 @@ function Ai(e) {
|
|
|
5421
5428
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
5422
5429
|
});
|
|
5423
5430
|
case 'minimax-h3':
|
|
5424
|
-
return
|
|
5431
|
+
return $e(e, {
|
|
5425
5432
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5426
5433
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
5427
5434
|
minSec: 4,
|
|
@@ -5432,37 +5439,37 @@ function Ai(e) {
|
|
|
5432
5439
|
return [$('Prompt text.')];
|
|
5433
5440
|
}
|
|
5434
5441
|
}
|
|
5435
|
-
function
|
|
5442
|
+
function Ce(e, t = e.api.model) {
|
|
5436
5443
|
return {
|
|
5437
5444
|
slug: t,
|
|
5438
5445
|
name: e.name,
|
|
5439
|
-
category:
|
|
5440
|
-
kind:
|
|
5446
|
+
category: wi[e.kind],
|
|
5447
|
+
kind: xi[e.kind],
|
|
5441
5448
|
vendor: e.vendor ?? '',
|
|
5442
5449
|
description: e.desc ?? e.name,
|
|
5443
|
-
priceFormatted:
|
|
5450
|
+
priceFormatted: vi(e),
|
|
5444
5451
|
unit: e.unit,
|
|
5445
|
-
primaryToolName:
|
|
5446
|
-
parameters:
|
|
5452
|
+
primaryToolName: ki[e.kind],
|
|
5453
|
+
parameters: Ti(e, Oi(e)),
|
|
5447
5454
|
};
|
|
5448
5455
|
}
|
|
5449
|
-
function
|
|
5456
|
+
function Li() {
|
|
5450
5457
|
let e = {};
|
|
5451
5458
|
for (let t of ne())
|
|
5452
5459
|
if (t.slug !== 'seedance-2-fast') {
|
|
5453
5460
|
if (t.slug === 'seedance-2-mini') {
|
|
5454
|
-
e['seedance-2-mini'] =
|
|
5461
|
+
e['seedance-2-mini'] = Ce(t, 'seedance-2-mini');
|
|
5455
5462
|
continue;
|
|
5456
5463
|
}
|
|
5457
5464
|
if (t.slug === 'seedance-2') {
|
|
5458
|
-
let i =
|
|
5465
|
+
let i = Ce(t);
|
|
5459
5466
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
5460
5467
|
(e['seedance-2'] = i));
|
|
5461
5468
|
continue;
|
|
5462
5469
|
}
|
|
5463
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
5470
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
|
|
5464
5471
|
}
|
|
5465
|
-
Object.assign(e,
|
|
5472
|
+
Object.assign(e, ut());
|
|
5466
5473
|
for (let [t, i] of Object.entries(oe))
|
|
5467
5474
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
5468
5475
|
return e;
|
|
@@ -5470,111 +5477,111 @@ function Oi() {
|
|
|
5470
5477
|
function N(e) {
|
|
5471
5478
|
return de[e] ?? null;
|
|
5472
5479
|
}
|
|
5473
|
-
function
|
|
5480
|
+
function Vi(e, t, i) {
|
|
5474
5481
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5475
5482
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5476
5483
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
5477
5484
|
}
|
|
5478
5485
|
return !0;
|
|
5479
5486
|
}
|
|
5480
|
-
function
|
|
5487
|
+
function _t(e, t) {
|
|
5481
5488
|
let i = { ...t };
|
|
5482
5489
|
if (e?.slug === 'seedance-2-5') {
|
|
5483
5490
|
let r = (n) => typeof n != 'string' || !n.trim();
|
|
5484
|
-
for (let n of
|
|
5491
|
+
for (let n of Ni) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
5485
5492
|
if (!r(i.finalize)) return i;
|
|
5486
5493
|
}
|
|
5487
5494
|
for (let r of e?.parameters ?? [])
|
|
5488
5495
|
r.default !== void 0 &&
|
|
5489
5496
|
i[r.name] === void 0 &&
|
|
5490
|
-
|
|
5497
|
+
Vi(e.slug, r.name, t) &&
|
|
5491
5498
|
(i[r.name] = r.default);
|
|
5492
5499
|
return i;
|
|
5493
5500
|
}
|
|
5494
5501
|
function q() {
|
|
5495
5502
|
return Object.values(de);
|
|
5496
5503
|
}
|
|
5497
|
-
var
|
|
5498
|
-
wi,
|
|
5504
|
+
var wi,
|
|
5499
5505
|
ki,
|
|
5506
|
+
xi,
|
|
5500
5507
|
$,
|
|
5501
|
-
yt,
|
|
5502
|
-
Ii,
|
|
5503
|
-
_i,
|
|
5504
|
-
bt,
|
|
5505
5508
|
wt,
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
+
_i,
|
|
5510
|
+
Pi,
|
|
5511
|
+
kt,
|
|
5512
|
+
xt,
|
|
5513
|
+
Ee,
|
|
5514
|
+
Mi,
|
|
5509
5515
|
$i,
|
|
5510
5516
|
Ci,
|
|
5517
|
+
Ei,
|
|
5511
5518
|
pe,
|
|
5512
|
-
|
|
5513
|
-
xt,
|
|
5519
|
+
gt,
|
|
5514
5520
|
vt,
|
|
5515
|
-
|
|
5516
|
-
|
|
5521
|
+
It,
|
|
5522
|
+
ht,
|
|
5523
|
+
Di,
|
|
5517
5524
|
de,
|
|
5518
|
-
|
|
5525
|
+
Ni,
|
|
5519
5526
|
z = b(() => {
|
|
5520
5527
|
'use strict';
|
|
5521
|
-
|
|
5522
|
-
|
|
5528
|
+
Qe();
|
|
5529
|
+
be();
|
|
5523
5530
|
V();
|
|
5524
|
-
_e();
|
|
5525
5531
|
Pe();
|
|
5526
|
-
|
|
5532
|
+
Te();
|
|
5527
5533
|
at();
|
|
5528
5534
|
st();
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
(
|
|
5532
|
-
|
|
5535
|
+
lt();
|
|
5536
|
+
mt();
|
|
5537
|
+
Ke();
|
|
5538
|
+
((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5539
|
+
(ki = {
|
|
5533
5540
|
video: 'generate_video',
|
|
5534
5541
|
image: 'generate_image',
|
|
5535
5542
|
audio: 'generate_audio',
|
|
5536
5543
|
llm: 'run_task',
|
|
5537
5544
|
}),
|
|
5538
|
-
(
|
|
5545
|
+
(xi = {
|
|
5539
5546
|
video: 'Text-to-Video',
|
|
5540
5547
|
image: 'Text-to-Image',
|
|
5541
5548
|
audio: 'Text-to-Audio',
|
|
5542
5549
|
llm: 'Reasoning (LLM)',
|
|
5543
5550
|
}));
|
|
5544
5551
|
$ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5545
|
-
((
|
|
5552
|
+
((wt = {
|
|
5546
5553
|
name: 'creative_mode',
|
|
5547
5554
|
type: 'boolean',
|
|
5548
5555
|
default: !1,
|
|
5549
5556
|
description:
|
|
5550
5557
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5551
5558
|
}),
|
|
5552
|
-
(
|
|
5559
|
+
(_i = {
|
|
5553
5560
|
name: 'creative_mode',
|
|
5554
5561
|
type: 'boolean',
|
|
5555
5562
|
default: !1,
|
|
5556
5563
|
description: `Not available yet on this model: ${le}.`,
|
|
5557
5564
|
}),
|
|
5558
|
-
(
|
|
5565
|
+
(Pi = {
|
|
5559
5566
|
name: 'priority',
|
|
5560
5567
|
type: 'boolean',
|
|
5561
5568
|
default: !1,
|
|
5562
5569
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5563
5570
|
}),
|
|
5564
|
-
(
|
|
5571
|
+
(kt = {
|
|
5565
5572
|
name: 'reference_roles',
|
|
5566
5573
|
type: 'json',
|
|
5567
5574
|
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
5575
|
}),
|
|
5569
|
-
(
|
|
5576
|
+
(xt = {
|
|
5570
5577
|
name: 'auto_fit_images',
|
|
5571
5578
|
type: 'boolean',
|
|
5572
5579
|
default: !1,
|
|
5573
5580
|
description:
|
|
5574
5581
|
'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
5582
|
}),
|
|
5576
|
-
(
|
|
5577
|
-
|
|
5583
|
+
(Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5584
|
+
Mi = new Set([
|
|
5578
5585
|
'quality',
|
|
5579
5586
|
'bitrate_mode',
|
|
5580
5587
|
'draft',
|
|
@@ -5583,7 +5590,7 @@ var bi,
|
|
|
5583
5590
|
'draft_generation_id',
|
|
5584
5591
|
'pass_faces',
|
|
5585
5592
|
]);
|
|
5586
|
-
((
|
|
5593
|
+
(($i = [
|
|
5587
5594
|
$('The user message or task.'),
|
|
5588
5595
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5589
5596
|
{
|
|
@@ -5601,7 +5608,7 @@ var bi,
|
|
|
5601
5608
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5602
5609
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5603
5610
|
]),
|
|
5604
|
-
(
|
|
5611
|
+
(Ci = [
|
|
5605
5612
|
$('The user message or task.'),
|
|
5606
5613
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5607
5614
|
{
|
|
@@ -5683,9 +5690,9 @@ var bi,
|
|
|
5683
5690
|
description: 'Video frames read a second.',
|
|
5684
5691
|
},
|
|
5685
5692
|
]),
|
|
5686
|
-
(
|
|
5693
|
+
(Ei = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5687
5694
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5688
|
-
(
|
|
5695
|
+
(gt = [
|
|
5689
5696
|
{
|
|
5690
5697
|
name: 'prompt',
|
|
5691
5698
|
type: 'string',
|
|
@@ -5834,19 +5841,19 @@ var bi,
|
|
|
5834
5841
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5835
5842
|
},
|
|
5836
5843
|
]),
|
|
5837
|
-
(
|
|
5844
|
+
(vt = {
|
|
5838
5845
|
name: 'images',
|
|
5839
5846
|
type: 'string[]',
|
|
5840
5847
|
description:
|
|
5841
5848
|
'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
5849
|
}),
|
|
5843
|
-
(
|
|
5850
|
+
(It = {
|
|
5844
5851
|
name: 'audios',
|
|
5845
5852
|
type: 'string[]',
|
|
5846
5853
|
description:
|
|
5847
5854
|
'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
5855
|
}),
|
|
5849
|
-
(
|
|
5856
|
+
(ht = [
|
|
5850
5857
|
{
|
|
5851
5858
|
name: 'prompt',
|
|
5852
5859
|
type: 'string',
|
|
@@ -5924,8 +5931,8 @@ var bi,
|
|
|
5924
5931
|
description:
|
|
5925
5932
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
5926
5933
|
},
|
|
5927
|
-
xt,
|
|
5928
5934
|
vt,
|
|
5935
|
+
It,
|
|
5929
5936
|
{
|
|
5930
5937
|
name: 'first_frame_image',
|
|
5931
5938
|
type: 'string',
|
|
@@ -5946,7 +5953,7 @@ var bi,
|
|
|
5946
5953
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5947
5954
|
},
|
|
5948
5955
|
]),
|
|
5949
|
-
(
|
|
5956
|
+
(Di = [
|
|
5950
5957
|
{
|
|
5951
5958
|
name: 'prompt',
|
|
5952
5959
|
type: 'string',
|
|
@@ -6001,8 +6008,8 @@ var bi,
|
|
|
6001
6008
|
description:
|
|
6002
6009
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6003
6010
|
},
|
|
6004
|
-
xt,
|
|
6005
6011
|
vt,
|
|
6012
|
+
It,
|
|
6006
6013
|
{
|
|
6007
6014
|
name: 'first_frame_image',
|
|
6008
6015
|
type: 'string',
|
|
@@ -6017,53 +6024,53 @@ var bi,
|
|
|
6017
6024
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6018
6025
|
},
|
|
6019
6026
|
]));
|
|
6020
|
-
de =
|
|
6021
|
-
|
|
6027
|
+
de = Li();
|
|
6028
|
+
Ni = ['draft_task_id', 'draft_generation_id'];
|
|
6022
6029
|
});
|
|
6023
6030
|
function ce(e) {
|
|
6024
6031
|
let t = '/v1/pricing/models',
|
|
6025
6032
|
i = e?.trim();
|
|
6026
6033
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
6027
6034
|
}
|
|
6028
|
-
var
|
|
6035
|
+
var Re = b(() => {
|
|
6029
6036
|
'use strict';
|
|
6030
6037
|
});
|
|
6031
|
-
function
|
|
6038
|
+
function Rt(e) {
|
|
6032
6039
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6033
6040
|
}
|
|
6034
|
-
function
|
|
6041
|
+
function Ot(e) {
|
|
6035
6042
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
6036
6043
|
i = t.filter((s) => G.includes(s.api.model)).map((s) => s.name),
|
|
6037
6044
|
r = t.filter((s) => !G.includes(s.api.model)).map((s) => s.name);
|
|
6038
6045
|
return [
|
|
6039
6046
|
...(i.length
|
|
6040
|
-
? [`${
|
|
6047
|
+
? [`${Rt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6041
6048
|
: []),
|
|
6042
|
-
...(r.length ? [`Not available yet on ${
|
|
6049
|
+
...(r.length ? [`Not available yet on ${Rt(r)}: ${le}.`] : []),
|
|
6043
6050
|
'The Acceptable Use Policy applies.',
|
|
6044
6051
|
].join(' ');
|
|
6045
6052
|
}
|
|
6046
|
-
function
|
|
6047
|
-
if (
|
|
6053
|
+
function pr(e) {
|
|
6054
|
+
if (or.has(e.name)) return e;
|
|
6048
6055
|
let t = e.inputSchema.properties;
|
|
6049
6056
|
return !t || t.callback_url
|
|
6050
6057
|
? e
|
|
6051
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
6058
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: sr } } };
|
|
6052
6059
|
}
|
|
6053
|
-
function
|
|
6060
|
+
function dr(e) {
|
|
6054
6061
|
let t = e.inputSchema.properties;
|
|
6055
6062
|
if (!t) return e;
|
|
6056
6063
|
let i = !1,
|
|
6057
6064
|
r = {};
|
|
6058
6065
|
for (let [n, s] of Object.entries(t))
|
|
6059
|
-
|
|
6066
|
+
Dt.has(n) && s.type === 'string' && !s.format
|
|
6060
6067
|
? ((r[n] = { ...s, format: 'uri' }), (i = !0))
|
|
6061
|
-
:
|
|
6068
|
+
: Dt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
6062
6069
|
? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
6063
6070
|
: (r[n] = s);
|
|
6064
6071
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
6065
6072
|
}
|
|
6066
|
-
function
|
|
6073
|
+
function cr(e) {
|
|
6067
6074
|
switch (e.type) {
|
|
6068
6075
|
case 'string':
|
|
6069
6076
|
return {
|
|
@@ -6118,11 +6125,11 @@ function pr(e) {
|
|
|
6118
6125
|
return { type: 'string', description: e.description };
|
|
6119
6126
|
}
|
|
6120
6127
|
}
|
|
6121
|
-
function
|
|
6128
|
+
function ur(e, t) {
|
|
6122
6129
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
6123
6130
|
r = {},
|
|
6124
6131
|
n = [];
|
|
6125
|
-
for (let o of e.parameters) ((r[o.name] =
|
|
6132
|
+
for (let o of e.parameters) ((r[o.name] = cr(o)), o.required && n.push(o.name));
|
|
6126
6133
|
let s = {
|
|
6127
6134
|
type: 'object',
|
|
6128
6135
|
properties: r,
|
|
@@ -6135,7 +6142,7 @@ function dr(e, t) {
|
|
|
6135
6142
|
inputSchema: s,
|
|
6136
6143
|
};
|
|
6137
6144
|
}
|
|
6138
|
-
function
|
|
6145
|
+
function mr() {
|
|
6139
6146
|
let e = q().filter((d) => d.category === 'Image'),
|
|
6140
6147
|
t = q().filter((d) => d.category === 'Video'),
|
|
6141
6148
|
i = q().filter((d) => d.category === 'Text'),
|
|
@@ -6231,7 +6238,7 @@ function cr() {
|
|
|
6231
6238
|
maximum: 2147483647,
|
|
6232
6239
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
6233
6240
|
},
|
|
6234
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6241
|
+
creative_mode: { type: 'boolean', default: !1, description: Ot('image') },
|
|
6235
6242
|
},
|
|
6236
6243
|
required: ['prompt'],
|
|
6237
6244
|
additionalProperties: !0,
|
|
@@ -6268,7 +6275,7 @@ function cr() {
|
|
|
6268
6275
|
default: '480p',
|
|
6269
6276
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
6270
6277
|
},
|
|
6271
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6278
|
+
creative_mode: { type: 'boolean', default: !1, description: Ot('video') },
|
|
6272
6279
|
priority: {
|
|
6273
6280
|
type: 'boolean',
|
|
6274
6281
|
default: !1,
|
|
@@ -6390,10 +6397,10 @@ function cr() {
|
|
|
6390
6397
|
additionalProperties: !0,
|
|
6391
6398
|
},
|
|
6392
6399
|
},
|
|
6393
|
-
p =
|
|
6394
|
-
return [n, s, o, u, l, p, c,
|
|
6400
|
+
p = fr();
|
|
6401
|
+
return [n, s, o, u, l, p, c, lr];
|
|
6395
6402
|
}
|
|
6396
|
-
function
|
|
6403
|
+
function fr() {
|
|
6397
6404
|
return {
|
|
6398
6405
|
name: 'upload_asset',
|
|
6399
6406
|
description:
|
|
@@ -6440,26 +6447,26 @@ function ur() {
|
|
|
6440
6447
|
},
|
|
6441
6448
|
};
|
|
6442
6449
|
}
|
|
6443
|
-
function
|
|
6444
|
-
let e =
|
|
6445
|
-
t = q().map((i) =>
|
|
6446
|
-
return [...e, ...t].map(
|
|
6450
|
+
function Ue() {
|
|
6451
|
+
let e = mr(),
|
|
6452
|
+
t = q().map((i) => ur(i));
|
|
6453
|
+
return [...e, ...t].map(pr).map(dr);
|
|
6447
6454
|
}
|
|
6448
|
-
var
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6455
|
+
var sr,
|
|
6456
|
+
or,
|
|
6457
|
+
lr,
|
|
6458
|
+
Dt,
|
|
6459
|
+
Lt = b(() => {
|
|
6453
6460
|
'use strict';
|
|
6454
6461
|
V();
|
|
6455
|
-
|
|
6462
|
+
Ke();
|
|
6456
6463
|
z();
|
|
6457
|
-
((
|
|
6464
|
+
((sr = {
|
|
6458
6465
|
type: 'string',
|
|
6459
6466
|
description:
|
|
6460
6467
|
'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
6468
|
}),
|
|
6462
|
-
(
|
|
6469
|
+
(or = new Set([
|
|
6463
6470
|
'upload_asset',
|
|
6464
6471
|
'upload_media',
|
|
6465
6472
|
'upload_image',
|
|
@@ -6467,7 +6474,7 @@ var ar,
|
|
|
6467
6474
|
'check_status',
|
|
6468
6475
|
'get_pricing',
|
|
6469
6476
|
])),
|
|
6470
|
-
(
|
|
6477
|
+
(lr = {
|
|
6471
6478
|
name: 'get_pricing',
|
|
6472
6479
|
description:
|
|
6473
6480
|
'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 +6489,7 @@ var ar,
|
|
|
6482
6489
|
additionalProperties: !1,
|
|
6483
6490
|
},
|
|
6484
6491
|
}));
|
|
6485
|
-
|
|
6492
|
+
Dt = new Set([
|
|
6486
6493
|
'image',
|
|
6487
6494
|
'images',
|
|
6488
6495
|
'image_url',
|
|
@@ -6499,19 +6506,19 @@ var ar,
|
|
|
6499
6506
|
'lipsyncing_audio',
|
|
6500
6507
|
]);
|
|
6501
6508
|
});
|
|
6502
|
-
var
|
|
6503
|
-
|
|
6504
|
-
forgetToolSchemas: () =>
|
|
6505
|
-
jsonRpcAnswer: () =>
|
|
6506
|
-
preprocessLocalFiles: () =>
|
|
6507
|
-
startStdioServer: () =>
|
|
6509
|
+
var zt = {};
|
|
6510
|
+
ii(zt, {
|
|
6511
|
+
forgetToolSchemas: () => wr,
|
|
6512
|
+
jsonRpcAnswer: () => jt,
|
|
6513
|
+
preprocessLocalFiles: () => Jt,
|
|
6514
|
+
startStdioServer: () => Ht,
|
|
6508
6515
|
});
|
|
6509
|
-
function
|
|
6516
|
+
function gr(e) {
|
|
6510
6517
|
let t = (i) =>
|
|
6511
6518
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6512
6519
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6513
6520
|
}
|
|
6514
|
-
function
|
|
6521
|
+
function jt(e, t, i) {
|
|
6515
6522
|
let r = e?.id,
|
|
6516
6523
|
n = r == null,
|
|
6517
6524
|
s = null;
|
|
@@ -6520,7 +6527,7 @@ function Ut(e, t, i) {
|
|
|
6520
6527
|
} catch {
|
|
6521
6528
|
s = null;
|
|
6522
6529
|
}
|
|
6523
|
-
if (s !== null &&
|
|
6530
|
+
if (s !== null && gr(s)) return n ? null : s;
|
|
6524
6531
|
if (n) return null;
|
|
6525
6532
|
if (!i && t >= 200 && t < 300) return;
|
|
6526
6533
|
let o = s?.error,
|
|
@@ -6541,12 +6548,12 @@ function Ut(e, t, i) {
|
|
|
6541
6548
|
},
|
|
6542
6549
|
};
|
|
6543
6550
|
}
|
|
6544
|
-
function
|
|
6551
|
+
function hr() {
|
|
6545
6552
|
let e = process.argv.slice(2),
|
|
6546
6553
|
t = e.indexOf('--api-key');
|
|
6547
6554
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6548
6555
|
}
|
|
6549
|
-
async function
|
|
6556
|
+
async function Bt(e, t, i) {
|
|
6550
6557
|
let r = U.default.resolve(e);
|
|
6551
6558
|
if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
|
|
6552
6559
|
throw new Error(`File not found: ${e}`);
|
|
@@ -6575,15 +6582,15 @@ async function jt(e, t, i) {
|
|
|
6575
6582
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
6576
6583
|
};
|
|
6577
6584
|
}
|
|
6578
|
-
function Bt(e) {
|
|
6579
|
-
return gr.has(U.default.extname(e).toLowerCase());
|
|
6580
|
-
}
|
|
6581
6585
|
function Ft(e) {
|
|
6586
|
+
return yr.has(U.default.extname(e).toLowerCase());
|
|
6587
|
+
}
|
|
6588
|
+
function Gt(e) {
|
|
6582
6589
|
return new Error(
|
|
6583
6590
|
`Tein uploads image, video and audio files only, and ${U.default.basename(e)} is not one.`,
|
|
6584
6591
|
);
|
|
6585
6592
|
}
|
|
6586
|
-
function
|
|
6593
|
+
function br(e) {
|
|
6587
6594
|
let t = e.trim();
|
|
6588
6595
|
if (
|
|
6589
6596
|
!t ||
|
|
@@ -6596,7 +6603,7 @@ function hr(e) {
|
|
|
6596
6603
|
let i = U.default.resolve(t);
|
|
6597
6604
|
return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
|
|
6598
6605
|
}
|
|
6599
|
-
function
|
|
6606
|
+
function Be(e) {
|
|
6600
6607
|
if (Array.isArray(e))
|
|
6601
6608
|
for (let t of e) {
|
|
6602
6609
|
let i = t;
|
|
@@ -6606,12 +6613,12 @@ function Ue(e) {
|
|
|
6606
6613
|
Q.set(i.name, i.inputSchema);
|
|
6607
6614
|
}
|
|
6608
6615
|
}
|
|
6609
|
-
function
|
|
6610
|
-
(Q.clear(), (
|
|
6616
|
+
function wr() {
|
|
6617
|
+
(Q.clear(), (je = 0));
|
|
6611
6618
|
}
|
|
6612
|
-
async function
|
|
6613
|
-
if (!(Date.now() -
|
|
6614
|
-
|
|
6619
|
+
async function kr(e, t) {
|
|
6620
|
+
if (!(Date.now() - je < 6e4)) {
|
|
6621
|
+
je = Date.now();
|
|
6615
6622
|
try {
|
|
6616
6623
|
let r = await (
|
|
6617
6624
|
await fetch(e, {
|
|
@@ -6621,39 +6628,39 @@ async function br(e, t) {
|
|
|
6621
6628
|
signal: AbortSignal.timeout(1e4),
|
|
6622
6629
|
})
|
|
6623
6630
|
).json();
|
|
6624
|
-
|
|
6631
|
+
Be(r.result?.tools);
|
|
6625
6632
|
} catch {}
|
|
6626
6633
|
}
|
|
6627
6634
|
}
|
|
6628
|
-
function
|
|
6635
|
+
function xr(e) {
|
|
6629
6636
|
return e
|
|
6630
6637
|
? e.type === 'string'
|
|
6631
6638
|
? e.format === 'uri'
|
|
6632
6639
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6633
6640
|
: !1;
|
|
6634
6641
|
}
|
|
6635
|
-
async function
|
|
6642
|
+
async function Vt(e, t, i) {
|
|
6636
6643
|
if (typeof e != 'string') return e;
|
|
6637
|
-
let r =
|
|
6644
|
+
let r = br(e);
|
|
6638
6645
|
if (!r) return e;
|
|
6639
|
-
if (!
|
|
6640
|
-
return (await
|
|
6646
|
+
if (!Ft(r)) throw Gt(r);
|
|
6647
|
+
return (await Bt(r, t, i)).url;
|
|
6641
6648
|
}
|
|
6642
|
-
async function
|
|
6643
|
-
(Q.size === 0 && Ue(
|
|
6649
|
+
async function Jt(e, t, i, r, n) {
|
|
6650
|
+
(Q.size === 0 && Be(Ue()), Q.has(e) || (await kr(n, i)));
|
|
6644
6651
|
let s = Q.get(e)?.properties;
|
|
6645
6652
|
if (!s) return t;
|
|
6646
6653
|
let o = { ...t };
|
|
6647
6654
|
for (let [u, l] of Object.entries(t))
|
|
6648
|
-
if (
|
|
6655
|
+
if (xr(s[u]))
|
|
6649
6656
|
if (Array.isArray(l)) {
|
|
6650
6657
|
let c = [];
|
|
6651
|
-
for (let p of l) c.push(await
|
|
6658
|
+
for (let p of l) c.push(await Vt(p, i, r));
|
|
6652
6659
|
o[u] = c;
|
|
6653
|
-
} else o[u] = await
|
|
6660
|
+
} else o[u] = await Vt(l, i, r);
|
|
6654
6661
|
return o;
|
|
6655
6662
|
}
|
|
6656
|
-
function
|
|
6663
|
+
function vr(e) {
|
|
6657
6664
|
let t = e.id ?? null;
|
|
6658
6665
|
switch (e.method) {
|
|
6659
6666
|
case 'initialize':
|
|
@@ -6671,7 +6678,7 @@ function kr(e) {
|
|
|
6671
6678
|
case 'ping':
|
|
6672
6679
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
6673
6680
|
case 'tools/list':
|
|
6674
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
6681
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ue() } };
|
|
6675
6682
|
case 'tools/call':
|
|
6676
6683
|
return {
|
|
6677
6684
|
jsonrpc: '2.0',
|
|
@@ -6694,13 +6701,13 @@ function kr(e) {
|
|
|
6694
6701
|
};
|
|
6695
6702
|
}
|
|
6696
6703
|
}
|
|
6697
|
-
async function
|
|
6698
|
-
if (
|
|
6699
|
-
|
|
6700
|
-
let e =
|
|
6704
|
+
async function Ht() {
|
|
6705
|
+
if (Nt) return;
|
|
6706
|
+
Nt = !0;
|
|
6707
|
+
let e = hr(),
|
|
6701
6708
|
t = x(),
|
|
6702
6709
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6703
|
-
(
|
|
6710
|
+
(Ut.default
|
|
6704
6711
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6705
6712
|
.on('line', async (n) => {
|
|
6706
6713
|
let s = n.trim();
|
|
@@ -6761,8 +6768,8 @@ async function Jt() {
|
|
|
6761
6768
|
try {
|
|
6762
6769
|
let d = U.default.resolve(p.trim());
|
|
6763
6770
|
if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
|
|
6764
|
-
if (!
|
|
6765
|
-
let m = await
|
|
6771
|
+
if (!Ft(d)) throw Gt(d);
|
|
6772
|
+
let m = await Bt(d, e, t),
|
|
6766
6773
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
6767
6774
|
ue =
|
|
6768
6775
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6818,7 +6825,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6818
6825
|
}
|
|
6819
6826
|
if (e)
|
|
6820
6827
|
try {
|
|
6821
|
-
o.params.arguments = await
|
|
6828
|
+
o.params.arguments = await Jt(String(l), c, e, t, i);
|
|
6822
6829
|
} catch (p) {
|
|
6823
6830
|
let d = p instanceof Error ? p.message : String(p);
|
|
6824
6831
|
process.stdout.write(
|
|
@@ -6849,10 +6856,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6849
6856
|
body: JSON.stringify(o),
|
|
6850
6857
|
}),
|
|
6851
6858
|
c = await l.text(),
|
|
6852
|
-
p =
|
|
6859
|
+
p = jt(o, l.status, c);
|
|
6853
6860
|
if (p === null) return;
|
|
6854
6861
|
if (p) {
|
|
6855
|
-
(o?.method === 'tools/list' &&
|
|
6862
|
+
(o?.method === 'tools/list' && Be(p.result?.tools),
|
|
6856
6863
|
process.stdout.write(
|
|
6857
6864
|
JSON.stringify(p) +
|
|
6858
6865
|
`
|
|
@@ -6861,7 +6868,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6861
6868
|
return;
|
|
6862
6869
|
}
|
|
6863
6870
|
} catch {}
|
|
6864
|
-
let u =
|
|
6871
|
+
let u = vr(o);
|
|
6865
6872
|
u !== null &&
|
|
6866
6873
|
process.stdout.write(
|
|
6867
6874
|
JSON.stringify(u) +
|
|
@@ -6886,20 +6893,20 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6886
6893
|
}
|
|
6887
6894
|
var R,
|
|
6888
6895
|
U,
|
|
6889
|
-
|
|
6890
|
-
|
|
6896
|
+
Ut,
|
|
6897
|
+
yr,
|
|
6891
6898
|
Q,
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6899
|
+
je,
|
|
6900
|
+
Nt,
|
|
6901
|
+
Wt = b(() => {
|
|
6895
6902
|
'use strict';
|
|
6896
6903
|
((R = I(require('node:fs'))),
|
|
6897
6904
|
(U = I(require('node:path'))),
|
|
6898
|
-
(
|
|
6899
|
-
|
|
6900
|
-
|
|
6905
|
+
(Ut = I(require('node:readline'))));
|
|
6906
|
+
Re();
|
|
6907
|
+
Lt();
|
|
6901
6908
|
E();
|
|
6902
|
-
|
|
6909
|
+
yr = new Set([
|
|
6903
6910
|
'.png',
|
|
6904
6911
|
'.jpg',
|
|
6905
6912
|
'.jpeg',
|
|
@@ -6925,20 +6932,20 @@ var R,
|
|
|
6925
6932
|
'.flac',
|
|
6926
6933
|
'.opus',
|
|
6927
6934
|
]);
|
|
6928
|
-
((Q = new Map()), (
|
|
6929
|
-
|
|
6935
|
+
((Q = new Map()), (je = 0));
|
|
6936
|
+
Nt = !1;
|
|
6930
6937
|
require.main === module &&
|
|
6931
|
-
|
|
6938
|
+
Ht().catch((e) => {
|
|
6932
6939
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
6933
6940
|
`),
|
|
6934
6941
|
process.exit(1));
|
|
6935
6942
|
});
|
|
6936
6943
|
});
|
|
6937
|
-
var
|
|
6944
|
+
var ai =
|
|
6938
6945
|
!process.env.NO_COLOR &&
|
|
6939
6946
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
6940
6947
|
function w(e, t) {
|
|
6941
|
-
return (i) => (
|
|
6948
|
+
return (i) => (ai ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
6942
6949
|
}
|
|
6943
6950
|
var a = {
|
|
6944
6951
|
bold: w(1, 22),
|
|
@@ -7025,10 +7032,10 @@ var a = {
|
|
|
7025
7032
|
var O = I(require('node:fs')),
|
|
7026
7033
|
A = I(require('node:path'));
|
|
7027
7034
|
var ee = I(require('node:fs')),
|
|
7028
|
-
|
|
7029
|
-
|
|
7035
|
+
Je = I(require('node:path')),
|
|
7036
|
+
He = require('node:stream/promises');
|
|
7030
7037
|
var Z = '1.1.7';
|
|
7031
|
-
var
|
|
7038
|
+
var ni = new Set([
|
|
7032
7039
|
'account_suspended',
|
|
7033
7040
|
'account_terminated',
|
|
7034
7041
|
'creative_mode_restricted',
|
|
@@ -7036,7 +7043,7 @@ var ai = new Set([
|
|
|
7036
7043
|
'workspace_paused',
|
|
7037
7044
|
]),
|
|
7038
7045
|
_ = 1,
|
|
7039
|
-
|
|
7046
|
+
si = 3,
|
|
7040
7047
|
k = class extends Error {
|
|
7041
7048
|
constructor(t, i, r, n = {}) {
|
|
7042
7049
|
(super(i),
|
|
@@ -7046,10 +7053,10 @@ var ai = new Set([
|
|
|
7046
7053
|
(this.fields = n));
|
|
7047
7054
|
}
|
|
7048
7055
|
get exitCode() {
|
|
7049
|
-
return this.code &&
|
|
7056
|
+
return this.code && ni.has(this.code) ? si : _;
|
|
7050
7057
|
}
|
|
7051
7058
|
};
|
|
7052
|
-
function
|
|
7059
|
+
function oi(e, t, i) {
|
|
7053
7060
|
let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
7054
7061
|
if (!i || typeof i != 'object') return new k(e, r);
|
|
7055
7062
|
let n = i;
|
|
@@ -7062,13 +7069,13 @@ function si(e, t, i) {
|
|
|
7062
7069
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
|
|
7063
7070
|
return new k(e, c, typeof o == 'string' ? o : void 0, l);
|
|
7064
7071
|
}
|
|
7065
|
-
function
|
|
7072
|
+
function Fe(e) {
|
|
7066
7073
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
7067
7074
|
}
|
|
7068
7075
|
function K(e) {
|
|
7069
7076
|
let t = [e.message],
|
|
7070
|
-
i =
|
|
7071
|
-
r =
|
|
7077
|
+
i = Fe(e.fields.required),
|
|
7078
|
+
r = Fe(e.fields.balance);
|
|
7072
7079
|
(i || r) &&
|
|
7073
7080
|
t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
|
|
7074
7081
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -7076,19 +7083,19 @@ function K(e) {
|
|
|
7076
7083
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
7077
7084
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
7078
7085
|
}
|
|
7079
|
-
function
|
|
7086
|
+
function li(e) {
|
|
7080
7087
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7081
7088
|
? 'video'
|
|
7082
7089
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
7083
7090
|
? 'audio'
|
|
7084
7091
|
: 'image';
|
|
7085
7092
|
}
|
|
7086
|
-
function
|
|
7093
|
+
function Ge(e) {
|
|
7087
7094
|
let t = [];
|
|
7088
7095
|
for (let i of e.data ?? [])
|
|
7089
7096
|
typeof i.message?.content == 'string'
|
|
7090
7097
|
? t.push({ type: 'text', text: i.message.content })
|
|
7091
|
-
: i.url && t.push({ type:
|
|
7098
|
+
: i.url && t.push({ type: li(i.url), url: i.url });
|
|
7092
7099
|
return t;
|
|
7093
7100
|
}
|
|
7094
7101
|
var M = class {
|
|
@@ -7114,7 +7121,7 @@ var M = class {
|
|
|
7114
7121
|
try {
|
|
7115
7122
|
s = await n.json();
|
|
7116
7123
|
} catch {}
|
|
7117
|
-
throw
|
|
7124
|
+
throw oi(n.status, n.statusText, s);
|
|
7118
7125
|
}
|
|
7119
7126
|
return await n.json();
|
|
7120
7127
|
}
|
|
@@ -7128,7 +7135,7 @@ var M = class {
|
|
|
7128
7135
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
7129
7136
|
? n
|
|
7130
7137
|
: 'processing',
|
|
7131
|
-
o =
|
|
7138
|
+
o = Ge(r);
|
|
7132
7139
|
return {
|
|
7133
7140
|
request_id: r.request_id || r.id || '',
|
|
7134
7141
|
model: r.model,
|
|
@@ -7146,7 +7153,7 @@ var M = class {
|
|
|
7146
7153
|
r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
|
|
7147
7154
|
? r
|
|
7148
7155
|
: 'processing',
|
|
7149
|
-
s =
|
|
7156
|
+
s = Ge(i),
|
|
7150
7157
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
7151
7158
|
return {
|
|
7152
7159
|
request_id: i.id || t,
|
|
@@ -7164,37 +7171,45 @@ var M = class {
|
|
|
7164
7171
|
async downloadOutput(t, i) {
|
|
7165
7172
|
let r = await fetch(t);
|
|
7166
7173
|
if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
|
|
7167
|
-
let n =
|
|
7174
|
+
let n = Je.default.dirname(i);
|
|
7168
7175
|
ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
|
|
7169
7176
|
let s = ee.default.createWriteStream(i);
|
|
7170
|
-
return (await (0,
|
|
7177
|
+
return (await (0, He.pipeline)(r.body, s), i);
|
|
7171
7178
|
}
|
|
7172
7179
|
};
|
|
7173
7180
|
E();
|
|
7181
|
+
function ye(e) {
|
|
7182
|
+
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
7183
|
+
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
7184
|
+
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
7185
|
+
i = 10 ** t,
|
|
7186
|
+
r = Math.round(Number((e * i).toFixed(6))) / i;
|
|
7187
|
+
return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
|
|
7188
|
+
}
|
|
7174
7189
|
z();
|
|
7175
|
-
var
|
|
7176
|
-
function
|
|
7177
|
-
for (let t of
|
|
7190
|
+
var Pt = ['images', 'input_images', 'videos', 'audios'];
|
|
7191
|
+
function Ui(e) {
|
|
7192
|
+
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7178
7193
|
}
|
|
7179
|
-
function
|
|
7194
|
+
function ji(e) {
|
|
7180
7195
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7181
7196
|
let t = A.default.resolve(e);
|
|
7182
7197
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7183
7198
|
}
|
|
7184
|
-
async function
|
|
7185
|
-
for (let i of
|
|
7199
|
+
async function Bi(e, t) {
|
|
7200
|
+
for (let i of Pt) {
|
|
7186
7201
|
if (!Array.isArray(e[i])) continue;
|
|
7187
7202
|
let r = [];
|
|
7188
7203
|
for (let n of e[i]) {
|
|
7189
7204
|
if (typeof n != 'string') continue;
|
|
7190
|
-
let s =
|
|
7205
|
+
let s = ji(n);
|
|
7191
7206
|
r.push(s ? await t(s) : n);
|
|
7192
7207
|
}
|
|
7193
7208
|
e[i] = r;
|
|
7194
7209
|
}
|
|
7195
7210
|
}
|
|
7196
7211
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7197
|
-
function
|
|
7212
|
+
function Fi(e) {
|
|
7198
7213
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7199
7214
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7200
7215
|
i = W.enterprise;
|
|
@@ -7207,7 +7222,7 @@ function ji(e) {
|
|
|
7207
7222
|
t
|
|
7208
7223
|
);
|
|
7209
7224
|
}
|
|
7210
|
-
async function
|
|
7225
|
+
async function Gi(e, t, i, r, n) {
|
|
7211
7226
|
n.isJson ||
|
|
7212
7227
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7213
7228
|
`);
|
|
@@ -7269,7 +7284,7 @@ async function Bi(e, t, i, r, n) {
|
|
|
7269
7284
|
else {
|
|
7270
7285
|
for (let l of o)
|
|
7271
7286
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
7272
|
-
l.usage?.cost !== void 0 && process.stdout.write(`
|
|
7287
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${ye(l.usage.cost)}`),
|
|
7273
7288
|
l.error && process.stdout.write(` ${l.error}`),
|
|
7274
7289
|
process.stdout.write(`
|
|
7275
7290
|
`));
|
|
@@ -7282,7 +7297,7 @@ async function Bi(e, t, i, r, n) {
|
|
|
7282
7297
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7283
7298
|
process.exit(_);
|
|
7284
7299
|
}
|
|
7285
|
-
function
|
|
7300
|
+
function Tt(e) {
|
|
7286
7301
|
let t = {},
|
|
7287
7302
|
i = new Set(),
|
|
7288
7303
|
r = [];
|
|
@@ -7327,7 +7342,7 @@ function Pt(e) {
|
|
|
7327
7342
|
}
|
|
7328
7343
|
return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
|
|
7329
7344
|
}
|
|
7330
|
-
async function
|
|
7345
|
+
async function Ae(e, t) {
|
|
7331
7346
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7332
7347
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7333
7348
|
(i ||
|
|
@@ -7349,7 +7364,7 @@ async function Ee(e, t) {
|
|
|
7349
7364
|
s = !!t.json,
|
|
7350
7365
|
o = !!(t.async || t.no_wait),
|
|
7351
7366
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7352
|
-
l =
|
|
7367
|
+
l = Fi(t),
|
|
7353
7368
|
c = { ...t };
|
|
7354
7369
|
(delete c.json,
|
|
7355
7370
|
delete c.async,
|
|
@@ -7358,8 +7373,8 @@ async function Ee(e, t) {
|
|
|
7358
7373
|
delete c.api_key,
|
|
7359
7374
|
delete c.api_url,
|
|
7360
7375
|
delete c.count);
|
|
7361
|
-
let p =
|
|
7362
|
-
(
|
|
7376
|
+
let p = _t(n, c);
|
|
7377
|
+
(Ui(p),
|
|
7363
7378
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7364
7379
|
p.image_url &&
|
|
7365
7380
|
!p.first_frame_image &&
|
|
@@ -7392,7 +7407,7 @@ async function Ee(e, t) {
|
|
|
7392
7407
|
}
|
|
7393
7408
|
}
|
|
7394
7409
|
}
|
|
7395
|
-
await
|
|
7410
|
+
await Bi(p, async (y) => {
|
|
7396
7411
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7397
7412
|
s || f.start();
|
|
7398
7413
|
try {
|
|
@@ -7416,7 +7431,7 @@ async function Ee(e, t) {
|
|
|
7416
7431
|
let g;
|
|
7417
7432
|
try {
|
|
7418
7433
|
if (l > 1) {
|
|
7419
|
-
await
|
|
7434
|
+
await Gi(d, e, p, l, { isJson: s, isAsync: o });
|
|
7420
7435
|
return;
|
|
7421
7436
|
}
|
|
7422
7437
|
g = await d.queueJob(e, p);
|
|
@@ -7501,7 +7516,7 @@ async function Ee(e, t) {
|
|
|
7501
7516
|
process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
|
|
7502
7517
|
`),
|
|
7503
7518
|
g.usage?.cost !== void 0 &&
|
|
7504
|
-
process.stdout.write(` ${a.bold('Cost:')}
|
|
7519
|
+
process.stdout.write(` ${a.bold('Cost:')} ${ye(g.usage.cost)}
|
|
7505
7520
|
`),
|
|
7506
7521
|
g.output && g.output.length > 0)
|
|
7507
7522
|
) {
|
|
@@ -7534,9 +7549,9 @@ ${f.text}
|
|
|
7534
7549
|
process.stdout.write(`
|
|
7535
7550
|
`);
|
|
7536
7551
|
}
|
|
7537
|
-
var
|
|
7552
|
+
var Mt = I(require('node:readline'));
|
|
7538
7553
|
E();
|
|
7539
|
-
async function
|
|
7554
|
+
async function Ji(e) {
|
|
7540
7555
|
try {
|
|
7541
7556
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7542
7557
|
} catch (t) {
|
|
@@ -7547,8 +7562,8 @@ async function Fi(e) {
|
|
|
7547
7562
|
return 'unchecked';
|
|
7548
7563
|
}
|
|
7549
7564
|
}
|
|
7550
|
-
function
|
|
7551
|
-
let t =
|
|
7565
|
+
function Hi(e) {
|
|
7566
|
+
let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7552
7567
|
return new Promise((i) => {
|
|
7553
7568
|
t.question(e, (r) => {
|
|
7554
7569
|
(t.close(), i(r.trim()));
|
|
@@ -7567,14 +7582,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7567
7582
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7568
7583
|
|
|
7569
7584
|
`),
|
|
7570
|
-
(i = await
|
|
7585
|
+
(i = await Hi('Enter your Tein API Key (sk_live_...): '))),
|
|
7571
7586
|
!i.startsWith('sk_live_') &&
|
|
7572
7587
|
!i.startsWith('sk_test_') &&
|
|
7573
7588
|
(process.stderr
|
|
7574
7589
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7575
7590
|
`),
|
|
7576
7591
|
process.exit(1)));
|
|
7577
|
-
let r = await
|
|
7592
|
+
let r = await Ji(i);
|
|
7578
7593
|
(r === 'invalid' &&
|
|
7579
7594
|
(process.stderr
|
|
7580
7595
|
.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 +7659,12 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7644
7659
|
}
|
|
7645
7660
|
}
|
|
7646
7661
|
E();
|
|
7647
|
-
|
|
7662
|
+
be();
|
|
7648
7663
|
z();
|
|
7649
|
-
var
|
|
7650
|
-
async function
|
|
7664
|
+
var zi = 3e3;
|
|
7665
|
+
async function Kt(e) {
|
|
7651
7666
|
try {
|
|
7652
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
7667
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(zi) });
|
|
7653
7668
|
if (!t.ok) return;
|
|
7654
7669
|
let i = await t.json(),
|
|
7655
7670
|
r = {};
|
|
@@ -7657,18 +7672,18 @@ async function Mt(e) {
|
|
|
7657
7672
|
let s = String(n.modelSlug ?? '');
|
|
7658
7673
|
B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7659
7674
|
}
|
|
7660
|
-
|
|
7675
|
+
yt(r);
|
|
7661
7676
|
} catch {}
|
|
7662
7677
|
}
|
|
7663
|
-
var
|
|
7664
|
-
|
|
7665
|
-
async function
|
|
7666
|
-
await
|
|
7678
|
+
var Wi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7679
|
+
Yi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7680
|
+
async function St(e, t) {
|
|
7681
|
+
await Kt(t);
|
|
7667
7682
|
let i = q();
|
|
7668
7683
|
if (e) {
|
|
7669
7684
|
let s = e.toLowerCase(),
|
|
7670
|
-
o =
|
|
7671
|
-
i =
|
|
7685
|
+
o = Yi[s] ?? s;
|
|
7686
|
+
i = Wi.has(o)
|
|
7672
7687
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7673
7688
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7674
7689
|
}
|
|
@@ -7706,8 +7721,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7706
7721
|
|
|
7707
7722
|
`);
|
|
7708
7723
|
}
|
|
7709
|
-
async function
|
|
7710
|
-
B.has(e) && (await
|
|
7724
|
+
async function $t(e, t) {
|
|
7725
|
+
B.has(e) && (await Kt(t));
|
|
7711
7726
|
let i = N(e);
|
|
7712
7727
|
(i ||
|
|
7713
7728
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -7788,9 +7803,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7788
7803
|
`);
|
|
7789
7804
|
}
|
|
7790
7805
|
E();
|
|
7791
|
-
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7806
|
+
Re();
|
|
7807
|
+
var Qi = 1e4,
|
|
7808
|
+
De = {
|
|
7794
7809
|
price: '',
|
|
7795
7810
|
creativeMode: 'Creative mode',
|
|
7796
7811
|
priority: 'Priority',
|
|
@@ -7800,22 +7815,22 @@ var Wi = 1e4,
|
|
|
7800
7815
|
priorityDraft: 'Priority + Draft',
|
|
7801
7816
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7802
7817
|
},
|
|
7803
|
-
|
|
7804
|
-
|
|
7818
|
+
Xi = Object.keys(De),
|
|
7819
|
+
Zi = {
|
|
7805
7820
|
creativeMode: 'unfiltered',
|
|
7806
7821
|
creativeModePriority: 'unfilteredPriority',
|
|
7807
7822
|
creativeModeDraft: 'unfilteredDraft',
|
|
7808
7823
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7809
7824
|
};
|
|
7810
|
-
function
|
|
7811
|
-
let i =
|
|
7825
|
+
function er(e, t) {
|
|
7826
|
+
let i = Zi[t];
|
|
7812
7827
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7813
7828
|
}
|
|
7814
|
-
async function
|
|
7829
|
+
async function tr(e, t) {
|
|
7815
7830
|
let i = `${x(e)}${ce(t)}`,
|
|
7816
7831
|
r;
|
|
7817
7832
|
try {
|
|
7818
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7833
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Qi) });
|
|
7819
7834
|
} catch {
|
|
7820
7835
|
throw new Error(`Could not reach ${i}`);
|
|
7821
7836
|
}
|
|
@@ -7831,18 +7846,18 @@ async function Zi(e, t) {
|
|
|
7831
7846
|
}
|
|
7832
7847
|
return n;
|
|
7833
7848
|
}
|
|
7834
|
-
function
|
|
7849
|
+
function Oe(e) {
|
|
7835
7850
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7836
7851
|
[i, r = ''] = t.split('.');
|
|
7837
7852
|
return `$${i}.${r.padEnd(2, '0')}`;
|
|
7838
7853
|
}
|
|
7839
|
-
function
|
|
7854
|
+
function Le(e) {
|
|
7840
7855
|
if (!e || typeof e.starter != 'number') return null;
|
|
7841
7856
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7842
7857
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7843
|
-
return `Starter ${
|
|
7858
|
+
return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
|
|
7844
7859
|
}
|
|
7845
|
-
function
|
|
7860
|
+
function ir(e) {
|
|
7846
7861
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7847
7862
|
let t = [];
|
|
7848
7863
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7854,33 +7869,33 @@ function er(e) {
|
|
|
7854
7869
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7855
7870
|
);
|
|
7856
7871
|
}
|
|
7857
|
-
function
|
|
7858
|
-
let i =
|
|
7859
|
-
for (let r of
|
|
7860
|
-
let n =
|
|
7872
|
+
function rr(e, t) {
|
|
7873
|
+
let i = ir(e);
|
|
7874
|
+
for (let r of Xi) {
|
|
7875
|
+
let n = Le(er(e, r));
|
|
7861
7876
|
if (!n) continue;
|
|
7862
|
-
let s =
|
|
7877
|
+
let s = De[r] ? ` (${De[r]})` : '';
|
|
7863
7878
|
t.push(` ${i}${s} ${n}`);
|
|
7864
7879
|
}
|
|
7865
7880
|
}
|
|
7866
|
-
function
|
|
7881
|
+
function ar(e, t) {
|
|
7867
7882
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7868
7883
|
t.push(
|
|
7869
7884
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7870
7885
|
);
|
|
7871
|
-
for (let n of e.variants ?? [])
|
|
7886
|
+
for (let n of e.variants ?? []) rr(n, t);
|
|
7872
7887
|
let r = e.addons;
|
|
7873
7888
|
if (Array.isArray(r))
|
|
7874
7889
|
for (let n of r) {
|
|
7875
7890
|
if (!n || typeof n != 'object') continue;
|
|
7876
7891
|
let s = n,
|
|
7877
7892
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
7878
|
-
u =
|
|
7893
|
+
u = Le(s.price);
|
|
7879
7894
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
7880
7895
|
}
|
|
7881
7896
|
t.push('');
|
|
7882
7897
|
}
|
|
7883
|
-
function
|
|
7898
|
+
function nr(e) {
|
|
7884
7899
|
let t = [],
|
|
7885
7900
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7886
7901
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7902,7 +7917,7 @@ function rr(e) {
|
|
|
7902
7917
|
});
|
|
7903
7918
|
for (let l of s) {
|
|
7904
7919
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7905
|
-
for (let c of r.get(l) ?? [])
|
|
7920
|
+
for (let c of r.get(l) ?? []) ar(c, t);
|
|
7906
7921
|
}
|
|
7907
7922
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7908
7923
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -7919,7 +7934,7 @@ function rr(e) {
|
|
|
7919
7934
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
7920
7935
|
for (let m of p) {
|
|
7921
7936
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
7922
|
-
g =
|
|
7937
|
+
g = Le(m.prices);
|
|
7923
7938
|
g && t.push(` ${h} ${g}`);
|
|
7924
7939
|
}
|
|
7925
7940
|
t.push('');
|
|
@@ -7932,10 +7947,10 @@ function rr(e) {
|
|
|
7932
7947
|
`
|
|
7933
7948
|
);
|
|
7934
7949
|
}
|
|
7935
|
-
async function
|
|
7950
|
+
async function Ct(e) {
|
|
7936
7951
|
let t;
|
|
7937
7952
|
try {
|
|
7938
|
-
t = await
|
|
7953
|
+
t = await tr(e.apiUrl, e.model);
|
|
7939
7954
|
} catch (i) {
|
|
7940
7955
|
let r = i instanceof Error ? i.message : String(i);
|
|
7941
7956
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7946,12 +7961,12 @@ async function $t(e) {
|
|
|
7946
7961
|
e.json
|
|
7947
7962
|
? `${JSON.stringify(t, null, 2)}
|
|
7948
7963
|
`
|
|
7949
|
-
:
|
|
7964
|
+
: nr(t),
|
|
7950
7965
|
);
|
|
7951
7966
|
}
|
|
7952
|
-
var
|
|
7967
|
+
var Et = I(require('node:path'));
|
|
7953
7968
|
E();
|
|
7954
|
-
async function
|
|
7969
|
+
async function qt(e, t) {
|
|
7955
7970
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7956
7971
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7957
7972
|
(i ||
|
|
@@ -8046,7 +8061,7 @@ ${a.bold('Outputs:')}
|
|
|
8046
8061
|
) {
|
|
8047
8062
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
8048
8063
|
try {
|
|
8049
|
-
(await u.downloadOutput(p.url,
|
|
8064
|
+
(await u.downloadOutput(p.url, Et.default.resolve(process.cwd(), o)),
|
|
8050
8065
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
8051
8066
|
} catch (m) {
|
|
8052
8067
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -8061,10 +8076,10 @@ ${p.text}
|
|
|
8061
8076
|
process.stdout.write(`
|
|
8062
8077
|
`);
|
|
8063
8078
|
}
|
|
8064
|
-
var
|
|
8065
|
-
|
|
8079
|
+
var Ve = I(require('node:fs')),
|
|
8080
|
+
Ne = I(require('node:path'));
|
|
8066
8081
|
E();
|
|
8067
|
-
async function
|
|
8082
|
+
async function At(e, t = {}) {
|
|
8068
8083
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8069
8084
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
8070
8085
|
n = !!t.json;
|
|
@@ -8081,13 +8096,13 @@ async function qt(e, t = {}) {
|
|
|
8081
8096
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8082
8097
|
`),
|
|
8083
8098
|
process.exit(1)));
|
|
8084
|
-
let s =
|
|
8085
|
-
|
|
8099
|
+
let s = Ne.default.resolve(e);
|
|
8100
|
+
Ve.default.existsSync(s) ||
|
|
8086
8101
|
(process.stderr.write(`${a.red('Error:')} File not found: ${s}
|
|
8087
8102
|
`),
|
|
8088
8103
|
process.exit(1));
|
|
8089
|
-
let o =
|
|
8090
|
-
l =
|
|
8104
|
+
let o = Ne.default.basename(s),
|
|
8105
|
+
l = Ve.default.readFileSync(s).toString('base64'),
|
|
8091
8106
|
c = new M(i, r),
|
|
8092
8107
|
p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
8093
8108
|
n || p.start();
|
|
@@ -8129,8 +8144,8 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8129
8144
|
}
|
|
8130
8145
|
}
|
|
8131
8146
|
z();
|
|
8132
|
-
|
|
8133
|
-
function
|
|
8147
|
+
Te();
|
|
8148
|
+
function Yt() {
|
|
8134
8149
|
process.stdout.write(`
|
|
8135
8150
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8136
8151
|
|
|
@@ -8190,11 +8205,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8190
8205
|
|
|
8191
8206
|
`);
|
|
8192
8207
|
}
|
|
8193
|
-
async function
|
|
8208
|
+
async function Ir() {
|
|
8194
8209
|
let e = process.argv.slice(2),
|
|
8195
|
-
t =
|
|
8210
|
+
t = Tt(e);
|
|
8196
8211
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8197
|
-
|
|
8212
|
+
Yt();
|
|
8198
8213
|
return;
|
|
8199
8214
|
}
|
|
8200
8215
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8221,14 +8236,14 @@ async function xr() {
|
|
|
8221
8236
|
}
|
|
8222
8237
|
case 'models':
|
|
8223
8238
|
case 'list': {
|
|
8224
|
-
await
|
|
8239
|
+
await St(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8225
8240
|
break;
|
|
8226
8241
|
}
|
|
8227
8242
|
case 'pricing':
|
|
8228
8243
|
case 'prices': {
|
|
8229
8244
|
let i = t.options.model,
|
|
8230
8245
|
r = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
8231
|
-
await
|
|
8246
|
+
await Ct({
|
|
8232
8247
|
model: r,
|
|
8233
8248
|
json: !!t.options.json,
|
|
8234
8249
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -8243,27 +8258,27 @@ async function xr() {
|
|
|
8243
8258
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8244
8259
|
`),
|
|
8245
8260
|
process.exit(1)),
|
|
8246
|
-
await
|
|
8261
|
+
await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8247
8262
|
break;
|
|
8248
8263
|
}
|
|
8249
8264
|
case 'upload': {
|
|
8250
8265
|
let i = t.subcommand || '';
|
|
8251
|
-
await
|
|
8266
|
+
await At(i, t.options);
|
|
8252
8267
|
break;
|
|
8253
8268
|
}
|
|
8254
8269
|
case 'run':
|
|
8255
8270
|
case 'generate': {
|
|
8256
8271
|
let i = t.subcommand || '';
|
|
8257
|
-
await
|
|
8272
|
+
await Ae(i, t.options);
|
|
8258
8273
|
break;
|
|
8259
8274
|
}
|
|
8260
8275
|
case 'status': {
|
|
8261
8276
|
let i = t.subcommand || '';
|
|
8262
|
-
await
|
|
8277
|
+
await qt(i, t.options);
|
|
8263
8278
|
break;
|
|
8264
8279
|
}
|
|
8265
8280
|
case 'mcp': {
|
|
8266
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
8281
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(), zt));
|
|
8267
8282
|
await i();
|
|
8268
8283
|
break;
|
|
8269
8284
|
}
|
|
@@ -8276,15 +8291,15 @@ ${a.red('Error:')} Unknown command or model "${t.command}".
|
|
|
8276
8291
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8277
8292
|
`),
|
|
8278
8293
|
process.exit(_)),
|
|
8279
|
-
await
|
|
8294
|
+
await Ae(t.command, t.options));
|
|
8280
8295
|
return;
|
|
8281
8296
|
}
|
|
8282
|
-
|
|
8297
|
+
Yt();
|
|
8283
8298
|
break;
|
|
8284
8299
|
}
|
|
8285
8300
|
}
|
|
8286
8301
|
}
|
|
8287
|
-
|
|
8302
|
+
Ir().catch((e) => {
|
|
8288
8303
|
(e instanceof k &&
|
|
8289
8304
|
(process.stderr.write(`
|
|
8290
8305
|
${a.red('Error:')} ${K(e).join(`
|