@teinai/cli 1.1.8 → 1.1.10

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +353 -329
  3. 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 Jt = Object.create;
3
+ var zt = Object.create;
4
4
  var me = Object.defineProperty;
5
- var Ht = Object.getOwnPropertyDescriptor;
6
- var Wt = Object.getOwnPropertyNames;
7
- var zt = Object.getPrototypeOf,
8
- Yt = Object.prototype.hasOwnProperty;
5
+ var Yt = Object.getOwnPropertyDescriptor;
6
+ var Qt = Object.getOwnPropertyNames;
7
+ var Xt = Object.getPrototypeOf,
8
+ Zt = Object.prototype.hasOwnProperty;
9
9
  var y = (e, t, i) => () => {
10
10
  if (i) throw i[0];
11
11
  try {
@@ -14,20 +14,20 @@ var y = (e, t, i) => () => {
14
14
  throw ((i = [r]), r);
15
15
  }
16
16
  };
17
- var Qt = (e, t) => {
17
+ var ei = (e, t) => {
18
18
  for (var i in t) me(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- Xt = (e, t, i, r) => {
20
+ ti = (e, t, i, r) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of Wt(t))
23
- !Yt.call(e, n) &&
22
+ for (let n of Qt(t))
23
+ !Zt.call(e, n) &&
24
24
  n !== i &&
25
- me(e, n, { get: () => t[n], enumerable: !(r = Ht(t, n)) || r.enumerable });
25
+ me(e, n, { get: () => t[n], enumerable: !(r = Yt(t, n)) || r.enumerable });
26
26
  return e;
27
27
  };
28
28
  var v = (e, t, i) => (
29
- (i = e != null ? Jt(zt(e)) : {}),
30
- Xt(t || !e || !e.__esModule ? me(i, 'default', { value: e, enumerable: !0 }) : i, e)
29
+ (i = e != null ? zt(Xt(e)) : {}),
30
+ ti(t || !e || !e.__esModule ? me(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
32
  function D() {
33
33
  try {
@@ -79,6 +79,16 @@ var $,
79
79
  (te = fe.default.join(Ge.default.homedir(), '.tein')),
80
80
  (O = fe.default.join(te, 'config.json')));
81
81
  });
82
+ var oi,
83
+ Je,
84
+ He,
85
+ We = y(() => {
86
+ 'use strict';
87
+ ((oi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (Je = [...oi, 'auto']),
89
+ (He =
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
+ });
82
92
  var B,
83
93
  he = y(() => {
84
94
  'use strict';
@@ -87,11 +97,11 @@ var B,
87
97
  function ye(e) {
88
98
  return !1;
89
99
  }
90
- var Je = y(() => {
100
+ var ze = y(() => {
91
101
  'use strict';
92
102
  });
93
103
  var re,
94
- He = y(() => {
104
+ Ye = y(() => {
95
105
  'use strict';
96
106
  re = {
97
107
  source: 'TEIN Price Board',
@@ -4515,7 +4525,7 @@ var re,
4515
4525
  function ke(e, t) {
4516
4526
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
4517
4527
  }
4518
- function ni(e, t) {
4528
+ function pi(e, t) {
4519
4529
  if (e === 'seedance-2-mini') return 'mini';
4520
4530
  if (e !== 'seedance-2') return;
4521
4531
  let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -4525,24 +4535,24 @@ function ni(e, t) {
4525
4535
  ? 'fast'
4526
4536
  : 'standard';
4527
4537
  }
4528
- function si(e, t) {
4538
+ function di(e, t) {
4529
4539
  let i = e
4530
4540
  .trim()
4531
4541
  .toLowerCase()
4532
4542
  .replace(/-(?:unfiltered|uncensored)$/, '');
4533
4543
  if (i === 'seedance-2' || i === 'seedance-2-mini') {
4534
- let n = ni(i, t),
4544
+ let n = pi(i, t),
4535
4545
  s = be.get(ke('seedance-2', n));
4536
4546
  return s ? s.slug : null;
4537
4547
  }
4538
4548
  let r = ae.get(i) ?? be.get(ke(i));
4539
4549
  return r ? r.slug : null;
4540
4550
  }
4541
- function li(e, t) {
4542
- return ae.has(e) && !(oi.has(e) && t) ? e : si(e, t);
4551
+ function ui(e, t) {
4552
+ return ae.has(e) && !(ci.has(e) && t) ? e : di(e, t);
4543
4553
  }
4544
4554
  function F(e, t) {
4545
- let i = li(e, t);
4555
+ let i = ui(e, t);
4546
4556
  return i ? (ae.get(i) ?? null) : null;
4547
4557
  }
4548
4558
  function ne() {
@@ -4551,14 +4561,14 @@ function ne() {
4551
4561
  var xe,
4552
4562
  ae,
4553
4563
  be,
4554
- We,
4555
- ai,
4564
+ Qe,
4565
+ li,
4556
4566
  we,
4557
- oi,
4567
+ ci,
4558
4568
  L = y(() => {
4559
4569
  'use strict';
4560
- Je();
4561
- He();
4570
+ ze();
4571
+ Ye();
4562
4572
  ((xe = {
4563
4573
  ...re,
4564
4574
  families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !ye(t)) })),
@@ -4566,19 +4576,19 @@ var xe,
4566
4576
  }),
4567
4577
  (ae = new Map()),
4568
4578
  (be = new Map()),
4569
- (We = new Map()),
4570
- (ai = new Map()),
4579
+ (Qe = new Map()),
4580
+ (li = new Map()),
4571
4581
  (we = new Map()));
4572
4582
  for (let e of xe.models) {
4573
4583
  (ae.set(e.slug, e), be.set(ke(e.api.model, e.api.quality), e));
4574
- for (let t of e.variants) We.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4584
+ for (let t of e.variants) Qe.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4575
4585
  for (let t of e.editVariants ?? [])
4576
- We.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4577
- for (let t of e.addons ?? []) ai.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4586
+ Qe.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4587
+ for (let t of e.addons ?? []) li.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4578
4588
  we.set(e.slug, e.family);
4579
4589
  }
4580
4590
  for (let e of xe.families) for (let t of e.models) we.has(t) || we.set(t, e.slug);
4581
- oi = new Set(['seedance-2']);
4591
+ ci = new Set(['seedance-2']);
4582
4592
  });
4583
4593
  function se(e) {
4584
4594
  let t = e.from?.variant;
@@ -4586,15 +4596,15 @@ function se(e) {
4586
4596
  }
4587
4597
  function ve(e) {
4588
4598
  if (e.endpoints?.length)
4589
- return e.editVariants?.length && e.endpoints.some((t) => t.id === ze)
4590
- ? ze
4599
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === Xe)
4600
+ ? Xe
4591
4601
  : (e.defaultEndpoint ?? e.endpoints[0].id);
4592
4602
  }
4593
- var ze,
4603
+ var Xe,
4594
4604
  Ie = y(() => {
4595
4605
  'use strict';
4596
4606
  L();
4597
- ze = 'dynamic';
4607
+ Xe = 'dynamic';
4598
4608
  });
4599
4609
  var oe,
4600
4610
  _e = y(() => {
@@ -4607,29 +4617,29 @@ var oe,
4607
4617
  'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
4608
4618
  };
4609
4619
  });
4610
- var Ye = y(() => {
4620
+ var Ze = y(() => {
4611
4621
  'use strict';
4612
4622
  });
4613
- function Qe(e, t) {
4614
- return typeof t == 'string' && (pi[e]?.includes(t) ?? !1);
4623
+ function et(e, t) {
4624
+ return typeof t == 'string' && (mi[e]?.includes(t) ?? !1);
4615
4625
  }
4616
- var pi,
4617
- Xe = y(() => {
4626
+ var mi,
4627
+ tt = y(() => {
4618
4628
  'use strict';
4619
4629
  L();
4620
4630
  Ie();
4621
- Ye();
4622
- pi = {};
4631
+ Ze();
4632
+ mi = {};
4623
4633
  });
4624
- function Ze(e) {
4625
- return e === 'nano-banana-pro' ? di : ci;
4634
+ function it(e) {
4635
+ return e === 'nano-banana-pro' ? fi : gi;
4626
4636
  }
4627
- var di,
4628
- ci,
4629
- et = y(() => {
4637
+ var fi,
4638
+ gi,
4639
+ rt = y(() => {
4630
4640
  'use strict';
4631
- ((di = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4632
- (ci = [
4641
+ ((fi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4642
+ (gi = [
4633
4643
  'auto',
4634
4644
  '1:1',
4635
4645
  '1:4',
@@ -4647,10 +4657,10 @@ var di,
4647
4657
  '21:9',
4648
4658
  ]));
4649
4659
  });
4650
- var tt,
4651
- it = y(() => {
4660
+ var at,
4661
+ nt = y(() => {
4652
4662
  'use strict';
4653
- tt = [
4663
+ at = [
4654
4664
  'prompt',
4655
4665
  'system',
4656
4666
  'messages',
@@ -4664,10 +4674,10 @@ var tt,
4664
4674
  'endpoint',
4665
4675
  ];
4666
4676
  });
4667
- var rt,
4668
- at = y(() => {
4677
+ var st,
4678
+ ot = y(() => {
4669
4679
  'use strict';
4670
- rt = [
4680
+ st = [
4671
4681
  {
4672
4682
  slug: 'claude-fable-5-1',
4673
4683
  family: 'fable-5-1',
@@ -4736,13 +4746,13 @@ var rt,
4736
4746
  },
4737
4747
  ];
4738
4748
  });
4739
- function nt(e) {
4749
+ function lt(e) {
4740
4750
  return `$${e}`;
4741
4751
  }
4742
4752
  function Pe(e, t, i) {
4743
4753
  return F(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
4744
4754
  }
4745
- function ui(e) {
4755
+ function hi(e) {
4746
4756
  return [
4747
4757
  {
4748
4758
  name: 'prompt',
@@ -4808,13 +4818,13 @@ function ui(e) {
4808
4818
  },
4809
4819
  ];
4810
4820
  }
4811
- function st() {
4821
+ function pt() {
4812
4822
  return Object.fromEntries(
4813
- rt.map((e) => {
4823
+ st.map((e) => {
4814
4824
  let t = Pe(e.slug, 'cheap', 'input'),
4815
4825
  i = Pe(e.slug, 'cheap', 'output'),
4816
4826
  r = Pe(e.slug, 'stable', 'input') != null,
4817
- n = t != null && i != null ? `${nt(t)}/M in \xB7 ${nt(i)}/M out` : '',
4827
+ n = t != null && i != null ? `${lt(t)}/M in \xB7 ${lt(i)}/M out` : '',
4818
4828
  s = {
4819
4829
  slug: e.slug,
4820
4830
  name: e.name,
@@ -4825,15 +4835,15 @@ function st() {
4825
4835
  priceFormatted: n,
4826
4836
  unit: '/M tokens',
4827
4837
  primaryToolName: 'run_task',
4828
- parameters: ui(r),
4838
+ parameters: hi(r),
4829
4839
  };
4830
4840
  return [e.slug, s];
4831
4841
  }),
4832
4842
  );
4833
4843
  }
4834
- var ot = y(() => {
4844
+ var dt = y(() => {
4835
4845
  'use strict';
4836
- at();
4846
+ ot();
4837
4847
  L();
4838
4848
  });
4839
4849
  var G,
@@ -4847,7 +4857,7 @@ var G,
4847
4857
  function J(e) {
4848
4858
  return `$${Number(e.toFixed(5))}`;
4849
4859
  }
4850
- function hi(e) {
4860
+ function ki(e) {
4851
4861
  if (e.kind === 'llm') {
4852
4862
  let t = e.defaultEndpoint,
4853
4863
  i = (s) =>
@@ -4865,14 +4875,14 @@ function hi(e) {
4865
4875
  }
4866
4876
  return `from ${J(se(e).price.starter)}${e.unit}`;
4867
4877
  }
4868
- function yi(e, t) {
4878
+ function xi(e, t) {
4869
4879
  let i = t.filter((r) => Number.isFinite(r) && r > 0);
4870
4880
  return i.length ? `from ${J(Math.min(...i))}${e}` : null;
4871
4881
  }
4872
- function ct(e) {
4882
+ function ft(e) {
4873
4883
  for (let t of B) {
4874
4884
  let i = de[t],
4875
- r = i ? yi(i.unit, e[t] ?? []) : null;
4885
+ r = i ? xi(i.unit, e[t] ?? []) : null;
4876
4886
  i && r && (i.priceFormatted = r);
4877
4887
  }
4878
4888
  }
@@ -4888,9 +4898,9 @@ function H(e, t) {
4888
4898
  ...(t ? { description: t } : {}),
4889
4899
  };
4890
4900
  }
4891
- function ut(e) {
4901
+ function gt(e) {
4892
4902
  if (!e.endpoints?.length) return null;
4893
- let t = e.endpoints.filter((i) => Qe(e.slug, i.id));
4903
+ let t = e.endpoints.filter((i) => et(e.slug, i.id));
4894
4904
  return {
4895
4905
  name: 'endpoint',
4896
4906
  type: 'select',
@@ -4903,20 +4913,20 @@ function ut(e) {
4903
4913
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
4904
4914
  };
4905
4915
  }
4906
- function ki(e, t) {
4916
+ function _i(e, t) {
4907
4917
  if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
4908
4918
  let i = G.includes(e.api.model);
4909
- return [...t.filter((r) => !$e.has(r.name)), i ? mt : bi];
4919
+ return [...t.filter((r) => !$e.has(r.name)), i ? ht : vi];
4910
4920
  }
4911
4921
  function Me(e, t) {
4912
4922
  let i = e.filter((n) => !$e.has(n.name)),
4913
- r = [mt, wi];
4914
- return (r.push(ft, gt), [...i, ...r]);
4923
+ r = [ht, Ii];
4924
+ return (r.push(yt, bt), [...i, ...r]);
4915
4925
  }
4916
- function lt(e) {
4926
+ function ct(e) {
4917
4927
  return [
4918
4928
  ...e
4919
- .filter((t) => !xi.has(t.name) && !$e.has(t.name))
4929
+ .filter((t) => !Pi.has(t.name) && !$e.has(t.name))
4920
4930
  .map((t) =>
4921
4931
  t.name === 'resolution'
4922
4932
  ? {
@@ -4932,8 +4942,8 @@ function lt(e) {
4932
4942
  options: ['standard'],
4933
4943
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
4934
4944
  },
4935
- ft,
4936
- gt,
4945
+ yt,
4946
+ bt,
4937
4947
  ];
4938
4948
  }
4939
4949
  function Ke(e, t) {
@@ -4965,8 +4975,8 @@ function Ke(e, t) {
4965
4975
  ),
4966
4976
  ];
4967
4977
  }
4968
- function vi(e) {
4969
- let t = ut(e);
4978
+ function Ti(e) {
4979
+ let t = gt(e);
4970
4980
  return [
4971
4981
  S('Image prompt text. Supports complex composition and text instructions.'),
4972
4982
  ...(t ? [t] : []),
@@ -4976,7 +4986,20 @@ function vi(e) {
4976
4986
  default: 'low',
4977
4987
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
4978
4988
  },
4979
- H(e, 'Square output: 1024, 2048 or 2880 px.'),
4989
+ H(
4990
+ e,
4991
+ e.slug === 'gpt-image-2'
4992
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${He}`
4993
+ : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
4994
+ ),
4995
+ {
4996
+ name: 'aspect_ratio',
4997
+ type: 'select',
4998
+ default: 'auto',
4999
+ options: [...Je],
5000
+ description:
5001
+ "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.",
5002
+ },
4980
5003
  {
4981
5004
  name: 'input_images',
4982
5005
  type: 'string[]',
@@ -5020,7 +5043,7 @@ function vi(e) {
5020
5043
  },
5021
5044
  ];
5022
5045
  }
5023
- function Ii(e) {
5046
+ function Mi(e) {
5024
5047
  return [
5025
5048
  S('Image prompt text.'),
5026
5049
  {
@@ -5028,7 +5051,7 @@ function Ii(e) {
5028
5051
  type: 'string[]',
5029
5052
  description: 'Images to edit or use as reference (up to 14).',
5030
5053
  },
5031
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Ze(e.slug)] },
5054
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...it(e.slug)] },
5032
5055
  H(e),
5033
5056
  {
5034
5057
  name: 'n',
@@ -5054,10 +5077,10 @@ function Ii(e) {
5054
5077
  },
5055
5078
  ];
5056
5079
  }
5057
- function Mi() {
5058
- let e = tt,
5080
+ function Ci() {
5081
+ let e = at,
5059
5082
  t = [];
5060
- for (let i of ht(!0))
5083
+ for (let i of wt(!0))
5061
5084
  e.includes(i.name) &&
5062
5085
  (t.push({
5063
5086
  ...i,
@@ -5079,7 +5102,7 @@ function Mi() {
5079
5102
  }));
5080
5103
  return t;
5081
5104
  }
5082
- function ht(e) {
5105
+ function wt(e) {
5083
5106
  return [
5084
5107
  S('The user message or task.'),
5085
5108
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -5174,37 +5197,37 @@ function ht(e) {
5174
5197
  },
5175
5198
  ];
5176
5199
  }
5177
- function Ki(e) {
5178
- if (e.slug === 'seed-2-1-turbo') return Pi;
5179
- let t = ut(e);
5200
+ function Ei(e) {
5201
+ if (e.slug === 'seed-2-1-turbo') return Si;
5202
+ let t = gt(e);
5180
5203
  return [
5181
5204
  ...(e.slug === 'gemini-3.1-pro-preview'
5182
- ? Mi()
5183
- : e.slug === 'gpt-6-astra' || Ti.includes(e.slug)
5184
- ? ht(e.slug !== 'gpt-6-astra')
5185
- : _i),
5205
+ ? Ci()
5206
+ : e.slug === 'gpt-6-astra' || $i.includes(e.slug)
5207
+ ? wt(e.slug !== 'gpt-6-astra')
5208
+ : Ki),
5186
5209
  ...(t ? [t] : []),
5187
5210
  ];
5188
5211
  }
5189
- function Si(e) {
5212
+ function qi(e) {
5190
5213
  let t = e.slug;
5191
- if (e.kind === 'llm') return Ki(e);
5192
- if (e.editVariants?.length) return vi(e);
5214
+ if (e.kind === 'llm') return Ei(e);
5215
+ if (e.editVariants?.length) return Ti(e);
5193
5216
  switch (t) {
5194
5217
  case 'seedance-2-5':
5195
- return Me(pt, t);
5218
+ return Me(ut, t);
5196
5219
  case 'seedance-2-5-lite':
5197
- return lt(pt);
5220
+ return ct(ut);
5198
5221
  case 'seedance-2':
5199
- return Me(dt, t);
5222
+ return Me(mt, t);
5200
5223
  case 'seedance-2-lite':
5201
- return lt(dt);
5224
+ return ct(mt);
5202
5225
  case 'seedance-2-mini':
5203
- return Me($i, t);
5226
+ return Me(Ai, t);
5204
5227
  case 'nano-banana-2':
5205
5228
  case 'nano-banana-2.1':
5206
5229
  case 'nano-banana-pro':
5207
- return Ii(e);
5230
+ return Mi(e);
5208
5231
  case 'seedream-5-pro':
5209
5232
  return [
5210
5233
  S('Detailed description of the image to generate.'),
@@ -5303,17 +5326,17 @@ function Se(e, t = e.api.model) {
5303
5326
  return {
5304
5327
  slug: t,
5305
5328
  name: e.name,
5306
- category: mi[e.kind],
5307
- kind: gi[e.kind],
5329
+ category: yi[e.kind],
5330
+ kind: wi[e.kind],
5308
5331
  vendor: e.vendor ?? '',
5309
5332
  description: e.desc ?? e.name,
5310
- priceFormatted: hi(e),
5333
+ priceFormatted: ki(e),
5311
5334
  unit: e.unit,
5312
- primaryToolName: fi[e.kind],
5313
- parameters: ki(e, Si(e)),
5335
+ primaryToolName: bi[e.kind],
5336
+ parameters: _i(e, qi(e)),
5314
5337
  };
5315
5338
  }
5316
- function Ci() {
5339
+ function Ri() {
5317
5340
  let e = {};
5318
5341
  for (let t of ne())
5319
5342
  if (t.slug !== 'seedance-2-fast') {
@@ -5329,7 +5352,7 @@ function Ci() {
5329
5352
  }
5330
5353
  t.slug.startsWith('claude-') || (e[t.api.model] = Se(t));
5331
5354
  }
5332
- Object.assign(e, st());
5355
+ Object.assign(e, pt());
5333
5356
  for (let [t, i] of Object.entries(oe))
5334
5357
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
5335
5358
  return e;
@@ -5337,87 +5360,88 @@ function Ci() {
5337
5360
  function V(e) {
5338
5361
  return de[e] ?? null;
5339
5362
  }
5340
- function wt(e, t, i) {
5363
+ function vt(e, t, i) {
5341
5364
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
5342
5365
  let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
5343
5366
  if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
5344
5367
  }
5345
5368
  return !0;
5346
5369
  }
5347
- function q() {
5370
+ function E() {
5348
5371
  return Object.values(de);
5349
5372
  }
5350
- var mi,
5351
- fi,
5352
- gi,
5353
- S,
5354
- mt,
5373
+ var yi,
5355
5374
  bi,
5356
5375
  wi,
5357
- ft,
5358
- gt,
5359
- $e,
5360
- xi,
5361
- _i,
5362
- Pi,
5363
- Ti,
5364
- pe,
5365
- pt,
5376
+ S,
5377
+ ht,
5378
+ vi,
5379
+ Ii,
5366
5380
  yt,
5367
5381
  bt,
5368
- dt,
5382
+ $e,
5383
+ Pi,
5384
+ Ki,
5385
+ Si,
5369
5386
  $i,
5387
+ pe,
5388
+ ut,
5389
+ kt,
5390
+ xt,
5391
+ mt,
5392
+ Ai,
5370
5393
  de,
5371
5394
  W = y(() => {
5372
5395
  'use strict';
5396
+ We();
5373
5397
  he();
5374
5398
  L();
5375
5399
  Ie();
5376
5400
  _e();
5377
- Xe();
5378
- et();
5379
- it();
5380
- ot();
5401
+ tt();
5402
+ rt();
5403
+ nt();
5404
+ dt();
5381
5405
  Te();
5382
- ((mi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5383
- (fi = {
5406
+ ((yi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5407
+ (bi = {
5384
5408
  video: 'generate_video',
5385
5409
  image: 'generate_image',
5386
5410
  audio: 'generate_audio',
5387
5411
  llm: 'run_task',
5388
5412
  }),
5389
- (gi = {
5413
+ (wi = {
5390
5414
  video: 'Text-to-Video',
5391
5415
  image: 'Text-to-Image',
5392
5416
  audio: 'Text-to-Audio',
5393
5417
  llm: 'Reasoning (LLM)',
5394
5418
  }));
5395
5419
  S = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
5396
- ((mt = {
5420
+ ((ht = {
5397
5421
  name: 'creative_mode',
5398
5422
  type: 'boolean',
5399
5423
  default: !1,
5400
5424
  description:
5401
5425
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
5402
5426
  }),
5403
- (bi = {
5427
+ (vi = {
5404
5428
  name: 'creative_mode',
5405
5429
  type: 'boolean',
5406
5430
  default: !1,
5407
5431
  description: `Not available yet on this model: ${le}.`,
5408
5432
  }),
5409
- (wi = {
5433
+ (Ii = {
5410
5434
  name: 'priority',
5411
5435
  type: 'boolean',
5412
5436
  default: !1,
5413
5437
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
5414
5438
  }),
5415
- (ft = {
5439
+ (yt = {
5416
5440
  name: 'reference_roles',
5417
5441
  type: 'json',
5418
5442
  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).`,
5419
5443
  }),
5420
- (gt = {
5444
+ (bt = {
5421
5445
  name: 'auto_fit_images',
5422
5446
  type: 'boolean',
5423
5447
  default: !1,
@@ -5425,7 +5449,7 @@ var mi,
5425
5449
  '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.',
5426
5450
  }),
5427
5451
  ($e = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5428
- xi = new Set([
5452
+ Pi = new Set([
5429
5453
  'quality',
5430
5454
  'bitrate_mode',
5431
5455
  'draft',
@@ -5433,7 +5457,7 @@ var mi,
5433
5457
  'draft_generation_id',
5434
5458
  'pass_faces',
5435
5459
  ]);
5436
- ((_i = [
5460
+ ((Ki = [
5437
5461
  S('The user message or task.'),
5438
5462
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5439
5463
  {
@@ -5451,7 +5475,7 @@ var mi,
5451
5475
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
5452
5476
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
5453
5477
  ]),
5454
- (Pi = [
5478
+ (Si = [
5455
5479
  S('The user message or task.'),
5456
5480
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5457
5481
  {
@@ -5533,9 +5557,9 @@ var mi,
5533
5557
  description: 'Video frames read a second.',
5534
5558
  },
5535
5559
  ]),
5536
- (Ti = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5560
+ ($i = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5537
5561
  ((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
5538
- (pt = [
5562
+ (ut = [
5539
5563
  {
5540
5564
  name: 'prompt',
5541
5565
  type: 'string',
@@ -5681,19 +5705,19 @@ var mi,
5681
5705
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5682
5706
  },
5683
5707
  ]),
5684
- (yt = {
5708
+ (kt = {
5685
5709
  name: 'images',
5686
5710
  type: 'string[]',
5687
5711
  description:
5688
5712
  '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.',
5689
5713
  }),
5690
- (bt = {
5714
+ (xt = {
5691
5715
  name: 'audios',
5692
5716
  type: 'string[]',
5693
5717
  description:
5694
5718
  '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.',
5695
5719
  }),
5696
- (dt = [
5720
+ (mt = [
5697
5721
  {
5698
5722
  name: 'prompt',
5699
5723
  type: 'string',
@@ -5771,8 +5795,8 @@ var mi,
5771
5795
  description:
5772
5796
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
5773
5797
  },
5774
- yt,
5775
- bt,
5798
+ kt,
5799
+ xt,
5776
5800
  {
5777
5801
  name: 'first_frame_image',
5778
5802
  type: 'string',
@@ -5793,7 +5817,7 @@ var mi,
5793
5817
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5794
5818
  },
5795
5819
  ]),
5796
- ($i = [
5820
+ (Ai = [
5797
5821
  {
5798
5822
  name: 'prompt',
5799
5823
  type: 'string',
@@ -5848,8 +5872,8 @@ var mi,
5848
5872
  description:
5849
5873
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
5850
5874
  },
5851
- yt,
5852
- bt,
5875
+ kt,
5876
+ xt,
5853
5877
  {
5854
5878
  name: 'first_frame_image',
5855
5879
  type: 'string',
@@ -5864,52 +5888,52 @@ var mi,
5864
5888
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5865
5889
  },
5866
5890
  ]));
5867
- de = Ci();
5891
+ de = Ri();
5868
5892
  });
5869
5893
  function ce(e) {
5870
5894
  let t = '/v1/pricing/models',
5871
5895
  i = e?.trim();
5872
5896
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
5873
5897
  }
5874
- var qe = y(() => {
5898
+ var Ee = y(() => {
5875
5899
  'use strict';
5876
5900
  });
5877
- function $t(e) {
5901
+ function qt(e) {
5878
5902
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
5879
5903
  }
5880
- function Ct(e) {
5904
+ function At(e) {
5881
5905
  let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
5882
5906
  i = t.filter((s) => G.includes(s.api.model)).map((s) => s.name),
5883
5907
  r = t.filter((s) => !G.includes(s.api.model)).map((s) => s.name);
5884
5908
  return [
5885
5909
  ...(i.length
5886
- ? [`${$t(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
5910
+ ? [`${qt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
5887
5911
  : []),
5888
- ...(r.length ? [`Not available yet on ${$t(r)}: ${le}.`] : []),
5912
+ ...(r.length ? [`Not available yet on ${qt(r)}: ${le}.`] : []),
5889
5913
  'The Acceptable Use Policy applies.',
5890
5914
  ].join(' ');
5891
5915
  }
5892
- function er(e) {
5893
- if (Xi.has(e.name)) return e;
5916
+ function ar(e) {
5917
+ if (ir.has(e.name)) return e;
5894
5918
  let t = e.inputSchema.properties;
5895
5919
  return !t || t.callback_url
5896
5920
  ? e
5897
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: Qi } } };
5921
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: tr } } };
5898
5922
  }
5899
- function tr(e) {
5923
+ function nr(e) {
5900
5924
  let t = e.inputSchema.properties;
5901
5925
  if (!t) return e;
5902
5926
  let i = !1,
5903
5927
  r = {};
5904
5928
  for (let [n, s] of Object.entries(t))
5905
- qt.has(n) && s.type === 'string' && !s.format
5929
+ Rt.has(n) && s.type === 'string' && !s.format
5906
5930
  ? ((r[n] = { ...s, format: 'uri' }), (i = !0))
5907
- : qt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
5931
+ : Rt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
5908
5932
  ? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
5909
5933
  : (r[n] = s);
5910
5934
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
5911
5935
  }
5912
- function ir(e) {
5936
+ function sr(e) {
5913
5937
  switch (e.type) {
5914
5938
  case 'string':
5915
5939
  return {
@@ -5964,11 +5988,11 @@ function ir(e) {
5964
5988
  return { type: 'string', description: e.description };
5965
5989
  }
5966
5990
  }
5967
- function rr(e, t) {
5991
+ function or(e, t) {
5968
5992
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
5969
5993
  r = {},
5970
5994
  n = [];
5971
- for (let o of e.parameters) ((r[o.name] = ir(o)), o.required && n.push(o.name));
5995
+ for (let o of e.parameters) ((r[o.name] = sr(o)), o.required && n.push(o.name));
5972
5996
  let s = {
5973
5997
  type: 'object',
5974
5998
  properties: r,
@@ -5981,11 +6005,11 @@ function rr(e, t) {
5981
6005
  inputSchema: s,
5982
6006
  };
5983
6007
  }
5984
- function ar() {
5985
- let e = q().filter((c) => c.category === 'Image'),
5986
- t = q().filter((c) => c.category === 'Video'),
5987
- i = q().filter((c) => c.category === 'Text'),
5988
- r = q().filter((c) => c.category === 'Audio'),
6008
+ function lr() {
6009
+ let e = E().filter((c) => c.category === 'Image'),
6010
+ t = E().filter((c) => c.category === 'Video'),
6011
+ i = E().filter((c) => c.category === 'Text'),
6012
+ r = E().filter((c) => c.category === 'Audio'),
5989
6013
  n = {
5990
6014
  name: 'generate_image',
5991
6015
  description:
@@ -6006,7 +6030,7 @@ function ar() {
6006
6030
  aspect_ratio: {
6007
6031
  type: 'string',
6008
6032
  description:
6009
- 'Aspect ratio where the model takes one (see each model tool for its list). Not for GPT Image models.',
6033
+ "Aspect ratio where the model takes one (see each model tool for its list). GPT Image: 1:1, 16:9, 9:16, 21:9, 3:2, 2:3, 4:3, 3:4 or auto (an edit keeps its input image's ratio); the medium endpoint renders non-square at 1K only.",
6010
6034
  },
6011
6035
  resolution: {
6012
6036
  type: 'string',
@@ -6025,14 +6049,14 @@ function ar() {
6025
6049
  enum: ['dynamic', 'token', 'flat', 'medium'],
6026
6050
  default: 'dynamic',
6027
6051
  description:
6028
- 'GPT Image models only. dynamic: lowest price for this request; token: billed by tokens within published limits; flat: one price at any quality or prompt length; medium: gpt-image-2 only, medium quality at one price for any resolution.',
6052
+ 'GPT Image models only. dynamic: lowest price for this request; token: billed by tokens within published limits; flat: one price at any quality or prompt length; medium: gpt-image-2 only, medium quality at one price for any resolution (non-square ratios at 1K only).',
6029
6053
  },
6030
6054
  quality: {
6031
6055
  type: 'string',
6032
6056
  enum: ['low', 'medium', 'high', 'xhigh', 'max'],
6033
6057
  default: 'low',
6034
6058
  description:
6035
- 'GPT Image models only. gpt-image-2 supports low, medium and high; the 2.5 models also xhigh and max. GPT Image output is square at the resolution.',
6059
+ 'GPT Image models only. gpt-image-2 supports low, medium and high; the 2.5 models also xhigh and max.',
6036
6060
  },
6037
6061
  n: {
6038
6062
  type: 'number',
@@ -6077,7 +6101,7 @@ function ar() {
6077
6101
  maximum: 2147483647,
6078
6102
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
6079
6103
  },
6080
- creative_mode: { type: 'boolean', default: !1, description: Ct('image') },
6104
+ creative_mode: { type: 'boolean', default: !1, description: At('image') },
6081
6105
  },
6082
6106
  required: ['prompt'],
6083
6107
  additionalProperties: !0,
@@ -6114,7 +6138,7 @@ function ar() {
6114
6138
  default: '480p',
6115
6139
  description: 'Video resolution (the lowest price is the default; see each model tool).',
6116
6140
  },
6117
- creative_mode: { type: 'boolean', default: !1, description: Ct('video') },
6141
+ creative_mode: { type: 'boolean', default: !1, description: At('video') },
6118
6142
  priority: {
6119
6143
  type: 'boolean',
6120
6144
  default: !1,
@@ -6236,10 +6260,10 @@ function ar() {
6236
6260
  additionalProperties: !0,
6237
6261
  },
6238
6262
  },
6239
- d = nr();
6240
- return [n, s, o, u, p, d, l, Zi];
6263
+ d = pr();
6264
+ return [n, s, o, u, p, d, l, rr];
6241
6265
  }
6242
- function nr() {
6266
+ function pr() {
6243
6267
  return {
6244
6268
  name: 'upload_asset',
6245
6269
  description:
@@ -6287,25 +6311,25 @@ function nr() {
6287
6311
  };
6288
6312
  }
6289
6313
  function Le() {
6290
- let e = ar(),
6291
- t = q().map((i) => rr(i));
6292
- return [...e, ...t].map(er).map(tr);
6314
+ let e = lr(),
6315
+ t = E().map((i) => or(i));
6316
+ return [...e, ...t].map(ar).map(nr);
6293
6317
  }
6294
- var Qi,
6295
- Xi,
6296
- Zi,
6297
- qt,
6298
- Et = y(() => {
6318
+ var tr,
6319
+ ir,
6320
+ rr,
6321
+ Rt,
6322
+ Ot = y(() => {
6299
6323
  'use strict';
6300
6324
  L();
6301
6325
  Te();
6302
6326
  W();
6303
- ((Qi = {
6327
+ ((tr = {
6304
6328
  type: 'string',
6305
6329
  description:
6306
6330
  '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.',
6307
6331
  }),
6308
- (Xi = new Set([
6332
+ (ir = new Set([
6309
6333
  'upload_asset',
6310
6334
  'upload_media',
6311
6335
  'upload_image',
@@ -6313,7 +6337,7 @@ var Qi,
6313
6337
  'check_status',
6314
6338
  'get_pricing',
6315
6339
  ])),
6316
- (Zi = {
6340
+ (rr = {
6317
6341
  name: 'get_pricing',
6318
6342
  description:
6319
6343
  '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.',
@@ -6328,7 +6352,7 @@ var Qi,
6328
6352
  additionalProperties: !1,
6329
6353
  },
6330
6354
  }));
6331
- qt = new Set([
6355
+ Rt = new Set([
6332
6356
  'image',
6333
6357
  'images',
6334
6358
  'image_url',
@@ -6345,19 +6369,19 @@ var Qi,
6345
6369
  'lipsyncing_audio',
6346
6370
  ]);
6347
6371
  });
6348
- var Bt = {};
6349
- Qt(Bt, {
6350
- forgetToolSchemas: () => dr,
6351
- jsonRpcAnswer: () => Dt,
6352
- preprocessLocalFiles: () => Ut,
6353
- startStdioServer: () => jt,
6372
+ var Jt = {};
6373
+ ei(Jt, {
6374
+ forgetToolSchemas: () => fr,
6375
+ jsonRpcAnswer: () => Nt,
6376
+ preprocessLocalFiles: () => Ft,
6377
+ startStdioServer: () => Gt,
6354
6378
  });
6355
- function sr(e) {
6379
+ function dr(e) {
6356
6380
  let t = (i) =>
6357
6381
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
6358
6382
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
6359
6383
  }
6360
- function Dt(e, t, i) {
6384
+ function Nt(e, t, i) {
6361
6385
  let r = e?.id,
6362
6386
  n = r == null,
6363
6387
  s = null;
@@ -6366,7 +6390,7 @@ function Dt(e, t, i) {
6366
6390
  } catch {
6367
6391
  s = null;
6368
6392
  }
6369
- if (s !== null && sr(s)) return n ? null : s;
6393
+ if (s !== null && dr(s)) return n ? null : s;
6370
6394
  if (n) return null;
6371
6395
  if (!i && t >= 200 && t < 300) return;
6372
6396
  let o = s?.error,
@@ -6387,12 +6411,12 @@ function Dt(e, t, i) {
6387
6411
  },
6388
6412
  };
6389
6413
  }
6390
- function or() {
6414
+ function cr() {
6391
6415
  let e = process.argv.slice(2),
6392
6416
  t = e.indexOf('--api-key');
6393
6417
  return K(t >= 0 ? e[t + 1] : void 0);
6394
6418
  }
6395
- async function Lt(e, t, i) {
6419
+ async function Ut(e, t, i) {
6396
6420
  let r = N.default.resolve(e);
6397
6421
  if (!A.default.existsSync(r) || !A.default.statSync(r).isFile())
6398
6422
  throw new Error(`File not found: ${e}`);
@@ -6421,15 +6445,15 @@ async function Lt(e, t, i) {
6421
6445
  mimeType: l.mime_type || l.mimeType || 'image/png',
6422
6446
  };
6423
6447
  }
6424
- function Vt(e) {
6425
- return lr.has(N.default.extname(e).toLowerCase());
6448
+ function jt(e) {
6449
+ return ur.has(N.default.extname(e).toLowerCase());
6426
6450
  }
6427
- function Nt(e) {
6451
+ function Bt(e) {
6428
6452
  return new Error(
6429
6453
  `Tein uploads image, video and audio files only, and ${N.default.basename(e)} is not one.`,
6430
6454
  );
6431
6455
  }
6432
- function pr(e) {
6456
+ function mr(e) {
6433
6457
  let t = e.trim();
6434
6458
  if (
6435
6459
  !t ||
@@ -6452,10 +6476,10 @@ function Ne(e) {
6452
6476
  Q.set(i.name, i.inputSchema);
6453
6477
  }
6454
6478
  }
6455
- function dr() {
6479
+ function fr() {
6456
6480
  (Q.clear(), (Ve = 0));
6457
6481
  }
6458
- async function cr(e, t) {
6482
+ async function gr(e, t) {
6459
6483
  if (!(Date.now() - Ve < 6e4)) {
6460
6484
  Ve = Date.now();
6461
6485
  try {
@@ -6471,35 +6495,35 @@ async function cr(e, t) {
6471
6495
  } catch {}
6472
6496
  }
6473
6497
  }
6474
- function ur(e) {
6498
+ function hr(e) {
6475
6499
  return e
6476
6500
  ? e.type === 'string'
6477
6501
  ? e.format === 'uri'
6478
6502
  : e.type === 'array' && e.items?.format === 'uri'
6479
6503
  : !1;
6480
6504
  }
6481
- async function At(e, t, i) {
6505
+ async function Dt(e, t, i) {
6482
6506
  if (typeof e != 'string') return e;
6483
- let r = pr(e);
6507
+ let r = mr(e);
6484
6508
  if (!r) return e;
6485
- if (!Vt(r)) throw Nt(r);
6486
- return (await Lt(r, t, i)).url;
6509
+ if (!jt(r)) throw Bt(r);
6510
+ return (await Ut(r, t, i)).url;
6487
6511
  }
6488
- async function Ut(e, t, i, r, n) {
6489
- (Q.size === 0 && Ne(Le()), Q.has(e) || (await cr(n, i)));
6512
+ async function Ft(e, t, i, r, n) {
6513
+ (Q.size === 0 && Ne(Le()), Q.has(e) || (await gr(n, i)));
6490
6514
  let s = Q.get(e)?.properties;
6491
6515
  if (!s) return t;
6492
6516
  let o = { ...t };
6493
6517
  for (let [u, p] of Object.entries(t))
6494
- if (ur(s[u]))
6518
+ if (hr(s[u]))
6495
6519
  if (Array.isArray(p)) {
6496
6520
  let l = [];
6497
- for (let d of p) l.push(await At(d, i, r));
6521
+ for (let d of p) l.push(await Dt(d, i, r));
6498
6522
  o[u] = l;
6499
- } else o[u] = await At(p, i, r);
6523
+ } else o[u] = await Dt(p, i, r);
6500
6524
  return o;
6501
6525
  }
6502
- function mr(e) {
6526
+ function yr(e) {
6503
6527
  let t = e.id ?? null;
6504
6528
  switch (e.method) {
6505
6529
  case 'initialize':
@@ -6540,13 +6564,13 @@ function mr(e) {
6540
6564
  };
6541
6565
  }
6542
6566
  }
6543
- async function jt() {
6544
- if (Rt) return;
6545
- Rt = !0;
6546
- let e = or(),
6567
+ async function Gt() {
6568
+ if (Lt) return;
6569
+ Lt = !0;
6570
+ let e = cr(),
6547
6571
  t = k(),
6548
6572
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
6549
- (Ot.default
6573
+ (Vt.default
6550
6574
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
6551
6575
  .on('line', async (n) => {
6552
6576
  let s = n.trim();
@@ -6607,8 +6631,8 @@ async function jt() {
6607
6631
  try {
6608
6632
  let c = N.default.resolve(d.trim());
6609
6633
  if (A.default.existsSync(c) && A.default.statSync(c).isFile() && e) {
6610
- if (!Vt(c)) throw Nt(c);
6611
- let m = await Lt(c, e, t),
6634
+ if (!jt(c)) throw Bt(c);
6635
+ let m = await Ut(c, e, t),
6612
6636
  f = (m.sizeBytes / 1024).toFixed(1),
6613
6637
  ue =
6614
6638
  m.mimeType.startsWith('image/') ||
@@ -6664,7 +6688,7 @@ Pass this URL to any Tein generation tool.`,
6664
6688
  }
6665
6689
  if (e)
6666
6690
  try {
6667
- o.params.arguments = await Ut(String(p), l, e, t, i);
6691
+ o.params.arguments = await Ft(String(p), l, e, t, i);
6668
6692
  } catch (d) {
6669
6693
  let c = d instanceof Error ? d.message : String(d);
6670
6694
  process.stdout.write(
@@ -6695,7 +6719,7 @@ Pass this URL to any Tein generation tool.`,
6695
6719
  body: JSON.stringify(o),
6696
6720
  }),
6697
6721
  l = await p.text(),
6698
- d = Dt(o, p.status, l);
6722
+ d = Nt(o, p.status, l);
6699
6723
  if (d === null) return;
6700
6724
  if (d) {
6701
6725
  (o?.method === 'tools/list' && Ne(d.result?.tools),
@@ -6707,7 +6731,7 @@ Pass this URL to any Tein generation tool.`,
6707
6731
  return;
6708
6732
  }
6709
6733
  } catch {}
6710
- let u = mr(o);
6734
+ let u = yr(o);
6711
6735
  u !== null &&
6712
6736
  process.stdout.write(
6713
6737
  JSON.stringify(u) +
@@ -6732,20 +6756,20 @@ Pass this URL to any Tein generation tool.`,
6732
6756
  }
6733
6757
  var A,
6734
6758
  N,
6735
- Ot,
6736
- lr,
6759
+ Vt,
6760
+ ur,
6737
6761
  Q,
6738
6762
  Ve,
6739
- Rt,
6740
- Ft = y(() => {
6763
+ Lt,
6764
+ Ht = y(() => {
6741
6765
  'use strict';
6742
6766
  ((A = v(require('node:fs'))),
6743
6767
  (N = v(require('node:path'))),
6744
- (Ot = v(require('node:readline'))));
6745
- qe();
6746
- Et();
6768
+ (Vt = v(require('node:readline'))));
6769
+ Ee();
6770
+ Ot();
6747
6771
  C();
6748
- lr = new Set([
6772
+ ur = new Set([
6749
6773
  '.png',
6750
6774
  '.jpg',
6751
6775
  '.jpeg',
@@ -6772,19 +6796,19 @@ var A,
6772
6796
  '.opus',
6773
6797
  ]);
6774
6798
  ((Q = new Map()), (Ve = 0));
6775
- Rt = !1;
6799
+ Lt = !1;
6776
6800
  require.main === module &&
6777
- jt().catch((e) => {
6801
+ Gt().catch((e) => {
6778
6802
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
6779
6803
  `),
6780
6804
  process.exit(1));
6781
6805
  });
6782
6806
  });
6783
- var Zt =
6807
+ var ii =
6784
6808
  !process.env.NO_COLOR &&
6785
6809
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
6786
6810
  function b(e, t) {
6787
- return (i) => (Zt ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
6811
+ return (i) => (ii ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
6788
6812
  }
6789
6813
  var a = {
6790
6814
  bold: b(1, 22),
@@ -6869,12 +6893,12 @@ var a = {
6869
6893
  }
6870
6894
  };
6871
6895
  var R = v(require('node:fs')),
6872
- E = v(require('node:path'));
6896
+ q = v(require('node:path'));
6873
6897
  var ee = v(require('node:fs')),
6874
6898
  Be = v(require('node:path')),
6875
6899
  Fe = require('node:stream/promises');
6876
6900
  var Z = '1.1.7';
6877
- var ei = new Set([
6901
+ var ri = new Set([
6878
6902
  'account_suspended',
6879
6903
  'account_terminated',
6880
6904
  'creative_mode_restricted',
@@ -6882,7 +6906,7 @@ var ei = new Set([
6882
6906
  'workspace_paused',
6883
6907
  ]),
6884
6908
  I = 1,
6885
- ti = 3,
6909
+ ai = 3,
6886
6910
  w = class extends Error {
6887
6911
  constructor(t, i, r, n = {}) {
6888
6912
  (super(i),
@@ -6892,10 +6916,10 @@ var ei = new Set([
6892
6916
  (this.fields = n));
6893
6917
  }
6894
6918
  get exitCode() {
6895
- return this.code && ei.has(this.code) ? ti : I;
6919
+ return this.code && ri.has(this.code) ? ai : I;
6896
6920
  }
6897
6921
  };
6898
- function ii(e, t, i) {
6922
+ function ni(e, t, i) {
6899
6923
  let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
6900
6924
  if (!i || typeof i != 'object') return new w(e, r);
6901
6925
  let n = i;
@@ -6922,7 +6946,7 @@ function M(e) {
6922
6946
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
6923
6947
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
6924
6948
  }
6925
- function ri(e) {
6949
+ function si(e) {
6926
6950
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
6927
6951
  ? 'video'
6928
6952
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
@@ -6934,7 +6958,7 @@ function je(e) {
6934
6958
  for (let i of e.data ?? [])
6935
6959
  typeof i.message?.content == 'string'
6936
6960
  ? t.push({ type: 'text', text: i.message.content })
6937
- : i.url && t.push({ type: ri(i.url), url: i.url });
6961
+ : i.url && t.push({ type: si(i.url), url: i.url });
6938
6962
  return t;
6939
6963
  }
6940
6964
  var T = class {
@@ -6960,7 +6984,7 @@ var T = class {
6960
6984
  try {
6961
6985
  s = await n.json();
6962
6986
  } catch {}
6963
- throw ii(n.status, n.statusText, s);
6987
+ throw ni(n.status, n.statusText, s);
6964
6988
  }
6965
6989
  return await n.json();
6966
6990
  }
@@ -7021,29 +7045,29 @@ var T = class {
7021
7045
  };
7022
7046
  C();
7023
7047
  W();
7024
- var kt = ['images', 'input_images', 'videos', 'audios'];
7025
- function qi(e) {
7026
- for (let t of kt) typeof e[t] == 'string' && (e[t] = [e[t]]);
7048
+ var It = ['images', 'input_images', 'videos', 'audios'];
7049
+ function Oi(e) {
7050
+ for (let t of It) typeof e[t] == 'string' && (e[t] = [e[t]]);
7027
7051
  }
7028
- function Ei(e) {
7052
+ function Di(e) {
7029
7053
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
7030
- let t = E.default.resolve(e);
7054
+ let t = q.default.resolve(e);
7031
7055
  return R.default.existsSync(t) && R.default.statSync(t).isFile() ? t : null;
7032
7056
  }
7033
- async function Ai(e, t) {
7034
- for (let i of kt) {
7057
+ async function Li(e, t) {
7058
+ for (let i of It) {
7035
7059
  if (!Array.isArray(e[i])) continue;
7036
7060
  let r = [];
7037
7061
  for (let n of e[i]) {
7038
7062
  if (typeof n != 'string') continue;
7039
- let s = Ei(n);
7063
+ let s = Di(n);
7040
7064
  r.push(s ? await t(s) : n);
7041
7065
  }
7042
7066
  e[i] = r;
7043
7067
  }
7044
7068
  }
7045
7069
  var z = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
7046
- function Ri(e) {
7070
+ function Vi(e) {
7047
7071
  if (e.count === void 0 || e.count === !0) return 1;
7048
7072
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
7049
7073
  i = z.enterprise;
@@ -7056,7 +7080,7 @@ function Ri(e) {
7056
7080
  t
7057
7081
  );
7058
7082
  }
7059
- async function Oi(e, t, i, r, n) {
7083
+ async function Ni(e, t, i, r, n) {
7060
7084
  n.isJson ||
7061
7085
  process.stderr.write(`Starting ${r} ${t} jobs together...
7062
7086
  `);
@@ -7131,7 +7155,7 @@ async function Oi(e, t, i, r, n) {
7131
7155
  o.some((p) => p.status === 'failed' || p.status === 'expired' || p.status === 'cancelled')) &&
7132
7156
  process.exit(I);
7133
7157
  }
7134
- function xt(e) {
7158
+ function _t(e) {
7135
7159
  let t = {},
7136
7160
  i = new Set(),
7137
7161
  r = [];
@@ -7198,7 +7222,7 @@ async function Ce(e, t) {
7198
7222
  s = !!t.json,
7199
7223
  o = !!(t.async || t.no_wait),
7200
7224
  u = typeof t.output == 'string' ? t.output : void 0,
7201
- p = Ri(t),
7225
+ p = Vi(t),
7202
7226
  l = { ...t };
7203
7227
  if (
7204
7228
  (delete l.json,
@@ -7213,9 +7237,9 @@ async function Ce(e, t) {
7213
7237
  for (let h of n.parameters)
7214
7238
  h.default !== void 0 &&
7215
7239
  l[h.name] === void 0 &&
7216
- wt(n.slug, h.name, t) &&
7240
+ vt(n.slug, h.name, t) &&
7217
7241
  (l[h.name] = h.default);
7218
- (qi(l),
7242
+ (Oi(l),
7219
7243
  typeof l.image == 'string' && !l.images && ((l.images = [l.image]), delete l.image),
7220
7244
  l.image_url &&
7221
7245
  !l.first_frame_image &&
@@ -7226,14 +7250,14 @@ async function Ce(e, t) {
7226
7250
  for (let h of c) {
7227
7251
  let g = l[h];
7228
7252
  if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
7229
- let x = E.default.resolve(g);
7253
+ let x = q.default.resolve(g);
7230
7254
  if (R.default.existsSync(x) && R.default.statSync(x).isFile()) {
7231
- let _ = new P(`Uploading local file ${E.default.basename(x)} to CDN...`);
7255
+ let _ = new P(`Uploading local file ${q.default.basename(x)} to CDN...`);
7232
7256
  s || _.start();
7233
7257
  try {
7234
7258
  let j = R.default.readFileSync(x),
7235
7259
  X = await d.uploadAsset(j.toString('base64'));
7236
- ((l[h] = X.url), s || _.succeed(`Uploaded ${E.default.basename(x)} to CDN`));
7260
+ ((l[h] = X.url), s || _.succeed(`Uploaded ${q.default.basename(x)} to CDN`));
7237
7261
  } catch (j) {
7238
7262
  let X = j instanceof Error ? j.message : String(j);
7239
7263
  (s
@@ -7248,13 +7272,13 @@ async function Ce(e, t) {
7248
7272
  }
7249
7273
  }
7250
7274
  }
7251
- await Ai(l, async (h) => {
7252
- let g = new P(`Uploading local file ${E.default.basename(h)} to CDN...`);
7275
+ await Li(l, async (h) => {
7276
+ let g = new P(`Uploading local file ${q.default.basename(h)} to CDN...`);
7253
7277
  s || g.start();
7254
7278
  try {
7255
7279
  let x = R.default.readFileSync(h),
7256
7280
  _ = await d.uploadAsset(x.toString('base64'));
7257
- return (s || g.succeed(`Uploaded ${E.default.basename(h)} to CDN`), _.url);
7281
+ return (s || g.succeed(`Uploaded ${q.default.basename(h)} to CDN`), _.url);
7258
7282
  } catch (x) {
7259
7283
  let _ = x instanceof Error ? x.message : String(x);
7260
7284
  (s
@@ -7272,7 +7296,7 @@ async function Ce(e, t) {
7272
7296
  let f;
7273
7297
  try {
7274
7298
  if (p > 1) {
7275
- await Oi(d, e, l, p, { isJson: s, isAsync: o });
7299
+ await Ni(d, e, l, p, { isJson: s, isAsync: o });
7276
7300
  return;
7277
7301
  }
7278
7302
  f = await d.queueJob(e, l);
@@ -7374,7 +7398,7 @@ ${a.bold('Outputs:')}
7374
7398
  ) {
7375
7399
  let x = new P(`Downloading output to ${u}...`).start();
7376
7400
  try {
7377
- (await d.downloadOutput(g.url, E.default.resolve(process.cwd(), u)),
7401
+ (await d.downloadOutput(g.url, q.default.resolve(process.cwd(), u)),
7378
7402
  x.succeed(`Saved to ${a.bold(u)}`));
7379
7403
  } catch (_) {
7380
7404
  x.fail(`Failed to download: ${_ instanceof Error ? _.message : _}`);
@@ -7390,9 +7414,9 @@ ${g.text}
7390
7414
  process.stdout.write(`
7391
7415
  `);
7392
7416
  }
7393
- var vt = v(require('node:readline'));
7417
+ var Pt = v(require('node:readline'));
7394
7418
  C();
7395
- async function Di(e) {
7419
+ async function Ui(e) {
7396
7420
  try {
7397
7421
  return (await new T(e, k()).checkKey(), 'ok');
7398
7422
  } catch (t) {
@@ -7403,8 +7427,8 @@ async function Di(e) {
7403
7427
  return 'unchecked';
7404
7428
  }
7405
7429
  }
7406
- function Li(e) {
7407
- let t = vt.default.createInterface({ input: process.stdin, output: process.stdout });
7430
+ function ji(e) {
7431
+ let t = Pt.default.createInterface({ input: process.stdin, output: process.stdout });
7408
7432
  return new Promise((i) => {
7409
7433
  t.question(e, (r) => {
7410
7434
  (t.close(), i(r.trim()));
@@ -7423,14 +7447,14 @@ ${a.bold('Tein AI Authentication')}
7423
7447
  process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
7424
7448
 
7425
7449
  `),
7426
- (i = await Li('Enter your Tein API Key (sk_live_...): '))),
7450
+ (i = await ji('Enter your Tein API Key (sk_live_...): '))),
7427
7451
  !i.startsWith('sk_live_') &&
7428
7452
  !i.startsWith('sk_test_') &&
7429
7453
  (process.stderr
7430
7454
  .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
7431
7455
  `),
7432
7456
  process.exit(1)));
7433
- let r = await Di(i);
7457
+ let r = await Ui(i);
7434
7458
  (r === 'invalid' &&
7435
7459
  (process.stderr
7436
7460
  .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
@@ -7502,10 +7526,10 @@ ${a.bold('Tein AI CLI Configuration')}
7502
7526
  C();
7503
7527
  he();
7504
7528
  W();
7505
- var Vi = 3e3;
7506
- async function It(e) {
7529
+ var Bi = 3e3;
7530
+ async function Tt(e) {
7507
7531
  try {
7508
- let t = await fetch(`${k(e)}/v1/pricing`, { signal: AbortSignal.timeout(Vi) });
7532
+ let t = await fetch(`${k(e)}/v1/pricing`, { signal: AbortSignal.timeout(Bi) });
7509
7533
  if (!t.ok) return;
7510
7534
  let i = await t.json(),
7511
7535
  r = {};
@@ -7513,18 +7537,18 @@ async function It(e) {
7513
7537
  let s = String(n.modelSlug ?? '');
7514
7538
  B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
7515
7539
  }
7516
- ct(r);
7540
+ ft(r);
7517
7541
  } catch {}
7518
7542
  }
7519
- var Ni = new Set(['video', 'image', 'text', 'audio', '3d']),
7520
- Ui = { llm: 'text', chat: 'text', reasoning: 'text' };
7521
- async function _t(e, t) {
7522
- await It(t);
7523
- let i = q();
7543
+ var Fi = new Set(['video', 'image', 'text', 'audio', '3d']),
7544
+ Gi = { llm: 'text', chat: 'text', reasoning: 'text' };
7545
+ async function Mt(e, t) {
7546
+ await Tt(t);
7547
+ let i = E();
7524
7548
  if (e) {
7525
7549
  let s = e.toLowerCase(),
7526
- o = Ui[s] ?? s;
7527
- i = Ni.has(o)
7550
+ o = Gi[s] ?? s;
7551
+ i = Fi.has(o)
7528
7552
  ? i.filter((u) => u.category.toLowerCase() === o)
7529
7553
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
7530
7554
  }
@@ -7562,8 +7586,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
7562
7586
 
7563
7587
  `);
7564
7588
  }
7565
- async function Pt(e, t) {
7566
- B.has(e) && (await It(t));
7589
+ async function Kt(e, t) {
7590
+ B.has(e) && (await Tt(t));
7567
7591
  let i = V(e);
7568
7592
  (i ||
7569
7593
  (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -7644,8 +7668,8 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
7644
7668
  `);
7645
7669
  }
7646
7670
  C();
7647
- qe();
7648
- var ji = 1e4,
7671
+ Ee();
7672
+ var Ji = 1e4,
7649
7673
  Ae = {
7650
7674
  price: '',
7651
7675
  creativeMode: 'Creative mode',
@@ -7656,22 +7680,22 @@ var ji = 1e4,
7656
7680
  priorityDraft: 'Priority + Draft',
7657
7681
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
7658
7682
  },
7659
- Bi = Object.keys(Ae),
7660
- Fi = {
7683
+ Hi = Object.keys(Ae),
7684
+ Wi = {
7661
7685
  creativeMode: 'unfiltered',
7662
7686
  creativeModePriority: 'unfilteredPriority',
7663
7687
  creativeModeDraft: 'unfilteredDraft',
7664
7688
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
7665
7689
  };
7666
- function Gi(e, t) {
7667
- let i = Fi[t];
7690
+ function zi(e, t) {
7691
+ let i = Wi[t];
7668
7692
  return e[t] ?? (i ? e[i] : void 0);
7669
7693
  }
7670
- async function Ji(e, t) {
7694
+ async function Yi(e, t) {
7671
7695
  let i = `${k(e)}${ce(t)}`,
7672
7696
  r;
7673
7697
  try {
7674
- r = await fetch(i, { signal: AbortSignal.timeout(ji) });
7698
+ r = await fetch(i, { signal: AbortSignal.timeout(Ji) });
7675
7699
  } catch {
7676
7700
  throw new Error(`Could not reach ${i}`);
7677
7701
  }
@@ -7687,7 +7711,7 @@ async function Ji(e, t) {
7687
7711
  }
7688
7712
  return n;
7689
7713
  }
7690
- function Ee(e) {
7714
+ function qe(e) {
7691
7715
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
7692
7716
  [i, r = ''] = t.split('.');
7693
7717
  return `$${i}.${r.padEnd(2, '0')}`;
@@ -7696,9 +7720,9 @@ function Re(e) {
7696
7720
  if (!e || typeof e.starter != 'number') return null;
7697
7721
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
7698
7722
  i = typeof e.scale == 'number' ? e.scale : t;
7699
- return `Starter ${Ee(e.starter)} Plus ${Ee(t)} Scale ${Ee(i)}`;
7723
+ return `Starter ${qe(e.starter)} Plus ${qe(t)} Scale ${qe(i)}`;
7700
7724
  }
7701
- function Hi(e) {
7725
+ function Qi(e) {
7702
7726
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
7703
7727
  let t = [];
7704
7728
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -7710,21 +7734,21 @@ function Hi(e) {
7710
7734
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
7711
7735
  );
7712
7736
  }
7713
- function Wi(e, t) {
7714
- let i = Hi(e);
7715
- for (let r of Bi) {
7716
- let n = Re(Gi(e, r));
7737
+ function Xi(e, t) {
7738
+ let i = Qi(e);
7739
+ for (let r of Hi) {
7740
+ let n = Re(zi(e, r));
7717
7741
  if (!n) continue;
7718
7742
  let s = Ae[r] ? ` (${Ae[r]})` : '';
7719
7743
  t.push(` ${i}${s} ${n}`);
7720
7744
  }
7721
7745
  }
7722
- function zi(e, t) {
7746
+ function Zi(e, t) {
7723
7747
  let i = e.quality ? ` quality=${e.quality}` : '';
7724
7748
  t.push(
7725
7749
  ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
7726
7750
  );
7727
- for (let n of e.variants ?? []) Wi(n, t);
7751
+ for (let n of e.variants ?? []) Xi(n, t);
7728
7752
  let r = e.addons;
7729
7753
  if (Array.isArray(r))
7730
7754
  for (let n of r) {
@@ -7736,7 +7760,7 @@ function zi(e, t) {
7736
7760
  }
7737
7761
  t.push('');
7738
7762
  }
7739
- function Yi(e) {
7763
+ function er(e) {
7740
7764
  let t = [],
7741
7765
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
7742
7766
  (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
@@ -7758,7 +7782,7 @@ function Yi(e) {
7758
7782
  });
7759
7783
  for (let p of s) {
7760
7784
  t.push(`${a.bold(a.cyan(`\u2500\u2500 ${p} \u2500\u2500`))}`);
7761
- for (let l of r.get(p) ?? []) zi(l, t);
7785
+ for (let l of r.get(p) ?? []) Zi(l, t);
7762
7786
  }
7763
7787
  let o = new Set(e.board.models.map((p) => p.slug.toLowerCase())),
7764
7788
  u = (e.configs ?? []).filter((p) => !o.has(String(p.modelSlug ?? '').toLowerCase()));
@@ -7788,10 +7812,10 @@ function Yi(e) {
7788
7812
  `
7789
7813
  );
7790
7814
  }
7791
- async function Tt(e) {
7815
+ async function St(e) {
7792
7816
  let t;
7793
7817
  try {
7794
- t = await Ji(e.apiUrl, e.model);
7818
+ t = await Yi(e.apiUrl, e.model);
7795
7819
  } catch (i) {
7796
7820
  let r = i instanceof Error ? i.message : String(i);
7797
7821
  (process.stderr.write(`${a.red('Error:')} ${r}
@@ -7802,12 +7826,12 @@ async function Tt(e) {
7802
7826
  e.json
7803
7827
  ? `${JSON.stringify(t, null, 2)}
7804
7828
  `
7805
- : Yi(t),
7829
+ : er(t),
7806
7830
  );
7807
7831
  }
7808
- var Mt = v(require('node:path'));
7832
+ var $t = v(require('node:path'));
7809
7833
  C();
7810
- async function Kt(e, t) {
7834
+ async function Ct(e, t) {
7811
7835
  let i = K(typeof t.api_key == 'string' ? t.api_key : void 0),
7812
7836
  r = k(typeof t.api_url == 'string' ? t.api_url : void 0);
7813
7837
  (i ||
@@ -7902,7 +7926,7 @@ ${a.bold('Outputs:')}
7902
7926
  ) {
7903
7927
  let c = new P(`Downloading output to ${o}...`).start();
7904
7928
  try {
7905
- (await u.downloadOutput(d.url, Mt.default.resolve(process.cwd(), o)),
7929
+ (await u.downloadOutput(d.url, $t.default.resolve(process.cwd(), o)),
7906
7930
  c.succeed(`Saved to ${a.bold(o)}`));
7907
7931
  } catch (m) {
7908
7932
  c.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -7920,7 +7944,7 @@ ${d.text}
7920
7944
  var Oe = v(require('node:fs')),
7921
7945
  De = v(require('node:path'));
7922
7946
  C();
7923
- async function St(e, t = {}) {
7947
+ async function Et(e, t = {}) {
7924
7948
  let i = K(typeof t.api_key == 'string' ? t.api_key : void 0),
7925
7949
  r = k(typeof t.api_url == 'string' ? t.api_url : void 0),
7926
7950
  n = !!t.json;
@@ -7986,7 +8010,7 @@ ${a.bold('CDN URL:')} ${a.green(c.url)}
7986
8010
  }
7987
8011
  W();
7988
8012
  _e();
7989
- function Gt() {
8013
+ function Wt() {
7990
8014
  process.stdout.write(`
7991
8015
  ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
7992
8016
 
@@ -8006,7 +8030,7 @@ ${a.bold('COMMANDS:')}
8006
8030
  ${a.bold('GENERATION OPTIONS (for `tein run`):')}
8007
8031
  ${a.cyan('-p, --prompt')} <text> Text prompt for generation ${a.red('(required)')}
8008
8032
  ${a.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
8009
- ${a.cyan('--aspect-ratio')} <ratio> Aspect ratio (16:9, 9:16, 1:1, 4:3, 21:9)
8033
+ ${a.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
8010
8034
  ${a.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
8011
8035
  ${a.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
8012
8036
  ${a.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
@@ -8043,11 +8067,11 @@ ${a.bold('EXAMPLES:')}
8043
8067
 
8044
8068
  `);
8045
8069
  }
8046
- async function fr() {
8070
+ async function br() {
8047
8071
  let e = process.argv.slice(2),
8048
- t = xt(e);
8072
+ t = _t(e);
8049
8073
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
8050
- Gt();
8074
+ Wt();
8051
8075
  return;
8052
8076
  }
8053
8077
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -8074,14 +8098,14 @@ async function fr() {
8074
8098
  }
8075
8099
  case 'models':
8076
8100
  case 'list': {
8077
- await _t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8101
+ await Mt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8078
8102
  break;
8079
8103
  }
8080
8104
  case 'pricing':
8081
8105
  case 'prices': {
8082
8106
  let i = t.options.model,
8083
8107
  r = t.subcommand || (typeof i == 'string' ? i : void 0);
8084
- await Tt({
8108
+ await St({
8085
8109
  model: r,
8086
8110
  json: !!t.options.json,
8087
8111
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -8096,12 +8120,12 @@ async function fr() {
8096
8120
  process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
8097
8121
  `),
8098
8122
  process.exit(1)),
8099
- await Pt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8123
+ await Kt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8100
8124
  break;
8101
8125
  }
8102
8126
  case 'upload': {
8103
8127
  let i = t.subcommand || '';
8104
- await St(i, t.options);
8128
+ await Et(i, t.options);
8105
8129
  break;
8106
8130
  }
8107
8131
  case 'run':
@@ -8112,11 +8136,11 @@ async function fr() {
8112
8136
  }
8113
8137
  case 'status': {
8114
8138
  let i = t.subcommand || '';
8115
- await Kt(i, t.options);
8139
+ await Ct(i, t.options);
8116
8140
  break;
8117
8141
  }
8118
8142
  case 'mcp': {
8119
- let { startStdioServer: i } = await Promise.resolve().then(() => (Ft(), Bt));
8143
+ let { startStdioServer: i } = await Promise.resolve().then(() => (Ht(), Jt));
8120
8144
  await i();
8121
8145
  break;
8122
8146
  }
@@ -8132,12 +8156,12 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
8132
8156
  await Ce(t.command, t.options));
8133
8157
  return;
8134
8158
  }
8135
- Gt();
8159
+ Wt();
8136
8160
  break;
8137
8161
  }
8138
8162
  }
8139
8163
  }
8140
- fr().catch((e) => {
8164
+ br().catch((e) => {
8141
8165
  (e instanceof w &&
8142
8166
  (process.stderr.write(`
8143
8167
  ${a.red('Error:')} ${M(e).join(`