@teinai/cli 1.1.12 → 1.1.14

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 +498 -415
  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 Yt = Object.create;
3
+ var Qt = Object.create;
4
4
  var fe = Object.defineProperty;
5
- var Qt = Object.getOwnPropertyDescriptor;
6
- var Xt = Object.getOwnPropertyNames;
7
- var Zt = Object.getPrototypeOf,
8
- ei = Object.prototype.hasOwnProperty;
5
+ var Xt = Object.getOwnPropertyDescriptor;
6
+ var Zt = Object.getOwnPropertyNames;
7
+ var ei = Object.getPrototypeOf,
8
+ ti = Object.prototype.hasOwnProperty;
9
9
  var b = (e, t, i) => () => {
10
10
  if (i) throw i[0];
11
11
  try {
@@ -14,20 +14,20 @@ var b = (e, t, i) => () => {
14
14
  throw ((i = [r]), r);
15
15
  }
16
16
  };
17
- var ti = (e, t) => {
17
+ var ii = (e, t) => {
18
18
  for (var i in t) fe(e, i, { get: t[i], enumerable: !0 });
19
19
  },
20
- ii = (e, t, i, r) => {
20
+ ri = (e, t, i, r) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of Xt(t))
23
- !ei.call(e, n) &&
22
+ for (let n of Zt(t))
23
+ !ti.call(e, n) &&
24
24
  n !== i &&
25
- fe(e, n, { get: () => t[n], enumerable: !(r = Qt(t, n)) || r.enumerable });
25
+ fe(e, n, { get: () => t[n], enumerable: !(r = Xt(t, n)) || r.enumerable });
26
26
  return e;
27
27
  };
28
28
  var I = (e, t, i) => (
29
- (i = e != null ? Yt(Zt(e)) : {}),
30
- ii(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
29
+ (i = e != null ? Qt(ei(e)) : {}),
30
+ ri(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
31
31
  );
32
32
  function L() {
33
33
  try {
@@ -67,41 +67,41 @@ function ie() {
67
67
  return D;
68
68
  }
69
69
  var C,
70
- Je,
70
+ He,
71
71
  ge,
72
72
  te,
73
73
  D,
74
74
  E = b(() => {
75
75
  'use strict';
76
76
  ((C = I(require('node:fs'))),
77
- (Je = I(require('node:os'))),
77
+ (He = I(require('node:os'))),
78
78
  (ge = I(require('node:path'))),
79
- (te = ge.default.join(Je.default.homedir(), '.tein')),
79
+ (te = ge.default.join(He.default.homedir(), '.tein')),
80
80
  (D = ge.default.join(te, 'config.json')));
81
81
  });
82
- var li,
83
- He,
82
+ var pi,
84
83
  ze,
85
- We = b(() => {
84
+ We,
85
+ Ye = b(() => {
86
86
  'use strict';
87
- ((li = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
- (He = [...li, 'auto']),
89
- (ze =
87
+ ((pi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (ze = [...pi, 'auto']),
89
+ (We =
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 B,
93
- ye = b(() => {
93
+ be = b(() => {
94
94
  'use strict';
95
95
  B = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
96
96
  });
97
- function be(e) {
97
+ function we(e) {
98
98
  return !1;
99
99
  }
100
- var Ye = b(() => {
100
+ var Qe = b(() => {
101
101
  'use strict';
102
102
  });
103
103
  var re,
104
- Qe = b(() => {
104
+ Xe = b(() => {
105
105
  'use strict';
106
106
  re = {
107
107
  source: 'TEIN Price Board',
@@ -192,33 +192,108 @@ var re,
192
192
  variants: [
193
193
  {
194
194
  id: '4k-with-video',
195
- price: { starter: 0.7374, plus: 0.6806, scale: 0.6523 },
195
+ price: { starter: 0.8103, plus: 0.709, scale: 0.6673 },
196
196
  label: '4K \xB7 Omni Reference \xB7 with reference video',
197
197
  resolution: '4k',
198
198
  task: 'omni',
199
199
  withVideo: !0,
200
- unfiltered: { starter: 0.7742, plus: 0.7146, scale: 0.6849 },
201
- priority: { starter: 0.7816, plus: 0.7214, scale: 0.6914 },
202
- unfilteredPriority: { starter: 0.8206, plus: 0.7574, scale: 0.7259 },
203
- draft: { starter: 0.7374, plus: 0.6806, scale: 0.6523 },
204
- unfilteredDraft: { starter: 0.7742, plus: 0.7146, scale: 0.6849 },
205
- priorityDraft: { starter: 0.7816, plus: 0.7214, scale: 0.6914 },
206
- unfilteredPriorityDraft: { starter: 0.8206, plus: 0.7574, scale: 0.7259 },
200
+ unfiltered: { starter: 0.8508, plus: 0.7444, scale: 0.7006 },
201
+ priority: { starter: 0.8589, plus: 0.7515, scale: 0.7073 },
202
+ unfilteredPriority: { starter: 0.9018, plus: 0.789, scale: 0.7426 },
203
+ draft: { starter: 0.8103, plus: 0.709, scale: 0.6673 },
204
+ unfilteredDraft: { starter: 0.8508, plus: 0.7444, scale: 0.7006 },
205
+ priorityDraft: { starter: 0.8589, plus: 0.7515, scale: 0.7073 },
206
+ unfilteredPriorityDraft: { starter: 0.9018, plus: 0.789, scale: 0.7426 },
207
207
  },
208
208
  {
209
209
  id: '4k-no-video',
210
- price: { starter: 1.2003, plus: 1.108, scale: 1.0618 },
210
+ price: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
211
211
  label: '4K \xB7 Text to Video',
212
212
  resolution: '4k',
213
213
  task: 't2v',
214
214
  withVideo: !1,
215
- unfiltered: { starter: 1.2603, plus: 1.1634, scale: 1.1148 },
216
- priority: { starter: 1.2723, plus: 1.1744, scale: 1.1255 },
217
- unfilteredPriority: { starter: 1.3359, plus: 1.2332, scale: 1.1816 },
218
- draft: { starter: 1.2003, plus: 1.108, scale: 1.0618 },
219
- unfilteredDraft: { starter: 1.2603, plus: 1.1634, scale: 1.1148 },
220
- priorityDraft: { starter: 1.2723, plus: 1.1744, scale: 1.1255 },
221
- unfilteredPriorityDraft: { starter: 1.3359, plus: 1.2332, scale: 1.1816 },
215
+ unfiltered: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
216
+ priority: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
217
+ unfilteredPriority: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
218
+ draft: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
219
+ unfilteredDraft: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
220
+ priorityDraft: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
221
+ unfilteredPriorityDraft: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
222
+ },
223
+ {
224
+ id: '4k-with-video-extend',
225
+ price: { starter: 0.8105, plus: 0.7092, scale: 0.6673 },
226
+ label: '4K \xB7 Extend \xB7 with reference video',
227
+ resolution: '4k',
228
+ task: 'extend',
229
+ withVideo: !0,
230
+ unfiltered: { starter: 0.851, plus: 0.7446, scale: 0.7006 },
231
+ priority: { starter: 0.8591, plus: 0.7517, scale: 0.7073 },
232
+ unfilteredPriority: { starter: 0.902, plus: 0.7892, scale: 0.7426 },
233
+ draft: { starter: 0.8105, plus: 0.7092, scale: 0.6673 },
234
+ unfilteredDraft: { starter: 0.851, plus: 0.7446, scale: 0.7006 },
235
+ priorityDraft: { starter: 0.8591, plus: 0.7517, scale: 0.7073 },
236
+ unfilteredPriorityDraft: { starter: 0.902, plus: 0.7892, scale: 0.7426 },
237
+ },
238
+ {
239
+ id: '4k-with-video-edit',
240
+ price: { starter: 0.8109, plus: 0.7096, scale: 0.6673 },
241
+ label: '4K \xB7 Edit \xB7 with reference video',
242
+ resolution: '4k',
243
+ task: 'edit',
244
+ withVideo: !0,
245
+ unfiltered: { starter: 0.8514, plus: 0.745, scale: 0.7006 },
246
+ priority: { starter: 0.8595, plus: 0.7521, scale: 0.7073 },
247
+ unfilteredPriority: { starter: 0.9024, plus: 0.7897, scale: 0.7426 },
248
+ draft: { starter: 0.8109, plus: 0.7096, scale: 0.6673 },
249
+ unfilteredDraft: { starter: 0.8514, plus: 0.745, scale: 0.7006 },
250
+ priorityDraft: { starter: 0.8595, plus: 0.7521, scale: 0.7073 },
251
+ unfilteredPriorityDraft: { starter: 0.9024, plus: 0.7897, scale: 0.7426 },
252
+ },
253
+ {
254
+ id: '4k-no-video-i2v',
255
+ price: { starter: 1.3195, plus: 1.1546, scale: 1.0862 },
256
+ label: '4K \xB7 Image to Video',
257
+ resolution: '4k',
258
+ task: 'i2v',
259
+ withVideo: !1,
260
+ unfiltered: { starter: 1.3854, plus: 1.2123, scale: 1.1405 },
261
+ priority: { starter: 1.3986, plus: 1.2238, scale: 1.1513 },
262
+ unfilteredPriority: { starter: 1.4685, plus: 1.285, scale: 1.2089 },
263
+ draft: { starter: 1.3195, plus: 1.1546, scale: 1.0862 },
264
+ unfilteredDraft: { starter: 1.3854, plus: 1.2123, scale: 1.1405 },
265
+ priorityDraft: { starter: 1.3986, plus: 1.2238, scale: 1.1513 },
266
+ unfilteredPriorityDraft: { starter: 1.4685, plus: 1.285, scale: 1.2089 },
267
+ },
268
+ {
269
+ id: '4k-no-video-frames',
270
+ price: { starter: 1.3199, plus: 1.1549, scale: 1.0862 },
271
+ label: '4K \xB7 First & Last Frame',
272
+ resolution: '4k',
273
+ task: 'frames',
274
+ withVideo: !1,
275
+ unfiltered: { starter: 1.3858, plus: 1.2126, scale: 1.1405 },
276
+ priority: { starter: 1.399, plus: 1.2241, scale: 1.1513 },
277
+ unfilteredPriority: { starter: 1.4689, plus: 1.2853, scale: 1.2089 },
278
+ draft: { starter: 1.3199, plus: 1.1549, scale: 1.0862 },
279
+ unfilteredDraft: { starter: 1.3858, plus: 1.2126, scale: 1.1405 },
280
+ priorityDraft: { starter: 1.399, plus: 1.2241, scale: 1.1513 },
281
+ unfilteredPriorityDraft: { starter: 1.4689, plus: 1.2853, scale: 1.2089 },
282
+ },
283
+ {
284
+ id: '4k-no-video-omni',
285
+ price: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
286
+ label: '4K \xB7 Omni Reference',
287
+ resolution: '4k',
288
+ task: 'omni',
289
+ withVideo: !1,
290
+ unfiltered: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
291
+ priority: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
292
+ unfilteredPriority: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
293
+ draft: { starter: 1.319, plus: 1.1541, scale: 1.0862 },
294
+ unfilteredDraft: { starter: 1.3849, plus: 1.2118, scale: 1.1405 },
295
+ priorityDraft: { starter: 1.3981, plus: 1.2233, scale: 1.1513 },
296
+ unfilteredPriorityDraft: { starter: 1.4679, plus: 1.2845, scale: 1.2089 },
222
297
  },
223
298
  {
224
299
  id: '1080p-with-video',
@@ -4552,10 +4627,10 @@ var re,
4552
4627
  ],
4553
4628
  };
4554
4629
  });
4555
- function xe(e, t) {
4630
+ function ve(e, t) {
4556
4631
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
4557
4632
  }
4558
- function di(e, t) {
4633
+ function ci(e, t) {
4559
4634
  if (e === 'seedance-2-mini') return 'mini';
4560
4635
  if (e !== 'seedance-2') return;
4561
4636
  let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -4565,79 +4640,79 @@ function di(e, t) {
4565
4640
  ? 'fast'
4566
4641
  : 'standard';
4567
4642
  }
4568
- function ci(e, t) {
4643
+ function ui(e, t) {
4569
4644
  let i = e
4570
4645
  .trim()
4571
4646
  .toLowerCase()
4572
4647
  .replace(/-(?:unfiltered|uncensored)$/, '');
4573
4648
  if (i === 'seedance-2' || i === 'seedance-2-mini') {
4574
- let n = di(i, t),
4575
- s = we.get(xe('seedance-2', n));
4649
+ let n = ci(i, t),
4650
+ s = ke.get(ve('seedance-2', n));
4576
4651
  return s ? s.slug : null;
4577
4652
  }
4578
- let r = ae.get(i) ?? we.get(xe(i));
4653
+ let r = ae.get(i) ?? ke.get(ve(i));
4579
4654
  return r ? r.slug : null;
4580
4655
  }
4581
- function mi(e, t) {
4582
- return ae.has(e) && !(ui.has(e) && t) ? e : ci(e, t);
4656
+ function fi(e, t) {
4657
+ return ae.has(e) && !(mi.has(e) && t) ? e : ui(e, t);
4583
4658
  }
4584
4659
  function F(e, t) {
4585
- let i = mi(e, t);
4660
+ let i = fi(e, t);
4586
4661
  return i ? (ae.get(i) ?? null) : null;
4587
4662
  }
4588
4663
  function ne() {
4589
- return ve.models;
4664
+ return Ie.models;
4590
4665
  }
4591
- var ve,
4666
+ var Ie,
4592
4667
  ae,
4593
- we,
4594
- Xe,
4595
- pi,
4596
4668
  ke,
4597
- ui,
4669
+ Ze,
4670
+ di,
4671
+ xe,
4672
+ mi,
4598
4673
  V = b(() => {
4599
4674
  'use strict';
4600
- Ye();
4601
4675
  Qe();
4602
- ((ve = {
4676
+ Xe();
4677
+ ((Ie = {
4603
4678
  ...re,
4604
- families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !be(t)) })),
4605
- models: re.models.filter((e) => !be(e.slug)),
4679
+ families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
4680
+ models: re.models.filter((e) => !we(e.slug)),
4606
4681
  }),
4607
4682
  (ae = new Map()),
4608
- (we = new Map()),
4609
- (Xe = new Map()),
4610
- (pi = new Map()),
4611
- (ke = new Map()));
4612
- for (let e of ve.models) {
4613
- (ae.set(e.slug, e), we.set(xe(e.api.model, e.api.quality), e));
4614
- for (let t of e.variants) Xe.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4683
+ (ke = new Map()),
4684
+ (Ze = new Map()),
4685
+ (di = new Map()),
4686
+ (xe = new Map()));
4687
+ for (let e of Ie.models) {
4688
+ (ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
4689
+ for (let t of e.variants) Ze.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4615
4690
  for (let t of e.editVariants ?? [])
4616
- Xe.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4617
- for (let t of e.addons ?? []) pi.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4618
- ke.set(e.slug, e.family);
4691
+ Ze.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4692
+ for (let t of e.addons ?? []) di.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4693
+ xe.set(e.slug, e.family);
4619
4694
  }
4620
- for (let e of ve.families) for (let t of e.models) ke.has(t) || ke.set(t, e.slug);
4621
- ui = new Set(['seedance-2']);
4695
+ for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
4696
+ mi = new Set(['seedance-2']);
4622
4697
  });
4623
4698
  function se(e) {
4624
4699
  let t = e.from?.variant;
4625
4700
  return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
4626
4701
  }
4627
- function Ie(e) {
4702
+ function _e(e) {
4628
4703
  if (e.endpoints?.length)
4629
- return e.editVariants?.length && e.endpoints.some((t) => t.id === Ze)
4630
- ? Ze
4704
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === et)
4705
+ ? et
4631
4706
  : (e.defaultEndpoint ?? e.endpoints[0].id);
4632
4707
  }
4633
- var Ze,
4634
- _e = b(() => {
4708
+ var et,
4709
+ Pe = b(() => {
4635
4710
  'use strict';
4636
4711
  V();
4637
- Ze = 'dynamic';
4712
+ et = 'dynamic';
4638
4713
  });
4639
4714
  var oe,
4640
- Pe = b(() => {
4715
+ Te = b(() => {
4641
4716
  'use strict';
4642
4717
  oe = {
4643
4718
  'gemini-3-8-flash': 'gemini-3.8-flash',
@@ -4647,29 +4722,29 @@ var oe,
4647
4722
  'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
4648
4723
  };
4649
4724
  });
4650
- var et = b(() => {
4725
+ var tt = b(() => {
4651
4726
  'use strict';
4652
4727
  });
4653
- function tt(e, t) {
4654
- return typeof t == 'string' && (fi[e]?.includes(t) ?? !1);
4728
+ function it(e, t) {
4729
+ return typeof t == 'string' && (gi[e]?.includes(t) ?? !1);
4655
4730
  }
4656
- var fi,
4657
- it = b(() => {
4731
+ var gi,
4732
+ rt = b(() => {
4658
4733
  'use strict';
4659
4734
  V();
4660
- _e();
4661
- et();
4662
- fi = {};
4735
+ Pe();
4736
+ tt();
4737
+ gi = {};
4663
4738
  });
4664
- function rt(e) {
4665
- return e === 'nano-banana-pro' ? gi : hi;
4739
+ function at(e) {
4740
+ return e === 'nano-banana-pro' ? hi : yi;
4666
4741
  }
4667
- var gi,
4668
- hi,
4669
- at = b(() => {
4742
+ var hi,
4743
+ yi,
4744
+ nt = b(() => {
4670
4745
  'use strict';
4671
- ((gi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4672
- (hi = [
4746
+ ((hi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4747
+ (yi = [
4673
4748
  'auto',
4674
4749
  '1:1',
4675
4750
  '1:4',
@@ -4687,10 +4762,10 @@ var gi,
4687
4762
  '21:9',
4688
4763
  ]));
4689
4764
  });
4690
- var nt,
4691
- st = b(() => {
4765
+ var st,
4766
+ ot = b(() => {
4692
4767
  'use strict';
4693
- nt = [
4768
+ st = [
4694
4769
  'prompt',
4695
4770
  'system',
4696
4771
  'messages',
@@ -4704,10 +4779,10 @@ var nt,
4704
4779
  'endpoint',
4705
4780
  ];
4706
4781
  });
4707
- var ot,
4708
- lt = b(() => {
4782
+ var lt,
4783
+ pt = b(() => {
4709
4784
  'use strict';
4710
- ot = [
4785
+ lt = [
4711
4786
  {
4712
4787
  slug: 'claude-fable-5-1',
4713
4788
  family: 'fable-5-1',
@@ -4776,13 +4851,13 @@ var ot,
4776
4851
  },
4777
4852
  ];
4778
4853
  });
4779
- function pt(e) {
4854
+ function dt(e) {
4780
4855
  return `$${e}`;
4781
4856
  }
4782
- function Te(e, t, i) {
4857
+ function Me(e, t, i) {
4783
4858
  return F(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
4784
4859
  }
4785
- function yi(e) {
4860
+ function bi(e) {
4786
4861
  return [
4787
4862
  {
4788
4863
  name: 'prompt',
@@ -4848,13 +4923,13 @@ function yi(e) {
4848
4923
  },
4849
4924
  ];
4850
4925
  }
4851
- function dt() {
4926
+ function ct() {
4852
4927
  return Object.fromEntries(
4853
- ot.map((e) => {
4854
- let t = Te(e.slug, 'cheap', 'input'),
4855
- i = Te(e.slug, 'cheap', 'output'),
4856
- r = Te(e.slug, 'stable', 'input') != null,
4857
- n = t != null && i != null ? `${pt(t)}/M in \xB7 ${pt(i)}/M out` : '',
4928
+ lt.map((e) => {
4929
+ let t = Me(e.slug, 'cheap', 'input'),
4930
+ i = Me(e.slug, 'cheap', 'output'),
4931
+ r = Me(e.slug, 'stable', 'input') != null,
4932
+ n = t != null && i != null ? `${dt(t)}/M in \xB7 ${dt(i)}/M out` : '',
4858
4933
  s = {
4859
4934
  slug: e.slug,
4860
4935
  name: e.name,
@@ -4865,20 +4940,20 @@ function dt() {
4865
4940
  priceFormatted: n,
4866
4941
  unit: '/M tokens',
4867
4942
  primaryToolName: 'run_task',
4868
- parameters: yi(r),
4943
+ parameters: bi(r),
4869
4944
  };
4870
4945
  return [e.slug, s];
4871
4946
  }),
4872
4947
  );
4873
4948
  }
4874
- var ct = b(() => {
4949
+ var ut = b(() => {
4875
4950
  'use strict';
4876
- lt();
4951
+ pt();
4877
4952
  V();
4878
4953
  });
4879
4954
  var G,
4880
4955
  le,
4881
- Me = b(() => {
4956
+ Ke = b(() => {
4882
4957
  'use strict';
4883
4958
  ((G = ['seedance-2-5', 'seedance-2', 'seedance-2-mini', 'seedream-5-pro', 'wan-3-0']),
4884
4959
  (le =
@@ -4887,7 +4962,7 @@ var G,
4887
4962
  function J(e) {
4888
4963
  return `$${Number(e.toFixed(5))}`;
4889
4964
  }
4890
- function xi(e) {
4965
+ function vi(e) {
4891
4966
  if (e.kind === 'llm') {
4892
4967
  let t = e.defaultEndpoint,
4893
4968
  i = (s) =>
@@ -4905,14 +4980,14 @@ function xi(e) {
4905
4980
  }
4906
4981
  return `from ${J(se(e).price.starter)}${e.unit}`;
4907
4982
  }
4908
- function vi(e, t) {
4983
+ function Ii(e, t) {
4909
4984
  let i = t.filter((r) => Number.isFinite(r) && r > 0);
4910
4985
  return i.length ? `from ${J(Math.min(...i))}${e}` : null;
4911
4986
  }
4912
- function gt(e) {
4987
+ function ht(e) {
4913
4988
  for (let t of B) {
4914
4989
  let i = de[t],
4915
- r = i ? vi(i.unit, e[t] ?? []) : null;
4990
+ r = i ? Ii(i.unit, e[t] ?? []) : null;
4916
4991
  i && r && (i.priceFormatted = r);
4917
4992
  }
4918
4993
  }
@@ -4928,13 +5003,13 @@ function H(e, t) {
4928
5003
  ...(t ? { description: t } : {}),
4929
5004
  };
4930
5005
  }
4931
- function ht(e) {
5006
+ function yt(e) {
4932
5007
  if (!e.endpoints?.length) return null;
4933
- let t = e.endpoints.filter((i) => tt(e.slug, i.id));
5008
+ let t = e.endpoints.filter((i) => it(e.slug, i.id));
4934
5009
  return {
4935
5010
  name: 'endpoint',
4936
5011
  type: 'select',
4937
- default: Ie(e),
5012
+ default: _e(e),
4938
5013
  options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
4939
5014
  description:
4940
5015
  (e.slug === 'gemini-3.1-pro-preview'
@@ -4943,20 +5018,20 @@ function ht(e) {
4943
5018
  (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
4944
5019
  };
4945
5020
  }
4946
- function Pi(e, t) {
5021
+ function Ti(e, t) {
4947
5022
  if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
4948
5023
  let i = G.includes(e.api.model);
4949
- return [...t.filter((r) => !Ce.has(r.name)), i ? yt : Ii];
5024
+ return [...t.filter((r) => !Ee.has(r.name)), i ? bt : _i];
4950
5025
  }
4951
- function Ke(e, t) {
4952
- let i = e.filter((n) => !Ce.has(n.name)),
4953
- r = [yt, _i];
4954
- return (r.push(bt, wt), [...i, ...r]);
5026
+ function Se(e, t) {
5027
+ let i = e.filter((n) => !Ee.has(n.name)),
5028
+ r = [bt, Pi];
5029
+ return (r.push(wt, kt), [...i, ...r]);
4955
5030
  }
4956
- function ut(e, t = {}) {
5031
+ function mt(e, t = {}) {
4957
5032
  return [
4958
5033
  ...e
4959
- .filter((i) => !Ti.has(i.name) && !Ce.has(i.name))
5034
+ .filter((i) => !Mi.has(i.name) && !Ee.has(i.name))
4960
5035
  .map((i) =>
4961
5036
  i.name === 'prompt'
4962
5037
  ? { ...i, required: !0 }
@@ -4977,11 +5052,11 @@ function ut(e, t = {}) {
4977
5052
  options: ['standard'],
4978
5053
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
4979
5054
  },
4980
- bt,
4981
5055
  wt,
5056
+ kt,
4982
5057
  ];
4983
5058
  }
4984
- function Se(e, t) {
5059
+ function $e(e, t) {
4985
5060
  return [
4986
5061
  $('Text prompt describing the video.'),
4987
5062
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
@@ -5010,8 +5085,8 @@ function Se(e, t) {
5010
5085
  ),
5011
5086
  ];
5012
5087
  }
5013
- function Mi(e) {
5014
- let t = ht(e);
5088
+ function Ki(e) {
5089
+ let t = yt(e);
5015
5090
  return [
5016
5091
  $('Image prompt text. Supports complex composition and text instructions.'),
5017
5092
  ...(t ? [t] : []),
@@ -5024,14 +5099,14 @@ function Mi(e) {
5024
5099
  H(
5025
5100
  e,
5026
5101
  e.slug === 'gpt-image-2'
5027
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ze}`
5102
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${We}`
5028
5103
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
5029
5104
  ),
5030
5105
  {
5031
5106
  name: 'aspect_ratio',
5032
5107
  type: 'select',
5033
5108
  default: 'auto',
5034
- options: [...He],
5109
+ options: [...ze],
5035
5110
  description:
5036
5111
  "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.",
5037
5112
  },
@@ -5078,7 +5153,7 @@ function Mi(e) {
5078
5153
  },
5079
5154
  ];
5080
5155
  }
5081
- function Ki(e) {
5156
+ function Si(e) {
5082
5157
  return [
5083
5158
  $('Image prompt text.'),
5084
5159
  {
@@ -5086,7 +5161,7 @@ function Ki(e) {
5086
5161
  type: 'string[]',
5087
5162
  description: 'Images to edit or use as reference (up to 14).',
5088
5163
  },
5089
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...rt(e.slug)] },
5164
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...at(e.slug)] },
5090
5165
  H(e),
5091
5166
  {
5092
5167
  name: 'n',
@@ -5112,10 +5187,10 @@ function Ki(e) {
5112
5187
  },
5113
5188
  ];
5114
5189
  }
5115
- function Ei() {
5116
- let e = nt,
5190
+ function qi() {
5191
+ let e = st,
5117
5192
  t = [];
5118
- for (let i of kt(!0))
5193
+ for (let i of xt(!0))
5119
5194
  e.includes(i.name) &&
5120
5195
  (t.push({
5121
5196
  ...i,
@@ -5137,7 +5212,7 @@ function Ei() {
5137
5212
  }));
5138
5213
  return t;
5139
5214
  }
5140
- function kt(e) {
5215
+ function xt(e) {
5141
5216
  return [
5142
5217
  $('The user message or task.'),
5143
5218
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -5232,37 +5307,37 @@ function kt(e) {
5232
5307
  },
5233
5308
  ];
5234
5309
  }
5235
- function qi(e) {
5236
- if (e.slug === 'seed-2-1-turbo') return $i;
5237
- let t = ht(e);
5310
+ function Ai(e) {
5311
+ if (e.slug === 'seed-2-1-turbo') return Ci;
5312
+ let t = yt(e);
5238
5313
  return [
5239
5314
  ...(e.slug === 'gemini-3.1-pro-preview'
5240
- ? Ei()
5241
- : e.slug === 'gpt-6-astra' || Ci.includes(e.slug)
5242
- ? kt(e.slug !== 'gpt-6-astra')
5243
- : Si),
5315
+ ? qi()
5316
+ : e.slug === 'gpt-6-astra' || Ei.includes(e.slug)
5317
+ ? xt(e.slug !== 'gpt-6-astra')
5318
+ : $i),
5244
5319
  ...(t ? [t] : []),
5245
5320
  ];
5246
5321
  }
5247
- function Ai(e) {
5322
+ function Ri(e) {
5248
5323
  let t = e.slug;
5249
- if (e.kind === 'llm') return qi(e);
5250
- if (e.editVariants?.length) return Mi(e);
5324
+ if (e.kind === 'llm') return Ai(e);
5325
+ if (e.editVariants?.length) return Ki(e);
5251
5326
  switch (t) {
5252
5327
  case 'seedance-2-5':
5253
- return Ke(mt, t);
5328
+ return Se(ft, t);
5254
5329
  case 'seedance-2-5-lite':
5255
- return ut(mt, { no4k: !0 });
5330
+ return mt(ft, { no4k: !0 });
5256
5331
  case 'seedance-2':
5257
- return Ke(ft, t);
5332
+ return Se(gt, t);
5258
5333
  case 'seedance-2-lite':
5259
- return ut(ft);
5334
+ return mt(gt);
5260
5335
  case 'seedance-2-mini':
5261
- return Ke(Ri, t);
5336
+ return Se(Oi, t);
5262
5337
  case 'nano-banana-2':
5263
5338
  case 'nano-banana-2.1':
5264
5339
  case 'nano-banana-pro':
5265
- return Ki(e);
5340
+ return Si(e);
5266
5341
  case 'seedream-5-pro':
5267
5342
  return [
5268
5343
  $('Detailed description of the image to generate.'),
@@ -5325,7 +5400,7 @@ function Ai(e) {
5325
5400
  ];
5326
5401
  case 'wan-3-0':
5327
5402
  case 'wan-3-0-prime':
5328
- return Se(e, {
5403
+ return $e(e, {
5329
5404
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5330
5405
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
5331
5406
  minSec: 2,
@@ -5335,7 +5410,7 @@ function Ai(e) {
5335
5410
  });
5336
5411
  case 'happy-horse-1-1':
5337
5412
  case 'happy-horse-1-0':
5338
- return Se(e, {
5413
+ return $e(e, {
5339
5414
  modes:
5340
5415
  t === 'happy-horse-1-0'
5341
5416
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -5346,7 +5421,7 @@ function Ai(e) {
5346
5421
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
5347
5422
  });
5348
5423
  case 'minimax-h3':
5349
- return Se(e, {
5424
+ return $e(e, {
5350
5425
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5351
5426
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
5352
5427
  minSec: 4,
@@ -5357,37 +5432,37 @@ function Ai(e) {
5357
5432
  return [$('Prompt text.')];
5358
5433
  }
5359
5434
  }
5360
- function $e(e, t = e.api.model) {
5435
+ function Ce(e, t = e.api.model) {
5361
5436
  return {
5362
5437
  slug: t,
5363
5438
  name: e.name,
5364
- category: bi[e.kind],
5365
- kind: ki[e.kind],
5439
+ category: wi[e.kind],
5440
+ kind: xi[e.kind],
5366
5441
  vendor: e.vendor ?? '',
5367
5442
  description: e.desc ?? e.name,
5368
- priceFormatted: xi(e),
5443
+ priceFormatted: vi(e),
5369
5444
  unit: e.unit,
5370
- primaryToolName: wi[e.kind],
5371
- parameters: Pi(e, Ai(e)),
5445
+ primaryToolName: ki[e.kind],
5446
+ parameters: Ti(e, Ri(e)),
5372
5447
  };
5373
5448
  }
5374
- function Oi() {
5449
+ function Di() {
5375
5450
  let e = {};
5376
5451
  for (let t of ne())
5377
5452
  if (t.slug !== 'seedance-2-fast') {
5378
5453
  if (t.slug === 'seedance-2-mini') {
5379
- e['seedance-2-mini'] = $e(t, 'seedance-2-mini');
5454
+ e['seedance-2-mini'] = Ce(t, 'seedance-2-mini');
5380
5455
  continue;
5381
5456
  }
5382
5457
  if (t.slug === 'seedance-2') {
5383
- let i = $e(t);
5458
+ let i = Ce(t);
5384
5459
  ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
5385
5460
  (e['seedance-2'] = i));
5386
5461
  continue;
5387
5462
  }
5388
- t.slug.startsWith('claude-') || (e[t.api.model] = $e(t));
5463
+ t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
5389
5464
  }
5390
- Object.assign(e, dt());
5465
+ Object.assign(e, ct());
5391
5466
  for (let [t, i] of Object.entries(oe))
5392
5467
  e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
5393
5468
  return e;
@@ -5395,111 +5470,111 @@ function Oi() {
5395
5470
  function N(e) {
5396
5471
  return de[e] ?? null;
5397
5472
  }
5398
- function Di(e, t, i) {
5473
+ function Li(e, t, i) {
5399
5474
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
5400
5475
  let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
5401
5476
  if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
5402
5477
  }
5403
5478
  return !0;
5404
5479
  }
5405
- function It(e, t) {
5480
+ function _t(e, t) {
5406
5481
  let i = { ...t };
5407
5482
  if (e?.slug === 'seedance-2-5') {
5408
5483
  let r = (n) => typeof n != 'string' || !n.trim();
5409
- for (let n of Li) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
5484
+ for (let n of Vi) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
5410
5485
  if (!r(i.finalize)) return i;
5411
5486
  }
5412
5487
  for (let r of e?.parameters ?? [])
5413
5488
  r.default !== void 0 &&
5414
5489
  i[r.name] === void 0 &&
5415
- Di(e.slug, r.name, t) &&
5490
+ Li(e.slug, r.name, t) &&
5416
5491
  (i[r.name] = r.default);
5417
5492
  return i;
5418
5493
  }
5419
5494
  function q() {
5420
5495
  return Object.values(de);
5421
5496
  }
5422
- var bi,
5423
- wi,
5497
+ var wi,
5424
5498
  ki,
5499
+ xi,
5425
5500
  $,
5426
- yt,
5427
- Ii,
5428
- _i,
5429
5501
  bt,
5502
+ _i,
5503
+ Pi,
5430
5504
  wt,
5431
- Ce,
5432
- Ti,
5433
- Si,
5505
+ kt,
5506
+ Ee,
5507
+ Mi,
5434
5508
  $i,
5435
5509
  Ci,
5510
+ Ei,
5436
5511
  pe,
5437
- mt,
5438
- xt,
5439
- vt,
5440
5512
  ft,
5441
- Ri,
5513
+ vt,
5514
+ It,
5515
+ gt,
5516
+ Oi,
5442
5517
  de,
5443
- Li,
5518
+ Vi,
5444
5519
  z = b(() => {
5445
5520
  'use strict';
5446
- We();
5447
- ye();
5521
+ Ye();
5522
+ be();
5448
5523
  V();
5449
- _e();
5450
5524
  Pe();
5451
- it();
5452
- at();
5453
- st();
5454
- ct();
5455
- Me();
5456
- ((bi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5457
- (wi = {
5525
+ Te();
5526
+ rt();
5527
+ nt();
5528
+ ot();
5529
+ ut();
5530
+ Ke();
5531
+ ((wi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5532
+ (ki = {
5458
5533
  video: 'generate_video',
5459
5534
  image: 'generate_image',
5460
5535
  audio: 'generate_audio',
5461
5536
  llm: 'run_task',
5462
5537
  }),
5463
- (ki = {
5538
+ (xi = {
5464
5539
  video: 'Text-to-Video',
5465
5540
  image: 'Text-to-Image',
5466
5541
  audio: 'Text-to-Audio',
5467
5542
  llm: 'Reasoning (LLM)',
5468
5543
  }));
5469
5544
  $ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
5470
- ((yt = {
5545
+ ((bt = {
5471
5546
  name: 'creative_mode',
5472
5547
  type: 'boolean',
5473
5548
  default: !1,
5474
5549
  description:
5475
5550
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
5476
5551
  }),
5477
- (Ii = {
5552
+ (_i = {
5478
5553
  name: 'creative_mode',
5479
5554
  type: 'boolean',
5480
5555
  default: !1,
5481
5556
  description: `Not available yet on this model: ${le}.`,
5482
5557
  }),
5483
- (_i = {
5558
+ (Pi = {
5484
5559
  name: 'priority',
5485
5560
  type: 'boolean',
5486
5561
  default: !1,
5487
5562
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
5488
5563
  }),
5489
- (bt = {
5564
+ (wt = {
5490
5565
  name: 'reference_roles',
5491
5566
  type: 'json',
5492
5567
  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).`,
5493
5568
  }),
5494
- (wt = {
5569
+ (kt = {
5495
5570
  name: 'auto_fit_images',
5496
5571
  type: 'boolean',
5497
5572
  default: !1,
5498
5573
  description:
5499
5574
  '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.',
5500
5575
  }),
5501
- (Ce = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5502
- Ti = new Set([
5576
+ (Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5577
+ Mi = new Set([
5503
5578
  'quality',
5504
5579
  'bitrate_mode',
5505
5580
  'draft',
@@ -5508,7 +5583,7 @@ var bi,
5508
5583
  'draft_generation_id',
5509
5584
  'pass_faces',
5510
5585
  ]);
5511
- ((Si = [
5586
+ (($i = [
5512
5587
  $('The user message or task.'),
5513
5588
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5514
5589
  {
@@ -5526,7 +5601,7 @@ var bi,
5526
5601
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
5527
5602
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
5528
5603
  ]),
5529
- ($i = [
5604
+ (Ci = [
5530
5605
  $('The user message or task.'),
5531
5606
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5532
5607
  {
@@ -5608,9 +5683,9 @@ var bi,
5608
5683
  description: 'Video frames read a second.',
5609
5684
  },
5610
5685
  ]),
5611
- (Ci = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5686
+ (Ei = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5612
5687
  ((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
5613
- (mt = [
5688
+ (ft = [
5614
5689
  {
5615
5690
  name: 'prompt',
5616
5691
  type: 'string',
@@ -5759,19 +5834,19 @@ var bi,
5759
5834
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5760
5835
  },
5761
5836
  ]),
5762
- (xt = {
5837
+ (vt = {
5763
5838
  name: 'images',
5764
5839
  type: 'string[]',
5765
5840
  description:
5766
5841
  '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.',
5767
5842
  }),
5768
- (vt = {
5843
+ (It = {
5769
5844
  name: 'audios',
5770
5845
  type: 'string[]',
5771
5846
  description:
5772
5847
  '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.',
5773
5848
  }),
5774
- (ft = [
5849
+ (gt = [
5775
5850
  {
5776
5851
  name: 'prompt',
5777
5852
  type: 'string',
@@ -5849,8 +5924,8 @@ var bi,
5849
5924
  description:
5850
5925
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
5851
5926
  },
5852
- xt,
5853
5927
  vt,
5928
+ It,
5854
5929
  {
5855
5930
  name: 'first_frame_image',
5856
5931
  type: 'string',
@@ -5871,7 +5946,7 @@ var bi,
5871
5946
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5872
5947
  },
5873
5948
  ]),
5874
- (Ri = [
5949
+ (Oi = [
5875
5950
  {
5876
5951
  name: 'prompt',
5877
5952
  type: 'string',
@@ -5926,8 +6001,8 @@ var bi,
5926
6001
  description:
5927
6002
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
5928
6003
  },
5929
- xt,
5930
6004
  vt,
6005
+ It,
5931
6006
  {
5932
6007
  name: 'first_frame_image',
5933
6008
  type: 'string',
@@ -5942,53 +6017,53 @@ var bi,
5942
6017
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5943
6018
  },
5944
6019
  ]));
5945
- de = Oi();
5946
- Li = ['draft_task_id', 'draft_generation_id'];
6020
+ de = Di();
6021
+ Vi = ['draft_task_id', 'draft_generation_id'];
5947
6022
  });
5948
6023
  function ce(e) {
5949
6024
  let t = '/v1/pricing/models',
5950
6025
  i = e?.trim();
5951
6026
  return i ? `${t}?model=${encodeURIComponent(i)}` : t;
5952
6027
  }
5953
- var qe = b(() => {
6028
+ var Ae = b(() => {
5954
6029
  'use strict';
5955
6030
  });
5956
- function At(e) {
6031
+ function Rt(e) {
5957
6032
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
5958
6033
  }
5959
- function Rt(e) {
6034
+ function Ot(e) {
5960
6035
  let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
5961
6036
  i = t.filter((s) => G.includes(s.api.model)).map((s) => s.name),
5962
6037
  r = t.filter((s) => !G.includes(s.api.model)).map((s) => s.name);
5963
6038
  return [
5964
6039
  ...(i.length
5965
- ? [`${At(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
6040
+ ? [`${Rt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
5966
6041
  : []),
5967
- ...(r.length ? [`Not available yet on ${At(r)}: ${le}.`] : []),
6042
+ ...(r.length ? [`Not available yet on ${Rt(r)}: ${le}.`] : []),
5968
6043
  'The Acceptable Use Policy applies.',
5969
6044
  ].join(' ');
5970
6045
  }
5971
- function or(e) {
5972
- if (nr.has(e.name)) return e;
6046
+ function lr(e) {
6047
+ if (sr.has(e.name)) return e;
5973
6048
  let t = e.inputSchema.properties;
5974
6049
  return !t || t.callback_url
5975
6050
  ? e
5976
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: ar } } };
6051
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: nr } } };
5977
6052
  }
5978
- function lr(e) {
6053
+ function pr(e) {
5979
6054
  let t = e.inputSchema.properties;
5980
6055
  if (!t) return e;
5981
6056
  let i = !1,
5982
6057
  r = {};
5983
6058
  for (let [n, s] of Object.entries(t))
5984
- Ot.has(n) && s.type === 'string' && !s.format
6059
+ Dt.has(n) && s.type === 'string' && !s.format
5985
6060
  ? ((r[n] = { ...s, format: 'uri' }), (i = !0))
5986
- : Ot.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
6061
+ : Dt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
5987
6062
  ? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
5988
6063
  : (r[n] = s);
5989
6064
  return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
5990
6065
  }
5991
- function pr(e) {
6066
+ function dr(e) {
5992
6067
  switch (e.type) {
5993
6068
  case 'string':
5994
6069
  return {
@@ -6043,11 +6118,11 @@ function pr(e) {
6043
6118
  return { type: 'string', description: e.description };
6044
6119
  }
6045
6120
  }
6046
- function dr(e, t) {
6121
+ function cr(e, t) {
6047
6122
  let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
6048
6123
  r = {},
6049
6124
  n = [];
6050
- for (let o of e.parameters) ((r[o.name] = pr(o)), o.required && n.push(o.name));
6125
+ for (let o of e.parameters) ((r[o.name] = dr(o)), o.required && n.push(o.name));
6051
6126
  let s = {
6052
6127
  type: 'object',
6053
6128
  properties: r,
@@ -6060,7 +6135,7 @@ function dr(e, t) {
6060
6135
  inputSchema: s,
6061
6136
  };
6062
6137
  }
6063
- function cr() {
6138
+ function ur() {
6064
6139
  let e = q().filter((d) => d.category === 'Image'),
6065
6140
  t = q().filter((d) => d.category === 'Video'),
6066
6141
  i = q().filter((d) => d.category === 'Text'),
@@ -6156,7 +6231,7 @@ function cr() {
6156
6231
  maximum: 2147483647,
6157
6232
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
6158
6233
  },
6159
- creative_mode: { type: 'boolean', default: !1, description: Rt('image') },
6234
+ creative_mode: { type: 'boolean', default: !1, description: Ot('image') },
6160
6235
  },
6161
6236
  required: ['prompt'],
6162
6237
  additionalProperties: !0,
@@ -6193,7 +6268,7 @@ function cr() {
6193
6268
  default: '480p',
6194
6269
  description: 'Video resolution (the lowest price is the default; see each model tool).',
6195
6270
  },
6196
- creative_mode: { type: 'boolean', default: !1, description: Rt('video') },
6271
+ creative_mode: { type: 'boolean', default: !1, description: Ot('video') },
6197
6272
  priority: {
6198
6273
  type: 'boolean',
6199
6274
  default: !1,
@@ -6315,10 +6390,10 @@ function cr() {
6315
6390
  additionalProperties: !0,
6316
6391
  },
6317
6392
  },
6318
- p = ur();
6319
- return [n, s, o, u, l, p, c, sr];
6393
+ p = mr();
6394
+ return [n, s, o, u, l, p, c, or];
6320
6395
  }
6321
- function ur() {
6396
+ function mr() {
6322
6397
  return {
6323
6398
  name: 'upload_asset',
6324
6399
  description:
@@ -6365,26 +6440,26 @@ function ur() {
6365
6440
  },
6366
6441
  };
6367
6442
  }
6368
- function Ve() {
6369
- let e = cr(),
6370
- t = q().map((i) => dr(i));
6371
- return [...e, ...t].map(or).map(lr);
6443
+ function Ne() {
6444
+ let e = ur(),
6445
+ t = q().map((i) => cr(i));
6446
+ return [...e, ...t].map(lr).map(pr);
6372
6447
  }
6373
- var ar,
6374
- nr,
6448
+ var nr,
6375
6449
  sr,
6376
- Ot,
6377
- Dt = b(() => {
6450
+ or,
6451
+ Dt,
6452
+ Lt = b(() => {
6378
6453
  'use strict';
6379
6454
  V();
6380
- Me();
6455
+ Ke();
6381
6456
  z();
6382
- ((ar = {
6457
+ ((nr = {
6383
6458
  type: 'string',
6384
6459
  description:
6385
6460
  '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.',
6386
6461
  }),
6387
- (nr = new Set([
6462
+ (sr = new Set([
6388
6463
  'upload_asset',
6389
6464
  'upload_media',
6390
6465
  'upload_image',
@@ -6392,7 +6467,7 @@ var ar,
6392
6467
  'check_status',
6393
6468
  'get_pricing',
6394
6469
  ])),
6395
- (sr = {
6470
+ (or = {
6396
6471
  name: 'get_pricing',
6397
6472
  description:
6398
6473
  '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.',
@@ -6407,7 +6482,7 @@ var ar,
6407
6482
  additionalProperties: !1,
6408
6483
  },
6409
6484
  }));
6410
- Ot = new Set([
6485
+ Dt = new Set([
6411
6486
  'image',
6412
6487
  'images',
6413
6488
  'image_url',
@@ -6424,19 +6499,19 @@ var ar,
6424
6499
  'lipsyncing_audio',
6425
6500
  ]);
6426
6501
  });
6427
- var Ht = {};
6428
- ti(Ht, {
6429
- forgetToolSchemas: () => yr,
6430
- jsonRpcAnswer: () => Ut,
6431
- preprocessLocalFiles: () => Gt,
6432
- startStdioServer: () => Jt,
6502
+ var zt = {};
6503
+ ii(zt, {
6504
+ forgetToolSchemas: () => br,
6505
+ jsonRpcAnswer: () => jt,
6506
+ preprocessLocalFiles: () => Jt,
6507
+ startStdioServer: () => Ht,
6433
6508
  });
6434
- function mr(e) {
6509
+ function fr(e) {
6435
6510
  let t = (i) =>
6436
6511
  !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
6437
6512
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
6438
6513
  }
6439
- function Ut(e, t, i) {
6514
+ function jt(e, t, i) {
6440
6515
  let r = e?.id,
6441
6516
  n = r == null,
6442
6517
  s = null;
@@ -6445,7 +6520,7 @@ function Ut(e, t, i) {
6445
6520
  } catch {
6446
6521
  s = null;
6447
6522
  }
6448
- if (s !== null && mr(s)) return n ? null : s;
6523
+ if (s !== null && fr(s)) return n ? null : s;
6449
6524
  if (n) return null;
6450
6525
  if (!i && t >= 200 && t < 300) return;
6451
6526
  let o = s?.error,
@@ -6466,12 +6541,12 @@ function Ut(e, t, i) {
6466
6541
  },
6467
6542
  };
6468
6543
  }
6469
- function fr() {
6544
+ function gr() {
6470
6545
  let e = process.argv.slice(2),
6471
6546
  t = e.indexOf('--api-key');
6472
6547
  return S(t >= 0 ? e[t + 1] : void 0);
6473
6548
  }
6474
- async function jt(e, t, i) {
6549
+ async function Bt(e, t, i) {
6475
6550
  let r = U.default.resolve(e);
6476
6551
  if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
6477
6552
  throw new Error(`File not found: ${e}`);
@@ -6500,15 +6575,15 @@ async function jt(e, t, i) {
6500
6575
  mimeType: c.mime_type || c.mimeType || 'image/png',
6501
6576
  };
6502
6577
  }
6503
- function Bt(e) {
6504
- return gr.has(U.default.extname(e).toLowerCase());
6505
- }
6506
6578
  function Ft(e) {
6579
+ return hr.has(U.default.extname(e).toLowerCase());
6580
+ }
6581
+ function Gt(e) {
6507
6582
  return new Error(
6508
6583
  `Tein uploads image, video and audio files only, and ${U.default.basename(e)} is not one.`,
6509
6584
  );
6510
6585
  }
6511
- function hr(e) {
6586
+ function yr(e) {
6512
6587
  let t = e.trim();
6513
6588
  if (
6514
6589
  !t ||
@@ -6521,7 +6596,7 @@ function hr(e) {
6521
6596
  let i = U.default.resolve(t);
6522
6597
  return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
6523
6598
  }
6524
- function Ue(e) {
6599
+ function je(e) {
6525
6600
  if (Array.isArray(e))
6526
6601
  for (let t of e) {
6527
6602
  let i = t;
@@ -6531,12 +6606,12 @@ function Ue(e) {
6531
6606
  Q.set(i.name, i.inputSchema);
6532
6607
  }
6533
6608
  }
6534
- function yr() {
6535
- (Q.clear(), (Ne = 0));
6609
+ function br() {
6610
+ (Q.clear(), (Ue = 0));
6536
6611
  }
6537
- async function br(e, t) {
6538
- if (!(Date.now() - Ne < 6e4)) {
6539
- Ne = Date.now();
6612
+ async function wr(e, t) {
6613
+ if (!(Date.now() - Ue < 6e4)) {
6614
+ Ue = Date.now();
6540
6615
  try {
6541
6616
  let r = await (
6542
6617
  await fetch(e, {
@@ -6546,39 +6621,39 @@ async function br(e, t) {
6546
6621
  signal: AbortSignal.timeout(1e4),
6547
6622
  })
6548
6623
  ).json();
6549
- Ue(r.result?.tools);
6624
+ je(r.result?.tools);
6550
6625
  } catch {}
6551
6626
  }
6552
6627
  }
6553
- function wr(e) {
6628
+ function kr(e) {
6554
6629
  return e
6555
6630
  ? e.type === 'string'
6556
6631
  ? e.format === 'uri'
6557
6632
  : e.type === 'array' && e.items?.format === 'uri'
6558
6633
  : !1;
6559
6634
  }
6560
- async function Lt(e, t, i) {
6635
+ async function Vt(e, t, i) {
6561
6636
  if (typeof e != 'string') return e;
6562
- let r = hr(e);
6637
+ let r = yr(e);
6563
6638
  if (!r) return e;
6564
- if (!Bt(r)) throw Ft(r);
6565
- return (await jt(r, t, i)).url;
6639
+ if (!Ft(r)) throw Gt(r);
6640
+ return (await Bt(r, t, i)).url;
6566
6641
  }
6567
- async function Gt(e, t, i, r, n) {
6568
- (Q.size === 0 && Ue(Ve()), Q.has(e) || (await br(n, i)));
6642
+ async function Jt(e, t, i, r, n) {
6643
+ (Q.size === 0 && je(Ne()), Q.has(e) || (await wr(n, i)));
6569
6644
  let s = Q.get(e)?.properties;
6570
6645
  if (!s) return t;
6571
6646
  let o = { ...t };
6572
6647
  for (let [u, l] of Object.entries(t))
6573
- if (wr(s[u]))
6648
+ if (kr(s[u]))
6574
6649
  if (Array.isArray(l)) {
6575
6650
  let c = [];
6576
- for (let p of l) c.push(await Lt(p, i, r));
6651
+ for (let p of l) c.push(await Vt(p, i, r));
6577
6652
  o[u] = c;
6578
- } else o[u] = await Lt(l, i, r);
6653
+ } else o[u] = await Vt(l, i, r);
6579
6654
  return o;
6580
6655
  }
6581
- function kr(e) {
6656
+ function xr(e) {
6582
6657
  let t = e.id ?? null;
6583
6658
  switch (e.method) {
6584
6659
  case 'initialize':
@@ -6596,7 +6671,7 @@ function kr(e) {
6596
6671
  case 'ping':
6597
6672
  return { jsonrpc: '2.0', id: t, result: {} };
6598
6673
  case 'tools/list':
6599
- return { jsonrpc: '2.0', id: t, result: { tools: Ve() } };
6674
+ return { jsonrpc: '2.0', id: t, result: { tools: Ne() } };
6600
6675
  case 'tools/call':
6601
6676
  return {
6602
6677
  jsonrpc: '2.0',
@@ -6619,13 +6694,13 @@ function kr(e) {
6619
6694
  };
6620
6695
  }
6621
6696
  }
6622
- async function Jt() {
6623
- if (Vt) return;
6624
- Vt = !0;
6625
- let e = fr(),
6697
+ async function Ht() {
6698
+ if (Nt) return;
6699
+ Nt = !0;
6700
+ let e = gr(),
6626
6701
  t = x(),
6627
6702
  i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
6628
- (Nt.default
6703
+ (Ut.default
6629
6704
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
6630
6705
  .on('line', async (n) => {
6631
6706
  let s = n.trim();
@@ -6686,8 +6761,8 @@ async function Jt() {
6686
6761
  try {
6687
6762
  let d = U.default.resolve(p.trim());
6688
6763
  if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
6689
- if (!Bt(d)) throw Ft(d);
6690
- let m = await jt(d, e, t),
6764
+ if (!Ft(d)) throw Gt(d);
6765
+ let m = await Bt(d, e, t),
6691
6766
  h = (m.sizeBytes / 1024).toFixed(1),
6692
6767
  ue =
6693
6768
  m.mimeType.startsWith('image/') ||
@@ -6743,7 +6818,7 @@ Pass this URL to any Tein generation tool.`,
6743
6818
  }
6744
6819
  if (e)
6745
6820
  try {
6746
- o.params.arguments = await Gt(String(l), c, e, t, i);
6821
+ o.params.arguments = await Jt(String(l), c, e, t, i);
6747
6822
  } catch (p) {
6748
6823
  let d = p instanceof Error ? p.message : String(p);
6749
6824
  process.stdout.write(
@@ -6774,10 +6849,10 @@ Pass this URL to any Tein generation tool.`,
6774
6849
  body: JSON.stringify(o),
6775
6850
  }),
6776
6851
  c = await l.text(),
6777
- p = Ut(o, l.status, c);
6852
+ p = jt(o, l.status, c);
6778
6853
  if (p === null) return;
6779
6854
  if (p) {
6780
- (o?.method === 'tools/list' && Ue(p.result?.tools),
6855
+ (o?.method === 'tools/list' && je(p.result?.tools),
6781
6856
  process.stdout.write(
6782
6857
  JSON.stringify(p) +
6783
6858
  `
@@ -6786,7 +6861,7 @@ Pass this URL to any Tein generation tool.`,
6786
6861
  return;
6787
6862
  }
6788
6863
  } catch {}
6789
- let u = kr(o);
6864
+ let u = xr(o);
6790
6865
  u !== null &&
6791
6866
  process.stdout.write(
6792
6867
  JSON.stringify(u) +
@@ -6811,20 +6886,20 @@ Pass this URL to any Tein generation tool.`,
6811
6886
  }
6812
6887
  var R,
6813
6888
  U,
6814
- Nt,
6815
- gr,
6889
+ Ut,
6890
+ hr,
6816
6891
  Q,
6817
- Ne,
6818
- Vt,
6819
- zt = b(() => {
6892
+ Ue,
6893
+ Nt,
6894
+ Wt = b(() => {
6820
6895
  'use strict';
6821
6896
  ((R = I(require('node:fs'))),
6822
6897
  (U = I(require('node:path'))),
6823
- (Nt = I(require('node:readline'))));
6824
- qe();
6825
- Dt();
6898
+ (Ut = I(require('node:readline'))));
6899
+ Ae();
6900
+ Lt();
6826
6901
  E();
6827
- gr = new Set([
6902
+ hr = new Set([
6828
6903
  '.png',
6829
6904
  '.jpg',
6830
6905
  '.jpeg',
@@ -6850,20 +6925,20 @@ var R,
6850
6925
  '.flac',
6851
6926
  '.opus',
6852
6927
  ]);
6853
- ((Q = new Map()), (Ne = 0));
6854
- Vt = !1;
6928
+ ((Q = new Map()), (Ue = 0));
6929
+ Nt = !1;
6855
6930
  require.main === module &&
6856
- Jt().catch((e) => {
6931
+ Ht().catch((e) => {
6857
6932
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
6858
6933
  `),
6859
6934
  process.exit(1));
6860
6935
  });
6861
6936
  });
6862
- var ri =
6937
+ var ai =
6863
6938
  !process.env.NO_COLOR &&
6864
6939
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
6865
6940
  function w(e, t) {
6866
- return (i) => (ri ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
6941
+ return (i) => (ai ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
6867
6942
  }
6868
6943
  var a = {
6869
6944
  bold: w(1, 22),
@@ -6950,10 +7025,10 @@ var a = {
6950
7025
  var O = I(require('node:fs')),
6951
7026
  A = I(require('node:path'));
6952
7027
  var ee = I(require('node:fs')),
6953
- Fe = I(require('node:path')),
6954
- Ge = require('node:stream/promises');
7028
+ Ge = I(require('node:path')),
7029
+ Je = require('node:stream/promises');
6955
7030
  var Z = '1.1.7';
6956
- var ai = new Set([
7031
+ var ni = new Set([
6957
7032
  'account_suspended',
6958
7033
  'account_terminated',
6959
7034
  'creative_mode_restricted',
@@ -6961,7 +7036,7 @@ var ai = new Set([
6961
7036
  'workspace_paused',
6962
7037
  ]),
6963
7038
  _ = 1,
6964
- ni = 3,
7039
+ si = 3,
6965
7040
  k = class extends Error {
6966
7041
  constructor(t, i, r, n = {}) {
6967
7042
  (super(i),
@@ -6971,10 +7046,10 @@ var ai = new Set([
6971
7046
  (this.fields = n));
6972
7047
  }
6973
7048
  get exitCode() {
6974
- return this.code && ai.has(this.code) ? ni : _;
7049
+ return this.code && ni.has(this.code) ? si : _;
6975
7050
  }
6976
7051
  };
6977
- function si(e, t, i) {
7052
+ function oi(e, t, i) {
6978
7053
  let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
6979
7054
  if (!i || typeof i != 'object') return new k(e, r);
6980
7055
  let n = i;
@@ -6987,13 +7062,13 @@ function si(e, t, i) {
6987
7062
  c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
6988
7063
  return new k(e, c, typeof o == 'string' ? o : void 0, l);
6989
7064
  }
6990
- function je(e) {
7065
+ function Be(e) {
6991
7066
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
6992
7067
  }
6993
7068
  function K(e) {
6994
7069
  let t = [e.message],
6995
- i = je(e.fields.required),
6996
- r = je(e.fields.balance);
7070
+ i = Be(e.fields.required),
7071
+ r = Be(e.fields.balance);
6997
7072
  (i || r) &&
6998
7073
  t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
6999
7074
  let n = e.fields.org_name ?? e.fields.orgName;
@@ -7001,19 +7076,19 @@ function K(e) {
7001
7076
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
7002
7077
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
7003
7078
  }
7004
- function oi(e) {
7079
+ function li(e) {
7005
7080
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
7006
7081
  ? 'video'
7007
7082
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
7008
7083
  ? 'audio'
7009
7084
  : 'image';
7010
7085
  }
7011
- function Be(e) {
7086
+ function Fe(e) {
7012
7087
  let t = [];
7013
7088
  for (let i of e.data ?? [])
7014
7089
  typeof i.message?.content == 'string'
7015
7090
  ? t.push({ type: 'text', text: i.message.content })
7016
- : i.url && t.push({ type: oi(i.url), url: i.url });
7091
+ : i.url && t.push({ type: li(i.url), url: i.url });
7017
7092
  return t;
7018
7093
  }
7019
7094
  var M = class {
@@ -7039,7 +7114,7 @@ var M = class {
7039
7114
  try {
7040
7115
  s = await n.json();
7041
7116
  } catch {}
7042
- throw si(n.status, n.statusText, s);
7117
+ throw oi(n.status, n.statusText, s);
7043
7118
  }
7044
7119
  return await n.json();
7045
7120
  }
@@ -7053,7 +7128,7 @@ var M = class {
7053
7128
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
7054
7129
  ? n
7055
7130
  : 'processing',
7056
- o = Be(r);
7131
+ o = Fe(r);
7057
7132
  return {
7058
7133
  request_id: r.request_id || r.id || '',
7059
7134
  model: r.model,
@@ -7071,7 +7146,7 @@ var M = class {
7071
7146
  r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
7072
7147
  ? r
7073
7148
  : 'processing',
7074
- s = Be(i),
7149
+ s = Fe(i),
7075
7150
  o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
7076
7151
  return {
7077
7152
  request_id: i.id || t,
@@ -7089,37 +7164,45 @@ var M = class {
7089
7164
  async downloadOutput(t, i) {
7090
7165
  let r = await fetch(t);
7091
7166
  if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
7092
- let n = Fe.default.dirname(i);
7167
+ let n = Ge.default.dirname(i);
7093
7168
  ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
7094
7169
  let s = ee.default.createWriteStream(i);
7095
- return (await (0, Ge.pipeline)(r.body, s), i);
7170
+ return (await (0, Je.pipeline)(r.body, s), i);
7096
7171
  }
7097
7172
  };
7098
7173
  E();
7099
- z();
7100
- var _t = ['images', 'input_images', 'videos', 'audios'];
7101
- function Vi(e) {
7102
- for (let t of _t) typeof e[t] == 'string' && (e[t] = [e[t]]);
7174
+ function ye(e) {
7175
+ if (typeof e != 'number' || !Number.isFinite(e)) return '';
7176
+ if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
7177
+ let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
7178
+ i = 10 ** t,
7179
+ r = Math.round(Number((e * i).toFixed(6))) / i;
7180
+ return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
7103
7181
  }
7182
+ z();
7183
+ var Pt = ['images', 'input_images', 'videos', 'audios'];
7104
7184
  function Ni(e) {
7185
+ for (let t of Pt) typeof e[t] == 'string' && (e[t] = [e[t]]);
7186
+ }
7187
+ function Ui(e) {
7105
7188
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
7106
7189
  let t = A.default.resolve(e);
7107
7190
  return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
7108
7191
  }
7109
- async function Ui(e, t) {
7110
- for (let i of _t) {
7192
+ async function ji(e, t) {
7193
+ for (let i of Pt) {
7111
7194
  if (!Array.isArray(e[i])) continue;
7112
7195
  let r = [];
7113
7196
  for (let n of e[i]) {
7114
7197
  if (typeof n != 'string') continue;
7115
- let s = Ni(n);
7198
+ let s = Ui(n);
7116
7199
  r.push(s ? await t(s) : n);
7117
7200
  }
7118
7201
  e[i] = r;
7119
7202
  }
7120
7203
  }
7121
7204
  var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
7122
- function ji(e) {
7205
+ function Bi(e) {
7123
7206
  if (e.count === void 0 || e.count === !0) return 1;
7124
7207
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
7125
7208
  i = W.enterprise;
@@ -7132,7 +7215,7 @@ function ji(e) {
7132
7215
  t
7133
7216
  );
7134
7217
  }
7135
- async function Bi(e, t, i, r, n) {
7218
+ async function Fi(e, t, i, r, n) {
7136
7219
  n.isJson ||
7137
7220
  process.stderr.write(`Starting ${r} ${t} jobs together...
7138
7221
  `);
@@ -7194,7 +7277,7 @@ async function Bi(e, t, i, r, n) {
7194
7277
  else {
7195
7278
  for (let l of o)
7196
7279
  (process.stdout.write(`${l.request_id} ${l.status}`),
7197
- l.usage?.cost !== void 0 && process.stdout.write(` $${l.usage.cost.toFixed(4)}`),
7280
+ l.usage?.cost !== void 0 && process.stdout.write(` ${ye(l.usage.cost)}`),
7198
7281
  l.error && process.stdout.write(` ${l.error}`),
7199
7282
  process.stdout.write(`
7200
7283
  `));
@@ -7207,7 +7290,7 @@ async function Bi(e, t, i, r, n) {
7207
7290
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
7208
7291
  process.exit(_);
7209
7292
  }
7210
- function Pt(e) {
7293
+ function Tt(e) {
7211
7294
  let t = {},
7212
7295
  i = new Set(),
7213
7296
  r = [];
@@ -7252,7 +7335,7 @@ function Pt(e) {
7252
7335
  }
7253
7336
  return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
7254
7337
  }
7255
- async function Ee(e, t) {
7338
+ async function qe(e, t) {
7256
7339
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
7257
7340
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
7258
7341
  (i ||
@@ -7274,7 +7357,7 @@ async function Ee(e, t) {
7274
7357
  s = !!t.json,
7275
7358
  o = !!(t.async || t.no_wait),
7276
7359
  u = typeof t.output == 'string' ? t.output : void 0,
7277
- l = ji(t),
7360
+ l = Bi(t),
7278
7361
  c = { ...t };
7279
7362
  (delete c.json,
7280
7363
  delete c.async,
@@ -7283,8 +7366,8 @@ async function Ee(e, t) {
7283
7366
  delete c.api_key,
7284
7367
  delete c.api_url,
7285
7368
  delete c.count);
7286
- let p = It(n, c);
7287
- (Vi(p),
7369
+ let p = _t(n, c);
7370
+ (Ni(p),
7288
7371
  typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
7289
7372
  p.image_url &&
7290
7373
  !p.first_frame_image &&
@@ -7317,7 +7400,7 @@ async function Ee(e, t) {
7317
7400
  }
7318
7401
  }
7319
7402
  }
7320
- await Ui(p, async (y) => {
7403
+ await ji(p, async (y) => {
7321
7404
  let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
7322
7405
  s || f.start();
7323
7406
  try {
@@ -7341,7 +7424,7 @@ async function Ee(e, t) {
7341
7424
  let g;
7342
7425
  try {
7343
7426
  if (l > 1) {
7344
- await Bi(d, e, p, l, { isJson: s, isAsync: o });
7427
+ await Fi(d, e, p, l, { isJson: s, isAsync: o });
7345
7428
  return;
7346
7429
  }
7347
7430
  g = await d.queueJob(e, p);
@@ -7426,7 +7509,7 @@ async function Ee(e, t) {
7426
7509
  process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
7427
7510
  `),
7428
7511
  g.usage?.cost !== void 0 &&
7429
- process.stdout.write(` ${a.bold('Cost:')} $${g.usage.cost.toFixed(4)}
7512
+ process.stdout.write(` ${a.bold('Cost:')} ${ye(g.usage.cost)}
7430
7513
  `),
7431
7514
  g.output && g.output.length > 0)
7432
7515
  ) {
@@ -7459,9 +7542,9 @@ ${f.text}
7459
7542
  process.stdout.write(`
7460
7543
  `);
7461
7544
  }
7462
- var Tt = I(require('node:readline'));
7545
+ var Mt = I(require('node:readline'));
7463
7546
  E();
7464
- async function Fi(e) {
7547
+ async function Gi(e) {
7465
7548
  try {
7466
7549
  return (await new M(e, x()).checkKey(), 'ok');
7467
7550
  } catch (t) {
@@ -7472,8 +7555,8 @@ async function Fi(e) {
7472
7555
  return 'unchecked';
7473
7556
  }
7474
7557
  }
7475
- function Gi(e) {
7476
- let t = Tt.default.createInterface({ input: process.stdin, output: process.stdout });
7558
+ function Ji(e) {
7559
+ let t = Mt.default.createInterface({ input: process.stdin, output: process.stdout });
7477
7560
  return new Promise((i) => {
7478
7561
  t.question(e, (r) => {
7479
7562
  (t.close(), i(r.trim()));
@@ -7492,14 +7575,14 @@ ${a.bold('Tein AI Authentication')}
7492
7575
  process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
7493
7576
 
7494
7577
  `),
7495
- (i = await Gi('Enter your Tein API Key (sk_live_...): '))),
7578
+ (i = await Ji('Enter your Tein API Key (sk_live_...): '))),
7496
7579
  !i.startsWith('sk_live_') &&
7497
7580
  !i.startsWith('sk_test_') &&
7498
7581
  (process.stderr
7499
7582
  .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
7500
7583
  `),
7501
7584
  process.exit(1)));
7502
- let r = await Fi(i);
7585
+ let r = await Gi(i);
7503
7586
  (r === 'invalid' &&
7504
7587
  (process.stderr
7505
7588
  .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
@@ -7569,12 +7652,12 @@ ${a.bold('Tein AI CLI Configuration')}
7569
7652
  }
7570
7653
  }
7571
7654
  E();
7572
- ye();
7655
+ be();
7573
7656
  z();
7574
- var Ji = 3e3;
7575
- async function Mt(e) {
7657
+ var Hi = 3e3;
7658
+ async function Kt(e) {
7576
7659
  try {
7577
- let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Ji) });
7660
+ let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Hi) });
7578
7661
  if (!t.ok) return;
7579
7662
  let i = await t.json(),
7580
7663
  r = {};
@@ -7582,18 +7665,18 @@ async function Mt(e) {
7582
7665
  let s = String(n.modelSlug ?? '');
7583
7666
  B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
7584
7667
  }
7585
- gt(r);
7668
+ ht(r);
7586
7669
  } catch {}
7587
7670
  }
7588
- var Hi = new Set(['video', 'image', 'text', 'audio', '3d']),
7589
- zi = { llm: 'text', chat: 'text', reasoning: 'text' };
7590
- async function Kt(e, t) {
7591
- await Mt(t);
7671
+ var zi = new Set(['video', 'image', 'text', 'audio', '3d']),
7672
+ Wi = { llm: 'text', chat: 'text', reasoning: 'text' };
7673
+ async function St(e, t) {
7674
+ await Kt(t);
7592
7675
  let i = q();
7593
7676
  if (e) {
7594
7677
  let s = e.toLowerCase(),
7595
- o = zi[s] ?? s;
7596
- i = Hi.has(o)
7678
+ o = Wi[s] ?? s;
7679
+ i = zi.has(o)
7597
7680
  ? i.filter((u) => u.category.toLowerCase() === o)
7598
7681
  : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
7599
7682
  }
@@ -7631,8 +7714,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
7631
7714
 
7632
7715
  `);
7633
7716
  }
7634
- async function St(e, t) {
7635
- B.has(e) && (await Mt(t));
7717
+ async function $t(e, t) {
7718
+ B.has(e) && (await Kt(t));
7636
7719
  let i = N(e);
7637
7720
  (i ||
7638
7721
  (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
@@ -7713,9 +7796,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
7713
7796
  `);
7714
7797
  }
7715
7798
  E();
7716
- qe();
7717
- var Wi = 1e4,
7718
- Re = {
7799
+ Ae();
7800
+ var Yi = 1e4,
7801
+ Oe = {
7719
7802
  price: '',
7720
7803
  creativeMode: 'Creative mode',
7721
7804
  priority: 'Priority',
@@ -7725,22 +7808,22 @@ var Wi = 1e4,
7725
7808
  priorityDraft: 'Priority + Draft',
7726
7809
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
7727
7810
  },
7728
- Yi = Object.keys(Re),
7729
- Qi = {
7811
+ Qi = Object.keys(Oe),
7812
+ Xi = {
7730
7813
  creativeMode: 'unfiltered',
7731
7814
  creativeModePriority: 'unfilteredPriority',
7732
7815
  creativeModeDraft: 'unfilteredDraft',
7733
7816
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
7734
7817
  };
7735
- function Xi(e, t) {
7736
- let i = Qi[t];
7818
+ function Zi(e, t) {
7819
+ let i = Xi[t];
7737
7820
  return e[t] ?? (i ? e[i] : void 0);
7738
7821
  }
7739
- async function Zi(e, t) {
7822
+ async function er(e, t) {
7740
7823
  let i = `${x(e)}${ce(t)}`,
7741
7824
  r;
7742
7825
  try {
7743
- r = await fetch(i, { signal: AbortSignal.timeout(Wi) });
7826
+ r = await fetch(i, { signal: AbortSignal.timeout(Yi) });
7744
7827
  } catch {
7745
7828
  throw new Error(`Could not reach ${i}`);
7746
7829
  }
@@ -7756,18 +7839,18 @@ async function Zi(e, t) {
7756
7839
  }
7757
7840
  return n;
7758
7841
  }
7759
- function Ae(e) {
7842
+ function Re(e) {
7760
7843
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
7761
7844
  [i, r = ''] = t.split('.');
7762
7845
  return `$${i}.${r.padEnd(2, '0')}`;
7763
7846
  }
7764
- function Oe(e) {
7847
+ function De(e) {
7765
7848
  if (!e || typeof e.starter != 'number') return null;
7766
7849
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
7767
7850
  i = typeof e.scale == 'number' ? e.scale : t;
7768
- return `Starter ${Ae(e.starter)} Plus ${Ae(t)} Scale ${Ae(i)}`;
7851
+ return `Starter ${Re(e.starter)} Plus ${Re(t)} Scale ${Re(i)}`;
7769
7852
  }
7770
- function er(e) {
7853
+ function tr(e) {
7771
7854
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
7772
7855
  let t = [];
7773
7856
  for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -7779,33 +7862,33 @@ function er(e) {
7779
7862
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
7780
7863
  );
7781
7864
  }
7782
- function tr(e, t) {
7783
- let i = er(e);
7784
- for (let r of Yi) {
7785
- let n = Oe(Xi(e, r));
7865
+ function ir(e, t) {
7866
+ let i = tr(e);
7867
+ for (let r of Qi) {
7868
+ let n = De(Zi(e, r));
7786
7869
  if (!n) continue;
7787
- let s = Re[r] ? ` (${Re[r]})` : '';
7870
+ let s = Oe[r] ? ` (${Oe[r]})` : '';
7788
7871
  t.push(` ${i}${s} ${n}`);
7789
7872
  }
7790
7873
  }
7791
- function ir(e, t) {
7874
+ function rr(e, t) {
7792
7875
  let i = e.quality ? ` quality=${e.quality}` : '';
7793
7876
  t.push(
7794
7877
  ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
7795
7878
  );
7796
- for (let n of e.variants ?? []) tr(n, t);
7879
+ for (let n of e.variants ?? []) ir(n, t);
7797
7880
  let r = e.addons;
7798
7881
  if (Array.isArray(r))
7799
7882
  for (let n of r) {
7800
7883
  if (!n || typeof n != 'object') continue;
7801
7884
  let s = n,
7802
7885
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
7803
- u = Oe(s.price);
7886
+ u = De(s.price);
7804
7887
  u && t.push(` ${o} (add-on) ${u}`);
7805
7888
  }
7806
7889
  t.push('');
7807
7890
  }
7808
- function rr(e) {
7891
+ function ar(e) {
7809
7892
  let t = [],
7810
7893
  i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
7811
7894
  (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
@@ -7827,7 +7910,7 @@ function rr(e) {
7827
7910
  });
7828
7911
  for (let l of s) {
7829
7912
  t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
7830
- for (let c of r.get(l) ?? []) ir(c, t);
7913
+ for (let c of r.get(l) ?? []) rr(c, t);
7831
7914
  }
7832
7915
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
7833
7916
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -7844,7 +7927,7 @@ function rr(e) {
7844
7927
  t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
7845
7928
  for (let m of p) {
7846
7929
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
7847
- g = Oe(m.prices);
7930
+ g = De(m.prices);
7848
7931
  g && t.push(` ${h} ${g}`);
7849
7932
  }
7850
7933
  t.push('');
@@ -7857,10 +7940,10 @@ function rr(e) {
7857
7940
  `
7858
7941
  );
7859
7942
  }
7860
- async function $t(e) {
7943
+ async function Ct(e) {
7861
7944
  let t;
7862
7945
  try {
7863
- t = await Zi(e.apiUrl, e.model);
7946
+ t = await er(e.apiUrl, e.model);
7864
7947
  } catch (i) {
7865
7948
  let r = i instanceof Error ? i.message : String(i);
7866
7949
  (process.stderr.write(`${a.red('Error:')} ${r}
@@ -7871,12 +7954,12 @@ async function $t(e) {
7871
7954
  e.json
7872
7955
  ? `${JSON.stringify(t, null, 2)}
7873
7956
  `
7874
- : rr(t),
7957
+ : ar(t),
7875
7958
  );
7876
7959
  }
7877
- var Ct = I(require('node:path'));
7960
+ var Et = I(require('node:path'));
7878
7961
  E();
7879
- async function Et(e, t) {
7962
+ async function qt(e, t) {
7880
7963
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
7881
7964
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
7882
7965
  (i ||
@@ -7971,7 +8054,7 @@ ${a.bold('Outputs:')}
7971
8054
  ) {
7972
8055
  let d = new T(`Downloading output to ${o}...`).start();
7973
8056
  try {
7974
- (await u.downloadOutput(p.url, Ct.default.resolve(process.cwd(), o)),
8057
+ (await u.downloadOutput(p.url, Et.default.resolve(process.cwd(), o)),
7975
8058
  d.succeed(`Saved to ${a.bold(o)}`));
7976
8059
  } catch (m) {
7977
8060
  d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -7986,10 +8069,10 @@ ${p.text}
7986
8069
  process.stdout.write(`
7987
8070
  `);
7988
8071
  }
7989
- var De = I(require('node:fs')),
7990
- Le = I(require('node:path'));
8072
+ var Le = I(require('node:fs')),
8073
+ Ve = I(require('node:path'));
7991
8074
  E();
7992
- async function qt(e, t = {}) {
8075
+ async function At(e, t = {}) {
7993
8076
  let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
7994
8077
  r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
7995
8078
  n = !!t.json;
@@ -8006,13 +8089,13 @@ async function qt(e, t = {}) {
8006
8089
  process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
8007
8090
  `),
8008
8091
  process.exit(1)));
8009
- let s = Le.default.resolve(e);
8010
- De.default.existsSync(s) ||
8092
+ let s = Ve.default.resolve(e);
8093
+ Le.default.existsSync(s) ||
8011
8094
  (process.stderr.write(`${a.red('Error:')} File not found: ${s}
8012
8095
  `),
8013
8096
  process.exit(1));
8014
- let o = Le.default.basename(s),
8015
- l = De.default.readFileSync(s).toString('base64'),
8097
+ let o = Ve.default.basename(s),
8098
+ l = Le.default.readFileSync(s).toString('base64'),
8016
8099
  c = new M(i, r),
8017
8100
  p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
8018
8101
  n || p.start();
@@ -8054,8 +8137,8 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
8054
8137
  }
8055
8138
  }
8056
8139
  z();
8057
- Pe();
8058
- function Wt() {
8140
+ Te();
8141
+ function Yt() {
8059
8142
  process.stdout.write(`
8060
8143
  ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
8061
8144
 
@@ -8115,11 +8198,11 @@ ${a.bold('EXAMPLES:')}
8115
8198
 
8116
8199
  `);
8117
8200
  }
8118
- async function xr() {
8201
+ async function vr() {
8119
8202
  let e = process.argv.slice(2),
8120
- t = Pt(e);
8203
+ t = Tt(e);
8121
8204
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
8122
- Wt();
8205
+ Yt();
8123
8206
  return;
8124
8207
  }
8125
8208
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -8146,14 +8229,14 @@ async function xr() {
8146
8229
  }
8147
8230
  case 'models':
8148
8231
  case 'list': {
8149
- await Kt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8232
+ await St(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8150
8233
  break;
8151
8234
  }
8152
8235
  case 'pricing':
8153
8236
  case 'prices': {
8154
8237
  let i = t.options.model,
8155
8238
  r = t.subcommand || (typeof i == 'string' ? i : void 0);
8156
- await $t({
8239
+ await Ct({
8157
8240
  model: r,
8158
8241
  json: !!t.options.json,
8159
8242
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
@@ -8168,27 +8251,27 @@ async function xr() {
8168
8251
  process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
8169
8252
  `),
8170
8253
  process.exit(1)),
8171
- await St(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8254
+ await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8172
8255
  break;
8173
8256
  }
8174
8257
  case 'upload': {
8175
8258
  let i = t.subcommand || '';
8176
- await qt(i, t.options);
8259
+ await At(i, t.options);
8177
8260
  break;
8178
8261
  }
8179
8262
  case 'run':
8180
8263
  case 'generate': {
8181
8264
  let i = t.subcommand || '';
8182
- await Ee(i, t.options);
8265
+ await qe(i, t.options);
8183
8266
  break;
8184
8267
  }
8185
8268
  case 'status': {
8186
8269
  let i = t.subcommand || '';
8187
- await Et(i, t.options);
8270
+ await qt(i, t.options);
8188
8271
  break;
8189
8272
  }
8190
8273
  case 'mcp': {
8191
- let { startStdioServer: i } = await Promise.resolve().then(() => (zt(), Ht));
8274
+ let { startStdioServer: i } = await Promise.resolve().then(() => (Wt(), zt));
8192
8275
  await i();
8193
8276
  break;
8194
8277
  }
@@ -8201,15 +8284,15 @@ ${a.red('Error:')} Unknown command or model "${t.command}".
8201
8284
  Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
8202
8285
  `),
8203
8286
  process.exit(_)),
8204
- await Ee(t.command, t.options));
8287
+ await qe(t.command, t.options));
8205
8288
  return;
8206
8289
  }
8207
- Wt();
8290
+ Yt();
8208
8291
  break;
8209
8292
  }
8210
8293
  }
8211
8294
  }
8212
- xr().catch((e) => {
8295
+ vr().catch((e) => {
8213
8296
  (e instanceof k &&
8214
8297
  (process.stderr.write(`
8215
8298
  ${a.red('Error:')} ${K(e).join(`