@teinai/cli 1.1.23 → 1.1.25
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 +317 -247
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -67,26 +67,26 @@ function re() {
|
|
|
67
67
|
return N;
|
|
68
68
|
}
|
|
69
69
|
var E,
|
|
70
|
-
|
|
70
|
+
Ze,
|
|
71
71
|
ke,
|
|
72
72
|
te,
|
|
73
73
|
N,
|
|
74
74
|
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
76
|
((E = _(require('node:fs'))),
|
|
77
|
-
(
|
|
77
|
+
(Ze = _(require('node:os'))),
|
|
78
78
|
(ke = _(require('node:path'))),
|
|
79
|
-
(te = ke.default.join(
|
|
79
|
+
(te = ke.default.join(Ze.default.homedir(), '.tein')),
|
|
80
80
|
(N = ke.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
82
|
var kr,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
et,
|
|
84
|
+
tt,
|
|
85
|
+
rt = y(() => {
|
|
86
86
|
'use strict';
|
|
87
87
|
((kr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
-
(
|
|
89
|
-
(
|
|
88
|
+
(et = [...kr, 'auto']),
|
|
89
|
+
(tt =
|
|
90
90
|
'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
|
|
91
91
|
});
|
|
92
92
|
var G,
|
|
@@ -97,11 +97,11 @@ var G,
|
|
|
97
97
|
function ae(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var at = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var ie,
|
|
104
|
-
|
|
104
|
+
it = y(() => {
|
|
105
105
|
'use strict';
|
|
106
106
|
ie = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
@@ -5842,50 +5842,50 @@ var ie,
|
|
|
5842
5842
|
],
|
|
5843
5843
|
};
|
|
5844
5844
|
});
|
|
5845
|
-
var
|
|
5846
|
-
|
|
5845
|
+
var ne,
|
|
5846
|
+
nt,
|
|
5847
5847
|
Pe = y(() => {
|
|
5848
5848
|
'use strict';
|
|
5849
|
-
((
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
]));
|
|
5849
|
+
((ne = [
|
|
5850
|
+
{
|
|
5851
|
+
slug: 'tein-video-upscaler',
|
|
5852
|
+
name: 'Tein Video Upscaler',
|
|
5853
|
+
family: 'tein-labs',
|
|
5854
|
+
vendor: 'Tein Labs',
|
|
5855
|
+
desc: 'Upscales a video to 1080p, 2K or 4K, keeping faces and details as they are, with optional film grain. Clips up to 30 seconds. Billed on the result: $0.11 per megapixel per second of output, the same on every plan.',
|
|
5856
|
+
kind: 'video',
|
|
5857
|
+
unit: '/sec',
|
|
5858
|
+
api: { model: 'tein-video-upscaler' },
|
|
5859
|
+
variants: [
|
|
5860
|
+
{
|
|
5861
|
+
id: '1080p',
|
|
5862
|
+
label: '1080p',
|
|
5863
|
+
resolution: '1080p',
|
|
5864
|
+
price: { starter: 0.2281, plus: 0.2281, scale: 0.2281 },
|
|
5865
|
+
},
|
|
5866
|
+
{
|
|
5867
|
+
id: '2k',
|
|
5868
|
+
label: '2K',
|
|
5869
|
+
resolution: '2k',
|
|
5870
|
+
price: { starter: 0.4055, plus: 0.4055, scale: 0.4055 },
|
|
5871
|
+
},
|
|
5872
|
+
{
|
|
5873
|
+
id: '4k',
|
|
5874
|
+
label: '4K',
|
|
5875
|
+
resolution: '4k',
|
|
5876
|
+
price: { starter: 0.9124, plus: 0.9124, scale: 0.9124 },
|
|
5877
|
+
},
|
|
5878
|
+
],
|
|
5879
|
+
unfiltered: null,
|
|
5880
|
+
priority: null,
|
|
5881
|
+
draft: null,
|
|
5882
|
+
axes: { resolution: ['1080p', '2k', '4k'] },
|
|
5883
|
+
from: { variant: '1080p' },
|
|
5884
|
+
},
|
|
5885
|
+
]),
|
|
5886
|
+
(nt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler'] }]));
|
|
5887
5887
|
});
|
|
5888
|
-
function
|
|
5888
|
+
function Te(e, t) {
|
|
5889
5889
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
5890
5890
|
}
|
|
5891
5891
|
function Ir(e, t) {
|
|
@@ -5905,10 +5905,10 @@ function Pr(e, t) {
|
|
|
5905
5905
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
5906
5906
|
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5907
5907
|
let n = Ir(r, t),
|
|
5908
|
-
s =
|
|
5908
|
+
s = _e.get(Te('seedance-2', n));
|
|
5909
5909
|
return s ? s.slug : null;
|
|
5910
5910
|
}
|
|
5911
|
-
let a = se.get(r) ??
|
|
5911
|
+
let a = se.get(r) ?? _e.get(Te(r));
|
|
5912
5912
|
return a ? a.slug : null;
|
|
5913
5913
|
}
|
|
5914
5914
|
function vr(e, t) {
|
|
@@ -5921,63 +5921,68 @@ function z(e, t) {
|
|
|
5921
5921
|
function oe() {
|
|
5922
5922
|
return pt;
|
|
5923
5923
|
}
|
|
5924
|
-
var
|
|
5925
|
-
|
|
5924
|
+
var ot,
|
|
5925
|
+
lt,
|
|
5926
5926
|
pt,
|
|
5927
5927
|
wr,
|
|
5928
5928
|
se,
|
|
5929
|
-
|
|
5930
|
-
|
|
5929
|
+
_e,
|
|
5930
|
+
st,
|
|
5931
5931
|
xr,
|
|
5932
|
-
|
|
5932
|
+
ve,
|
|
5933
5933
|
_r,
|
|
5934
5934
|
B = y(() => {
|
|
5935
5935
|
'use strict';
|
|
5936
|
-
|
|
5937
|
-
|
|
5936
|
+
at();
|
|
5937
|
+
it();
|
|
5938
5938
|
Pe();
|
|
5939
|
-
((
|
|
5939
|
+
((ot = {
|
|
5940
5940
|
...ie,
|
|
5941
5941
|
families: ie.families.map((e) => ({ ...e, models: e.models.filter((t) => !ae(t)) })),
|
|
5942
5942
|
models: ie.models.filter((e) => !ae(e.slug)),
|
|
5943
5943
|
}),
|
|
5944
|
-
(
|
|
5945
|
-
(pt = [...
|
|
5946
|
-
(wr =
|
|
5944
|
+
(lt = ne.filter((e) => !ae(e.slug))),
|
|
5945
|
+
(pt = [...ot.models, ...lt]),
|
|
5946
|
+
(wr = [
|
|
5947
|
+
...ot.families,
|
|
5948
|
+
...nt
|
|
5949
|
+
.map((e) => ({ ...e, models: lt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
|
|
5950
|
+
.filter((e) => e.models.length > 0),
|
|
5951
|
+
]),
|
|
5947
5952
|
(se = new Map()),
|
|
5948
|
-
(
|
|
5949
|
-
(
|
|
5953
|
+
(_e = new Map()),
|
|
5954
|
+
(st = new Map()),
|
|
5950
5955
|
(xr = new Map()),
|
|
5951
|
-
(
|
|
5956
|
+
(ve = new Map()));
|
|
5952
5957
|
for (let e of pt) {
|
|
5953
|
-
(se.set(e.slug, e),
|
|
5954
|
-
for (let t of e.variants)
|
|
5958
|
+
(se.set(e.slug, e), _e.set(Te(e.api.model, e.api.quality), e));
|
|
5959
|
+
for (let t of e.variants) st.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
5955
5960
|
for (let t of e.editVariants ?? [])
|
|
5956
|
-
|
|
5961
|
+
st.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
5957
5962
|
for (let t of e.addons ?? []) xr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
5958
|
-
|
|
5963
|
+
ve.set(e.slug, e.family);
|
|
5959
5964
|
}
|
|
5960
|
-
for (let e of wr) for (let t of e.models)
|
|
5965
|
+
for (let e of wr) for (let t of e.models) ve.has(t) || ve.set(t, e.slug);
|
|
5961
5966
|
_r = new Set(['seedance-2']);
|
|
5962
5967
|
});
|
|
5963
5968
|
function le(e) {
|
|
5964
5969
|
let t = e.from?.variant;
|
|
5965
5970
|
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
5966
5971
|
}
|
|
5967
|
-
function
|
|
5972
|
+
function Me(e) {
|
|
5968
5973
|
if (e.endpoints?.length)
|
|
5969
5974
|
return e.editVariants?.length && e.endpoints.some((t) => t.id === dt)
|
|
5970
5975
|
? dt
|
|
5971
5976
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
5972
5977
|
}
|
|
5973
5978
|
var dt,
|
|
5974
|
-
|
|
5979
|
+
Ke = y(() => {
|
|
5975
5980
|
'use strict';
|
|
5976
5981
|
B();
|
|
5977
5982
|
dt = 'dynamic';
|
|
5978
5983
|
});
|
|
5979
5984
|
var pe,
|
|
5980
|
-
|
|
5985
|
+
Se = y(() => {
|
|
5981
5986
|
'use strict';
|
|
5982
5987
|
pe = {
|
|
5983
5988
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -5999,7 +6004,7 @@ var Tr,
|
|
|
5999
6004
|
mt = y(() => {
|
|
6000
6005
|
'use strict';
|
|
6001
6006
|
B();
|
|
6002
|
-
|
|
6007
|
+
Ke();
|
|
6003
6008
|
ct();
|
|
6004
6009
|
Tr = {};
|
|
6005
6010
|
});
|
|
@@ -6121,7 +6126,7 @@ var bt,
|
|
|
6121
6126
|
function wt(e) {
|
|
6122
6127
|
return `$${e}`;
|
|
6123
6128
|
}
|
|
6124
|
-
function
|
|
6129
|
+
function qe(e, t, r) {
|
|
6125
6130
|
return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
|
|
6126
6131
|
}
|
|
6127
6132
|
function Sr(e) {
|
|
@@ -6193,9 +6198,9 @@ function Sr(e) {
|
|
|
6193
6198
|
function xt() {
|
|
6194
6199
|
return Object.fromEntries(
|
|
6195
6200
|
bt.map((e) => {
|
|
6196
|
-
let t =
|
|
6197
|
-
r =
|
|
6198
|
-
a =
|
|
6201
|
+
let t = qe(e.slug, 'cheap', 'input'),
|
|
6202
|
+
r = qe(e.slug, 'cheap', 'output'),
|
|
6203
|
+
a = qe(e.slug, 'stable', 'input') != null,
|
|
6199
6204
|
n = t != null && r != null ? `${wt(t)}/M in \xB7 ${wt(r)}/M out` : '',
|
|
6200
6205
|
s = {
|
|
6201
6206
|
slug: e.slug,
|
|
@@ -6220,7 +6225,7 @@ var It = y(() => {
|
|
|
6220
6225
|
});
|
|
6221
6226
|
var H,
|
|
6222
6227
|
de,
|
|
6223
|
-
|
|
6228
|
+
$e = y(() => {
|
|
6224
6229
|
'use strict';
|
|
6225
6230
|
((H = [
|
|
6226
6231
|
'seedance-2-5',
|
|
@@ -6284,7 +6289,7 @@ function Kt(e) {
|
|
|
6284
6289
|
return {
|
|
6285
6290
|
name: 'endpoint',
|
|
6286
6291
|
type: 'select',
|
|
6287
|
-
default:
|
|
6292
|
+
default: Me(e),
|
|
6288
6293
|
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
6289
6294
|
description:
|
|
6290
6295
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -6296,17 +6301,17 @@ function Kt(e) {
|
|
|
6296
6301
|
function Dr(e, t) {
|
|
6297
6302
|
if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
|
|
6298
6303
|
let r = H.includes(e.api.model);
|
|
6299
|
-
return [...t.filter((a) => !
|
|
6304
|
+
return [...t.filter((a) => !Re.has(a.name)), r ? St : Or];
|
|
6300
6305
|
}
|
|
6301
|
-
function
|
|
6302
|
-
let r = e.filter((n) => !
|
|
6306
|
+
function Ce(e, t) {
|
|
6307
|
+
let r = e.filter((n) => !Re.has(n.name)),
|
|
6303
6308
|
a = [St, Rr];
|
|
6304
6309
|
return (a.push(qt, $t), [...r, ...a]);
|
|
6305
6310
|
}
|
|
6306
6311
|
function Pt(e, t = {}) {
|
|
6307
6312
|
return [
|
|
6308
6313
|
...e
|
|
6309
|
-
.filter((r) => !Lr.has(r.name) && !
|
|
6314
|
+
.filter((r) => !Lr.has(r.name) && !Re.has(r.name))
|
|
6310
6315
|
.map((r) =>
|
|
6311
6316
|
r.name === 'prompt'
|
|
6312
6317
|
? { ...r, required: !0 }
|
|
@@ -6331,7 +6336,7 @@ function Pt(e, t = {}) {
|
|
|
6331
6336
|
$t,
|
|
6332
6337
|
];
|
|
6333
6338
|
}
|
|
6334
|
-
function
|
|
6339
|
+
function Ee(e, t) {
|
|
6335
6340
|
return [
|
|
6336
6341
|
M('Text prompt describing the video.'),
|
|
6337
6342
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
@@ -6374,14 +6379,14 @@ function Vr(e) {
|
|
|
6374
6379
|
O(
|
|
6375
6380
|
e,
|
|
6376
6381
|
e.slug === 'gpt-image-2'
|
|
6377
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
6382
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${tt}`
|
|
6378
6383
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
6379
6384
|
),
|
|
6380
6385
|
{
|
|
6381
6386
|
name: 'aspect_ratio',
|
|
6382
6387
|
type: 'select',
|
|
6383
6388
|
default: 'auto',
|
|
6384
|
-
options: [...
|
|
6389
|
+
options: [...et],
|
|
6385
6390
|
description:
|
|
6386
6391
|
"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.",
|
|
6387
6392
|
},
|
|
@@ -6465,7 +6470,7 @@ function Nr(e) {
|
|
|
6465
6470
|
function jr() {
|
|
6466
6471
|
let e = ht,
|
|
6467
6472
|
t = [];
|
|
6468
|
-
for (let r of
|
|
6473
|
+
for (let r of De(!0))
|
|
6469
6474
|
e.includes(r.name) &&
|
|
6470
6475
|
(t.push({
|
|
6471
6476
|
...r,
|
|
@@ -6488,11 +6493,11 @@ function jr() {
|
|
|
6488
6493
|
return t;
|
|
6489
6494
|
}
|
|
6490
6495
|
function Gr() {
|
|
6491
|
-
return
|
|
6496
|
+
return De(!0).map((e) =>
|
|
6492
6497
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
6493
6498
|
);
|
|
6494
6499
|
}
|
|
6495
|
-
function
|
|
6500
|
+
function De(e) {
|
|
6496
6501
|
return [
|
|
6497
6502
|
M('The user message or task.'),
|
|
6498
6503
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
@@ -6596,12 +6601,12 @@ function zr(e) {
|
|
|
6596
6601
|
: e.slug === 'gemini-3.7-flash'
|
|
6597
6602
|
? Gr()
|
|
6598
6603
|
: e.slug === 'gpt-6-astra' || Fr.includes(e.slug)
|
|
6599
|
-
?
|
|
6604
|
+
? De(e.slug !== 'gpt-6-astra')
|
|
6600
6605
|
: Ur),
|
|
6601
6606
|
...(t ? [t] : []),
|
|
6602
6607
|
];
|
|
6603
6608
|
}
|
|
6604
|
-
function
|
|
6609
|
+
function Ae() {
|
|
6605
6610
|
return {
|
|
6606
6611
|
name: 'image',
|
|
6607
6612
|
type: 'string',
|
|
@@ -6631,22 +6636,87 @@ function Jr(e) {
|
|
|
6631
6636
|
},
|
|
6632
6637
|
];
|
|
6633
6638
|
}
|
|
6634
|
-
function Wr(
|
|
6639
|
+
function Wr() {
|
|
6640
|
+
return [
|
|
6641
|
+
{
|
|
6642
|
+
name: 'mode',
|
|
6643
|
+
type: 'select',
|
|
6644
|
+
default: 'swap',
|
|
6645
|
+
options: ['swap', 'new_scene'],
|
|
6646
|
+
description:
|
|
6647
|
+
'swap puts you into the photo; new_scene keeps only its pose and camera and builds a new place around you.',
|
|
6648
|
+
},
|
|
6649
|
+
{
|
|
6650
|
+
name: 'image_urls',
|
|
6651
|
+
type: 'string',
|
|
6652
|
+
required: !0,
|
|
6653
|
+
description:
|
|
6654
|
+
'The photo: the one to be in (swap), or the one whose pose and camera to copy (new_scene). One image link.',
|
|
6655
|
+
},
|
|
6656
|
+
{
|
|
6657
|
+
name: 'image_urls_2',
|
|
6658
|
+
type: 'string',
|
|
6659
|
+
required: !0,
|
|
6660
|
+
description:
|
|
6661
|
+
'Your photo: one clear photo of you, or of someone who has agreed. One image link.',
|
|
6662
|
+
},
|
|
6663
|
+
{
|
|
6664
|
+
name: 'image_urls_3',
|
|
6665
|
+
type: 'string[]',
|
|
6666
|
+
description: 'swap only. Up to 4 pictures of clothes, accessories or objects to add.',
|
|
6667
|
+
},
|
|
6668
|
+
{
|
|
6669
|
+
name: 'outfit',
|
|
6670
|
+
type: 'select',
|
|
6671
|
+
options: ['theirs', 'mine'],
|
|
6672
|
+
description:
|
|
6673
|
+
'theirs: the clothes of the photo; mine: the outfit from your photo (swap: your whole look). Default: theirs on swap, mine on new_scene. Describe another outfit in add or prompt.',
|
|
6674
|
+
},
|
|
6675
|
+
{ name: 'add', type: 'string', description: 'swap only. What to add and where.' },
|
|
6676
|
+
{
|
|
6677
|
+
name: 'scene',
|
|
6678
|
+
type: 'string',
|
|
6679
|
+
description: 'new_scene only. The new place and its light. Default: a private jet cabin.',
|
|
6680
|
+
},
|
|
6681
|
+
{ name: 'prompt', type: 'string', description: 'Extra direction. Optional.' },
|
|
6682
|
+
{
|
|
6683
|
+
name: 'avoid',
|
|
6684
|
+
type: 'string',
|
|
6685
|
+
description: 'What to leave out of the picture, for example: hat, sunglasses. Optional.',
|
|
6686
|
+
},
|
|
6687
|
+
{
|
|
6688
|
+
name: 'copy_expression',
|
|
6689
|
+
type: 'boolean',
|
|
6690
|
+
default: !0,
|
|
6691
|
+
description:
|
|
6692
|
+
'true: your character takes the facial expression of the person in the photo. false: they keep the expression from their own picture.',
|
|
6693
|
+
},
|
|
6694
|
+
{
|
|
6695
|
+
name: 'aspect_ratio',
|
|
6696
|
+
type: 'select',
|
|
6697
|
+
default: 'adaptive',
|
|
6698
|
+
options: ['adaptive', '1:1', '4:3', '3:4', '16:9', '9:16', '3:2', '2:3', '21:9'],
|
|
6699
|
+
description: 'adaptive keeps the shape of the photo.',
|
|
6700
|
+
},
|
|
6701
|
+
];
|
|
6702
|
+
}
|
|
6703
|
+
function Yr(e) {
|
|
6635
6704
|
let t = e.slug;
|
|
6705
|
+
if (e.family === 'tein-labs' && e.kind === 'image') return Wr();
|
|
6636
6706
|
if (ne.some((r) => r.slug === t)) return Jr(e);
|
|
6637
6707
|
if (e.kind === 'llm') return zr(e);
|
|
6638
6708
|
if (e.editVariants?.length) return Vr(e);
|
|
6639
6709
|
switch (t) {
|
|
6640
6710
|
case 'seedance-2-5':
|
|
6641
|
-
return
|
|
6711
|
+
return Ce(_t, t);
|
|
6642
6712
|
case 'seedance-2-5-lite':
|
|
6643
6713
|
return Pt(_t, { no4k: !0 });
|
|
6644
6714
|
case 'seedance-2':
|
|
6645
|
-
return
|
|
6715
|
+
return Ce(vt, t);
|
|
6646
6716
|
case 'seedance-2-lite':
|
|
6647
6717
|
return Pt(vt);
|
|
6648
6718
|
case 'seedance-2-mini':
|
|
6649
|
-
return
|
|
6719
|
+
return Ce(Qr, t);
|
|
6650
6720
|
case 'nano-banana-2':
|
|
6651
6721
|
case 'nano-banana-2.1':
|
|
6652
6722
|
case 'nano-banana-pro':
|
|
@@ -6801,7 +6871,7 @@ function Wr(e) {
|
|
|
6801
6871
|
];
|
|
6802
6872
|
case 'enhancor-skin-fix-v1':
|
|
6803
6873
|
return [
|
|
6804
|
-
|
|
6874
|
+
Ae(),
|
|
6805
6875
|
{
|
|
6806
6876
|
name: 'mode',
|
|
6807
6877
|
type: 'select',
|
|
@@ -6838,7 +6908,7 @@ function Wr(e) {
|
|
|
6838
6908
|
];
|
|
6839
6909
|
case 'enhancor-skin-fix-v3':
|
|
6840
6910
|
return [
|
|
6841
|
-
|
|
6911
|
+
Ae(),
|
|
6842
6912
|
{
|
|
6843
6913
|
name: 'mask_image',
|
|
6844
6914
|
type: 'string',
|
|
@@ -6878,7 +6948,7 @@ function Wr(e) {
|
|
|
6878
6948
|
];
|
|
6879
6949
|
case 'enhancor-skin-fix-v4':
|
|
6880
6950
|
return [
|
|
6881
|
-
|
|
6951
|
+
Ae(),
|
|
6882
6952
|
{
|
|
6883
6953
|
name: 'mode',
|
|
6884
6954
|
type: 'select',
|
|
@@ -6909,7 +6979,7 @@ function Wr(e) {
|
|
|
6909
6979
|
];
|
|
6910
6980
|
case 'wan-3-0':
|
|
6911
6981
|
case 'wan-3-0-prime':
|
|
6912
|
-
return
|
|
6982
|
+
return Ee(e, {
|
|
6913
6983
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6914
6984
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
6915
6985
|
minSec: 2,
|
|
@@ -6919,7 +6989,7 @@ function Wr(e) {
|
|
|
6919
6989
|
});
|
|
6920
6990
|
case 'happy-horse-1-1':
|
|
6921
6991
|
case 'happy-horse-1-0':
|
|
6922
|
-
return
|
|
6992
|
+
return Ee(e, {
|
|
6923
6993
|
modes:
|
|
6924
6994
|
t === 'happy-horse-1-0'
|
|
6925
6995
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -6930,7 +7000,7 @@ function Wr(e) {
|
|
|
6930
7000
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
6931
7001
|
});
|
|
6932
7002
|
case 'minimax-h3':
|
|
6933
|
-
return
|
|
7003
|
+
return Ee(e, {
|
|
6934
7004
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
6935
7005
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
6936
7006
|
minSec: 4,
|
|
@@ -6941,7 +7011,7 @@ function Wr(e) {
|
|
|
6941
7011
|
return [M('Prompt text.')];
|
|
6942
7012
|
}
|
|
6943
7013
|
}
|
|
6944
|
-
function
|
|
7014
|
+
function Oe(e, t = e.api.model) {
|
|
6945
7015
|
return {
|
|
6946
7016
|
slug: t,
|
|
6947
7017
|
name: e.name,
|
|
@@ -6952,24 +7022,24 @@ function De(e, t = e.api.model) {
|
|
|
6952
7022
|
priceFormatted: Er(e),
|
|
6953
7023
|
unit: e.unit,
|
|
6954
7024
|
primaryToolName: $r[e.kind],
|
|
6955
|
-
parameters: Dr(e,
|
|
7025
|
+
parameters: Dr(e, Yr(e)),
|
|
6956
7026
|
};
|
|
6957
7027
|
}
|
|
6958
|
-
function
|
|
7028
|
+
function Xr() {
|
|
6959
7029
|
let e = {};
|
|
6960
7030
|
for (let t of oe())
|
|
6961
7031
|
if (t.slug !== 'seedance-2-fast') {
|
|
6962
7032
|
if (t.slug === 'seedance-2-mini') {
|
|
6963
|
-
e['seedance-2-mini'] =
|
|
7033
|
+
e['seedance-2-mini'] = Oe(t, 'seedance-2-mini');
|
|
6964
7034
|
continue;
|
|
6965
7035
|
}
|
|
6966
7036
|
if (t.slug === 'seedance-2') {
|
|
6967
|
-
let r =
|
|
7037
|
+
let r = Oe(t);
|
|
6968
7038
|
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
6969
7039
|
(e['seedance-2'] = r));
|
|
6970
7040
|
continue;
|
|
6971
7041
|
}
|
|
6972
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
7042
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Oe(t));
|
|
6973
7043
|
}
|
|
6974
7044
|
Object.assign(e, xt());
|
|
6975
7045
|
for (let [t, r] of Object.entries(pe))
|
|
@@ -6982,7 +7052,7 @@ function me(e) {
|
|
|
6982
7052
|
function F(e) {
|
|
6983
7053
|
return ue[e] ?? null;
|
|
6984
7054
|
}
|
|
6985
|
-
function
|
|
7055
|
+
function Zr(e, t, r) {
|
|
6986
7056
|
if (e.startsWith('enhancor-skin-fix-')) return !1;
|
|
6987
7057
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
6988
7058
|
let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
@@ -7000,13 +7070,13 @@ function At(e, t) {
|
|
|
7000
7070
|
let r = { ...t };
|
|
7001
7071
|
if (e?.slug === 'seedance-2-5') {
|
|
7002
7072
|
let a = (n) => typeof n != 'string' || !n.trim();
|
|
7003
|
-
for (let n of
|
|
7073
|
+
for (let n of ea) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
|
|
7004
7074
|
if (!a(r.finalize)) return r;
|
|
7005
7075
|
}
|
|
7006
7076
|
for (let a of e?.parameters ?? [])
|
|
7007
7077
|
a.default !== void 0 &&
|
|
7008
7078
|
r[a.name] === void 0 &&
|
|
7009
|
-
|
|
7079
|
+
Zr(e.slug, a.name, t) &&
|
|
7010
7080
|
(r[a.name] = a.default);
|
|
7011
7081
|
return r;
|
|
7012
7082
|
}
|
|
@@ -7022,7 +7092,7 @@ var qr,
|
|
|
7022
7092
|
Rr,
|
|
7023
7093
|
qt,
|
|
7024
7094
|
$t,
|
|
7025
|
-
|
|
7095
|
+
Re,
|
|
7026
7096
|
Lr,
|
|
7027
7097
|
Ur,
|
|
7028
7098
|
Br,
|
|
@@ -7033,22 +7103,22 @@ var qr,
|
|
|
7033
7103
|
Ct,
|
|
7034
7104
|
Et,
|
|
7035
7105
|
vt,
|
|
7036
|
-
|
|
7106
|
+
Qr,
|
|
7037
7107
|
ue,
|
|
7038
|
-
|
|
7108
|
+
ea,
|
|
7039
7109
|
W = y(() => {
|
|
7040
7110
|
'use strict';
|
|
7041
|
-
|
|
7111
|
+
rt();
|
|
7042
7112
|
Ie();
|
|
7043
7113
|
B();
|
|
7044
|
-
|
|
7114
|
+
Ke();
|
|
7045
7115
|
Pe();
|
|
7046
|
-
|
|
7116
|
+
Se();
|
|
7047
7117
|
mt();
|
|
7048
7118
|
gt();
|
|
7049
7119
|
yt();
|
|
7050
7120
|
It();
|
|
7051
|
-
|
|
7121
|
+
$e();
|
|
7052
7122
|
((qr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
7053
7123
|
($r = {
|
|
7054
7124
|
video: 'generate_video',
|
|
@@ -7094,7 +7164,7 @@ var qr,
|
|
|
7094
7164
|
description:
|
|
7095
7165
|
'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.',
|
|
7096
7166
|
}),
|
|
7097
|
-
(
|
|
7167
|
+
(Re = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
7098
7168
|
Lr = new Set([
|
|
7099
7169
|
'quality',
|
|
7100
7170
|
'bitrate_mode',
|
|
@@ -7493,7 +7563,7 @@ var qr,
|
|
|
7493
7563
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7494
7564
|
},
|
|
7495
7565
|
]),
|
|
7496
|
-
(
|
|
7566
|
+
(Qr = [
|
|
7497
7567
|
{
|
|
7498
7568
|
name: 'prompt',
|
|
7499
7569
|
type: 'string',
|
|
@@ -7564,15 +7634,15 @@ var qr,
|
|
|
7564
7634
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
7565
7635
|
},
|
|
7566
7636
|
]));
|
|
7567
|
-
ue =
|
|
7568
|
-
|
|
7637
|
+
ue = Xr();
|
|
7638
|
+
ea = ['draft_task_id', 'draft_generation_id'];
|
|
7569
7639
|
});
|
|
7570
7640
|
function fe(e) {
|
|
7571
7641
|
let t = '/v1/pricing/models',
|
|
7572
7642
|
r = e?.trim();
|
|
7573
7643
|
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
7574
7644
|
}
|
|
7575
|
-
var
|
|
7645
|
+
var Ve = y(() => {
|
|
7576
7646
|
'use strict';
|
|
7577
7647
|
});
|
|
7578
7648
|
function Gt(e) {
|
|
@@ -7590,14 +7660,14 @@ function zt(e) {
|
|
|
7590
7660
|
'The Acceptable Use Policy applies.',
|
|
7591
7661
|
].join(' ');
|
|
7592
7662
|
}
|
|
7593
|
-
function
|
|
7594
|
-
if (
|
|
7663
|
+
function _a(e) {
|
|
7664
|
+
if (Ia.has(e.name)) return e;
|
|
7595
7665
|
let t = e.inputSchema.properties;
|
|
7596
7666
|
return !t || t.callback_url
|
|
7597
7667
|
? e
|
|
7598
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7668
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: xa } } };
|
|
7599
7669
|
}
|
|
7600
|
-
function
|
|
7670
|
+
function va(e) {
|
|
7601
7671
|
let t = e.inputSchema.properties;
|
|
7602
7672
|
if (!t) return e;
|
|
7603
7673
|
let r = !1,
|
|
@@ -7610,7 +7680,7 @@ function _a(e) {
|
|
|
7610
7680
|
: (a[n] = s);
|
|
7611
7681
|
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
|
|
7612
7682
|
}
|
|
7613
|
-
function
|
|
7683
|
+
function Ta(e) {
|
|
7614
7684
|
switch (e.type) {
|
|
7615
7685
|
case 'string':
|
|
7616
7686
|
return {
|
|
@@ -7665,11 +7735,11 @@ function va(e) {
|
|
|
7665
7735
|
return { type: 'string', description: e.description };
|
|
7666
7736
|
}
|
|
7667
7737
|
}
|
|
7668
|
-
function
|
|
7738
|
+
function Ma(e, t) {
|
|
7669
7739
|
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7670
7740
|
a = {},
|
|
7671
7741
|
n = [];
|
|
7672
|
-
for (let o of e.parameters) ((a[o.name] =
|
|
7742
|
+
for (let o of e.parameters) ((a[o.name] = Ta(o)), o.required && n.push(o.name));
|
|
7673
7743
|
let s = {
|
|
7674
7744
|
type: 'object',
|
|
7675
7745
|
properties: a,
|
|
@@ -7682,7 +7752,7 @@ function Ta(e, t) {
|
|
|
7682
7752
|
inputSchema: s,
|
|
7683
7753
|
};
|
|
7684
7754
|
}
|
|
7685
|
-
function
|
|
7755
|
+
function Ka() {
|
|
7686
7756
|
let e = R().filter((d) => d.category === 'Image' && !me(d)),
|
|
7687
7757
|
t = R().filter((d) => d.category === 'Video'),
|
|
7688
7758
|
r = R().filter((d) => d.category === 'Text'),
|
|
@@ -7953,10 +8023,10 @@ function Ma() {
|
|
|
7953
8023
|
additionalProperties: !0,
|
|
7954
8024
|
},
|
|
7955
8025
|
},
|
|
7956
|
-
p =
|
|
7957
|
-
return [n, s, o, u, l, p, c,
|
|
8026
|
+
p = Sa();
|
|
8027
|
+
return [n, s, o, u, l, p, c, Pa];
|
|
7958
8028
|
}
|
|
7959
|
-
function
|
|
8029
|
+
function Sa() {
|
|
7960
8030
|
return {
|
|
7961
8031
|
name: 'upload_asset',
|
|
7962
8032
|
description:
|
|
@@ -8003,26 +8073,26 @@ function Ka() {
|
|
|
8003
8073
|
},
|
|
8004
8074
|
};
|
|
8005
8075
|
}
|
|
8006
|
-
function
|
|
8007
|
-
let e =
|
|
8008
|
-
t = R().map((r) =>
|
|
8009
|
-
return [...e, ...t].map(
|
|
8076
|
+
function Ge() {
|
|
8077
|
+
let e = Ka(),
|
|
8078
|
+
t = R().map((r) => Ma(r));
|
|
8079
|
+
return [...e, ...t].map(_a).map(va);
|
|
8010
8080
|
}
|
|
8011
|
-
var
|
|
8012
|
-
xa,
|
|
8081
|
+
var xa,
|
|
8013
8082
|
Ia,
|
|
8083
|
+
Pa,
|
|
8014
8084
|
Ht,
|
|
8015
8085
|
Jt = y(() => {
|
|
8016
8086
|
'use strict';
|
|
8017
8087
|
B();
|
|
8018
|
-
|
|
8088
|
+
$e();
|
|
8019
8089
|
W();
|
|
8020
|
-
((
|
|
8090
|
+
((xa = {
|
|
8021
8091
|
type: 'string',
|
|
8022
8092
|
description:
|
|
8023
8093
|
'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.',
|
|
8024
8094
|
}),
|
|
8025
|
-
(
|
|
8095
|
+
(Ia = new Set([
|
|
8026
8096
|
'upload_asset',
|
|
8027
8097
|
'upload_media',
|
|
8028
8098
|
'upload_image',
|
|
@@ -8030,7 +8100,7 @@ var wa,
|
|
|
8030
8100
|
'check_status',
|
|
8031
8101
|
'get_pricing',
|
|
8032
8102
|
])),
|
|
8033
|
-
(
|
|
8103
|
+
(Pa = {
|
|
8034
8104
|
name: 'get_pricing',
|
|
8035
8105
|
description:
|
|
8036
8106
|
'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.',
|
|
@@ -8064,12 +8134,12 @@ var wa,
|
|
|
8064
8134
|
});
|
|
8065
8135
|
var ir = {};
|
|
8066
8136
|
ur(ir, {
|
|
8067
|
-
forgetToolSchemas: () =>
|
|
8137
|
+
forgetToolSchemas: () => Aa,
|
|
8068
8138
|
jsonRpcAnswer: () => Xt,
|
|
8069
8139
|
preprocessLocalFiles: () => rr,
|
|
8070
8140
|
startStdioServer: () => ar,
|
|
8071
8141
|
});
|
|
8072
|
-
function
|
|
8142
|
+
function qa(e) {
|
|
8073
8143
|
let t = (r) =>
|
|
8074
8144
|
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
8075
8145
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
@@ -8083,7 +8153,7 @@ function Xt(e, t, r) {
|
|
|
8083
8153
|
} catch {
|
|
8084
8154
|
s = null;
|
|
8085
8155
|
}
|
|
8086
|
-
if (s !== null &&
|
|
8156
|
+
if (s !== null && qa(s)) return n ? null : s;
|
|
8087
8157
|
if (n) return null;
|
|
8088
8158
|
if (!r && t >= 200 && t < 300) return;
|
|
8089
8159
|
let o = s?.error,
|
|
@@ -8104,7 +8174,7 @@ function Xt(e, t, r) {
|
|
|
8104
8174
|
},
|
|
8105
8175
|
};
|
|
8106
8176
|
}
|
|
8107
|
-
function
|
|
8177
|
+
function $a() {
|
|
8108
8178
|
let e = process.argv.slice(2),
|
|
8109
8179
|
t = e.indexOf('--api-key');
|
|
8110
8180
|
return q(t >= 0 ? e[t + 1] : void 0);
|
|
@@ -8139,14 +8209,14 @@ async function Zt(e, t, r) {
|
|
|
8139
8209
|
};
|
|
8140
8210
|
}
|
|
8141
8211
|
function er(e) {
|
|
8142
|
-
return
|
|
8212
|
+
return Ca.has(j.default.extname(e).toLowerCase());
|
|
8143
8213
|
}
|
|
8144
8214
|
function tr(e) {
|
|
8145
8215
|
return new Error(
|
|
8146
8216
|
`Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
|
|
8147
8217
|
);
|
|
8148
8218
|
}
|
|
8149
|
-
function
|
|
8219
|
+
function Ea(e) {
|
|
8150
8220
|
let t = e.trim();
|
|
8151
8221
|
if (
|
|
8152
8222
|
!t ||
|
|
@@ -8159,7 +8229,7 @@ function Ca(e) {
|
|
|
8159
8229
|
let r = j.default.resolve(t);
|
|
8160
8230
|
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
8161
8231
|
}
|
|
8162
|
-
function
|
|
8232
|
+
function He(e) {
|
|
8163
8233
|
if (Array.isArray(e))
|
|
8164
8234
|
for (let t of e) {
|
|
8165
8235
|
let r = t;
|
|
@@ -8169,12 +8239,12 @@ function We(e) {
|
|
|
8169
8239
|
X.set(r.name, r.inputSchema);
|
|
8170
8240
|
}
|
|
8171
8241
|
}
|
|
8172
|
-
function
|
|
8173
|
-
(X.clear(), (
|
|
8242
|
+
function Aa() {
|
|
8243
|
+
(X.clear(), (ze = 0));
|
|
8174
8244
|
}
|
|
8175
|
-
async function
|
|
8176
|
-
if (!(Date.now() -
|
|
8177
|
-
|
|
8245
|
+
async function Oa(e, t) {
|
|
8246
|
+
if (!(Date.now() - ze < 6e4)) {
|
|
8247
|
+
ze = Date.now();
|
|
8178
8248
|
try {
|
|
8179
8249
|
let a = await (
|
|
8180
8250
|
await fetch(e, {
|
|
@@ -8184,11 +8254,11 @@ async function Aa(e, t) {
|
|
|
8184
8254
|
signal: AbortSignal.timeout(1e4),
|
|
8185
8255
|
})
|
|
8186
8256
|
).json();
|
|
8187
|
-
|
|
8257
|
+
He(a.result?.tools);
|
|
8188
8258
|
} catch {}
|
|
8189
8259
|
}
|
|
8190
8260
|
}
|
|
8191
|
-
function
|
|
8261
|
+
function Ra(e) {
|
|
8192
8262
|
return e
|
|
8193
8263
|
? e.type === 'string'
|
|
8194
8264
|
? e.format === 'uri'
|
|
@@ -8197,18 +8267,18 @@ function Oa(e) {
|
|
|
8197
8267
|
}
|
|
8198
8268
|
async function Wt(e, t, r) {
|
|
8199
8269
|
if (typeof e != 'string') return e;
|
|
8200
|
-
let a =
|
|
8270
|
+
let a = Ea(e);
|
|
8201
8271
|
if (!a) return e;
|
|
8202
8272
|
if (!er(a)) throw tr(a);
|
|
8203
8273
|
return (await Zt(a, t, r)).url;
|
|
8204
8274
|
}
|
|
8205
8275
|
async function rr(e, t, r, a, n) {
|
|
8206
|
-
(X.size === 0 &&
|
|
8276
|
+
(X.size === 0 && He(Ge()), X.has(e) || (await Oa(n, r)));
|
|
8207
8277
|
let s = X.get(e)?.properties;
|
|
8208
8278
|
if (!s) return t;
|
|
8209
8279
|
let o = { ...t };
|
|
8210
8280
|
for (let [u, l] of Object.entries(t))
|
|
8211
|
-
if (
|
|
8281
|
+
if (Ra(s[u]))
|
|
8212
8282
|
if (Array.isArray(l)) {
|
|
8213
8283
|
let c = [];
|
|
8214
8284
|
for (let p of l) c.push(await Wt(p, r, a));
|
|
@@ -8216,7 +8286,7 @@ async function rr(e, t, r, a, n) {
|
|
|
8216
8286
|
} else o[u] = await Wt(l, r, a);
|
|
8217
8287
|
return o;
|
|
8218
8288
|
}
|
|
8219
|
-
function
|
|
8289
|
+
function Da(e) {
|
|
8220
8290
|
let t = e.id ?? null;
|
|
8221
8291
|
switch (e.method) {
|
|
8222
8292
|
case 'initialize':
|
|
@@ -8234,7 +8304,7 @@ function Ra(e) {
|
|
|
8234
8304
|
case 'ping':
|
|
8235
8305
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
8236
8306
|
case 'tools/list':
|
|
8237
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
8307
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ge() } };
|
|
8238
8308
|
case 'tools/call':
|
|
8239
8309
|
return {
|
|
8240
8310
|
jsonrpc: '2.0',
|
|
@@ -8260,7 +8330,7 @@ function Ra(e) {
|
|
|
8260
8330
|
async function ar() {
|
|
8261
8331
|
if (Yt) return;
|
|
8262
8332
|
Yt = !0;
|
|
8263
|
-
let e =
|
|
8333
|
+
let e = $a(),
|
|
8264
8334
|
t = P(),
|
|
8265
8335
|
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
8266
8336
|
(Qt.default
|
|
@@ -8415,7 +8485,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8415
8485
|
p = Xt(o, l.status, c);
|
|
8416
8486
|
if (p === null) return;
|
|
8417
8487
|
if (p) {
|
|
8418
|
-
(o?.method === 'tools/list' &&
|
|
8488
|
+
(o?.method === 'tools/list' && He(p.result?.tools),
|
|
8419
8489
|
process.stdout.write(
|
|
8420
8490
|
JSON.stringify(p) +
|
|
8421
8491
|
`
|
|
@@ -8424,7 +8494,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8424
8494
|
return;
|
|
8425
8495
|
}
|
|
8426
8496
|
} catch {}
|
|
8427
|
-
let u =
|
|
8497
|
+
let u = Da(o);
|
|
8428
8498
|
u !== null &&
|
|
8429
8499
|
process.stdout.write(
|
|
8430
8500
|
JSON.stringify(u) +
|
|
@@ -8450,19 +8520,19 @@ Pass this URL to any Tein generation tool.`,
|
|
|
8450
8520
|
var D,
|
|
8451
8521
|
j,
|
|
8452
8522
|
Qt,
|
|
8453
|
-
|
|
8523
|
+
Ca,
|
|
8454
8524
|
X,
|
|
8455
|
-
|
|
8525
|
+
ze,
|
|
8456
8526
|
Yt,
|
|
8457
8527
|
nr = y(() => {
|
|
8458
8528
|
'use strict';
|
|
8459
8529
|
((D = _(require('node:fs'))),
|
|
8460
8530
|
(j = _(require('node:path'))),
|
|
8461
8531
|
(Qt = _(require('node:readline'))));
|
|
8462
|
-
|
|
8532
|
+
Ve();
|
|
8463
8533
|
Jt();
|
|
8464
8534
|
A();
|
|
8465
|
-
|
|
8535
|
+
Ca = new Set([
|
|
8466
8536
|
'.png',
|
|
8467
8537
|
'.jpg',
|
|
8468
8538
|
'.jpeg',
|
|
@@ -8488,7 +8558,7 @@ var D,
|
|
|
8488
8558
|
'.flac',
|
|
8489
8559
|
'.opus',
|
|
8490
8560
|
]);
|
|
8491
|
-
((X = new Map()), (
|
|
8561
|
+
((X = new Map()), (ze = 0));
|
|
8492
8562
|
Yt = !1;
|
|
8493
8563
|
require.main === module &&
|
|
8494
8564
|
ar().catch((e) => {
|
|
@@ -8588,8 +8658,8 @@ var i = {
|
|
|
8588
8658
|
var V = _(require('node:fs')),
|
|
8589
8659
|
$ = _(require('node:path'));
|
|
8590
8660
|
var ee = _(require('node:fs')),
|
|
8591
|
-
|
|
8592
|
-
|
|
8661
|
+
Qe = _(require('node:path')),
|
|
8662
|
+
Xe = require('node:stream/promises');
|
|
8593
8663
|
var Z = '1.1.7';
|
|
8594
8664
|
var gr = new Set([
|
|
8595
8665
|
'account_suspended',
|
|
@@ -8625,13 +8695,13 @@ function yr(e, t, r) {
|
|
|
8625
8695
|
c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
|
|
8626
8696
|
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
8627
8697
|
}
|
|
8628
|
-
function
|
|
8698
|
+
function We(e) {
|
|
8629
8699
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
8630
8700
|
}
|
|
8631
8701
|
function S(e) {
|
|
8632
8702
|
let t = [e.message],
|
|
8633
|
-
r =
|
|
8634
|
-
a =
|
|
8703
|
+
r = We(e.fields.required),
|
|
8704
|
+
a = We(e.fields.balance);
|
|
8635
8705
|
(r || a) &&
|
|
8636
8706
|
t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
|
|
8637
8707
|
let n = e.fields.org_name ?? e.fields.orgName;
|
|
@@ -8646,7 +8716,7 @@ function br(e) {
|
|
|
8646
8716
|
? 'audio'
|
|
8647
8717
|
: 'image';
|
|
8648
8718
|
}
|
|
8649
|
-
function
|
|
8719
|
+
function Ye(e) {
|
|
8650
8720
|
let t = [];
|
|
8651
8721
|
for (let r of e.data ?? [])
|
|
8652
8722
|
typeof r.message?.content == 'string'
|
|
@@ -8691,7 +8761,7 @@ var K = class {
|
|
|
8691
8761
|
n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
|
|
8692
8762
|
? n
|
|
8693
8763
|
: 'processing',
|
|
8694
|
-
o =
|
|
8764
|
+
o = Ye(a);
|
|
8695
8765
|
return {
|
|
8696
8766
|
request_id: a.request_id || a.id || '',
|
|
8697
8767
|
model: a.model,
|
|
@@ -8709,7 +8779,7 @@ var K = class {
|
|
|
8709
8779
|
a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
|
|
8710
8780
|
? a
|
|
8711
8781
|
: 'processing',
|
|
8712
|
-
s =
|
|
8782
|
+
s = Ye(r),
|
|
8713
8783
|
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
8714
8784
|
return {
|
|
8715
8785
|
request_id: r.id || t,
|
|
@@ -8727,10 +8797,10 @@ var K = class {
|
|
|
8727
8797
|
async downloadOutput(t, r) {
|
|
8728
8798
|
let a = await fetch(t);
|
|
8729
8799
|
if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
|
|
8730
|
-
let n =
|
|
8800
|
+
let n = Qe.default.dirname(r);
|
|
8731
8801
|
ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
|
|
8732
8802
|
let s = ee.default.createWriteStream(r);
|
|
8733
|
-
return (await (0,
|
|
8803
|
+
return (await (0, Xe.pipeline)(a.body, s), r);
|
|
8734
8804
|
}
|
|
8735
8805
|
};
|
|
8736
8806
|
A();
|
|
@@ -8744,28 +8814,28 @@ function xe(e) {
|
|
|
8744
8814
|
}
|
|
8745
8815
|
W();
|
|
8746
8816
|
var Ot = ['images', 'input_images', 'videos', 'audios'];
|
|
8747
|
-
function
|
|
8817
|
+
function ta(e) {
|
|
8748
8818
|
for (let t of Ot) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
8749
8819
|
}
|
|
8750
|
-
function
|
|
8820
|
+
function ra(e) {
|
|
8751
8821
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
8752
8822
|
let t = $.default.resolve(e);
|
|
8753
8823
|
return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
|
|
8754
8824
|
}
|
|
8755
|
-
async function
|
|
8825
|
+
async function aa(e, t) {
|
|
8756
8826
|
for (let r of Ot) {
|
|
8757
8827
|
if (!Array.isArray(e[r])) continue;
|
|
8758
8828
|
let a = [];
|
|
8759
8829
|
for (let n of e[r]) {
|
|
8760
8830
|
if (typeof n != 'string') continue;
|
|
8761
|
-
let s =
|
|
8831
|
+
let s = ra(n);
|
|
8762
8832
|
a.push(s ? await t(s) : n);
|
|
8763
8833
|
}
|
|
8764
8834
|
e[r] = a;
|
|
8765
8835
|
}
|
|
8766
8836
|
}
|
|
8767
|
-
var Y = { starter: 10, plus: 25, scale: 40, enterprise:
|
|
8768
|
-
function
|
|
8837
|
+
var Y = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
|
|
8838
|
+
function ia(e) {
|
|
8769
8839
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
8770
8840
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
8771
8841
|
r = Y.enterprise;
|
|
@@ -8778,7 +8848,7 @@ function aa(e) {
|
|
|
8778
8848
|
t
|
|
8779
8849
|
);
|
|
8780
8850
|
}
|
|
8781
|
-
async function
|
|
8851
|
+
async function na(e, t, r, a, n) {
|
|
8782
8852
|
n.isJson ||
|
|
8783
8853
|
process.stderr.write(`Starting ${a} ${t} jobs together...
|
|
8784
8854
|
`);
|
|
@@ -8853,7 +8923,7 @@ async function ia(e, t, r, a, n) {
|
|
|
8853
8923
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
8854
8924
|
process.exit(v);
|
|
8855
8925
|
}
|
|
8856
|
-
function
|
|
8926
|
+
function sa(e, t, r) {
|
|
8857
8927
|
if (r <= 1) return e;
|
|
8858
8928
|
let a = $.default.extname(e);
|
|
8859
8929
|
return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
|
|
@@ -8903,7 +8973,7 @@ function Rt(e) {
|
|
|
8903
8973
|
}
|
|
8904
8974
|
return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
|
|
8905
8975
|
}
|
|
8906
|
-
async function
|
|
8976
|
+
async function Le(e, t) {
|
|
8907
8977
|
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8908
8978
|
a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8909
8979
|
(r ||
|
|
@@ -8925,7 +8995,7 @@ async function Ne(e, t) {
|
|
|
8925
8995
|
s = !!t.json,
|
|
8926
8996
|
o = !!(t.async || t.no_wait),
|
|
8927
8997
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
8928
|
-
l =
|
|
8998
|
+
l = ia(t),
|
|
8929
8999
|
c = { ...t };
|
|
8930
9000
|
(delete c.json,
|
|
8931
9001
|
delete c.async,
|
|
@@ -8935,7 +9005,7 @@ async function Ne(e, t) {
|
|
|
8935
9005
|
delete c.api_url,
|
|
8936
9006
|
delete c.count);
|
|
8937
9007
|
let p = At(n, c);
|
|
8938
|
-
(
|
|
9008
|
+
(ta(p),
|
|
8939
9009
|
typeof p.image == 'string' && !p.images && !me(n) && ((p.images = [p.image]), delete p.image),
|
|
8940
9010
|
p.image_url &&
|
|
8941
9011
|
!p.first_frame_image &&
|
|
@@ -8976,7 +9046,7 @@ async function Ne(e, t) {
|
|
|
8976
9046
|
}
|
|
8977
9047
|
}
|
|
8978
9048
|
}
|
|
8979
|
-
await
|
|
9049
|
+
await aa(p, async (b) => {
|
|
8980
9050
|
let g = new T(`Uploading local file ${$.default.basename(b)} to CDN...`);
|
|
8981
9051
|
s || g.start();
|
|
8982
9052
|
try {
|
|
@@ -9000,7 +9070,7 @@ async function Ne(e, t) {
|
|
|
9000
9070
|
let f;
|
|
9001
9071
|
try {
|
|
9002
9072
|
if (l > 1) {
|
|
9003
|
-
await
|
|
9073
|
+
await na(d, e, p, l, { isJson: s, isAsync: o });
|
|
9004
9074
|
return;
|
|
9005
9075
|
}
|
|
9006
9076
|
f = await d.queueJob(e, p);
|
|
@@ -9103,13 +9173,13 @@ ${i.bold('Outputs:')}
|
|
|
9103
9173
|
`),
|
|
9104
9174
|
u)
|
|
9105
9175
|
) {
|
|
9106
|
-
let C =
|
|
9107
|
-
|
|
9176
|
+
let C = sa(u, g++, b),
|
|
9177
|
+
Je = new T(`Downloading output to ${C}...`).start();
|
|
9108
9178
|
try {
|
|
9109
9179
|
(await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
|
|
9110
|
-
|
|
9180
|
+
Je.succeed(`Saved to ${i.bold(C)}`));
|
|
9111
9181
|
} catch (ye) {
|
|
9112
|
-
|
|
9182
|
+
Je.fail(`Failed to download: ${ye instanceof Error ? ye.message : ye}`);
|
|
9113
9183
|
}
|
|
9114
9184
|
}
|
|
9115
9185
|
} else
|
|
@@ -9124,7 +9194,7 @@ ${I.text}
|
|
|
9124
9194
|
}
|
|
9125
9195
|
var Dt = _(require('node:readline'));
|
|
9126
9196
|
A();
|
|
9127
|
-
async function
|
|
9197
|
+
async function oa(e) {
|
|
9128
9198
|
try {
|
|
9129
9199
|
return (await new K(e, P()).checkKey(), 'ok');
|
|
9130
9200
|
} catch (t) {
|
|
@@ -9135,7 +9205,7 @@ async function sa(e) {
|
|
|
9135
9205
|
return 'unchecked';
|
|
9136
9206
|
}
|
|
9137
9207
|
}
|
|
9138
|
-
function
|
|
9208
|
+
function la(e) {
|
|
9139
9209
|
let t = Dt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
9140
9210
|
return new Promise((r) => {
|
|
9141
9211
|
t.question(e, (a) => {
|
|
@@ -9155,14 +9225,14 @@ ${i.bold('Tein AI Authentication')}
|
|
|
9155
9225
|
process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
|
|
9156
9226
|
|
|
9157
9227
|
`),
|
|
9158
|
-
(r = await
|
|
9228
|
+
(r = await la('Enter your Tein API Key (sk_live_...): '))),
|
|
9159
9229
|
!r.startsWith('sk_live_') &&
|
|
9160
9230
|
!r.startsWith('sk_test_') &&
|
|
9161
9231
|
(process.stderr
|
|
9162
9232
|
.write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
9163
9233
|
`),
|
|
9164
9234
|
process.exit(1)));
|
|
9165
|
-
let a = await
|
|
9235
|
+
let a = await oa(r);
|
|
9166
9236
|
(a === 'invalid' &&
|
|
9167
9237
|
(process.stderr
|
|
9168
9238
|
.write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -9234,10 +9304,10 @@ ${i.bold('Tein AI CLI Configuration')}
|
|
|
9234
9304
|
A();
|
|
9235
9305
|
Ie();
|
|
9236
9306
|
W();
|
|
9237
|
-
var
|
|
9307
|
+
var pa = 3e3;
|
|
9238
9308
|
async function Lt(e) {
|
|
9239
9309
|
try {
|
|
9240
|
-
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
9310
|
+
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(pa) });
|
|
9241
9311
|
if (!t.ok) return;
|
|
9242
9312
|
let r = await t.json(),
|
|
9243
9313
|
a = {};
|
|
@@ -9248,15 +9318,15 @@ async function Lt(e) {
|
|
|
9248
9318
|
Mt(a);
|
|
9249
9319
|
} catch {}
|
|
9250
9320
|
}
|
|
9251
|
-
var
|
|
9252
|
-
|
|
9321
|
+
var da = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
9322
|
+
ca = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
9253
9323
|
async function Vt(e, t) {
|
|
9254
9324
|
await Lt(t);
|
|
9255
9325
|
let r = R();
|
|
9256
9326
|
if (e) {
|
|
9257
9327
|
let s = e.toLowerCase(),
|
|
9258
|
-
o =
|
|
9259
|
-
r =
|
|
9328
|
+
o = ca[s] ?? s;
|
|
9329
|
+
r = da.has(o)
|
|
9260
9330
|
? r.filter((u) => u.category.toLowerCase() === o)
|
|
9261
9331
|
: r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
9262
9332
|
}
|
|
@@ -9376,9 +9446,9 @@ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
|
|
|
9376
9446
|
`);
|
|
9377
9447
|
}
|
|
9378
9448
|
A();
|
|
9379
|
-
|
|
9380
|
-
var
|
|
9381
|
-
|
|
9449
|
+
Ve();
|
|
9450
|
+
var ua = 1e4,
|
|
9451
|
+
Ue = {
|
|
9382
9452
|
price: '',
|
|
9383
9453
|
creativeMode: 'Creative mode',
|
|
9384
9454
|
priority: 'Priority',
|
|
@@ -9388,22 +9458,22 @@ var ca = 1e4,
|
|
|
9388
9458
|
priorityDraft: 'Priority + Draft',
|
|
9389
9459
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
9390
9460
|
},
|
|
9391
|
-
|
|
9392
|
-
|
|
9461
|
+
ma = Object.keys(Ue),
|
|
9462
|
+
fa = {
|
|
9393
9463
|
creativeMode: 'unfiltered',
|
|
9394
9464
|
creativeModePriority: 'unfilteredPriority',
|
|
9395
9465
|
creativeModeDraft: 'unfilteredDraft',
|
|
9396
9466
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
9397
9467
|
};
|
|
9398
|
-
function
|
|
9399
|
-
let r =
|
|
9468
|
+
function ga(e, t) {
|
|
9469
|
+
let r = fa[t];
|
|
9400
9470
|
return e[t] ?? (r ? e[r] : void 0);
|
|
9401
9471
|
}
|
|
9402
|
-
async function
|
|
9472
|
+
async function ha(e, t) {
|
|
9403
9473
|
let r = `${P(e)}${fe(t)}`,
|
|
9404
9474
|
a;
|
|
9405
9475
|
try {
|
|
9406
|
-
a = await fetch(r, { signal: AbortSignal.timeout(
|
|
9476
|
+
a = await fetch(r, { signal: AbortSignal.timeout(ua) });
|
|
9407
9477
|
} catch {
|
|
9408
9478
|
throw new Error(`Could not reach ${r}`);
|
|
9409
9479
|
}
|
|
@@ -9419,18 +9489,18 @@ async function ga(e, t) {
|
|
|
9419
9489
|
}
|
|
9420
9490
|
return n;
|
|
9421
9491
|
}
|
|
9422
|
-
function
|
|
9492
|
+
function Ne(e) {
|
|
9423
9493
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
9424
9494
|
[r, a = ''] = t.split('.');
|
|
9425
9495
|
return `$${r}.${a.padEnd(2, '0')}`;
|
|
9426
9496
|
}
|
|
9427
|
-
function
|
|
9497
|
+
function Be(e) {
|
|
9428
9498
|
if (!e || typeof e.starter != 'number') return null;
|
|
9429
9499
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
9430
9500
|
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9431
|
-
return `Starter ${
|
|
9501
|
+
return `Starter ${Ne(e.starter)} Plus ${Ne(t)} Scale ${Ne(r)}`;
|
|
9432
9502
|
}
|
|
9433
|
-
function
|
|
9503
|
+
function ya(e) {
|
|
9434
9504
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
9435
9505
|
let t = [];
|
|
9436
9506
|
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -9442,33 +9512,33 @@ function ha(e) {
|
|
|
9442
9512
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
9443
9513
|
);
|
|
9444
9514
|
}
|
|
9445
|
-
function
|
|
9446
|
-
let r =
|
|
9447
|
-
for (let a of
|
|
9448
|
-
let n =
|
|
9515
|
+
function ba(e, t) {
|
|
9516
|
+
let r = ya(e);
|
|
9517
|
+
for (let a of ma) {
|
|
9518
|
+
let n = Be(ga(e, a));
|
|
9449
9519
|
if (!n) continue;
|
|
9450
|
-
let s =
|
|
9520
|
+
let s = Ue[a] ? ` (${Ue[a]})` : '';
|
|
9451
9521
|
t.push(` ${r}${s} ${n}`);
|
|
9452
9522
|
}
|
|
9453
9523
|
}
|
|
9454
|
-
function
|
|
9524
|
+
function ka(e, t) {
|
|
9455
9525
|
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
9456
9526
|
t.push(
|
|
9457
9527
|
` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
9458
9528
|
);
|
|
9459
|
-
for (let n of e.variants ?? [])
|
|
9529
|
+
for (let n of e.variants ?? []) ba(n, t);
|
|
9460
9530
|
let a = e.addons;
|
|
9461
9531
|
if (Array.isArray(a))
|
|
9462
9532
|
for (let n of a) {
|
|
9463
9533
|
if (!n || typeof n != 'object') continue;
|
|
9464
9534
|
let s = n,
|
|
9465
9535
|
o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
|
|
9466
|
-
u =
|
|
9536
|
+
u = Be(s.price);
|
|
9467
9537
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
9468
9538
|
}
|
|
9469
9539
|
t.push('');
|
|
9470
9540
|
}
|
|
9471
|
-
function
|
|
9541
|
+
function wa(e) {
|
|
9472
9542
|
let t = [],
|
|
9473
9543
|
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9474
9544
|
(t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
|
|
@@ -9490,7 +9560,7 @@ function ka(e) {
|
|
|
9490
9560
|
});
|
|
9491
9561
|
for (let l of s) {
|
|
9492
9562
|
t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
9493
|
-
for (let c of a.get(l) ?? [])
|
|
9563
|
+
for (let c of a.get(l) ?? []) ka(c, t);
|
|
9494
9564
|
}
|
|
9495
9565
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
9496
9566
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -9507,7 +9577,7 @@ function ka(e) {
|
|
|
9507
9577
|
t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
|
|
9508
9578
|
for (let m of p) {
|
|
9509
9579
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
9510
|
-
f =
|
|
9580
|
+
f = Be(m.prices);
|
|
9511
9581
|
f && t.push(` ${h} ${f}`);
|
|
9512
9582
|
}
|
|
9513
9583
|
t.push('');
|
|
@@ -9523,7 +9593,7 @@ function ka(e) {
|
|
|
9523
9593
|
async function Ut(e) {
|
|
9524
9594
|
let t;
|
|
9525
9595
|
try {
|
|
9526
|
-
t = await
|
|
9596
|
+
t = await ha(e.apiUrl, e.model);
|
|
9527
9597
|
} catch (r) {
|
|
9528
9598
|
let a = r instanceof Error ? r.message : String(r);
|
|
9529
9599
|
(process.stderr.write(`${i.red('Error:')} ${a}
|
|
@@ -9534,7 +9604,7 @@ async function Ut(e) {
|
|
|
9534
9604
|
e.json
|
|
9535
9605
|
? `${JSON.stringify(t, null, 2)}
|
|
9536
9606
|
`
|
|
9537
|
-
:
|
|
9607
|
+
: wa(t),
|
|
9538
9608
|
);
|
|
9539
9609
|
}
|
|
9540
9610
|
var Bt = _(require('node:path'));
|
|
@@ -9649,8 +9719,8 @@ ${p.text}
|
|
|
9649
9719
|
process.stdout.write(`
|
|
9650
9720
|
`);
|
|
9651
9721
|
}
|
|
9652
|
-
var
|
|
9653
|
-
|
|
9722
|
+
var Fe = _(require('node:fs')),
|
|
9723
|
+
je = _(require('node:path'));
|
|
9654
9724
|
A();
|
|
9655
9725
|
async function jt(e, t = {}) {
|
|
9656
9726
|
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
@@ -9669,13 +9739,13 @@ async function jt(e, t = {}) {
|
|
|
9669
9739
|
process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
|
|
9670
9740
|
`),
|
|
9671
9741
|
process.exit(1)));
|
|
9672
|
-
let s =
|
|
9673
|
-
|
|
9742
|
+
let s = je.default.resolve(e);
|
|
9743
|
+
Fe.default.existsSync(s) ||
|
|
9674
9744
|
(process.stderr.write(`${i.red('Error:')} File not found: ${s}
|
|
9675
9745
|
`),
|
|
9676
9746
|
process.exit(1));
|
|
9677
|
-
let o =
|
|
9678
|
-
l =
|
|
9747
|
+
let o = je.default.basename(s),
|
|
9748
|
+
l = Fe.default.readFileSync(s).toString('base64'),
|
|
9679
9749
|
c = new K(r, a),
|
|
9680
9750
|
p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
|
|
9681
9751
|
n || p.start();
|
|
@@ -9717,7 +9787,7 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
|
|
|
9717
9787
|
}
|
|
9718
9788
|
}
|
|
9719
9789
|
W();
|
|
9720
|
-
|
|
9790
|
+
Se();
|
|
9721
9791
|
function sr() {
|
|
9722
9792
|
process.stdout.write(`
|
|
9723
9793
|
${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
@@ -9778,7 +9848,7 @@ ${i.bold('EXAMPLES:')}
|
|
|
9778
9848
|
|
|
9779
9849
|
`);
|
|
9780
9850
|
}
|
|
9781
|
-
async function
|
|
9851
|
+
async function La() {
|
|
9782
9852
|
let e = process.argv.slice(2),
|
|
9783
9853
|
t = Rt(e);
|
|
9784
9854
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
@@ -9842,7 +9912,7 @@ async function Da() {
|
|
|
9842
9912
|
case 'run':
|
|
9843
9913
|
case 'generate': {
|
|
9844
9914
|
let r = t.subcommand || '';
|
|
9845
|
-
await
|
|
9915
|
+
await Le(r, t.options);
|
|
9846
9916
|
break;
|
|
9847
9917
|
}
|
|
9848
9918
|
case 'status': {
|
|
@@ -9864,7 +9934,7 @@ ${i.red('Error:')} Unknown command or model "${t.command}".
|
|
|
9864
9934
|
Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
|
|
9865
9935
|
`),
|
|
9866
9936
|
process.exit(v)),
|
|
9867
|
-
await
|
|
9937
|
+
await Le(t.command, t.options));
|
|
9868
9938
|
return;
|
|
9869
9939
|
}
|
|
9870
9940
|
sr();
|
|
@@ -9872,7 +9942,7 @@ Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for t
|
|
|
9872
9942
|
}
|
|
9873
9943
|
}
|
|
9874
9944
|
}
|
|
9875
|
-
|
|
9945
|
+
La().catch((e) => {
|
|
9876
9946
|
(e instanceof w &&
|
|
9877
9947
|
(process.stderr.write(`
|
|
9878
9948
|
${i.red('Error:')} ${S(e).join(`
|