@teinai/cli 1.1.15 → 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 +376 -299
- 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 {
|
|
@@ -67,32 +67,32 @@ function ie() {
|
|
|
67
67
|
return D;
|
|
68
68
|
}
|
|
69
69
|
var C,
|
|
70
|
-
|
|
70
|
+
He,
|
|
71
71
|
ge,
|
|
72
72
|
te,
|
|
73
73
|
D,
|
|
74
74
|
E = b(() => {
|
|
75
75
|
'use strict';
|
|
76
76
|
((C = I(require('node:fs'))),
|
|
77
|
-
(
|
|
77
|
+
(He = I(require('node:os'))),
|
|
78
78
|
(ge = I(require('node:path'))),
|
|
79
|
-
(te = ge.default.join(
|
|
79
|
+
(te = ge.default.join(He.default.homedir(), '.tein')),
|
|
80
80
|
(D = ge.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
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
|
});
|
|
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;
|
|
@@ -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',
|
|
@@ -4630,7 +4662,7 @@ var re,
|
|
|
4630
4662
|
function ve(e, t) {
|
|
4631
4663
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4632
4664
|
}
|
|
4633
|
-
function
|
|
4665
|
+
function ui(e, t) {
|
|
4634
4666
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4635
4667
|
if (e !== 'seedance-2') return;
|
|
4636
4668
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -4640,24 +4672,24 @@ function ci(e, t) {
|
|
|
4640
4672
|
? 'fast'
|
|
4641
4673
|
: 'standard';
|
|
4642
4674
|
}
|
|
4643
|
-
function
|
|
4675
|
+
function mi(e, t) {
|
|
4644
4676
|
let i = e
|
|
4645
4677
|
.trim()
|
|
4646
4678
|
.toLowerCase()
|
|
4647
4679
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4648
4680
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
4649
|
-
let n =
|
|
4681
|
+
let n = ui(i, t),
|
|
4650
4682
|
s = ke.get(ve('seedance-2', n));
|
|
4651
4683
|
return s ? s.slug : null;
|
|
4652
4684
|
}
|
|
4653
4685
|
let r = ae.get(i) ?? ke.get(ve(i));
|
|
4654
4686
|
return r ? r.slug : null;
|
|
4655
4687
|
}
|
|
4656
|
-
function
|
|
4657
|
-
return ae.has(e) && !(
|
|
4688
|
+
function gi(e, t) {
|
|
4689
|
+
return ae.has(e) && !(fi.has(e) && t) ? e : mi(e, t);
|
|
4658
4690
|
}
|
|
4659
|
-
function
|
|
4660
|
-
let i =
|
|
4691
|
+
function G(e, t) {
|
|
4692
|
+
let i = gi(e, t);
|
|
4661
4693
|
return i ? (ae.get(i) ?? null) : null;
|
|
4662
4694
|
}
|
|
4663
4695
|
function ne() {
|
|
@@ -4667,9 +4699,9 @@ var Ie,
|
|
|
4667
4699
|
ae,
|
|
4668
4700
|
ke,
|
|
4669
4701
|
et,
|
|
4670
|
-
|
|
4702
|
+
ci,
|
|
4671
4703
|
xe,
|
|
4672
|
-
|
|
4704
|
+
fi,
|
|
4673
4705
|
V = b(() => {
|
|
4674
4706
|
'use strict';
|
|
4675
4707
|
Xe();
|
|
@@ -4682,18 +4714,18 @@ var Ie,
|
|
|
4682
4714
|
(ae = new Map()),
|
|
4683
4715
|
(ke = new Map()),
|
|
4684
4716
|
(et = new Map()),
|
|
4685
|
-
(
|
|
4717
|
+
(ci = 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
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
|
-
for (let t of e.addons ?? [])
|
|
4724
|
+
for (let t of e.addons ?? []) ci.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4693
4725
|
xe.set(e.slug, e.family);
|
|
4694
4726
|
}
|
|
4695
4727
|
for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
|
|
4696
|
-
|
|
4728
|
+
fi = new Set(['seedance-2']);
|
|
4697
4729
|
});
|
|
4698
4730
|
function se(e) {
|
|
4699
4731
|
let t = e.from?.variant;
|
|
@@ -4726,25 +4758,25 @@ var it = b(() => {
|
|
|
4726
4758
|
'use strict';
|
|
4727
4759
|
});
|
|
4728
4760
|
function rt(e, t) {
|
|
4729
|
-
return typeof t == 'string' && (
|
|
4761
|
+
return typeof t == 'string' && (hi[e]?.includes(t) ?? !1);
|
|
4730
4762
|
}
|
|
4731
|
-
var
|
|
4763
|
+
var hi,
|
|
4732
4764
|
at = b(() => {
|
|
4733
4765
|
'use strict';
|
|
4734
4766
|
V();
|
|
4735
4767
|
Pe();
|
|
4736
4768
|
it();
|
|
4737
|
-
|
|
4769
|
+
hi = {};
|
|
4738
4770
|
});
|
|
4739
4771
|
function nt(e) {
|
|
4740
|
-
return e === 'nano-banana-pro' ?
|
|
4772
|
+
return e === 'nano-banana-pro' ? yi : bi;
|
|
4741
4773
|
}
|
|
4742
|
-
var
|
|
4743
|
-
|
|
4774
|
+
var yi,
|
|
4775
|
+
bi,
|
|
4744
4776
|
st = b(() => {
|
|
4745
4777
|
'use strict';
|
|
4746
|
-
((
|
|
4747
|
-
(
|
|
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 = [
|
|
4748
4780
|
'auto',
|
|
4749
4781
|
'1:1',
|
|
4750
4782
|
'1:4',
|
|
@@ -4855,9 +4887,9 @@ 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
|
-
function
|
|
4892
|
+
function wi(e) {
|
|
4861
4893
|
return [
|
|
4862
4894
|
{
|
|
4863
4895
|
name: 'prompt',
|
|
@@ -4940,7 +4972,7 @@ function ut() {
|
|
|
4940
4972
|
priceFormatted: n,
|
|
4941
4973
|
unit: '/M tokens',
|
|
4942
4974
|
primaryToolName: 'run_task',
|
|
4943
|
-
parameters:
|
|
4975
|
+
parameters: wi(r),
|
|
4944
4976
|
};
|
|
4945
4977
|
return [e.slug, s];
|
|
4946
4978
|
}),
|
|
@@ -4951,18 +4983,25 @@ var mt = b(() => {
|
|
|
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
|
-
function
|
|
5004
|
+
function Ii(e) {
|
|
4966
5005
|
if (e.kind === 'llm') {
|
|
4967
5006
|
let t = e.defaultEndpoint,
|
|
4968
5007
|
i = (s) =>
|
|
@@ -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
|
-
function
|
|
5022
|
+
function _i(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 bt(e) {
|
|
5027
|
+
for (let t of F) {
|
|
4989
5028
|
let i = de[t],
|
|
4990
|
-
r = i ?
|
|
5029
|
+
r = i ? _i(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,7 +5042,7 @@ function H(e, t) {
|
|
|
5003
5042
|
...(t ? { description: t } : {}),
|
|
5004
5043
|
};
|
|
5005
5044
|
}
|
|
5006
|
-
function
|
|
5045
|
+
function wt(e) {
|
|
5007
5046
|
if (!e.endpoints?.length) return null;
|
|
5008
5047
|
let t = e.endpoints.filter((i) => rt(e.slug, i.id));
|
|
5009
5048
|
return {
|
|
@@ -5018,20 +5057,20 @@ function bt(e) {
|
|
|
5018
5057
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
5019
5058
|
};
|
|
5020
5059
|
}
|
|
5021
|
-
function
|
|
5060
|
+
function Mi(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 ? kt : Pi];
|
|
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 = [kt, Ti];
|
|
5068
|
+
return (r.push(xt, vt), [...i, ...r]);
|
|
5030
5069
|
}
|
|
5031
5070
|
function ft(e, t = {}) {
|
|
5032
5071
|
return [
|
|
5033
5072
|
...e
|
|
5034
|
-
.filter((i) => !
|
|
5073
|
+
.filter((i) => !Ki.has(i.name) && !Ee.has(i.name))
|
|
5035
5074
|
.map((i) =>
|
|
5036
5075
|
i.name === 'prompt'
|
|
5037
5076
|
? { ...i, required: !0 }
|
|
@@ -5052,8 +5091,8 @@ function ft(e, t = {}) {
|
|
|
5052
5091
|
options: ['standard'],
|
|
5053
5092
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5054
5093
|
},
|
|
5055
|
-
kt,
|
|
5056
5094
|
xt,
|
|
5095
|
+
vt,
|
|
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')
|
|
@@ -5085,8 +5124,8 @@ function $e(e, t) {
|
|
|
5085
5124
|
),
|
|
5086
5125
|
];
|
|
5087
5126
|
}
|
|
5088
|
-
function
|
|
5089
|
-
let t =
|
|
5127
|
+
function Si(e) {
|
|
5128
|
+
let t = wt(e);
|
|
5090
5129
|
return [
|
|
5091
5130
|
$('Image prompt text. Supports complex composition and text instructions.'),
|
|
5092
5131
|
...(t ? [t] : []),
|
|
@@ -5096,7 +5135,7 @@ 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
5141
|
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ye}`
|
|
@@ -5153,7 +5192,7 @@ function Ki(e) {
|
|
|
5153
5192
|
},
|
|
5154
5193
|
];
|
|
5155
5194
|
}
|
|
5156
|
-
function
|
|
5195
|
+
function $i(e) {
|
|
5157
5196
|
return [
|
|
5158
5197
|
$('Image prompt text.'),
|
|
5159
5198
|
{
|
|
@@ -5162,7 +5201,7 @@ function Si(e) {
|
|
|
5162
5201
|
description: 'Images to edit or use as reference (up to 14).',
|
|
5163
5202
|
},
|
|
5164
5203
|
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...nt(e.slug)] },
|
|
5165
|
-
|
|
5204
|
+
N(e),
|
|
5166
5205
|
{
|
|
5167
5206
|
name: 'n',
|
|
5168
5207
|
type: 'slider',
|
|
@@ -5187,7 +5226,7 @@ function Si(e) {
|
|
|
5187
5226
|
},
|
|
5188
5227
|
];
|
|
5189
5228
|
}
|
|
5190
|
-
function
|
|
5229
|
+
function Ai() {
|
|
5191
5230
|
let e = ot,
|
|
5192
5231
|
t = [];
|
|
5193
5232
|
for (let i of qe(!0))
|
|
@@ -5212,7 +5251,7 @@ function qi() {
|
|
|
5212
5251
|
}));
|
|
5213
5252
|
return t;
|
|
5214
5253
|
}
|
|
5215
|
-
function
|
|
5254
|
+
function Ri() {
|
|
5216
5255
|
return qe(!0).map((e) =>
|
|
5217
5256
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5218
5257
|
);
|
|
@@ -5312,24 +5351,24 @@ function qe(e) {
|
|
|
5312
5351
|
},
|
|
5313
5352
|
];
|
|
5314
5353
|
}
|
|
5315
|
-
function
|
|
5316
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5317
|
-
let t =
|
|
5354
|
+
function Oi(e) {
|
|
5355
|
+
if (e.slug === 'seed-2-1-turbo') return Ei;
|
|
5356
|
+
let t = wt(e);
|
|
5318
5357
|
return [
|
|
5319
5358
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5320
|
-
?
|
|
5359
|
+
? Ai()
|
|
5321
5360
|
: e.slug === 'gemini-3.7-flash'
|
|
5322
|
-
?
|
|
5323
|
-
: e.slug === 'gpt-6-astra' ||
|
|
5361
|
+
? Ri()
|
|
5362
|
+
: e.slug === 'gpt-6-astra' || qi.includes(e.slug)
|
|
5324
5363
|
? qe(e.slug !== 'gpt-6-astra')
|
|
5325
|
-
:
|
|
5364
|
+
: Ci),
|
|
5326
5365
|
...(t ? [t] : []),
|
|
5327
5366
|
];
|
|
5328
5367
|
}
|
|
5329
|
-
function
|
|
5368
|
+
function Di(e) {
|
|
5330
5369
|
let t = e.slug;
|
|
5331
|
-
if (e.kind === 'llm') return
|
|
5332
|
-
if (e.editVariants?.length) return
|
|
5370
|
+
if (e.kind === 'llm') return Oi(e);
|
|
5371
|
+
if (e.editVariants?.length) return Si(e);
|
|
5333
5372
|
switch (t) {
|
|
5334
5373
|
case 'seedance-2-5':
|
|
5335
5374
|
return Se(gt, t);
|
|
@@ -5340,16 +5379,16 @@ function Oi(e) {
|
|
|
5340
5379
|
case 'seedance-2-lite':
|
|
5341
5380
|
return ft(ht);
|
|
5342
5381
|
case 'seedance-2-mini':
|
|
5343
|
-
return Se(
|
|
5382
|
+
return Se(Li, t);
|
|
5344
5383
|
case 'nano-banana-2':
|
|
5345
5384
|
case 'nano-banana-2.1':
|
|
5346
5385
|
case 'nano-banana-pro':
|
|
5347
|
-
return
|
|
5386
|
+
return $i(e);
|
|
5348
5387
|
case 'seedream-5-pro':
|
|
5349
5388
|
return [
|
|
5350
5389
|
$('Detailed description of the image to generate.'),
|
|
5351
5390
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
5352
|
-
|
|
5391
|
+
N(e),
|
|
5353
5392
|
{
|
|
5354
5393
|
name: 'aspect_ratio',
|
|
5355
5394
|
type: 'select',
|
|
@@ -5367,7 +5406,7 @@ function Oi(e) {
|
|
|
5367
5406
|
type: 'string[]',
|
|
5368
5407
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
5369
5408
|
},
|
|
5370
|
-
|
|
5409
|
+
N(e),
|
|
5371
5410
|
{
|
|
5372
5411
|
name: 'aspect_ratio',
|
|
5373
5412
|
type: 'select',
|
|
@@ -5383,6 +5422,38 @@ function Oi(e) {
|
|
|
5383
5422
|
description: 'Number of images. Each image is billed.',
|
|
5384
5423
|
},
|
|
5385
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
|
+
];
|
|
5386
5457
|
case 'seed-audio-1-0':
|
|
5387
5458
|
return [
|
|
5388
5459
|
{
|
|
@@ -5443,17 +5514,17 @@ function Ce(e, t = e.api.model) {
|
|
|
5443
5514
|
return {
|
|
5444
5515
|
slug: t,
|
|
5445
5516
|
name: e.name,
|
|
5446
|
-
category:
|
|
5447
|
-
kind:
|
|
5517
|
+
category: ki[e.kind],
|
|
5518
|
+
kind: vi[e.kind],
|
|
5448
5519
|
vendor: e.vendor ?? '',
|
|
5449
5520
|
description: e.desc ?? e.name,
|
|
5450
|
-
priceFormatted:
|
|
5521
|
+
priceFormatted: Ii(e),
|
|
5451
5522
|
unit: e.unit,
|
|
5452
|
-
primaryToolName:
|
|
5453
|
-
parameters:
|
|
5523
|
+
primaryToolName: xi[e.kind],
|
|
5524
|
+
parameters: Mi(e, Di(e)),
|
|
5454
5525
|
};
|
|
5455
5526
|
}
|
|
5456
|
-
function
|
|
5527
|
+
function Vi() {
|
|
5457
5528
|
let e = {};
|
|
5458
5529
|
for (let t of ne())
|
|
5459
5530
|
if (t.slug !== 'seedance-2-fast') {
|
|
@@ -5474,56 +5545,62 @@ function Li() {
|
|
|
5474
5545
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
5475
5546
|
return e;
|
|
5476
5547
|
}
|
|
5477
|
-
function
|
|
5548
|
+
function U(e) {
|
|
5478
5549
|
return de[e] ?? null;
|
|
5479
5550
|
}
|
|
5480
|
-
function
|
|
5551
|
+
function Ni(e, t, i) {
|
|
5481
5552
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5482
5553
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5483
5554
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
5484
5555
|
}
|
|
5485
|
-
return !
|
|
5556
|
+
return !(
|
|
5557
|
+
(t === 'max_tokens' && yt(i.max_completion_tokens)) ||
|
|
5558
|
+
(t === 'max_completion_tokens' && yt(i.max_tokens))
|
|
5559
|
+
);
|
|
5486
5560
|
}
|
|
5487
|
-
function
|
|
5561
|
+
function yt(e) {
|
|
5562
|
+
return e != null && e !== '';
|
|
5563
|
+
}
|
|
5564
|
+
function Pt(e, t) {
|
|
5488
5565
|
let i = { ...t };
|
|
5489
5566
|
if (e?.slug === 'seedance-2-5') {
|
|
5490
5567
|
let r = (n) => typeof n != 'string' || !n.trim();
|
|
5491
|
-
for (let n of
|
|
5568
|
+
for (let n of Ui) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
|
|
5492
5569
|
if (!r(i.finalize)) return i;
|
|
5493
5570
|
}
|
|
5494
5571
|
for (let r of e?.parameters ?? [])
|
|
5495
5572
|
r.default !== void 0 &&
|
|
5496
5573
|
i[r.name] === void 0 &&
|
|
5497
|
-
|
|
5574
|
+
Ni(e.slug, r.name, t) &&
|
|
5498
5575
|
(i[r.name] = r.default);
|
|
5499
5576
|
return i;
|
|
5500
5577
|
}
|
|
5501
5578
|
function q() {
|
|
5502
5579
|
return Object.values(de);
|
|
5503
5580
|
}
|
|
5504
|
-
var
|
|
5505
|
-
ki,
|
|
5581
|
+
var ki,
|
|
5506
5582
|
xi,
|
|
5583
|
+
vi,
|
|
5507
5584
|
$,
|
|
5508
|
-
wt,
|
|
5509
|
-
_i,
|
|
5510
|
-
Pi,
|
|
5511
5585
|
kt,
|
|
5586
|
+
Pi,
|
|
5587
|
+
Ti,
|
|
5512
5588
|
xt,
|
|
5589
|
+
vt,
|
|
5513
5590
|
Ee,
|
|
5514
|
-
|
|
5515
|
-
$i,
|
|
5591
|
+
Ki,
|
|
5516
5592
|
Ci,
|
|
5517
5593
|
Ei,
|
|
5594
|
+
qi,
|
|
5518
5595
|
pe,
|
|
5519
5596
|
gt,
|
|
5520
|
-
vt,
|
|
5521
5597
|
It,
|
|
5598
|
+
_t,
|
|
5522
5599
|
ht,
|
|
5523
|
-
|
|
5600
|
+
Li,
|
|
5524
5601
|
de,
|
|
5525
|
-
|
|
5526
|
-
|
|
5602
|
+
Ui,
|
|
5603
|
+
H = b(() => {
|
|
5527
5604
|
'use strict';
|
|
5528
5605
|
Qe();
|
|
5529
5606
|
be();
|
|
@@ -5535,45 +5612,45 @@ var wi,
|
|
|
5535
5612
|
lt();
|
|
5536
5613
|
mt();
|
|
5537
5614
|
Ke();
|
|
5538
|
-
((
|
|
5539
|
-
(
|
|
5615
|
+
((ki = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5616
|
+
(xi = {
|
|
5540
5617
|
video: 'generate_video',
|
|
5541
5618
|
image: 'generate_image',
|
|
5542
5619
|
audio: 'generate_audio',
|
|
5543
5620
|
llm: 'run_task',
|
|
5544
5621
|
}),
|
|
5545
|
-
(
|
|
5622
|
+
(vi = {
|
|
5546
5623
|
video: 'Text-to-Video',
|
|
5547
5624
|
image: 'Text-to-Image',
|
|
5548
5625
|
audio: 'Text-to-Audio',
|
|
5549
5626
|
llm: 'Reasoning (LLM)',
|
|
5550
5627
|
}));
|
|
5551
5628
|
$ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5552
|
-
((
|
|
5629
|
+
((kt = {
|
|
5553
5630
|
name: 'creative_mode',
|
|
5554
5631
|
type: 'boolean',
|
|
5555
5632
|
default: !1,
|
|
5556
5633
|
description:
|
|
5557
5634
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5558
5635
|
}),
|
|
5559
|
-
(
|
|
5636
|
+
(Pi = {
|
|
5560
5637
|
name: 'creative_mode',
|
|
5561
5638
|
type: 'boolean',
|
|
5562
5639
|
default: !1,
|
|
5563
5640
|
description: `Not available yet on this model: ${le}.`,
|
|
5564
5641
|
}),
|
|
5565
|
-
(
|
|
5642
|
+
(Ti = {
|
|
5566
5643
|
name: 'priority',
|
|
5567
5644
|
type: 'boolean',
|
|
5568
5645
|
default: !1,
|
|
5569
5646
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5570
5647
|
}),
|
|
5571
|
-
(
|
|
5648
|
+
(xt = {
|
|
5572
5649
|
name: 'reference_roles',
|
|
5573
5650
|
type: 'json',
|
|
5574
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).`,
|
|
5575
5652
|
}),
|
|
5576
|
-
(
|
|
5653
|
+
(vt = {
|
|
5577
5654
|
name: 'auto_fit_images',
|
|
5578
5655
|
type: 'boolean',
|
|
5579
5656
|
default: !1,
|
|
@@ -5581,7 +5658,7 @@ var wi,
|
|
|
5581
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.',
|
|
5582
5659
|
}),
|
|
5583
5660
|
(Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5584
|
-
|
|
5661
|
+
Ki = new Set([
|
|
5585
5662
|
'quality',
|
|
5586
5663
|
'bitrate_mode',
|
|
5587
5664
|
'draft',
|
|
@@ -5590,7 +5667,7 @@ var wi,
|
|
|
5590
5667
|
'draft_generation_id',
|
|
5591
5668
|
'pass_faces',
|
|
5592
5669
|
]);
|
|
5593
|
-
((
|
|
5670
|
+
((Ci = [
|
|
5594
5671
|
$('The user message or task.'),
|
|
5595
5672
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5596
5673
|
{
|
|
@@ -5608,7 +5685,7 @@ var wi,
|
|
|
5608
5685
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5609
5686
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5610
5687
|
]),
|
|
5611
|
-
(
|
|
5688
|
+
(Ei = [
|
|
5612
5689
|
$('The user message or task.'),
|
|
5613
5690
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5614
5691
|
{
|
|
@@ -5690,7 +5767,7 @@ var wi,
|
|
|
5690
5767
|
description: 'Video frames read a second.',
|
|
5691
5768
|
},
|
|
5692
5769
|
]),
|
|
5693
|
-
(
|
|
5770
|
+
(qi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5694
5771
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5695
5772
|
(gt = [
|
|
5696
5773
|
{
|
|
@@ -5841,13 +5918,13 @@ var wi,
|
|
|
5841
5918
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5842
5919
|
},
|
|
5843
5920
|
]),
|
|
5844
|
-
(
|
|
5921
|
+
(It = {
|
|
5845
5922
|
name: 'images',
|
|
5846
5923
|
type: 'string[]',
|
|
5847
5924
|
description:
|
|
5848
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.',
|
|
5849
5926
|
}),
|
|
5850
|
-
(
|
|
5927
|
+
(_t = {
|
|
5851
5928
|
name: 'audios',
|
|
5852
5929
|
type: 'string[]',
|
|
5853
5930
|
description:
|
|
@@ -5931,8 +6008,8 @@ var wi,
|
|
|
5931
6008
|
description:
|
|
5932
6009
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
5933
6010
|
},
|
|
5934
|
-
vt,
|
|
5935
6011
|
It,
|
|
6012
|
+
_t,
|
|
5936
6013
|
{
|
|
5937
6014
|
name: 'first_frame_image',
|
|
5938
6015
|
type: 'string',
|
|
@@ -5953,7 +6030,7 @@ var wi,
|
|
|
5953
6030
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5954
6031
|
},
|
|
5955
6032
|
]),
|
|
5956
|
-
(
|
|
6033
|
+
(Li = [
|
|
5957
6034
|
{
|
|
5958
6035
|
name: 'prompt',
|
|
5959
6036
|
type: 'string',
|
|
@@ -6008,8 +6085,8 @@ var wi,
|
|
|
6008
6085
|
description:
|
|
6009
6086
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6010
6087
|
},
|
|
6011
|
-
vt,
|
|
6012
6088
|
It,
|
|
6089
|
+
_t,
|
|
6013
6090
|
{
|
|
6014
6091
|
name: 'first_frame_image',
|
|
6015
6092
|
type: 'string',
|
|
@@ -6024,8 +6101,8 @@ var wi,
|
|
|
6024
6101
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6025
6102
|
},
|
|
6026
6103
|
]));
|
|
6027
|
-
de =
|
|
6028
|
-
|
|
6104
|
+
de = Vi();
|
|
6105
|
+
Ui = ['draft_task_id', 'draft_generation_id'];
|
|
6029
6106
|
});
|
|
6030
6107
|
function ce(e) {
|
|
6031
6108
|
let t = '/v1/pricing/models',
|
|
@@ -6035,42 +6112,42 @@ function ce(e) {
|
|
|
6035
6112
|
var Re = b(() => {
|
|
6036
6113
|
'use strict';
|
|
6037
6114
|
});
|
|
6038
|
-
function
|
|
6115
|
+
function Ot(e) {
|
|
6039
6116
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6040
6117
|
}
|
|
6041
|
-
function
|
|
6118
|
+
function Dt(e) {
|
|
6042
6119
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
6043
|
-
i = t.filter((s) =>
|
|
6044
|
-
r = t.filter((s) => !
|
|
6120
|
+
i = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
|
|
6121
|
+
r = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
|
|
6045
6122
|
return [
|
|
6046
6123
|
...(i.length
|
|
6047
|
-
? [`${
|
|
6124
|
+
? [`${Ot(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6048
6125
|
: []),
|
|
6049
|
-
...(r.length ? [`Not available yet on ${
|
|
6126
|
+
...(r.length ? [`Not available yet on ${Ot(r)}: ${le}.`] : []),
|
|
6050
6127
|
'The Acceptable Use Policy applies.',
|
|
6051
6128
|
].join(' ');
|
|
6052
6129
|
}
|
|
6053
|
-
function
|
|
6054
|
-
if (
|
|
6130
|
+
function dr(e) {
|
|
6131
|
+
if (lr.has(e.name)) return e;
|
|
6055
6132
|
let t = e.inputSchema.properties;
|
|
6056
6133
|
return !t || t.callback_url
|
|
6057
6134
|
? e
|
|
6058
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
6135
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: or } } };
|
|
6059
6136
|
}
|
|
6060
|
-
function
|
|
6137
|
+
function cr(e) {
|
|
6061
6138
|
let t = e.inputSchema.properties;
|
|
6062
6139
|
if (!t) return e;
|
|
6063
6140
|
let i = !1,
|
|
6064
6141
|
r = {};
|
|
6065
6142
|
for (let [n, s] of Object.entries(t))
|
|
6066
|
-
|
|
6143
|
+
Lt.has(n) && s.type === 'string' && !s.format
|
|
6067
6144
|
? ((r[n] = { ...s, format: 'uri' }), (i = !0))
|
|
6068
|
-
:
|
|
6145
|
+
: Lt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
6069
6146
|
? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
6070
6147
|
: (r[n] = s);
|
|
6071
6148
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
6072
6149
|
}
|
|
6073
|
-
function
|
|
6150
|
+
function ur(e) {
|
|
6074
6151
|
switch (e.type) {
|
|
6075
6152
|
case 'string':
|
|
6076
6153
|
return {
|
|
@@ -6125,11 +6202,11 @@ function cr(e) {
|
|
|
6125
6202
|
return { type: 'string', description: e.description };
|
|
6126
6203
|
}
|
|
6127
6204
|
}
|
|
6128
|
-
function
|
|
6205
|
+
function mr(e, t) {
|
|
6129
6206
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
6130
6207
|
r = {},
|
|
6131
6208
|
n = [];
|
|
6132
|
-
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));
|
|
6133
6210
|
let s = {
|
|
6134
6211
|
type: 'object',
|
|
6135
6212
|
properties: r,
|
|
@@ -6142,7 +6219,7 @@ function ur(e, t) {
|
|
|
6142
6219
|
inputSchema: s,
|
|
6143
6220
|
};
|
|
6144
6221
|
}
|
|
6145
|
-
function
|
|
6222
|
+
function fr() {
|
|
6146
6223
|
let e = q().filter((d) => d.category === 'Image'),
|
|
6147
6224
|
t = q().filter((d) => d.category === 'Video'),
|
|
6148
6225
|
i = q().filter((d) => d.category === 'Text'),
|
|
@@ -6238,7 +6315,7 @@ function mr() {
|
|
|
6238
6315
|
maximum: 2147483647,
|
|
6239
6316
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
6240
6317
|
},
|
|
6241
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6318
|
+
creative_mode: { type: 'boolean', default: !1, description: Dt('image') },
|
|
6242
6319
|
},
|
|
6243
6320
|
required: ['prompt'],
|
|
6244
6321
|
additionalProperties: !0,
|
|
@@ -6275,7 +6352,7 @@ function mr() {
|
|
|
6275
6352
|
default: '480p',
|
|
6276
6353
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
6277
6354
|
},
|
|
6278
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6355
|
+
creative_mode: { type: 'boolean', default: !1, description: Dt('video') },
|
|
6279
6356
|
priority: {
|
|
6280
6357
|
type: 'boolean',
|
|
6281
6358
|
default: !1,
|
|
@@ -6397,10 +6474,10 @@ function mr() {
|
|
|
6397
6474
|
additionalProperties: !0,
|
|
6398
6475
|
},
|
|
6399
6476
|
},
|
|
6400
|
-
p =
|
|
6401
|
-
return [n, s, o, u, l, p, c,
|
|
6477
|
+
p = gr();
|
|
6478
|
+
return [n, s, o, u, l, p, c, pr];
|
|
6402
6479
|
}
|
|
6403
|
-
function
|
|
6480
|
+
function gr() {
|
|
6404
6481
|
return {
|
|
6405
6482
|
name: 'upload_asset',
|
|
6406
6483
|
description:
|
|
@@ -6448,25 +6525,25 @@ function fr() {
|
|
|
6448
6525
|
};
|
|
6449
6526
|
}
|
|
6450
6527
|
function Ue() {
|
|
6451
|
-
let e =
|
|
6452
|
-
t = q().map((i) =>
|
|
6453
|
-
return [...e, ...t].map(
|
|
6528
|
+
let e = fr(),
|
|
6529
|
+
t = q().map((i) => mr(i));
|
|
6530
|
+
return [...e, ...t].map(dr).map(cr);
|
|
6454
6531
|
}
|
|
6455
|
-
var
|
|
6456
|
-
or,
|
|
6532
|
+
var or,
|
|
6457
6533
|
lr,
|
|
6458
|
-
|
|
6459
|
-
Lt
|
|
6534
|
+
pr,
|
|
6535
|
+
Lt,
|
|
6536
|
+
Vt = b(() => {
|
|
6460
6537
|
'use strict';
|
|
6461
6538
|
V();
|
|
6462
6539
|
Ke();
|
|
6463
|
-
|
|
6464
|
-
((
|
|
6540
|
+
H();
|
|
6541
|
+
((or = {
|
|
6465
6542
|
type: 'string',
|
|
6466
6543
|
description:
|
|
6467
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.',
|
|
6468
6545
|
}),
|
|
6469
|
-
(
|
|
6546
|
+
(lr = new Set([
|
|
6470
6547
|
'upload_asset',
|
|
6471
6548
|
'upload_media',
|
|
6472
6549
|
'upload_image',
|
|
@@ -6474,7 +6551,7 @@ var sr,
|
|
|
6474
6551
|
'check_status',
|
|
6475
6552
|
'get_pricing',
|
|
6476
6553
|
])),
|
|
6477
|
-
(
|
|
6554
|
+
(pr = {
|
|
6478
6555
|
name: 'get_pricing',
|
|
6479
6556
|
description:
|
|
6480
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.',
|
|
@@ -6489,7 +6566,7 @@ var sr,
|
|
|
6489
6566
|
additionalProperties: !1,
|
|
6490
6567
|
},
|
|
6491
6568
|
}));
|
|
6492
|
-
|
|
6569
|
+
Lt = new Set([
|
|
6493
6570
|
'image',
|
|
6494
6571
|
'images',
|
|
6495
6572
|
'image_url',
|
|
@@ -6506,19 +6583,19 @@ var sr,
|
|
|
6506
6583
|
'lipsyncing_audio',
|
|
6507
6584
|
]);
|
|
6508
6585
|
});
|
|
6509
|
-
var
|
|
6510
|
-
|
|
6511
|
-
forgetToolSchemas: () =>
|
|
6512
|
-
jsonRpcAnswer: () =>
|
|
6513
|
-
preprocessLocalFiles: () =>
|
|
6586
|
+
var Wt = {};
|
|
6587
|
+
ri(Wt, {
|
|
6588
|
+
forgetToolSchemas: () => kr,
|
|
6589
|
+
jsonRpcAnswer: () => Bt,
|
|
6590
|
+
preprocessLocalFiles: () => zt,
|
|
6514
6591
|
startStdioServer: () => Ht,
|
|
6515
6592
|
});
|
|
6516
|
-
function
|
|
6593
|
+
function hr(e) {
|
|
6517
6594
|
let t = (i) =>
|
|
6518
6595
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6519
6596
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6520
6597
|
}
|
|
6521
|
-
function
|
|
6598
|
+
function Bt(e, t, i) {
|
|
6522
6599
|
let r = e?.id,
|
|
6523
6600
|
n = r == null,
|
|
6524
6601
|
s = null;
|
|
@@ -6527,7 +6604,7 @@ function jt(e, t, i) {
|
|
|
6527
6604
|
} catch {
|
|
6528
6605
|
s = null;
|
|
6529
6606
|
}
|
|
6530
|
-
if (s !== null &&
|
|
6607
|
+
if (s !== null && hr(s)) return n ? null : s;
|
|
6531
6608
|
if (n) return null;
|
|
6532
6609
|
if (!i && t >= 200 && t < 300) return;
|
|
6533
6610
|
let o = s?.error,
|
|
@@ -6548,13 +6625,13 @@ function jt(e, t, i) {
|
|
|
6548
6625
|
},
|
|
6549
6626
|
};
|
|
6550
6627
|
}
|
|
6551
|
-
function
|
|
6628
|
+
function yr() {
|
|
6552
6629
|
let e = process.argv.slice(2),
|
|
6553
6630
|
t = e.indexOf('--api-key');
|
|
6554
6631
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6555
6632
|
}
|
|
6556
|
-
async function
|
|
6557
|
-
let r =
|
|
6633
|
+
async function Ft(e, t, i) {
|
|
6634
|
+
let r = j.default.resolve(e);
|
|
6558
6635
|
if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
|
|
6559
6636
|
throw new Error(`File not found: ${e}`);
|
|
6560
6637
|
let n = R.default.readFileSync(r),
|
|
@@ -6582,15 +6659,15 @@ async function Bt(e, t, i) {
|
|
|
6582
6659
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
6583
6660
|
};
|
|
6584
6661
|
}
|
|
6585
|
-
function Ft(e) {
|
|
6586
|
-
return yr.has(U.default.extname(e).toLowerCase());
|
|
6587
|
-
}
|
|
6588
6662
|
function Gt(e) {
|
|
6663
|
+
return br.has(j.default.extname(e).toLowerCase());
|
|
6664
|
+
}
|
|
6665
|
+
function Jt(e) {
|
|
6589
6666
|
return new Error(
|
|
6590
|
-
`Tein uploads image, video and audio files only, and ${
|
|
6667
|
+
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
6591
6668
|
);
|
|
6592
6669
|
}
|
|
6593
|
-
function
|
|
6670
|
+
function wr(e) {
|
|
6594
6671
|
let t = e.trim();
|
|
6595
6672
|
if (
|
|
6596
6673
|
!t ||
|
|
@@ -6600,7 +6677,7 @@ function br(e) {
|
|
|
6600
6677
|
`)
|
|
6601
6678
|
)
|
|
6602
6679
|
return null;
|
|
6603
|
-
let i =
|
|
6680
|
+
let i = j.default.resolve(t);
|
|
6604
6681
|
return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
|
|
6605
6682
|
}
|
|
6606
6683
|
function Be(e) {
|
|
@@ -6613,10 +6690,10 @@ function Be(e) {
|
|
|
6613
6690
|
Q.set(i.name, i.inputSchema);
|
|
6614
6691
|
}
|
|
6615
6692
|
}
|
|
6616
|
-
function
|
|
6693
|
+
function kr() {
|
|
6617
6694
|
(Q.clear(), (je = 0));
|
|
6618
6695
|
}
|
|
6619
|
-
async function
|
|
6696
|
+
async function xr(e, t) {
|
|
6620
6697
|
if (!(Date.now() - je < 6e4)) {
|
|
6621
6698
|
je = Date.now();
|
|
6622
6699
|
try {
|
|
@@ -6632,35 +6709,35 @@ async function kr(e, t) {
|
|
|
6632
6709
|
} catch {}
|
|
6633
6710
|
}
|
|
6634
6711
|
}
|
|
6635
|
-
function
|
|
6712
|
+
function vr(e) {
|
|
6636
6713
|
return e
|
|
6637
6714
|
? e.type === 'string'
|
|
6638
6715
|
? e.format === 'uri'
|
|
6639
6716
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6640
6717
|
: !1;
|
|
6641
6718
|
}
|
|
6642
|
-
async function
|
|
6719
|
+
async function Nt(e, t, i) {
|
|
6643
6720
|
if (typeof e != 'string') return e;
|
|
6644
|
-
let r =
|
|
6721
|
+
let r = wr(e);
|
|
6645
6722
|
if (!r) return e;
|
|
6646
|
-
if (!
|
|
6647
|
-
return (await
|
|
6723
|
+
if (!Gt(r)) throw Jt(r);
|
|
6724
|
+
return (await Ft(r, t, i)).url;
|
|
6648
6725
|
}
|
|
6649
|
-
async function
|
|
6650
|
-
(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)));
|
|
6651
6728
|
let s = Q.get(e)?.properties;
|
|
6652
6729
|
if (!s) return t;
|
|
6653
6730
|
let o = { ...t };
|
|
6654
6731
|
for (let [u, l] of Object.entries(t))
|
|
6655
|
-
if (
|
|
6732
|
+
if (vr(s[u]))
|
|
6656
6733
|
if (Array.isArray(l)) {
|
|
6657
6734
|
let c = [];
|
|
6658
|
-
for (let p of l) c.push(await
|
|
6735
|
+
for (let p of l) c.push(await Nt(p, i, r));
|
|
6659
6736
|
o[u] = c;
|
|
6660
|
-
} else o[u] = await
|
|
6737
|
+
} else o[u] = await Nt(l, i, r);
|
|
6661
6738
|
return o;
|
|
6662
6739
|
}
|
|
6663
|
-
function
|
|
6740
|
+
function Ir(e) {
|
|
6664
6741
|
let t = e.id ?? null;
|
|
6665
6742
|
switch (e.method) {
|
|
6666
6743
|
case 'initialize':
|
|
@@ -6702,12 +6779,12 @@ function vr(e) {
|
|
|
6702
6779
|
}
|
|
6703
6780
|
}
|
|
6704
6781
|
async function Ht() {
|
|
6705
|
-
if (
|
|
6706
|
-
|
|
6707
|
-
let e =
|
|
6782
|
+
if (Ut) return;
|
|
6783
|
+
Ut = !0;
|
|
6784
|
+
let e = yr(),
|
|
6708
6785
|
t = x(),
|
|
6709
6786
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6710
|
-
(
|
|
6787
|
+
(jt.default
|
|
6711
6788
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6712
6789
|
.on('line', async (n) => {
|
|
6713
6790
|
let s = n.trim();
|
|
@@ -6766,10 +6843,10 @@ async function Ht() {
|
|
|
6766
6843
|
!p.startsWith('data:')
|
|
6767
6844
|
)
|
|
6768
6845
|
try {
|
|
6769
|
-
let d =
|
|
6846
|
+
let d = j.default.resolve(p.trim());
|
|
6770
6847
|
if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
|
|
6771
|
-
if (!
|
|
6772
|
-
let m = await
|
|
6848
|
+
if (!Gt(d)) throw Jt(d);
|
|
6849
|
+
let m = await Ft(d, e, t),
|
|
6773
6850
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
6774
6851
|
ue =
|
|
6775
6852
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6825,7 +6902,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6825
6902
|
}
|
|
6826
6903
|
if (e)
|
|
6827
6904
|
try {
|
|
6828
|
-
o.params.arguments = await
|
|
6905
|
+
o.params.arguments = await zt(String(l), c, e, t, i);
|
|
6829
6906
|
} catch (p) {
|
|
6830
6907
|
let d = p instanceof Error ? p.message : String(p);
|
|
6831
6908
|
process.stdout.write(
|
|
@@ -6856,7 +6933,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6856
6933
|
body: JSON.stringify(o),
|
|
6857
6934
|
}),
|
|
6858
6935
|
c = await l.text(),
|
|
6859
|
-
p =
|
|
6936
|
+
p = Bt(o, l.status, c);
|
|
6860
6937
|
if (p === null) return;
|
|
6861
6938
|
if (p) {
|
|
6862
6939
|
(o?.method === 'tools/list' && Be(p.result?.tools),
|
|
@@ -6868,7 +6945,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6868
6945
|
return;
|
|
6869
6946
|
}
|
|
6870
6947
|
} catch {}
|
|
6871
|
-
let u =
|
|
6948
|
+
let u = Ir(o);
|
|
6872
6949
|
u !== null &&
|
|
6873
6950
|
process.stdout.write(
|
|
6874
6951
|
JSON.stringify(u) +
|
|
@@ -6892,21 +6969,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6892
6969
|
`));
|
|
6893
6970
|
}
|
|
6894
6971
|
var R,
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6972
|
+
j,
|
|
6973
|
+
jt,
|
|
6974
|
+
br,
|
|
6898
6975
|
Q,
|
|
6899
6976
|
je,
|
|
6900
|
-
|
|
6901
|
-
|
|
6977
|
+
Ut,
|
|
6978
|
+
Yt = b(() => {
|
|
6902
6979
|
'use strict';
|
|
6903
6980
|
((R = I(require('node:fs'))),
|
|
6904
|
-
(
|
|
6905
|
-
(
|
|
6981
|
+
(j = I(require('node:path'))),
|
|
6982
|
+
(jt = I(require('node:readline'))));
|
|
6906
6983
|
Re();
|
|
6907
|
-
|
|
6984
|
+
Vt();
|
|
6908
6985
|
E();
|
|
6909
|
-
|
|
6986
|
+
br = new Set([
|
|
6910
6987
|
'.png',
|
|
6911
6988
|
'.jpg',
|
|
6912
6989
|
'.jpeg',
|
|
@@ -6933,7 +7010,7 @@ var R,
|
|
|
6933
7010
|
'.opus',
|
|
6934
7011
|
]);
|
|
6935
7012
|
((Q = new Map()), (je = 0));
|
|
6936
|
-
|
|
7013
|
+
Ut = !1;
|
|
6937
7014
|
require.main === module &&
|
|
6938
7015
|
Ht().catch((e) => {
|
|
6939
7016
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
@@ -6941,11 +7018,11 @@ var R,
|
|
|
6941
7018
|
process.exit(1));
|
|
6942
7019
|
});
|
|
6943
7020
|
});
|
|
6944
|
-
var
|
|
7021
|
+
var ni =
|
|
6945
7022
|
!process.env.NO_COLOR &&
|
|
6946
7023
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
6947
7024
|
function w(e, t) {
|
|
6948
|
-
return (i) => (
|
|
7025
|
+
return (i) => (ni ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
6949
7026
|
}
|
|
6950
7027
|
var a = {
|
|
6951
7028
|
bold: w(1, 22),
|
|
@@ -7033,9 +7110,9 @@ var O = I(require('node:fs')),
|
|
|
7033
7110
|
A = I(require('node:path'));
|
|
7034
7111
|
var ee = I(require('node:fs')),
|
|
7035
7112
|
Je = I(require('node:path')),
|
|
7036
|
-
|
|
7113
|
+
ze = require('node:stream/promises');
|
|
7037
7114
|
var Z = '1.1.7';
|
|
7038
|
-
var
|
|
7115
|
+
var si = new Set([
|
|
7039
7116
|
'account_suspended',
|
|
7040
7117
|
'account_terminated',
|
|
7041
7118
|
'creative_mode_restricted',
|
|
@@ -7043,7 +7120,7 @@ var ni = new Set([
|
|
|
7043
7120
|
'workspace_paused',
|
|
7044
7121
|
]),
|
|
7045
7122
|
_ = 1,
|
|
7046
|
-
|
|
7123
|
+
oi = 3,
|
|
7047
7124
|
k = class extends Error {
|
|
7048
7125
|
constructor(t, i, r, n = {}) {
|
|
7049
7126
|
(super(i),
|
|
@@ -7053,10 +7130,10 @@ var ni = new Set([
|
|
|
7053
7130
|
(this.fields = n));
|
|
7054
7131
|
}
|
|
7055
7132
|
get exitCode() {
|
|
7056
|
-
return this.code &&
|
|
7133
|
+
return this.code && si.has(this.code) ? oi : _;
|
|
7057
7134
|
}
|
|
7058
7135
|
};
|
|
7059
|
-
function
|
|
7136
|
+
function li(e, t, i) {
|
|
7060
7137
|
let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
7061
7138
|
if (!i || typeof i != 'object') return new k(e, r);
|
|
7062
7139
|
let n = i;
|
|
@@ -7083,7 +7160,7 @@ function K(e) {
|
|
|
7083
7160
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
7084
7161
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
7085
7162
|
}
|
|
7086
|
-
function
|
|
7163
|
+
function pi(e) {
|
|
7087
7164
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7088
7165
|
? 'video'
|
|
7089
7166
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
@@ -7095,7 +7172,7 @@ function Ge(e) {
|
|
|
7095
7172
|
for (let i of e.data ?? [])
|
|
7096
7173
|
typeof i.message?.content == 'string'
|
|
7097
7174
|
? t.push({ type: 'text', text: i.message.content })
|
|
7098
|
-
: i.url && t.push({ type:
|
|
7175
|
+
: i.url && t.push({ type: pi(i.url), url: i.url });
|
|
7099
7176
|
return t;
|
|
7100
7177
|
}
|
|
7101
7178
|
var M = class {
|
|
@@ -7121,7 +7198,7 @@ var M = class {
|
|
|
7121
7198
|
try {
|
|
7122
7199
|
s = await n.json();
|
|
7123
7200
|
} catch {}
|
|
7124
|
-
throw
|
|
7201
|
+
throw li(n.status, n.statusText, s);
|
|
7125
7202
|
}
|
|
7126
7203
|
return await n.json();
|
|
7127
7204
|
}
|
|
@@ -7174,7 +7251,7 @@ var M = class {
|
|
|
7174
7251
|
let n = Je.default.dirname(i);
|
|
7175
7252
|
ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
|
|
7176
7253
|
let s = ee.default.createWriteStream(i);
|
|
7177
|
-
return (await (0,
|
|
7254
|
+
return (await (0, ze.pipeline)(r.body, s), i);
|
|
7178
7255
|
}
|
|
7179
7256
|
};
|
|
7180
7257
|
E();
|
|
@@ -7186,30 +7263,30 @@ function ye(e) {
|
|
|
7186
7263
|
r = Math.round(Number((e * i).toFixed(6))) / i;
|
|
7187
7264
|
return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
|
|
7188
7265
|
}
|
|
7189
|
-
|
|
7190
|
-
var
|
|
7191
|
-
function Ui(e) {
|
|
7192
|
-
for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7193
|
-
}
|
|
7266
|
+
H();
|
|
7267
|
+
var Tt = ['images', 'input_images', 'videos', 'audios'];
|
|
7194
7268
|
function ji(e) {
|
|
7269
|
+
for (let t of Tt) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7270
|
+
}
|
|
7271
|
+
function Bi(e) {
|
|
7195
7272
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7196
7273
|
let t = A.default.resolve(e);
|
|
7197
7274
|
return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
|
|
7198
7275
|
}
|
|
7199
|
-
async function
|
|
7200
|
-
for (let i of
|
|
7276
|
+
async function Fi(e, t) {
|
|
7277
|
+
for (let i of Tt) {
|
|
7201
7278
|
if (!Array.isArray(e[i])) continue;
|
|
7202
7279
|
let r = [];
|
|
7203
7280
|
for (let n of e[i]) {
|
|
7204
7281
|
if (typeof n != 'string') continue;
|
|
7205
|
-
let s =
|
|
7282
|
+
let s = Bi(n);
|
|
7206
7283
|
r.push(s ? await t(s) : n);
|
|
7207
7284
|
}
|
|
7208
7285
|
e[i] = r;
|
|
7209
7286
|
}
|
|
7210
7287
|
}
|
|
7211
7288
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7212
|
-
function
|
|
7289
|
+
function Gi(e) {
|
|
7213
7290
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7214
7291
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7215
7292
|
i = W.enterprise;
|
|
@@ -7222,7 +7299,7 @@ function Fi(e) {
|
|
|
7222
7299
|
t
|
|
7223
7300
|
);
|
|
7224
7301
|
}
|
|
7225
|
-
async function
|
|
7302
|
+
async function Ji(e, t, i, r, n) {
|
|
7226
7303
|
n.isJson ||
|
|
7227
7304
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
7228
7305
|
`);
|
|
@@ -7297,7 +7374,7 @@ async function Gi(e, t, i, r, n) {
|
|
|
7297
7374
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7298
7375
|
process.exit(_);
|
|
7299
7376
|
}
|
|
7300
|
-
function
|
|
7377
|
+
function Mt(e) {
|
|
7301
7378
|
let t = {},
|
|
7302
7379
|
i = new Set(),
|
|
7303
7380
|
r = [];
|
|
@@ -7360,11 +7437,11 @@ async function Ae(e, t) {
|
|
|
7360
7437
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
7361
7438
|
`),
|
|
7362
7439
|
process.exit(1)));
|
|
7363
|
-
let n =
|
|
7440
|
+
let n = U(e),
|
|
7364
7441
|
s = !!t.json,
|
|
7365
7442
|
o = !!(t.async || t.no_wait),
|
|
7366
7443
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7367
|
-
l =
|
|
7444
|
+
l = Gi(t),
|
|
7368
7445
|
c = { ...t };
|
|
7369
7446
|
(delete c.json,
|
|
7370
7447
|
delete c.async,
|
|
@@ -7373,8 +7450,8 @@ async function Ae(e, t) {
|
|
|
7373
7450
|
delete c.api_key,
|
|
7374
7451
|
delete c.api_url,
|
|
7375
7452
|
delete c.count);
|
|
7376
|
-
let p =
|
|
7377
|
-
(
|
|
7453
|
+
let p = Pt(n, c);
|
|
7454
|
+
(ji(p),
|
|
7378
7455
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7379
7456
|
p.image_url &&
|
|
7380
7457
|
!p.first_frame_image &&
|
|
@@ -7390,11 +7467,11 @@ async function Ae(e, t) {
|
|
|
7390
7467
|
let P = new T(`Uploading local file ${A.default.basename(v)} to CDN...`);
|
|
7391
7468
|
s || P.start();
|
|
7392
7469
|
try {
|
|
7393
|
-
let
|
|
7394
|
-
X = await d.uploadAsset(
|
|
7470
|
+
let B = O.default.readFileSync(v),
|
|
7471
|
+
X = await d.uploadAsset(B.toString('base64'));
|
|
7395
7472
|
((p[y] = X.url), s || P.succeed(`Uploaded ${A.default.basename(v)} to CDN`));
|
|
7396
|
-
} catch (
|
|
7397
|
-
let X =
|
|
7473
|
+
} catch (B) {
|
|
7474
|
+
let X = B instanceof Error ? B.message : String(B);
|
|
7398
7475
|
(s
|
|
7399
7476
|
? process.stdout.write(
|
|
7400
7477
|
JSON.stringify({ error: X }) +
|
|
@@ -7407,7 +7484,7 @@ async function Ae(e, t) {
|
|
|
7407
7484
|
}
|
|
7408
7485
|
}
|
|
7409
7486
|
}
|
|
7410
|
-
await
|
|
7487
|
+
await Fi(p, async (y) => {
|
|
7411
7488
|
let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
7412
7489
|
s || f.start();
|
|
7413
7490
|
try {
|
|
@@ -7431,7 +7508,7 @@ async function Ae(e, t) {
|
|
|
7431
7508
|
let g;
|
|
7432
7509
|
try {
|
|
7433
7510
|
if (l > 1) {
|
|
7434
|
-
await
|
|
7511
|
+
await Ji(d, e, p, l, { isJson: s, isAsync: o });
|
|
7435
7512
|
return;
|
|
7436
7513
|
}
|
|
7437
7514
|
g = await d.queueJob(e, p);
|
|
@@ -7549,9 +7626,9 @@ ${f.text}
|
|
|
7549
7626
|
process.stdout.write(`
|
|
7550
7627
|
`);
|
|
7551
7628
|
}
|
|
7552
|
-
var
|
|
7629
|
+
var Kt = I(require('node:readline'));
|
|
7553
7630
|
E();
|
|
7554
|
-
async function
|
|
7631
|
+
async function zi(e) {
|
|
7555
7632
|
try {
|
|
7556
7633
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7557
7634
|
} catch (t) {
|
|
@@ -7563,7 +7640,7 @@ async function Ji(e) {
|
|
|
7563
7640
|
}
|
|
7564
7641
|
}
|
|
7565
7642
|
function Hi(e) {
|
|
7566
|
-
let t =
|
|
7643
|
+
let t = Kt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7567
7644
|
return new Promise((i) => {
|
|
7568
7645
|
t.question(e, (r) => {
|
|
7569
7646
|
(t.close(), i(r.trim()));
|
|
@@ -7589,7 +7666,7 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7589
7666
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7590
7667
|
`),
|
|
7591
7668
|
process.exit(1)));
|
|
7592
|
-
let r = await
|
|
7669
|
+
let r = await zi(i);
|
|
7593
7670
|
(r === 'invalid' &&
|
|
7594
7671
|
(process.stderr
|
|
7595
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.
|
|
@@ -7660,30 +7737,30 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7660
7737
|
}
|
|
7661
7738
|
E();
|
|
7662
7739
|
be();
|
|
7663
|
-
|
|
7664
|
-
var
|
|
7665
|
-
async function
|
|
7740
|
+
H();
|
|
7741
|
+
var Wi = 3e3;
|
|
7742
|
+
async function St(e) {
|
|
7666
7743
|
try {
|
|
7667
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
7744
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Wi) });
|
|
7668
7745
|
if (!t.ok) return;
|
|
7669
7746
|
let i = await t.json(),
|
|
7670
7747
|
r = {};
|
|
7671
7748
|
for (let n of i.configs ?? []) {
|
|
7672
7749
|
let s = String(n.modelSlug ?? '');
|
|
7673
|
-
|
|
7750
|
+
F.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7674
7751
|
}
|
|
7675
|
-
|
|
7752
|
+
bt(r);
|
|
7676
7753
|
} catch {}
|
|
7677
7754
|
}
|
|
7678
|
-
var
|
|
7679
|
-
|
|
7680
|
-
async function
|
|
7681
|
-
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);
|
|
7682
7759
|
let i = q();
|
|
7683
7760
|
if (e) {
|
|
7684
7761
|
let s = e.toLowerCase(),
|
|
7685
|
-
o =
|
|
7686
|
-
i =
|
|
7762
|
+
o = Qi[s] ?? s;
|
|
7763
|
+
i = Yi.has(o)
|
|
7687
7764
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7688
7765
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7689
7766
|
}
|
|
@@ -7721,9 +7798,9 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7721
7798
|
|
|
7722
7799
|
`);
|
|
7723
7800
|
}
|
|
7724
|
-
async function
|
|
7725
|
-
|
|
7726
|
-
let i =
|
|
7801
|
+
async function Ct(e, t) {
|
|
7802
|
+
F.has(e) && (await St(t));
|
|
7803
|
+
let i = U(e);
|
|
7727
7804
|
(i ||
|
|
7728
7805
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
7729
7806
|
`),
|
|
@@ -7804,7 +7881,7 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7804
7881
|
}
|
|
7805
7882
|
E();
|
|
7806
7883
|
Re();
|
|
7807
|
-
var
|
|
7884
|
+
var Xi = 1e4,
|
|
7808
7885
|
De = {
|
|
7809
7886
|
price: '',
|
|
7810
7887
|
creativeMode: 'Creative mode',
|
|
@@ -7815,22 +7892,22 @@ var Qi = 1e4,
|
|
|
7815
7892
|
priorityDraft: 'Priority + Draft',
|
|
7816
7893
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7817
7894
|
},
|
|
7818
|
-
|
|
7819
|
-
|
|
7895
|
+
Zi = Object.keys(De),
|
|
7896
|
+
er = {
|
|
7820
7897
|
creativeMode: 'unfiltered',
|
|
7821
7898
|
creativeModePriority: 'unfilteredPriority',
|
|
7822
7899
|
creativeModeDraft: 'unfilteredDraft',
|
|
7823
7900
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7824
7901
|
};
|
|
7825
|
-
function
|
|
7826
|
-
let i =
|
|
7902
|
+
function tr(e, t) {
|
|
7903
|
+
let i = er[t];
|
|
7827
7904
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7828
7905
|
}
|
|
7829
|
-
async function
|
|
7906
|
+
async function ir(e, t) {
|
|
7830
7907
|
let i = `${x(e)}${ce(t)}`,
|
|
7831
7908
|
r;
|
|
7832
7909
|
try {
|
|
7833
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7910
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Xi) });
|
|
7834
7911
|
} catch {
|
|
7835
7912
|
throw new Error(`Could not reach ${i}`);
|
|
7836
7913
|
}
|
|
@@ -7857,7 +7934,7 @@ function Le(e) {
|
|
|
7857
7934
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7858
7935
|
return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
|
|
7859
7936
|
}
|
|
7860
|
-
function
|
|
7937
|
+
function rr(e) {
|
|
7861
7938
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7862
7939
|
let t = [];
|
|
7863
7940
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7869,21 +7946,21 @@ function ir(e) {
|
|
|
7869
7946
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7870
7947
|
);
|
|
7871
7948
|
}
|
|
7872
|
-
function
|
|
7873
|
-
let i =
|
|
7874
|
-
for (let r of
|
|
7875
|
-
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));
|
|
7876
7953
|
if (!n) continue;
|
|
7877
7954
|
let s = De[r] ? ` (${De[r]})` : '';
|
|
7878
7955
|
t.push(` ${i}${s} ${n}`);
|
|
7879
7956
|
}
|
|
7880
7957
|
}
|
|
7881
|
-
function
|
|
7958
|
+
function nr(e, t) {
|
|
7882
7959
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7883
7960
|
t.push(
|
|
7884
7961
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7885
7962
|
);
|
|
7886
|
-
for (let n of e.variants ?? [])
|
|
7963
|
+
for (let n of e.variants ?? []) ar(n, t);
|
|
7887
7964
|
let r = e.addons;
|
|
7888
7965
|
if (Array.isArray(r))
|
|
7889
7966
|
for (let n of r) {
|
|
@@ -7895,7 +7972,7 @@ function ar(e, t) {
|
|
|
7895
7972
|
}
|
|
7896
7973
|
t.push('');
|
|
7897
7974
|
}
|
|
7898
|
-
function
|
|
7975
|
+
function sr(e) {
|
|
7899
7976
|
let t = [],
|
|
7900
7977
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7901
7978
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7917,7 +7994,7 @@ function nr(e) {
|
|
|
7917
7994
|
});
|
|
7918
7995
|
for (let l of s) {
|
|
7919
7996
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
7920
|
-
for (let c of r.get(l) ?? [])
|
|
7997
|
+
for (let c of r.get(l) ?? []) nr(c, t);
|
|
7921
7998
|
}
|
|
7922
7999
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
7923
8000
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -7947,10 +8024,10 @@ function nr(e) {
|
|
|
7947
8024
|
`
|
|
7948
8025
|
);
|
|
7949
8026
|
}
|
|
7950
|
-
async function
|
|
8027
|
+
async function Et(e) {
|
|
7951
8028
|
let t;
|
|
7952
8029
|
try {
|
|
7953
|
-
t = await
|
|
8030
|
+
t = await ir(e.apiUrl, e.model);
|
|
7954
8031
|
} catch (i) {
|
|
7955
8032
|
let r = i instanceof Error ? i.message : String(i);
|
|
7956
8033
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7961,12 +8038,12 @@ async function Ct(e) {
|
|
|
7961
8038
|
e.json
|
|
7962
8039
|
? `${JSON.stringify(t, null, 2)}
|
|
7963
8040
|
`
|
|
7964
|
-
:
|
|
8041
|
+
: sr(t),
|
|
7965
8042
|
);
|
|
7966
8043
|
}
|
|
7967
|
-
var
|
|
8044
|
+
var qt = I(require('node:path'));
|
|
7968
8045
|
E();
|
|
7969
|
-
async function
|
|
8046
|
+
async function At(e, t) {
|
|
7970
8047
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7971
8048
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7972
8049
|
(i ||
|
|
@@ -8061,7 +8138,7 @@ ${a.bold('Outputs:')}
|
|
|
8061
8138
|
) {
|
|
8062
8139
|
let d = new T(`Downloading output to ${o}...`).start();
|
|
8063
8140
|
try {
|
|
8064
|
-
(await u.downloadOutput(p.url,
|
|
8141
|
+
(await u.downloadOutput(p.url, qt.default.resolve(process.cwd(), o)),
|
|
8065
8142
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
8066
8143
|
} catch (m) {
|
|
8067
8144
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -8079,7 +8156,7 @@ ${p.text}
|
|
|
8079
8156
|
var Ve = I(require('node:fs')),
|
|
8080
8157
|
Ne = I(require('node:path'));
|
|
8081
8158
|
E();
|
|
8082
|
-
async function
|
|
8159
|
+
async function Rt(e, t = {}) {
|
|
8083
8160
|
let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8084
8161
|
r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
8085
8162
|
n = !!t.json;
|
|
@@ -8143,9 +8220,9 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8143
8220
|
process.exit(m ? m.exitCode : _));
|
|
8144
8221
|
}
|
|
8145
8222
|
}
|
|
8146
|
-
|
|
8223
|
+
H();
|
|
8147
8224
|
Te();
|
|
8148
|
-
function
|
|
8225
|
+
function Qt() {
|
|
8149
8226
|
process.stdout.write(`
|
|
8150
8227
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8151
8228
|
|
|
@@ -8205,11 +8282,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8205
8282
|
|
|
8206
8283
|
`);
|
|
8207
8284
|
}
|
|
8208
|
-
async function
|
|
8285
|
+
async function _r() {
|
|
8209
8286
|
let e = process.argv.slice(2),
|
|
8210
|
-
t =
|
|
8287
|
+
t = Mt(e);
|
|
8211
8288
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8212
|
-
|
|
8289
|
+
Qt();
|
|
8213
8290
|
return;
|
|
8214
8291
|
}
|
|
8215
8292
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8236,14 +8313,14 @@ async function Ir() {
|
|
|
8236
8313
|
}
|
|
8237
8314
|
case 'models':
|
|
8238
8315
|
case 'list': {
|
|
8239
|
-
await
|
|
8316
|
+
await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8240
8317
|
break;
|
|
8241
8318
|
}
|
|
8242
8319
|
case 'pricing':
|
|
8243
8320
|
case 'prices': {
|
|
8244
8321
|
let i = t.options.model,
|
|
8245
8322
|
r = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
8246
|
-
await
|
|
8323
|
+
await Et({
|
|
8247
8324
|
model: r,
|
|
8248
8325
|
json: !!t.options.json,
|
|
8249
8326
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -8258,12 +8335,12 @@ async function Ir() {
|
|
|
8258
8335
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8259
8336
|
`),
|
|
8260
8337
|
process.exit(1)),
|
|
8261
|
-
await
|
|
8338
|
+
await Ct(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8262
8339
|
break;
|
|
8263
8340
|
}
|
|
8264
8341
|
case 'upload': {
|
|
8265
8342
|
let i = t.subcommand || '';
|
|
8266
|
-
await
|
|
8343
|
+
await Rt(i, t.options);
|
|
8267
8344
|
break;
|
|
8268
8345
|
}
|
|
8269
8346
|
case 'run':
|
|
@@ -8274,17 +8351,17 @@ async function Ir() {
|
|
|
8274
8351
|
}
|
|
8275
8352
|
case 'status': {
|
|
8276
8353
|
let i = t.subcommand || '';
|
|
8277
|
-
await
|
|
8354
|
+
await At(i, t.options);
|
|
8278
8355
|
break;
|
|
8279
8356
|
}
|
|
8280
8357
|
case 'mcp': {
|
|
8281
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
8358
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Yt(), Wt));
|
|
8282
8359
|
await i();
|
|
8283
8360
|
break;
|
|
8284
8361
|
}
|
|
8285
8362
|
default: {
|
|
8286
8363
|
if (t.command && !t.command.startsWith('-')) {
|
|
8287
|
-
(!
|
|
8364
|
+
(!U(t.command) &&
|
|
8288
8365
|
!oe[t.command] &&
|
|
8289
8366
|
(process.stderr.write(`
|
|
8290
8367
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
@@ -8294,12 +8371,12 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
|
|
|
8294
8371
|
await Ae(t.command, t.options));
|
|
8295
8372
|
return;
|
|
8296
8373
|
}
|
|
8297
|
-
|
|
8374
|
+
Qt();
|
|
8298
8375
|
break;
|
|
8299
8376
|
}
|
|
8300
8377
|
}
|
|
8301
8378
|
}
|
|
8302
|
-
|
|
8379
|
+
_r().catch((e) => {
|
|
8303
8380
|
(e instanceof k &&
|
|
8304
8381
|
(process.stderr.write(`
|
|
8305
8382
|
${a.red('Error:')} ${K(e).join(`
|