@teinai/cli 1.1.14 → 1.1.16
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 +325 -247
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -80,28 +80,28 @@ var C,
|
|
|
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
|
-
var
|
|
92
|
+
var F,
|
|
93
93
|
be = b(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
F = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
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',
|
|
@@ -140,6 +140,7 @@ var re,
|
|
|
140
140
|
{ slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
|
|
141
141
|
{ slug: 'minimax', name: 'Hailuo', models: ['minimax-h3', 'minimax-h3-turbo'] },
|
|
142
142
|
{ slug: 'qwen', name: 'Qwen', models: ['qwen-3', 'qwen-3-pro'] },
|
|
143
|
+
{ slug: 'z-image', name: 'Z Image', models: ['z-image-pro'] },
|
|
143
144
|
{
|
|
144
145
|
slug: 'nano-banana',
|
|
145
146
|
name: 'Nano Banana',
|
|
@@ -1562,6 +1563,37 @@ var re,
|
|
|
1562
1563
|
axes: { resolution: ['1K', '2K'] },
|
|
1563
1564
|
from: { variant: '1k' },
|
|
1564
1565
|
},
|
|
1566
|
+
{
|
|
1567
|
+
slug: 'z-image-pro',
|
|
1568
|
+
name: 'Z Image Pro',
|
|
1569
|
+
family: 'z-image',
|
|
1570
|
+
vendor: 'Alibaba',
|
|
1571
|
+
desc: "Alibaba's Z Image Pro \u2014 photoreal text-to-image at 1K or 2K for the same price, with Creative mode. Text to image only: no reference images or edits.",
|
|
1572
|
+
kind: 'image',
|
|
1573
|
+
unit: '/img',
|
|
1574
|
+
api: { model: 'z-image-pro' },
|
|
1575
|
+
variants: [
|
|
1576
|
+
{
|
|
1577
|
+
id: '1k',
|
|
1578
|
+
price: { starter: 0.0232, plus: 0.022, scale: 0.0206 },
|
|
1579
|
+
label: '1K',
|
|
1580
|
+
resolution: '1K',
|
|
1581
|
+
unfiltered: { starter: 0.0243, plus: 0.0231, scale: 0.0216 },
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
id: '2k',
|
|
1585
|
+
price: { starter: 0.0232, plus: 0.022, scale: 0.0206 },
|
|
1586
|
+
label: '2K',
|
|
1587
|
+
resolution: '2K',
|
|
1588
|
+
unfiltered: { starter: 0.0243, plus: 0.0231, scale: 0.0216 },
|
|
1589
|
+
},
|
|
1590
|
+
],
|
|
1591
|
+
unfiltered: 0.05,
|
|
1592
|
+
priority: null,
|
|
1593
|
+
draft: null,
|
|
1594
|
+
axes: { resolution: ['1K', '2K'] },
|
|
1595
|
+
from: { variant: '1k' },
|
|
1596
|
+
},
|
|
1565
1597
|
{
|
|
1566
1598
|
slug: 'nano-banana-2',
|
|
1567
1599
|
name: 'Nano Banana 2',
|
|
@@ -4656,7 +4688,7 @@ function ui(e, t) {
|
|
|
4656
4688
|
function fi(e, t) {
|
|
4657
4689
|
return ae.has(e) && !(mi.has(e) && t) ? e : ui(e, t);
|
|
4658
4690
|
}
|
|
4659
|
-
function
|
|
4691
|
+
function G(e, t) {
|
|
4660
4692
|
let i = fi(e, t);
|
|
4661
4693
|
return i ? (ae.get(i) ?? null) : null;
|
|
4662
4694
|
}
|
|
@@ -4666,14 +4698,14 @@ function ne() {
|
|
|
4666
4698
|
var Ie,
|
|
4667
4699
|
ae,
|
|
4668
4700
|
ke,
|
|
4669
|
-
|
|
4701
|
+
et,
|
|
4670
4702
|
di,
|
|
4671
4703
|
xe,
|
|
4672
4704
|
mi,
|
|
4673
4705
|
V = b(() => {
|
|
4674
4706
|
'use strict';
|
|
4675
|
-
Qe();
|
|
4676
4707
|
Xe();
|
|
4708
|
+
Ze();
|
|
4677
4709
|
((Ie = {
|
|
4678
4710
|
...re,
|
|
4679
4711
|
families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
|
|
@@ -4681,14 +4713,14 @@ var Ie,
|
|
|
4681
4713
|
}),
|
|
4682
4714
|
(ae = new Map()),
|
|
4683
4715
|
(ke = new Map()),
|
|
4684
|
-
(
|
|
4716
|
+
(et = new Map()),
|
|
4685
4717
|
(di = new Map()),
|
|
4686
4718
|
(xe = new Map()));
|
|
4687
4719
|
for (let e of Ie.models) {
|
|
4688
4720
|
(ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
|
|
4689
|
-
for (let t of e.variants)
|
|
4721
|
+
for (let t of e.variants) et.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4690
4722
|
for (let t of e.editVariants ?? [])
|
|
4691
|
-
|
|
4723
|
+
et.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4692
4724
|
for (let t of e.addons ?? []) di.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4693
4725
|
xe.set(e.slug, e.family);
|
|
4694
4726
|
}
|
|
@@ -4701,15 +4733,15 @@ function se(e) {
|
|
|
4701
4733
|
}
|
|
4702
4734
|
function _e(e) {
|
|
4703
4735
|
if (e.endpoints?.length)
|
|
4704
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
4705
|
-
?
|
|
4736
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === tt)
|
|
4737
|
+
? tt
|
|
4706
4738
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4707
4739
|
}
|
|
4708
|
-
var
|
|
4740
|
+
var tt,
|
|
4709
4741
|
Pe = b(() => {
|
|
4710
4742
|
'use strict';
|
|
4711
4743
|
V();
|
|
4712
|
-
|
|
4744
|
+
tt = 'dynamic';
|
|
4713
4745
|
});
|
|
4714
4746
|
var oe,
|
|
4715
4747
|
Te = b(() => {
|
|
@@ -4722,26 +4754,26 @@ var oe,
|
|
|
4722
4754
|
'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
|
|
4723
4755
|
};
|
|
4724
4756
|
});
|
|
4725
|
-
var
|
|
4757
|
+
var it = b(() => {
|
|
4726
4758
|
'use strict';
|
|
4727
4759
|
});
|
|
4728
|
-
function
|
|
4760
|
+
function rt(e, t) {
|
|
4729
4761
|
return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
|
|
4730
4762
|
}
|
|
4731
4763
|
var gi,
|
|
4732
|
-
|
|
4764
|
+
at = b(() => {
|
|
4733
4765
|
'use strict';
|
|
4734
4766
|
V();
|
|
4735
4767
|
Pe();
|
|
4736
|
-
|
|
4768
|
+
it();
|
|
4737
4769
|
gi = {};
|
|
4738
4770
|
});
|
|
4739
|
-
function
|
|
4771
|
+
function nt(e) {
|
|
4740
4772
|
return e === 'nano-banana-pro' ? hi : yi;
|
|
4741
4773
|
}
|
|
4742
4774
|
var hi,
|
|
4743
4775
|
yi,
|
|
4744
|
-
|
|
4776
|
+
st = b(() => {
|
|
4745
4777
|
'use strict';
|
|
4746
4778
|
((hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
4747
4779
|
(yi = [
|
|
@@ -4762,10 +4794,10 @@ var hi,
|
|
|
4762
4794
|
'21:9',
|
|
4763
4795
|
]));
|
|
4764
4796
|
});
|
|
4765
|
-
var
|
|
4766
|
-
|
|
4797
|
+
var ot,
|
|
4798
|
+
lt = b(() => {
|
|
4767
4799
|
'use strict';
|
|
4768
|
-
|
|
4800
|
+
ot = [
|
|
4769
4801
|
'prompt',
|
|
4770
4802
|
'system',
|
|
4771
4803
|
'messages',
|
|
@@ -4779,10 +4811,10 @@ var st,
|
|
|
4779
4811
|
'endpoint',
|
|
4780
4812
|
];
|
|
4781
4813
|
});
|
|
4782
|
-
var
|
|
4783
|
-
|
|
4814
|
+
var pt,
|
|
4815
|
+
dt = b(() => {
|
|
4784
4816
|
'use strict';
|
|
4785
|
-
|
|
4817
|
+
pt = [
|
|
4786
4818
|
{
|
|
4787
4819
|
slug: 'claude-fable-5-1',
|
|
4788
4820
|
family: 'fable-5-1',
|
|
@@ -4851,11 +4883,11 @@ var lt,
|
|
|
4851
4883
|
},
|
|
4852
4884
|
];
|
|
4853
4885
|
});
|
|
4854
|
-
function
|
|
4886
|
+
function ct(e) {
|
|
4855
4887
|
return `$${e}`;
|
|
4856
4888
|
}
|
|
4857
4889
|
function Me(e, t, i) {
|
|
4858
|
-
return
|
|
4890
|
+
return G(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
4859
4891
|
}
|
|
4860
4892
|
function bi(e) {
|
|
4861
4893
|
return [
|
|
@@ -4923,13 +4955,13 @@ function bi(e) {
|
|
|
4923
4955
|
},
|
|
4924
4956
|
];
|
|
4925
4957
|
}
|
|
4926
|
-
function
|
|
4958
|
+
function ut() {
|
|
4927
4959
|
return Object.fromEntries(
|
|
4928
|
-
|
|
4960
|
+
pt.map((e) => {
|
|
4929
4961
|
let t = Me(e.slug, 'cheap', 'input'),
|
|
4930
4962
|
i = Me(e.slug, 'cheap', 'output'),
|
|
4931
4963
|
r = Me(e.slug, 'stable', 'input') != null,
|
|
4932
|
-
n = t != null && i != null ? `${
|
|
4964
|
+
n = t != null && i != null ? `${ct(t)}/M in \xB7 ${ct(i)}/M out` : '',
|
|
4933
4965
|
s = {
|
|
4934
4966
|
slug: e.slug,
|
|
4935
4967
|
name: e.name,
|
|
@@ -4946,20 +4978,27 @@ function ct() {
|
|
|
4946
4978
|
}),
|
|
4947
4979
|
);
|
|
4948
4980
|
}
|
|
4949
|
-
var
|
|
4981
|
+
var mt = b(() => {
|
|
4950
4982
|
'use strict';
|
|
4951
|
-
|
|
4983
|
+
dt();
|
|
4952
4984
|
V();
|
|
4953
4985
|
});
|
|
4954
|
-
var
|
|
4986
|
+
var J,
|
|
4955
4987
|
le,
|
|
4956
4988
|
Ke = b(() => {
|
|
4957
4989
|
'use strict';
|
|
4958
|
-
((
|
|
4990
|
+
((J = [
|
|
4991
|
+
'seedance-2-5',
|
|
4992
|
+
'seedance-2',
|
|
4993
|
+
'seedance-2-mini',
|
|
4994
|
+
'seedream-5-pro',
|
|
4995
|
+
'wan-3-0',
|
|
4996
|
+
'z-image-pro',
|
|
4997
|
+
]),
|
|
4959
4998
|
(le =
|
|
4960
4999
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
4961
5000
|
});
|
|
4962
|
-
function
|
|
5001
|
+
function z(e) {
|
|
4963
5002
|
return `$${Number(e.toFixed(5))}`;
|
|
4964
5003
|
}
|
|
4965
5004
|
function vi(e) {
|
|
@@ -4975,23 +5014,23 @@ function vi(e) {
|
|
|
4975
5014
|
r = i('input'),
|
|
4976
5015
|
n = i('output');
|
|
4977
5016
|
return r && n
|
|
4978
|
-
? `${
|
|
4979
|
-
: `from ${
|
|
5017
|
+
? `${z(r.price.starter)}/M in \xB7 ${z(n.price.starter)}/M out`
|
|
5018
|
+
: `from ${z(se(e).price.starter)}/M tokens`;
|
|
4980
5019
|
}
|
|
4981
|
-
return `from ${
|
|
5020
|
+
return `from ${z(se(e).price.starter)}${e.unit}`;
|
|
4982
5021
|
}
|
|
4983
5022
|
function Ii(e, t) {
|
|
4984
5023
|
let i = t.filter((r) => Number.isFinite(r) && r > 0);
|
|
4985
|
-
return i.length ? `from ${
|
|
5024
|
+
return i.length ? `from ${z(Math.min(...i))}${e}` : null;
|
|
4986
5025
|
}
|
|
4987
|
-
function
|
|
4988
|
-
for (let t of
|
|
5026
|
+
function yt(e) {
|
|
5027
|
+
for (let t of F) {
|
|
4989
5028
|
let i = de[t],
|
|
4990
5029
|
r = i ? Ii(i.unit, e[t] ?? []) : null;
|
|
4991
5030
|
i && r && (i.priceFormatted = r);
|
|
4992
5031
|
}
|
|
4993
5032
|
}
|
|
4994
|
-
function
|
|
5033
|
+
function N(e, t) {
|
|
4995
5034
|
let i = e.axes?.resolution ?? [
|
|
4996
5035
|
...new Set(e.variants.map((r) => r.resolution).filter((r) => !!r)),
|
|
4997
5036
|
];
|
|
@@ -5003,9 +5042,9 @@ function H(e, t) {
|
|
|
5003
5042
|
...(t ? { description: t } : {}),
|
|
5004
5043
|
};
|
|
5005
5044
|
}
|
|
5006
|
-
function
|
|
5045
|
+
function bt(e) {
|
|
5007
5046
|
if (!e.endpoints?.length) return null;
|
|
5008
|
-
let t = e.endpoints.filter((i) =>
|
|
5047
|
+
let t = e.endpoints.filter((i) => rt(e.slug, i.id));
|
|
5009
5048
|
return {
|
|
5010
5049
|
name: 'endpoint',
|
|
5011
5050
|
type: 'select',
|
|
@@ -5020,15 +5059,15 @@ function yt(e) {
|
|
|
5020
5059
|
}
|
|
5021
5060
|
function Ti(e, t) {
|
|
5022
5061
|
if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
|
|
5023
|
-
let i =
|
|
5024
|
-
return [...t.filter((r) => !Ee.has(r.name)), i ?
|
|
5062
|
+
let i = J.includes(e.api.model);
|
|
5063
|
+
return [...t.filter((r) => !Ee.has(r.name)), i ? wt : _i];
|
|
5025
5064
|
}
|
|
5026
5065
|
function Se(e, t) {
|
|
5027
5066
|
let i = e.filter((n) => !Ee.has(n.name)),
|
|
5028
|
-
r = [
|
|
5029
|
-
return (r.push(
|
|
5067
|
+
r = [wt, Pi];
|
|
5068
|
+
return (r.push(kt, xt), [...i, ...r]);
|
|
5030
5069
|
}
|
|
5031
|
-
function
|
|
5070
|
+
function ft(e, t = {}) {
|
|
5032
5071
|
return [
|
|
5033
5072
|
...e
|
|
5034
5073
|
.filter((i) => !Mi.has(i.name) && !Ee.has(i.name))
|
|
@@ -5052,8 +5091,8 @@ function mt(e, t = {}) {
|
|
|
5052
5091
|
options: ['standard'],
|
|
5053
5092
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5054
5093
|
},
|
|
5055
|
-
wt,
|
|
5056
5094
|
kt,
|
|
5095
|
+
xt,
|
|
5057
5096
|
];
|
|
5058
5097
|
}
|
|
5059
5098
|
function $e(e, t) {
|
|
@@ -5068,7 +5107,7 @@ function $e(e, t) {
|
|
|
5068
5107
|
max: t.maxSec,
|
|
5069
5108
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
5070
5109
|
},
|
|
5071
|
-
|
|
5110
|
+
N(e),
|
|
5072
5111
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
5073
5112
|
...t.references.map((i) =>
|
|
5074
5113
|
i.endsWith('s')
|
|
@@ -5086,7 +5125,7 @@ function $e(e, t) {
|
|
|
5086
5125
|
];
|
|
5087
5126
|
}
|
|
5088
5127
|
function Ki(e) {
|
|
5089
|
-
let t =
|
|
5128
|
+
let t = bt(e);
|
|
5090
5129
|
return [
|
|
5091
5130
|
$('Image prompt text. Supports complex composition and text instructions.'),
|
|
5092
5131
|
...(t ? [t] : []),
|
|
@@ -5096,17 +5135,17 @@ function Ki(e) {
|
|
|
5096
5135
|
default: 'low',
|
|
5097
5136
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
5098
5137
|
},
|
|
5099
|
-
|
|
5138
|
+
N(
|
|
5100
5139
|
e,
|
|
5101
5140
|
e.slug === 'gpt-image-2'
|
|
5102
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
5141
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ye}`
|
|
5103
5142
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
5104
5143
|
),
|
|
5105
5144
|
{
|
|
5106
5145
|
name: 'aspect_ratio',
|
|
5107
5146
|
type: 'select',
|
|
5108
5147
|
default: 'auto',
|
|
5109
|
-
options: [...
|
|
5148
|
+
options: [...We],
|
|
5110
5149
|
description:
|
|
5111
5150
|
"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
5151
|
},
|
|
@@ -5161,8 +5200,8 @@ function Si(e) {
|
|
|
5161
5200
|
type: 'string[]',
|
|
5162
5201
|
description: 'Images to edit or use as reference (up to 14).',
|
|
5163
5202
|
},
|
|
5164
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
5165
|
-
|
|
5203
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...nt(e.slug)] },
|
|
5204
|
+
N(e),
|
|
5166
5205
|
{
|
|
5167
5206
|
name: 'n',
|
|
5168
5207
|
type: 'slider',
|
|
@@ -5188,9 +5227,9 @@ function Si(e) {
|
|
|
5188
5227
|
];
|
|
5189
5228
|
}
|
|
5190
5229
|
function qi() {
|
|
5191
|
-
let e =
|
|
5230
|
+
let e = ot,
|
|
5192
5231
|
t = [];
|
|
5193
|
-
for (let i of
|
|
5232
|
+
for (let i of qe(!0))
|
|
5194
5233
|
e.includes(i.name) &&
|
|
5195
5234
|
(t.push({
|
|
5196
5235
|
...i,
|
|
@@ -5212,7 +5251,12 @@ function qi() {
|
|
|
5212
5251
|
}));
|
|
5213
5252
|
return t;
|
|
5214
5253
|
}
|
|
5215
|
-
function
|
|
5254
|
+
function Ai() {
|
|
5255
|
+
return qe(!0).map((e) =>
|
|
5256
|
+
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5257
|
+
);
|
|
5258
|
+
}
|
|
5259
|
+
function qe(e) {
|
|
5216
5260
|
return [
|
|
5217
5261
|
$('The user message or task.'),
|
|
5218
5262
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -5307,33 +5351,35 @@ function xt(e) {
|
|
|
5307
5351
|
},
|
|
5308
5352
|
];
|
|
5309
5353
|
}
|
|
5310
|
-
function
|
|
5354
|
+
function Ri(e) {
|
|
5311
5355
|
if (e.slug === 'seed-2-1-turbo') return Ci;
|
|
5312
|
-
let t =
|
|
5356
|
+
let t = bt(e);
|
|
5313
5357
|
return [
|
|
5314
5358
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5315
5359
|
? qi()
|
|
5316
|
-
: e.slug === '
|
|
5317
|
-
?
|
|
5318
|
-
:
|
|
5360
|
+
: e.slug === 'gemini-3.7-flash'
|
|
5361
|
+
? Ai()
|
|
5362
|
+
: e.slug === 'gpt-6-astra' || Ei.includes(e.slug)
|
|
5363
|
+
? qe(e.slug !== 'gpt-6-astra')
|
|
5364
|
+
: $i),
|
|
5319
5365
|
...(t ? [t] : []),
|
|
5320
5366
|
];
|
|
5321
5367
|
}
|
|
5322
|
-
function
|
|
5368
|
+
function Oi(e) {
|
|
5323
5369
|
let t = e.slug;
|
|
5324
|
-
if (e.kind === 'llm') return
|
|
5370
|
+
if (e.kind === 'llm') return Ri(e);
|
|
5325
5371
|
if (e.editVariants?.length) return Ki(e);
|
|
5326
5372
|
switch (t) {
|
|
5327
5373
|
case 'seedance-2-5':
|
|
5328
|
-
return Se(
|
|
5374
|
+
return Se(gt, t);
|
|
5329
5375
|
case 'seedance-2-5-lite':
|
|
5330
|
-
return
|
|
5376
|
+
return ft(gt, { no4k: !0 });
|
|
5331
5377
|
case 'seedance-2':
|
|
5332
|
-
return Se(
|
|
5378
|
+
return Se(ht, t);
|
|
5333
5379
|
case 'seedance-2-lite':
|
|
5334
|
-
return
|
|
5380
|
+
return ft(ht);
|
|
5335
5381
|
case 'seedance-2-mini':
|
|
5336
|
-
return Se(
|
|
5382
|
+
return Se(Di, t);
|
|
5337
5383
|
case 'nano-banana-2':
|
|
5338
5384
|
case 'nano-banana-2.1':
|
|
5339
5385
|
case 'nano-banana-pro':
|
|
@@ -5342,7 +5388,7 @@ function Ri(e) {
|
|
|
5342
5388
|
return [
|
|
5343
5389
|
$('Detailed description of the image to generate.'),
|
|
5344
5390
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
5345
|
-
|
|
5391
|
+
N(e),
|
|
5346
5392
|
{
|
|
5347
5393
|
name: 'aspect_ratio',
|
|
5348
5394
|
type: 'select',
|
|
@@ -5360,7 +5406,7 @@ function Ri(e) {
|
|
|
5360
5406
|
type: 'string[]',
|
|
5361
5407
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
5362
5408
|
},
|
|
5363
|
-
|
|
5409
|
+
N(e),
|
|
5364
5410
|
{
|
|
5365
5411
|
name: 'aspect_ratio',
|
|
5366
5412
|
type: 'select',
|
|
@@ -5376,6 +5422,38 @@ function Ri(e) {
|
|
|
5376
5422
|
description: 'Number of images. Each image is billed.',
|
|
5377
5423
|
},
|
|
5378
5424
|
];
|
|
5425
|
+
case 'z-image-pro':
|
|
5426
|
+
return [
|
|
5427
|
+
$('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
5428
|
+
N(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
5429
|
+
{
|
|
5430
|
+
name: 'aspect_ratio',
|
|
5431
|
+
type: 'select',
|
|
5432
|
+
default: '1:1',
|
|
5433
|
+
options: ['1:1', '16:9', '9:16', '4:3', '3:4', '3:2', '2:3', '21:9', '9:21'],
|
|
5434
|
+
},
|
|
5435
|
+
{
|
|
5436
|
+
name: 'n',
|
|
5437
|
+
type: 'slider',
|
|
5438
|
+
default: 1,
|
|
5439
|
+
min: 1,
|
|
5440
|
+
max: 10,
|
|
5441
|
+
description: 'Number of images (1-10). Each image is billed.',
|
|
5442
|
+
},
|
|
5443
|
+
{
|
|
5444
|
+
name: 'seed',
|
|
5445
|
+
type: 'number',
|
|
5446
|
+
min: 0,
|
|
5447
|
+
max: 2147483647,
|
|
5448
|
+
description: 'Random seed. The same seed does not guarantee identical results.',
|
|
5449
|
+
},
|
|
5450
|
+
{
|
|
5451
|
+
name: 'prompt_expansion',
|
|
5452
|
+
type: 'boolean',
|
|
5453
|
+
default: !1,
|
|
5454
|
+
description: 'Let the model expand and refine the prompt before generating.',
|
|
5455
|
+
},
|
|
5456
|
+
];
|
|
5379
5457
|
case 'seed-audio-1-0':
|
|
5380
5458
|
return [
|
|
5381
5459
|
{
|
|
@@ -5443,10 +5521,10 @@ function Ce(e, t = e.api.model) {
|
|
|
5443
5521
|
priceFormatted: vi(e),
|
|
5444
5522
|
unit: e.unit,
|
|
5445
5523
|
primaryToolName: ki[e.kind],
|
|
5446
|
-
parameters: Ti(e,
|
|
5524
|
+
parameters: Ti(e, Oi(e)),
|
|
5447
5525
|
};
|
|
5448
5526
|
}
|
|
5449
|
-
function
|
|
5527
|
+
function Li() {
|
|
5450
5528
|
let e = {};
|
|
5451
5529
|
for (let t of ne())
|
|
5452
5530
|
if (t.slug !== 'seedance-2-fast') {
|
|
@@ -5462,15 +5540,15 @@ function Di() {
|
|
|
5462
5540
|
}
|
|
5463
5541
|
t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
|
|
5464
5542
|
}
|
|
5465
|
-
Object.assign(e,
|
|
5543
|
+
Object.assign(e, ut());
|
|
5466
5544
|
for (let [t, i] of Object.entries(oe))
|
|
5467
5545
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
5468
5546
|
return e;
|
|
5469
5547
|
}
|
|
5470
|
-
function
|
|
5548
|
+
function U(e) {
|
|
5471
5549
|
return de[e] ?? null;
|
|
5472
5550
|
}
|
|
5473
|
-
function
|
|
5551
|
+
function Vi(e, t, i) {
|
|
5474
5552
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5475
5553
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5476
5554
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
@@ -5481,13 +5559,13 @@ function _t(e, t) {
|
|
|
5481
5559
|
let i = { ...t };
|
|
5482
5560
|
if (e?.slug === 'seedance-2-5') {
|
|
5483
5561
|
let r = (n) => typeof n != 'string' || !n.trim();
|
|
5484
|
-
for (let n of
|
|
5562
|
+
for (let n of Ni) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
5485
5563
|
if (!r(i.finalize)) return i;
|
|
5486
5564
|
}
|
|
5487
5565
|
for (let r of e?.parameters ?? [])
|
|
5488
5566
|
r.default !== void 0 &&
|
|
5489
5567
|
i[r.name] === void 0 &&
|
|
5490
|
-
|
|
5568
|
+
Vi(e.slug, r.name, t) &&
|
|
5491
5569
|
(i[r.name] = r.default);
|
|
5492
5570
|
return i;
|
|
5493
5571
|
}
|
|
@@ -5498,35 +5576,35 @@ var wi,
|
|
|
5498
5576
|
ki,
|
|
5499
5577
|
xi,
|
|
5500
5578
|
$,
|
|
5501
|
-
|
|
5579
|
+
wt,
|
|
5502
5580
|
_i,
|
|
5503
5581
|
Pi,
|
|
5504
|
-
wt,
|
|
5505
5582
|
kt,
|
|
5583
|
+
xt,
|
|
5506
5584
|
Ee,
|
|
5507
5585
|
Mi,
|
|
5508
5586
|
$i,
|
|
5509
5587
|
Ci,
|
|
5510
5588
|
Ei,
|
|
5511
5589
|
pe,
|
|
5512
|
-
|
|
5590
|
+
gt,
|
|
5513
5591
|
vt,
|
|
5514
5592
|
It,
|
|
5515
|
-
|
|
5516
|
-
|
|
5593
|
+
ht,
|
|
5594
|
+
Di,
|
|
5517
5595
|
de,
|
|
5518
|
-
|
|
5519
|
-
|
|
5596
|
+
Ni,
|
|
5597
|
+
H = b(() => {
|
|
5520
5598
|
'use strict';
|
|
5521
|
-
|
|
5599
|
+
Qe();
|
|
5522
5600
|
be();
|
|
5523
5601
|
V();
|
|
5524
5602
|
Pe();
|
|
5525
5603
|
Te();
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5604
|
+
at();
|
|
5605
|
+
st();
|
|
5606
|
+
lt();
|
|
5607
|
+
mt();
|
|
5530
5608
|
Ke();
|
|
5531
5609
|
((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5532
5610
|
(ki = {
|
|
@@ -5542,7 +5620,7 @@ var wi,
|
|
|
5542
5620
|
llm: 'Reasoning (LLM)',
|
|
5543
5621
|
}));
|
|
5544
5622
|
$ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5545
|
-
((
|
|
5623
|
+
((wt = {
|
|
5546
5624
|
name: 'creative_mode',
|
|
5547
5625
|
type: 'boolean',
|
|
5548
5626
|
default: !1,
|
|
@@ -5561,12 +5639,12 @@ var wi,
|
|
|
5561
5639
|
default: !1,
|
|
5562
5640
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5563
5641
|
}),
|
|
5564
|
-
(
|
|
5642
|
+
(kt = {
|
|
5565
5643
|
name: 'reference_roles',
|
|
5566
5644
|
type: 'json',
|
|
5567
5645
|
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
5646
|
}),
|
|
5569
|
-
(
|
|
5647
|
+
(xt = {
|
|
5570
5648
|
name: 'auto_fit_images',
|
|
5571
5649
|
type: 'boolean',
|
|
5572
5650
|
default: !1,
|
|
@@ -5685,7 +5763,7 @@ var wi,
|
|
|
5685
5763
|
]),
|
|
5686
5764
|
(Ei = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5687
5765
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5688
|
-
(
|
|
5766
|
+
(gt = [
|
|
5689
5767
|
{
|
|
5690
5768
|
name: 'prompt',
|
|
5691
5769
|
type: 'string',
|
|
@@ -5846,7 +5924,7 @@ var wi,
|
|
|
5846
5924
|
description:
|
|
5847
5925
|
'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
5926
|
}),
|
|
5849
|
-
(
|
|
5927
|
+
(ht = [
|
|
5850
5928
|
{
|
|
5851
5929
|
name: 'prompt',
|
|
5852
5930
|
type: 'string',
|
|
@@ -5946,7 +6024,7 @@ var wi,
|
|
|
5946
6024
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5947
6025
|
},
|
|
5948
6026
|
]),
|
|
5949
|
-
(
|
|
6027
|
+
(Di = [
|
|
5950
6028
|
{
|
|
5951
6029
|
name: 'prompt',
|
|
5952
6030
|
type: 'string',
|
|
@@ -6017,15 +6095,15 @@ var wi,
|
|
|
6017
6095
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6018
6096
|
},
|
|
6019
6097
|
]));
|
|
6020
|
-
de =
|
|
6021
|
-
|
|
6098
|
+
de = Li();
|
|
6099
|
+
Ni = ['draft_task_id', 'draft_generation_id'];
|
|
6022
6100
|
});
|
|
6023
6101
|
function ce(e) {
|
|
6024
6102
|
let t = '/v1/pricing/models',
|
|
6025
6103
|
i = e?.trim();
|
|
6026
6104
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
6027
6105
|
}
|
|
6028
|
-
var
|
|
6106
|
+
var Re = b(() => {
|
|
6029
6107
|
'use strict';
|
|
6030
6108
|
});
|
|
6031
6109
|
function Rt(e) {
|
|
@@ -6033,8 +6111,8 @@ function Rt(e) {
|
|
|
6033
6111
|
}
|
|
6034
6112
|
function Ot(e) {
|
|
6035
6113
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
6036
|
-
i = t.filter((s) =>
|
|
6037
|
-
r = t.filter((s) => !
|
|
6114
|
+
i = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
|
|
6115
|
+
r = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
|
|
6038
6116
|
return [
|
|
6039
6117
|
...(i.length
|
|
6040
6118
|
? [`${Rt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
@@ -6043,14 +6121,14 @@ function Ot(e) {
|
|
|
6043
6121
|
'The Acceptable Use Policy applies.',
|
|
6044
6122
|
].join(' ');
|
|
6045
6123
|
}
|
|
6046
|
-
function
|
|
6047
|
-
if (
|
|
6124
|
+
function pr(e) {
|
|
6125
|
+
if (or.has(e.name)) return e;
|
|
6048
6126
|
let t = e.inputSchema.properties;
|
|
6049
6127
|
return !t || t.callback_url
|
|
6050
6128
|
? e
|
|
6051
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
6129
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: sr } } };
|
|
6052
6130
|
}
|
|
6053
|
-
function
|
|
6131
|
+
function dr(e) {
|
|
6054
6132
|
let t = e.inputSchema.properties;
|
|
6055
6133
|
if (!t) return e;
|
|
6056
6134
|
let i = !1,
|
|
@@ -6063,7 +6141,7 @@ function pr(e) {
|
|
|
6063
6141
|
: (r[n] = s);
|
|
6064
6142
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
6065
6143
|
}
|
|
6066
|
-
function
|
|
6144
|
+
function cr(e) {
|
|
6067
6145
|
switch (e.type) {
|
|
6068
6146
|
case 'string':
|
|
6069
6147
|
return {
|
|
@@ -6118,11 +6196,11 @@ function dr(e) {
|
|
|
6118
6196
|
return { type: 'string', description: e.description };
|
|
6119
6197
|
}
|
|
6120
6198
|
}
|
|
6121
|
-
function
|
|
6199
|
+
function ur(e, t) {
|
|
6122
6200
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
6123
6201
|
r = {},
|
|
6124
6202
|
n = [];
|
|
6125
|
-
for (let o of e.parameters) ((r[o.name] =
|
|
6203
|
+
for (let o of e.parameters) ((r[o.name] = cr(o)), o.required && n.push(o.name));
|
|
6126
6204
|
let s = {
|
|
6127
6205
|
type: 'object',
|
|
6128
6206
|
properties: r,
|
|
@@ -6135,7 +6213,7 @@ function cr(e, t) {
|
|
|
6135
6213
|
inputSchema: s,
|
|
6136
6214
|
};
|
|
6137
6215
|
}
|
|
6138
|
-
function
|
|
6216
|
+
function mr() {
|
|
6139
6217
|
let e = q().filter((d) => d.category === 'Image'),
|
|
6140
6218
|
t = q().filter((d) => d.category === 'Video'),
|
|
6141
6219
|
i = q().filter((d) => d.category === 'Text'),
|
|
@@ -6390,10 +6468,10 @@ function ur() {
|
|
|
6390
6468
|
additionalProperties: !0,
|
|
6391
6469
|
},
|
|
6392
6470
|
},
|
|
6393
|
-
p =
|
|
6394
|
-
return [n, s, o, u, l, p, c,
|
|
6471
|
+
p = fr();
|
|
6472
|
+
return [n, s, o, u, l, p, c, lr];
|
|
6395
6473
|
}
|
|
6396
|
-
function
|
|
6474
|
+
function fr() {
|
|
6397
6475
|
return {
|
|
6398
6476
|
name: 'upload_asset',
|
|
6399
6477
|
description:
|
|
@@ -6440,26 +6518,26 @@ function mr() {
|
|
|
6440
6518
|
},
|
|
6441
6519
|
};
|
|
6442
6520
|
}
|
|
6443
|
-
function
|
|
6444
|
-
let e =
|
|
6445
|
-
t = q().map((i) =>
|
|
6446
|
-
return [...e, ...t].map(
|
|
6521
|
+
function Ue() {
|
|
6522
|
+
let e = mr(),
|
|
6523
|
+
t = q().map((i) => ur(i));
|
|
6524
|
+
return [...e, ...t].map(pr).map(dr);
|
|
6447
6525
|
}
|
|
6448
|
-
var
|
|
6449
|
-
sr,
|
|
6526
|
+
var sr,
|
|
6450
6527
|
or,
|
|
6528
|
+
lr,
|
|
6451
6529
|
Dt,
|
|
6452
6530
|
Lt = b(() => {
|
|
6453
6531
|
'use strict';
|
|
6454
6532
|
V();
|
|
6455
6533
|
Ke();
|
|
6456
|
-
|
|
6457
|
-
((
|
|
6534
|
+
H();
|
|
6535
|
+
((sr = {
|
|
6458
6536
|
type: 'string',
|
|
6459
6537
|
description:
|
|
6460
6538
|
'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
6539
|
}),
|
|
6462
|
-
(
|
|
6540
|
+
(or = new Set([
|
|
6463
6541
|
'upload_asset',
|
|
6464
6542
|
'upload_media',
|
|
6465
6543
|
'upload_image',
|
|
@@ -6467,7 +6545,7 @@ var nr,
|
|
|
6467
6545
|
'check_status',
|
|
6468
6546
|
'get_pricing',
|
|
6469
6547
|
])),
|
|
6470
|
-
(
|
|
6548
|
+
(lr = {
|
|
6471
6549
|
name: 'get_pricing',
|
|
6472
6550
|
description:
|
|
6473
6551
|
'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.',
|
|
@@ -6499,14 +6577,14 @@ var nr,
|
|
|
6499
6577
|
'lipsyncing_audio',
|
|
6500
6578
|
]);
|
|
6501
6579
|
});
|
|
6502
|
-
var
|
|
6503
|
-
ii(
|
|
6504
|
-
forgetToolSchemas: () =>
|
|
6580
|
+
var Ht = {};
|
|
6581
|
+
ii(Ht, {
|
|
6582
|
+
forgetToolSchemas: () => wr,
|
|
6505
6583
|
jsonRpcAnswer: () => jt,
|
|
6506
6584
|
preprocessLocalFiles: () => Jt,
|
|
6507
|
-
startStdioServer: () =>
|
|
6585
|
+
startStdioServer: () => zt,
|
|
6508
6586
|
});
|
|
6509
|
-
function
|
|
6587
|
+
function gr(e) {
|
|
6510
6588
|
let t = (i) =>
|
|
6511
6589
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6512
6590
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
@@ -6520,7 +6598,7 @@ function jt(e, t, i) {
|
|
|
6520
6598
|
} catch {
|
|
6521
6599
|
s = null;
|
|
6522
6600
|
}
|
|
6523
|
-
if (s !== null &&
|
|
6601
|
+
if (s !== null && gr(s)) return n ? null : s;
|
|
6524
6602
|
if (n) return null;
|
|
6525
6603
|
if (!i && t >= 200 && t < 300) return;
|
|
6526
6604
|
let o = s?.error,
|
|
@@ -6541,13 +6619,13 @@ function jt(e, t, i) {
|
|
|
6541
6619
|
},
|
|
6542
6620
|
};
|
|
6543
6621
|
}
|
|
6544
|
-
function
|
|
6622
|
+
function hr() {
|
|
6545
6623
|
let e = process.argv.slice(2),
|
|
6546
6624
|
t = e.indexOf('--api-key');
|
|
6547
6625
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6548
6626
|
}
|
|
6549
6627
|
async function Bt(e, t, i) {
|
|
6550
|
-
let r =
|
|
6628
|
+
let r = j.default.resolve(e);
|
|
6551
6629
|
if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
|
|
6552
6630
|
throw new Error(`File not found: ${e}`);
|
|
6553
6631
|
let n = R.default.readFileSync(r),
|
|
@@ -6576,14 +6654,14 @@ async function Bt(e, t, i) {
|
|
|
6576
6654
|
};
|
|
6577
6655
|
}
|
|
6578
6656
|
function Ft(e) {
|
|
6579
|
-
return
|
|
6657
|
+
return yr.has(j.default.extname(e).toLowerCase());
|
|
6580
6658
|
}
|
|
6581
6659
|
function Gt(e) {
|
|
6582
6660
|
return new Error(
|
|
6583
|
-
`Tein uploads image, video and audio files only, and ${
|
|
6661
|
+
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
6584
6662
|
);
|
|
6585
6663
|
}
|
|
6586
|
-
function
|
|
6664
|
+
function br(e) {
|
|
6587
6665
|
let t = e.trim();
|
|
6588
6666
|
if (
|
|
6589
6667
|
!t ||
|
|
@@ -6593,10 +6671,10 @@ function yr(e) {
|
|
|
6593
6671
|
`)
|
|
6594
6672
|
)
|
|
6595
6673
|
return null;
|
|
6596
|
-
let i =
|
|
6674
|
+
let i = j.default.resolve(t);
|
|
6597
6675
|
return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
|
|
6598
6676
|
}
|
|
6599
|
-
function
|
|
6677
|
+
function Be(e) {
|
|
6600
6678
|
if (Array.isArray(e))
|
|
6601
6679
|
for (let t of e) {
|
|
6602
6680
|
let i = t;
|
|
@@ -6606,12 +6684,12 @@ function je(e) {
|
|
|
6606
6684
|
Q.set(i.name, i.inputSchema);
|
|
6607
6685
|
}
|
|
6608
6686
|
}
|
|
6609
|
-
function
|
|
6610
|
-
(Q.clear(), (
|
|
6687
|
+
function wr() {
|
|
6688
|
+
(Q.clear(), (je = 0));
|
|
6611
6689
|
}
|
|
6612
|
-
async function
|
|
6613
|
-
if (!(Date.now() -
|
|
6614
|
-
|
|
6690
|
+
async function kr(e, t) {
|
|
6691
|
+
if (!(Date.now() - je < 6e4)) {
|
|
6692
|
+
je = Date.now();
|
|
6615
6693
|
try {
|
|
6616
6694
|
let r = await (
|
|
6617
6695
|
await fetch(e, {
|
|
@@ -6621,11 +6699,11 @@ async function wr(e, t) {
|
|
|
6621
6699
|
signal: AbortSignal.timeout(1e4),
|
|
6622
6700
|
})
|
|
6623
6701
|
).json();
|
|
6624
|
-
|
|
6702
|
+
Be(r.result?.tools);
|
|
6625
6703
|
} catch {}
|
|
6626
6704
|
}
|
|
6627
6705
|
}
|
|
6628
|
-
function
|
|
6706
|
+
function xr(e) {
|
|
6629
6707
|
return e
|
|
6630
6708
|
? e.type === 'string'
|
|
6631
6709
|
? e.format === 'uri'
|
|
@@ -6634,18 +6712,18 @@ function kr(e) {
|
|
|
6634
6712
|
}
|
|
6635
6713
|
async function Vt(e, t, i) {
|
|
6636
6714
|
if (typeof e != 'string') return e;
|
|
6637
|
-
let r =
|
|
6715
|
+
let r = br(e);
|
|
6638
6716
|
if (!r) return e;
|
|
6639
6717
|
if (!Ft(r)) throw Gt(r);
|
|
6640
6718
|
return (await Bt(r, t, i)).url;
|
|
6641
6719
|
}
|
|
6642
6720
|
async function Jt(e, t, i, r, n) {
|
|
6643
|
-
(Q.size === 0 &&
|
|
6721
|
+
(Q.size === 0 && Be(Ue()), Q.has(e) || (await kr(n, i)));
|
|
6644
6722
|
let s = Q.get(e)?.properties;
|
|
6645
6723
|
if (!s) return t;
|
|
6646
6724
|
let o = { ...t };
|
|
6647
6725
|
for (let [u, l] of Object.entries(t))
|
|
6648
|
-
if (
|
|
6726
|
+
if (xr(s[u]))
|
|
6649
6727
|
if (Array.isArray(l)) {
|
|
6650
6728
|
let c = [];
|
|
6651
6729
|
for (let p of l) c.push(await Vt(p, i, r));
|
|
@@ -6653,7 +6731,7 @@ async function Jt(e, t, i, r, n) {
|
|
|
6653
6731
|
} else o[u] = await Vt(l, i, r);
|
|
6654
6732
|
return o;
|
|
6655
6733
|
}
|
|
6656
|
-
function
|
|
6734
|
+
function vr(e) {
|
|
6657
6735
|
let t = e.id ?? null;
|
|
6658
6736
|
switch (e.method) {
|
|
6659
6737
|
case 'initialize':
|
|
@@ -6671,7 +6749,7 @@ function xr(e) {
|
|
|
6671
6749
|
case 'ping':
|
|
6672
6750
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
6673
6751
|
case 'tools/list':
|
|
6674
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
6752
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ue() } };
|
|
6675
6753
|
case 'tools/call':
|
|
6676
6754
|
return {
|
|
6677
6755
|
jsonrpc: '2.0',
|
|
@@ -6694,10 +6772,10 @@ function xr(e) {
|
|
|
6694
6772
|
};
|
|
6695
6773
|
}
|
|
6696
6774
|
}
|
|
6697
|
-
async function
|
|
6775
|
+
async function zt() {
|
|
6698
6776
|
if (Nt) return;
|
|
6699
6777
|
Nt = !0;
|
|
6700
|
-
let e =
|
|
6778
|
+
let e = hr(),
|
|
6701
6779
|
t = x(),
|
|
6702
6780
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6703
6781
|
(Ut.default
|
|
@@ -6759,7 +6837,7 @@ async function Ht() {
|
|
|
6759
6837
|
!p.startsWith('data:')
|
|
6760
6838
|
)
|
|
6761
6839
|
try {
|
|
6762
|
-
let d =
|
|
6840
|
+
let d = j.default.resolve(p.trim());
|
|
6763
6841
|
if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
|
|
6764
6842
|
if (!Ft(d)) throw Gt(d);
|
|
6765
6843
|
let m = await Bt(d, e, t),
|
|
@@ -6852,7 +6930,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6852
6930
|
p = jt(o, l.status, c);
|
|
6853
6931
|
if (p === null) return;
|
|
6854
6932
|
if (p) {
|
|
6855
|
-
(o?.method === 'tools/list' &&
|
|
6933
|
+
(o?.method === 'tools/list' && Be(p.result?.tools),
|
|
6856
6934
|
process.stdout.write(
|
|
6857
6935
|
JSON.stringify(p) +
|
|
6858
6936
|
`
|
|
@@ -6861,7 +6939,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6861
6939
|
return;
|
|
6862
6940
|
}
|
|
6863
6941
|
} catch {}
|
|
6864
|
-
let u =
|
|
6942
|
+
let u = vr(o);
|
|
6865
6943
|
u !== null &&
|
|
6866
6944
|
process.stdout.write(
|
|
6867
6945
|
JSON.stringify(u) +
|
|
@@ -6885,21 +6963,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6885
6963
|
`));
|
|
6886
6964
|
}
|
|
6887
6965
|
var R,
|
|
6888
|
-
|
|
6966
|
+
j,
|
|
6889
6967
|
Ut,
|
|
6890
|
-
|
|
6968
|
+
yr,
|
|
6891
6969
|
Q,
|
|
6892
|
-
|
|
6970
|
+
je,
|
|
6893
6971
|
Nt,
|
|
6894
6972
|
Wt = b(() => {
|
|
6895
6973
|
'use strict';
|
|
6896
6974
|
((R = I(require('node:fs'))),
|
|
6897
|
-
(
|
|
6975
|
+
(j = I(require('node:path'))),
|
|
6898
6976
|
(Ut = I(require('node:readline'))));
|
|
6899
|
-
|
|
6977
|
+
Re();
|
|
6900
6978
|
Lt();
|
|
6901
6979
|
E();
|
|
6902
|
-
|
|
6980
|
+
yr = new Set([
|
|
6903
6981
|
'.png',
|
|
6904
6982
|
'.jpg',
|
|
6905
6983
|
'.jpeg',
|
|
@@ -6925,10 +7003,10 @@ var R,
|
|
|
6925
7003
|
'.flac',
|
|
6926
7004
|
'.opus',
|
|
6927
7005
|
]);
|
|
6928
|
-
((Q = new Map()), (
|
|
7006
|
+
((Q = new Map()), (je = 0));
|
|
6929
7007
|
Nt = !1;
|
|
6930
7008
|
require.main === module &&
|
|
6931
|
-
|
|
7009
|
+
zt().catch((e) => {
|
|
6932
7010
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
6933
7011
|
`),
|
|
6934
7012
|
process.exit(1));
|
|
@@ -7025,8 +7103,8 @@ var a = {
|
|
|
7025
7103
|
var O = I(require('node:fs')),
|
|
7026
7104
|
A = I(require('node:path'));
|
|
7027
7105
|
var ee = I(require('node:fs')),
|
|
7028
|
-
|
|
7029
|
-
|
|
7106
|
+
Je = I(require('node:path')),
|
|
7107
|
+
ze = require('node:stream/promises');
|
|
7030
7108
|
var Z = '1.1.7';
|
|
7031
7109
|
var ni = new Set([
|
|
7032
7110
|
'account_suspended',
|
|
@@ -7062,13 +7140,13 @@ function oi(e, t, i) {
|
|
|
7062
7140
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
|
|
7063
7141
|
return new k(e, c, typeof o == 'string' ? o : void 0, l);
|
|
7064
7142
|
}
|
|
7065
|
-
function
|
|
7143
|
+
function Fe(e) {
|
|
7066
7144
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
7067
7145
|
}
|
|
7068
7146
|
function K(e) {
|
|
7069
7147
|
let t = [e.message],
|
|
7070
|
-
i =
|
|
7071
|
-
r =
|
|
7148
|
+
i = Fe(e.fields.required),
|
|
7149
|
+
r = Fe(e.fields.balance);
|
|
7072
7150
|
(i || r) &&
|
|
7073
7151
|
t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
|
|
7074
7152
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -7083,7 +7161,7 @@ function li(e) {
|
|
|
7083
7161
|
? 'audio'
|
|
7084
7162
|
: 'image';
|
|
7085
7163
|
}
|
|
7086
|
-
function
|
|
7164
|
+
function Ge(e) {
|
|
7087
7165
|
let t = [];
|
|
7088
7166
|
for (let i of e.data ?? [])
|
|
7089
7167
|
typeof i.message?.content == 'string'
|
|
@@ -7128,7 +7206,7 @@ var M = class {
|
|
|
7128
7206
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
7129
7207
|
? n
|
|
7130
7208
|
: 'processing',
|
|
7131
|
-
o =
|
|
7209
|
+
o = Ge(r);
|
|
7132
7210
|
return {
|
|
7133
7211
|
request_id: r.request_id || r.id || '',
|
|
7134
7212
|
model: r.model,
|
|
@@ -7146,7 +7224,7 @@ var M = class {
|
|
|
7146
7224
|
r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
|
|
7147
7225
|
? r
|
|
7148
7226
|
: 'processing',
|
|
7149
|
-
s =
|
|
7227
|
+
s = Ge(i),
|
|
7150
7228
|
o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
|
|
7151
7229
|
return {
|
|
7152
7230
|
request_id: i.id || t,
|
|
@@ -7164,10 +7242,10 @@ var M = class {
|
|
|
7164
7242
|
async downloadOutput(t, i) {
|
|
7165
7243
|
let r = await fetch(t);
|
|
7166
7244
|
if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
|
|
7167
|
-
let n =
|
|
7245
|
+
let n = Je.default.dirname(i);
|
|
7168
7246
|
ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
|
|
7169
7247
|
let s = ee.default.createWriteStream(i);
|
|
7170
|
-
return (await (0,
|
|
7248
|
+
return (await (0, ze.pipeline)(r.body, s), i);
|
|
7171
7249
|
}
|
|
7172
7250
|
};
|
|
7173
7251
|
E();
|
|
@@ -7179,30 +7257,30 @@ function ye(e) {
|
|
|
7179
7257
|
r = Math.round(Number((e * i).toFixed(6))) / i;
|
|
7180
7258
|
return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
|
|
7181
7259
|
}
|
|
7182
|
-
|
|
7260
|
+
H();
|
|
7183
7261
|
var Pt = ['images', 'input_images', 'videos', 'audios'];
|
|
7184
|
-
function
|
|
7262
|
+
function Ui(e) {
|
|
7185
7263
|
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7186
7264
|
}
|
|
7187
|
-
function
|
|
7265
|
+
function ji(e) {
|
|
7188
7266
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7189
7267
|
let t = A.default.resolve(e);
|
|
7190
7268
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7191
7269
|
}
|
|
7192
|
-
async function
|
|
7270
|
+
async function Bi(e, t) {
|
|
7193
7271
|
for (let i of Pt) {
|
|
7194
7272
|
if (!Array.isArray(e[i])) continue;
|
|
7195
7273
|
let r = [];
|
|
7196
7274
|
for (let n of e[i]) {
|
|
7197
7275
|
if (typeof n != 'string') continue;
|
|
7198
|
-
let s =
|
|
7276
|
+
let s = ji(n);
|
|
7199
7277
|
r.push(s ? await t(s) : n);
|
|
7200
7278
|
}
|
|
7201
7279
|
e[i] = r;
|
|
7202
7280
|
}
|
|
7203
7281
|
}
|
|
7204
7282
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7205
|
-
function
|
|
7283
|
+
function Fi(e) {
|
|
7206
7284
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7207
7285
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7208
7286
|
i = W.enterprise;
|
|
@@ -7215,7 +7293,7 @@ function Bi(e) {
|
|
|
7215
7293
|
t
|
|
7216
7294
|
);
|
|
7217
7295
|
}
|
|
7218
|
-
async function
|
|
7296
|
+
async function Gi(e, t, i, r, n) {
|
|
7219
7297
|
n.isJson ||
|
|
7220
7298
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7221
7299
|
`);
|
|
@@ -7335,7 +7413,7 @@ function Tt(e) {
|
|
|
7335
7413
|
}
|
|
7336
7414
|
return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
|
|
7337
7415
|
}
|
|
7338
|
-
async function
|
|
7416
|
+
async function Ae(e, t) {
|
|
7339
7417
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7340
7418
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7341
7419
|
(i ||
|
|
@@ -7353,11 +7431,11 @@ async function qe(e, t) {
|
|
|
7353
7431
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
7354
7432
|
`),
|
|
7355
7433
|
process.exit(1)));
|
|
7356
|
-
let n =
|
|
7434
|
+
let n = U(e),
|
|
7357
7435
|
s = !!t.json,
|
|
7358
7436
|
o = !!(t.async || t.no_wait),
|
|
7359
7437
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7360
|
-
l =
|
|
7438
|
+
l = Fi(t),
|
|
7361
7439
|
c = { ...t };
|
|
7362
7440
|
(delete c.json,
|
|
7363
7441
|
delete c.async,
|
|
@@ -7367,7 +7445,7 @@ async function qe(e, t) {
|
|
|
7367
7445
|
delete c.api_url,
|
|
7368
7446
|
delete c.count);
|
|
7369
7447
|
let p = _t(n, c);
|
|
7370
|
-
(
|
|
7448
|
+
(Ui(p),
|
|
7371
7449
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7372
7450
|
p.image_url &&
|
|
7373
7451
|
!p.first_frame_image &&
|
|
@@ -7383,11 +7461,11 @@ async function qe(e, t) {
|
|
|
7383
7461
|
let P = new T(`Uploading local file ${A.default.basename(v)} to CDN...`);
|
|
7384
7462
|
s || P.start();
|
|
7385
7463
|
try {
|
|
7386
|
-
let
|
|
7387
|
-
X = await d.uploadAsset(
|
|
7464
|
+
let B = O.default.readFileSync(v),
|
|
7465
|
+
X = await d.uploadAsset(B.toString('base64'));
|
|
7388
7466
|
((p[y] = X.url), s || P.succeed(`Uploaded ${A.default.basename(v)} to CDN`));
|
|
7389
|
-
} catch (
|
|
7390
|
-
let X =
|
|
7467
|
+
} catch (B) {
|
|
7468
|
+
let X = B instanceof Error ? B.message : String(B);
|
|
7391
7469
|
(s
|
|
7392
7470
|
? process.stdout.write(
|
|
7393
7471
|
JSON.stringify({ error: X }) +
|
|
@@ -7400,7 +7478,7 @@ async function qe(e, t) {
|
|
|
7400
7478
|
}
|
|
7401
7479
|
}
|
|
7402
7480
|
}
|
|
7403
|
-
await
|
|
7481
|
+
await Bi(p, async (y) => {
|
|
7404
7482
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7405
7483
|
s || f.start();
|
|
7406
7484
|
try {
|
|
@@ -7424,7 +7502,7 @@ async function qe(e, t) {
|
|
|
7424
7502
|
let g;
|
|
7425
7503
|
try {
|
|
7426
7504
|
if (l > 1) {
|
|
7427
|
-
await
|
|
7505
|
+
await Gi(d, e, p, l, { isJson: s, isAsync: o });
|
|
7428
7506
|
return;
|
|
7429
7507
|
}
|
|
7430
7508
|
g = await d.queueJob(e, p);
|
|
@@ -7544,7 +7622,7 @@ ${f.text}
|
|
|
7544
7622
|
}
|
|
7545
7623
|
var Mt = I(require('node:readline'));
|
|
7546
7624
|
E();
|
|
7547
|
-
async function
|
|
7625
|
+
async function Ji(e) {
|
|
7548
7626
|
try {
|
|
7549
7627
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7550
7628
|
} catch (t) {
|
|
@@ -7555,7 +7633,7 @@ async function Gi(e) {
|
|
|
7555
7633
|
return 'unchecked';
|
|
7556
7634
|
}
|
|
7557
7635
|
}
|
|
7558
|
-
function
|
|
7636
|
+
function zi(e) {
|
|
7559
7637
|
let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7560
7638
|
return new Promise((i) => {
|
|
7561
7639
|
t.question(e, (r) => {
|
|
@@ -7575,14 +7653,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7575
7653
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7576
7654
|
|
|
7577
7655
|
`),
|
|
7578
|
-
(i = await
|
|
7656
|
+
(i = await zi('Enter your Tein API Key (sk_live_...): '))),
|
|
7579
7657
|
!i.startsWith('sk_live_') &&
|
|
7580
7658
|
!i.startsWith('sk_test_') &&
|
|
7581
7659
|
(process.stderr
|
|
7582
7660
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7583
7661
|
`),
|
|
7584
7662
|
process.exit(1)));
|
|
7585
|
-
let r = await
|
|
7663
|
+
let r = await Ji(i);
|
|
7586
7664
|
(r === 'invalid' &&
|
|
7587
7665
|
(process.stderr
|
|
7588
7666
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -7653,7 +7731,7 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7653
7731
|
}
|
|
7654
7732
|
E();
|
|
7655
7733
|
be();
|
|
7656
|
-
|
|
7734
|
+
H();
|
|
7657
7735
|
var Hi = 3e3;
|
|
7658
7736
|
async function Kt(e) {
|
|
7659
7737
|
try {
|
|
@@ -7663,20 +7741,20 @@ async function Kt(e) {
|
|
|
7663
7741
|
r = {};
|
|
7664
7742
|
for (let n of i.configs ?? []) {
|
|
7665
7743
|
let s = String(n.modelSlug ?? '');
|
|
7666
|
-
|
|
7744
|
+
F.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7667
7745
|
}
|
|
7668
|
-
|
|
7746
|
+
yt(r);
|
|
7669
7747
|
} catch {}
|
|
7670
7748
|
}
|
|
7671
|
-
var
|
|
7672
|
-
|
|
7749
|
+
var Wi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7750
|
+
Yi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7673
7751
|
async function St(e, t) {
|
|
7674
7752
|
await Kt(t);
|
|
7675
7753
|
let i = q();
|
|
7676
7754
|
if (e) {
|
|
7677
7755
|
let s = e.toLowerCase(),
|
|
7678
|
-
o =
|
|
7679
|
-
i =
|
|
7756
|
+
o = Yi[s] ?? s;
|
|
7757
|
+
i = Wi.has(o)
|
|
7680
7758
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7681
7759
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7682
7760
|
}
|
|
@@ -7715,8 +7793,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7715
7793
|
`);
|
|
7716
7794
|
}
|
|
7717
7795
|
async function $t(e, t) {
|
|
7718
|
-
|
|
7719
|
-
let i =
|
|
7796
|
+
F.has(e) && (await Kt(t));
|
|
7797
|
+
let i = U(e);
|
|
7720
7798
|
(i ||
|
|
7721
7799
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
7722
7800
|
`),
|
|
@@ -7796,9 +7874,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7796
7874
|
`);
|
|
7797
7875
|
}
|
|
7798
7876
|
E();
|
|
7799
|
-
|
|
7800
|
-
var
|
|
7801
|
-
|
|
7877
|
+
Re();
|
|
7878
|
+
var Qi = 1e4,
|
|
7879
|
+
De = {
|
|
7802
7880
|
price: '',
|
|
7803
7881
|
creativeMode: 'Creative mode',
|
|
7804
7882
|
priority: 'Priority',
|
|
@@ -7808,22 +7886,22 @@ var Yi = 1e4,
|
|
|
7808
7886
|
priorityDraft: 'Priority + Draft',
|
|
7809
7887
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7810
7888
|
},
|
|
7811
|
-
|
|
7812
|
-
|
|
7889
|
+
Xi = Object.keys(De),
|
|
7890
|
+
Zi = {
|
|
7813
7891
|
creativeMode: 'unfiltered',
|
|
7814
7892
|
creativeModePriority: 'unfilteredPriority',
|
|
7815
7893
|
creativeModeDraft: 'unfilteredDraft',
|
|
7816
7894
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7817
7895
|
};
|
|
7818
|
-
function
|
|
7819
|
-
let i =
|
|
7896
|
+
function er(e, t) {
|
|
7897
|
+
let i = Zi[t];
|
|
7820
7898
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7821
7899
|
}
|
|
7822
|
-
async function
|
|
7900
|
+
async function tr(e, t) {
|
|
7823
7901
|
let i = `${x(e)}${ce(t)}`,
|
|
7824
7902
|
r;
|
|
7825
7903
|
try {
|
|
7826
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7904
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Qi) });
|
|
7827
7905
|
} catch {
|
|
7828
7906
|
throw new Error(`Could not reach ${i}`);
|
|
7829
7907
|
}
|
|
@@ -7839,18 +7917,18 @@ async function er(e, t) {
|
|
|
7839
7917
|
}
|
|
7840
7918
|
return n;
|
|
7841
7919
|
}
|
|
7842
|
-
function
|
|
7920
|
+
function Oe(e) {
|
|
7843
7921
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7844
7922
|
[i, r = ''] = t.split('.');
|
|
7845
7923
|
return `$${i}.${r.padEnd(2, '0')}`;
|
|
7846
7924
|
}
|
|
7847
|
-
function
|
|
7925
|
+
function Le(e) {
|
|
7848
7926
|
if (!e || typeof e.starter != 'number') return null;
|
|
7849
7927
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7850
7928
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7851
|
-
return `Starter ${
|
|
7929
|
+
return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
|
|
7852
7930
|
}
|
|
7853
|
-
function
|
|
7931
|
+
function ir(e) {
|
|
7854
7932
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7855
7933
|
let t = [];
|
|
7856
7934
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7862,33 +7940,33 @@ function tr(e) {
|
|
|
7862
7940
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7863
7941
|
);
|
|
7864
7942
|
}
|
|
7865
|
-
function
|
|
7866
|
-
let i =
|
|
7867
|
-
for (let r of
|
|
7868
|
-
let n =
|
|
7943
|
+
function rr(e, t) {
|
|
7944
|
+
let i = ir(e);
|
|
7945
|
+
for (let r of Xi) {
|
|
7946
|
+
let n = Le(er(e, r));
|
|
7869
7947
|
if (!n) continue;
|
|
7870
|
-
let s =
|
|
7948
|
+
let s = De[r] ? ` (${De[r]})` : '';
|
|
7871
7949
|
t.push(` ${i}${s} ${n}`);
|
|
7872
7950
|
}
|
|
7873
7951
|
}
|
|
7874
|
-
function
|
|
7952
|
+
function ar(e, t) {
|
|
7875
7953
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7876
7954
|
t.push(
|
|
7877
7955
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7878
7956
|
);
|
|
7879
|
-
for (let n of e.variants ?? [])
|
|
7957
|
+
for (let n of e.variants ?? []) rr(n, t);
|
|
7880
7958
|
let r = e.addons;
|
|
7881
7959
|
if (Array.isArray(r))
|
|
7882
7960
|
for (let n of r) {
|
|
7883
7961
|
if (!n || typeof n != 'object') continue;
|
|
7884
7962
|
let s = n,
|
|
7885
7963
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
7886
|
-
u =
|
|
7964
|
+
u = Le(s.price);
|
|
7887
7965
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
7888
7966
|
}
|
|
7889
7967
|
t.push('');
|
|
7890
7968
|
}
|
|
7891
|
-
function
|
|
7969
|
+
function nr(e) {
|
|
7892
7970
|
let t = [],
|
|
7893
7971
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7894
7972
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7910,7 +7988,7 @@ function ar(e) {
|
|
|
7910
7988
|
});
|
|
7911
7989
|
for (let l of s) {
|
|
7912
7990
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7913
|
-
for (let c of r.get(l) ?? [])
|
|
7991
|
+
for (let c of r.get(l) ?? []) ar(c, t);
|
|
7914
7992
|
}
|
|
7915
7993
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7916
7994
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -7927,7 +8005,7 @@ function ar(e) {
|
|
|
7927
8005
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
7928
8006
|
for (let m of p) {
|
|
7929
8007
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
7930
|
-
g =
|
|
8008
|
+
g = Le(m.prices);
|
|
7931
8009
|
g && t.push(` ${h} ${g}`);
|
|
7932
8010
|
}
|
|
7933
8011
|
t.push('');
|
|
@@ -7943,7 +8021,7 @@ function ar(e) {
|
|
|
7943
8021
|
async function Ct(e) {
|
|
7944
8022
|
let t;
|
|
7945
8023
|
try {
|
|
7946
|
-
t = await
|
|
8024
|
+
t = await tr(e.apiUrl, e.model);
|
|
7947
8025
|
} catch (i) {
|
|
7948
8026
|
let r = i instanceof Error ? i.message : String(i);
|
|
7949
8027
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7954,7 +8032,7 @@ async function Ct(e) {
|
|
|
7954
8032
|
e.json
|
|
7955
8033
|
? `${JSON.stringify(t, null, 2)}
|
|
7956
8034
|
`
|
|
7957
|
-
:
|
|
8035
|
+
: nr(t),
|
|
7958
8036
|
);
|
|
7959
8037
|
}
|
|
7960
8038
|
var Et = I(require('node:path'));
|
|
@@ -8069,8 +8147,8 @@ ${p.text}
|
|
|
8069
8147
|
process.stdout.write(`
|
|
8070
8148
|
`);
|
|
8071
8149
|
}
|
|
8072
|
-
var
|
|
8073
|
-
|
|
8150
|
+
var Ve = I(require('node:fs')),
|
|
8151
|
+
Ne = I(require('node:path'));
|
|
8074
8152
|
E();
|
|
8075
8153
|
async function At(e, t = {}) {
|
|
8076
8154
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
@@ -8089,13 +8167,13 @@ async function At(e, t = {}) {
|
|
|
8089
8167
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8090
8168
|
`),
|
|
8091
8169
|
process.exit(1)));
|
|
8092
|
-
let s =
|
|
8093
|
-
|
|
8170
|
+
let s = Ne.default.resolve(e);
|
|
8171
|
+
Ve.default.existsSync(s) ||
|
|
8094
8172
|
(process.stderr.write(`${a.red('Error:')} File not found: ${s}
|
|
8095
8173
|
`),
|
|
8096
8174
|
process.exit(1));
|
|
8097
|
-
let o =
|
|
8098
|
-
l =
|
|
8175
|
+
let o = Ne.default.basename(s),
|
|
8176
|
+
l = Ve.default.readFileSync(s).toString('base64'),
|
|
8099
8177
|
c = new M(i, r),
|
|
8100
8178
|
p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
8101
8179
|
n || p.start();
|
|
@@ -8136,7 +8214,7 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8136
8214
|
process.exit(m ? m.exitCode : _));
|
|
8137
8215
|
}
|
|
8138
8216
|
}
|
|
8139
|
-
|
|
8217
|
+
H();
|
|
8140
8218
|
Te();
|
|
8141
8219
|
function Yt() {
|
|
8142
8220
|
process.stdout.write(`
|
|
@@ -8198,7 +8276,7 @@ ${a.bold('EXAMPLES:')}
|
|
|
8198
8276
|
|
|
8199
8277
|
`);
|
|
8200
8278
|
}
|
|
8201
|
-
async function
|
|
8279
|
+
async function Ir() {
|
|
8202
8280
|
let e = process.argv.slice(2),
|
|
8203
8281
|
t = Tt(e);
|
|
8204
8282
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
@@ -8262,7 +8340,7 @@ async function vr() {
|
|
|
8262
8340
|
case 'run':
|
|
8263
8341
|
case 'generate': {
|
|
8264
8342
|
let i = t.subcommand || '';
|
|
8265
|
-
await
|
|
8343
|
+
await Ae(i, t.options);
|
|
8266
8344
|
break;
|
|
8267
8345
|
}
|
|
8268
8346
|
case 'status': {
|
|
@@ -8271,20 +8349,20 @@ async function vr() {
|
|
|
8271
8349
|
break;
|
|
8272
8350
|
}
|
|
8273
8351
|
case 'mcp': {
|
|
8274
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(),
|
|
8352
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(), Ht));
|
|
8275
8353
|
await i();
|
|
8276
8354
|
break;
|
|
8277
8355
|
}
|
|
8278
8356
|
default: {
|
|
8279
8357
|
if (t.command && !t.command.startsWith('-')) {
|
|
8280
|
-
(!
|
|
8358
|
+
(!U(t.command) &&
|
|
8281
8359
|
!oe[t.command] &&
|
|
8282
8360
|
(process.stderr.write(`
|
|
8283
8361
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
8284
8362
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8285
8363
|
`),
|
|
8286
8364
|
process.exit(_)),
|
|
8287
|
-
await
|
|
8365
|
+
await Ae(t.command, t.options));
|
|
8288
8366
|
return;
|
|
8289
8367
|
}
|
|
8290
8368
|
Yt();
|
|
@@ -8292,7 +8370,7 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
|
|
|
8292
8370
|
}
|
|
8293
8371
|
}
|
|
8294
8372
|
}
|
|
8295
|
-
|
|
8373
|
+
Ir().catch((e) => {
|
|
8296
8374
|
(e instanceof k &&
|
|
8297
8375
|
(process.stderr.write(`
|
|
8298
8376
|
${a.red('Error:')} ${K(e).join(`
|