@teinai/cli 1.1.16 → 1.1.18

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 +560 -517
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var Qt = Object.create;
4
- var fe = Object.defineProperty;
5
- var Xt = Object.getOwnPropertyDescriptor;
6
- var Zt = Object.getOwnPropertyNames;
7
- var ei = Object.getPrototypeOf,
8
- ti = Object.prototype.hasOwnProperty;
3
+ var ri = Object.create;
4
+ var he = Object.defineProperty;
5
+ var ai = Object.getOwnPropertyDescriptor;
6
+ var ni = Object.getOwnPropertyNames;
7
+ var si = Object.getPrototypeOf,
8
+ oi = Object.prototype.hasOwnProperty;
9
9
  var b = (e, t, i) => () => {
10
10
  if (i) throw i[0];
11
11
  try {
@@ -14,96 +14,96 @@ var b = (e, t, i) => () => {
14
14
  throw ((i = [r]), r);
15
15
  }
16
16
  };
17
- var ii = (e, t) => {
18
- for (var i in t) fe(e, i, { get: t[i], enumerable: !0 });
17
+ var li = (e, t) => {
18
+ for (var i in t) he(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- ri = (e, t, i, r) => {
20
+ pi = (e, t, i, r) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of Zt(t))
23
- !ti.call(e, n) &&
22
+ for (let n of ni(t))
23
+ !oi.call(e, n) &&
24
24
  n !== i &&
25
- fe(e, n, { get: () => t[n], enumerable: !(r = Xt(t, n)) || r.enumerable });
25
+ he(e, n, { get: () => t[n], enumerable: !(r = ai(t, n)) || r.enumerable });
26
26
  return e;
27
27
  };
28
- var I = (e, t, i) => (
29
- (i = e != null ? Qt(ei(e)) : {}),
30
- ri(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
28
+ var _ = (e, t, i) => (
29
+ (i = e != null ? ri(si(e)) : {}),
30
+ pi(t || !e || !e.__esModule ? he(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
- function L() {
32
+ function V() {
33
33
  try {
34
- if (C.default.existsSync(D)) {
35
- let e = C.default.readFileSync(D, 'utf-8');
34
+ if (C.default.existsSync(L)) {
35
+ let e = C.default.readFileSync(L, 'utf-8');
36
36
  return JSON.parse(e);
37
37
  }
38
38
  } catch {}
39
39
  return {};
40
40
  }
41
- function he(e) {
41
+ function be(e) {
42
42
  try {
43
43
  C.default.existsSync(te) || C.default.mkdirSync(te, { recursive: !0, mode: 448 });
44
- let i = { ...L(), ...e };
45
- (C.default.writeFileSync(D, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
44
+ let i = { ...V(), ...e };
45
+ (C.default.writeFileSync(L, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
46
46
  C.default.chmodSync(te, 448),
47
- C.default.chmodSync(D, 384));
47
+ C.default.chmodSync(L, 384));
48
48
  } catch (t) {
49
- throw new Error(`Failed to save config to ${D}: ${t}`);
49
+ throw new Error(`Failed to save config to ${L}: ${t}`);
50
50
  }
51
51
  }
52
52
  function S(e) {
53
53
  if (e && e.trim()) return e.trim();
54
54
  let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
55
55
  if (t && t.trim()) return t.trim();
56
- let i = L();
56
+ let i = V();
57
57
  return i.apiKey && i.apiKey.trim() ? i.apiKey.trim() : '';
58
58
  }
59
59
  function x(e) {
60
60
  if (e && e.trim()) return e.trim().replace(/\/+$/, '');
61
61
  let t = process.env.TEIN_API_URL;
62
62
  if (t && t.trim()) return t.trim().replace(/\/+$/, '');
63
- let i = L();
63
+ let i = V();
64
64
  return i.apiUrl && i.apiUrl.trim() ? i.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
65
65
  }
66
66
  function ie() {
67
- return D;
67
+ return L;
68
68
  }
69
69
  var C,
70
- He,
71
- ge,
70
+ Qe,
71
+ ye,
72
72
  te,
73
- D,
73
+ L,
74
74
  E = b(() => {
75
75
  'use strict';
76
- ((C = I(require('node:fs'))),
77
- (He = I(require('node:os'))),
78
- (ge = I(require('node:path'))),
79
- (te = ge.default.join(He.default.homedir(), '.tein')),
80
- (D = ge.default.join(te, 'config.json')));
76
+ ((C = _(require('node:fs'))),
77
+ (Qe = _(require('node:os'))),
78
+ (ye = _(require('node:path'))),
79
+ (te = ye.default.join(Qe.default.homedir(), '.tein')),
80
+ (L = ye.default.join(te, 'config.json')));
81
81
  });
82
- var pi,
83
- We,
84
- Ye,
85
- Qe = b(() => {
82
+ var gi,
83
+ Xe,
84
+ Ze,
85
+ et = b(() => {
86
86
  'use strict';
87
- ((pi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
- (We = [...pi, 'auto']),
89
- (Ye =
87
+ ((gi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (Xe = [...gi, 'auto']),
89
+ (Ze =
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 F,
93
- be = b(() => {
93
+ ke = b(() => {
94
94
  'use strict';
95
95
  F = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
96
96
  });
97
- function we(e) {
97
+ function re(e) {
98
98
  return !1;
99
99
  }
100
- var Xe = b(() => {
100
+ var tt = b(() => {
101
101
  'use strict';
102
102
  });
103
- var re,
104
- Ze = b(() => {
103
+ var ae,
104
+ it = b(() => {
105
105
  'use strict';
106
- re = {
106
+ ae = {
107
107
  source: 'TEIN Price Board',
108
108
  checked: '17 Sep 2026',
109
109
  generated: '2026-10-01',
@@ -4659,10 +4659,16 @@ var re,
4659
4659
  ],
4660
4660
  };
4661
4661
  });
4662
- function ve(e, t) {
4662
+ var rt,
4663
+ ne,
4664
+ xe = b(() => {
4665
+ 'use strict';
4666
+ ((rt = { slug: 'tein', name: 'Tein', models: [] }), (ne = []));
4667
+ });
4668
+ function Te(e, t) {
4663
4669
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
4664
4670
  }
4665
- function ci(e, t) {
4671
+ function bi(e, t) {
4666
4672
  if (e === 'seedance-2-mini') return 'mini';
4667
4673
  if (e !== 'seedance-2') return;
4668
4674
  let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -4672,81 +4678,88 @@ function ci(e, t) {
4672
4678
  ? 'fast'
4673
4679
  : 'standard';
4674
4680
  }
4675
- function ui(e, t) {
4681
+ function wi(e, t) {
4676
4682
  let i = e
4677
4683
  .trim()
4678
4684
  .toLowerCase()
4679
4685
  .replace(/-(?:unfiltered|uncensored)$/, '');
4680
4686
  if (i === 'seedance-2' || i === 'seedance-2-mini') {
4681
- let n = ci(i, t),
4682
- s = ke.get(ve('seedance-2', n));
4687
+ let n = bi(i, t),
4688
+ s = Ie.get(Te('seedance-2', n));
4683
4689
  return s ? s.slug : null;
4684
4690
  }
4685
- let r = ae.get(i) ?? ke.get(ve(i));
4691
+ let r = se.get(i) ?? Ie.get(Te(i));
4686
4692
  return r ? r.slug : null;
4687
4693
  }
4688
- function fi(e, t) {
4689
- return ae.has(e) && !(mi.has(e) && t) ? e : ui(e, t);
4694
+ function xi(e, t) {
4695
+ return se.has(e) && !(ki.has(e) && t) ? e : wi(e, t);
4690
4696
  }
4691
4697
  function G(e, t) {
4692
- let i = fi(e, t);
4693
- return i ? (ae.get(i) ?? null) : null;
4698
+ let i = xi(e, t);
4699
+ return i ? (se.get(i) ?? null) : null;
4694
4700
  }
4695
- function ne() {
4696
- return Ie.models;
4701
+ function oe() {
4702
+ return nt;
4697
4703
  }
4698
- var Ie,
4699
- ae,
4700
- ke,
4701
- et,
4702
- di,
4703
- xe,
4704
- mi,
4705
- V = b(() => {
4704
+ var ve,
4705
+ _e,
4706
+ nt,
4707
+ hi,
4708
+ se,
4709
+ Ie,
4710
+ at,
4711
+ yi,
4712
+ Pe,
4713
+ ki,
4714
+ N = b(() => {
4706
4715
  'use strict';
4707
- Xe();
4708
- Ze();
4709
- ((Ie = {
4710
- ...re,
4711
- families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
4712
- models: re.models.filter((e) => !we(e.slug)),
4716
+ tt();
4717
+ it();
4718
+ xe();
4719
+ ((ve = {
4720
+ ...ae,
4721
+ families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !re(t)) })),
4722
+ models: ae.models.filter((e) => !re(e.slug)),
4713
4723
  }),
4714
- (ae = new Map()),
4715
- (ke = new Map()),
4716
- (et = new Map()),
4717
- (di = new Map()),
4718
- (xe = new Map()));
4719
- for (let e of Ie.models) {
4720
- (ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
4721
- for (let t of e.variants) et.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4724
+ (_e = ne.filter((e) => !re(e.slug))),
4725
+ (nt = [...ve.models, ..._e]),
4726
+ (hi = _e.length ? [...ve.families, { ...rt, models: _e.map((e) => e.slug) }] : ve.families),
4727
+ (se = new Map()),
4728
+ (Ie = new Map()),
4729
+ (at = new Map()),
4730
+ (yi = new Map()),
4731
+ (Pe = new Map()));
4732
+ for (let e of nt) {
4733
+ (se.set(e.slug, e), Ie.set(Te(e.api.model, e.api.quality), e));
4734
+ for (let t of e.variants) at.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4722
4735
  for (let t of e.editVariants ?? [])
4723
- et.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4724
- for (let t of e.addons ?? []) di.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4725
- xe.set(e.slug, e.family);
4736
+ at.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4737
+ for (let t of e.addons ?? []) yi.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4738
+ Pe.set(e.slug, e.family);
4726
4739
  }
4727
- for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
4728
- mi = new Set(['seedance-2']);
4740
+ for (let e of hi) for (let t of e.models) Pe.has(t) || Pe.set(t, e.slug);
4741
+ ki = new Set(['seedance-2']);
4729
4742
  });
4730
- function se(e) {
4743
+ function le(e) {
4731
4744
  let t = e.from?.variant;
4732
4745
  return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
4733
4746
  }
4734
- function _e(e) {
4747
+ function Me(e) {
4735
4748
  if (e.endpoints?.length)
4736
- return e.editVariants?.length && e.endpoints.some((t) => t.id === tt)
4737
- ? tt
4749
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === st)
4750
+ ? st
4738
4751
  : (e.defaultEndpoint ?? e.endpoints[0].id);
4739
4752
  }
4740
- var tt,
4741
- Pe = b(() => {
4753
+ var st,
4754
+ Ke = b(() => {
4742
4755
  'use strict';
4743
- V();
4744
- tt = 'dynamic';
4756
+ N();
4757
+ st = 'dynamic';
4745
4758
  });
4746
- var oe,
4747
- Te = b(() => {
4759
+ var pe,
4760
+ Se = b(() => {
4748
4761
  'use strict';
4749
- oe = {
4762
+ pe = {
4750
4763
  'gemini-3-8-flash': 'gemini-3.8-flash',
4751
4764
  'gemini-3-7-flash': 'gemini-3.7-flash',
4752
4765
  'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
@@ -4754,29 +4767,29 @@ var oe,
4754
4767
  'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
4755
4768
  };
4756
4769
  });
4757
- var it = b(() => {
4770
+ var ot = b(() => {
4758
4771
  'use strict';
4759
4772
  });
4760
- function rt(e, t) {
4761
- return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
4773
+ function lt(e, t) {
4774
+ return typeof t == 'string' && (vi[e]?.includes(t) ?? !1);
4762
4775
  }
4763
- var gi,
4764
- at = b(() => {
4776
+ var vi,
4777
+ pt = b(() => {
4765
4778
  'use strict';
4766
- V();
4767
- Pe();
4768
- it();
4769
- gi = {};
4779
+ N();
4780
+ Ke();
4781
+ ot();
4782
+ vi = {};
4770
4783
  });
4771
- function nt(e) {
4772
- return e === 'nano-banana-pro' ? hi : yi;
4784
+ function dt(e) {
4785
+ return e === 'nano-banana-pro' ? _i : Ii;
4773
4786
  }
4774
- var hi,
4775
- yi,
4776
- st = b(() => {
4787
+ var _i,
4788
+ Ii,
4789
+ ct = b(() => {
4777
4790
  'use strict';
4778
- ((hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4779
- (yi = [
4791
+ ((_i = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4792
+ (Ii = [
4780
4793
  'auto',
4781
4794
  '1:1',
4782
4795
  '1:4',
@@ -4794,10 +4807,10 @@ var hi,
4794
4807
  '21:9',
4795
4808
  ]));
4796
4809
  });
4797
- var ot,
4798
- lt = b(() => {
4810
+ var ut,
4811
+ mt = b(() => {
4799
4812
  'use strict';
4800
- ot = [
4813
+ ut = [
4801
4814
  'prompt',
4802
4815
  'system',
4803
4816
  'messages',
@@ -4811,10 +4824,10 @@ var ot,
4811
4824
  'endpoint',
4812
4825
  ];
4813
4826
  });
4814
- var pt,
4815
- dt = b(() => {
4827
+ var ft,
4828
+ gt = b(() => {
4816
4829
  'use strict';
4817
- pt = [
4830
+ ft = [
4818
4831
  {
4819
4832
  slug: 'claude-fable-5-1',
4820
4833
  family: 'fable-5-1',
@@ -4883,13 +4896,13 @@ var pt,
4883
4896
  },
4884
4897
  ];
4885
4898
  });
4886
- function ct(e) {
4899
+ function ht(e) {
4887
4900
  return `$${e}`;
4888
4901
  }
4889
- function Me(e, t, i) {
4902
+ function $e(e, t, i) {
4890
4903
  return G(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
4891
4904
  }
4892
- function bi(e) {
4905
+ function Pi(e) {
4893
4906
  return [
4894
4907
  {
4895
4908
  name: 'prompt',
@@ -4955,13 +4968,13 @@ function bi(e) {
4955
4968
  },
4956
4969
  ];
4957
4970
  }
4958
- function ut() {
4971
+ function yt() {
4959
4972
  return Object.fromEntries(
4960
- pt.map((e) => {
4961
- let t = Me(e.slug, 'cheap', 'input'),
4962
- i = Me(e.slug, 'cheap', 'output'),
4963
- r = Me(e.slug, 'stable', 'input') != null,
4964
- n = t != null && i != null ? `${ct(t)}/M in \xB7 ${ct(i)}/M out` : '',
4973
+ ft.map((e) => {
4974
+ let t = $e(e.slug, 'cheap', 'input'),
4975
+ i = $e(e.slug, 'cheap', 'output'),
4976
+ r = $e(e.slug, 'stable', 'input') != null,
4977
+ n = t != null && i != null ? `${ht(t)}/M in \xB7 ${ht(i)}/M out` : '',
4965
4978
  s = {
4966
4979
  slug: e.slug,
4967
4980
  name: e.name,
@@ -4972,20 +4985,20 @@ function ut() {
4972
4985
  priceFormatted: n,
4973
4986
  unit: '/M tokens',
4974
4987
  primaryToolName: 'run_task',
4975
- parameters: bi(r),
4988
+ parameters: Pi(r),
4976
4989
  };
4977
4990
  return [e.slug, s];
4978
4991
  }),
4979
4992
  );
4980
4993
  }
4981
- var mt = b(() => {
4994
+ var bt = b(() => {
4982
4995
  'use strict';
4983
- dt();
4984
- V();
4996
+ gt();
4997
+ N();
4985
4998
  });
4986
4999
  var J,
4987
- le,
4988
- Ke = b(() => {
5000
+ de,
5001
+ Ce = b(() => {
4989
5002
  'use strict';
4990
5003
  ((J = [
4991
5004
  'seedance-2-5',
@@ -4995,13 +5008,13 @@ var J,
4995
5008
  'wan-3-0',
4996
5009
  'z-image-pro',
4997
5010
  ]),
4998
- (le =
5011
+ (de =
4999
5012
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
5000
5013
  });
5001
5014
  function z(e) {
5002
5015
  return `$${Number(e.toFixed(5))}`;
5003
5016
  }
5004
- function vi(e) {
5017
+ function Si(e) {
5005
5018
  if (e.kind === 'llm') {
5006
5019
  let t = e.defaultEndpoint,
5007
5020
  i = (s) =>
@@ -5015,40 +5028,40 @@ function vi(e) {
5015
5028
  n = i('output');
5016
5029
  return r && n
5017
5030
  ? `${z(r.price.starter)}/M in \xB7 ${z(n.price.starter)}/M out`
5018
- : `from ${z(se(e).price.starter)}/M tokens`;
5031
+ : `from ${z(le(e).price.starter)}/M tokens`;
5019
5032
  }
5020
- return `from ${z(se(e).price.starter)}${e.unit}`;
5033
+ return `from ${z(le(e).price.starter)}${e.unit}`;
5021
5034
  }
5022
- function Ii(e, t) {
5035
+ function $i(e, t) {
5023
5036
  let i = t.filter((r) => Number.isFinite(r) && r > 0);
5024
5037
  return i.length ? `from ${z(Math.min(...i))}${e}` : null;
5025
5038
  }
5026
- function yt(e) {
5039
+ function _t(e) {
5027
5040
  for (let t of F) {
5028
- let i = de[t],
5029
- r = i ? Ii(i.unit, e[t] ?? []) : null;
5041
+ let i = ue[t],
5042
+ r = i ? $i(i.unit, e[t] ?? []) : null;
5030
5043
  i && r && (i.priceFormatted = r);
5031
5044
  }
5032
5045
  }
5033
- function N(e, t) {
5046
+ function O(e, t) {
5034
5047
  let i = e.axes?.resolution ?? [
5035
5048
  ...new Set(e.variants.map((r) => r.resolution).filter((r) => !!r)),
5036
5049
  ];
5037
5050
  return {
5038
5051
  name: 'resolution',
5039
5052
  type: 'select',
5040
- default: se(e).resolution ?? i[0],
5053
+ default: le(e).resolution ?? i[0],
5041
5054
  options: i,
5042
5055
  ...(t ? { description: t } : {}),
5043
5056
  };
5044
5057
  }
5045
- function bt(e) {
5058
+ function It(e) {
5046
5059
  if (!e.endpoints?.length) return null;
5047
- let t = e.endpoints.filter((i) => rt(e.slug, i.id));
5060
+ let t = e.endpoints.filter((i) => lt(e.slug, i.id));
5048
5061
  return {
5049
5062
  name: 'endpoint',
5050
5063
  type: 'select',
5051
- default: _e(e),
5064
+ default: Me(e),
5052
5065
  options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
5053
5066
  description:
5054
5067
  (e.slug === 'gemini-3.1-pro-preview'
@@ -5057,20 +5070,20 @@ function bt(e) {
5057
5070
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
5058
5071
  };
5059
5072
  }
5060
- function Ti(e, t) {
5073
+ function qi(e, t) {
5061
5074
  if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
5062
5075
  let i = J.includes(e.api.model);
5063
- return [...t.filter((r) => !Ee.has(r.name)), i ? wt : _i];
5076
+ return [...t.filter((r) => !Re.has(r.name)), i ? Pt : Ci];
5064
5077
  }
5065
- function Se(e, t) {
5066
- let i = e.filter((n) => !Ee.has(n.name)),
5067
- r = [wt, Pi];
5068
- return (r.push(kt, xt), [...i, ...r]);
5078
+ function Ee(e, t) {
5079
+ let i = e.filter((n) => !Re.has(n.name)),
5080
+ r = [Pt, Ei];
5081
+ return (r.push(Tt, Mt), [...i, ...r]);
5069
5082
  }
5070
- function ft(e, t = {}) {
5083
+ function wt(e, t = {}) {
5071
5084
  return [
5072
5085
  ...e
5073
- .filter((i) => !Mi.has(i.name) && !Ee.has(i.name))
5086
+ .filter((i) => !Ai.has(i.name) && !Re.has(i.name))
5074
5087
  .map((i) =>
5075
5088
  i.name === 'prompt'
5076
5089
  ? { ...i, required: !0 }
@@ -5080,7 +5093,7 @@ function ft(e, t = {}) {
5080
5093
  ...(t.no4k && i.options
5081
5094
  ? { options: i.options.filter((r) => String(r).toLowerCase() !== '4k') }
5082
5095
  : {}),
5083
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${pe}`,
5096
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
5084
5097
  }
5085
5098
  : i,
5086
5099
  ),
@@ -5091,11 +5104,11 @@ function ft(e, t = {}) {
5091
5104
  options: ['standard'],
5092
5105
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
5093
5106
  },
5094
- kt,
5095
- xt,
5107
+ Tt,
5108
+ Mt,
5096
5109
  ];
5097
5110
  }
5098
- function $e(e, t) {
5111
+ function qe(e, t) {
5099
5112
  return [
5100
5113
  $('Text prompt describing the video.'),
5101
5114
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
@@ -5107,7 +5120,7 @@ function $e(e, t) {
5107
5120
  max: t.maxSec,
5108
5121
  description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
5109
5122
  },
5110
- N(e),
5123
+ O(e),
5111
5124
  { name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
5112
5125
  ...t.references.map((i) =>
5113
5126
  i.endsWith('s')
@@ -5124,8 +5137,8 @@ function $e(e, t) {
5124
5137
  ),
5125
5138
  ];
5126
5139
  }
5127
- function Ki(e) {
5128
- let t = bt(e);
5140
+ function Ri(e) {
5141
+ let t = It(e);
5129
5142
  return [
5130
5143
  $('Image prompt text. Supports complex composition and text instructions.'),
5131
5144
  ...(t ? [t] : []),
@@ -5135,17 +5148,17 @@ function Ki(e) {
5135
5148
  default: 'low',
5136
5149
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
5137
5150
  },
5138
- N(
5151
+ O(
5139
5152
  e,
5140
5153
  e.slug === 'gpt-image-2'
5141
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ye}`
5154
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ze}`
5142
5155
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
5143
5156
  ),
5144
5157
  {
5145
5158
  name: 'aspect_ratio',
5146
5159
  type: 'select',
5147
5160
  default: 'auto',
5148
- options: [...We],
5161
+ options: [...Xe],
5149
5162
  description:
5150
5163
  "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.",
5151
5164
  },
@@ -5192,7 +5205,7 @@ function Ki(e) {
5192
5205
  },
5193
5206
  ];
5194
5207
  }
5195
- function Si(e) {
5208
+ function Oi(e) {
5196
5209
  return [
5197
5210
  $('Image prompt text.'),
5198
5211
  {
@@ -5200,8 +5213,8 @@ function Si(e) {
5200
5213
  type: 'string[]',
5201
5214
  description: 'Images to edit or use as reference (up to 14).',
5202
5215
  },
5203
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...nt(e.slug)] },
5204
- N(e),
5216
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...dt(e.slug)] },
5217
+ O(e),
5205
5218
  {
5206
5219
  name: 'n',
5207
5220
  type: 'slider',
@@ -5226,10 +5239,10 @@ function Si(e) {
5226
5239
  },
5227
5240
  ];
5228
5241
  }
5229
- function qi() {
5230
- let e = ot,
5242
+ function Ni() {
5243
+ let e = ut,
5231
5244
  t = [];
5232
- for (let i of qe(!0))
5245
+ for (let i of Oe(!0))
5233
5246
  e.includes(i.name) &&
5234
5247
  (t.push({
5235
5248
  ...i,
@@ -5251,12 +5264,12 @@ function qi() {
5251
5264
  }));
5252
5265
  return t;
5253
5266
  }
5254
- function Ai() {
5255
- return qe(!0).map((e) =>
5267
+ function Ui() {
5268
+ return Oe(!0).map((e) =>
5256
5269
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
5257
5270
  );
5258
5271
  }
5259
- function qe(e) {
5272
+ function Oe(e) {
5260
5273
  return [
5261
5274
  $('The user message or task.'),
5262
5275
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -5351,44 +5364,67 @@ function qe(e) {
5351
5364
  },
5352
5365
  ];
5353
5366
  }
5354
- function Ri(e) {
5355
- if (e.slug === 'seed-2-1-turbo') return Ci;
5356
- let t = bt(e);
5367
+ function Bi(e) {
5368
+ if (e.slug === 'seed-2-1-turbo') return Li;
5369
+ let t = It(e);
5357
5370
  return [
5358
5371
  ...(e.slug === 'gemini-3.1-pro-preview'
5359
- ? qi()
5372
+ ? Ni()
5360
5373
  : e.slug === 'gemini-3.7-flash'
5361
- ? Ai()
5362
- : e.slug === 'gpt-6-astra' || Ei.includes(e.slug)
5363
- ? qe(e.slug !== 'gpt-6-astra')
5364
- : $i),
5374
+ ? Ui()
5375
+ : e.slug === 'gpt-6-astra' || Vi.includes(e.slug)
5376
+ ? Oe(e.slug !== 'gpt-6-astra')
5377
+ : Di),
5365
5378
  ...(t ? [t] : []),
5366
5379
  ];
5367
5380
  }
5368
- function Oi(e) {
5381
+ function ji(e) {
5382
+ return [
5383
+ {
5384
+ name: 'video_url',
5385
+ type: 'string',
5386
+ required: !0,
5387
+ description:
5388
+ 'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
5389
+ },
5390
+ O(
5391
+ e,
5392
+ 'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
5393
+ ),
5394
+ {
5395
+ name: 'grain',
5396
+ type: 'select',
5397
+ default: 'off',
5398
+ options: ['off', 'light', 'medium', 'heavy'],
5399
+ description: 'Film grain added to the result.',
5400
+ },
5401
+ ];
5402
+ }
5403
+ function Fi(e) {
5369
5404
  let t = e.slug;
5370
- if (e.kind === 'llm') return Ri(e);
5371
- if (e.editVariants?.length) return Ki(e);
5405
+ if (ne.some((i) => i.slug === t)) return ji(e);
5406
+ if (e.kind === 'llm') return Bi(e);
5407
+ if (e.editVariants?.length) return Ri(e);
5372
5408
  switch (t) {
5373
5409
  case 'seedance-2-5':
5374
- return Se(gt, t);
5410
+ return Ee(kt, t);
5375
5411
  case 'seedance-2-5-lite':
5376
- return ft(gt, { no4k: !0 });
5412
+ return wt(kt, { no4k: !0 });
5377
5413
  case 'seedance-2':
5378
- return Se(ht, t);
5414
+ return Ee(xt, t);
5379
5415
  case 'seedance-2-lite':
5380
- return ft(ht);
5416
+ return wt(xt);
5381
5417
  case 'seedance-2-mini':
5382
- return Se(Di, t);
5418
+ return Ee(Gi, t);
5383
5419
  case 'nano-banana-2':
5384
5420
  case 'nano-banana-2.1':
5385
5421
  case 'nano-banana-pro':
5386
- return Si(e);
5422
+ return Oi(e);
5387
5423
  case 'seedream-5-pro':
5388
5424
  return [
5389
5425
  $('Detailed description of the image to generate.'),
5390
5426
  { name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
5391
- N(e),
5427
+ O(e),
5392
5428
  {
5393
5429
  name: 'aspect_ratio',
5394
5430
  type: 'select',
@@ -5406,7 +5442,7 @@ function Oi(e) {
5406
5442
  type: 'string[]',
5407
5443
  description: 'Up to 3 reference images, each billed at the published add-on price.',
5408
5444
  },
5409
- N(e),
5445
+ O(e),
5410
5446
  {
5411
5447
  name: 'aspect_ratio',
5412
5448
  type: 'select',
@@ -5425,7 +5461,7 @@ function Oi(e) {
5425
5461
  case 'z-image-pro':
5426
5462
  return [
5427
5463
  $('Image prompt text: subject, scene, style, composition and lighting.'),
5428
- N(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
5464
+ O(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
5429
5465
  {
5430
5466
  name: 'aspect_ratio',
5431
5467
  type: 'select',
@@ -5478,7 +5514,7 @@ function Oi(e) {
5478
5514
  ];
5479
5515
  case 'wan-3-0':
5480
5516
  case 'wan-3-0-prime':
5481
- return $e(e, {
5517
+ return qe(e, {
5482
5518
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5483
5519
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
5484
5520
  minSec: 2,
@@ -5488,7 +5524,7 @@ function Oi(e) {
5488
5524
  });
5489
5525
  case 'happy-horse-1-1':
5490
5526
  case 'happy-horse-1-0':
5491
- return $e(e, {
5527
+ return qe(e, {
5492
5528
  modes:
5493
5529
  t === 'happy-horse-1-0'
5494
5530
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -5499,7 +5535,7 @@ function Oi(e) {
5499
5535
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
5500
5536
  });
5501
5537
  case 'minimax-h3':
5502
- return $e(e, {
5538
+ return qe(e, {
5503
5539
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5504
5540
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
5505
5541
  minSec: 4,
@@ -5510,149 +5546,156 @@ function Oi(e) {
5510
5546
  return [$('Prompt text.')];
5511
5547
  }
5512
5548
  }
5513
- function Ce(e, t = e.api.model) {
5549
+ function Ae(e, t = e.api.model) {
5514
5550
  return {
5515
5551
  slug: t,
5516
5552
  name: e.name,
5517
- category: wi[e.kind],
5518
- kind: xi[e.kind],
5553
+ category: Ti[e.kind],
5554
+ kind: Ki[e.kind],
5519
5555
  vendor: e.vendor ?? '',
5520
5556
  description: e.desc ?? e.name,
5521
- priceFormatted: vi(e),
5557
+ priceFormatted: Si(e),
5522
5558
  unit: e.unit,
5523
- primaryToolName: ki[e.kind],
5524
- parameters: Ti(e, Oi(e)),
5559
+ primaryToolName: Mi[e.kind],
5560
+ parameters: qi(e, Fi(e)),
5525
5561
  };
5526
5562
  }
5527
- function Li() {
5563
+ function Ji() {
5528
5564
  let e = {};
5529
- for (let t of ne())
5565
+ for (let t of oe())
5530
5566
  if (t.slug !== 'seedance-2-fast') {
5531
5567
  if (t.slug === 'seedance-2-mini') {
5532
- e['seedance-2-mini'] = Ce(t, 'seedance-2-mini');
5568
+ e['seedance-2-mini'] = Ae(t, 'seedance-2-mini');
5533
5569
  continue;
5534
5570
  }
5535
5571
  if (t.slug === 'seedance-2') {
5536
- let i = Ce(t);
5572
+ let i = Ae(t);
5537
5573
  ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
5538
5574
  (e['seedance-2'] = i));
5539
5575
  continue;
5540
5576
  }
5541
- t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
5577
+ t.slug.startsWith('claude-') || (e[t.api.model] = Ae(t));
5542
5578
  }
5543
- Object.assign(e, ut());
5544
- for (let [t, i] of Object.entries(oe))
5579
+ Object.assign(e, yt());
5580
+ for (let [t, i] of Object.entries(pe))
5545
5581
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
5546
5582
  return e;
5547
5583
  }
5548
5584
  function U(e) {
5549
- return de[e] ?? null;
5585
+ return ue[e] ?? null;
5550
5586
  }
5551
- function Vi(e, t, i) {
5587
+ function zi(e, t, i) {
5552
5588
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
5553
5589
  let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
5554
5590
  if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
5555
5591
  }
5556
- return !0;
5592
+ return !(
5593
+ (t === 'max_tokens' && vt(i.max_completion_tokens)) ||
5594
+ (t === 'max_completion_tokens' && vt(i.max_tokens))
5595
+ );
5596
+ }
5597
+ function vt(e) {
5598
+ return e != null && e !== '';
5557
5599
  }
5558
- function _t(e, t) {
5600
+ function $t(e, t) {
5559
5601
  let i = { ...t };
5560
5602
  if (e?.slug === 'seedance-2-5') {
5561
5603
  let r = (n) => typeof n != 'string' || !n.trim();
5562
- for (let n of Ni) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
5604
+ for (let n of Hi) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
5563
5605
  if (!r(i.finalize)) return i;
5564
5606
  }
5565
5607
  for (let r of e?.parameters ?? [])
5566
5608
  r.default !== void 0 &&
5567
5609
  i[r.name] === void 0 &&
5568
- Vi(e.slug, r.name, t) &&
5610
+ zi(e.slug, r.name, t) &&
5569
5611
  (i[r.name] = r.default);
5570
5612
  return i;
5571
5613
  }
5572
5614
  function q() {
5573
- return Object.values(de);
5615
+ return Object.values(ue);
5574
5616
  }
5575
- var wi,
5576
- ki,
5577
- xi,
5578
- $,
5579
- wt,
5580
- _i,
5581
- Pi,
5582
- kt,
5583
- xt,
5584
- Ee,
5617
+ var Ti,
5585
5618
  Mi,
5586
- $i,
5619
+ Ki,
5620
+ $,
5621
+ Pt,
5587
5622
  Ci,
5588
5623
  Ei,
5589
- pe,
5590
- gt,
5591
- vt,
5592
- It,
5593
- ht,
5624
+ Tt,
5625
+ Mt,
5626
+ Re,
5627
+ Ai,
5594
5628
  Di,
5595
- de,
5596
- Ni,
5629
+ Li,
5630
+ Vi,
5631
+ ce,
5632
+ kt,
5633
+ Kt,
5634
+ St,
5635
+ xt,
5636
+ Gi,
5637
+ ue,
5638
+ Hi,
5597
5639
  H = b(() => {
5598
5640
  'use strict';
5599
- Qe();
5600
- be();
5601
- V();
5602
- Pe();
5603
- Te();
5604
- at();
5605
- st();
5606
- lt();
5607
- mt();
5641
+ et();
5642
+ ke();
5643
+ N();
5608
5644
  Ke();
5609
- ((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5610
- (ki = {
5645
+ xe();
5646
+ Se();
5647
+ pt();
5648
+ ct();
5649
+ mt();
5650
+ bt();
5651
+ Ce();
5652
+ ((Ti = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5653
+ (Mi = {
5611
5654
  video: 'generate_video',
5612
5655
  image: 'generate_image',
5613
5656
  audio: 'generate_audio',
5614
5657
  llm: 'run_task',
5615
5658
  }),
5616
- (xi = {
5659
+ (Ki = {
5617
5660
  video: 'Text-to-Video',
5618
5661
  image: 'Text-to-Image',
5619
5662
  audio: 'Text-to-Audio',
5620
5663
  llm: 'Reasoning (LLM)',
5621
5664
  }));
5622
5665
  $ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
5623
- ((wt = {
5666
+ ((Pt = {
5624
5667
  name: 'creative_mode',
5625
5668
  type: 'boolean',
5626
5669
  default: !1,
5627
5670
  description:
5628
5671
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
5629
5672
  }),
5630
- (_i = {
5673
+ (Ci = {
5631
5674
  name: 'creative_mode',
5632
5675
  type: 'boolean',
5633
5676
  default: !1,
5634
- description: `Not available yet on this model: ${le}.`,
5677
+ description: `Not available yet on this model: ${de}.`,
5635
5678
  }),
5636
- (Pi = {
5679
+ (Ei = {
5637
5680
  name: 'priority',
5638
5681
  type: 'boolean',
5639
5682
  default: !1,
5640
5683
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
5641
5684
  }),
5642
- (kt = {
5685
+ (Tt = {
5643
5686
  name: 'reference_roles',
5644
5687
  type: 'json',
5645
5688
  description: `Omni Reference only. Role of each reference, by tag { "@Image1": "prop" } or by kind { "image": ["prop"] }. Image: appearance, clothing, prop, scene_layout, lighting, first_frame, last_frame; Seedance 2.5 also keyframe, storyboard. Video: motion, camera, style; Seedance 2.5 also blockout_coarse, blockout_fine. Audio: voice, ambience, music, sound_effect. On a tag, the value image, video or audio uses that kind's default (appearance, motion, voice).`,
5646
5689
  }),
5647
- (xt = {
5690
+ (Mt = {
5648
5691
  name: 'auto_fit_images',
5649
5692
  type: 'boolean',
5650
5693
  default: !1,
5651
5694
  description:
5652
5695
  'Fits a reference image whose aspect ratio (width / height) is outside 0.40-2.50 just inside it: a slight stretch, or the image on a blurred copy of itself, never cropped. Off: such an image is refused with a 422. First and last frames are never changed. Same price.',
5653
5696
  }),
5654
- (Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5655
- Mi = new Set([
5697
+ (Re = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5698
+ Ai = new Set([
5656
5699
  'quality',
5657
5700
  'bitrate_mode',
5658
5701
  'draft',
@@ -5661,7 +5704,7 @@ var wi,
5661
5704
  'draft_generation_id',
5662
5705
  'pass_faces',
5663
5706
  ]);
5664
- (($i = [
5707
+ ((Di = [
5665
5708
  $('The user message or task.'),
5666
5709
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5667
5710
  {
@@ -5679,7 +5722,7 @@ var wi,
5679
5722
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
5680
5723
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
5681
5724
  ]),
5682
- (Ci = [
5725
+ (Li = [
5683
5726
  $('The user message or task.'),
5684
5727
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5685
5728
  {
@@ -5761,9 +5804,9 @@ var wi,
5761
5804
  description: 'Video frames read a second.',
5762
5805
  },
5763
5806
  ]),
5764
- (Ei = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5765
- ((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
5766
- (gt = [
5807
+ (Vi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5808
+ ((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
5809
+ (kt = [
5767
5810
  {
5768
5811
  name: 'prompt',
5769
5812
  type: 'string',
@@ -5801,7 +5844,7 @@ var wi,
5801
5844
  type: 'select',
5802
5845
  default: '480p',
5803
5846
  options: ['480p', '720p', '1080p', '4k'],
5804
- description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${pe}`,
5847
+ description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${ce}`,
5805
5848
  },
5806
5849
  {
5807
5850
  name: 'aspect_ratio',
@@ -5912,19 +5955,19 @@ var wi,
5912
5955
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5913
5956
  },
5914
5957
  ]),
5915
- (vt = {
5958
+ (Kt = {
5916
5959
  name: 'images',
5917
5960
  type: 'string[]',
5918
5961
  description:
5919
5962
  'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
5920
5963
  }),
5921
- (It = {
5964
+ (St = {
5922
5965
  name: 'audios',
5923
5966
  type: 'string[]',
5924
5967
  description:
5925
5968
  'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
5926
5969
  }),
5927
- (ht = [
5970
+ (xt = [
5928
5971
  {
5929
5972
  name: 'prompt',
5930
5973
  type: 'string',
@@ -5968,7 +6011,7 @@ var wi,
5968
6011
  type: 'select',
5969
6012
  default: '480p',
5970
6013
  options: ['480p', '720p', '1080p', '4k'],
5971
- description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${pe}`,
6014
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ce}`,
5972
6015
  },
5973
6016
  {
5974
6017
  name: 'bitrate_mode',
@@ -6002,8 +6045,8 @@ var wi,
6002
6045
  description:
6003
6046
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
6004
6047
  },
6005
- vt,
6006
- It,
6048
+ Kt,
6049
+ St,
6007
6050
  {
6008
6051
  name: 'first_frame_image',
6009
6052
  type: 'string',
@@ -6024,7 +6067,7 @@ var wi,
6024
6067
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
6025
6068
  },
6026
6069
  ]),
6027
- (Di = [
6070
+ (Gi = [
6028
6071
  {
6029
6072
  name: 'prompt',
6030
6073
  type: 'string',
@@ -6045,7 +6088,7 @@ var wi,
6045
6088
  type: 'select',
6046
6089
  default: '480p',
6047
6090
  options: ['480p', '720p'],
6048
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${pe}`,
6091
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ce}`,
6049
6092
  },
6050
6093
  {
6051
6094
  name: 'bitrate_mode',
@@ -6079,8 +6122,8 @@ var wi,
6079
6122
  description:
6080
6123
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
6081
6124
  },
6082
- vt,
6083
- It,
6125
+ Kt,
6126
+ St,
6084
6127
  {
6085
6128
  name: 'first_frame_image',
6086
6129
  type: 'string',
@@ -6095,53 +6138,53 @@ var wi,
6095
6138
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
6096
6139
  },
6097
6140
  ]));
6098
- de = Li();
6099
- Ni = ['draft_task_id', 'draft_generation_id'];
6141
+ ue = Ji();
6142
+ Hi = ['draft_task_id', 'draft_generation_id'];
6100
6143
  });
6101
- function ce(e) {
6144
+ function me(e) {
6102
6145
  let t = '/v1/pricing/models',
6103
6146
  i = e?.trim();
6104
6147
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
6105
6148
  }
6106
- var Re = b(() => {
6149
+ var Le = b(() => {
6107
6150
  'use strict';
6108
6151
  });
6109
- function Rt(e) {
6152
+ function Ut(e) {
6110
6153
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
6111
6154
  }
6112
- function Ot(e) {
6113
- let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
6155
+ function Bt(e) {
6156
+ let t = oe().filter((s) => s.kind === e && s.unfiltered != null),
6114
6157
  i = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
6115
6158
  r = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
6116
6159
  return [
6117
6160
  ...(i.length
6118
- ? [`${Rt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
6161
+ ? [`${Ut(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
6119
6162
  : []),
6120
- ...(r.length ? [`Not available yet on ${Rt(r)}: ${le}.`] : []),
6163
+ ...(r.length ? [`Not available yet on ${Ut(r)}: ${de}.`] : []),
6121
6164
  'The Acceptable Use Policy applies.',
6122
6165
  ].join(' ');
6123
6166
  }
6124
- function pr(e) {
6125
- if (or.has(e.name)) return e;
6167
+ function yr(e) {
6168
+ if (gr.has(e.name)) return e;
6126
6169
  let t = e.inputSchema.properties;
6127
6170
  return !t || t.callback_url
6128
6171
  ? e
6129
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: sr } } };
6172
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: fr } } };
6130
6173
  }
6131
- function dr(e) {
6174
+ function br(e) {
6132
6175
  let t = e.inputSchema.properties;
6133
6176
  if (!t) return e;
6134
6177
  let i = !1,
6135
6178
  r = {};
6136
6179
  for (let [n, s] of Object.entries(t))
6137
- Dt.has(n) && s.type === 'string' && !s.format
6180
+ jt.has(n) && s.type === 'string' && !s.format
6138
6181
  ? ((r[n] = { ...s, format: 'uri' }), (i = !0))
6139
- : Dt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
6182
+ : jt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
6140
6183
  ? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
6141
6184
  : (r[n] = s);
6142
6185
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
6143
6186
  }
6144
- function cr(e) {
6187
+ function wr(e) {
6145
6188
  switch (e.type) {
6146
6189
  case 'string':
6147
6190
  return {
@@ -6196,11 +6239,11 @@ function cr(e) {
6196
6239
  return { type: 'string', description: e.description };
6197
6240
  }
6198
6241
  }
6199
- function ur(e, t) {
6242
+ function kr(e, t) {
6200
6243
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
6201
6244
  r = {},
6202
6245
  n = [];
6203
- for (let o of e.parameters) ((r[o.name] = cr(o)), o.required && n.push(o.name));
6246
+ for (let o of e.parameters) ((r[o.name] = wr(o)), o.required && n.push(o.name));
6204
6247
  let s = {
6205
6248
  type: 'object',
6206
6249
  properties: r,
@@ -6213,7 +6256,7 @@ function ur(e, t) {
6213
6256
  inputSchema: s,
6214
6257
  };
6215
6258
  }
6216
- function mr() {
6259
+ function xr() {
6217
6260
  let e = q().filter((d) => d.category === 'Image'),
6218
6261
  t = q().filter((d) => d.category === 'Video'),
6219
6262
  i = q().filter((d) => d.category === 'Text'),
@@ -6309,7 +6352,7 @@ function mr() {
6309
6352
  maximum: 2147483647,
6310
6353
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
6311
6354
  },
6312
- creative_mode: { type: 'boolean', default: !1, description: Ot('image') },
6355
+ creative_mode: { type: 'boolean', default: !1, description: Bt('image') },
6313
6356
  },
6314
6357
  required: ['prompt'],
6315
6358
  additionalProperties: !0,
@@ -6346,7 +6389,7 @@ function mr() {
6346
6389
  default: '480p',
6347
6390
  description: 'Video resolution (the lowest price is the default; see each model tool).',
6348
6391
  },
6349
- creative_mode: { type: 'boolean', default: !1, description: Ot('video') },
6392
+ creative_mode: { type: 'boolean', default: !1, description: Bt('video') },
6350
6393
  priority: {
6351
6394
  type: 'boolean',
6352
6395
  default: !1,
@@ -6468,10 +6511,10 @@ function mr() {
6468
6511
  additionalProperties: !0,
6469
6512
  },
6470
6513
  },
6471
- p = fr();
6472
- return [n, s, o, u, l, p, c, lr];
6514
+ p = vr();
6515
+ return [n, s, o, u, l, p, c, hr];
6473
6516
  }
6474
- function fr() {
6517
+ function vr() {
6475
6518
  return {
6476
6519
  name: 'upload_asset',
6477
6520
  description:
@@ -6518,26 +6561,26 @@ function fr() {
6518
6561
  },
6519
6562
  };
6520
6563
  }
6521
- function Ue() {
6522
- let e = mr(),
6523
- t = q().map((i) => ur(i));
6524
- return [...e, ...t].map(pr).map(dr);
6564
+ function Fe() {
6565
+ let e = xr(),
6566
+ t = q().map((i) => kr(i));
6567
+ return [...e, ...t].map(yr).map(br);
6525
6568
  }
6526
- var sr,
6527
- or,
6528
- lr,
6529
- Dt,
6530
- Lt = b(() => {
6569
+ var fr,
6570
+ gr,
6571
+ hr,
6572
+ jt,
6573
+ Ft = b(() => {
6531
6574
  'use strict';
6532
- V();
6533
- Ke();
6575
+ N();
6576
+ Ce();
6534
6577
  H();
6535
- ((sr = {
6578
+ ((fr = {
6536
6579
  type: 'string',
6537
6580
  description:
6538
6581
  'Optional HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled. The body matches GET /v1/jobs/:id and is signed with X-Tein-Signature.',
6539
6582
  }),
6540
- (or = new Set([
6583
+ (gr = new Set([
6541
6584
  'upload_asset',
6542
6585
  'upload_media',
6543
6586
  'upload_image',
@@ -6545,7 +6588,7 @@ var sr,
6545
6588
  'check_status',
6546
6589
  'get_pricing',
6547
6590
  ])),
6548
- (lr = {
6591
+ (hr = {
6549
6592
  name: 'get_pricing',
6550
6593
  description:
6551
6594
  'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
@@ -6560,7 +6603,7 @@ var sr,
6560
6603
  additionalProperties: !1,
6561
6604
  },
6562
6605
  }));
6563
- Dt = new Set([
6606
+ jt = new Set([
6564
6607
  'image',
6565
6608
  'images',
6566
6609
  'image_url',
@@ -6577,19 +6620,19 @@ var sr,
6577
6620
  'lipsyncing_audio',
6578
6621
  ]);
6579
6622
  });
6580
- var Ht = {};
6581
- ii(Ht, {
6582
- forgetToolSchemas: () => wr,
6583
- jsonRpcAnswer: () => jt,
6584
- preprocessLocalFiles: () => Jt,
6585
- startStdioServer: () => zt,
6623
+ var ei = {};
6624
+ li(ei, {
6625
+ forgetToolSchemas: () => Mr,
6626
+ jsonRpcAnswer: () => Ht,
6627
+ preprocessLocalFiles: () => Xt,
6628
+ startStdioServer: () => Zt,
6586
6629
  });
6587
- function gr(e) {
6630
+ function _r(e) {
6588
6631
  let t = (i) =>
6589
6632
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
6590
6633
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
6591
6634
  }
6592
- function jt(e, t, i) {
6635
+ function Ht(e, t, i) {
6593
6636
  let r = e?.id,
6594
6637
  n = r == null,
6595
6638
  s = null;
@@ -6598,7 +6641,7 @@ function jt(e, t, i) {
6598
6641
  } catch {
6599
6642
  s = null;
6600
6643
  }
6601
- if (s !== null && gr(s)) return n ? null : s;
6644
+ if (s !== null && _r(s)) return n ? null : s;
6602
6645
  if (n) return null;
6603
6646
  if (!i && t >= 200 && t < 300) return;
6604
6647
  let o = s?.error,
@@ -6619,13 +6662,13 @@ function jt(e, t, i) {
6619
6662
  },
6620
6663
  };
6621
6664
  }
6622
- function hr() {
6665
+ function Ir() {
6623
6666
  let e = process.argv.slice(2),
6624
6667
  t = e.indexOf('--api-key');
6625
6668
  return S(t >= 0 ? e[t + 1] : void 0);
6626
6669
  }
6627
- async function Bt(e, t, i) {
6628
- let r = j.default.resolve(e);
6670
+ async function Wt(e, t, i) {
6671
+ let r = B.default.resolve(e);
6629
6672
  if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
6630
6673
  throw new Error(`File not found: ${e}`);
6631
6674
  let n = R.default.readFileSync(r),
@@ -6653,15 +6696,15 @@ async function Bt(e, t, i) {
6653
6696
  mimeType: c.mime_type || c.mimeType || 'image/png',
6654
6697
  };
6655
6698
  }
6656
- function Ft(e) {
6657
- return yr.has(j.default.extname(e).toLowerCase());
6699
+ function Yt(e) {
6700
+ return Pr.has(B.default.extname(e).toLowerCase());
6658
6701
  }
6659
- function Gt(e) {
6702
+ function Qt(e) {
6660
6703
  return new Error(
6661
- `Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
6704
+ `Tein uploads image, video and audio files only, and ${B.default.basename(e)} is not one.`,
6662
6705
  );
6663
6706
  }
6664
- function br(e) {
6707
+ function Tr(e) {
6665
6708
  let t = e.trim();
6666
6709
  if (
6667
6710
  !t ||
@@ -6671,10 +6714,10 @@ function br(e) {
6671
6714
  `)
6672
6715
  )
6673
6716
  return null;
6674
- let i = j.default.resolve(t);
6717
+ let i = B.default.resolve(t);
6675
6718
  return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
6676
6719
  }
6677
- function Be(e) {
6720
+ function Je(e) {
6678
6721
  if (Array.isArray(e))
6679
6722
  for (let t of e) {
6680
6723
  let i = t;
@@ -6684,12 +6727,12 @@ function Be(e) {
6684
6727
  Q.set(i.name, i.inputSchema);
6685
6728
  }
6686
6729
  }
6687
- function wr() {
6688
- (Q.clear(), (je = 0));
6730
+ function Mr() {
6731
+ (Q.clear(), (Ge = 0));
6689
6732
  }
6690
- async function kr(e, t) {
6691
- if (!(Date.now() - je < 6e4)) {
6692
- je = Date.now();
6733
+ async function Kr(e, t) {
6734
+ if (!(Date.now() - Ge < 6e4)) {
6735
+ Ge = Date.now();
6693
6736
  try {
6694
6737
  let r = await (
6695
6738
  await fetch(e, {
@@ -6699,39 +6742,39 @@ async function kr(e, t) {
6699
6742
  signal: AbortSignal.timeout(1e4),
6700
6743
  })
6701
6744
  ).json();
6702
- Be(r.result?.tools);
6745
+ Je(r.result?.tools);
6703
6746
  } catch {}
6704
6747
  }
6705
6748
  }
6706
- function xr(e) {
6749
+ function Sr(e) {
6707
6750
  return e
6708
6751
  ? e.type === 'string'
6709
6752
  ? e.format === 'uri'
6710
6753
  : e.type === 'array' && e.items?.format === 'uri'
6711
6754
  : !1;
6712
6755
  }
6713
- async function Vt(e, t, i) {
6756
+ async function Gt(e, t, i) {
6714
6757
  if (typeof e != 'string') return e;
6715
- let r = br(e);
6758
+ let r = Tr(e);
6716
6759
  if (!r) return e;
6717
- if (!Ft(r)) throw Gt(r);
6718
- return (await Bt(r, t, i)).url;
6760
+ if (!Yt(r)) throw Qt(r);
6761
+ return (await Wt(r, t, i)).url;
6719
6762
  }
6720
- async function Jt(e, t, i, r, n) {
6721
- (Q.size === 0 && Be(Ue()), Q.has(e) || (await kr(n, i)));
6763
+ async function Xt(e, t, i, r, n) {
6764
+ (Q.size === 0 && Je(Fe()), Q.has(e) || (await Kr(n, i)));
6722
6765
  let s = Q.get(e)?.properties;
6723
6766
  if (!s) return t;
6724
6767
  let o = { ...t };
6725
6768
  for (let [u, l] of Object.entries(t))
6726
- if (xr(s[u]))
6769
+ if (Sr(s[u]))
6727
6770
  if (Array.isArray(l)) {
6728
6771
  let c = [];
6729
- for (let p of l) c.push(await Vt(p, i, r));
6772
+ for (let p of l) c.push(await Gt(p, i, r));
6730
6773
  o[u] = c;
6731
- } else o[u] = await Vt(l, i, r);
6774
+ } else o[u] = await Gt(l, i, r);
6732
6775
  return o;
6733
6776
  }
6734
- function vr(e) {
6777
+ function $r(e) {
6735
6778
  let t = e.id ?? null;
6736
6779
  switch (e.method) {
6737
6780
  case 'initialize':
@@ -6749,7 +6792,7 @@ function vr(e) {
6749
6792
  case 'ping':
6750
6793
  return { jsonrpc: '2.0', id: t, result: {} };
6751
6794
  case 'tools/list':
6752
- return { jsonrpc: '2.0', id: t, result: { tools: Ue() } };
6795
+ return { jsonrpc: '2.0', id: t, result: { tools: Fe() } };
6753
6796
  case 'tools/call':
6754
6797
  return {
6755
6798
  jsonrpc: '2.0',
@@ -6772,13 +6815,13 @@ function vr(e) {
6772
6815
  };
6773
6816
  }
6774
6817
  }
6775
- async function zt() {
6776
- if (Nt) return;
6777
- Nt = !0;
6778
- let e = hr(),
6818
+ async function Zt() {
6819
+ if (Jt) return;
6820
+ Jt = !0;
6821
+ let e = Ir(),
6779
6822
  t = x(),
6780
6823
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
6781
- (Ut.default
6824
+ (zt.default
6782
6825
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
6783
6826
  .on('line', async (n) => {
6784
6827
  let s = n.trim();
@@ -6790,7 +6833,7 @@ async function zt() {
6790
6833
  c = o.params.arguments || {};
6791
6834
  if (l === 'get_pricing') {
6792
6835
  let p = typeof c.model == 'string' ? c.model.trim() : '',
6793
- d = `${t.replace(/\/+$/, '')}${ce(p)}`;
6836
+ d = `${t.replace(/\/+$/, '')}${me(p)}`;
6794
6837
  try {
6795
6838
  let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
6796
6839
  h = await m.text();
@@ -6837,19 +6880,19 @@ async function zt() {
6837
6880
  !p.startsWith('data:')
6838
6881
  )
6839
6882
  try {
6840
- let d = j.default.resolve(p.trim());
6883
+ let d = B.default.resolve(p.trim());
6841
6884
  if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
6842
- if (!Ft(d)) throw Gt(d);
6843
- let m = await Bt(d, e, t),
6885
+ if (!Yt(d)) throw Qt(d);
6886
+ let m = await Wt(d, e, t),
6844
6887
  h = (m.sizeBytes / 1024).toFixed(1),
6845
- ue =
6888
+ fe =
6846
6889
  m.mimeType.startsWith('image/') ||
6847
6890
  /\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
6848
6891
  ? `
6849
6892
 
6850
6893
  ![Uploaded Asset](${m.url})`
6851
6894
  : '',
6852
- me = {
6895
+ ge = {
6853
6896
  jsonrpc: '2.0',
6854
6897
  id: o.id,
6855
6898
  result: {
@@ -6860,7 +6903,7 @@ async function zt() {
6860
6903
 
6861
6904
  - **URL:** ${m.url}
6862
6905
  - **Type:** \`${m.mimeType}\`
6863
- - **Size:** ${h} KB${ue}
6906
+ - **Size:** ${h} KB${fe}
6864
6907
 
6865
6908
  Pass this URL to any Tein generation tool.`,
6866
6909
  },
@@ -6869,7 +6912,7 @@ Pass this URL to any Tein generation tool.`,
6869
6912
  },
6870
6913
  };
6871
6914
  process.stdout.write(
6872
- JSON.stringify(me) +
6915
+ JSON.stringify(ge) +
6873
6916
  `
6874
6917
  `,
6875
6918
  );
@@ -6896,7 +6939,7 @@ Pass this URL to any Tein generation tool.`,
6896
6939
  }
6897
6940
  if (e)
6898
6941
  try {
6899
- o.params.arguments = await Jt(String(l), c, e, t, i);
6942
+ o.params.arguments = await Xt(String(l), c, e, t, i);
6900
6943
  } catch (p) {
6901
6944
  let d = p instanceof Error ? p.message : String(p);
6902
6945
  process.stdout.write(
@@ -6927,10 +6970,10 @@ Pass this URL to any Tein generation tool.`,
6927
6970
  body: JSON.stringify(o),
6928
6971
  }),
6929
6972
  c = await l.text(),
6930
- p = jt(o, l.status, c);
6973
+ p = Ht(o, l.status, c);
6931
6974
  if (p === null) return;
6932
6975
  if (p) {
6933
- (o?.method === 'tools/list' && Be(p.result?.tools),
6976
+ (o?.method === 'tools/list' && Je(p.result?.tools),
6934
6977
  process.stdout.write(
6935
6978
  JSON.stringify(p) +
6936
6979
  `
@@ -6939,7 +6982,7 @@ Pass this URL to any Tein generation tool.`,
6939
6982
  return;
6940
6983
  }
6941
6984
  } catch {}
6942
- let u = vr(o);
6985
+ let u = $r(o);
6943
6986
  u !== null &&
6944
6987
  process.stdout.write(
6945
6988
  JSON.stringify(u) +
@@ -6963,21 +7006,21 @@ Pass this URL to any Tein generation tool.`,
6963
7006
  `));
6964
7007
  }
6965
7008
  var R,
6966
- j,
6967
- Ut,
6968
- yr,
7009
+ B,
7010
+ zt,
7011
+ Pr,
6969
7012
  Q,
6970
- je,
6971
- Nt,
6972
- Wt = b(() => {
7013
+ Ge,
7014
+ Jt,
7015
+ ti = b(() => {
6973
7016
  'use strict';
6974
- ((R = I(require('node:fs'))),
6975
- (j = I(require('node:path'))),
6976
- (Ut = I(require('node:readline'))));
6977
- Re();
6978
- Lt();
7017
+ ((R = _(require('node:fs'))),
7018
+ (B = _(require('node:path'))),
7019
+ (zt = _(require('node:readline'))));
7020
+ Le();
7021
+ Ft();
6979
7022
  E();
6980
- yr = new Set([
7023
+ Pr = new Set([
6981
7024
  '.png',
6982
7025
  '.jpg',
6983
7026
  '.jpeg',
@@ -7003,20 +7046,20 @@ var R,
7003
7046
  '.flac',
7004
7047
  '.opus',
7005
7048
  ]);
7006
- ((Q = new Map()), (je = 0));
7007
- Nt = !1;
7049
+ ((Q = new Map()), (Ge = 0));
7050
+ Jt = !1;
7008
7051
  require.main === module &&
7009
- zt().catch((e) => {
7052
+ Zt().catch((e) => {
7010
7053
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
7011
7054
  `),
7012
7055
  process.exit(1));
7013
7056
  });
7014
7057
  });
7015
- var ai =
7058
+ var di =
7016
7059
  !process.env.NO_COLOR &&
7017
7060
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
7018
7061
  function w(e, t) {
7019
- return (i) => (ai ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
7062
+ return (i) => (di ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
7020
7063
  }
7021
7064
  var a = {
7022
7065
  bold: w(1, 22),
@@ -7100,21 +7143,21 @@ var a = {
7100
7143
  process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
7101
7144
  }
7102
7145
  };
7103
- var O = I(require('node:fs')),
7104
- A = I(require('node:path'));
7105
- var ee = I(require('node:fs')),
7106
- Je = I(require('node:path')),
7107
- ze = require('node:stream/promises');
7146
+ var D = _(require('node:fs')),
7147
+ A = _(require('node:path'));
7148
+ var ee = _(require('node:fs')),
7149
+ We = _(require('node:path')),
7150
+ Ye = require('node:stream/promises');
7108
7151
  var Z = '1.1.7';
7109
- var ni = new Set([
7152
+ var ci = new Set([
7110
7153
  'account_suspended',
7111
7154
  'account_terminated',
7112
7155
  'creative_mode_restricted',
7113
7156
  'unfiltered_restricted',
7114
7157
  'workspace_paused',
7115
7158
  ]),
7116
- _ = 1,
7117
- si = 3,
7159
+ I = 1,
7160
+ ui = 3,
7118
7161
  k = class extends Error {
7119
7162
  constructor(t, i, r, n = {}) {
7120
7163
  (super(i),
@@ -7124,10 +7167,10 @@ var ni = new Set([
7124
7167
  (this.fields = n));
7125
7168
  }
7126
7169
  get exitCode() {
7127
- return this.code && ni.has(this.code) ? si : _;
7170
+ return this.code && ci.has(this.code) ? ui : I;
7128
7171
  }
7129
7172
  };
7130
- function oi(e, t, i) {
7173
+ function mi(e, t, i) {
7131
7174
  let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
7132
7175
  if (!i || typeof i != 'object') return new k(e, r);
7133
7176
  let n = i;
@@ -7140,13 +7183,13 @@ function oi(e, t, i) {
7140
7183
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
7141
7184
  return new k(e, c, typeof o == 'string' ? o : void 0, l);
7142
7185
  }
7143
- function Fe(e) {
7186
+ function ze(e) {
7144
7187
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
7145
7188
  }
7146
7189
  function K(e) {
7147
7190
  let t = [e.message],
7148
- i = Fe(e.fields.required),
7149
- r = Fe(e.fields.balance);
7191
+ i = ze(e.fields.required),
7192
+ r = ze(e.fields.balance);
7150
7193
  (i || r) &&
7151
7194
  t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
7152
7195
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -7154,19 +7197,19 @@ function K(e) {
7154
7197
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
7155
7198
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
7156
7199
  }
7157
- function li(e) {
7200
+ function fi(e) {
7158
7201
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
7159
7202
  ? 'video'
7160
7203
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
7161
7204
  ? 'audio'
7162
7205
  : 'image';
7163
7206
  }
7164
- function Ge(e) {
7207
+ function He(e) {
7165
7208
  let t = [];
7166
7209
  for (let i of e.data ?? [])
7167
7210
  typeof i.message?.content == 'string'
7168
7211
  ? t.push({ type: 'text', text: i.message.content })
7169
- : i.url && t.push({ type: li(i.url), url: i.url });
7212
+ : i.url && t.push({ type: fi(i.url), url: i.url });
7170
7213
  return t;
7171
7214
  }
7172
7215
  var M = class {
@@ -7192,7 +7235,7 @@ var M = class {
7192
7235
  try {
7193
7236
  s = await n.json();
7194
7237
  } catch {}
7195
- throw oi(n.status, n.statusText, s);
7238
+ throw mi(n.status, n.statusText, s);
7196
7239
  }
7197
7240
  return await n.json();
7198
7241
  }
@@ -7206,7 +7249,7 @@ var M = class {
7206
7249
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
7207
7250
  ? n
7208
7251
  : 'processing',
7209
- o = Ge(r);
7252
+ o = He(r);
7210
7253
  return {
7211
7254
  request_id: r.request_id || r.id || '',
7212
7255
  model: r.model,
@@ -7224,7 +7267,7 @@ var M = class {
7224
7267
  r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
7225
7268
  ? r
7226
7269
  : 'processing',
7227
- s = Ge(i),
7270
+ s = He(i),
7228
7271
  o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
7229
7272
  return {
7230
7273
  request_id: i.id || t,
@@ -7242,14 +7285,14 @@ var M = class {
7242
7285
  async downloadOutput(t, i) {
7243
7286
  let r = await fetch(t);
7244
7287
  if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
7245
- let n = Je.default.dirname(i);
7288
+ let n = We.default.dirname(i);
7246
7289
  ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
7247
7290
  let s = ee.default.createWriteStream(i);
7248
- return (await (0, ze.pipeline)(r.body, s), i);
7291
+ return (await (0, Ye.pipeline)(r.body, s), i);
7249
7292
  }
7250
7293
  };
7251
7294
  E();
7252
- function ye(e) {
7295
+ function we(e) {
7253
7296
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
7254
7297
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
7255
7298
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
@@ -7258,29 +7301,29 @@ function ye(e) {
7258
7301
  return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
7259
7302
  }
7260
7303
  H();
7261
- var Pt = ['images', 'input_images', 'videos', 'audios'];
7262
- function Ui(e) {
7263
- for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
7304
+ var Ct = ['images', 'input_images', 'videos', 'audios'];
7305
+ function Wi(e) {
7306
+ for (let t of Ct) typeof e[t] == 'string' && (e[t] = [e[t]]);
7264
7307
  }
7265
- function ji(e) {
7308
+ function Yi(e) {
7266
7309
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
7267
7310
  let t = A.default.resolve(e);
7268
- return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
7311
+ return D.default.existsSync(t) && D.default.statSync(t).isFile() ? t : null;
7269
7312
  }
7270
- async function Bi(e, t) {
7271
- for (let i of Pt) {
7313
+ async function Qi(e, t) {
7314
+ for (let i of Ct) {
7272
7315
  if (!Array.isArray(e[i])) continue;
7273
7316
  let r = [];
7274
7317
  for (let n of e[i]) {
7275
7318
  if (typeof n != 'string') continue;
7276
- let s = ji(n);
7319
+ let s = Yi(n);
7277
7320
  r.push(s ? await t(s) : n);
7278
7321
  }
7279
7322
  e[i] = r;
7280
7323
  }
7281
7324
  }
7282
7325
  var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
7283
- function Fi(e) {
7326
+ function Xi(e) {
7284
7327
  if (e.count === void 0 || e.count === !0) return 1;
7285
7328
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
7286
7329
  i = W.enterprise;
@@ -7293,7 +7336,7 @@ function Fi(e) {
7293
7336
  t
7294
7337
  );
7295
7338
  }
7296
- async function Gi(e, t, i, r, n) {
7339
+ async function Zi(e, t, i, r, n) {
7297
7340
  n.isJson ||
7298
7341
  process.stderr.write(`Starting ${r} ${t} jobs together...
7299
7342
  `);
@@ -7355,7 +7398,7 @@ async function Gi(e, t, i, r, n) {
7355
7398
  else {
7356
7399
  for (let l of o)
7357
7400
  (process.stdout.write(`${l.request_id} ${l.status}`),
7358
- l.usage?.cost !== void 0 && process.stdout.write(` ${ye(l.usage.cost)}`),
7401
+ l.usage?.cost !== void 0 && process.stdout.write(` ${we(l.usage.cost)}`),
7359
7402
  l.error && process.stdout.write(` ${l.error}`),
7360
7403
  process.stdout.write(`
7361
7404
  `));
@@ -7366,9 +7409,9 @@ async function Gi(e, t, i, r, n) {
7366
7409
  }
7367
7410
  (u.length ||
7368
7411
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
7369
- process.exit(_);
7412
+ process.exit(I);
7370
7413
  }
7371
- function Tt(e) {
7414
+ function Et(e) {
7372
7415
  let t = {},
7373
7416
  i = new Set(),
7374
7417
  r = [];
@@ -7413,7 +7456,7 @@ function Tt(e) {
7413
7456
  }
7414
7457
  return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
7415
7458
  }
7416
- async function Ae(e, t) {
7459
+ async function De(e, t) {
7417
7460
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
7418
7461
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
7419
7462
  (i ||
@@ -7435,7 +7478,7 @@ async function Ae(e, t) {
7435
7478
  s = !!t.json,
7436
7479
  o = !!(t.async || t.no_wait),
7437
7480
  u = typeof t.output == 'string' ? t.output : void 0,
7438
- l = Fi(t),
7481
+ l = Xi(t),
7439
7482
  c = { ...t };
7440
7483
  (delete c.json,
7441
7484
  delete c.async,
@@ -7444,8 +7487,8 @@ async function Ae(e, t) {
7444
7487
  delete c.api_key,
7445
7488
  delete c.api_url,
7446
7489
  delete c.count);
7447
- let p = _t(n, c);
7448
- (Ui(p),
7490
+ let p = $t(n, c);
7491
+ (Wi(p),
7449
7492
  typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
7450
7493
  p.image_url &&
7451
7494
  !p.first_frame_image &&
@@ -7457,15 +7500,15 @@ async function Ae(e, t) {
7457
7500
  let f = p[y];
7458
7501
  if (typeof f == 'string' && !f.startsWith('http://') && !f.startsWith('https://')) {
7459
7502
  let v = A.default.resolve(f);
7460
- if (O.default.existsSync(v) && O.default.statSync(v).isFile()) {
7503
+ if (D.default.existsSync(v) && D.default.statSync(v).isFile()) {
7461
7504
  let P = new T(`Uploading local file ${A.default.basename(v)} to CDN...`);
7462
7505
  s || P.start();
7463
7506
  try {
7464
- let B = O.default.readFileSync(v),
7465
- X = await d.uploadAsset(B.toString('base64'));
7507
+ let j = D.default.readFileSync(v),
7508
+ X = await d.uploadAsset(j.toString('base64'));
7466
7509
  ((p[y] = X.url), s || P.succeed(`Uploaded ${A.default.basename(v)} to CDN`));
7467
- } catch (B) {
7468
- let X = B instanceof Error ? B.message : String(B);
7510
+ } catch (j) {
7511
+ let X = j instanceof Error ? j.message : String(j);
7469
7512
  (s
7470
7513
  ? process.stdout.write(
7471
7514
  JSON.stringify({ error: X }) +
@@ -7478,11 +7521,11 @@ async function Ae(e, t) {
7478
7521
  }
7479
7522
  }
7480
7523
  }
7481
- await Bi(p, async (y) => {
7524
+ await Qi(p, async (y) => {
7482
7525
  let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
7483
7526
  s || f.start();
7484
7527
  try {
7485
- let v = O.default.readFileSync(y),
7528
+ let v = D.default.readFileSync(y),
7486
7529
  P = await d.uploadAsset(v.toString('base64'));
7487
7530
  return (s || f.succeed(`Uploaded ${A.default.basename(y)} to CDN`), P.url);
7488
7531
  } catch (v) {
@@ -7502,7 +7545,7 @@ async function Ae(e, t) {
7502
7545
  let g;
7503
7546
  try {
7504
7547
  if (l > 1) {
7505
- await Gi(d, e, p, l, { isJson: s, isAsync: o });
7548
+ await Zi(d, e, p, l, { isJson: s, isAsync: o });
7506
7549
  return;
7507
7550
  }
7508
7551
  g = await d.queueJob(e, p);
@@ -7526,7 +7569,7 @@ async function Ae(e, t) {
7526
7569
  `)
7527
7570
  : `Failed to start generation: ${y instanceof Error ? y.message : y}`,
7528
7571
  ),
7529
- process.exit(f ? f.exitCode : _));
7572
+ process.exit(f ? f.exitCode : I));
7530
7573
  }
7531
7574
  if (o) {
7532
7575
  s
@@ -7540,17 +7583,17 @@ async function Ae(e, t) {
7540
7583
  `));
7541
7584
  return;
7542
7585
  }
7543
- let ue = Date.now(),
7544
- me = 1500;
7586
+ let fe = Date.now(),
7587
+ ge = 1500;
7545
7588
  for (; g.status === 'processing';) {
7546
- let y = Math.round((Date.now() - ue) / 1e3);
7589
+ let y = Math.round((Date.now() - fe) / 1e3);
7547
7590
  (s || h.update(`Rendering ${a.bold(e)} (${y}s elapsed)... [ID: ${g.request_id}]`),
7548
- await new Promise((f) => setTimeout(f, me)));
7591
+ await new Promise((f) => setTimeout(f, ge)));
7549
7592
  try {
7550
7593
  g = await d.getStatus(g.request_id);
7551
7594
  } catch (f) {
7552
7595
  f instanceof k &&
7553
- f.exitCode !== _ &&
7596
+ f.exitCode !== I &&
7554
7597
  (s ||
7555
7598
  h.fail(
7556
7599
  K(f).join(`
@@ -7568,7 +7611,7 @@ async function Ae(e, t) {
7568
7611
  `,
7569
7612
  )
7570
7613
  : h.fail(`Generation ${g.status}: ${g.error || 'Something failed on our side.'}`),
7571
- process.exit(_)),
7614
+ process.exit(I)),
7572
7615
  s || h.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
7573
7616
  s)
7574
7617
  ) {
@@ -7587,7 +7630,7 @@ async function Ae(e, t) {
7587
7630
  process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
7588
7631
  `),
7589
7632
  g.usage?.cost !== void 0 &&
7590
- process.stdout.write(` ${a.bold('Cost:')} ${ye(g.usage.cost)}
7633
+ process.stdout.write(` ${a.bold('Cost:')} ${we(g.usage.cost)}
7591
7634
  `),
7592
7635
  g.output && g.output.length > 0)
7593
7636
  ) {
@@ -7620,9 +7663,9 @@ ${f.text}
7620
7663
  process.stdout.write(`
7621
7664
  `);
7622
7665
  }
7623
- var Mt = I(require('node:readline'));
7666
+ var qt = _(require('node:readline'));
7624
7667
  E();
7625
- async function Ji(e) {
7668
+ async function er(e) {
7626
7669
  try {
7627
7670
  return (await new M(e, x()).checkKey(), 'ok');
7628
7671
  } catch (t) {
@@ -7633,8 +7676,8 @@ async function Ji(e) {
7633
7676
  return 'unchecked';
7634
7677
  }
7635
7678
  }
7636
- function zi(e) {
7637
- let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
7679
+ function tr(e) {
7680
+ let t = qt.default.createInterface({ input: process.stdin, output: process.stdout });
7638
7681
  return new Promise((i) => {
7639
7682
  t.question(e, (r) => {
7640
7683
  (t.close(), i(r.trim()));
@@ -7653,20 +7696,20 @@ ${a.bold('Tein AI Authentication')}
7653
7696
  process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
7654
7697
 
7655
7698
  `),
7656
- (i = await zi('Enter your Tein API Key (sk_live_...): '))),
7699
+ (i = await tr('Enter your Tein API Key (sk_live_...): '))),
7657
7700
  !i.startsWith('sk_live_') &&
7658
7701
  !i.startsWith('sk_test_') &&
7659
7702
  (process.stderr
7660
7703
  .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
7661
7704
  `),
7662
7705
  process.exit(1)));
7663
- let r = await Ji(i);
7706
+ let r = await er(i);
7664
7707
  (r === 'invalid' &&
7665
7708
  (process.stderr
7666
7709
  .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
7667
7710
  `),
7668
7711
  process.exit(1)),
7669
- he({ apiKey: i }),
7712
+ be({ apiKey: i }),
7670
7713
  process.stdout.write(`
7671
7714
  ${a.green('\u2713')} API key saved to ${a.dim(ie())}
7672
7715
  `),
@@ -7685,13 +7728,13 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
7685
7728
  break;
7686
7729
  }
7687
7730
  case 'logout': {
7688
- if (!L().apiKey) {
7731
+ if (!V().apiKey) {
7689
7732
  process.stdout
7690
7733
  .write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
7691
7734
  `);
7692
7735
  break;
7693
7736
  }
7694
- (he({ apiKey: '' }),
7737
+ (be({ apiKey: '' }),
7695
7738
  process.stdout
7696
7739
  .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(ie())}
7697
7740
  `));
@@ -7700,7 +7743,7 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
7700
7743
  default: {
7701
7744
  let i = S(),
7702
7745
  r = x(),
7703
- n = L();
7746
+ n = V();
7704
7747
  if (
7705
7748
  (process.stdout.write(`
7706
7749
  ${a.bold('Tein AI CLI Configuration')}
@@ -7730,12 +7773,12 @@ ${a.bold('Tein AI CLI Configuration')}
7730
7773
  }
7731
7774
  }
7732
7775
  E();
7733
- be();
7776
+ ke();
7734
7777
  H();
7735
- var Hi = 3e3;
7736
- async function Kt(e) {
7778
+ var ir = 3e3;
7779
+ async function At(e) {
7737
7780
  try {
7738
- let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Hi) });
7781
+ let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(ir) });
7739
7782
  if (!t.ok) return;
7740
7783
  let i = await t.json(),
7741
7784
  r = {};
@@ -7743,18 +7786,18 @@ async function Kt(e) {
7743
7786
  let s = String(n.modelSlug ?? '');
7744
7787
  F.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
7745
7788
  }
7746
- yt(r);
7789
+ _t(r);
7747
7790
  } catch {}
7748
7791
  }
7749
- var Wi = new Set(['video', 'image', 'text', 'audio', '3d']),
7750
- Yi = { llm: 'text', chat: 'text', reasoning: 'text' };
7751
- async function St(e, t) {
7752
- await Kt(t);
7792
+ var rr = new Set(['video', 'image', 'text', 'audio', '3d']),
7793
+ ar = { llm: 'text', chat: 'text', reasoning: 'text' };
7794
+ async function Rt(e, t) {
7795
+ await At(t);
7753
7796
  let i = q();
7754
7797
  if (e) {
7755
7798
  let s = e.toLowerCase(),
7756
- o = Yi[s] ?? s;
7757
- i = Wi.has(o)
7799
+ o = ar[s] ?? s;
7800
+ i = rr.has(o)
7758
7801
  ? i.filter((u) => u.category.toLowerCase() === o)
7759
7802
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
7760
7803
  }
@@ -7792,8 +7835,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
7792
7835
 
7793
7836
  `);
7794
7837
  }
7795
- async function $t(e, t) {
7796
- F.has(e) && (await Kt(t));
7838
+ async function Ot(e, t) {
7839
+ F.has(e) && (await At(t));
7797
7840
  let i = U(e);
7798
7841
  (i ||
7799
7842
  (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -7874,9 +7917,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
7874
7917
  `);
7875
7918
  }
7876
7919
  E();
7877
- Re();
7878
- var Qi = 1e4,
7879
- De = {
7920
+ Le();
7921
+ var nr = 1e4,
7922
+ Ne = {
7880
7923
  price: '',
7881
7924
  creativeMode: 'Creative mode',
7882
7925
  priority: 'Priority',
@@ -7886,22 +7929,22 @@ var Qi = 1e4,
7886
7929
  priorityDraft: 'Priority + Draft',
7887
7930
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
7888
7931
  },
7889
- Xi = Object.keys(De),
7890
- Zi = {
7932
+ sr = Object.keys(Ne),
7933
+ or = {
7891
7934
  creativeMode: 'unfiltered',
7892
7935
  creativeModePriority: 'unfilteredPriority',
7893
7936
  creativeModeDraft: 'unfilteredDraft',
7894
7937
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
7895
7938
  };
7896
- function er(e, t) {
7897
- let i = Zi[t];
7939
+ function lr(e, t) {
7940
+ let i = or[t];
7898
7941
  return e[t] ?? (i ? e[i] : void 0);
7899
7942
  }
7900
- async function tr(e, t) {
7901
- let i = `${x(e)}${ce(t)}`,
7943
+ async function pr(e, t) {
7944
+ let i = `${x(e)}${me(t)}`,
7902
7945
  r;
7903
7946
  try {
7904
- r = await fetch(i, { signal: AbortSignal.timeout(Qi) });
7947
+ r = await fetch(i, { signal: AbortSignal.timeout(nr) });
7905
7948
  } catch {
7906
7949
  throw new Error(`Could not reach ${i}`);
7907
7950
  }
@@ -7917,18 +7960,18 @@ async function tr(e, t) {
7917
7960
  }
7918
7961
  return n;
7919
7962
  }
7920
- function Oe(e) {
7963
+ function Ve(e) {
7921
7964
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
7922
7965
  [i, r = ''] = t.split('.');
7923
7966
  return `$${i}.${r.padEnd(2, '0')}`;
7924
7967
  }
7925
- function Le(e) {
7968
+ function Ue(e) {
7926
7969
  if (!e || typeof e.starter != 'number') return null;
7927
7970
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
7928
7971
  i = typeof e.scale == 'number' ? e.scale : t;
7929
- return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
7972
+ return `Starter ${Ve(e.starter)} Plus ${Ve(t)} Scale ${Ve(i)}`;
7930
7973
  }
7931
- function ir(e) {
7974
+ function dr(e) {
7932
7975
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
7933
7976
  let t = [];
7934
7977
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -7940,33 +7983,33 @@ function ir(e) {
7940
7983
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
7941
7984
  );
7942
7985
  }
7943
- function rr(e, t) {
7944
- let i = ir(e);
7945
- for (let r of Xi) {
7946
- let n = Le(er(e, r));
7986
+ function cr(e, t) {
7987
+ let i = dr(e);
7988
+ for (let r of sr) {
7989
+ let n = Ue(lr(e, r));
7947
7990
  if (!n) continue;
7948
- let s = De[r] ? ` (${De[r]})` : '';
7991
+ let s = Ne[r] ? ` (${Ne[r]})` : '';
7949
7992
  t.push(` ${i}${s} ${n}`);
7950
7993
  }
7951
7994
  }
7952
- function ar(e, t) {
7995
+ function ur(e, t) {
7953
7996
  let i = e.quality ? ` quality=${e.quality}` : '';
7954
7997
  t.push(
7955
7998
  ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
7956
7999
  );
7957
- for (let n of e.variants ?? []) rr(n, t);
8000
+ for (let n of e.variants ?? []) cr(n, t);
7958
8001
  let r = e.addons;
7959
8002
  if (Array.isArray(r))
7960
8003
  for (let n of r) {
7961
8004
  if (!n || typeof n != 'object') continue;
7962
8005
  let s = n,
7963
8006
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
7964
- u = Le(s.price);
8007
+ u = Ue(s.price);
7965
8008
  u && t.push(` ${o} (add-on) ${u}`);
7966
8009
  }
7967
8010
  t.push('');
7968
8011
  }
7969
- function nr(e) {
8012
+ function mr(e) {
7970
8013
  let t = [],
7971
8014
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
7972
8015
  (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
@@ -7988,7 +8031,7 @@ function nr(e) {
7988
8031
  });
7989
8032
  for (let l of s) {
7990
8033
  t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
7991
- for (let c of r.get(l) ?? []) ar(c, t);
8034
+ for (let c of r.get(l) ?? []) ur(c, t);
7992
8035
  }
7993
8036
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
7994
8037
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -8005,7 +8048,7 @@ function nr(e) {
8005
8048
  t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
8006
8049
  for (let m of p) {
8007
8050
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
8008
- g = Le(m.prices);
8051
+ g = Ue(m.prices);
8009
8052
  g && t.push(` ${h} ${g}`);
8010
8053
  }
8011
8054
  t.push('');
@@ -8018,10 +8061,10 @@ function nr(e) {
8018
8061
  `
8019
8062
  );
8020
8063
  }
8021
- async function Ct(e) {
8064
+ async function Dt(e) {
8022
8065
  let t;
8023
8066
  try {
8024
- t = await tr(e.apiUrl, e.model);
8067
+ t = await pr(e.apiUrl, e.model);
8025
8068
  } catch (i) {
8026
8069
  let r = i instanceof Error ? i.message : String(i);
8027
8070
  (process.stderr.write(`${a.red('Error:')} ${r}
@@ -8032,12 +8075,12 @@ async function Ct(e) {
8032
8075
  e.json
8033
8076
  ? `${JSON.stringify(t, null, 2)}
8034
8077
  `
8035
- : nr(t),
8078
+ : mr(t),
8036
8079
  );
8037
8080
  }
8038
- var Et = I(require('node:path'));
8081
+ var Lt = _(require('node:path'));
8039
8082
  E();
8040
- async function qt(e, t) {
8083
+ async function Vt(e, t) {
8041
8084
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
8042
8085
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
8043
8086
  (i ||
@@ -8080,7 +8123,7 @@ async function qt(e, t) {
8080
8123
  ),
8081
8124
  process.exit(p.exitCode)),
8082
8125
  n || l.fail(p instanceof Error ? p.message : String(p)),
8083
- process.exit(_));
8126
+ process.exit(I));
8084
8127
  }
8085
8128
  if (s && c.status === 'processing') {
8086
8129
  let p = Date.now();
@@ -8132,7 +8175,7 @@ ${a.bold('Outputs:')}
8132
8175
  ) {
8133
8176
  let d = new T(`Downloading output to ${o}...`).start();
8134
8177
  try {
8135
- (await u.downloadOutput(p.url, Et.default.resolve(process.cwd(), o)),
8178
+ (await u.downloadOutput(p.url, Lt.default.resolve(process.cwd(), o)),
8136
8179
  d.succeed(`Saved to ${a.bold(o)}`));
8137
8180
  } catch (m) {
8138
8181
  d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -8147,10 +8190,10 @@ ${p.text}
8147
8190
  process.stdout.write(`
8148
8191
  `);
8149
8192
  }
8150
- var Ve = I(require('node:fs')),
8151
- Ne = I(require('node:path'));
8193
+ var Be = _(require('node:fs')),
8194
+ je = _(require('node:path'));
8152
8195
  E();
8153
- async function At(e, t = {}) {
8196
+ async function Nt(e, t = {}) {
8154
8197
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
8155
8198
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
8156
8199
  n = !!t.json;
@@ -8167,13 +8210,13 @@ async function At(e, t = {}) {
8167
8210
  process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
8168
8211
  `),
8169
8212
  process.exit(1)));
8170
- let s = Ne.default.resolve(e);
8171
- Ve.default.existsSync(s) ||
8213
+ let s = je.default.resolve(e);
8214
+ Be.default.existsSync(s) ||
8172
8215
  (process.stderr.write(`${a.red('Error:')} File not found: ${s}
8173
8216
  `),
8174
8217
  process.exit(1));
8175
- let o = Ne.default.basename(s),
8176
- l = Ve.default.readFileSync(s).toString('base64'),
8218
+ let o = je.default.basename(s),
8219
+ l = Be.default.readFileSync(s).toString('base64'),
8177
8220
  c = new M(i, r),
8178
8221
  p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
8179
8222
  n || p.start();
@@ -8211,12 +8254,12 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
8211
8254
  `,
8212
8255
  )
8213
8256
  : p.fail(`Upload failed: ${h}`),
8214
- process.exit(m ? m.exitCode : _));
8257
+ process.exit(m ? m.exitCode : I));
8215
8258
  }
8216
8259
  }
8217
8260
  H();
8218
- Te();
8219
- function Yt() {
8261
+ Se();
8262
+ function ii() {
8220
8263
  process.stdout.write(`
8221
8264
  ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
8222
8265
 
@@ -8276,11 +8319,11 @@ ${a.bold('EXAMPLES:')}
8276
8319
 
8277
8320
  `);
8278
8321
  }
8279
- async function Ir() {
8322
+ async function Cr() {
8280
8323
  let e = process.argv.slice(2),
8281
- t = Tt(e);
8324
+ t = Et(e);
8282
8325
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
8283
- Yt();
8326
+ ii();
8284
8327
  return;
8285
8328
  }
8286
8329
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -8307,14 +8350,14 @@ async function Ir() {
8307
8350
  }
8308
8351
  case 'models':
8309
8352
  case 'list': {
8310
- await St(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8353
+ await Rt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8311
8354
  break;
8312
8355
  }
8313
8356
  case 'pricing':
8314
8357
  case 'prices': {
8315
8358
  let i = t.options.model,
8316
8359
  r = t.subcommand || (typeof i == 'string' ? i : void 0);
8317
- await Ct({
8360
+ await Dt({
8318
8361
  model: r,
8319
8362
  json: !!t.options.json,
8320
8363
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -8329,48 +8372,48 @@ async function Ir() {
8329
8372
  process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
8330
8373
  `),
8331
8374
  process.exit(1)),
8332
- await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8375
+ await Ot(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8333
8376
  break;
8334
8377
  }
8335
8378
  case 'upload': {
8336
8379
  let i = t.subcommand || '';
8337
- await At(i, t.options);
8380
+ await Nt(i, t.options);
8338
8381
  break;
8339
8382
  }
8340
8383
  case 'run':
8341
8384
  case 'generate': {
8342
8385
  let i = t.subcommand || '';
8343
- await Ae(i, t.options);
8386
+ await De(i, t.options);
8344
8387
  break;
8345
8388
  }
8346
8389
  case 'status': {
8347
8390
  let i = t.subcommand || '';
8348
- await qt(i, t.options);
8391
+ await Vt(i, t.options);
8349
8392
  break;
8350
8393
  }
8351
8394
  case 'mcp': {
8352
- let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(), Ht));
8395
+ let { startStdioServer: i } = await Promise.resolve().then(() => (ti(), ei));
8353
8396
  await i();
8354
8397
  break;
8355
8398
  }
8356
8399
  default: {
8357
8400
  if (t.command && !t.command.startsWith('-')) {
8358
8401
  (!U(t.command) &&
8359
- !oe[t.command] &&
8402
+ !pe[t.command] &&
8360
8403
  (process.stderr.write(`
8361
8404
  ${a.red('Error:')} Unknown command or model "${t.command}".
8362
8405
  Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
8363
8406
  `),
8364
- process.exit(_)),
8365
- await Ae(t.command, t.options));
8407
+ process.exit(I)),
8408
+ await De(t.command, t.options));
8366
8409
  return;
8367
8410
  }
8368
- Yt();
8411
+ ii();
8369
8412
  break;
8370
8413
  }
8371
8414
  }
8372
8415
  }
8373
- Ir().catch((e) => {
8416
+ Cr().catch((e) => {
8374
8417
  (e instanceof k &&
8375
8418
  (process.stderr.write(`
8376
8419
  ${a.red('Error:')} ${K(e).join(`
@@ -8380,5 +8423,5 @@ ${a.red('Error:')} ${K(e).join(`
8380
8423
  process.stderr.write(`
8381
8424
  ${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
8382
8425
  `),
8383
- process.exit(_));
8426
+ process.exit(I));
8384
8427
  });