@teinai/cli 1.1.24 → 1.1.26

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.
Files changed (2) hide show
  1. package/index.js +351 -246
  2. 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
- tt,
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
- (tt = _(require('node:os'))),
77
+ (Ze = _(require('node:os'))),
78
78
  (ke = _(require('node:path'))),
79
- (te = ke.default.join(tt.default.homedir(), '.tein')),
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
- rt,
84
- at,
85
- it = y(() => {
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
- (rt = [...kr, 'auto']),
89
- (at =
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 nt = y(() => {
100
+ var at = y(() => {
101
101
  'use strict';
102
102
  });
103
103
  var ie,
104
- st = y(() => {
104
+ it = y(() => {
105
105
  'use strict';
106
106
  ie = {
107
107
  source: 'TEIN Price Board',
@@ -5842,50 +5842,85 @@ var ie,
5842
5842
  ],
5843
5843
  };
5844
5844
  });
5845
- var ot,
5846
- ne,
5845
+ var ne,
5846
+ nt,
5847
5847
  Pe = y(() => {
5848
5848
  'use strict';
5849
- ((ot = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
5850
- (ne = [
5851
- {
5852
- slug: 'tein-video-upscaler',
5853
- name: 'Tein Video Upscaler',
5854
- family: 'tein',
5855
- vendor: 'Tein',
5856
- 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.',
5857
- kind: 'video',
5858
- unit: '/sec',
5859
- api: { model: 'tein-video-upscaler' },
5860
- variants: [
5861
- {
5862
- id: '1080p',
5863
- label: '1080p',
5864
- resolution: '1080p',
5865
- price: { starter: 0.2281, plus: 0.2281, scale: 0.2281 },
5866
- },
5867
- {
5868
- id: '2k',
5869
- label: '2K',
5870
- resolution: '2k',
5871
- price: { starter: 0.4055, plus: 0.4055, scale: 0.4055 },
5872
- },
5873
- {
5874
- id: '4k',
5875
- label: '4K',
5876
- resolution: '4k',
5877
- price: { starter: 0.9124, plus: 0.9124, scale: 0.9124 },
5878
- },
5879
- ],
5880
- unfiltered: null,
5881
- priority: null,
5882
- draft: null,
5883
- axes: { resolution: ['1080p', '2k', '4k'] },
5884
- from: { variant: '1080p' },
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
+ slug: 'doppel',
5887
+ name: 'Doppel',
5888
+ family: 'tein-labs',
5889
+ vendor: 'Tein Labs',
5890
+ desc: 'Puts you into any photo. Swap: your face, and if you like your outfit, in the photo you pick, with things to add. New scene: the pose and camera of a photo, rebuilt around you in a new place.',
5891
+ kind: 'image',
5892
+ unit: '/run',
5893
+ api: { model: 'doppel' },
5894
+ variants: [
5895
+ {
5896
+ id: 'swap',
5897
+ label: 'Swap',
5898
+ resolution: 'run',
5899
+ price: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
5900
+ },
5901
+ {
5902
+ id: 'swap-4-items',
5903
+ label: 'Swap, 4 things to add',
5904
+ resolution: 'run',
5905
+ price: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
5906
+ },
5907
+ {
5908
+ id: 'new_scene',
5909
+ label: 'New scene',
5910
+ resolution: 'run',
5911
+ price: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
5912
+ },
5913
+ ],
5914
+ unfiltered: null,
5915
+ priority: null,
5916
+ draft: null,
5917
+ axes: { mode: ['swap', 'new_scene'] },
5918
+ from: { variant: 'swap' },
5919
+ },
5920
+ ]),
5921
+ (nt = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
5887
5922
  });
5888
- function Ke(e, t) {
5923
+ function Te(e, t) {
5889
5924
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
5890
5925
  }
5891
5926
  function Ir(e, t) {
@@ -5905,10 +5940,10 @@ function Pr(e, t) {
5905
5940
  .replace(/-(?:unfiltered|uncensored)$/, '');
5906
5941
  if (r === 'seedance-2' || r === 'seedance-2-mini') {
5907
5942
  let n = Ir(r, t),
5908
- s = Te.get(Ke('seedance-2', n));
5943
+ s = _e.get(Te('seedance-2', n));
5909
5944
  return s ? s.slug : null;
5910
5945
  }
5911
- let a = se.get(r) ?? Te.get(Ke(r));
5946
+ let a = se.get(r) ?? _e.get(Te(r));
5912
5947
  return a ? a.slug : null;
5913
5948
  }
5914
5949
  function vr(e, t) {
@@ -5921,63 +5956,68 @@ function z(e, t) {
5921
5956
  function oe() {
5922
5957
  return pt;
5923
5958
  }
5924
- var _e,
5925
- ve,
5959
+ var ot,
5960
+ lt,
5926
5961
  pt,
5927
5962
  wr,
5928
5963
  se,
5929
- Te,
5930
- lt,
5964
+ _e,
5965
+ st,
5931
5966
  xr,
5932
- Me,
5967
+ ve,
5933
5968
  _r,
5934
5969
  B = y(() => {
5935
5970
  'use strict';
5936
- nt();
5937
- st();
5971
+ at();
5972
+ it();
5938
5973
  Pe();
5939
- ((_e = {
5974
+ ((ot = {
5940
5975
  ...ie,
5941
5976
  families: ie.families.map((e) => ({ ...e, models: e.models.filter((t) => !ae(t)) })),
5942
5977
  models: ie.models.filter((e) => !ae(e.slug)),
5943
5978
  }),
5944
- (ve = ne.filter((e) => !ae(e.slug))),
5945
- (pt = [..._e.models, ...ve]),
5946
- (wr = ve.length ? [..._e.families, { ...ot, models: ve.map((e) => e.slug) }] : _e.families),
5979
+ (lt = ne.filter((e) => !ae(e.slug))),
5980
+ (pt = [...ot.models, ...lt]),
5981
+ (wr = [
5982
+ ...ot.families,
5983
+ ...nt
5984
+ .map((e) => ({ ...e, models: lt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
5985
+ .filter((e) => e.models.length > 0),
5986
+ ]),
5947
5987
  (se = new Map()),
5948
- (Te = new Map()),
5949
- (lt = new Map()),
5988
+ (_e = new Map()),
5989
+ (st = new Map()),
5950
5990
  (xr = new Map()),
5951
- (Me = new Map()));
5991
+ (ve = new Map()));
5952
5992
  for (let e of pt) {
5953
- (se.set(e.slug, e), Te.set(Ke(e.api.model, e.api.quality), e));
5954
- for (let t of e.variants) lt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
5993
+ (se.set(e.slug, e), _e.set(Te(e.api.model, e.api.quality), e));
5994
+ for (let t of e.variants) st.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
5955
5995
  for (let t of e.editVariants ?? [])
5956
- lt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
5996
+ st.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
5957
5997
  for (let t of e.addons ?? []) xr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
5958
- Me.set(e.slug, e.family);
5998
+ ve.set(e.slug, e.family);
5959
5999
  }
5960
- for (let e of wr) for (let t of e.models) Me.has(t) || Me.set(t, e.slug);
6000
+ for (let e of wr) for (let t of e.models) ve.has(t) || ve.set(t, e.slug);
5961
6001
  _r = new Set(['seedance-2']);
5962
6002
  });
5963
6003
  function le(e) {
5964
6004
  let t = e.from?.variant;
5965
6005
  return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
5966
6006
  }
5967
- function Se(e) {
6007
+ function Me(e) {
5968
6008
  if (e.endpoints?.length)
5969
6009
  return e.editVariants?.length && e.endpoints.some((t) => t.id === dt)
5970
6010
  ? dt
5971
6011
  : (e.defaultEndpoint ?? e.endpoints[0].id);
5972
6012
  }
5973
6013
  var dt,
5974
- qe = y(() => {
6014
+ Ke = y(() => {
5975
6015
  'use strict';
5976
6016
  B();
5977
6017
  dt = 'dynamic';
5978
6018
  });
5979
6019
  var pe,
5980
- $e = y(() => {
6020
+ Se = y(() => {
5981
6021
  'use strict';
5982
6022
  pe = {
5983
6023
  'gemini-3-8-flash': 'gemini-3.8-flash',
@@ -5999,7 +6039,7 @@ var Tr,
5999
6039
  mt = y(() => {
6000
6040
  'use strict';
6001
6041
  B();
6002
- qe();
6042
+ Ke();
6003
6043
  ct();
6004
6044
  Tr = {};
6005
6045
  });
@@ -6121,7 +6161,7 @@ var bt,
6121
6161
  function wt(e) {
6122
6162
  return `$${e}`;
6123
6163
  }
6124
- function Ce(e, t, r) {
6164
+ function qe(e, t, r) {
6125
6165
  return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
6126
6166
  }
6127
6167
  function Sr(e) {
@@ -6193,9 +6233,9 @@ function Sr(e) {
6193
6233
  function xt() {
6194
6234
  return Object.fromEntries(
6195
6235
  bt.map((e) => {
6196
- let t = Ce(e.slug, 'cheap', 'input'),
6197
- r = Ce(e.slug, 'cheap', 'output'),
6198
- a = Ce(e.slug, 'stable', 'input') != null,
6236
+ let t = qe(e.slug, 'cheap', 'input'),
6237
+ r = qe(e.slug, 'cheap', 'output'),
6238
+ a = qe(e.slug, 'stable', 'input') != null,
6199
6239
  n = t != null && r != null ? `${wt(t)}/M in \xB7 ${wt(r)}/M out` : '',
6200
6240
  s = {
6201
6241
  slug: e.slug,
@@ -6220,7 +6260,7 @@ var It = y(() => {
6220
6260
  });
6221
6261
  var H,
6222
6262
  de,
6223
- Ee = y(() => {
6263
+ $e = y(() => {
6224
6264
  'use strict';
6225
6265
  ((H = [
6226
6266
  'seedance-2-5',
@@ -6284,7 +6324,7 @@ function Kt(e) {
6284
6324
  return {
6285
6325
  name: 'endpoint',
6286
6326
  type: 'select',
6287
- default: Se(e),
6327
+ default: Me(e),
6288
6328
  options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
6289
6329
  description:
6290
6330
  (e.slug === 'gemini-3.1-pro-preview'
@@ -6296,17 +6336,17 @@ function Kt(e) {
6296
6336
  function Dr(e, t) {
6297
6337
  if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
6298
6338
  let r = H.includes(e.api.model);
6299
- return [...t.filter((a) => !Le.has(a.name)), r ? St : Or];
6339
+ return [...t.filter((a) => !Re.has(a.name)), r ? St : Or];
6300
6340
  }
6301
- function Ae(e, t) {
6302
- let r = e.filter((n) => !Le.has(n.name)),
6341
+ function Ce(e, t) {
6342
+ let r = e.filter((n) => !Re.has(n.name)),
6303
6343
  a = [St, Rr];
6304
6344
  return (a.push(qt, $t), [...r, ...a]);
6305
6345
  }
6306
6346
  function Pt(e, t = {}) {
6307
6347
  return [
6308
6348
  ...e
6309
- .filter((r) => !Lr.has(r.name) && !Le.has(r.name))
6349
+ .filter((r) => !Lr.has(r.name) && !Re.has(r.name))
6310
6350
  .map((r) =>
6311
6351
  r.name === 'prompt'
6312
6352
  ? { ...r, required: !0 }
@@ -6331,7 +6371,7 @@ function Pt(e, t = {}) {
6331
6371
  $t,
6332
6372
  ];
6333
6373
  }
6334
- function Oe(e, t) {
6374
+ function Ee(e, t) {
6335
6375
  return [
6336
6376
  M('Text prompt describing the video.'),
6337
6377
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
@@ -6374,14 +6414,14 @@ function Vr(e) {
6374
6414
  O(
6375
6415
  e,
6376
6416
  e.slug === 'gpt-image-2'
6377
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${at}`
6417
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${tt}`
6378
6418
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
6379
6419
  ),
6380
6420
  {
6381
6421
  name: 'aspect_ratio',
6382
6422
  type: 'select',
6383
6423
  default: 'auto',
6384
- options: [...rt],
6424
+ options: [...et],
6385
6425
  description:
6386
6426
  "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
6427
  },
@@ -6465,7 +6505,7 @@ function Nr(e) {
6465
6505
  function jr() {
6466
6506
  let e = ht,
6467
6507
  t = [];
6468
- for (let r of Ve(!0))
6508
+ for (let r of De(!0))
6469
6509
  e.includes(r.name) &&
6470
6510
  (t.push({
6471
6511
  ...r,
@@ -6488,11 +6528,11 @@ function jr() {
6488
6528
  return t;
6489
6529
  }
6490
6530
  function Gr() {
6491
- return Ve(!0).map((e) =>
6531
+ return De(!0).map((e) =>
6492
6532
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
6493
6533
  );
6494
6534
  }
6495
- function Ve(e) {
6535
+ function De(e) {
6496
6536
  return [
6497
6537
  M('The user message or task.'),
6498
6538
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -6596,12 +6636,12 @@ function zr(e) {
6596
6636
  : e.slug === 'gemini-3.7-flash'
6597
6637
  ? Gr()
6598
6638
  : e.slug === 'gpt-6-astra' || Fr.includes(e.slug)
6599
- ? Ve(e.slug !== 'gpt-6-astra')
6639
+ ? De(e.slug !== 'gpt-6-astra')
6600
6640
  : Ur),
6601
6641
  ...(t ? [t] : []),
6602
6642
  ];
6603
6643
  }
6604
- function Re() {
6644
+ function Ae() {
6605
6645
  return {
6606
6646
  name: 'image',
6607
6647
  type: 'string',
@@ -6631,22 +6671,87 @@ function Jr(e) {
6631
6671
  },
6632
6672
  ];
6633
6673
  }
6634
- function Wr(e) {
6674
+ function Wr() {
6675
+ return [
6676
+ {
6677
+ name: 'mode',
6678
+ type: 'select',
6679
+ default: 'swap',
6680
+ options: ['swap', 'new_scene'],
6681
+ description:
6682
+ 'swap puts you into the photo; new_scene keeps only its pose and camera and builds a new place around you.',
6683
+ },
6684
+ {
6685
+ name: 'image_urls',
6686
+ type: 'string',
6687
+ required: !0,
6688
+ description:
6689
+ 'The photo: the one to be in (swap), or the one whose pose and camera to copy (new_scene). One image link.',
6690
+ },
6691
+ {
6692
+ name: 'image_urls_2',
6693
+ type: 'string',
6694
+ required: !0,
6695
+ description:
6696
+ 'Your photo: one clear photo of you, or of someone who has agreed. One image link.',
6697
+ },
6698
+ {
6699
+ name: 'image_urls_3',
6700
+ type: 'string[]',
6701
+ description: 'swap only. Up to 4 pictures of clothes, accessories or objects to add.',
6702
+ },
6703
+ {
6704
+ name: 'outfit',
6705
+ type: 'select',
6706
+ options: ['theirs', 'mine'],
6707
+ description:
6708
+ '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.',
6709
+ },
6710
+ { name: 'add', type: 'string', description: 'swap only. What to add and where.' },
6711
+ {
6712
+ name: 'scene',
6713
+ type: 'string',
6714
+ description: 'new_scene only. The new place and its light. Default: a private jet cabin.',
6715
+ },
6716
+ { name: 'prompt', type: 'string', description: 'Extra direction. Optional.' },
6717
+ {
6718
+ name: 'avoid',
6719
+ type: 'string',
6720
+ description: 'What to leave out of the picture, for example: hat, sunglasses. Optional.',
6721
+ },
6722
+ {
6723
+ name: 'copy_expression',
6724
+ type: 'boolean',
6725
+ default: !0,
6726
+ description:
6727
+ 'true: your character takes the facial expression of the person in the photo. false: they keep the expression from their own picture.',
6728
+ },
6729
+ {
6730
+ name: 'aspect_ratio',
6731
+ type: 'select',
6732
+ default: 'adaptive',
6733
+ options: ['adaptive', '1:1', '4:3', '3:4', '16:9', '9:16', '3:2', '2:3', '21:9'],
6734
+ description: 'adaptive keeps the shape of the photo.',
6735
+ },
6736
+ ];
6737
+ }
6738
+ function Yr(e) {
6635
6739
  let t = e.slug;
6740
+ if (e.family === 'tein-labs' && e.kind === 'image') return Wr();
6636
6741
  if (ne.some((r) => r.slug === t)) return Jr(e);
6637
6742
  if (e.kind === 'llm') return zr(e);
6638
6743
  if (e.editVariants?.length) return Vr(e);
6639
6744
  switch (t) {
6640
6745
  case 'seedance-2-5':
6641
- return Ae(_t, t);
6746
+ return Ce(_t, t);
6642
6747
  case 'seedance-2-5-lite':
6643
6748
  return Pt(_t, { no4k: !0 });
6644
6749
  case 'seedance-2':
6645
- return Ae(vt, t);
6750
+ return Ce(vt, t);
6646
6751
  case 'seedance-2-lite':
6647
6752
  return Pt(vt);
6648
6753
  case 'seedance-2-mini':
6649
- return Ae(Yr, t);
6754
+ return Ce(Qr, t);
6650
6755
  case 'nano-banana-2':
6651
6756
  case 'nano-banana-2.1':
6652
6757
  case 'nano-banana-pro':
@@ -6801,7 +6906,7 @@ function Wr(e) {
6801
6906
  ];
6802
6907
  case 'enhancor-skin-fix-v1':
6803
6908
  return [
6804
- Re(),
6909
+ Ae(),
6805
6910
  {
6806
6911
  name: 'mode',
6807
6912
  type: 'select',
@@ -6838,7 +6943,7 @@ function Wr(e) {
6838
6943
  ];
6839
6944
  case 'enhancor-skin-fix-v3':
6840
6945
  return [
6841
- Re(),
6946
+ Ae(),
6842
6947
  {
6843
6948
  name: 'mask_image',
6844
6949
  type: 'string',
@@ -6878,7 +6983,7 @@ function Wr(e) {
6878
6983
  ];
6879
6984
  case 'enhancor-skin-fix-v4':
6880
6985
  return [
6881
- Re(),
6986
+ Ae(),
6882
6987
  {
6883
6988
  name: 'mode',
6884
6989
  type: 'select',
@@ -6909,7 +7014,7 @@ function Wr(e) {
6909
7014
  ];
6910
7015
  case 'wan-3-0':
6911
7016
  case 'wan-3-0-prime':
6912
- return Oe(e, {
7017
+ return Ee(e, {
6913
7018
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
6914
7019
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
6915
7020
  minSec: 2,
@@ -6919,7 +7024,7 @@ function Wr(e) {
6919
7024
  });
6920
7025
  case 'happy-horse-1-1':
6921
7026
  case 'happy-horse-1-0':
6922
- return Oe(e, {
7027
+ return Ee(e, {
6923
7028
  modes:
6924
7029
  t === 'happy-horse-1-0'
6925
7030
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -6930,7 +7035,7 @@ function Wr(e) {
6930
7035
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
6931
7036
  });
6932
7037
  case 'minimax-h3':
6933
- return Oe(e, {
7038
+ return Ee(e, {
6934
7039
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
6935
7040
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
6936
7041
  minSec: 4,
@@ -6941,7 +7046,7 @@ function Wr(e) {
6941
7046
  return [M('Prompt text.')];
6942
7047
  }
6943
7048
  }
6944
- function De(e, t = e.api.model) {
7049
+ function Oe(e, t = e.api.model) {
6945
7050
  return {
6946
7051
  slug: t,
6947
7052
  name: e.name,
@@ -6952,24 +7057,24 @@ function De(e, t = e.api.model) {
6952
7057
  priceFormatted: Er(e),
6953
7058
  unit: e.unit,
6954
7059
  primaryToolName: $r[e.kind],
6955
- parameters: Dr(e, Wr(e)),
7060
+ parameters: Dr(e, Yr(e)),
6956
7061
  };
6957
7062
  }
6958
- function Qr() {
7063
+ function Xr() {
6959
7064
  let e = {};
6960
7065
  for (let t of oe())
6961
7066
  if (t.slug !== 'seedance-2-fast') {
6962
7067
  if (t.slug === 'seedance-2-mini') {
6963
- e['seedance-2-mini'] = De(t, 'seedance-2-mini');
7068
+ e['seedance-2-mini'] = Oe(t, 'seedance-2-mini');
6964
7069
  continue;
6965
7070
  }
6966
7071
  if (t.slug === 'seedance-2') {
6967
- let r = De(t);
7072
+ let r = Oe(t);
6968
7073
  ((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
6969
7074
  (e['seedance-2'] = r));
6970
7075
  continue;
6971
7076
  }
6972
- t.slug.startsWith('claude-') || (e[t.api.model] = De(t));
7077
+ t.slug.startsWith('claude-') || (e[t.api.model] = Oe(t));
6973
7078
  }
6974
7079
  Object.assign(e, xt());
6975
7080
  for (let [t, r] of Object.entries(pe))
@@ -6982,7 +7087,7 @@ function me(e) {
6982
7087
  function F(e) {
6983
7088
  return ue[e] ?? null;
6984
7089
  }
6985
- function Xr(e, t, r) {
7090
+ function Zr(e, t, r) {
6986
7091
  if (e.startsWith('enhancor-skin-fix-')) return !1;
6987
7092
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
6988
7093
  let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
@@ -7000,13 +7105,13 @@ function At(e, t) {
7000
7105
  let r = { ...t };
7001
7106
  if (e?.slug === 'seedance-2-5') {
7002
7107
  let a = (n) => typeof n != 'string' || !n.trim();
7003
- for (let n of Zr) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
7108
+ for (let n of ea) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
7004
7109
  if (!a(r.finalize)) return r;
7005
7110
  }
7006
7111
  for (let a of e?.parameters ?? [])
7007
7112
  a.default !== void 0 &&
7008
7113
  r[a.name] === void 0 &&
7009
- Xr(e.slug, a.name, t) &&
7114
+ Zr(e.slug, a.name, t) &&
7010
7115
  (r[a.name] = a.default);
7011
7116
  return r;
7012
7117
  }
@@ -7022,7 +7127,7 @@ var qr,
7022
7127
  Rr,
7023
7128
  qt,
7024
7129
  $t,
7025
- Le,
7130
+ Re,
7026
7131
  Lr,
7027
7132
  Ur,
7028
7133
  Br,
@@ -7033,22 +7138,22 @@ var qr,
7033
7138
  Ct,
7034
7139
  Et,
7035
7140
  vt,
7036
- Yr,
7141
+ Qr,
7037
7142
  ue,
7038
- Zr,
7143
+ ea,
7039
7144
  W = y(() => {
7040
7145
  'use strict';
7041
- it();
7146
+ rt();
7042
7147
  Ie();
7043
7148
  B();
7044
- qe();
7149
+ Ke();
7045
7150
  Pe();
7046
- $e();
7151
+ Se();
7047
7152
  mt();
7048
7153
  gt();
7049
7154
  yt();
7050
7155
  It();
7051
- Ee();
7156
+ $e();
7052
7157
  ((qr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
7053
7158
  ($r = {
7054
7159
  video: 'generate_video',
@@ -7094,7 +7199,7 @@ var qr,
7094
7199
  description:
7095
7200
  '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
7201
  }),
7097
- (Le = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
7202
+ (Re = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
7098
7203
  Lr = new Set([
7099
7204
  'quality',
7100
7205
  'bitrate_mode',
@@ -7493,7 +7598,7 @@ var qr,
7493
7598
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7494
7599
  },
7495
7600
  ]),
7496
- (Yr = [
7601
+ (Qr = [
7497
7602
  {
7498
7603
  name: 'prompt',
7499
7604
  type: 'string',
@@ -7564,15 +7669,15 @@ var qr,
7564
7669
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7565
7670
  },
7566
7671
  ]));
7567
- ue = Qr();
7568
- Zr = ['draft_task_id', 'draft_generation_id'];
7672
+ ue = Xr();
7673
+ ea = ['draft_task_id', 'draft_generation_id'];
7569
7674
  });
7570
7675
  function fe(e) {
7571
7676
  let t = '/v1/pricing/models',
7572
7677
  r = e?.trim();
7573
7678
  return r ? `${t}?model=${encodeURIComponent(r)}` : t;
7574
7679
  }
7575
- var Ue = y(() => {
7680
+ var Ve = y(() => {
7576
7681
  'use strict';
7577
7682
  });
7578
7683
  function Gt(e) {
@@ -7590,14 +7695,14 @@ function zt(e) {
7590
7695
  'The Acceptable Use Policy applies.',
7591
7696
  ].join(' ');
7592
7697
  }
7593
- function Pa(e) {
7594
- if (xa.has(e.name)) return e;
7698
+ function _a(e) {
7699
+ if (Ia.has(e.name)) return e;
7595
7700
  let t = e.inputSchema.properties;
7596
7701
  return !t || t.callback_url
7597
7702
  ? e
7598
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: wa } } };
7703
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: xa } } };
7599
7704
  }
7600
- function _a(e) {
7705
+ function va(e) {
7601
7706
  let t = e.inputSchema.properties;
7602
7707
  if (!t) return e;
7603
7708
  let r = !1,
@@ -7610,7 +7715,7 @@ function _a(e) {
7610
7715
  : (a[n] = s);
7611
7716
  return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
7612
7717
  }
7613
- function va(e) {
7718
+ function Ta(e) {
7614
7719
  switch (e.type) {
7615
7720
  case 'string':
7616
7721
  return {
@@ -7665,11 +7770,11 @@ function va(e) {
7665
7770
  return { type: 'string', description: e.description };
7666
7771
  }
7667
7772
  }
7668
- function Ta(e, t) {
7773
+ function Ma(e, t) {
7669
7774
  let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
7670
7775
  a = {},
7671
7776
  n = [];
7672
- for (let o of e.parameters) ((a[o.name] = va(o)), o.required && n.push(o.name));
7777
+ for (let o of e.parameters) ((a[o.name] = Ta(o)), o.required && n.push(o.name));
7673
7778
  let s = {
7674
7779
  type: 'object',
7675
7780
  properties: a,
@@ -7682,7 +7787,7 @@ function Ta(e, t) {
7682
7787
  inputSchema: s,
7683
7788
  };
7684
7789
  }
7685
- function Ma() {
7790
+ function Ka() {
7686
7791
  let e = R().filter((d) => d.category === 'Image' && !me(d)),
7687
7792
  t = R().filter((d) => d.category === 'Video'),
7688
7793
  r = R().filter((d) => d.category === 'Text'),
@@ -7953,10 +8058,10 @@ function Ma() {
7953
8058
  additionalProperties: !0,
7954
8059
  },
7955
8060
  },
7956
- p = Ka();
7957
- return [n, s, o, u, l, p, c, Ia];
8061
+ p = Sa();
8062
+ return [n, s, o, u, l, p, c, Pa];
7958
8063
  }
7959
- function Ka() {
8064
+ function Sa() {
7960
8065
  return {
7961
8066
  name: 'upload_asset',
7962
8067
  description:
@@ -8003,26 +8108,26 @@ function Ka() {
8003
8108
  },
8004
8109
  };
8005
8110
  }
8006
- function He() {
8007
- let e = Ma(),
8008
- t = R().map((r) => Ta(r));
8009
- return [...e, ...t].map(Pa).map(_a);
8111
+ function Ge() {
8112
+ let e = Ka(),
8113
+ t = R().map((r) => Ma(r));
8114
+ return [...e, ...t].map(_a).map(va);
8010
8115
  }
8011
- var wa,
8012
- xa,
8116
+ var xa,
8013
8117
  Ia,
8118
+ Pa,
8014
8119
  Ht,
8015
8120
  Jt = y(() => {
8016
8121
  'use strict';
8017
8122
  B();
8018
- Ee();
8123
+ $e();
8019
8124
  W();
8020
- ((wa = {
8125
+ ((xa = {
8021
8126
  type: 'string',
8022
8127
  description:
8023
8128
  '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
8129
  }),
8025
- (xa = new Set([
8130
+ (Ia = new Set([
8026
8131
  'upload_asset',
8027
8132
  'upload_media',
8028
8133
  'upload_image',
@@ -8030,7 +8135,7 @@ var wa,
8030
8135
  'check_status',
8031
8136
  'get_pricing',
8032
8137
  ])),
8033
- (Ia = {
8138
+ (Pa = {
8034
8139
  name: 'get_pricing',
8035
8140
  description:
8036
8141
  '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 +8169,12 @@ var wa,
8064
8169
  });
8065
8170
  var ir = {};
8066
8171
  ur(ir, {
8067
- forgetToolSchemas: () => Ea,
8172
+ forgetToolSchemas: () => Aa,
8068
8173
  jsonRpcAnswer: () => Xt,
8069
8174
  preprocessLocalFiles: () => rr,
8070
8175
  startStdioServer: () => ar,
8071
8176
  });
8072
- function Sa(e) {
8177
+ function qa(e) {
8073
8178
  let t = (r) =>
8074
8179
  !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
8075
8180
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
@@ -8083,7 +8188,7 @@ function Xt(e, t, r) {
8083
8188
  } catch {
8084
8189
  s = null;
8085
8190
  }
8086
- if (s !== null && Sa(s)) return n ? null : s;
8191
+ if (s !== null && qa(s)) return n ? null : s;
8087
8192
  if (n) return null;
8088
8193
  if (!r && t >= 200 && t < 300) return;
8089
8194
  let o = s?.error,
@@ -8104,7 +8209,7 @@ function Xt(e, t, r) {
8104
8209
  },
8105
8210
  };
8106
8211
  }
8107
- function qa() {
8212
+ function $a() {
8108
8213
  let e = process.argv.slice(2),
8109
8214
  t = e.indexOf('--api-key');
8110
8215
  return q(t >= 0 ? e[t + 1] : void 0);
@@ -8139,14 +8244,14 @@ async function Zt(e, t, r) {
8139
8244
  };
8140
8245
  }
8141
8246
  function er(e) {
8142
- return $a.has(j.default.extname(e).toLowerCase());
8247
+ return Ca.has(j.default.extname(e).toLowerCase());
8143
8248
  }
8144
8249
  function tr(e) {
8145
8250
  return new Error(
8146
8251
  `Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
8147
8252
  );
8148
8253
  }
8149
- function Ca(e) {
8254
+ function Ea(e) {
8150
8255
  let t = e.trim();
8151
8256
  if (
8152
8257
  !t ||
@@ -8159,7 +8264,7 @@ function Ca(e) {
8159
8264
  let r = j.default.resolve(t);
8160
8265
  return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
8161
8266
  }
8162
- function We(e) {
8267
+ function He(e) {
8163
8268
  if (Array.isArray(e))
8164
8269
  for (let t of e) {
8165
8270
  let r = t;
@@ -8169,12 +8274,12 @@ function We(e) {
8169
8274
  X.set(r.name, r.inputSchema);
8170
8275
  }
8171
8276
  }
8172
- function Ea() {
8173
- (X.clear(), (Je = 0));
8277
+ function Aa() {
8278
+ (X.clear(), (ze = 0));
8174
8279
  }
8175
- async function Aa(e, t) {
8176
- if (!(Date.now() - Je < 6e4)) {
8177
- Je = Date.now();
8280
+ async function Oa(e, t) {
8281
+ if (!(Date.now() - ze < 6e4)) {
8282
+ ze = Date.now();
8178
8283
  try {
8179
8284
  let a = await (
8180
8285
  await fetch(e, {
@@ -8184,11 +8289,11 @@ async function Aa(e, t) {
8184
8289
  signal: AbortSignal.timeout(1e4),
8185
8290
  })
8186
8291
  ).json();
8187
- We(a.result?.tools);
8292
+ He(a.result?.tools);
8188
8293
  } catch {}
8189
8294
  }
8190
8295
  }
8191
- function Oa(e) {
8296
+ function Ra(e) {
8192
8297
  return e
8193
8298
  ? e.type === 'string'
8194
8299
  ? e.format === 'uri'
@@ -8197,18 +8302,18 @@ function Oa(e) {
8197
8302
  }
8198
8303
  async function Wt(e, t, r) {
8199
8304
  if (typeof e != 'string') return e;
8200
- let a = Ca(e);
8305
+ let a = Ea(e);
8201
8306
  if (!a) return e;
8202
8307
  if (!er(a)) throw tr(a);
8203
8308
  return (await Zt(a, t, r)).url;
8204
8309
  }
8205
8310
  async function rr(e, t, r, a, n) {
8206
- (X.size === 0 && We(He()), X.has(e) || (await Aa(n, r)));
8311
+ (X.size === 0 && He(Ge()), X.has(e) || (await Oa(n, r)));
8207
8312
  let s = X.get(e)?.properties;
8208
8313
  if (!s) return t;
8209
8314
  let o = { ...t };
8210
8315
  for (let [u, l] of Object.entries(t))
8211
- if (Oa(s[u]))
8316
+ if (Ra(s[u]))
8212
8317
  if (Array.isArray(l)) {
8213
8318
  let c = [];
8214
8319
  for (let p of l) c.push(await Wt(p, r, a));
@@ -8216,7 +8321,7 @@ async function rr(e, t, r, a, n) {
8216
8321
  } else o[u] = await Wt(l, r, a);
8217
8322
  return o;
8218
8323
  }
8219
- function Ra(e) {
8324
+ function Da(e) {
8220
8325
  let t = e.id ?? null;
8221
8326
  switch (e.method) {
8222
8327
  case 'initialize':
@@ -8234,7 +8339,7 @@ function Ra(e) {
8234
8339
  case 'ping':
8235
8340
  return { jsonrpc: '2.0', id: t, result: {} };
8236
8341
  case 'tools/list':
8237
- return { jsonrpc: '2.0', id: t, result: { tools: He() } };
8342
+ return { jsonrpc: '2.0', id: t, result: { tools: Ge() } };
8238
8343
  case 'tools/call':
8239
8344
  return {
8240
8345
  jsonrpc: '2.0',
@@ -8260,7 +8365,7 @@ function Ra(e) {
8260
8365
  async function ar() {
8261
8366
  if (Yt) return;
8262
8367
  Yt = !0;
8263
- let e = qa(),
8368
+ let e = $a(),
8264
8369
  t = P(),
8265
8370
  r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
8266
8371
  (Qt.default
@@ -8415,7 +8520,7 @@ Pass this URL to any Tein generation tool.`,
8415
8520
  p = Xt(o, l.status, c);
8416
8521
  if (p === null) return;
8417
8522
  if (p) {
8418
- (o?.method === 'tools/list' && We(p.result?.tools),
8523
+ (o?.method === 'tools/list' && He(p.result?.tools),
8419
8524
  process.stdout.write(
8420
8525
  JSON.stringify(p) +
8421
8526
  `
@@ -8424,7 +8529,7 @@ Pass this URL to any Tein generation tool.`,
8424
8529
  return;
8425
8530
  }
8426
8531
  } catch {}
8427
- let u = Ra(o);
8532
+ let u = Da(o);
8428
8533
  u !== null &&
8429
8534
  process.stdout.write(
8430
8535
  JSON.stringify(u) +
@@ -8450,19 +8555,19 @@ Pass this URL to any Tein generation tool.`,
8450
8555
  var D,
8451
8556
  j,
8452
8557
  Qt,
8453
- $a,
8558
+ Ca,
8454
8559
  X,
8455
- Je,
8560
+ ze,
8456
8561
  Yt,
8457
8562
  nr = y(() => {
8458
8563
  'use strict';
8459
8564
  ((D = _(require('node:fs'))),
8460
8565
  (j = _(require('node:path'))),
8461
8566
  (Qt = _(require('node:readline'))));
8462
- Ue();
8567
+ Ve();
8463
8568
  Jt();
8464
8569
  A();
8465
- $a = new Set([
8570
+ Ca = new Set([
8466
8571
  '.png',
8467
8572
  '.jpg',
8468
8573
  '.jpeg',
@@ -8488,7 +8593,7 @@ var D,
8488
8593
  '.flac',
8489
8594
  '.opus',
8490
8595
  ]);
8491
- ((X = new Map()), (Je = 0));
8596
+ ((X = new Map()), (ze = 0));
8492
8597
  Yt = !1;
8493
8598
  require.main === module &&
8494
8599
  ar().catch((e) => {
@@ -8588,8 +8693,8 @@ var i = {
8588
8693
  var V = _(require('node:fs')),
8589
8694
  $ = _(require('node:path'));
8590
8695
  var ee = _(require('node:fs')),
8591
- Ze = _(require('node:path')),
8592
- et = require('node:stream/promises');
8696
+ Qe = _(require('node:path')),
8697
+ Xe = require('node:stream/promises');
8593
8698
  var Z = '1.1.7';
8594
8699
  var gr = new Set([
8595
8700
  'account_suspended',
@@ -8625,13 +8730,13 @@ function yr(e, t, r) {
8625
8730
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
8626
8731
  return new w(e, c, typeof o == 'string' ? o : void 0, l);
8627
8732
  }
8628
- function Qe(e) {
8733
+ function We(e) {
8629
8734
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
8630
8735
  }
8631
8736
  function S(e) {
8632
8737
  let t = [e.message],
8633
- r = Qe(e.fields.required),
8634
- a = Qe(e.fields.balance);
8738
+ r = We(e.fields.required),
8739
+ a = We(e.fields.balance);
8635
8740
  (r || a) &&
8636
8741
  t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
8637
8742
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -8646,7 +8751,7 @@ function br(e) {
8646
8751
  ? 'audio'
8647
8752
  : 'image';
8648
8753
  }
8649
- function Xe(e) {
8754
+ function Ye(e) {
8650
8755
  let t = [];
8651
8756
  for (let r of e.data ?? [])
8652
8757
  typeof r.message?.content == 'string'
@@ -8691,7 +8796,7 @@ var K = class {
8691
8796
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
8692
8797
  ? n
8693
8798
  : 'processing',
8694
- o = Xe(a);
8799
+ o = Ye(a);
8695
8800
  return {
8696
8801
  request_id: a.request_id || a.id || '',
8697
8802
  model: a.model,
@@ -8709,7 +8814,7 @@ var K = class {
8709
8814
  a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
8710
8815
  ? a
8711
8816
  : 'processing',
8712
- s = Xe(r),
8817
+ s = Ye(r),
8713
8818
  o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
8714
8819
  return {
8715
8820
  request_id: r.id || t,
@@ -8727,10 +8832,10 @@ var K = class {
8727
8832
  async downloadOutput(t, r) {
8728
8833
  let a = await fetch(t);
8729
8834
  if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
8730
- let n = Ze.default.dirname(r);
8835
+ let n = Qe.default.dirname(r);
8731
8836
  ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
8732
8837
  let s = ee.default.createWriteStream(r);
8733
- return (await (0, et.pipeline)(a.body, s), r);
8838
+ return (await (0, Xe.pipeline)(a.body, s), r);
8734
8839
  }
8735
8840
  };
8736
8841
  A();
@@ -8744,28 +8849,28 @@ function xe(e) {
8744
8849
  }
8745
8850
  W();
8746
8851
  var Ot = ['images', 'input_images', 'videos', 'audios'];
8747
- function ea(e) {
8852
+ function ta(e) {
8748
8853
  for (let t of Ot) typeof e[t] == 'string' && (e[t] = [e[t]]);
8749
8854
  }
8750
- function ta(e) {
8855
+ function ra(e) {
8751
8856
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
8752
8857
  let t = $.default.resolve(e);
8753
8858
  return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
8754
8859
  }
8755
- async function ra(e, t) {
8860
+ async function aa(e, t) {
8756
8861
  for (let r of Ot) {
8757
8862
  if (!Array.isArray(e[r])) continue;
8758
8863
  let a = [];
8759
8864
  for (let n of e[r]) {
8760
8865
  if (typeof n != 'string') continue;
8761
- let s = ta(n);
8866
+ let s = ra(n);
8762
8867
  a.push(s ? await t(s) : n);
8763
8868
  }
8764
8869
  e[r] = a;
8765
8870
  }
8766
8871
  }
8767
8872
  var Y = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
8768
- function aa(e) {
8873
+ function ia(e) {
8769
8874
  if (e.count === void 0 || e.count === !0) return 1;
8770
8875
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
8771
8876
  r = Y.enterprise;
@@ -8778,7 +8883,7 @@ function aa(e) {
8778
8883
  t
8779
8884
  );
8780
8885
  }
8781
- async function ia(e, t, r, a, n) {
8886
+ async function na(e, t, r, a, n) {
8782
8887
  n.isJson ||
8783
8888
  process.stderr.write(`Starting ${a} ${t} jobs together...
8784
8889
  `);
@@ -8853,7 +8958,7 @@ async function ia(e, t, r, a, n) {
8853
8958
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
8854
8959
  process.exit(v);
8855
8960
  }
8856
- function na(e, t, r) {
8961
+ function sa(e, t, r) {
8857
8962
  if (r <= 1) return e;
8858
8963
  let a = $.default.extname(e);
8859
8964
  return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
@@ -8903,7 +9008,7 @@ function Rt(e) {
8903
9008
  }
8904
9009
  return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
8905
9010
  }
8906
- async function Ne(e, t) {
9011
+ async function Le(e, t) {
8907
9012
  let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
8908
9013
  a = P(typeof t.api_url == 'string' ? t.api_url : void 0);
8909
9014
  (r ||
@@ -8925,7 +9030,7 @@ async function Ne(e, t) {
8925
9030
  s = !!t.json,
8926
9031
  o = !!(t.async || t.no_wait),
8927
9032
  u = typeof t.output == 'string' ? t.output : void 0,
8928
- l = aa(t),
9033
+ l = ia(t),
8929
9034
  c = { ...t };
8930
9035
  (delete c.json,
8931
9036
  delete c.async,
@@ -8935,7 +9040,7 @@ async function Ne(e, t) {
8935
9040
  delete c.api_url,
8936
9041
  delete c.count);
8937
9042
  let p = At(n, c);
8938
- (ea(p),
9043
+ (ta(p),
8939
9044
  typeof p.image == 'string' && !p.images && !me(n) && ((p.images = [p.image]), delete p.image),
8940
9045
  p.image_url &&
8941
9046
  !p.first_frame_image &&
@@ -8976,7 +9081,7 @@ async function Ne(e, t) {
8976
9081
  }
8977
9082
  }
8978
9083
  }
8979
- await ra(p, async (b) => {
9084
+ await aa(p, async (b) => {
8980
9085
  let g = new T(`Uploading local file ${$.default.basename(b)} to CDN...`);
8981
9086
  s || g.start();
8982
9087
  try {
@@ -9000,7 +9105,7 @@ async function Ne(e, t) {
9000
9105
  let f;
9001
9106
  try {
9002
9107
  if (l > 1) {
9003
- await ia(d, e, p, l, { isJson: s, isAsync: o });
9108
+ await na(d, e, p, l, { isJson: s, isAsync: o });
9004
9109
  return;
9005
9110
  }
9006
9111
  f = await d.queueJob(e, p);
@@ -9103,13 +9208,13 @@ ${i.bold('Outputs:')}
9103
9208
  `),
9104
9209
  u)
9105
9210
  ) {
9106
- let C = na(u, g++, b),
9107
- Ye = new T(`Downloading output to ${C}...`).start();
9211
+ let C = sa(u, g++, b),
9212
+ Je = new T(`Downloading output to ${C}...`).start();
9108
9213
  try {
9109
9214
  (await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
9110
- Ye.succeed(`Saved to ${i.bold(C)}`));
9215
+ Je.succeed(`Saved to ${i.bold(C)}`));
9111
9216
  } catch (ye) {
9112
- Ye.fail(`Failed to download: ${ye instanceof Error ? ye.message : ye}`);
9217
+ Je.fail(`Failed to download: ${ye instanceof Error ? ye.message : ye}`);
9113
9218
  }
9114
9219
  }
9115
9220
  } else
@@ -9124,7 +9229,7 @@ ${I.text}
9124
9229
  }
9125
9230
  var Dt = _(require('node:readline'));
9126
9231
  A();
9127
- async function sa(e) {
9232
+ async function oa(e) {
9128
9233
  try {
9129
9234
  return (await new K(e, P()).checkKey(), 'ok');
9130
9235
  } catch (t) {
@@ -9135,7 +9240,7 @@ async function sa(e) {
9135
9240
  return 'unchecked';
9136
9241
  }
9137
9242
  }
9138
- function oa(e) {
9243
+ function la(e) {
9139
9244
  let t = Dt.default.createInterface({ input: process.stdin, output: process.stdout });
9140
9245
  return new Promise((r) => {
9141
9246
  t.question(e, (a) => {
@@ -9155,14 +9260,14 @@ ${i.bold('Tein AI Authentication')}
9155
9260
  process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
9156
9261
 
9157
9262
  `),
9158
- (r = await oa('Enter your Tein API Key (sk_live_...): '))),
9263
+ (r = await la('Enter your Tein API Key (sk_live_...): '))),
9159
9264
  !r.startsWith('sk_live_') &&
9160
9265
  !r.startsWith('sk_test_') &&
9161
9266
  (process.stderr
9162
9267
  .write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
9163
9268
  `),
9164
9269
  process.exit(1)));
9165
- let a = await sa(r);
9270
+ let a = await oa(r);
9166
9271
  (a === 'invalid' &&
9167
9272
  (process.stderr
9168
9273
  .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 +9339,10 @@ ${i.bold('Tein AI CLI Configuration')}
9234
9339
  A();
9235
9340
  Ie();
9236
9341
  W();
9237
- var la = 3e3;
9342
+ var pa = 3e3;
9238
9343
  async function Lt(e) {
9239
9344
  try {
9240
- let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(la) });
9345
+ let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(pa) });
9241
9346
  if (!t.ok) return;
9242
9347
  let r = await t.json(),
9243
9348
  a = {};
@@ -9248,15 +9353,15 @@ async function Lt(e) {
9248
9353
  Mt(a);
9249
9354
  } catch {}
9250
9355
  }
9251
- var pa = new Set(['video', 'image', 'text', 'audio', '3d']),
9252
- da = { llm: 'text', chat: 'text', reasoning: 'text' };
9356
+ var da = new Set(['video', 'image', 'text', 'audio', '3d']),
9357
+ ca = { llm: 'text', chat: 'text', reasoning: 'text' };
9253
9358
  async function Vt(e, t) {
9254
9359
  await Lt(t);
9255
9360
  let r = R();
9256
9361
  if (e) {
9257
9362
  let s = e.toLowerCase(),
9258
- o = da[s] ?? s;
9259
- r = pa.has(o)
9363
+ o = ca[s] ?? s;
9364
+ r = da.has(o)
9260
9365
  ? r.filter((u) => u.category.toLowerCase() === o)
9261
9366
  : r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
9262
9367
  }
@@ -9376,9 +9481,9 @@ ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
9376
9481
  `);
9377
9482
  }
9378
9483
  A();
9379
- Ue();
9380
- var ca = 1e4,
9381
- Fe = {
9484
+ Ve();
9485
+ var ua = 1e4,
9486
+ Ue = {
9382
9487
  price: '',
9383
9488
  creativeMode: 'Creative mode',
9384
9489
  priority: 'Priority',
@@ -9388,22 +9493,22 @@ var ca = 1e4,
9388
9493
  priorityDraft: 'Priority + Draft',
9389
9494
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
9390
9495
  },
9391
- ua = Object.keys(Fe),
9392
- ma = {
9496
+ ma = Object.keys(Ue),
9497
+ fa = {
9393
9498
  creativeMode: 'unfiltered',
9394
9499
  creativeModePriority: 'unfilteredPriority',
9395
9500
  creativeModeDraft: 'unfilteredDraft',
9396
9501
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
9397
9502
  };
9398
- function fa(e, t) {
9399
- let r = ma[t];
9503
+ function ga(e, t) {
9504
+ let r = fa[t];
9400
9505
  return e[t] ?? (r ? e[r] : void 0);
9401
9506
  }
9402
- async function ga(e, t) {
9507
+ async function ha(e, t) {
9403
9508
  let r = `${P(e)}${fe(t)}`,
9404
9509
  a;
9405
9510
  try {
9406
- a = await fetch(r, { signal: AbortSignal.timeout(ca) });
9511
+ a = await fetch(r, { signal: AbortSignal.timeout(ua) });
9407
9512
  } catch {
9408
9513
  throw new Error(`Could not reach ${r}`);
9409
9514
  }
@@ -9419,18 +9524,18 @@ async function ga(e, t) {
9419
9524
  }
9420
9525
  return n;
9421
9526
  }
9422
- function Be(e) {
9527
+ function Ne(e) {
9423
9528
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
9424
9529
  [r, a = ''] = t.split('.');
9425
9530
  return `$${r}.${a.padEnd(2, '0')}`;
9426
9531
  }
9427
- function je(e) {
9532
+ function Be(e) {
9428
9533
  if (!e || typeof e.starter != 'number') return null;
9429
9534
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
9430
9535
  r = typeof e.scale == 'number' ? e.scale : t;
9431
- return `Starter ${Be(e.starter)} Plus ${Be(t)} Scale ${Be(r)}`;
9536
+ return `Starter ${Ne(e.starter)} Plus ${Ne(t)} Scale ${Ne(r)}`;
9432
9537
  }
9433
- function ha(e) {
9538
+ function ya(e) {
9434
9539
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
9435
9540
  let t = [];
9436
9541
  for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -9442,33 +9547,33 @@ function ha(e) {
9442
9547
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
9443
9548
  );
9444
9549
  }
9445
- function ya(e, t) {
9446
- let r = ha(e);
9447
- for (let a of ua) {
9448
- let n = je(fa(e, a));
9550
+ function ba(e, t) {
9551
+ let r = ya(e);
9552
+ for (let a of ma) {
9553
+ let n = Be(ga(e, a));
9449
9554
  if (!n) continue;
9450
- let s = Fe[a] ? ` (${Fe[a]})` : '';
9555
+ let s = Ue[a] ? ` (${Ue[a]})` : '';
9451
9556
  t.push(` ${r}${s} ${n}`);
9452
9557
  }
9453
9558
  }
9454
- function ba(e, t) {
9559
+ function ka(e, t) {
9455
9560
  let r = e.quality ? ` quality=${e.quality}` : '';
9456
9561
  t.push(
9457
9562
  ` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
9458
9563
  );
9459
- for (let n of e.variants ?? []) ya(n, t);
9564
+ for (let n of e.variants ?? []) ba(n, t);
9460
9565
  let a = e.addons;
9461
9566
  if (Array.isArray(a))
9462
9567
  for (let n of a) {
9463
9568
  if (!n || typeof n != 'object') continue;
9464
9569
  let s = n,
9465
9570
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
9466
- u = je(s.price);
9571
+ u = Be(s.price);
9467
9572
  u && t.push(` ${o} (add-on) ${u}`);
9468
9573
  }
9469
9574
  t.push('');
9470
9575
  }
9471
- function ka(e) {
9576
+ function wa(e) {
9472
9577
  let t = [],
9473
9578
  r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
9474
9579
  (t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
@@ -9490,7 +9595,7 @@ function ka(e) {
9490
9595
  });
9491
9596
  for (let l of s) {
9492
9597
  t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
9493
- for (let c of a.get(l) ?? []) ba(c, t);
9598
+ for (let c of a.get(l) ?? []) ka(c, t);
9494
9599
  }
9495
9600
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
9496
9601
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -9507,7 +9612,7 @@ function ka(e) {
9507
9612
  t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
9508
9613
  for (let m of p) {
9509
9614
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
9510
- f = je(m.prices);
9615
+ f = Be(m.prices);
9511
9616
  f && t.push(` ${h} ${f}`);
9512
9617
  }
9513
9618
  t.push('');
@@ -9523,7 +9628,7 @@ function ka(e) {
9523
9628
  async function Ut(e) {
9524
9629
  let t;
9525
9630
  try {
9526
- t = await ga(e.apiUrl, e.model);
9631
+ t = await ha(e.apiUrl, e.model);
9527
9632
  } catch (r) {
9528
9633
  let a = r instanceof Error ? r.message : String(r);
9529
9634
  (process.stderr.write(`${i.red('Error:')} ${a}
@@ -9534,7 +9639,7 @@ async function Ut(e) {
9534
9639
  e.json
9535
9640
  ? `${JSON.stringify(t, null, 2)}
9536
9641
  `
9537
- : ka(t),
9642
+ : wa(t),
9538
9643
  );
9539
9644
  }
9540
9645
  var Bt = _(require('node:path'));
@@ -9649,8 +9754,8 @@ ${p.text}
9649
9754
  process.stdout.write(`
9650
9755
  `);
9651
9756
  }
9652
- var Ge = _(require('node:fs')),
9653
- ze = _(require('node:path'));
9757
+ var Fe = _(require('node:fs')),
9758
+ je = _(require('node:path'));
9654
9759
  A();
9655
9760
  async function jt(e, t = {}) {
9656
9761
  let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
@@ -9669,13 +9774,13 @@ async function jt(e, t = {}) {
9669
9774
  process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
9670
9775
  `),
9671
9776
  process.exit(1)));
9672
- let s = ze.default.resolve(e);
9673
- Ge.default.existsSync(s) ||
9777
+ let s = je.default.resolve(e);
9778
+ Fe.default.existsSync(s) ||
9674
9779
  (process.stderr.write(`${i.red('Error:')} File not found: ${s}
9675
9780
  `),
9676
9781
  process.exit(1));
9677
- let o = ze.default.basename(s),
9678
- l = Ge.default.readFileSync(s).toString('base64'),
9782
+ let o = je.default.basename(s),
9783
+ l = Fe.default.readFileSync(s).toString('base64'),
9679
9784
  c = new K(r, a),
9680
9785
  p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
9681
9786
  n || p.start();
@@ -9717,7 +9822,7 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
9717
9822
  }
9718
9823
  }
9719
9824
  W();
9720
- $e();
9825
+ Se();
9721
9826
  function sr() {
9722
9827
  process.stdout.write(`
9723
9828
  ${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
@@ -9778,7 +9883,7 @@ ${i.bold('EXAMPLES:')}
9778
9883
 
9779
9884
  `);
9780
9885
  }
9781
- async function Da() {
9886
+ async function La() {
9782
9887
  let e = process.argv.slice(2),
9783
9888
  t = Rt(e);
9784
9889
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
@@ -9842,7 +9947,7 @@ async function Da() {
9842
9947
  case 'run':
9843
9948
  case 'generate': {
9844
9949
  let r = t.subcommand || '';
9845
- await Ne(r, t.options);
9950
+ await Le(r, t.options);
9846
9951
  break;
9847
9952
  }
9848
9953
  case 'status': {
@@ -9864,7 +9969,7 @@ ${i.red('Error:')} Unknown command or model "${t.command}".
9864
9969
  Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
9865
9970
  `),
9866
9971
  process.exit(v)),
9867
- await Ne(t.command, t.options));
9972
+ await Le(t.command, t.options));
9868
9973
  return;
9869
9974
  }
9870
9975
  sr();
@@ -9872,7 +9977,7 @@ Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for t
9872
9977
  }
9873
9978
  }
9874
9979
  }
9875
- Da().catch((e) => {
9980
+ La().catch((e) => {
9876
9981
  (e instanceof w &&
9877
9982
  (process.stderr.write(`
9878
9983
  ${i.red('Error:')} ${S(e).join(`