@teinai/cli 1.1.14 → 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 +211 -204
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -67,26 +67,26 @@ 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
82
|
var pi,
|
|
83
|
-
ze,
|
|
84
83
|
We,
|
|
85
|
-
Ye
|
|
84
|
+
Ye,
|
|
85
|
+
Qe = b(() => {
|
|
86
86
|
'use strict';
|
|
87
87
|
((pi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
-
(
|
|
89
|
-
(
|
|
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,
|
|
@@ -97,11 +97,11 @@ var B,
|
|
|
97
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',
|
|
@@ -4666,14 +4666,14 @@ function ne() {
|
|
|
4666
4666
|
var Ie,
|
|
4667
4667
|
ae,
|
|
4668
4668
|
ke,
|
|
4669
|
-
|
|
4669
|
+
et,
|
|
4670
4670
|
di,
|
|
4671
4671
|
xe,
|
|
4672
4672
|
mi,
|
|
4673
4673
|
V = b(() => {
|
|
4674
4674
|
'use strict';
|
|
4675
|
-
Qe();
|
|
4676
4675
|
Xe();
|
|
4676
|
+
Ze();
|
|
4677
4677
|
((Ie = {
|
|
4678
4678
|
...re,
|
|
4679
4679
|
families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
|
|
@@ -4681,14 +4681,14 @@ var Ie,
|
|
|
4681
4681
|
}),
|
|
4682
4682
|
(ae = new Map()),
|
|
4683
4683
|
(ke = new Map()),
|
|
4684
|
-
(
|
|
4684
|
+
(et = new Map()),
|
|
4685
4685
|
(di = new Map()),
|
|
4686
4686
|
(xe = new Map()));
|
|
4687
4687
|
for (let e of Ie.models) {
|
|
4688
4688
|
(ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
|
|
4689
|
-
for (let t of e.variants)
|
|
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
|
-
|
|
4691
|
+
et.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4692
4692
|
for (let t of e.addons ?? []) di.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4693
4693
|
xe.set(e.slug, e.family);
|
|
4694
4694
|
}
|
|
@@ -4701,15 +4701,15 @@ function se(e) {
|
|
|
4701
4701
|
}
|
|
4702
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
|
|
4708
|
+
var tt,
|
|
4709
4709
|
Pe = b(() => {
|
|
4710
4710
|
'use strict';
|
|
4711
4711
|
V();
|
|
4712
|
-
|
|
4712
|
+
tt = 'dynamic';
|
|
4713
4713
|
});
|
|
4714
4714
|
var oe,
|
|
4715
4715
|
Te = b(() => {
|
|
@@ -4722,26 +4722,26 @@ 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
|
|
4728
|
+
function rt(e, t) {
|
|
4729
4729
|
return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
|
|
4730
4730
|
}
|
|
4731
4731
|
var gi,
|
|
4732
|
-
|
|
4732
|
+
at = b(() => {
|
|
4733
4733
|
'use strict';
|
|
4734
4734
|
V();
|
|
4735
4735
|
Pe();
|
|
4736
|
-
|
|
4736
|
+
it();
|
|
4737
4737
|
gi = {};
|
|
4738
4738
|
});
|
|
4739
|
-
function
|
|
4739
|
+
function nt(e) {
|
|
4740
4740
|
return e === 'nano-banana-pro' ? hi : yi;
|
|
4741
4741
|
}
|
|
4742
4742
|
var hi,
|
|
4743
4743
|
yi,
|
|
4744
|
-
|
|
4744
|
+
st = b(() => {
|
|
4745
4745
|
'use strict';
|
|
4746
4746
|
((hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
4747
4747
|
(yi = [
|
|
@@ -4762,10 +4762,10 @@ var hi,
|
|
|
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 st,
|
|
|
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,7 +4851,7 @@ var lt,
|
|
|
4851
4851
|
},
|
|
4852
4852
|
];
|
|
4853
4853
|
});
|
|
4854
|
-
function
|
|
4854
|
+
function ct(e) {
|
|
4855
4855
|
return `$${e}`;
|
|
4856
4856
|
}
|
|
4857
4857
|
function Me(e, t, i) {
|
|
@@ -4923,13 +4923,13 @@ function bi(e) {
|
|
|
4923
4923
|
},
|
|
4924
4924
|
];
|
|
4925
4925
|
}
|
|
4926
|
-
function
|
|
4926
|
+
function ut() {
|
|
4927
4927
|
return Object.fromEntries(
|
|
4928
|
-
|
|
4928
|
+
pt.map((e) => {
|
|
4929
4929
|
let t = Me(e.slug, 'cheap', 'input'),
|
|
4930
4930
|
i = Me(e.slug, 'cheap', 'output'),
|
|
4931
4931
|
r = Me(e.slug, 'stable', 'input') != null,
|
|
4932
|
-
n = t != null && i != 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,
|
|
@@ -4946,9 +4946,9 @@ function ct() {
|
|
|
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,
|
|
@@ -4984,7 +4984,7 @@ 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
4990
|
r = i ? Ii(i.unit, e[t] ?? []) : null;
|
|
@@ -5003,9 +5003,9 @@ 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',
|
|
@@ -5021,14 +5021,14 @@ function yt(e) {
|
|
|
5021
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) => !Ee.has(r.name)), i ?
|
|
5024
|
+
return [...t.filter((r) => !Ee.has(r.name)), i ? wt : _i];
|
|
5025
5025
|
}
|
|
5026
5026
|
function Se(e, t) {
|
|
5027
5027
|
let i = e.filter((n) => !Ee.has(n.name)),
|
|
5028
|
-
r = [
|
|
5029
|
-
return (r.push(
|
|
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
5034
|
.filter((i) => !Mi.has(i.name) && !Ee.has(i.name))
|
|
@@ -5052,8 +5052,8 @@ function mt(e, t = {}) {
|
|
|
5052
5052
|
options: ['standard'],
|
|
5053
5053
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5054
5054
|
},
|
|
5055
|
-
wt,
|
|
5056
5055
|
kt,
|
|
5056
|
+
xt,
|
|
5057
5057
|
];
|
|
5058
5058
|
}
|
|
5059
5059
|
function $e(e, t) {
|
|
@@ -5086,7 +5086,7 @@ function $e(e, t) {
|
|
|
5086
5086
|
];
|
|
5087
5087
|
}
|
|
5088
5088
|
function Ki(e) {
|
|
5089
|
-
let t =
|
|
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 Ki(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
|
},
|
|
@@ -5161,7 +5161,7 @@ function Si(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',
|
|
@@ -5188,9 +5188,9 @@ function Si(e) {
|
|
|
5188
5188
|
];
|
|
5189
5189
|
}
|
|
5190
5190
|
function qi() {
|
|
5191
|
-
let e =
|
|
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 qi() {
|
|
|
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,33 +5312,35 @@ function xt(e) {
|
|
|
5307
5312
|
},
|
|
5308
5313
|
];
|
|
5309
5314
|
}
|
|
5310
|
-
function
|
|
5315
|
+
function Ri(e) {
|
|
5311
5316
|
if (e.slug === 'seed-2-1-turbo') return Ci;
|
|
5312
|
-
let t =
|
|
5317
|
+
let t = bt(e);
|
|
5313
5318
|
return [
|
|
5314
5319
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5315
5320
|
? qi()
|
|
5316
|
-
: e.slug === '
|
|
5317
|
-
?
|
|
5318
|
-
:
|
|
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
|
|
5331
|
+
if (e.kind === 'llm') return Ri(e);
|
|
5325
5332
|
if (e.editVariants?.length) return Ki(e);
|
|
5326
5333
|
switch (t) {
|
|
5327
5334
|
case 'seedance-2-5':
|
|
5328
|
-
return Se(
|
|
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 Se(
|
|
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 Se(
|
|
5343
|
+
return Se(Di, t);
|
|
5337
5344
|
case 'nano-banana-2':
|
|
5338
5345
|
case 'nano-banana-2.1':
|
|
5339
5346
|
case 'nano-banana-pro':
|
|
@@ -5443,10 +5450,10 @@ function Ce(e, t = e.api.model) {
|
|
|
5443
5450
|
priceFormatted: vi(e),
|
|
5444
5451
|
unit: e.unit,
|
|
5445
5452
|
primaryToolName: ki[e.kind],
|
|
5446
|
-
parameters: Ti(e,
|
|
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') {
|
|
@@ -5462,7 +5469,7 @@ function Di() {
|
|
|
5462
5469
|
}
|
|
5463
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,7 +5477,7 @@ function Di() {
|
|
|
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;
|
|
@@ -5481,13 +5488,13 @@ 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
|
}
|
|
@@ -5498,35 +5505,35 @@ var wi,
|
|
|
5498
5505
|
ki,
|
|
5499
5506
|
xi,
|
|
5500
5507
|
$,
|
|
5501
|
-
|
|
5508
|
+
wt,
|
|
5502
5509
|
_i,
|
|
5503
5510
|
Pi,
|
|
5504
|
-
wt,
|
|
5505
5511
|
kt,
|
|
5512
|
+
xt,
|
|
5506
5513
|
Ee,
|
|
5507
5514
|
Mi,
|
|
5508
5515
|
$i,
|
|
5509
5516
|
Ci,
|
|
5510
5517
|
Ei,
|
|
5511
5518
|
pe,
|
|
5512
|
-
|
|
5519
|
+
gt,
|
|
5513
5520
|
vt,
|
|
5514
5521
|
It,
|
|
5515
|
-
|
|
5516
|
-
|
|
5522
|
+
ht,
|
|
5523
|
+
Di,
|
|
5517
5524
|
de,
|
|
5518
|
-
|
|
5525
|
+
Ni,
|
|
5519
5526
|
z = b(() => {
|
|
5520
5527
|
'use strict';
|
|
5521
|
-
|
|
5528
|
+
Qe();
|
|
5522
5529
|
be();
|
|
5523
5530
|
V();
|
|
5524
5531
|
Pe();
|
|
5525
5532
|
Te();
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5533
|
+
at();
|
|
5534
|
+
st();
|
|
5535
|
+
lt();
|
|
5536
|
+
mt();
|
|
5530
5537
|
Ke();
|
|
5531
5538
|
((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5532
5539
|
(ki = {
|
|
@@ -5542,7 +5549,7 @@ var wi,
|
|
|
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,
|
|
@@ -5561,12 +5568,12 @@ var wi,
|
|
|
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,
|
|
@@ -5685,7 +5692,7 @@ var wi,
|
|
|
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',
|
|
@@ -5846,7 +5853,7 @@ var wi,
|
|
|
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',
|
|
@@ -5946,7 +5953,7 @@ var wi,
|
|
|
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',
|
|
@@ -6017,15 +6024,15 @@ var wi,
|
|
|
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
6038
|
function Rt(e) {
|
|
@@ -6043,14 +6050,14 @@ function Ot(e) {
|
|
|
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,
|
|
@@ -6063,7 +6070,7 @@ function pr(e) {
|
|
|
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 dr(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 cr(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'),
|
|
@@ -6390,10 +6397,10 @@ function ur() {
|
|
|
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 mr() {
|
|
|
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
|
-
sr,
|
|
6455
|
+
var sr,
|
|
6450
6456
|
or,
|
|
6457
|
+
lr,
|
|
6451
6458
|
Dt,
|
|
6452
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 nr,
|
|
|
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.',
|
|
@@ -6501,12 +6508,12 @@ var nr,
|
|
|
6501
6508
|
});
|
|
6502
6509
|
var zt = {};
|
|
6503
6510
|
ii(zt, {
|
|
6504
|
-
forgetToolSchemas: () =>
|
|
6511
|
+
forgetToolSchemas: () => wr,
|
|
6505
6512
|
jsonRpcAnswer: () => jt,
|
|
6506
6513
|
preprocessLocalFiles: () => Jt,
|
|
6507
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);
|
|
@@ -6520,7 +6527,7 @@ function jt(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,7 +6548,7 @@ function jt(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);
|
|
@@ -6576,14 +6583,14 @@ async function Bt(e, t, i) {
|
|
|
6576
6583
|
};
|
|
6577
6584
|
}
|
|
6578
6585
|
function Ft(e) {
|
|
6579
|
-
return
|
|
6586
|
+
return yr.has(U.default.extname(e).toLowerCase());
|
|
6580
6587
|
}
|
|
6581
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 yr(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 je(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,11 +6628,11 @@ async function wr(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'
|
|
@@ -6634,18 +6641,18 @@ function kr(e) {
|
|
|
6634
6641
|
}
|
|
6635
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
6646
|
if (!Ft(r)) throw Gt(r);
|
|
6640
6647
|
return (await Bt(r, t, i)).url;
|
|
6641
6648
|
}
|
|
6642
6649
|
async function Jt(e, t, i, r, n) {
|
|
6643
|
-
(Q.size === 0 &&
|
|
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
6658
|
for (let p of l) c.push(await Vt(p, i, r));
|
|
@@ -6653,7 +6660,7 @@ async function Jt(e, t, i, r, n) {
|
|
|
6653
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 xr(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',
|
|
@@ -6697,7 +6704,7 @@ function xr(e) {
|
|
|
6697
6704
|
async function Ht() {
|
|
6698
6705
|
if (Nt) return;
|
|
6699
6706
|
Nt = !0;
|
|
6700
|
-
let e =
|
|
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
|
|
@@ -6852,7 +6859,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6852
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) +
|
|
@@ -6887,19 +6894,19 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6887
6894
|
var R,
|
|
6888
6895
|
U,
|
|
6889
6896
|
Ut,
|
|
6890
|
-
|
|
6897
|
+
yr,
|
|
6891
6898
|
Q,
|
|
6892
|
-
|
|
6899
|
+
je,
|
|
6893
6900
|
Nt,
|
|
6894
6901
|
Wt = b(() => {
|
|
6895
6902
|
'use strict';
|
|
6896
6903
|
((R = I(require('node:fs'))),
|
|
6897
6904
|
(U = I(require('node:path'))),
|
|
6898
6905
|
(Ut = I(require('node:readline'))));
|
|
6899
|
-
|
|
6906
|
+
Re();
|
|
6900
6907
|
Lt();
|
|
6901
6908
|
E();
|
|
6902
|
-
|
|
6909
|
+
yr = new Set([
|
|
6903
6910
|
'.png',
|
|
6904
6911
|
'.jpg',
|
|
6905
6912
|
'.jpeg',
|
|
@@ -6925,7 +6932,7 @@ var R,
|
|
|
6925
6932
|
'.flac',
|
|
6926
6933
|
'.opus',
|
|
6927
6934
|
]);
|
|
6928
|
-
((Q = new Map()), (
|
|
6935
|
+
((Q = new Map()), (je = 0));
|
|
6929
6936
|
Nt = !1;
|
|
6930
6937
|
require.main === module &&
|
|
6931
6938
|
Ht().catch((e) => {
|
|
@@ -7025,8 +7032,8 @@ 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
7038
|
var ni = new Set([
|
|
7032
7039
|
'account_suspended',
|
|
@@ -7062,13 +7069,13 @@ function oi(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;
|
|
@@ -7083,7 +7090,7 @@ function li(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'
|
|
@@ -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,10 +7171,10 @@ 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,28 +7188,28 @@ function ye(e) {
|
|
|
7181
7188
|
}
|
|
7182
7189
|
z();
|
|
7183
7190
|
var Pt = ['images', 'input_images', 'videos', 'audios'];
|
|
7184
|
-
function
|
|
7191
|
+
function Ui(e) {
|
|
7185
7192
|
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7186
7193
|
}
|
|
7187
|
-
function
|
|
7194
|
+
function ji(e) {
|
|
7188
7195
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7189
7196
|
let t = A.default.resolve(e);
|
|
7190
7197
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7191
7198
|
}
|
|
7192
|
-
async function
|
|
7199
|
+
async function Bi(e, t) {
|
|
7193
7200
|
for (let i of Pt) {
|
|
7194
7201
|
if (!Array.isArray(e[i])) continue;
|
|
7195
7202
|
let r = [];
|
|
7196
7203
|
for (let n of e[i]) {
|
|
7197
7204
|
if (typeof n != 'string') continue;
|
|
7198
|
-
let s =
|
|
7205
|
+
let s = ji(n);
|
|
7199
7206
|
r.push(s ? await t(s) : n);
|
|
7200
7207
|
}
|
|
7201
7208
|
e[i] = r;
|
|
7202
7209
|
}
|
|
7203
7210
|
}
|
|
7204
7211
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7205
|
-
function
|
|
7212
|
+
function Fi(e) {
|
|
7206
7213
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7207
7214
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7208
7215
|
i = W.enterprise;
|
|
@@ -7215,7 +7222,7 @@ function Bi(e) {
|
|
|
7215
7222
|
t
|
|
7216
7223
|
);
|
|
7217
7224
|
}
|
|
7218
|
-
async function
|
|
7225
|
+
async function Gi(e, t, i, r, n) {
|
|
7219
7226
|
n.isJson ||
|
|
7220
7227
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7221
7228
|
`);
|
|
@@ -7335,7 +7342,7 @@ function Tt(e) {
|
|
|
7335
7342
|
}
|
|
7336
7343
|
return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
|
|
7337
7344
|
}
|
|
7338
|
-
async function
|
|
7345
|
+
async function Ae(e, t) {
|
|
7339
7346
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7340
7347
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7341
7348
|
(i ||
|
|
@@ -7357,7 +7364,7 @@ async function qe(e, t) {
|
|
|
7357
7364
|
s = !!t.json,
|
|
7358
7365
|
o = !!(t.async || t.no_wait),
|
|
7359
7366
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7360
|
-
l =
|
|
7367
|
+
l = Fi(t),
|
|
7361
7368
|
c = { ...t };
|
|
7362
7369
|
(delete c.json,
|
|
7363
7370
|
delete c.async,
|
|
@@ -7367,7 +7374,7 @@ async function qe(e, t) {
|
|
|
7367
7374
|
delete c.api_url,
|
|
7368
7375
|
delete c.count);
|
|
7369
7376
|
let p = _t(n, c);
|
|
7370
|
-
(
|
|
7377
|
+
(Ui(p),
|
|
7371
7378
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7372
7379
|
p.image_url &&
|
|
7373
7380
|
!p.first_frame_image &&
|
|
@@ -7400,7 +7407,7 @@ async function qe(e, t) {
|
|
|
7400
7407
|
}
|
|
7401
7408
|
}
|
|
7402
7409
|
}
|
|
7403
|
-
await
|
|
7410
|
+
await Bi(p, async (y) => {
|
|
7404
7411
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7405
7412
|
s || f.start();
|
|
7406
7413
|
try {
|
|
@@ -7424,7 +7431,7 @@ async function qe(e, t) {
|
|
|
7424
7431
|
let g;
|
|
7425
7432
|
try {
|
|
7426
7433
|
if (l > 1) {
|
|
7427
|
-
await
|
|
7434
|
+
await Gi(d, e, p, l, { isJson: s, isAsync: o });
|
|
7428
7435
|
return;
|
|
7429
7436
|
}
|
|
7430
7437
|
g = await d.queueJob(e, p);
|
|
@@ -7544,7 +7551,7 @@ ${f.text}
|
|
|
7544
7551
|
}
|
|
7545
7552
|
var Mt = I(require('node:readline'));
|
|
7546
7553
|
E();
|
|
7547
|
-
async function
|
|
7554
|
+
async function Ji(e) {
|
|
7548
7555
|
try {
|
|
7549
7556
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7550
7557
|
} catch (t) {
|
|
@@ -7555,7 +7562,7 @@ async function Gi(e) {
|
|
|
7555
7562
|
return 'unchecked';
|
|
7556
7563
|
}
|
|
7557
7564
|
}
|
|
7558
|
-
function
|
|
7565
|
+
function Hi(e) {
|
|
7559
7566
|
let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7560
7567
|
return new Promise((i) => {
|
|
7561
7568
|
t.question(e, (r) => {
|
|
@@ -7575,14 +7582,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7575
7582
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7576
7583
|
|
|
7577
7584
|
`),
|
|
7578
|
-
(i = await
|
|
7585
|
+
(i = await Hi('Enter your Tein API Key (sk_live_...): '))),
|
|
7579
7586
|
!i.startsWith('sk_live_') &&
|
|
7580
7587
|
!i.startsWith('sk_test_') &&
|
|
7581
7588
|
(process.stderr
|
|
7582
7589
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7583
7590
|
`),
|
|
7584
7591
|
process.exit(1)));
|
|
7585
|
-
let r = await
|
|
7592
|
+
let r = await Ji(i);
|
|
7586
7593
|
(r === 'invalid' &&
|
|
7587
7594
|
(process.stderr
|
|
7588
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.
|
|
@@ -7654,10 +7661,10 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7654
7661
|
E();
|
|
7655
7662
|
be();
|
|
7656
7663
|
z();
|
|
7657
|
-
var
|
|
7664
|
+
var zi = 3e3;
|
|
7658
7665
|
async function Kt(e) {
|
|
7659
7666
|
try {
|
|
7660
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
7667
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(zi) });
|
|
7661
7668
|
if (!t.ok) return;
|
|
7662
7669
|
let i = await t.json(),
|
|
7663
7670
|
r = {};
|
|
@@ -7665,18 +7672,18 @@ async function Kt(e) {
|
|
|
7665
7672
|
let s = String(n.modelSlug ?? '');
|
|
7666
7673
|
B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7667
7674
|
}
|
|
7668
|
-
|
|
7675
|
+
yt(r);
|
|
7669
7676
|
} catch {}
|
|
7670
7677
|
}
|
|
7671
|
-
var
|
|
7672
|
-
|
|
7678
|
+
var Wi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7679
|
+
Yi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7673
7680
|
async function St(e, t) {
|
|
7674
7681
|
await Kt(t);
|
|
7675
7682
|
let i = q();
|
|
7676
7683
|
if (e) {
|
|
7677
7684
|
let s = e.toLowerCase(),
|
|
7678
|
-
o =
|
|
7679
|
-
i =
|
|
7685
|
+
o = Yi[s] ?? s;
|
|
7686
|
+
i = Wi.has(o)
|
|
7680
7687
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7681
7688
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7682
7689
|
}
|
|
@@ -7796,9 +7803,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7796
7803
|
`);
|
|
7797
7804
|
}
|
|
7798
7805
|
E();
|
|
7799
|
-
|
|
7800
|
-
var
|
|
7801
|
-
|
|
7806
|
+
Re();
|
|
7807
|
+
var Qi = 1e4,
|
|
7808
|
+
De = {
|
|
7802
7809
|
price: '',
|
|
7803
7810
|
creativeMode: 'Creative mode',
|
|
7804
7811
|
priority: 'Priority',
|
|
@@ -7808,22 +7815,22 @@ var Yi = 1e4,
|
|
|
7808
7815
|
priorityDraft: 'Priority + Draft',
|
|
7809
7816
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7810
7817
|
},
|
|
7811
|
-
|
|
7812
|
-
|
|
7818
|
+
Xi = Object.keys(De),
|
|
7819
|
+
Zi = {
|
|
7813
7820
|
creativeMode: 'unfiltered',
|
|
7814
7821
|
creativeModePriority: 'unfilteredPriority',
|
|
7815
7822
|
creativeModeDraft: 'unfilteredDraft',
|
|
7816
7823
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7817
7824
|
};
|
|
7818
|
-
function
|
|
7819
|
-
let i =
|
|
7825
|
+
function er(e, t) {
|
|
7826
|
+
let i = Zi[t];
|
|
7820
7827
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7821
7828
|
}
|
|
7822
|
-
async function
|
|
7829
|
+
async function tr(e, t) {
|
|
7823
7830
|
let i = `${x(e)}${ce(t)}`,
|
|
7824
7831
|
r;
|
|
7825
7832
|
try {
|
|
7826
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7833
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Qi) });
|
|
7827
7834
|
} catch {
|
|
7828
7835
|
throw new Error(`Could not reach ${i}`);
|
|
7829
7836
|
}
|
|
@@ -7839,18 +7846,18 @@ async function er(e, t) {
|
|
|
7839
7846
|
}
|
|
7840
7847
|
return n;
|
|
7841
7848
|
}
|
|
7842
|
-
function
|
|
7849
|
+
function Oe(e) {
|
|
7843
7850
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7844
7851
|
[i, r = ''] = t.split('.');
|
|
7845
7852
|
return `$${i}.${r.padEnd(2, '0')}`;
|
|
7846
7853
|
}
|
|
7847
|
-
function
|
|
7854
|
+
function Le(e) {
|
|
7848
7855
|
if (!e || typeof e.starter != 'number') return null;
|
|
7849
7856
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7850
7857
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7851
|
-
return `Starter ${
|
|
7858
|
+
return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
|
|
7852
7859
|
}
|
|
7853
|
-
function
|
|
7860
|
+
function ir(e) {
|
|
7854
7861
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7855
7862
|
let t = [];
|
|
7856
7863
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7862,33 +7869,33 @@ function tr(e) {
|
|
|
7862
7869
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7863
7870
|
);
|
|
7864
7871
|
}
|
|
7865
|
-
function
|
|
7866
|
-
let i =
|
|
7867
|
-
for (let r of
|
|
7868
|
-
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));
|
|
7869
7876
|
if (!n) continue;
|
|
7870
|
-
let s =
|
|
7877
|
+
let s = De[r] ? ` (${De[r]})` : '';
|
|
7871
7878
|
t.push(` ${i}${s} ${n}`);
|
|
7872
7879
|
}
|
|
7873
7880
|
}
|
|
7874
|
-
function
|
|
7881
|
+
function ar(e, t) {
|
|
7875
7882
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7876
7883
|
t.push(
|
|
7877
7884
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7878
7885
|
);
|
|
7879
|
-
for (let n of e.variants ?? [])
|
|
7886
|
+
for (let n of e.variants ?? []) rr(n, t);
|
|
7880
7887
|
let r = e.addons;
|
|
7881
7888
|
if (Array.isArray(r))
|
|
7882
7889
|
for (let n of r) {
|
|
7883
7890
|
if (!n || typeof n != 'object') continue;
|
|
7884
7891
|
let s = n,
|
|
7885
7892
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
7886
|
-
u =
|
|
7893
|
+
u = Le(s.price);
|
|
7887
7894
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
7888
7895
|
}
|
|
7889
7896
|
t.push('');
|
|
7890
7897
|
}
|
|
7891
|
-
function
|
|
7898
|
+
function nr(e) {
|
|
7892
7899
|
let t = [],
|
|
7893
7900
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7894
7901
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7910,7 +7917,7 @@ function ar(e) {
|
|
|
7910
7917
|
});
|
|
7911
7918
|
for (let l of s) {
|
|
7912
7919
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7913
|
-
for (let c of r.get(l) ?? [])
|
|
7920
|
+
for (let c of r.get(l) ?? []) ar(c, t);
|
|
7914
7921
|
}
|
|
7915
7922
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7916
7923
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -7927,7 +7934,7 @@ function ar(e) {
|
|
|
7927
7934
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
7928
7935
|
for (let m of p) {
|
|
7929
7936
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
7930
|
-
g =
|
|
7937
|
+
g = Le(m.prices);
|
|
7931
7938
|
g && t.push(` ${h} ${g}`);
|
|
7932
7939
|
}
|
|
7933
7940
|
t.push('');
|
|
@@ -7943,7 +7950,7 @@ function ar(e) {
|
|
|
7943
7950
|
async function Ct(e) {
|
|
7944
7951
|
let t;
|
|
7945
7952
|
try {
|
|
7946
|
-
t = await
|
|
7953
|
+
t = await tr(e.apiUrl, e.model);
|
|
7947
7954
|
} catch (i) {
|
|
7948
7955
|
let r = i instanceof Error ? i.message : String(i);
|
|
7949
7956
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7954,7 +7961,7 @@ async function Ct(e) {
|
|
|
7954
7961
|
e.json
|
|
7955
7962
|
? `${JSON.stringify(t, null, 2)}
|
|
7956
7963
|
`
|
|
7957
|
-
:
|
|
7964
|
+
: nr(t),
|
|
7958
7965
|
);
|
|
7959
7966
|
}
|
|
7960
7967
|
var Et = I(require('node:path'));
|
|
@@ -8069,8 +8076,8 @@ ${p.text}
|
|
|
8069
8076
|
process.stdout.write(`
|
|
8070
8077
|
`);
|
|
8071
8078
|
}
|
|
8072
|
-
var
|
|
8073
|
-
|
|
8079
|
+
var Ve = I(require('node:fs')),
|
|
8080
|
+
Ne = I(require('node:path'));
|
|
8074
8081
|
E();
|
|
8075
8082
|
async function At(e, t = {}) {
|
|
8076
8083
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
@@ -8089,13 +8096,13 @@ async function At(e, t = {}) {
|
|
|
8089
8096
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8090
8097
|
`),
|
|
8091
8098
|
process.exit(1)));
|
|
8092
|
-
let s =
|
|
8093
|
-
|
|
8099
|
+
let s = Ne.default.resolve(e);
|
|
8100
|
+
Ve.default.existsSync(s) ||
|
|
8094
8101
|
(process.stderr.write(`${a.red('Error:')} File not found: ${s}
|
|
8095
8102
|
`),
|
|
8096
8103
|
process.exit(1));
|
|
8097
|
-
let o =
|
|
8098
|
-
l =
|
|
8104
|
+
let o = Ne.default.basename(s),
|
|
8105
|
+
l = Ve.default.readFileSync(s).toString('base64'),
|
|
8099
8106
|
c = new M(i, r),
|
|
8100
8107
|
p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
8101
8108
|
n || p.start();
|
|
@@ -8198,7 +8205,7 @@ ${a.bold('EXAMPLES:')}
|
|
|
8198
8205
|
|
|
8199
8206
|
`);
|
|
8200
8207
|
}
|
|
8201
|
-
async function
|
|
8208
|
+
async function Ir() {
|
|
8202
8209
|
let e = process.argv.slice(2),
|
|
8203
8210
|
t = Tt(e);
|
|
8204
8211
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
@@ -8262,7 +8269,7 @@ async function vr() {
|
|
|
8262
8269
|
case 'run':
|
|
8263
8270
|
case 'generate': {
|
|
8264
8271
|
let i = t.subcommand || '';
|
|
8265
|
-
await
|
|
8272
|
+
await Ae(i, t.options);
|
|
8266
8273
|
break;
|
|
8267
8274
|
}
|
|
8268
8275
|
case 'status': {
|
|
@@ -8284,7 +8291,7 @@ ${a.red('Error:')} Unknown command or model "${t.command}".
|
|
|
8284
8291
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8285
8292
|
`),
|
|
8286
8293
|
process.exit(_)),
|
|
8287
|
-
await
|
|
8294
|
+
await Ae(t.command, t.options));
|
|
8288
8295
|
return;
|
|
8289
8296
|
}
|
|
8290
8297
|
Yt();
|
|
@@ -8292,7 +8299,7 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
|
|
|
8292
8299
|
}
|
|
8293
8300
|
}
|
|
8294
8301
|
}
|
|
8295
|
-
|
|
8302
|
+
Ir().catch((e) => {
|
|
8296
8303
|
(e instanceof k &&
|
|
8297
8304
|
(process.stderr.write(`
|
|
8298
8305
|
${a.red('Error:')} ${K(e).join(`
|