@teinai/cli 1.1.16 → 1.1.17
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 +264 -258
- 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 Xt = Object.create;
|
|
4
4
|
var fe = Object.defineProperty;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
5
|
+
var Zt = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var ei = Object.getOwnPropertyNames;
|
|
7
|
+
var ti = Object.getPrototypeOf,
|
|
8
|
+
ii = 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 ri = (e, t) => {
|
|
18
18
|
for (var i in t) fe(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
ai = (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 ei(t))
|
|
23
|
+
!ii.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 = Zt(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 ? Xt(ti(e)) : {}),
|
|
30
|
+
ai(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
32
|
function L() {
|
|
33
33
|
try {
|
|
@@ -79,13 +79,13 @@ var C,
|
|
|
79
79
|
(te = ge.default.join(He.default.homedir(), '.tein')),
|
|
80
80
|
(D = ge.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
82
|
+
var di,
|
|
83
83
|
We,
|
|
84
84
|
Ye,
|
|
85
85
|
Qe = b(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(We = [...
|
|
87
|
+
((di = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(We = [...di, 'auto']),
|
|
89
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
|
});
|
|
@@ -4662,7 +4662,7 @@ var re,
|
|
|
4662
4662
|
function ve(e, t) {
|
|
4663
4663
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4664
4664
|
}
|
|
4665
|
-
function
|
|
4665
|
+
function ui(e, t) {
|
|
4666
4666
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4667
4667
|
if (e !== 'seedance-2') return;
|
|
4668
4668
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -4672,24 +4672,24 @@ function ci(e, t) {
|
|
|
4672
4672
|
? 'fast'
|
|
4673
4673
|
: 'standard';
|
|
4674
4674
|
}
|
|
4675
|
-
function
|
|
4675
|
+
function mi(e, t) {
|
|
4676
4676
|
let i = e
|
|
4677
4677
|
.trim()
|
|
4678
4678
|
.toLowerCase()
|
|
4679
4679
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4680
4680
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
4681
|
-
let n =
|
|
4681
|
+
let n = ui(i, t),
|
|
4682
4682
|
s = ke.get(ve('seedance-2', n));
|
|
4683
4683
|
return s ? s.slug : null;
|
|
4684
4684
|
}
|
|
4685
4685
|
let r = ae.get(i) ?? ke.get(ve(i));
|
|
4686
4686
|
return r ? r.slug : null;
|
|
4687
4687
|
}
|
|
4688
|
-
function
|
|
4689
|
-
return ae.has(e) && !(
|
|
4688
|
+
function gi(e, t) {
|
|
4689
|
+
return ae.has(e) && !(fi.has(e) && t) ? e : mi(e, t);
|
|
4690
4690
|
}
|
|
4691
4691
|
function G(e, t) {
|
|
4692
|
-
let i =
|
|
4692
|
+
let i = gi(e, t);
|
|
4693
4693
|
return i ? (ae.get(i) ?? null) : null;
|
|
4694
4694
|
}
|
|
4695
4695
|
function ne() {
|
|
@@ -4699,9 +4699,9 @@ var Ie,
|
|
|
4699
4699
|
ae,
|
|
4700
4700
|
ke,
|
|
4701
4701
|
et,
|
|
4702
|
-
|
|
4702
|
+
ci,
|
|
4703
4703
|
xe,
|
|
4704
|
-
|
|
4704
|
+
fi,
|
|
4705
4705
|
V = b(() => {
|
|
4706
4706
|
'use strict';
|
|
4707
4707
|
Xe();
|
|
@@ -4714,18 +4714,18 @@ var Ie,
|
|
|
4714
4714
|
(ae = new Map()),
|
|
4715
4715
|
(ke = new Map()),
|
|
4716
4716
|
(et = new Map()),
|
|
4717
|
-
(
|
|
4717
|
+
(ci = new Map()),
|
|
4718
4718
|
(xe = new Map()));
|
|
4719
4719
|
for (let e of Ie.models) {
|
|
4720
4720
|
(ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
|
|
4721
4721
|
for (let t of e.variants) et.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4722
4722
|
for (let t of e.editVariants ?? [])
|
|
4723
4723
|
et.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4724
|
-
for (let t of e.addons ?? [])
|
|
4724
|
+
for (let t of e.addons ?? []) ci.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4725
4725
|
xe.set(e.slug, e.family);
|
|
4726
4726
|
}
|
|
4727
4727
|
for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
|
|
4728
|
-
|
|
4728
|
+
fi = new Set(['seedance-2']);
|
|
4729
4729
|
});
|
|
4730
4730
|
function se(e) {
|
|
4731
4731
|
let t = e.from?.variant;
|
|
@@ -4758,25 +4758,25 @@ var it = b(() => {
|
|
|
4758
4758
|
'use strict';
|
|
4759
4759
|
});
|
|
4760
4760
|
function rt(e, t) {
|
|
4761
|
-
return typeof t == 'string' && (
|
|
4761
|
+
return typeof t == 'string' && (hi[e]?.includes(t) ?? !1);
|
|
4762
4762
|
}
|
|
4763
|
-
var
|
|
4763
|
+
var hi,
|
|
4764
4764
|
at = b(() => {
|
|
4765
4765
|
'use strict';
|
|
4766
4766
|
V();
|
|
4767
4767
|
Pe();
|
|
4768
4768
|
it();
|
|
4769
|
-
|
|
4769
|
+
hi = {};
|
|
4770
4770
|
});
|
|
4771
4771
|
function nt(e) {
|
|
4772
|
-
return e === 'nano-banana-pro' ?
|
|
4772
|
+
return e === 'nano-banana-pro' ? yi : bi;
|
|
4773
4773
|
}
|
|
4774
|
-
var
|
|
4775
|
-
|
|
4774
|
+
var yi,
|
|
4775
|
+
bi,
|
|
4776
4776
|
st = b(() => {
|
|
4777
4777
|
'use strict';
|
|
4778
|
-
((
|
|
4779
|
-
(
|
|
4778
|
+
((yi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
4779
|
+
(bi = [
|
|
4780
4780
|
'auto',
|
|
4781
4781
|
'1:1',
|
|
4782
4782
|
'1:4',
|
|
@@ -4889,7 +4889,7 @@ function ct(e) {
|
|
|
4889
4889
|
function Me(e, t, i) {
|
|
4890
4890
|
return G(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
4891
4891
|
}
|
|
4892
|
-
function
|
|
4892
|
+
function wi(e) {
|
|
4893
4893
|
return [
|
|
4894
4894
|
{
|
|
4895
4895
|
name: 'prompt',
|
|
@@ -4972,7 +4972,7 @@ function ut() {
|
|
|
4972
4972
|
priceFormatted: n,
|
|
4973
4973
|
unit: '/M tokens',
|
|
4974
4974
|
primaryToolName: 'run_task',
|
|
4975
|
-
parameters:
|
|
4975
|
+
parameters: wi(r),
|
|
4976
4976
|
};
|
|
4977
4977
|
return [e.slug, s];
|
|
4978
4978
|
}),
|
|
@@ -5001,7 +5001,7 @@ var J,
|
|
|
5001
5001
|
function z(e) {
|
|
5002
5002
|
return `$${Number(e.toFixed(5))}`;
|
|
5003
5003
|
}
|
|
5004
|
-
function
|
|
5004
|
+
function Ii(e) {
|
|
5005
5005
|
if (e.kind === 'llm') {
|
|
5006
5006
|
let t = e.defaultEndpoint,
|
|
5007
5007
|
i = (s) =>
|
|
@@ -5019,14 +5019,14 @@ function vi(e) {
|
|
|
5019
5019
|
}
|
|
5020
5020
|
return `from ${z(se(e).price.starter)}${e.unit}`;
|
|
5021
5021
|
}
|
|
5022
|
-
function
|
|
5022
|
+
function _i(e, t) {
|
|
5023
5023
|
let i = t.filter((r) => Number.isFinite(r) && r > 0);
|
|
5024
5024
|
return i.length ? `from ${z(Math.min(...i))}${e}` : null;
|
|
5025
5025
|
}
|
|
5026
|
-
function
|
|
5026
|
+
function bt(e) {
|
|
5027
5027
|
for (let t of F) {
|
|
5028
5028
|
let i = de[t],
|
|
5029
|
-
r = i ?
|
|
5029
|
+
r = i ? _i(i.unit, e[t] ?? []) : null;
|
|
5030
5030
|
i && r && (i.priceFormatted = r);
|
|
5031
5031
|
}
|
|
5032
5032
|
}
|
|
@@ -5042,7 +5042,7 @@ function N(e, t) {
|
|
|
5042
5042
|
...(t ? { description: t } : {}),
|
|
5043
5043
|
};
|
|
5044
5044
|
}
|
|
5045
|
-
function
|
|
5045
|
+
function wt(e) {
|
|
5046
5046
|
if (!e.endpoints?.length) return null;
|
|
5047
5047
|
let t = e.endpoints.filter((i) => rt(e.slug, i.id));
|
|
5048
5048
|
return {
|
|
@@ -5057,20 +5057,20 @@ function bt(e) {
|
|
|
5057
5057
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
5058
5058
|
};
|
|
5059
5059
|
}
|
|
5060
|
-
function
|
|
5060
|
+
function Mi(e, t) {
|
|
5061
5061
|
if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
|
|
5062
5062
|
let i = J.includes(e.api.model);
|
|
5063
|
-
return [...t.filter((r) => !Ee.has(r.name)), i ?
|
|
5063
|
+
return [...t.filter((r) => !Ee.has(r.name)), i ? kt : Pi];
|
|
5064
5064
|
}
|
|
5065
5065
|
function Se(e, t) {
|
|
5066
5066
|
let i = e.filter((n) => !Ee.has(n.name)),
|
|
5067
|
-
r = [
|
|
5068
|
-
return (r.push(
|
|
5067
|
+
r = [kt, Ti];
|
|
5068
|
+
return (r.push(xt, vt), [...i, ...r]);
|
|
5069
5069
|
}
|
|
5070
5070
|
function ft(e, t = {}) {
|
|
5071
5071
|
return [
|
|
5072
5072
|
...e
|
|
5073
|
-
.filter((i) => !
|
|
5073
|
+
.filter((i) => !Ki.has(i.name) && !Ee.has(i.name))
|
|
5074
5074
|
.map((i) =>
|
|
5075
5075
|
i.name === 'prompt'
|
|
5076
5076
|
? { ...i, required: !0 }
|
|
@@ -5091,8 +5091,8 @@ function ft(e, t = {}) {
|
|
|
5091
5091
|
options: ['standard'],
|
|
5092
5092
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5093
5093
|
},
|
|
5094
|
-
kt,
|
|
5095
5094
|
xt,
|
|
5095
|
+
vt,
|
|
5096
5096
|
];
|
|
5097
5097
|
}
|
|
5098
5098
|
function $e(e, t) {
|
|
@@ -5124,8 +5124,8 @@ function $e(e, t) {
|
|
|
5124
5124
|
),
|
|
5125
5125
|
];
|
|
5126
5126
|
}
|
|
5127
|
-
function
|
|
5128
|
-
let t =
|
|
5127
|
+
function Si(e) {
|
|
5128
|
+
let t = wt(e);
|
|
5129
5129
|
return [
|
|
5130
5130
|
$('Image prompt text. Supports complex composition and text instructions.'),
|
|
5131
5131
|
...(t ? [t] : []),
|
|
@@ -5192,7 +5192,7 @@ function Ki(e) {
|
|
|
5192
5192
|
},
|
|
5193
5193
|
];
|
|
5194
5194
|
}
|
|
5195
|
-
function
|
|
5195
|
+
function $i(e) {
|
|
5196
5196
|
return [
|
|
5197
5197
|
$('Image prompt text.'),
|
|
5198
5198
|
{
|
|
@@ -5226,7 +5226,7 @@ function Si(e) {
|
|
|
5226
5226
|
},
|
|
5227
5227
|
];
|
|
5228
5228
|
}
|
|
5229
|
-
function
|
|
5229
|
+
function Ai() {
|
|
5230
5230
|
let e = ot,
|
|
5231
5231
|
t = [];
|
|
5232
5232
|
for (let i of qe(!0))
|
|
@@ -5251,7 +5251,7 @@ function qi() {
|
|
|
5251
5251
|
}));
|
|
5252
5252
|
return t;
|
|
5253
5253
|
}
|
|
5254
|
-
function
|
|
5254
|
+
function Ri() {
|
|
5255
5255
|
return qe(!0).map((e) =>
|
|
5256
5256
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5257
5257
|
);
|
|
@@ -5351,24 +5351,24 @@ function qe(e) {
|
|
|
5351
5351
|
},
|
|
5352
5352
|
];
|
|
5353
5353
|
}
|
|
5354
|
-
function
|
|
5355
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5356
|
-
let t =
|
|
5354
|
+
function Oi(e) {
|
|
5355
|
+
if (e.slug === 'seed-2-1-turbo') return Ei;
|
|
5356
|
+
let t = wt(e);
|
|
5357
5357
|
return [
|
|
5358
5358
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5359
|
-
?
|
|
5359
|
+
? Ai()
|
|
5360
5360
|
: e.slug === 'gemini-3.7-flash'
|
|
5361
|
-
?
|
|
5362
|
-
: e.slug === 'gpt-6-astra' ||
|
|
5361
|
+
? Ri()
|
|
5362
|
+
: e.slug === 'gpt-6-astra' || qi.includes(e.slug)
|
|
5363
5363
|
? qe(e.slug !== 'gpt-6-astra')
|
|
5364
|
-
:
|
|
5364
|
+
: Ci),
|
|
5365
5365
|
...(t ? [t] : []),
|
|
5366
5366
|
];
|
|
5367
5367
|
}
|
|
5368
|
-
function
|
|
5368
|
+
function Di(e) {
|
|
5369
5369
|
let t = e.slug;
|
|
5370
|
-
if (e.kind === 'llm') return
|
|
5371
|
-
if (e.editVariants?.length) return
|
|
5370
|
+
if (e.kind === 'llm') return Oi(e);
|
|
5371
|
+
if (e.editVariants?.length) return Si(e);
|
|
5372
5372
|
switch (t) {
|
|
5373
5373
|
case 'seedance-2-5':
|
|
5374
5374
|
return Se(gt, t);
|
|
@@ -5379,11 +5379,11 @@ function Oi(e) {
|
|
|
5379
5379
|
case 'seedance-2-lite':
|
|
5380
5380
|
return ft(ht);
|
|
5381
5381
|
case 'seedance-2-mini':
|
|
5382
|
-
return Se(
|
|
5382
|
+
return Se(Li, t);
|
|
5383
5383
|
case 'nano-banana-2':
|
|
5384
5384
|
case 'nano-banana-2.1':
|
|
5385
5385
|
case 'nano-banana-pro':
|
|
5386
|
-
return
|
|
5386
|
+
return $i(e);
|
|
5387
5387
|
case 'seedream-5-pro':
|
|
5388
5388
|
return [
|
|
5389
5389
|
$('Detailed description of the image to generate.'),
|
|
@@ -5514,17 +5514,17 @@ function Ce(e, t = e.api.model) {
|
|
|
5514
5514
|
return {
|
|
5515
5515
|
slug: t,
|
|
5516
5516
|
name: e.name,
|
|
5517
|
-
category:
|
|
5518
|
-
kind:
|
|
5517
|
+
category: ki[e.kind],
|
|
5518
|
+
kind: vi[e.kind],
|
|
5519
5519
|
vendor: e.vendor ?? '',
|
|
5520
5520
|
description: e.desc ?? e.name,
|
|
5521
|
-
priceFormatted:
|
|
5521
|
+
priceFormatted: Ii(e),
|
|
5522
5522
|
unit: e.unit,
|
|
5523
|
-
primaryToolName:
|
|
5524
|
-
parameters:
|
|
5523
|
+
primaryToolName: xi[e.kind],
|
|
5524
|
+
parameters: Mi(e, Di(e)),
|
|
5525
5525
|
};
|
|
5526
5526
|
}
|
|
5527
|
-
function
|
|
5527
|
+
function Vi() {
|
|
5528
5528
|
let e = {};
|
|
5529
5529
|
for (let t of ne())
|
|
5530
5530
|
if (t.slug !== 'seedance-2-fast') {
|
|
@@ -5548,52 +5548,58 @@ function Li() {
|
|
|
5548
5548
|
function U(e) {
|
|
5549
5549
|
return de[e] ?? null;
|
|
5550
5550
|
}
|
|
5551
|
-
function
|
|
5551
|
+
function Ni(e, t, i) {
|
|
5552
5552
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5553
5553
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5554
5554
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
5555
5555
|
}
|
|
5556
|
-
return !
|
|
5556
|
+
return !(
|
|
5557
|
+
(t === 'max_tokens' && yt(i.max_completion_tokens)) ||
|
|
5558
|
+
(t === 'max_completion_tokens' && yt(i.max_tokens))
|
|
5559
|
+
);
|
|
5560
|
+
}
|
|
5561
|
+
function yt(e) {
|
|
5562
|
+
return e != null && e !== '';
|
|
5557
5563
|
}
|
|
5558
|
-
function
|
|
5564
|
+
function Pt(e, t) {
|
|
5559
5565
|
let i = { ...t };
|
|
5560
5566
|
if (e?.slug === 'seedance-2-5') {
|
|
5561
5567
|
let r = (n) => typeof n != 'string' || !n.trim();
|
|
5562
|
-
for (let n of
|
|
5568
|
+
for (let n of Ui) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
5563
5569
|
if (!r(i.finalize)) return i;
|
|
5564
5570
|
}
|
|
5565
5571
|
for (let r of e?.parameters ?? [])
|
|
5566
5572
|
r.default !== void 0 &&
|
|
5567
5573
|
i[r.name] === void 0 &&
|
|
5568
|
-
|
|
5574
|
+
Ni(e.slug, r.name, t) &&
|
|
5569
5575
|
(i[r.name] = r.default);
|
|
5570
5576
|
return i;
|
|
5571
5577
|
}
|
|
5572
5578
|
function q() {
|
|
5573
5579
|
return Object.values(de);
|
|
5574
5580
|
}
|
|
5575
|
-
var
|
|
5576
|
-
ki,
|
|
5581
|
+
var ki,
|
|
5577
5582
|
xi,
|
|
5583
|
+
vi,
|
|
5578
5584
|
$,
|
|
5579
|
-
wt,
|
|
5580
|
-
_i,
|
|
5581
|
-
Pi,
|
|
5582
5585
|
kt,
|
|
5586
|
+
Pi,
|
|
5587
|
+
Ti,
|
|
5583
5588
|
xt,
|
|
5589
|
+
vt,
|
|
5584
5590
|
Ee,
|
|
5585
|
-
|
|
5586
|
-
$i,
|
|
5591
|
+
Ki,
|
|
5587
5592
|
Ci,
|
|
5588
5593
|
Ei,
|
|
5594
|
+
qi,
|
|
5589
5595
|
pe,
|
|
5590
5596
|
gt,
|
|
5591
|
-
vt,
|
|
5592
5597
|
It,
|
|
5598
|
+
_t,
|
|
5593
5599
|
ht,
|
|
5594
|
-
|
|
5600
|
+
Li,
|
|
5595
5601
|
de,
|
|
5596
|
-
|
|
5602
|
+
Ui,
|
|
5597
5603
|
H = b(() => {
|
|
5598
5604
|
'use strict';
|
|
5599
5605
|
Qe();
|
|
@@ -5606,45 +5612,45 @@ var wi,
|
|
|
5606
5612
|
lt();
|
|
5607
5613
|
mt();
|
|
5608
5614
|
Ke();
|
|
5609
|
-
((
|
|
5610
|
-
(
|
|
5615
|
+
((ki = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5616
|
+
(xi = {
|
|
5611
5617
|
video: 'generate_video',
|
|
5612
5618
|
image: 'generate_image',
|
|
5613
5619
|
audio: 'generate_audio',
|
|
5614
5620
|
llm: 'run_task',
|
|
5615
5621
|
}),
|
|
5616
|
-
(
|
|
5622
|
+
(vi = {
|
|
5617
5623
|
video: 'Text-to-Video',
|
|
5618
5624
|
image: 'Text-to-Image',
|
|
5619
5625
|
audio: 'Text-to-Audio',
|
|
5620
5626
|
llm: 'Reasoning (LLM)',
|
|
5621
5627
|
}));
|
|
5622
5628
|
$ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5623
|
-
((
|
|
5629
|
+
((kt = {
|
|
5624
5630
|
name: 'creative_mode',
|
|
5625
5631
|
type: 'boolean',
|
|
5626
5632
|
default: !1,
|
|
5627
5633
|
description:
|
|
5628
5634
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5629
5635
|
}),
|
|
5630
|
-
(
|
|
5636
|
+
(Pi = {
|
|
5631
5637
|
name: 'creative_mode',
|
|
5632
5638
|
type: 'boolean',
|
|
5633
5639
|
default: !1,
|
|
5634
5640
|
description: `Not available yet on this model: ${le}.`,
|
|
5635
5641
|
}),
|
|
5636
|
-
(
|
|
5642
|
+
(Ti = {
|
|
5637
5643
|
name: 'priority',
|
|
5638
5644
|
type: 'boolean',
|
|
5639
5645
|
default: !1,
|
|
5640
5646
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5641
5647
|
}),
|
|
5642
|
-
(
|
|
5648
|
+
(xt = {
|
|
5643
5649
|
name: 'reference_roles',
|
|
5644
5650
|
type: 'json',
|
|
5645
5651
|
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).`,
|
|
5646
5652
|
}),
|
|
5647
|
-
(
|
|
5653
|
+
(vt = {
|
|
5648
5654
|
name: 'auto_fit_images',
|
|
5649
5655
|
type: 'boolean',
|
|
5650
5656
|
default: !1,
|
|
@@ -5652,7 +5658,7 @@ var wi,
|
|
|
5652
5658
|
'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.',
|
|
5653
5659
|
}),
|
|
5654
5660
|
(Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5655
|
-
|
|
5661
|
+
Ki = new Set([
|
|
5656
5662
|
'quality',
|
|
5657
5663
|
'bitrate_mode',
|
|
5658
5664
|
'draft',
|
|
@@ -5661,7 +5667,7 @@ var wi,
|
|
|
5661
5667
|
'draft_generation_id',
|
|
5662
5668
|
'pass_faces',
|
|
5663
5669
|
]);
|
|
5664
|
-
((
|
|
5670
|
+
((Ci = [
|
|
5665
5671
|
$('The user message or task.'),
|
|
5666
5672
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5667
5673
|
{
|
|
@@ -5679,7 +5685,7 @@ var wi,
|
|
|
5679
5685
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5680
5686
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5681
5687
|
]),
|
|
5682
|
-
(
|
|
5688
|
+
(Ei = [
|
|
5683
5689
|
$('The user message or task.'),
|
|
5684
5690
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5685
5691
|
{
|
|
@@ -5761,7 +5767,7 @@ var wi,
|
|
|
5761
5767
|
description: 'Video frames read a second.',
|
|
5762
5768
|
},
|
|
5763
5769
|
]),
|
|
5764
|
-
(
|
|
5770
|
+
(qi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5765
5771
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5766
5772
|
(gt = [
|
|
5767
5773
|
{
|
|
@@ -5912,13 +5918,13 @@ var wi,
|
|
|
5912
5918
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5913
5919
|
},
|
|
5914
5920
|
]),
|
|
5915
|
-
(
|
|
5921
|
+
(It = {
|
|
5916
5922
|
name: 'images',
|
|
5917
5923
|
type: 'string[]',
|
|
5918
5924
|
description:
|
|
5919
5925
|
'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.',
|
|
5920
5926
|
}),
|
|
5921
|
-
(
|
|
5927
|
+
(_t = {
|
|
5922
5928
|
name: 'audios',
|
|
5923
5929
|
type: 'string[]',
|
|
5924
5930
|
description:
|
|
@@ -6002,8 +6008,8 @@ var wi,
|
|
|
6002
6008
|
description:
|
|
6003
6009
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6004
6010
|
},
|
|
6005
|
-
vt,
|
|
6006
6011
|
It,
|
|
6012
|
+
_t,
|
|
6007
6013
|
{
|
|
6008
6014
|
name: 'first_frame_image',
|
|
6009
6015
|
type: 'string',
|
|
@@ -6024,7 +6030,7 @@ var wi,
|
|
|
6024
6030
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6025
6031
|
},
|
|
6026
6032
|
]),
|
|
6027
|
-
(
|
|
6033
|
+
(Li = [
|
|
6028
6034
|
{
|
|
6029
6035
|
name: 'prompt',
|
|
6030
6036
|
type: 'string',
|
|
@@ -6079,8 +6085,8 @@ var wi,
|
|
|
6079
6085
|
description:
|
|
6080
6086
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6081
6087
|
},
|
|
6082
|
-
vt,
|
|
6083
6088
|
It,
|
|
6089
|
+
_t,
|
|
6084
6090
|
{
|
|
6085
6091
|
name: 'first_frame_image',
|
|
6086
6092
|
type: 'string',
|
|
@@ -6095,8 +6101,8 @@ var wi,
|
|
|
6095
6101
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6096
6102
|
},
|
|
6097
6103
|
]));
|
|
6098
|
-
de =
|
|
6099
|
-
|
|
6104
|
+
de = Vi();
|
|
6105
|
+
Ui = ['draft_task_id', 'draft_generation_id'];
|
|
6100
6106
|
});
|
|
6101
6107
|
function ce(e) {
|
|
6102
6108
|
let t = '/v1/pricing/models',
|
|
@@ -6106,42 +6112,42 @@ function ce(e) {
|
|
|
6106
6112
|
var Re = b(() => {
|
|
6107
6113
|
'use strict';
|
|
6108
6114
|
});
|
|
6109
|
-
function
|
|
6115
|
+
function Ot(e) {
|
|
6110
6116
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6111
6117
|
}
|
|
6112
|
-
function
|
|
6118
|
+
function Dt(e) {
|
|
6113
6119
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
6114
6120
|
i = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
|
|
6115
6121
|
r = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
|
|
6116
6122
|
return [
|
|
6117
6123
|
...(i.length
|
|
6118
|
-
? [`${
|
|
6124
|
+
? [`${Ot(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6119
6125
|
: []),
|
|
6120
|
-
...(r.length ? [`Not available yet on ${
|
|
6126
|
+
...(r.length ? [`Not available yet on ${Ot(r)}: ${le}.`] : []),
|
|
6121
6127
|
'The Acceptable Use Policy applies.',
|
|
6122
6128
|
].join(' ');
|
|
6123
6129
|
}
|
|
6124
|
-
function
|
|
6125
|
-
if (
|
|
6130
|
+
function dr(e) {
|
|
6131
|
+
if (lr.has(e.name)) return e;
|
|
6126
6132
|
let t = e.inputSchema.properties;
|
|
6127
6133
|
return !t || t.callback_url
|
|
6128
6134
|
? e
|
|
6129
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
6135
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: or } } };
|
|
6130
6136
|
}
|
|
6131
|
-
function
|
|
6137
|
+
function cr(e) {
|
|
6132
6138
|
let t = e.inputSchema.properties;
|
|
6133
6139
|
if (!t) return e;
|
|
6134
6140
|
let i = !1,
|
|
6135
6141
|
r = {};
|
|
6136
6142
|
for (let [n, s] of Object.entries(t))
|
|
6137
|
-
|
|
6143
|
+
Lt.has(n) && s.type === 'string' && !s.format
|
|
6138
6144
|
? ((r[n] = { ...s, format: 'uri' }), (i = !0))
|
|
6139
|
-
:
|
|
6145
|
+
: Lt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
6140
6146
|
? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
6141
6147
|
: (r[n] = s);
|
|
6142
6148
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
6143
6149
|
}
|
|
6144
|
-
function
|
|
6150
|
+
function ur(e) {
|
|
6145
6151
|
switch (e.type) {
|
|
6146
6152
|
case 'string':
|
|
6147
6153
|
return {
|
|
@@ -6196,11 +6202,11 @@ function cr(e) {
|
|
|
6196
6202
|
return { type: 'string', description: e.description };
|
|
6197
6203
|
}
|
|
6198
6204
|
}
|
|
6199
|
-
function
|
|
6205
|
+
function mr(e, t) {
|
|
6200
6206
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
6201
6207
|
r = {},
|
|
6202
6208
|
n = [];
|
|
6203
|
-
for (let o of e.parameters) ((r[o.name] =
|
|
6209
|
+
for (let o of e.parameters) ((r[o.name] = ur(o)), o.required && n.push(o.name));
|
|
6204
6210
|
let s = {
|
|
6205
6211
|
type: 'object',
|
|
6206
6212
|
properties: r,
|
|
@@ -6213,7 +6219,7 @@ function ur(e, t) {
|
|
|
6213
6219
|
inputSchema: s,
|
|
6214
6220
|
};
|
|
6215
6221
|
}
|
|
6216
|
-
function
|
|
6222
|
+
function fr() {
|
|
6217
6223
|
let e = q().filter((d) => d.category === 'Image'),
|
|
6218
6224
|
t = q().filter((d) => d.category === 'Video'),
|
|
6219
6225
|
i = q().filter((d) => d.category === 'Text'),
|
|
@@ -6309,7 +6315,7 @@ function mr() {
|
|
|
6309
6315
|
maximum: 2147483647,
|
|
6310
6316
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
6311
6317
|
},
|
|
6312
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6318
|
+
creative_mode: { type: 'boolean', default: !1, description: Dt('image') },
|
|
6313
6319
|
},
|
|
6314
6320
|
required: ['prompt'],
|
|
6315
6321
|
additionalProperties: !0,
|
|
@@ -6346,7 +6352,7 @@ function mr() {
|
|
|
6346
6352
|
default: '480p',
|
|
6347
6353
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
6348
6354
|
},
|
|
6349
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6355
|
+
creative_mode: { type: 'boolean', default: !1, description: Dt('video') },
|
|
6350
6356
|
priority: {
|
|
6351
6357
|
type: 'boolean',
|
|
6352
6358
|
default: !1,
|
|
@@ -6468,10 +6474,10 @@ function mr() {
|
|
|
6468
6474
|
additionalProperties: !0,
|
|
6469
6475
|
},
|
|
6470
6476
|
},
|
|
6471
|
-
p =
|
|
6472
|
-
return [n, s, o, u, l, p, c,
|
|
6477
|
+
p = gr();
|
|
6478
|
+
return [n, s, o, u, l, p, c, pr];
|
|
6473
6479
|
}
|
|
6474
|
-
function
|
|
6480
|
+
function gr() {
|
|
6475
6481
|
return {
|
|
6476
6482
|
name: 'upload_asset',
|
|
6477
6483
|
description:
|
|
@@ -6519,25 +6525,25 @@ function fr() {
|
|
|
6519
6525
|
};
|
|
6520
6526
|
}
|
|
6521
6527
|
function Ue() {
|
|
6522
|
-
let e =
|
|
6523
|
-
t = q().map((i) =>
|
|
6524
|
-
return [...e, ...t].map(
|
|
6528
|
+
let e = fr(),
|
|
6529
|
+
t = q().map((i) => mr(i));
|
|
6530
|
+
return [...e, ...t].map(dr).map(cr);
|
|
6525
6531
|
}
|
|
6526
|
-
var
|
|
6527
|
-
or,
|
|
6532
|
+
var or,
|
|
6528
6533
|
lr,
|
|
6529
|
-
|
|
6530
|
-
Lt
|
|
6534
|
+
pr,
|
|
6535
|
+
Lt,
|
|
6536
|
+
Vt = b(() => {
|
|
6531
6537
|
'use strict';
|
|
6532
6538
|
V();
|
|
6533
6539
|
Ke();
|
|
6534
6540
|
H();
|
|
6535
|
-
((
|
|
6541
|
+
((or = {
|
|
6536
6542
|
type: 'string',
|
|
6537
6543
|
description:
|
|
6538
6544
|
'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.',
|
|
6539
6545
|
}),
|
|
6540
|
-
(
|
|
6546
|
+
(lr = new Set([
|
|
6541
6547
|
'upload_asset',
|
|
6542
6548
|
'upload_media',
|
|
6543
6549
|
'upload_image',
|
|
@@ -6545,7 +6551,7 @@ var sr,
|
|
|
6545
6551
|
'check_status',
|
|
6546
6552
|
'get_pricing',
|
|
6547
6553
|
])),
|
|
6548
|
-
(
|
|
6554
|
+
(pr = {
|
|
6549
6555
|
name: 'get_pricing',
|
|
6550
6556
|
description:
|
|
6551
6557
|
'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.',
|
|
@@ -6560,7 +6566,7 @@ var sr,
|
|
|
6560
6566
|
additionalProperties: !1,
|
|
6561
6567
|
},
|
|
6562
6568
|
}));
|
|
6563
|
-
|
|
6569
|
+
Lt = new Set([
|
|
6564
6570
|
'image',
|
|
6565
6571
|
'images',
|
|
6566
6572
|
'image_url',
|
|
@@ -6577,19 +6583,19 @@ var sr,
|
|
|
6577
6583
|
'lipsyncing_audio',
|
|
6578
6584
|
]);
|
|
6579
6585
|
});
|
|
6580
|
-
var
|
|
6581
|
-
|
|
6582
|
-
forgetToolSchemas: () =>
|
|
6583
|
-
jsonRpcAnswer: () =>
|
|
6584
|
-
preprocessLocalFiles: () =>
|
|
6585
|
-
startStdioServer: () =>
|
|
6586
|
+
var Wt = {};
|
|
6587
|
+
ri(Wt, {
|
|
6588
|
+
forgetToolSchemas: () => kr,
|
|
6589
|
+
jsonRpcAnswer: () => Bt,
|
|
6590
|
+
preprocessLocalFiles: () => zt,
|
|
6591
|
+
startStdioServer: () => Ht,
|
|
6586
6592
|
});
|
|
6587
|
-
function
|
|
6593
|
+
function hr(e) {
|
|
6588
6594
|
let t = (i) =>
|
|
6589
6595
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6590
6596
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6591
6597
|
}
|
|
6592
|
-
function
|
|
6598
|
+
function Bt(e, t, i) {
|
|
6593
6599
|
let r = e?.id,
|
|
6594
6600
|
n = r == null,
|
|
6595
6601
|
s = null;
|
|
@@ -6598,7 +6604,7 @@ function jt(e, t, i) {
|
|
|
6598
6604
|
} catch {
|
|
6599
6605
|
s = null;
|
|
6600
6606
|
}
|
|
6601
|
-
if (s !== null &&
|
|
6607
|
+
if (s !== null && hr(s)) return n ? null : s;
|
|
6602
6608
|
if (n) return null;
|
|
6603
6609
|
if (!i && t >= 200 && t < 300) return;
|
|
6604
6610
|
let o = s?.error,
|
|
@@ -6619,12 +6625,12 @@ function jt(e, t, i) {
|
|
|
6619
6625
|
},
|
|
6620
6626
|
};
|
|
6621
6627
|
}
|
|
6622
|
-
function
|
|
6628
|
+
function yr() {
|
|
6623
6629
|
let e = process.argv.slice(2),
|
|
6624
6630
|
t = e.indexOf('--api-key');
|
|
6625
6631
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6626
6632
|
}
|
|
6627
|
-
async function
|
|
6633
|
+
async function Ft(e, t, i) {
|
|
6628
6634
|
let r = j.default.resolve(e);
|
|
6629
6635
|
if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
|
|
6630
6636
|
throw new Error(`File not found: ${e}`);
|
|
@@ -6653,15 +6659,15 @@ async function Bt(e, t, i) {
|
|
|
6653
6659
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
6654
6660
|
};
|
|
6655
6661
|
}
|
|
6656
|
-
function Ft(e) {
|
|
6657
|
-
return yr.has(j.default.extname(e).toLowerCase());
|
|
6658
|
-
}
|
|
6659
6662
|
function Gt(e) {
|
|
6663
|
+
return br.has(j.default.extname(e).toLowerCase());
|
|
6664
|
+
}
|
|
6665
|
+
function Jt(e) {
|
|
6660
6666
|
return new Error(
|
|
6661
6667
|
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
6662
6668
|
);
|
|
6663
6669
|
}
|
|
6664
|
-
function
|
|
6670
|
+
function wr(e) {
|
|
6665
6671
|
let t = e.trim();
|
|
6666
6672
|
if (
|
|
6667
6673
|
!t ||
|
|
@@ -6684,10 +6690,10 @@ function Be(e) {
|
|
|
6684
6690
|
Q.set(i.name, i.inputSchema);
|
|
6685
6691
|
}
|
|
6686
6692
|
}
|
|
6687
|
-
function
|
|
6693
|
+
function kr() {
|
|
6688
6694
|
(Q.clear(), (je = 0));
|
|
6689
6695
|
}
|
|
6690
|
-
async function
|
|
6696
|
+
async function xr(e, t) {
|
|
6691
6697
|
if (!(Date.now() - je < 6e4)) {
|
|
6692
6698
|
je = Date.now();
|
|
6693
6699
|
try {
|
|
@@ -6703,35 +6709,35 @@ async function kr(e, t) {
|
|
|
6703
6709
|
} catch {}
|
|
6704
6710
|
}
|
|
6705
6711
|
}
|
|
6706
|
-
function
|
|
6712
|
+
function vr(e) {
|
|
6707
6713
|
return e
|
|
6708
6714
|
? e.type === 'string'
|
|
6709
6715
|
? e.format === 'uri'
|
|
6710
6716
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6711
6717
|
: !1;
|
|
6712
6718
|
}
|
|
6713
|
-
async function
|
|
6719
|
+
async function Nt(e, t, i) {
|
|
6714
6720
|
if (typeof e != 'string') return e;
|
|
6715
|
-
let r =
|
|
6721
|
+
let r = wr(e);
|
|
6716
6722
|
if (!r) return e;
|
|
6717
|
-
if (!
|
|
6718
|
-
return (await
|
|
6723
|
+
if (!Gt(r)) throw Jt(r);
|
|
6724
|
+
return (await Ft(r, t, i)).url;
|
|
6719
6725
|
}
|
|
6720
|
-
async function
|
|
6721
|
-
(Q.size === 0 && Be(Ue()), Q.has(e) || (await
|
|
6726
|
+
async function zt(e, t, i, r, n) {
|
|
6727
|
+
(Q.size === 0 && Be(Ue()), Q.has(e) || (await xr(n, i)));
|
|
6722
6728
|
let s = Q.get(e)?.properties;
|
|
6723
6729
|
if (!s) return t;
|
|
6724
6730
|
let o = { ...t };
|
|
6725
6731
|
for (let [u, l] of Object.entries(t))
|
|
6726
|
-
if (
|
|
6732
|
+
if (vr(s[u]))
|
|
6727
6733
|
if (Array.isArray(l)) {
|
|
6728
6734
|
let c = [];
|
|
6729
|
-
for (let p of l) c.push(await
|
|
6735
|
+
for (let p of l) c.push(await Nt(p, i, r));
|
|
6730
6736
|
o[u] = c;
|
|
6731
|
-
} else o[u] = await
|
|
6737
|
+
} else o[u] = await Nt(l, i, r);
|
|
6732
6738
|
return o;
|
|
6733
6739
|
}
|
|
6734
|
-
function
|
|
6740
|
+
function Ir(e) {
|
|
6735
6741
|
let t = e.id ?? null;
|
|
6736
6742
|
switch (e.method) {
|
|
6737
6743
|
case 'initialize':
|
|
@@ -6772,13 +6778,13 @@ function vr(e) {
|
|
|
6772
6778
|
};
|
|
6773
6779
|
}
|
|
6774
6780
|
}
|
|
6775
|
-
async function
|
|
6776
|
-
if (
|
|
6777
|
-
|
|
6778
|
-
let e =
|
|
6781
|
+
async function Ht() {
|
|
6782
|
+
if (Ut) return;
|
|
6783
|
+
Ut = !0;
|
|
6784
|
+
let e = yr(),
|
|
6779
6785
|
t = x(),
|
|
6780
6786
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6781
|
-
(
|
|
6787
|
+
(jt.default
|
|
6782
6788
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6783
6789
|
.on('line', async (n) => {
|
|
6784
6790
|
let s = n.trim();
|
|
@@ -6839,8 +6845,8 @@ async function zt() {
|
|
|
6839
6845
|
try {
|
|
6840
6846
|
let d = j.default.resolve(p.trim());
|
|
6841
6847
|
if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
|
|
6842
|
-
if (!
|
|
6843
|
-
let m = await
|
|
6848
|
+
if (!Gt(d)) throw Jt(d);
|
|
6849
|
+
let m = await Ft(d, e, t),
|
|
6844
6850
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
6845
6851
|
ue =
|
|
6846
6852
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6896,7 +6902,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6896
6902
|
}
|
|
6897
6903
|
if (e)
|
|
6898
6904
|
try {
|
|
6899
|
-
o.params.arguments = await
|
|
6905
|
+
o.params.arguments = await zt(String(l), c, e, t, i);
|
|
6900
6906
|
} catch (p) {
|
|
6901
6907
|
let d = p instanceof Error ? p.message : String(p);
|
|
6902
6908
|
process.stdout.write(
|
|
@@ -6927,7 +6933,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6927
6933
|
body: JSON.stringify(o),
|
|
6928
6934
|
}),
|
|
6929
6935
|
c = await l.text(),
|
|
6930
|
-
p =
|
|
6936
|
+
p = Bt(o, l.status, c);
|
|
6931
6937
|
if (p === null) return;
|
|
6932
6938
|
if (p) {
|
|
6933
6939
|
(o?.method === 'tools/list' && Be(p.result?.tools),
|
|
@@ -6939,7 +6945,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6939
6945
|
return;
|
|
6940
6946
|
}
|
|
6941
6947
|
} catch {}
|
|
6942
|
-
let u =
|
|
6948
|
+
let u = Ir(o);
|
|
6943
6949
|
u !== null &&
|
|
6944
6950
|
process.stdout.write(
|
|
6945
6951
|
JSON.stringify(u) +
|
|
@@ -6964,20 +6970,20 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6964
6970
|
}
|
|
6965
6971
|
var R,
|
|
6966
6972
|
j,
|
|
6967
|
-
|
|
6968
|
-
|
|
6973
|
+
jt,
|
|
6974
|
+
br,
|
|
6969
6975
|
Q,
|
|
6970
6976
|
je,
|
|
6971
|
-
|
|
6972
|
-
|
|
6977
|
+
Ut,
|
|
6978
|
+
Yt = b(() => {
|
|
6973
6979
|
'use strict';
|
|
6974
6980
|
((R = I(require('node:fs'))),
|
|
6975
6981
|
(j = I(require('node:path'))),
|
|
6976
|
-
(
|
|
6982
|
+
(jt = I(require('node:readline'))));
|
|
6977
6983
|
Re();
|
|
6978
|
-
|
|
6984
|
+
Vt();
|
|
6979
6985
|
E();
|
|
6980
|
-
|
|
6986
|
+
br = new Set([
|
|
6981
6987
|
'.png',
|
|
6982
6988
|
'.jpg',
|
|
6983
6989
|
'.jpeg',
|
|
@@ -7004,19 +7010,19 @@ var R,
|
|
|
7004
7010
|
'.opus',
|
|
7005
7011
|
]);
|
|
7006
7012
|
((Q = new Map()), (je = 0));
|
|
7007
|
-
|
|
7013
|
+
Ut = !1;
|
|
7008
7014
|
require.main === module &&
|
|
7009
|
-
|
|
7015
|
+
Ht().catch((e) => {
|
|
7010
7016
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
7011
7017
|
`),
|
|
7012
7018
|
process.exit(1));
|
|
7013
7019
|
});
|
|
7014
7020
|
});
|
|
7015
|
-
var
|
|
7021
|
+
var ni =
|
|
7016
7022
|
!process.env.NO_COLOR &&
|
|
7017
7023
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
7018
7024
|
function w(e, t) {
|
|
7019
|
-
return (i) => (
|
|
7025
|
+
return (i) => (ni ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
7020
7026
|
}
|
|
7021
7027
|
var a = {
|
|
7022
7028
|
bold: w(1, 22),
|
|
@@ -7106,7 +7112,7 @@ var ee = I(require('node:fs')),
|
|
|
7106
7112
|
Je = I(require('node:path')),
|
|
7107
7113
|
ze = require('node:stream/promises');
|
|
7108
7114
|
var Z = '1.1.7';
|
|
7109
|
-
var
|
|
7115
|
+
var si = new Set([
|
|
7110
7116
|
'account_suspended',
|
|
7111
7117
|
'account_terminated',
|
|
7112
7118
|
'creative_mode_restricted',
|
|
@@ -7114,7 +7120,7 @@ var ni = new Set([
|
|
|
7114
7120
|
'workspace_paused',
|
|
7115
7121
|
]),
|
|
7116
7122
|
_ = 1,
|
|
7117
|
-
|
|
7123
|
+
oi = 3,
|
|
7118
7124
|
k = class extends Error {
|
|
7119
7125
|
constructor(t, i, r, n = {}) {
|
|
7120
7126
|
(super(i),
|
|
@@ -7124,10 +7130,10 @@ var ni = new Set([
|
|
|
7124
7130
|
(this.fields = n));
|
|
7125
7131
|
}
|
|
7126
7132
|
get exitCode() {
|
|
7127
|
-
return this.code &&
|
|
7133
|
+
return this.code && si.has(this.code) ? oi : _;
|
|
7128
7134
|
}
|
|
7129
7135
|
};
|
|
7130
|
-
function
|
|
7136
|
+
function li(e, t, i) {
|
|
7131
7137
|
let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
7132
7138
|
if (!i || typeof i != 'object') return new k(e, r);
|
|
7133
7139
|
let n = i;
|
|
@@ -7154,7 +7160,7 @@ function K(e) {
|
|
|
7154
7160
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
7155
7161
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
7156
7162
|
}
|
|
7157
|
-
function
|
|
7163
|
+
function pi(e) {
|
|
7158
7164
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7159
7165
|
? 'video'
|
|
7160
7166
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
@@ -7166,7 +7172,7 @@ function Ge(e) {
|
|
|
7166
7172
|
for (let i of e.data ?? [])
|
|
7167
7173
|
typeof i.message?.content == 'string'
|
|
7168
7174
|
? t.push({ type: 'text', text: i.message.content })
|
|
7169
|
-
: i.url && t.push({ type:
|
|
7175
|
+
: i.url && t.push({ type: pi(i.url), url: i.url });
|
|
7170
7176
|
return t;
|
|
7171
7177
|
}
|
|
7172
7178
|
var M = class {
|
|
@@ -7192,7 +7198,7 @@ var M = class {
|
|
|
7192
7198
|
try {
|
|
7193
7199
|
s = await n.json();
|
|
7194
7200
|
} catch {}
|
|
7195
|
-
throw
|
|
7201
|
+
throw li(n.status, n.statusText, s);
|
|
7196
7202
|
}
|
|
7197
7203
|
return await n.json();
|
|
7198
7204
|
}
|
|
@@ -7258,29 +7264,29 @@ function ye(e) {
|
|
|
7258
7264
|
return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
|
|
7259
7265
|
}
|
|
7260
7266
|
H();
|
|
7261
|
-
var
|
|
7262
|
-
function Ui(e) {
|
|
7263
|
-
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7264
|
-
}
|
|
7267
|
+
var Tt = ['images', 'input_images', 'videos', 'audios'];
|
|
7265
7268
|
function ji(e) {
|
|
7269
|
+
for (let t of Tt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7270
|
+
}
|
|
7271
|
+
function Bi(e) {
|
|
7266
7272
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7267
7273
|
let t = A.default.resolve(e);
|
|
7268
7274
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7269
7275
|
}
|
|
7270
|
-
async function
|
|
7271
|
-
for (let i of
|
|
7276
|
+
async function Fi(e, t) {
|
|
7277
|
+
for (let i of Tt) {
|
|
7272
7278
|
if (!Array.isArray(e[i])) continue;
|
|
7273
7279
|
let r = [];
|
|
7274
7280
|
for (let n of e[i]) {
|
|
7275
7281
|
if (typeof n != 'string') continue;
|
|
7276
|
-
let s =
|
|
7282
|
+
let s = Bi(n);
|
|
7277
7283
|
r.push(s ? await t(s) : n);
|
|
7278
7284
|
}
|
|
7279
7285
|
e[i] = r;
|
|
7280
7286
|
}
|
|
7281
7287
|
}
|
|
7282
7288
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7283
|
-
function
|
|
7289
|
+
function Gi(e) {
|
|
7284
7290
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7285
7291
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7286
7292
|
i = W.enterprise;
|
|
@@ -7293,7 +7299,7 @@ function Fi(e) {
|
|
|
7293
7299
|
t
|
|
7294
7300
|
);
|
|
7295
7301
|
}
|
|
7296
|
-
async function
|
|
7302
|
+
async function Ji(e, t, i, r, n) {
|
|
7297
7303
|
n.isJson ||
|
|
7298
7304
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7299
7305
|
`);
|
|
@@ -7368,7 +7374,7 @@ async function Gi(e, t, i, r, n) {
|
|
|
7368
7374
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7369
7375
|
process.exit(_);
|
|
7370
7376
|
}
|
|
7371
|
-
function
|
|
7377
|
+
function Mt(e) {
|
|
7372
7378
|
let t = {},
|
|
7373
7379
|
i = new Set(),
|
|
7374
7380
|
r = [];
|
|
@@ -7435,7 +7441,7 @@ async function Ae(e, t) {
|
|
|
7435
7441
|
s = !!t.json,
|
|
7436
7442
|
o = !!(t.async || t.no_wait),
|
|
7437
7443
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7438
|
-
l =
|
|
7444
|
+
l = Gi(t),
|
|
7439
7445
|
c = { ...t };
|
|
7440
7446
|
(delete c.json,
|
|
7441
7447
|
delete c.async,
|
|
@@ -7444,8 +7450,8 @@ async function Ae(e, t) {
|
|
|
7444
7450
|
delete c.api_key,
|
|
7445
7451
|
delete c.api_url,
|
|
7446
7452
|
delete c.count);
|
|
7447
|
-
let p =
|
|
7448
|
-
(
|
|
7453
|
+
let p = Pt(n, c);
|
|
7454
|
+
(ji(p),
|
|
7449
7455
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7450
7456
|
p.image_url &&
|
|
7451
7457
|
!p.first_frame_image &&
|
|
@@ -7478,7 +7484,7 @@ async function Ae(e, t) {
|
|
|
7478
7484
|
}
|
|
7479
7485
|
}
|
|
7480
7486
|
}
|
|
7481
|
-
await
|
|
7487
|
+
await Fi(p, async (y) => {
|
|
7482
7488
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7483
7489
|
s || f.start();
|
|
7484
7490
|
try {
|
|
@@ -7502,7 +7508,7 @@ async function Ae(e, t) {
|
|
|
7502
7508
|
let g;
|
|
7503
7509
|
try {
|
|
7504
7510
|
if (l > 1) {
|
|
7505
|
-
await
|
|
7511
|
+
await Ji(d, e, p, l, { isJson: s, isAsync: o });
|
|
7506
7512
|
return;
|
|
7507
7513
|
}
|
|
7508
7514
|
g = await d.queueJob(e, p);
|
|
@@ -7620,9 +7626,9 @@ ${f.text}
|
|
|
7620
7626
|
process.stdout.write(`
|
|
7621
7627
|
`);
|
|
7622
7628
|
}
|
|
7623
|
-
var
|
|
7629
|
+
var Kt = I(require('node:readline'));
|
|
7624
7630
|
E();
|
|
7625
|
-
async function
|
|
7631
|
+
async function zi(e) {
|
|
7626
7632
|
try {
|
|
7627
7633
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7628
7634
|
} catch (t) {
|
|
@@ -7633,8 +7639,8 @@ async function Ji(e) {
|
|
|
7633
7639
|
return 'unchecked';
|
|
7634
7640
|
}
|
|
7635
7641
|
}
|
|
7636
|
-
function
|
|
7637
|
-
let t =
|
|
7642
|
+
function Hi(e) {
|
|
7643
|
+
let t = Kt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7638
7644
|
return new Promise((i) => {
|
|
7639
7645
|
t.question(e, (r) => {
|
|
7640
7646
|
(t.close(), i(r.trim()));
|
|
@@ -7653,14 +7659,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7653
7659
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7654
7660
|
|
|
7655
7661
|
`),
|
|
7656
|
-
(i = await
|
|
7662
|
+
(i = await Hi('Enter your Tein API Key (sk_live_...): '))),
|
|
7657
7663
|
!i.startsWith('sk_live_') &&
|
|
7658
7664
|
!i.startsWith('sk_test_') &&
|
|
7659
7665
|
(process.stderr
|
|
7660
7666
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7661
7667
|
`),
|
|
7662
7668
|
process.exit(1)));
|
|
7663
|
-
let r = await
|
|
7669
|
+
let r = await zi(i);
|
|
7664
7670
|
(r === 'invalid' &&
|
|
7665
7671
|
(process.stderr
|
|
7666
7672
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -7732,10 +7738,10 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7732
7738
|
E();
|
|
7733
7739
|
be();
|
|
7734
7740
|
H();
|
|
7735
|
-
var
|
|
7736
|
-
async function
|
|
7741
|
+
var Wi = 3e3;
|
|
7742
|
+
async function St(e) {
|
|
7737
7743
|
try {
|
|
7738
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
7744
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Wi) });
|
|
7739
7745
|
if (!t.ok) return;
|
|
7740
7746
|
let i = await t.json(),
|
|
7741
7747
|
r = {};
|
|
@@ -7743,18 +7749,18 @@ async function Kt(e) {
|
|
|
7743
7749
|
let s = String(n.modelSlug ?? '');
|
|
7744
7750
|
F.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7745
7751
|
}
|
|
7746
|
-
|
|
7752
|
+
bt(r);
|
|
7747
7753
|
} catch {}
|
|
7748
7754
|
}
|
|
7749
|
-
var
|
|
7750
|
-
|
|
7751
|
-
async function
|
|
7752
|
-
await
|
|
7755
|
+
var Yi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7756
|
+
Qi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7757
|
+
async function $t(e, t) {
|
|
7758
|
+
await St(t);
|
|
7753
7759
|
let i = q();
|
|
7754
7760
|
if (e) {
|
|
7755
7761
|
let s = e.toLowerCase(),
|
|
7756
|
-
o =
|
|
7757
|
-
i =
|
|
7762
|
+
o = Qi[s] ?? s;
|
|
7763
|
+
i = Yi.has(o)
|
|
7758
7764
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7759
7765
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7760
7766
|
}
|
|
@@ -7792,8 +7798,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7792
7798
|
|
|
7793
7799
|
`);
|
|
7794
7800
|
}
|
|
7795
|
-
async function
|
|
7796
|
-
F.has(e) && (await
|
|
7801
|
+
async function Ct(e, t) {
|
|
7802
|
+
F.has(e) && (await St(t));
|
|
7797
7803
|
let i = U(e);
|
|
7798
7804
|
(i ||
|
|
7799
7805
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -7875,7 +7881,7 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7875
7881
|
}
|
|
7876
7882
|
E();
|
|
7877
7883
|
Re();
|
|
7878
|
-
var
|
|
7884
|
+
var Xi = 1e4,
|
|
7879
7885
|
De = {
|
|
7880
7886
|
price: '',
|
|
7881
7887
|
creativeMode: 'Creative mode',
|
|
@@ -7886,22 +7892,22 @@ var Qi = 1e4,
|
|
|
7886
7892
|
priorityDraft: 'Priority + Draft',
|
|
7887
7893
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7888
7894
|
},
|
|
7889
|
-
|
|
7890
|
-
|
|
7895
|
+
Zi = Object.keys(De),
|
|
7896
|
+
er = {
|
|
7891
7897
|
creativeMode: 'unfiltered',
|
|
7892
7898
|
creativeModePriority: 'unfilteredPriority',
|
|
7893
7899
|
creativeModeDraft: 'unfilteredDraft',
|
|
7894
7900
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7895
7901
|
};
|
|
7896
|
-
function
|
|
7897
|
-
let i =
|
|
7902
|
+
function tr(e, t) {
|
|
7903
|
+
let i = er[t];
|
|
7898
7904
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7899
7905
|
}
|
|
7900
|
-
async function
|
|
7906
|
+
async function ir(e, t) {
|
|
7901
7907
|
let i = `${x(e)}${ce(t)}`,
|
|
7902
7908
|
r;
|
|
7903
7909
|
try {
|
|
7904
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7910
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Xi) });
|
|
7905
7911
|
} catch {
|
|
7906
7912
|
throw new Error(`Could not reach ${i}`);
|
|
7907
7913
|
}
|
|
@@ -7928,7 +7934,7 @@ function Le(e) {
|
|
|
7928
7934
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7929
7935
|
return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
|
|
7930
7936
|
}
|
|
7931
|
-
function
|
|
7937
|
+
function rr(e) {
|
|
7932
7938
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7933
7939
|
let t = [];
|
|
7934
7940
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7940,21 +7946,21 @@ function ir(e) {
|
|
|
7940
7946
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7941
7947
|
);
|
|
7942
7948
|
}
|
|
7943
|
-
function
|
|
7944
|
-
let i =
|
|
7945
|
-
for (let r of
|
|
7946
|
-
let n = Le(
|
|
7949
|
+
function ar(e, t) {
|
|
7950
|
+
let i = rr(e);
|
|
7951
|
+
for (let r of Zi) {
|
|
7952
|
+
let n = Le(tr(e, r));
|
|
7947
7953
|
if (!n) continue;
|
|
7948
7954
|
let s = De[r] ? ` (${De[r]})` : '';
|
|
7949
7955
|
t.push(` ${i}${s} ${n}`);
|
|
7950
7956
|
}
|
|
7951
7957
|
}
|
|
7952
|
-
function
|
|
7958
|
+
function nr(e, t) {
|
|
7953
7959
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7954
7960
|
t.push(
|
|
7955
7961
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7956
7962
|
);
|
|
7957
|
-
for (let n of e.variants ?? [])
|
|
7963
|
+
for (let n of e.variants ?? []) ar(n, t);
|
|
7958
7964
|
let r = e.addons;
|
|
7959
7965
|
if (Array.isArray(r))
|
|
7960
7966
|
for (let n of r) {
|
|
@@ -7966,7 +7972,7 @@ function ar(e, t) {
|
|
|
7966
7972
|
}
|
|
7967
7973
|
t.push('');
|
|
7968
7974
|
}
|
|
7969
|
-
function
|
|
7975
|
+
function sr(e) {
|
|
7970
7976
|
let t = [],
|
|
7971
7977
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7972
7978
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7988,7 +7994,7 @@ function nr(e) {
|
|
|
7988
7994
|
});
|
|
7989
7995
|
for (let l of s) {
|
|
7990
7996
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7991
|
-
for (let c of r.get(l) ?? [])
|
|
7997
|
+
for (let c of r.get(l) ?? []) nr(c, t);
|
|
7992
7998
|
}
|
|
7993
7999
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7994
8000
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -8018,10 +8024,10 @@ function nr(e) {
|
|
|
8018
8024
|
`
|
|
8019
8025
|
);
|
|
8020
8026
|
}
|
|
8021
|
-
async function
|
|
8027
|
+
async function Et(e) {
|
|
8022
8028
|
let t;
|
|
8023
8029
|
try {
|
|
8024
|
-
t = await
|
|
8030
|
+
t = await ir(e.apiUrl, e.model);
|
|
8025
8031
|
} catch (i) {
|
|
8026
8032
|
let r = i instanceof Error ? i.message : String(i);
|
|
8027
8033
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -8032,12 +8038,12 @@ async function Ct(e) {
|
|
|
8032
8038
|
e.json
|
|
8033
8039
|
? `${JSON.stringify(t, null, 2)}
|
|
8034
8040
|
`
|
|
8035
|
-
:
|
|
8041
|
+
: sr(t),
|
|
8036
8042
|
);
|
|
8037
8043
|
}
|
|
8038
|
-
var
|
|
8044
|
+
var qt = I(require('node:path'));
|
|
8039
8045
|
E();
|
|
8040
|
-
async function
|
|
8046
|
+
async function At(e, t) {
|
|
8041
8047
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8042
8048
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8043
8049
|
(i ||
|
|
@@ -8132,7 +8138,7 @@ ${a.bold('Outputs:')}
|
|
|
8132
8138
|
) {
|
|
8133
8139
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
8134
8140
|
try {
|
|
8135
|
-
(await u.downloadOutput(p.url,
|
|
8141
|
+
(await u.downloadOutput(p.url, qt.default.resolve(process.cwd(), o)),
|
|
8136
8142
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
8137
8143
|
} catch (m) {
|
|
8138
8144
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -8150,7 +8156,7 @@ ${p.text}
|
|
|
8150
8156
|
var Ve = I(require('node:fs')),
|
|
8151
8157
|
Ne = I(require('node:path'));
|
|
8152
8158
|
E();
|
|
8153
|
-
async function
|
|
8159
|
+
async function Rt(e, t = {}) {
|
|
8154
8160
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8155
8161
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
8156
8162
|
n = !!t.json;
|
|
@@ -8216,7 +8222,7 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8216
8222
|
}
|
|
8217
8223
|
H();
|
|
8218
8224
|
Te();
|
|
8219
|
-
function
|
|
8225
|
+
function Qt() {
|
|
8220
8226
|
process.stdout.write(`
|
|
8221
8227
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8222
8228
|
|
|
@@ -8276,11 +8282,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8276
8282
|
|
|
8277
8283
|
`);
|
|
8278
8284
|
}
|
|
8279
|
-
async function
|
|
8285
|
+
async function _r() {
|
|
8280
8286
|
let e = process.argv.slice(2),
|
|
8281
|
-
t =
|
|
8287
|
+
t = Mt(e);
|
|
8282
8288
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8283
|
-
|
|
8289
|
+
Qt();
|
|
8284
8290
|
return;
|
|
8285
8291
|
}
|
|
8286
8292
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8307,14 +8313,14 @@ async function Ir() {
|
|
|
8307
8313
|
}
|
|
8308
8314
|
case 'models':
|
|
8309
8315
|
case 'list': {
|
|
8310
|
-
await
|
|
8316
|
+
await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8311
8317
|
break;
|
|
8312
8318
|
}
|
|
8313
8319
|
case 'pricing':
|
|
8314
8320
|
case 'prices': {
|
|
8315
8321
|
let i = t.options.model,
|
|
8316
8322
|
r = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
8317
|
-
await
|
|
8323
|
+
await Et({
|
|
8318
8324
|
model: r,
|
|
8319
8325
|
json: !!t.options.json,
|
|
8320
8326
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -8329,12 +8335,12 @@ async function Ir() {
|
|
|
8329
8335
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8330
8336
|
`),
|
|
8331
8337
|
process.exit(1)),
|
|
8332
|
-
await
|
|
8338
|
+
await Ct(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8333
8339
|
break;
|
|
8334
8340
|
}
|
|
8335
8341
|
case 'upload': {
|
|
8336
8342
|
let i = t.subcommand || '';
|
|
8337
|
-
await
|
|
8343
|
+
await Rt(i, t.options);
|
|
8338
8344
|
break;
|
|
8339
8345
|
}
|
|
8340
8346
|
case 'run':
|
|
@@ -8345,11 +8351,11 @@ async function Ir() {
|
|
|
8345
8351
|
}
|
|
8346
8352
|
case 'status': {
|
|
8347
8353
|
let i = t.subcommand || '';
|
|
8348
|
-
await
|
|
8354
|
+
await At(i, t.options);
|
|
8349
8355
|
break;
|
|
8350
8356
|
}
|
|
8351
8357
|
case 'mcp': {
|
|
8352
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
8358
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Yt(), Wt));
|
|
8353
8359
|
await i();
|
|
8354
8360
|
break;
|
|
8355
8361
|
}
|
|
@@ -8365,12 +8371,12 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
|
|
|
8365
8371
|
await Ae(t.command, t.options));
|
|
8366
8372
|
return;
|
|
8367
8373
|
}
|
|
8368
|
-
|
|
8374
|
+
Qt();
|
|
8369
8375
|
break;
|
|
8370
8376
|
}
|
|
8371
8377
|
}
|
|
8372
8378
|
}
|
|
8373
|
-
|
|
8379
|
+
_r().catch((e) => {
|
|
8374
8380
|
(e instanceof k &&
|
|
8375
8381
|
(process.stderr.write(`
|
|
8376
8382
|
${a.red('Error:')} ${K(e).join(`
|