@teinai/cli 1.1.27 → 1.1.29

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 +1541 -903
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,50 +1,50 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var gr = Object.create;
4
- var xe = Object.defineProperty;
5
- var hr = Object.getOwnPropertyDescriptor;
6
- var yr = Object.getOwnPropertyNames;
7
- var br = Object.getPrototypeOf,
8
- kr = Object.prototype.hasOwnProperty;
3
+ var Tr = Object.create;
4
+ var Pe = Object.defineProperty;
5
+ var Mr = Object.getOwnPropertyDescriptor;
6
+ var Kr = Object.getOwnPropertyNames;
7
+ var Sr = Object.getPrototypeOf,
8
+ Er = Object.prototype.hasOwnProperty;
9
9
  var y = (e, t, r) => () => {
10
10
  if (r) throw r[0];
11
11
  try {
12
12
  return (e && (t = e((e = 0))), t);
13
- } catch (a) {
14
- throw ((r = [a]), a);
13
+ } catch (i) {
14
+ throw ((r = [i]), i);
15
15
  }
16
16
  };
17
- var wr = (e, t) => {
18
- for (var r in t) xe(e, r, { get: t[r], enumerable: !0 });
17
+ var Cr = (e, t) => {
18
+ for (var r in t) Pe(e, r, { get: t[r], enumerable: !0 });
19
19
  },
20
- xr = (e, t, r, a) => {
20
+ $r = (e, t, r, i) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of yr(t))
23
- !kr.call(e, n) &&
22
+ for (let n of Kr(t))
23
+ !Er.call(e, n) &&
24
24
  n !== r &&
25
- xe(e, n, { get: () => t[n], enumerable: !(a = hr(t, n)) || a.enumerable });
25
+ Pe(e, n, { get: () => t[n], enumerable: !(i = Mr(t, n)) || i.enumerable });
26
26
  return e;
27
27
  };
28
- var _ = (e, t, r) => (
29
- (r = e != null ? gr(br(e)) : {}),
30
- xr(t || !e || !e.__esModule ? xe(r, 'default', { value: e, enumerable: !0 }) : r, e)
28
+ var I = (e, t, r) => (
29
+ (r = e != null ? Tr(Sr(e)) : {}),
30
+ $r(t || !e || !e.__esModule ? Pe(r, 'default', { value: e, enumerable: !0 }) : r, e)
31
31
  );
32
- function V() {
32
+ function F() {
33
33
  try {
34
- if ($.default.existsSync(U)) {
35
- let e = $.default.readFileSync(U, 'utf-8');
34
+ if (q.default.existsSync(U)) {
35
+ let e = q.default.readFileSync(U, 'utf-8');
36
36
  return JSON.parse(e);
37
37
  }
38
38
  } catch {}
39
39
  return {};
40
40
  }
41
- function Ie(e) {
41
+ function ve(e) {
42
42
  try {
43
- $.default.existsSync(ae) || $.default.mkdirSync(ae, { recursive: !0, mode: 448 });
44
- let r = { ...V(), ...e };
45
- ($.default.writeFileSync(U, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
46
- $.default.chmodSync(ae, 448),
47
- $.default.chmodSync(U, 384));
43
+ q.default.existsSync(ae) || q.default.mkdirSync(ae, { recursive: !0, mode: 448 });
44
+ let r = { ...F(), ...e };
45
+ (q.default.writeFileSync(U, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
46
+ q.default.chmodSync(ae, 448),
47
+ q.default.chmodSync(U, 384));
48
48
  } catch (t) {
49
49
  throw new Error(`Failed to save config to ${U}: ${t}`);
50
50
  }
@@ -53,57 +53,57 @@ function E(e) {
53
53
  if (e && e.trim()) return e.trim();
54
54
  let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
55
55
  if (t && t.trim()) return t.trim();
56
- let r = V();
56
+ let r = F();
57
57
  return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
58
58
  }
59
- function I(e) {
59
+ function P(e) {
60
60
  if (e && e.trim()) return e.trim().replace(/\/+$/, '');
61
61
  let t = process.env.TEIN_API_URL;
62
62
  if (t && t.trim()) return t.trim().replace(/\/+$/, '');
63
- let r = V();
63
+ let r = F();
64
64
  return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
65
65
  }
66
- function ie() {
66
+ function ne() {
67
67
  return U;
68
68
  }
69
- var $,
70
- nt,
71
- Pe,
69
+ var q,
70
+ dt,
71
+ Ie,
72
72
  ae,
73
73
  U,
74
74
  A = y(() => {
75
75
  'use strict';
76
- (($ = _(require('node:fs'))),
77
- (nt = _(require('node:os'))),
78
- (Pe = _(require('node:path'))),
79
- (ae = Pe.default.join(nt.default.homedir(), '.tein')),
80
- (U = Pe.default.join(ae, 'config.json')));
76
+ ((q = I(require('node:fs'))),
77
+ (dt = I(require('node:os'))),
78
+ (Ie = I(require('node:path'))),
79
+ (ae = Ie.default.join(dt.default.homedir(), '.tein')),
80
+ (U = Ie.default.join(ae, 'config.json')));
81
81
  });
82
- var Mr,
83
- st,
84
- ot,
85
- lt = y(() => {
82
+ var Lr,
83
+ ct,
84
+ ut,
85
+ mt = y(() => {
86
86
  'use strict';
87
- ((Mr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
- (st = [...Mr, 'auto']),
89
- (ot =
87
+ ((Lr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (ct = [...Lr, 'auto']),
89
+ (ut =
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
- var G,
93
- ve = y(() => {
92
+ var H,
93
+ Me = y(() => {
94
94
  'use strict';
95
- G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
95
+ H = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
96
96
  });
97
- function ne(e) {
97
+ function se(e) {
98
98
  return !1;
99
99
  }
100
- var pt = y(() => {
100
+ var ft = y(() => {
101
101
  'use strict';
102
102
  });
103
- var se,
104
- dt = y(() => {
103
+ var oe,
104
+ gt = y(() => {
105
105
  'use strict';
106
- se = {
106
+ oe = {
107
107
  source: 'TEIN Price Board',
108
108
  checked: '17 Sep 2026',
109
109
  generated: '2026-10-01',
@@ -128,6 +128,7 @@ var se,
128
128
  models: [
129
129
  'seedance-2-5',
130
130
  'seedance-2-5-lite',
131
+ 'seedance-2-5-flash',
131
132
  'seedance-2',
132
133
  'seedance-2-lite',
133
134
  'seedance-2-fast',
@@ -666,6 +667,177 @@ var se,
666
667
  axes: { resolution: ['480p', '720p', '1080p'] },
667
668
  from: { variant: '480p-no-video' },
668
669
  },
670
+ {
671
+ slug: 'seedance-2-5-flash',
672
+ name: 'Seedance 2.5 Flash',
673
+ family: 'seedance',
674
+ vendor: 'ByteDance',
675
+ desc: 'The fast, lower-priced Seedance 2.5: the same tasks, audio and up to 30 seconds, at 480P or 720P.',
676
+ kind: 'video',
677
+ unit: '/sec',
678
+ api: { model: 'seedance-2-5-flash' },
679
+ variants: [
680
+ {
681
+ id: '720p-with-video',
682
+ price: { starter: 0.1344, plus: 0.1176, scale: 0.1107 },
683
+ label: '720P \xB7 Omni Reference \xB7 with reference video',
684
+ resolution: '720p',
685
+ task: 'omni',
686
+ withVideo: !0,
687
+ unfiltered: { starter: 0.1411, plus: 0.1234, scale: 0.1162 },
688
+ priority: { starter: 0.1424, plus: 0.1246, scale: 0.1173 },
689
+ unfilteredPriority: { starter: 0.1495, plus: 0.1308, scale: 0.1231 },
690
+ },
691
+ {
692
+ id: '720p-no-video',
693
+ price: { starter: 0.2197, plus: 0.1922, scale: 0.1809 },
694
+ label: '720P \xB7 Text to Video',
695
+ resolution: '720p',
696
+ task: 't2v',
697
+ withVideo: !1,
698
+ unfiltered: { starter: 0.2306, plus: 0.2018, scale: 0.1899 },
699
+ priority: { starter: 0.2328, plus: 0.2037, scale: 0.1917 },
700
+ unfilteredPriority: { starter: 0.2444, plus: 0.2139, scale: 0.2012 },
701
+ },
702
+ {
703
+ id: '720p-with-video-extend',
704
+ price: { starter: 0.1345, plus: 0.1179, scale: 0.1107 },
705
+ label: '720P \xB7 Extend \xB7 with reference video',
706
+ resolution: '720p',
707
+ task: 'extend',
708
+ withVideo: !0,
709
+ unfiltered: { starter: 0.1412, plus: 0.1237, scale: 0.1162 },
710
+ priority: { starter: 0.1425, plus: 0.1249, scale: 0.1173 },
711
+ unfilteredPriority: { starter: 0.1496, plus: 0.1311, scale: 0.1231 },
712
+ },
713
+ {
714
+ id: '720p-with-video-edit',
715
+ price: { starter: 0.1349, plus: 0.1185, scale: 0.1107 },
716
+ label: '720P \xB7 Edit \xB7 with reference video',
717
+ resolution: '720p',
718
+ task: 'edit',
719
+ withVideo: !0,
720
+ unfiltered: { starter: 0.1416, plus: 0.1244, scale: 0.1162 },
721
+ priority: { starter: 0.1429, plus: 0.1256, scale: 0.1173 },
722
+ unfilteredPriority: { starter: 0.15, plus: 0.1318, scale: 0.1231 },
723
+ },
724
+ {
725
+ id: '720p-no-video-i2v',
726
+ price: { starter: 0.2199, plus: 0.1925, scale: 0.1809 },
727
+ label: '720P \xB7 Image to Video',
728
+ resolution: '720p',
729
+ task: 'i2v',
730
+ withVideo: !1,
731
+ unfiltered: { starter: 0.2308, plus: 0.2021, scale: 0.1899 },
732
+ priority: { starter: 0.233, plus: 0.204, scale: 0.1917 },
733
+ unfilteredPriority: { starter: 0.2446, plus: 0.2142, scale: 0.2012 },
734
+ },
735
+ {
736
+ id: '720p-no-video-frames',
737
+ price: { starter: 0.2205, plus: 0.1929, scale: 0.1809 },
738
+ label: '720P \xB7 First & Last Frame',
739
+ resolution: '720p',
740
+ task: 'frames',
741
+ withVideo: !1,
742
+ unfiltered: { starter: 0.2315, plus: 0.2025, scale: 0.1899 },
743
+ priority: { starter: 0.2337, plus: 0.2044, scale: 0.1917 },
744
+ unfilteredPriority: { starter: 0.2453, plus: 0.2146, scale: 0.2012 },
745
+ },
746
+ {
747
+ id: '720p-no-video-omni',
748
+ price: { starter: 0.2197, plus: 0.1922, scale: 0.1809 },
749
+ label: '720P \xB7 Omni Reference',
750
+ resolution: '720p',
751
+ task: 'omni',
752
+ withVideo: !1,
753
+ unfiltered: { starter: 0.2306, plus: 0.2018, scale: 0.1899 },
754
+ priority: { starter: 0.2328, plus: 0.2037, scale: 0.1917 },
755
+ unfilteredPriority: { starter: 0.2444, plus: 0.2139, scale: 0.2012 },
756
+ },
757
+ {
758
+ id: '480p-with-video',
759
+ price: { starter: 0.0621, plus: 0.0544, scale: 0.0512 },
760
+ label: '480P \xB7 Omni Reference \xB7 with reference video',
761
+ resolution: '480p',
762
+ task: 'omni',
763
+ withVideo: !0,
764
+ unfiltered: { starter: 0.0652, plus: 0.0571, scale: 0.0537 },
765
+ priority: { starter: 0.0658, plus: 0.0576, scale: 0.0542 },
766
+ unfilteredPriority: { starter: 0.0691, plus: 0.0605, scale: 0.0569 },
767
+ },
768
+ {
769
+ id: '480p-no-video',
770
+ price: { starter: 0.1015, plus: 0.0889, scale: 0.0836 },
771
+ label: '480P \xB7 Text to Video',
772
+ resolution: '480p',
773
+ task: 't2v',
774
+ withVideo: !1,
775
+ unfiltered: { starter: 0.1065, plus: 0.0933, scale: 0.0877 },
776
+ priority: { starter: 0.1075, plus: 0.0942, scale: 0.0886 },
777
+ unfilteredPriority: { starter: 0.1128, plus: 0.0988, scale: 0.0929 },
778
+ },
779
+ {
780
+ id: '480p-with-video-extend',
781
+ price: { starter: 0.0625, plus: 0.0545, scale: 0.0512 },
782
+ label: '480P \xB7 Extend \xB7 with reference video',
783
+ resolution: '480p',
784
+ task: 'extend',
785
+ withVideo: !0,
786
+ unfiltered: { starter: 0.0656, plus: 0.0572, scale: 0.0537 },
787
+ priority: { starter: 0.0662, plus: 0.0577, scale: 0.0542 },
788
+ unfilteredPriority: { starter: 0.0695, plus: 0.0606, scale: 0.0569 },
789
+ },
790
+ {
791
+ id: '480p-with-video-edit',
792
+ price: { starter: 0.0629, plus: 0.0549, scale: 0.0512 },
793
+ label: '480P \xB7 Edit \xB7 with reference video',
794
+ resolution: '480p',
795
+ task: 'edit',
796
+ withVideo: !0,
797
+ unfiltered: { starter: 0.066, plus: 0.0576, scale: 0.0537 },
798
+ priority: { starter: 0.0666, plus: 0.0581, scale: 0.0542 },
799
+ unfilteredPriority: { starter: 0.0699, plus: 0.061, scale: 0.0569 },
800
+ },
801
+ {
802
+ id: '480p-no-video-i2v',
803
+ price: { starter: 0.1019, plus: 0.0895, scale: 0.0836 },
804
+ label: '480P \xB7 Image to Video',
805
+ resolution: '480p',
806
+ task: 'i2v',
807
+ withVideo: !1,
808
+ unfiltered: { starter: 0.1069, plus: 0.0939, scale: 0.0877 },
809
+ priority: { starter: 0.108, plus: 0.0948, scale: 0.0886 },
810
+ unfilteredPriority: { starter: 0.1133, plus: 0.0995, scale: 0.0929 },
811
+ },
812
+ {
813
+ id: '480p-no-video-frames',
814
+ price: { starter: 0.1025, plus: 0.0899, scale: 0.0836 },
815
+ label: '480P \xB7 First & Last Frame',
816
+ resolution: '480p',
817
+ task: 'frames',
818
+ withVideo: !1,
819
+ unfiltered: { starter: 0.1076, plus: 0.0943, scale: 0.0877 },
820
+ priority: { starter: 0.1086, plus: 0.0952, scale: 0.0886 },
821
+ unfilteredPriority: { starter: 0.114, plus: 0.0999, scale: 0.0929 },
822
+ },
823
+ {
824
+ id: '480p-no-video-omni',
825
+ price: { starter: 0.1015, plus: 0.0889, scale: 0.0836 },
826
+ label: '480P \xB7 Omni Reference',
827
+ resolution: '480p',
828
+ task: 'omni',
829
+ withVideo: !1,
830
+ unfiltered: { starter: 0.1065, plus: 0.0933, scale: 0.0877 },
831
+ priority: { starter: 0.1075, plus: 0.0942, scale: 0.0886 },
832
+ unfilteredPriority: { starter: 0.1128, plus: 0.0988, scale: 0.0929 },
833
+ },
834
+ ],
835
+ unfiltered: 0.05,
836
+ priority: 0.06,
837
+ draft: null,
838
+ axes: { resolution: ['480p', '720p'] },
839
+ from: { variant: '480p-no-video-omni' },
840
+ },
669
841
  {
670
842
  slug: 'seedance-2',
671
843
  name: 'Seedance 2.0',
@@ -5455,7 +5627,7 @@ var se,
5455
5627
  name: 'Kling Video 3.0',
5456
5628
  family: 'kling',
5457
5629
  vendor: 'Kuaishou',
5458
- desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds. Sound is optional; silent clips are the lower rate.',
5630
+ desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds, and motion control: a character image moved by a reference video. Sound is optional; silent clips are the lower rate.',
5459
5631
  kind: 'video',
5460
5632
  unit: '/sec',
5461
5633
  api: { model: 'kling-v3-video' },
@@ -5502,6 +5674,20 @@ var se,
5502
5674
  resolution: '4k',
5503
5675
  quality: 'audio',
5504
5676
  },
5677
+ {
5678
+ id: '720p-motion',
5679
+ price: { starter: 0.1575, plus: 0.1496, scale: 0.14 },
5680
+ label: '720p \xB7 motion control',
5681
+ resolution: '720p',
5682
+ quality: 'motion',
5683
+ },
5684
+ {
5685
+ id: '1080p-motion',
5686
+ price: { starter: 0.21, plus: 0.1995, scale: 0.1867 },
5687
+ label: '1080p \xB7 motion control',
5688
+ resolution: '1080p',
5689
+ quality: 'motion',
5690
+ },
5505
5691
  ],
5506
5692
  unfiltered: null,
5507
5693
  priority: null,
@@ -5632,31 +5818,31 @@ var se,
5632
5818
  variants: [
5633
5819
  {
5634
5820
  id: '1024x768',
5635
- price: { starter: 0.004, plus: 0.0038, scale: 0.0035 },
5821
+ price: { starter: 0.0046, plus: 0.0043, scale: 0.0041 },
5636
5822
  label: '1024\xD7768',
5637
5823
  resolution: '1024x768',
5638
5824
  },
5639
5825
  {
5640
5826
  id: '1024x1024',
5641
- price: { starter: 0.0053, plus: 0.005, scale: 0.0047 },
5827
+ price: { starter: 0.0059, plus: 0.0056, scale: 0.0053 },
5642
5828
  label: '1024\xD71024',
5643
5829
  resolution: '1024x1024',
5644
5830
  },
5645
5831
  {
5646
5832
  id: '1024x1808',
5647
- price: { starter: 0.0093, plus: 0.0088, scale: 0.0083 },
5833
+ price: { starter: 0.0099, plus: 0.0094, scale: 0.0088 },
5648
5834
  label: '1024\xD71808',
5649
5835
  resolution: '1024x1808',
5650
5836
  },
5651
5837
  {
5652
5838
  id: '2048x1536',
5653
- price: { starter: 0.0158, plus: 0.015, scale: 0.014 },
5839
+ price: { starter: 0.0164, plus: 0.0155, scale: 0.0146 },
5654
5840
  label: '2048\xD71536',
5655
5841
  resolution: '2048x1536',
5656
5842
  },
5657
5843
  {
5658
5844
  id: '2048x2048',
5659
- price: { starter: 0.021, plus: 0.0199, scale: 0.0187 },
5845
+ price: { starter: 0.0216, plus: 0.0205, scale: 0.0192 },
5660
5846
  label: '2048\xD72048',
5661
5847
  resolution: '2048x2048',
5662
5848
  },
@@ -5842,11 +6028,11 @@ var se,
5842
6028
  ],
5843
6029
  };
5844
6030
  });
5845
- var oe,
5846
- ct,
5847
- Te = y(() => {
6031
+ var le,
6032
+ ht,
6033
+ Ke = y(() => {
5848
6034
  'use strict';
5849
- ((oe = [
6035
+ ((le = [
5850
6036
  {
5851
6037
  slug: 'tein-video-upscaler',
5852
6038
  name: 'Tein Video Upscaler',
@@ -5897,33 +6083,36 @@ var oe,
5897
6083
  label: 'Swap',
5898
6084
  resolution: 'run',
5899
6085
  price: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
6086
+ unfiltered: { starter: 0.0816, plus: 0.0775, scale: 0.0693 },
5900
6087
  },
5901
6088
  {
5902
6089
  id: 'swap-4-items',
5903
6090
  label: 'Swap, 4 things to add',
5904
6091
  resolution: 'run',
5905
6092
  price: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
6093
+ unfiltered: { starter: 0.1656, plus: 0.1571, scale: 0.1404 },
5906
6094
  },
5907
6095
  {
5908
6096
  id: 'new_scene',
5909
6097
  label: 'New scene',
5910
6098
  resolution: 'run',
5911
6099
  price: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
6100
+ unfiltered: { starter: 0.1732, plus: 0.1645, scale: 0.1472 },
5912
6101
  },
5913
6102
  ],
5914
- unfiltered: null,
6103
+ unfiltered: 0,
5915
6104
  priority: null,
5916
6105
  draft: null,
5917
6106
  axes: { mode: ['swap', 'new_scene'] },
5918
6107
  from: { variant: 'swap' },
5919
6108
  },
5920
6109
  ]),
5921
- (ct = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
6110
+ (ht = [{ slug: 'tein-labs', name: 'Tein Labs', models: ['tein-video-upscaler', 'doppel'] }]));
5922
6111
  });
5923
- function Se(e, t) {
6112
+ function Ce(e, t) {
5924
6113
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
5925
6114
  }
5926
- function Er(e, t) {
6115
+ function Ur(e, t) {
5927
6116
  if (e === 'seedance-2-mini') return 'mini';
5928
6117
  if (e !== 'seedance-2') return;
5929
6118
  let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
@@ -5933,93 +6122,93 @@ function Er(e, t) {
5933
6122
  ? 'fast'
5934
6123
  : 'standard';
5935
6124
  }
5936
- function qr(e, t) {
6125
+ function Fr(e, t) {
5937
6126
  let r = e
5938
6127
  .trim()
5939
6128
  .toLowerCase()
5940
6129
  .replace(/-(?:unfiltered|uncensored)$/, '');
5941
6130
  if (r === 'seedance-2' || r === 'seedance-2-mini') {
5942
- let n = Er(r, t),
5943
- s = Me.get(Se('seedance-2', n));
6131
+ let n = Ur(r, t),
6132
+ s = Se.get(Ce('seedance-2', n));
5944
6133
  return s ? s.slug : null;
5945
6134
  }
5946
- let a = le.get(r) ?? Me.get(Se(r));
5947
- return a ? a.slug : null;
6135
+ let i = pe.get(r) ?? Se.get(Ce(r));
6136
+ return i ? i.slug : null;
5948
6137
  }
5949
- function $r(e, t) {
5950
- return le.has(e) && !(Cr.has(e) && t) ? e : qr(e, t);
6138
+ function jr(e, t) {
6139
+ return pe.has(e) && !(Br.has(e) && t) ? e : Fr(e, t);
5951
6140
  }
5952
- function H(e, t) {
5953
- let r = $r(e, t);
5954
- return r ? (le.get(r) ?? null) : null;
6141
+ function z(e, t) {
6142
+ let r = jr(e, t);
6143
+ return r ? (pe.get(r) ?? null) : null;
5955
6144
  }
5956
- function pe() {
5957
- return gt;
6145
+ function de() {
6146
+ return wt;
5958
6147
  }
5959
- var mt,
5960
- ft,
5961
- gt,
5962
- Kr,
5963
- le,
5964
- Me,
5965
- ut,
5966
- Sr,
5967
- Ke,
5968
- Cr,
5969
- F = y(() => {
6148
+ var bt,
6149
+ kt,
6150
+ wt,
6151
+ Vr,
6152
+ pe,
6153
+ Se,
6154
+ yt,
6155
+ Nr,
6156
+ Ee,
6157
+ Br,
6158
+ B = y(() => {
5970
6159
  'use strict';
5971
- pt();
5972
- dt();
5973
- Te();
5974
- ((mt = {
5975
- ...se,
5976
- families: se.families.map((e) => ({ ...e, models: e.models.filter((t) => !ne(t)) })),
5977
- models: se.models.filter((e) => !ne(e.slug)),
6160
+ ft();
6161
+ gt();
6162
+ Ke();
6163
+ ((bt = {
6164
+ ...oe,
6165
+ families: oe.families.map((e) => ({ ...e, models: e.models.filter((t) => !se(t)) })),
6166
+ models: oe.models.filter((e) => !se(e.slug)),
5978
6167
  }),
5979
- (ft = oe.filter((e) => !ne(e.slug))),
5980
- (gt = [...mt.models, ...ft]),
5981
- (Kr = [
5982
- ...mt.families,
5983
- ...ct
5984
- .map((e) => ({ ...e, models: ft.filter((t) => t.family === e.slug).map((t) => t.slug) }))
6168
+ (kt = le.filter((e) => !se(e.slug))),
6169
+ (wt = [...bt.models, ...kt]),
6170
+ (Vr = [
6171
+ ...bt.families,
6172
+ ...ht
6173
+ .map((e) => ({ ...e, models: kt.filter((t) => t.family === e.slug).map((t) => t.slug) }))
5985
6174
  .filter((e) => e.models.length > 0),
5986
6175
  ]),
5987
- (le = new Map()),
5988
- (Me = new Map()),
5989
- (ut = new Map()),
5990
- (Sr = new Map()),
5991
- (Ke = new Map()));
5992
- for (let e of gt) {
5993
- (le.set(e.slug, e), Me.set(Se(e.api.model, e.api.quality), e));
5994
- for (let t of e.variants) ut.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
6176
+ (pe = new Map()),
6177
+ (Se = new Map()),
6178
+ (yt = new Map()),
6179
+ (Nr = new Map()),
6180
+ (Ee = new Map()));
6181
+ for (let e of wt) {
6182
+ (pe.set(e.slug, e), Se.set(Ce(e.api.model, e.api.quality), e));
6183
+ for (let t of e.variants) yt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
5995
6184
  for (let t of e.editVariants ?? [])
5996
- ut.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
5997
- for (let t of e.addons ?? []) Sr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
5998
- Ke.set(e.slug, e.family);
6185
+ yt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
6186
+ for (let t of e.addons ?? []) Nr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
6187
+ Ee.set(e.slug, e.family);
5999
6188
  }
6000
- for (let e of Kr) for (let t of e.models) Ke.has(t) || Ke.set(t, e.slug);
6001
- Cr = new Set(['seedance-2']);
6189
+ for (let e of Vr) for (let t of e.models) Ee.has(t) || Ee.set(t, e.slug);
6190
+ Br = new Set(['seedance-2']);
6002
6191
  });
6003
- function de(e) {
6192
+ function ce(e) {
6004
6193
  let t = e.from?.variant;
6005
6194
  return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
6006
6195
  }
6007
- function Ee(e) {
6196
+ function $e(e) {
6008
6197
  if (e.endpoints?.length)
6009
- return e.editVariants?.length && e.endpoints.some((t) => t.id === ht)
6010
- ? ht
6198
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === xt)
6199
+ ? xt
6011
6200
  : (e.defaultEndpoint ?? e.endpoints[0].id);
6012
6201
  }
6013
- var ht,
6202
+ var xt,
6014
6203
  qe = y(() => {
6015
6204
  'use strict';
6016
- F();
6017
- ht = 'dynamic';
6205
+ B();
6206
+ xt = 'dynamic';
6018
6207
  });
6019
- var ce,
6020
- Ce = y(() => {
6208
+ var ue,
6209
+ Ae = y(() => {
6021
6210
  'use strict';
6022
- ce = {
6211
+ ue = {
6023
6212
  'gemini-3-8-flash': 'gemini-3.8-flash',
6024
6213
  'gemini-3-7-flash': 'gemini-3.7-flash',
6025
6214
  'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
@@ -6029,29 +6218,29 @@ var ce,
6029
6218
  'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
6030
6219
  };
6031
6220
  });
6032
- var yt = y(() => {
6221
+ var _t = y(() => {
6033
6222
  'use strict';
6034
6223
  });
6035
- function bt(e, t) {
6036
- return typeof t == 'string' && (Ar[e]?.includes(t) ?? !1);
6224
+ function Pt(e, t) {
6225
+ return typeof t == 'string' && (Gr[e]?.includes(t) ?? !1);
6037
6226
  }
6038
- var Ar,
6039
- kt = y(() => {
6227
+ var Gr,
6228
+ It = y(() => {
6040
6229
  'use strict';
6041
- F();
6230
+ B();
6042
6231
  qe();
6043
- yt();
6044
- Ar = {};
6232
+ _t();
6233
+ Gr = {};
6045
6234
  });
6046
- function wt(e) {
6047
- return e === 'nano-banana-pro' ? Rr : Or;
6235
+ function vt(e) {
6236
+ return e === 'nano-banana-pro' ? Hr : zr;
6048
6237
  }
6049
- var Rr,
6050
- Or,
6051
- xt = y(() => {
6238
+ var Hr,
6239
+ zr,
6240
+ Tt = y(() => {
6052
6241
  'use strict';
6053
- ((Rr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6054
- (Or = [
6242
+ ((Hr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
6243
+ (zr = [
6055
6244
  'auto',
6056
6245
  '1:1',
6057
6246
  '1:4',
@@ -6069,10 +6258,10 @@ var Rr,
6069
6258
  '21:9',
6070
6259
  ]));
6071
6260
  });
6072
- var Pt,
6073
- It = y(() => {
6261
+ var Mt,
6262
+ Kt = y(() => {
6074
6263
  'use strict';
6075
- Pt = [
6264
+ Mt = [
6076
6265
  'prompt',
6077
6266
  'system',
6078
6267
  'messages',
@@ -6086,10 +6275,10 @@ var Pt,
6086
6275
  'endpoint',
6087
6276
  ];
6088
6277
  });
6089
- var _t,
6090
- vt = y(() => {
6278
+ var St,
6279
+ Et = y(() => {
6091
6280
  'use strict';
6092
- _t = [
6281
+ St = [
6093
6282
  {
6094
6283
  slug: 'claude-fable-5-1',
6095
6284
  family: 'fable-5-1',
@@ -6158,13 +6347,13 @@ var _t,
6158
6347
  },
6159
6348
  ];
6160
6349
  });
6161
- function Tt(e) {
6350
+ function Ct(e) {
6162
6351
  return `$${e}`;
6163
6352
  }
6164
- function $e(e, t, r) {
6165
- return H(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
6353
+ function Oe(e, t, r) {
6354
+ return z(e)?.variants.find((n) => n.endpoint === t && n.component === r)?.price.starter ?? null;
6166
6355
  }
6167
- function Dr(e) {
6356
+ function Jr(e) {
6168
6357
  return [
6169
6358
  {
6170
6359
  name: 'prompt',
@@ -6230,13 +6419,13 @@ function Dr(e) {
6230
6419
  },
6231
6420
  ];
6232
6421
  }
6233
- function Mt() {
6422
+ function $t() {
6234
6423
  return Object.fromEntries(
6235
- _t.map((e) => {
6236
- let t = $e(e.slug, 'cheap', 'input'),
6237
- r = $e(e.slug, 'cheap', 'output'),
6238
- a = $e(e.slug, 'stable', 'input') != null,
6239
- n = t != null && r != null ? `${Tt(t)}/M in \xB7 ${Tt(r)}/M out` : '',
6424
+ St.map((e) => {
6425
+ let t = Oe(e.slug, 'cheap', 'input'),
6426
+ r = Oe(e.slug, 'cheap', 'output'),
6427
+ i = Oe(e.slug, 'stable', 'input') != null,
6428
+ n = t != null && r != null ? `${Ct(t)}/M in \xB7 ${Ct(r)}/M out` : '',
6240
6429
  s = {
6241
6430
  slug: e.slug,
6242
6431
  name: e.name,
@@ -6247,56 +6436,476 @@ function Mt() {
6247
6436
  priceFormatted: n,
6248
6437
  unit: '/M tokens',
6249
6438
  primaryToolName: 'run_task',
6250
- parameters: Dr(a),
6439
+ parameters: Jr(i),
6251
6440
  };
6252
6441
  return [e.slug, s];
6253
6442
  }),
6254
6443
  );
6255
6444
  }
6256
- var Kt = y(() => {
6445
+ var qt = y(() => {
6257
6446
  'use strict';
6258
- vt();
6259
- F();
6447
+ Et();
6448
+ B();
6260
6449
  });
6261
- var ue,
6262
- St,
6263
- z,
6264
- Et,
6265
- Mi,
6266
- Ki,
6267
- Si,
6268
- Ei,
6269
- qt = y(() => {
6450
+ function me(e) {
6451
+ return e ? Xr.get(e) : void 0;
6452
+ }
6453
+ function Rt(e, t) {
6454
+ return !e.aspects?.length || e.sourceFramedModes?.includes(t)
6455
+ ? null
6456
+ : e.adaptiveModes?.includes(t)
6457
+ ? [...e.aspects, 'adaptive']
6458
+ : [...e.aspects];
6459
+ }
6460
+ function Dt(e, t, r) {
6461
+ return e.modes.includes('motion_control')
6462
+ ? t === 'motion_control'
6463
+ ? !Zr.includes(r)
6464
+ : !Qr.includes(r)
6465
+ : !0;
6466
+ }
6467
+ var Wr,
6468
+ Yr,
6469
+ At,
6470
+ Wa,
6471
+ Xr,
6472
+ Ot,
6473
+ Re,
6474
+ Ya,
6475
+ De,
6476
+ Qr,
6477
+ Zr,
6478
+ Le = y(() => {
6270
6479
  'use strict';
6271
- ((ue = 'enhancor-ultrafine'),
6272
- (St = 'Enhancor Ultrafine'),
6273
- (z = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
6274
- (Et = 2),
6275
- (Mi = 24 * 1024 * 1024),
6276
- (Ki = 4096 * 4096),
6277
- (Si = 30 * 6e4),
6278
- (Ei = 120 * 6e4));
6480
+ ((Wr = ['16:9', '9:16', '1:1', '21:9']),
6481
+ (Yr = ['16:9', '9:16', '1:1', '4:3', '3:4', '21:9']),
6482
+ (At = [
6483
+ {
6484
+ slug: 'kling-v4',
6485
+ kind: 'video',
6486
+ modes: ['text_to_video', 'image_to_video', 'multi_reference'],
6487
+ promptMax: 26e3,
6488
+ duration: { min: 3, max: 30, default: 5 },
6489
+ heights: { '720p': 720, '1080p': 1080 },
6490
+ aspects: Wr,
6491
+ sourceFramedModes: ['image_to_video'],
6492
+ adaptiveModes: ['multi_reference'],
6493
+ fps: 24,
6494
+ audio: 'none',
6495
+ seed: !1,
6496
+ lastFrameOnImageToVideo: !0,
6497
+ referenceHandles: !0,
6498
+ reference: {
6499
+ maxImages: 10,
6500
+ maxVideos: 5,
6501
+ maxAudios: 0,
6502
+ maxFiles: 15,
6503
+ maxVideoSeconds: 30,
6504
+ },
6505
+ videoInputBilling: { minOutputMultiple: 2, withVideoRows: !0 },
6506
+ },
6507
+ {
6508
+ slug: 'kling-v3-video',
6509
+ kind: 'video',
6510
+ modes: ['text_to_video', 'image_to_video', 'motion_control'],
6511
+ promptMax: 2500,
6512
+ promptOptionalModes: ['motion_control'],
6513
+ duration: { min: 3, max: 15, default: 5 },
6514
+ heights: { '720p': 720, '1080p': 1080, '4k': 2160 },
6515
+ aspects: ['16:9', '9:16', '1:1'],
6516
+ sourceFramedModes: ['image_to_video', 'motion_control'],
6517
+ fps: 30,
6518
+ audio: 'priced',
6519
+ seed: !1,
6520
+ lastFrameOnImageToVideo: !0,
6521
+ },
6522
+ {
6523
+ slug: 'minimax-h3-turbo',
6524
+ kind: 'video',
6525
+ modes: ['text_to_video', 'image_to_video', 'first_n_last_frames', 'multi_reference'],
6526
+ promptMax: 65535,
6527
+ duration: { min: 5, max: 15, default: 5 },
6528
+ heights: { '480p': 480, '768p': 768 },
6529
+ aspects: Yr,
6530
+ fps: 24,
6531
+ audio: 'free',
6532
+ seed: !0,
6533
+ lastFrameOnImageToVideo: !0,
6534
+ reference: {
6535
+ maxImages: 9,
6536
+ maxVideos: 3,
6537
+ maxAudios: 3,
6538
+ maxFiles: 15,
6539
+ maxVideoSeconds: 15,
6540
+ maxAudioSeconds: 15,
6541
+ },
6542
+ videoInputBilling: { minOutputMultiple: 1, withVideoRows: !1 },
6543
+ },
6544
+ {
6545
+ slug: 'ltx-2.3-pro',
6546
+ kind: 'video',
6547
+ modes: ['text_to_video', 'image_to_video', 'first_n_last_frames'],
6548
+ promptMax: 1e4,
6549
+ duration: { min: 6, max: 10, default: 6, allowed: [6, 8, 10] },
6550
+ heights: { '1080p': 1080, '1440p': 1440, '4k': 2160 },
6551
+ aspects: ['16:9'],
6552
+ fps: 24,
6553
+ audio: 'free',
6554
+ seed: !0,
6555
+ },
6556
+ {
6557
+ slug: 'vidu-q4-preview',
6558
+ kind: 'video',
6559
+ modes: ['image_to_video', 'multi_reference'],
6560
+ promptMax: 2e4,
6561
+ promptOptionalModes: ['image_to_video'],
6562
+ duration: { min: 3, max: 16, default: 5 },
6563
+ heights: { '540p': 540, '720p': 720, '1080p': 1080, '1440p': 1440, '4k': 2160 },
6564
+ aspects: ['16:9', '9:16', '1:1', '4:3', '3:4'],
6565
+ sourceFramedModes: ['image_to_video'],
6566
+ fps: 24,
6567
+ audio: 'free',
6568
+ seed: !0,
6569
+ referenceHandles: !0,
6570
+ reference: {
6571
+ maxImages: 15,
6572
+ maxVideos: 0,
6573
+ maxAudios: 3,
6574
+ maxFiles: 18,
6575
+ audioClipSeconds: { min: 3, max: 12 },
6576
+ },
6577
+ },
6578
+ {
6579
+ slug: 'flux-2-dev',
6580
+ kind: 'image',
6581
+ modes: ['text_to_image', 'image_to_image'],
6582
+ promptMax: 1e4,
6583
+ sizes: {
6584
+ '1024x768': { width: 1024, height: 768 },
6585
+ '1024x1024': { width: 1024, height: 1024 },
6586
+ '1024x1808': { width: 1024, height: 1808 },
6587
+ '2048x1536': { width: 2048, height: 1536 },
6588
+ '2048x2048': { width: 2048, height: 2048 },
6589
+ },
6590
+ audio: 'none',
6591
+ seed: !0,
6592
+ maxEditImages: 3,
6593
+ },
6594
+ {
6595
+ slug: 'eleven-v4',
6596
+ kind: 'audio',
6597
+ modes: ['text_to_speech', 'dialogue'],
6598
+ modeRequired: !0,
6599
+ promptMax: 1e4,
6600
+ audio: 'none',
6601
+ seed: !0,
6602
+ },
6603
+ ]),
6604
+ (Wa = At.map((e) => e.slug)),
6605
+ (Xr = new Map(At.map((e) => [e.slug, e]))));
6606
+ ((Ot = 'EXAVITQu4vr4xnSDxMaL'),
6607
+ (Re = {
6608
+ hpp4J3VqNfWAUOO0d1Us: 'Bella',
6609
+ CwhRBWXzGAHq8TQ4Fs17: 'Roger',
6610
+ EXAVITQu4vr4xnSDxMaL: 'Sarah',
6611
+ FGY2WhTYpPnrIDTdsKH5: 'Laura',
6612
+ IKne3meq5aSn9XLyUdCD: 'Charlie',
6613
+ JBFqnCBsd6RMkjVDRZzb: 'George',
6614
+ N2lVS1w4EtoT3dr4eOWO: 'Callum',
6615
+ SAz9YHcvj6GT2YYXdXww: 'River',
6616
+ TX3LPaxmHKxFdv7VOQHJ: 'Liam',
6617
+ Xb7hH8MSUJpSbSDYk0k2: 'Alice',
6618
+ XrExE9yKIg1WjnnlVkGX: 'Matilda',
6619
+ bIHbv24MWmeRgasZH58o: 'Will',
6620
+ cgSgspJ2msm6clMCkdW9: 'Jessica',
6621
+ cjVigY5qzO86Huf0OWal: 'Eric',
6622
+ iP95p4xoKVk53GoZ742B: 'Chris',
6623
+ nPczCjzI2devNBz1zQrb: 'Brian',
6624
+ onwK4e9ZLuTAKqWW03F9: 'Daniel',
6625
+ pFZP5JQG7iQjIQuC4Bku: 'Lily',
6626
+ pqHfZKP75CvOlQylNhV4: 'Bill',
6627
+ pNInz6obpgDQGcFmaJgB: 'Adam',
6628
+ }),
6629
+ (Ya = Object.keys(Re)),
6630
+ (De = [
6631
+ 'mp3_44100_128',
6632
+ 'mp3_22050_32',
6633
+ 'mp3_24000_48',
6634
+ 'mp3_44100_32',
6635
+ 'mp3_44100_64',
6636
+ 'mp3_44100_96',
6637
+ 'mp3_44100_192',
6638
+ 'opus_48000_32',
6639
+ 'opus_48000_64',
6640
+ 'opus_48000_96',
6641
+ 'opus_48000_128',
6642
+ 'opus_48000_192',
6643
+ ]));
6644
+ ((Qr = ['image_url', 'video_url', 'character_orientation', 'keep_original_sound']),
6645
+ (Zr = [
6646
+ 'duration',
6647
+ 'aspect_ratio',
6648
+ 'generate_audio',
6649
+ 'seed',
6650
+ 'first_frame_image',
6651
+ 'last_frame_image',
6652
+ 'images',
6653
+ 'videos',
6654
+ 'audios',
6655
+ ]));
6279
6656
  });
6280
- var J,
6281
- me,
6282
- Ae = y(() => {
6657
+ function ti() {
6658
+ return [
6659
+ {
6660
+ name: 'image_url',
6661
+ type: 'string',
6662
+ description: `motion_control: the character to animate, one jpg or png (at least 300 px a side, aspect 1:2.5 to 2.5:1) with the head and upper or full body clearly visible, ${O}`,
6663
+ },
6664
+ {
6665
+ name: 'video_url',
6666
+ type: 'string',
6667
+ description: `motion_control: the motion to copy, one mp4 or mov of a single person in one continuous take, 3 to 30 s (up to 10 s when character_orientation is image). Billed per second of this video, rounded up, ${O}`,
6668
+ },
6669
+ {
6670
+ name: 'character_orientation',
6671
+ type: 'select',
6672
+ default: 'video',
6673
+ options: ['video', 'image'],
6674
+ description:
6675
+ 'motion_control: video faces the character as in the video (complex motion, up to 30 s); image as in the image (camera moves, up to 10 s).',
6676
+ },
6677
+ {
6678
+ name: 'keep_original_sound',
6679
+ type: 'boolean',
6680
+ default: !0,
6681
+ description: "motion_control: keep the video's sound. Same price on or off.",
6682
+ },
6683
+ ];
6684
+ }
6685
+ function ri(e) {
6686
+ let t = e.duration,
6687
+ r = Object.keys(e.heights),
6688
+ i = e.sourceFramedModes?.length
6689
+ ? ` Not taken by ${e.sourceFramedModes.join(', ')}: the source image sets the frame.`
6690
+ : '',
6691
+ n = [
6692
+ {
6693
+ name: 'duration',
6694
+ type: t.allowed ? 'select' : 'slider',
6695
+ default: t.default,
6696
+ ...(t.allowed ? { options: t.allowed.map(String) } : { min: t.min, max: t.max }),
6697
+ description: t.allowed
6698
+ ? `Video length in seconds: ${t.allowed.join(', ')}.`
6699
+ : `Video length in seconds (${t.min} to ${t.max}).`,
6700
+ },
6701
+ {
6702
+ name: 'resolution',
6703
+ type: 'select',
6704
+ default: r[0],
6705
+ options: r,
6706
+ description: `Output resolution. Higher resolutions cost more per second.${e.modes.includes('motion_control') ? ' motion_control: 720p or 1080p.' : ''}`,
6707
+ },
6708
+ {
6709
+ name: 'aspect_ratio',
6710
+ type: 'select',
6711
+ default: e.aspects[0],
6712
+ options: [...e.aspects, ...(e.adaptiveModes?.length ? ['adaptive'] : [])],
6713
+ description: `The frame.${e.adaptiveModes?.length ? ` adaptive: ${e.adaptiveModes.join(', ')} only.` : ''}${i}`,
6714
+ },
6715
+ ];
6716
+ if (
6717
+ (e.audio === 'priced'
6718
+ ? n.push({
6719
+ name: 'generate_audio',
6720
+ type: 'boolean',
6721
+ default: !1,
6722
+ description: 'Add sound. Clips with sound are billed at the higher rate.',
6723
+ })
6724
+ : e.audio === 'free' &&
6725
+ n.push({
6726
+ name: 'generate_audio',
6727
+ type: 'boolean',
6728
+ default: !0,
6729
+ description: 'Add sound. Same price on or off.',
6730
+ }),
6731
+ e.reference?.maxImages &&
6732
+ n.push({
6733
+ name: 'images',
6734
+ type: 'string[]',
6735
+ description: `multi_reference: up to ${e.reference.maxImages} reference images.${e.referenceHandles ? ' In the prompt, name them @Image1, @Image2, ... in this order.' : ''} ${O}`,
6736
+ }),
6737
+ (e.modes.includes('image_to_video') || e.modes.includes('first_n_last_frames')) &&
6738
+ n.push({
6739
+ name: 'first_frame_image',
6740
+ type: 'string',
6741
+ description: `The start frame (image_to_video, first_n_last_frames), ${O}`,
6742
+ }),
6743
+ (e.lastFrameOnImageToVideo || e.modes.includes('first_n_last_frames')) &&
6744
+ n.push({
6745
+ name: 'last_frame_image',
6746
+ type: 'string',
6747
+ description: `Last frame (optional on image_to_video), ${O}`,
6748
+ }),
6749
+ e.reference?.maxVideos)
6750
+ ) {
6751
+ let s = e.reference,
6752
+ o = e.videoInputBilling
6753
+ ? ` Billed as input plus output seconds${e.videoInputBilling.minOutputMultiple > 1 ? `, at least ${e.videoInputBilling.minOutputMultiple}x the output` : ''}.`
6754
+ : '';
6755
+ n.push({
6756
+ name: 'videos',
6757
+ type: 'string[]',
6758
+ description: `multi_reference: up to ${s.maxVideos} reference videos${s.maxVideoSeconds ? `, ${s.maxVideoSeconds} s in all` : ''}.${e.referenceHandles ? ' In the prompt, name them @Video1, @Video2, ... in this order.' : ''}${o} ${O}`,
6759
+ });
6760
+ }
6761
+ if (e.reference?.maxAudios) {
6762
+ let s = e.reference,
6763
+ o = s.audioClipSeconds
6764
+ ? `, each ${s.audioClipSeconds.min} to ${s.audioClipSeconds.max} s`
6765
+ : s.maxAudioSeconds
6766
+ ? `, ${s.maxAudioSeconds} s in all`
6767
+ : '';
6768
+ n.push({
6769
+ name: 'audios',
6770
+ type: 'string[]',
6771
+ description: `multi_reference: up to ${s.maxAudios} reference audios${o}, with at least one image or video. ${O}`,
6772
+ });
6773
+ }
6774
+ return n;
6775
+ }
6776
+ function ii(e) {
6777
+ let t = Object.keys(e.sizes);
6778
+ return [
6779
+ {
6780
+ name: 'resolution',
6781
+ type: 'select',
6782
+ default: t[0],
6783
+ options: t,
6784
+ description: 'Output size, width x height. Priced by size.',
6785
+ },
6786
+ {
6787
+ name: 'images',
6788
+ type: 'string[]',
6789
+ description: `image_to_image: up to ${e.maxEditImages} images to edit, ${O}`,
6790
+ },
6791
+ ];
6792
+ }
6793
+ function ni() {
6794
+ return [
6795
+ {
6796
+ name: 'voice_id',
6797
+ type: 'string',
6798
+ default: Ot,
6799
+ description: `text_to_speech: the ElevenLabs voice id, one of: ${ai}.`,
6800
+ },
6801
+ {
6802
+ name: 'turns',
6803
+ type: 'json',
6804
+ description:
6805
+ 'dialogue: a JSON list of {voice_id, text}, up to 20 turns, 10 voices and 2000 characters in all; plain text is refused. Each voice_id is one of the voice_id voices. Leave prompt out.',
6806
+ },
6807
+ { name: 'output_format', type: 'select', default: De[0], options: [...De] },
6808
+ { name: 'stability', type: 'number', min: 0, max: 1, description: 'Voice stability, 0 to 1.' },
6809
+ {
6810
+ name: 'similarity_boost',
6811
+ type: 'number',
6812
+ min: 0,
6813
+ max: 1,
6814
+ description: 'How closely to match the voice, 0 to 1.',
6815
+ },
6816
+ ];
6817
+ }
6818
+ function Lt(e) {
6819
+ let t = e.promptOptionalModes?.length ? ` Optional on ${e.promptOptionalModes.join(', ')}.` : '',
6820
+ r = [
6821
+ {
6822
+ name: 'prompt',
6823
+ type: 'string',
6824
+ required: e.kind !== 'audio' && !e.promptOptionalModes?.length,
6825
+ description: `${e.kind === 'audio' ? 'Text to speak (text_to_speech), billed per character.' : 'Text prompt.'} Up to ${e.promptMax} characters.${t}`,
6826
+ },
6827
+ {
6828
+ name: 'mode',
6829
+ type: 'select',
6830
+ required: !0,
6831
+ default: e.modes[0],
6832
+ options: [...e.modes],
6833
+ description: e.modes.map((i) => ei[i]).join(' '),
6834
+ },
6835
+ ];
6836
+ return (
6837
+ e.kind === 'video' ? r.push(...ri(e)) : e.kind === 'image' ? r.push(...ii(e)) : r.push(...ni()),
6838
+ e.modes.includes('motion_control') && r.push(...ti()),
6839
+ e.seed &&
6840
+ r.push({ name: 'seed', type: 'number', min: 0, description: 'Seed for repeatable runs.' }),
6841
+ r
6842
+ );
6843
+ }
6844
+ var O,
6845
+ ei,
6846
+ ai,
6847
+ Vt = y(() => {
6848
+ 'use strict';
6849
+ Le();
6850
+ ((O =
6851
+ 'as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.'),
6852
+ (ei = {
6853
+ text_to_video: 'text_to_video: from the prompt alone.',
6854
+ image_to_video: 'image_to_video: a start image in first_frame_image.',
6855
+ first_n_last_frames: 'first_n_last_frames: first_frame_image and last_frame_image.',
6856
+ multi_reference: 'multi_reference: reference images, videos or audios.',
6857
+ text_to_image: 'text_to_image: from the prompt alone.',
6858
+ image_to_image: 'image_to_image: edit the images in `images`.',
6859
+ text_to_speech: 'text_to_speech: speaks the prompt in one voice.',
6860
+ dialogue: 'dialogue: speaks `turns`, each with its own voice.',
6861
+ motion_control:
6862
+ 'motion_control: the character in image_url performs the motion of video_url; length and frame follow the video.',
6863
+ }));
6864
+ ai = Object.entries(Re)
6865
+ .map(([e, t]) => `${e} (${t})`)
6866
+ .join(', ');
6867
+ });
6868
+ var fe,
6869
+ Nt,
6870
+ J,
6871
+ Ut,
6872
+ en,
6873
+ tn,
6874
+ rn,
6875
+ an,
6876
+ Ft = y(() => {
6283
6877
  'use strict';
6284
- ((J = [
6878
+ ((fe = 'enhancor-ultrafine'),
6879
+ (Nt = 'Enhancor Ultrafine'),
6880
+ (J = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
6881
+ (Ut = 2),
6882
+ (en = 24 * 1024 * 1024),
6883
+ (tn = 4096 * 4096),
6884
+ (rn = 30 * 6e4),
6885
+ (an = 120 * 6e4));
6886
+ });
6887
+ var W,
6888
+ ge,
6889
+ Ve = y(() => {
6890
+ 'use strict';
6891
+ ((W = [
6285
6892
  'seedance-2-5',
6893
+ 'seedance-2-5-flash',
6286
6894
  'seedance-2',
6287
6895
  'seedance-2-mini',
6288
6896
  'seedream-5-pro',
6289
6897
  'seedream-5-5',
6290
6898
  'wan-3-0',
6291
6899
  'z-image-pro',
6900
+ 'doppel',
6292
6901
  ]),
6293
- (me =
6902
+ (ge =
6294
6903
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
6295
6904
  });
6296
- function W(e) {
6905
+ function Y(e) {
6297
6906
  return `$${Number(e.toFixed(5))}`;
6298
6907
  }
6299
- function Ur(e) {
6908
+ function li(e) {
6300
6909
  if (e.kind === 'llm') {
6301
6910
  let t = e.defaultEndpoint,
6302
6911
  r = (s) =>
@@ -6306,44 +6915,44 @@ function Ur(e) {
6306
6915
  (!t || !o.endpoint || o.endpoint === t) &&
6307
6916
  (!o.context || o.context === '0\u201332K'),
6308
6917
  ),
6309
- a = r('input'),
6918
+ i = r('input'),
6310
6919
  n = r('output');
6311
- return a && n
6312
- ? `${W(a.price.starter)}/M in \xB7 ${W(n.price.starter)}/M out`
6313
- : `from ${W(de(e).price.starter)}/M tokens`;
6920
+ return i && n
6921
+ ? `${Y(i.price.starter)}/M in \xB7 ${Y(n.price.starter)}/M out`
6922
+ : `from ${Y(ce(e).price.starter)}/M tokens`;
6314
6923
  }
6315
- return `from ${W(de(e).price.starter)}${e.unit}`;
6924
+ return `from ${Y(ce(e).price.starter)}${e.unit}`;
6316
6925
  }
6317
- function Vr(e, t) {
6318
- let r = t.filter((a) => Number.isFinite(a) && a > 0);
6319
- return r.length ? `from ${W(Math.min(...r))}${e}` : null;
6926
+ function pi(e, t) {
6927
+ let r = t.filter((i) => Number.isFinite(i) && i > 0);
6928
+ return r.length ? `from ${Y(Math.min(...r))}${e}` : null;
6320
6929
  }
6321
- function Ot(e) {
6322
- for (let t of G) {
6323
- let r = ge[t],
6324
- a = r ? Vr(r.unit, e[t] ?? []) : null;
6325
- r && a && (r.priceFormatted = a);
6930
+ function zt(e) {
6931
+ for (let t of H) {
6932
+ let r = ye[t],
6933
+ i = r ? pi(r.unit, e[t] ?? []) : null;
6934
+ r && i && (r.priceFormatted = i);
6326
6935
  }
6327
6936
  }
6328
6937
  function R(e, t) {
6329
6938
  let r = e.axes?.resolution ?? [
6330
- ...new Set(e.variants.map((a) => a.resolution).filter((a) => !!a)),
6939
+ ...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
6331
6940
  ];
6332
6941
  return {
6333
6942
  name: 'resolution',
6334
6943
  type: 'select',
6335
- default: de(e).resolution ?? r[0],
6944
+ default: ce(e).resolution ?? r[0],
6336
6945
  options: r,
6337
6946
  ...(t ? { description: t } : {}),
6338
6947
  };
6339
6948
  }
6340
- function Dt(e) {
6949
+ function Jt(e) {
6341
6950
  if (!e.endpoints?.length) return null;
6342
- let t = e.endpoints.filter((r) => bt(e.slug, r.id));
6951
+ let t = e.endpoints.filter((r) => Pt(e.slug, r.id));
6343
6952
  return {
6344
6953
  name: 'endpoint',
6345
6954
  type: 'select',
6346
- default: Ee(e),
6955
+ default: $e(e),
6347
6956
  options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
6348
6957
  description:
6349
6958
  (e.slug === 'gemini-3.1-pro-preview'
@@ -6352,55 +6961,55 @@ function Dt(e) {
6352
6961
  (t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
6353
6962
  };
6354
6963
  }
6355
- function Br(e, t) {
6356
- if (e.unfiltered == null || t.some((a) => a.name === 'creative_mode')) return t;
6357
- let r = J.includes(e.api.model);
6358
- return [...t.filter((a) => !fe.has(a.name)), r ? Ue : Fr];
6964
+ function ci(e, t) {
6965
+ if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
6966
+ let r = W.includes(e.api.model);
6967
+ return [...t.filter((i) => !he.has(i.name)), r ? Ge : di];
6359
6968
  }
6360
- function Re(e, t) {
6361
- let r = e.filter((n) => !fe.has(n.name)),
6362
- a = [Ue, Lt];
6363
- return (a.push(Ve, Fe), [...r, ...a]);
6969
+ function Ne(e, t) {
6970
+ let r = e.filter((n) => !he.has(n.name)),
6971
+ i = [Ge, Wt];
6972
+ return (i.push(He, ze), [...r, ...i]);
6364
6973
  }
6365
- function zr(e) {
6974
+ function gi(e) {
6366
6975
  return [
6367
6976
  ...e
6368
- .filter((t) => !Gr.has(t.name) && !fe.has(t.name))
6977
+ .filter((t) => !mi.has(t.name) && !he.has(t.name))
6369
6978
  .map((t) => {
6370
6979
  if (t.name === 'resolution')
6371
6980
  return {
6372
6981
  ...t,
6373
6982
  ...(t.options
6374
6983
  ? {
6375
- options: t.options.filter((a) =>
6376
- ['480p', '720p'].includes(String(a).toLowerCase()),
6984
+ options: t.options.filter((i) =>
6985
+ ['480p', '720p'].includes(String(i).toLowerCase()),
6377
6986
  ),
6378
6987
  }
6379
6988
  : {}),
6380
- description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${Y}`,
6989
+ description: `Output resolution: 480p or 720p (8-bit). This tier has no 1080p or 4k. ${X}`,
6381
6990
  };
6382
- let r = Hr[t.name];
6991
+ let r = fi[t.name];
6383
6992
  return r && typeof t.description == 'string'
6384
6993
  ? { ...t, description: t.description.replace(/\(up to [^)]*\)/, `(${r})`) }
6385
6994
  : t;
6386
6995
  }),
6387
- Ue,
6388
- Lt,
6389
- Ve,
6390
- Fe,
6996
+ Ge,
6997
+ Wt,
6998
+ He,
6999
+ ze,
6391
7000
  ];
6392
7001
  }
6393
- function Nt(e) {
7002
+ function Yt(e) {
6394
7003
  return (
6395
7004
  e.startsWith('seedance-2-5-') &&
6396
7005
  e !== 'seedance-2-5-lite' &&
6397
7006
  !/-(creative-mode|unfiltered|uncensored)$/.test(e)
6398
7007
  );
6399
7008
  }
6400
- function Ct(e, t = {}) {
7009
+ function Bt(e, t = {}) {
6401
7010
  return [
6402
7011
  ...e
6403
- .filter((r) => !jr.has(r.name) && !fe.has(r.name))
7012
+ .filter((r) => !ui.has(r.name) && !he.has(r.name))
6404
7013
  .map((r) =>
6405
7014
  r.name === 'prompt'
6406
7015
  ? { ...r, required: !0 }
@@ -6408,9 +7017,9 @@ function Ct(e, t = {}) {
6408
7017
  ? {
6409
7018
  ...r,
6410
7019
  ...(t.no4k && r.options
6411
- ? { options: r.options.filter((a) => String(a).toLowerCase() !== '4k') }
7020
+ ? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
6412
7021
  : {}),
6413
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${Y}`,
7022
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${X}`,
6414
7023
  }
6415
7024
  : r,
6416
7025
  ),
@@ -6421,11 +7030,11 @@ function Ct(e, t = {}) {
6421
7030
  options: ['standard'],
6422
7031
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
6423
7032
  },
6424
- Ve,
6425
- Fe,
7033
+ He,
7034
+ ze,
6426
7035
  ];
6427
7036
  }
6428
- function Oe(e, t) {
7037
+ function Ue(e, t) {
6429
7038
  return [
6430
7039
  M('Text prompt describing the video.'),
6431
7040
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
@@ -6454,8 +7063,8 @@ function Oe(e, t) {
6454
7063
  ),
6455
7064
  ];
6456
7065
  }
6457
- function Jr(e) {
6458
- let t = Dt(e);
7066
+ function hi(e) {
7067
+ let t = Jt(e);
6459
7068
  return [
6460
7069
  M('Image prompt text. Supports complex composition and text instructions.'),
6461
7070
  ...(t ? [t] : []),
@@ -6468,14 +7077,14 @@ function Jr(e) {
6468
7077
  R(
6469
7078
  e,
6470
7079
  e.slug === 'gpt-image-2'
6471
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ot}`
7080
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${ut}`
6472
7081
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
6473
7082
  ),
6474
7083
  {
6475
7084
  name: 'aspect_ratio',
6476
7085
  type: 'select',
6477
7086
  default: 'auto',
6478
- options: [...st],
7087
+ options: [...ct],
6479
7088
  description:
6480
7089
  "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.",
6481
7090
  },
@@ -6522,7 +7131,7 @@ function Jr(e) {
6522
7131
  },
6523
7132
  ];
6524
7133
  }
6525
- function Wr(e) {
7134
+ function yi(e) {
6526
7135
  return [
6527
7136
  M('Image prompt text.'),
6528
7137
  {
@@ -6530,7 +7139,7 @@ function Wr(e) {
6530
7139
  type: 'string[]',
6531
7140
  description: 'Images to edit or use as reference (up to 14).',
6532
7141
  },
6533
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...wt(e.slug)] },
7142
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...vt(e.slug)] },
6534
7143
  R(e),
6535
7144
  {
6536
7145
  name: 'n',
@@ -6556,10 +7165,10 @@ function Wr(e) {
6556
7165
  },
6557
7166
  ];
6558
7167
  }
6559
- function Zr() {
6560
- let e = Pt,
7168
+ function xi() {
7169
+ let e = Mt,
6561
7170
  t = [];
6562
- for (let r of Be(!0))
7171
+ for (let r of Je(!0))
6563
7172
  e.includes(r.name) &&
6564
7173
  (t.push({
6565
7174
  ...r,
@@ -6581,12 +7190,12 @@ function Zr() {
6581
7190
  }));
6582
7191
  return t;
6583
7192
  }
6584
- function ea() {
6585
- return Be(!0).map((e) =>
7193
+ function _i() {
7194
+ return Je(!0).map((e) =>
6586
7195
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
6587
7196
  );
6588
7197
  }
6589
- function Be(e) {
7198
+ function Je(e) {
6590
7199
  return [
6591
7200
  M('The user message or task.'),
6592
7201
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
@@ -6681,21 +7290,21 @@ function Be(e) {
6681
7290
  },
6682
7291
  ];
6683
7292
  }
6684
- function ta(e) {
6685
- if (e.slug === 'seed-2-1-turbo') return Xr;
6686
- let t = Dt(e);
7293
+ function Pi(e) {
7294
+ if (e.slug === 'seed-2-1-turbo') return ki;
7295
+ let t = Jt(e);
6687
7296
  return [
6688
7297
  ...(e.slug === 'gemini-3.1-pro-preview'
6689
- ? Zr()
7298
+ ? xi()
6690
7299
  : e.slug === 'gemini-3.7-flash'
6691
- ? ea()
6692
- : e.slug === 'gpt-6-astra' || Qr.includes(e.slug)
6693
- ? Be(e.slug !== 'gpt-6-astra')
6694
- : Yr),
7300
+ ? _i()
7301
+ : e.slug === 'gpt-6-astra' || wi.includes(e.slug)
7302
+ ? Je(e.slug !== 'gpt-6-astra')
7303
+ : bi),
6695
7304
  ...(t ? [t] : []),
6696
7305
  ];
6697
7306
  }
6698
- function De() {
7307
+ function Fe() {
6699
7308
  return {
6700
7309
  name: 'image',
6701
7310
  type: 'string',
@@ -6703,7 +7312,7 @@ function De() {
6703
7312
  description: 'The photo to fix: one JPEG or PNG URL.',
6704
7313
  };
6705
7314
  }
6706
- function aa(e) {
7315
+ function vi(e) {
6707
7316
  return [
6708
7317
  {
6709
7318
  name: 'video_url',
@@ -6725,7 +7334,7 @@ function aa(e) {
6725
7334
  },
6726
7335
  ];
6727
7336
  }
6728
- function ia() {
7337
+ function Ti() {
6729
7338
  return [
6730
7339
  {
6731
7340
  name: 'mode',
@@ -6780,6 +7389,13 @@ function ia() {
6780
7389
  description:
6781
7390
  'true: your character takes the facial expression of the person in the photo. false: they keep the expression from their own picture.',
6782
7391
  },
7392
+ {
7393
+ name: 'creative_mode',
7394
+ type: 'boolean',
7395
+ default: !1,
7396
+ description:
7397
+ 'Runs the Creative mode checkpoint, at the same price as a standard run. The Acceptable Use Policy applies.',
7398
+ },
6783
7399
  {
6784
7400
  name: 'aspect_ratio',
6785
7401
  type: 'select',
@@ -6789,28 +7405,30 @@ function ia() {
6789
7405
  },
6790
7406
  ];
6791
7407
  }
6792
- function na(e) {
7408
+ function Mi(e) {
6793
7409
  let t = e.slug;
6794
- if (e.family === 'tein-labs' && e.kind === 'image') return ia();
6795
- if (oe.some((r) => r.slug === t)) return aa(e);
6796
- if (e.kind === 'llm') return ta(e);
6797
- if (e.editVariants?.length) return Jr(e);
6798
- if (Nt(t)) return zr(Le);
7410
+ if (e.family === 'tein-labs' && e.kind === 'image') return Ti();
7411
+ if (le.some((i) => i.slug === t)) return vi(e);
7412
+ if (e.kind === 'llm') return Pi(e);
7413
+ if (e.editVariants?.length) return hi(e);
7414
+ let r = me(t);
7415
+ if (r) return Lt(r);
7416
+ if (Yt(t)) return gi(Be);
6799
7417
  switch (t) {
6800
7418
  case 'seedance-2-5':
6801
- return Re(Le, t);
7419
+ return Ne(Be, t);
6802
7420
  case 'seedance-2-5-lite':
6803
- return Ct(Le, { no4k: !0 });
7421
+ return Bt(Be, { no4k: !0 });
6804
7422
  case 'seedance-2':
6805
- return Re($t, t);
7423
+ return Ne(jt, t);
6806
7424
  case 'seedance-2-lite':
6807
- return Ct($t);
7425
+ return Bt(jt);
6808
7426
  case 'seedance-2-mini':
6809
- return Re(sa, t);
7427
+ return Ne(Ki, t);
6810
7428
  case 'nano-banana-2':
6811
7429
  case 'nano-banana-2.1':
6812
7430
  case 'nano-banana-pro':
6813
- return Wr(e);
7431
+ return yi(e);
6814
7432
  case 'seedream-5-pro':
6815
7433
  return [
6816
7434
  M('Detailed description of the image to generate.'),
@@ -6961,7 +7579,7 @@ function na(e) {
6961
7579
  ];
6962
7580
  case 'enhancor-skin-fix-v1':
6963
7581
  return [
6964
- De(),
7582
+ Fe(),
6965
7583
  {
6966
7584
  name: 'mode',
6967
7585
  type: 'select',
@@ -6994,11 +7612,11 @@ function na(e) {
6994
7612
  max: 0.4,
6995
7613
  description: 'Portrait depth. Heavy only.',
6996
7614
  },
6997
- ...ra,
7615
+ ...Ii,
6998
7616
  ];
6999
7617
  case 'enhancor-skin-fix-v3':
7000
7618
  return [
7001
- De(),
7619
+ Fe(),
7002
7620
  {
7003
7621
  name: 'mask_image',
7004
7622
  type: 'string',
@@ -7038,7 +7656,7 @@ function na(e) {
7038
7656
  ];
7039
7657
  case 'enhancor-skin-fix-v4':
7040
7658
  return [
7041
- De(),
7659
+ Fe(),
7042
7660
  {
7043
7661
  name: 'mode',
7044
7662
  type: 'select',
@@ -7069,7 +7687,7 @@ function na(e) {
7069
7687
  ];
7070
7688
  case 'wan-3-0':
7071
7689
  case 'wan-3-0-prime':
7072
- return Oe(e, {
7690
+ return Ue(e, {
7073
7691
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
7074
7692
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
7075
7693
  minSec: 2,
@@ -7079,7 +7697,7 @@ function na(e) {
7079
7697
  });
7080
7698
  case 'happy-horse-1-1':
7081
7699
  case 'happy-horse-1-0':
7082
- return Oe(e, {
7700
+ return Ue(e, {
7083
7701
  modes:
7084
7702
  t === 'happy-horse-1-0'
7085
7703
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -7090,7 +7708,7 @@ function na(e) {
7090
7708
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
7091
7709
  });
7092
7710
  case 'minimax-h3':
7093
- return Oe(e, {
7711
+ return Ue(e, {
7094
7712
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
7095
7713
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
7096
7714
  minSec: 4,
@@ -7101,10 +7719,10 @@ function na(e) {
7101
7719
  return [M('Prompt text.')];
7102
7720
  }
7103
7721
  }
7104
- function oa() {
7722
+ function Si() {
7105
7723
  return {
7106
- slug: ue,
7107
- name: St,
7724
+ slug: fe,
7725
+ name: Nt,
7108
7726
  category: 'Image',
7109
7727
  kind: 'Image-to-Image',
7110
7728
  vendor: 'Enhancor',
@@ -7112,7 +7730,7 @@ function oa() {
7112
7730
  'Upscales a photo, with an optional skin fix. Full makes the photo its size times the scale; Fast makes a fixed size (long side 2432 px).',
7113
7731
  priceFormatted: '',
7114
7732
  unit: '/img',
7115
- primaryToolName: Rt.image,
7733
+ primaryToolName: Ht.image,
7116
7734
  parameters: [
7117
7735
  {
7118
7736
  name: 'image',
@@ -7138,171 +7756,189 @@ function oa() {
7138
7756
  {
7139
7757
  name: 'scale',
7140
7758
  type: 'select',
7141
- default: String(Et),
7142
- options: z.noSkin.map(String),
7143
- description: `Full only. ${z.skin.join(', ')} with skin_fix on; also ${z.noSkin.filter((e) => !z.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
7759
+ default: String(Ut),
7760
+ options: J.noSkin.map(String),
7761
+ description: `Full only. ${J.skin.join(', ')} with skin_fix on; also ${J.noSkin.filter((e) => !J.skin.includes(e)).join(' and ')} with it off. The output is at most 48 megapixels.`,
7144
7762
  },
7145
7763
  ],
7146
7764
  };
7147
7765
  }
7148
- function Ne(e, t = e.api.model) {
7766
+ function je(e, t = e.api.model) {
7149
7767
  return {
7150
7768
  slug: t,
7151
7769
  name: e.name,
7152
- category: Lr[e.kind],
7153
- kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : Nr[e.kind],
7770
+ category: si[e.kind],
7771
+ kind: t.startsWith('enhancor-skin-fix-') ? 'Image-to-Image' : oi[e.kind],
7154
7772
  vendor: e.vendor ?? '',
7155
7773
  description: e.desc ?? e.name,
7156
- priceFormatted: Ur(e),
7774
+ priceFormatted: li(e),
7157
7775
  unit: e.unit,
7158
- primaryToolName: Rt[e.kind],
7159
- parameters: Br(e, na(e)),
7776
+ primaryToolName: Ht[e.kind],
7777
+ parameters: ci(e, Mi(e)),
7160
7778
  };
7161
7779
  }
7162
- function la() {
7780
+ function Ei() {
7163
7781
  let e = {};
7164
- for (let t of pe())
7782
+ for (let t of de())
7165
7783
  if (t.slug !== 'seedance-2-fast') {
7166
7784
  if (t.slug === 'seedance-2-mini') {
7167
- e['seedance-2-mini'] = Ne(t, 'seedance-2-mini');
7785
+ e['seedance-2-mini'] = je(t, 'seedance-2-mini');
7168
7786
  continue;
7169
7787
  }
7170
7788
  if (t.slug === 'seedance-2') {
7171
- let r = Ne(t);
7789
+ let r = je(t);
7172
7790
  ((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
7173
7791
  (e['seedance-2'] = r));
7174
7792
  continue;
7175
7793
  }
7176
- t.slug.startsWith('claude-') || (e[t.api.model] = Ne(t));
7794
+ t.slug.startsWith('claude-') || (e[t.api.model] = je(t));
7177
7795
  }
7178
- (Object.assign(e, Mt()), (e[ue] = oa()));
7179
- for (let [t, r] of Object.entries(ce))
7796
+ (Object.assign(e, $t()), (e[fe] = Si()));
7797
+ for (let [t, r] of Object.entries(ue))
7180
7798
  e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
7181
7799
  return e;
7182
7800
  }
7183
- function he(e) {
7801
+ function be(e) {
7184
7802
  return !!e?.parameters.some((t) => t.name === 'image');
7185
7803
  }
7186
- function B(e) {
7187
- return ge[e] ?? null;
7804
+ function j(e) {
7805
+ return ye[e] ?? null;
7188
7806
  }
7189
- function pa(e, t, r) {
7190
- if (e.startsWith('enhancor-skin-fix-') || e === ue) return !1;
7191
- if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Nt(e)) && t === 'duration') {
7192
- let a = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
7193
- if (a(r.mode) === 'edit' || a(r.omni_reference_task_type) === 'edit') return !1;
7807
+ function Ci(e, t, r) {
7808
+ if (e.startsWith('enhancor-skin-fix-') || e === fe) return !1;
7809
+ if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite' || Yt(e)) && t === 'duration') {
7810
+ let n = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
7811
+ if (n(r.mode) === 'edit' || n(r.omni_reference_task_type) === 'edit') return !1;
7194
7812
  }
7195
- return !(
7196
- (t === 'max_tokens' && At(r.max_completion_tokens)) ||
7197
- (t === 'max_completion_tokens' && At(r.max_tokens))
7198
- );
7813
+ if (
7814
+ (t === 'max_tokens' && Gt(r.max_completion_tokens)) ||
7815
+ (t === 'max_completion_tokens' && Gt(r.max_tokens))
7816
+ )
7817
+ return !1;
7818
+ if (t === 'aspect_ratio') {
7819
+ let n = me(e);
7820
+ if (n) {
7821
+ let s = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
7822
+ o = s ? s.replace(/-/g, '_') : n.modes[0];
7823
+ if (n.modes.includes(o) && !Rt(n, o)) return !1;
7824
+ }
7825
+ }
7826
+ let i = me(e);
7827
+ if (i) {
7828
+ let n = typeof r.mode == 'string' ? r.mode.trim().toLowerCase() : '',
7829
+ s = n ? n.replace(/-/g, '_') : i.modes[0];
7830
+ if (i.modes.includes(s) && !Dt(i, s, t)) return !1;
7831
+ }
7832
+ return !0;
7199
7833
  }
7200
- function At(e) {
7834
+ function Gt(e) {
7201
7835
  return e != null && e !== '';
7202
7836
  }
7203
- function Ft(e, t) {
7837
+ function Zt(e, t) {
7204
7838
  let r = { ...t };
7205
7839
  if (e?.slug === 'seedance-2-5') {
7206
- let a = (n) => typeof n != 'string' || !n.trim();
7207
- for (let n of da) (a(r.finalize) && !a(r[n]) && (r.finalize = r[n]), delete r[n]);
7208
- if (!a(r.finalize)) return r;
7840
+ let i = (n) => typeof n != 'string' || !n.trim();
7841
+ for (let n of $i) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
7842
+ if (!i(r.finalize)) return r;
7209
7843
  }
7210
- for (let a of e?.parameters ?? [])
7211
- a.default !== void 0 &&
7212
- r[a.name] === void 0 &&
7213
- pa(e.slug, a.name, t) &&
7214
- (r[a.name] = a.default);
7844
+ for (let i of e?.parameters ?? [])
7845
+ i.default !== void 0 &&
7846
+ r[i.name] === void 0 &&
7847
+ Ci(e.slug, i.name, t) &&
7848
+ (r[i.name] = i.default);
7215
7849
  return r;
7216
7850
  }
7217
- function O() {
7218
- return Object.values(ge);
7851
+ function D() {
7852
+ return Object.values(ye);
7219
7853
  }
7220
- var Lr,
7221
- Rt,
7222
- Nr,
7854
+ var si,
7855
+ Ht,
7856
+ oi,
7223
7857
  M,
7224
- Ue,
7225
- Fr,
7226
- Lt,
7227
- Ve,
7228
- Fe,
7229
- fe,
7230
- jr,
7231
- Gr,
7232
- Hr,
7233
- Yr,
7234
- Xr,
7235
- Qr,
7236
- ra,
7237
- Y,
7238
- Le,
7239
- Ut,
7240
- Vt,
7241
- $t,
7242
- sa,
7243
- ge,
7244
- da,
7245
- X = y(() => {
7858
+ Ge,
7859
+ di,
7860
+ Wt,
7861
+ He,
7862
+ ze,
7863
+ he,
7864
+ ui,
7865
+ mi,
7866
+ fi,
7867
+ bi,
7868
+ ki,
7869
+ wi,
7870
+ Ii,
7871
+ X,
7872
+ Be,
7873
+ Xt,
7874
+ Qt,
7875
+ jt,
7876
+ Ki,
7877
+ ye,
7878
+ $i,
7879
+ Q = y(() => {
7246
7880
  'use strict';
7247
- lt();
7248
- ve();
7249
- F();
7881
+ mt();
7882
+ Me();
7883
+ B();
7250
7884
  qe();
7251
- Te();
7252
- Ce();
7253
- kt();
7254
- xt();
7885
+ Ke();
7886
+ Ae();
7255
7887
  It();
7888
+ Tt();
7256
7889
  Kt();
7257
7890
  qt();
7258
- Ae();
7259
- ((Lr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
7260
- (Rt = {
7891
+ Le();
7892
+ Vt();
7893
+ Ft();
7894
+ Ve();
7895
+ ((si = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
7896
+ (Ht = {
7261
7897
  video: 'generate_video',
7262
7898
  image: 'generate_image',
7263
7899
  audio: 'generate_audio',
7264
7900
  llm: 'run_task',
7265
7901
  }),
7266
- (Nr = {
7902
+ (oi = {
7267
7903
  video: 'Text-to-Video',
7268
7904
  image: 'Text-to-Image',
7269
7905
  audio: 'Text-to-Audio',
7270
7906
  llm: 'Reasoning (LLM)',
7271
7907
  }));
7272
7908
  M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
7273
- ((Ue = {
7909
+ ((Ge = {
7274
7910
  name: 'creative_mode',
7275
7911
  type: 'boolean',
7276
7912
  default: !1,
7277
7913
  description:
7278
7914
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
7279
7915
  }),
7280
- (Fr = {
7916
+ (di = {
7281
7917
  name: 'creative_mode',
7282
7918
  type: 'boolean',
7283
7919
  default: !1,
7284
- description: `Not available yet on this model: ${me}.`,
7920
+ description: `Not available yet on this model: ${ge}.`,
7285
7921
  }),
7286
- (Lt = {
7922
+ (Wt = {
7287
7923
  name: 'priority',
7288
7924
  type: 'boolean',
7289
7925
  default: !1,
7290
7926
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
7291
7927
  }),
7292
- (Ve = {
7928
+ (He = {
7293
7929
  name: 'reference_roles',
7294
7930
  type: 'json',
7295
7931
  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).`,
7296
7932
  }),
7297
- (Fe = {
7933
+ (ze = {
7298
7934
  name: 'auto_fit_images',
7299
7935
  type: 'boolean',
7300
7936
  default: !1,
7301
7937
  description:
7302
7938
  '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.',
7303
7939
  }),
7304
- (fe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
7305
- ((jr = new Set([
7940
+ (he = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
7941
+ ((ui = new Set([
7306
7942
  'quality',
7307
7943
  'bitrate_mode',
7308
7944
  'draft',
@@ -7311,7 +7947,7 @@ var Lr,
7311
7947
  'draft_generation_id',
7312
7948
  'pass_faces',
7313
7949
  ])),
7314
- (Gr = new Set([
7950
+ (mi = new Set([
7315
7951
  'quality',
7316
7952
  'bitrate_mode',
7317
7953
  'draft',
@@ -7319,12 +7955,12 @@ var Lr,
7319
7955
  'draft_task_id',
7320
7956
  'draft_generation_id',
7321
7957
  ])),
7322
- (Hr = {
7958
+ (fi = {
7323
7959
  images: 'up to 10',
7324
7960
  videos: 'up to 5; combined duration < 30s',
7325
7961
  audios: 'up to 5; combined duration < 30s',
7326
7962
  }));
7327
- ((Yr = [
7963
+ ((bi = [
7328
7964
  M('The user message or task.'),
7329
7965
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
7330
7966
  {
@@ -7342,7 +7978,7 @@ var Lr,
7342
7978
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
7343
7979
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
7344
7980
  ]),
7345
- (Xr = [
7981
+ (ki = [
7346
7982
  M('The user message or task.'),
7347
7983
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
7348
7984
  {
@@ -7424,8 +8060,8 @@ var Lr,
7424
8060
  description: 'Video frames read a second.',
7425
8061
  },
7426
8062
  ]),
7427
- (Qr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
7428
- ra = Object.entries({
8063
+ (wi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
8064
+ Ii = Object.entries({
7429
8065
  background: !1,
7430
8066
  skin: !1,
7431
8067
  nose: !1,
@@ -7451,8 +8087,8 @@ var Lr,
7451
8087
  default: t,
7452
8088
  description: 'Keep this part out of the fix. Standard only.',
7453
8089
  }));
7454
- ((Y = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
7455
- (Le = [
8090
+ ((X = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
8091
+ (Be = [
7456
8092
  {
7457
8093
  name: 'prompt',
7458
8094
  type: 'string',
@@ -7490,7 +8126,7 @@ var Lr,
7490
8126
  type: 'select',
7491
8127
  default: '480p',
7492
8128
  options: ['480p', '720p', '1080p', '4k'],
7493
- description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${Y}`,
8129
+ description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${X}`,
7494
8130
  },
7495
8131
  {
7496
8132
  name: 'aspect_ratio',
@@ -7601,19 +8237,19 @@ var Lr,
7601
8237
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7602
8238
  },
7603
8239
  ]),
7604
- (Ut = {
8240
+ (Xt = {
7605
8241
  name: 'images',
7606
8242
  type: 'string[]',
7607
8243
  description:
7608
8244
  '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.',
7609
8245
  }),
7610
- (Vt = {
8246
+ (Qt = {
7611
8247
  name: 'audios',
7612
8248
  type: 'string[]',
7613
8249
  description:
7614
8250
  '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.',
7615
8251
  }),
7616
- ($t = [
8252
+ (jt = [
7617
8253
  {
7618
8254
  name: 'prompt',
7619
8255
  type: 'string',
@@ -7657,7 +8293,7 @@ var Lr,
7657
8293
  type: 'select',
7658
8294
  default: '480p',
7659
8295
  options: ['480p', '720p', '1080p', '4k'],
7660
- description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${Y}`,
8296
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${X}`,
7661
8297
  },
7662
8298
  {
7663
8299
  name: 'bitrate_mode',
@@ -7691,8 +8327,8 @@ var Lr,
7691
8327
  description:
7692
8328
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
7693
8329
  },
7694
- Ut,
7695
- Vt,
8330
+ Xt,
8331
+ Qt,
7696
8332
  {
7697
8333
  name: 'first_frame_image',
7698
8334
  type: 'string',
@@ -7713,7 +8349,7 @@ var Lr,
7713
8349
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7714
8350
  },
7715
8351
  ]),
7716
- (sa = [
8352
+ (Ki = [
7717
8353
  {
7718
8354
  name: 'prompt',
7719
8355
  type: 'string',
@@ -7734,7 +8370,7 @@ var Lr,
7734
8370
  type: 'select',
7735
8371
  default: '480p',
7736
8372
  options: ['480p', '720p'],
7737
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${Y}`,
8373
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${X}`,
7738
8374
  },
7739
8375
  {
7740
8376
  name: 'bitrate_mode',
@@ -7768,8 +8404,8 @@ var Lr,
7768
8404
  description:
7769
8405
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
7770
8406
  },
7771
- Ut,
7772
- Vt,
8407
+ Xt,
8408
+ Qt,
7773
8409
  {
7774
8410
  name: 'first_frame_image',
7775
8411
  type: 'string',
@@ -7784,53 +8420,53 @@ var Lr,
7784
8420
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
7785
8421
  },
7786
8422
  ]));
7787
- ge = la();
7788
- da = ['draft_task_id', 'draft_generation_id'];
8423
+ ye = Ei();
8424
+ $i = ['draft_task_id', 'draft_generation_id'];
7789
8425
  });
7790
- function ye(e) {
8426
+ function ke(e) {
7791
8427
  let t = '/v1/pricing/models',
7792
8428
  r = e?.trim();
7793
8429
  return r ? `${t}?model=${encodeURIComponent(r)}` : t;
7794
8430
  }
7795
- var Ge = y(() => {
8431
+ var Ye = y(() => {
7796
8432
  'use strict';
7797
8433
  });
7798
- function Zt(e) {
8434
+ function dr(e) {
7799
8435
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
7800
8436
  }
7801
- function er(e) {
7802
- let t = pe().filter((s) => s.kind === e && s.unfiltered != null),
7803
- r = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
7804
- a = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
8437
+ function cr(e) {
8438
+ let t = de().filter((s) => s.kind === e && s.unfiltered != null),
8439
+ r = t.filter((s) => W.includes(s.api.model)).map((s) => s.name),
8440
+ i = t.filter((s) => !W.includes(s.api.model)).map((s) => s.name);
7805
8441
  return [
7806
8442
  ...(r.length
7807
- ? [`${Zt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
8443
+ ? [`${dr(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
7808
8444
  : []),
7809
- ...(a.length ? [`Not available yet on ${Zt(a)}: ${me}.`] : []),
8445
+ ...(i.length ? [`Not available yet on ${dr(i)}: ${ge}.`] : []),
7810
8446
  'The Acceptable Use Policy applies.',
7811
8447
  ].join(' ');
7812
8448
  }
7813
- function Aa(e) {
7814
- if (Ca.has(e.name)) return e;
8449
+ function ra(e) {
8450
+ if (ea.has(e.name)) return e;
7815
8451
  let t = e.inputSchema.properties;
7816
8452
  return !t || t.callback_url
7817
8453
  ? e
7818
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: qa } } };
8454
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: Zi } } };
7819
8455
  }
7820
- function Ra(e) {
8456
+ function ia(e) {
7821
8457
  let t = e.inputSchema.properties;
7822
8458
  if (!t) return e;
7823
8459
  let r = !1,
7824
- a = {};
8460
+ i = {};
7825
8461
  for (let [n, s] of Object.entries(t))
7826
- tr.has(n) && s.type === 'string' && !s.format
7827
- ? ((a[n] = { ...s, format: 'uri' }), (r = !0))
7828
- : tr.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
7829
- ? ((a[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
7830
- : (a[n] = s);
7831
- return r ? { ...e, inputSchema: { ...e.inputSchema, properties: a } } : e;
8462
+ ur.has(n) && s.type === 'string' && !s.format
8463
+ ? ((i[n] = { ...s, format: 'uri' }), (r = !0))
8464
+ : ur.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
8465
+ ? ((i[n] = { ...s, items: { ...s.items, format: 'uri' } }), (r = !0))
8466
+ : (i[n] = s);
8467
+ return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
7832
8468
  }
7833
- function Oa(e) {
8469
+ function aa(e) {
7834
8470
  switch (e.type) {
7835
8471
  case 'string':
7836
8472
  return {
@@ -7885,14 +8521,14 @@ function Oa(e) {
7885
8521
  return { type: 'string', description: e.description };
7886
8522
  }
7887
8523
  }
7888
- function Da(e, t) {
8524
+ function na(e, t) {
7889
8525
  let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
7890
- a = {},
8526
+ i = {},
7891
8527
  n = [];
7892
- for (let o of e.parameters) ((a[o.name] = Oa(o)), o.required && n.push(o.name));
8528
+ for (let o of e.parameters) ((i[o.name] = aa(o)), o.required && n.push(o.name));
7893
8529
  let s = {
7894
8530
  type: 'object',
7895
- properties: a,
8531
+ properties: i,
7896
8532
  ...(n.length > 0 ? { required: n } : {}),
7897
8533
  additionalProperties: !0,
7898
8534
  };
@@ -7902,11 +8538,11 @@ function Da(e, t) {
7902
8538
  inputSchema: s,
7903
8539
  };
7904
8540
  }
7905
- function La() {
7906
- let e = O().filter((d) => d.category === 'Image' && !he(d)),
7907
- t = O().filter((d) => d.category === 'Video'),
7908
- r = O().filter((d) => d.category === 'Text'),
7909
- a = O().filter((d) => d.category === 'Audio'),
8541
+ function sa() {
8542
+ let e = D().filter((d) => d.category === 'Image' && !be(d)),
8543
+ t = D().filter((d) => d.category === 'Video'),
8544
+ r = D().filter((d) => d.category === 'Text'),
8545
+ i = D().filter((d) => d.category === 'Audio'),
7910
8546
  n = {
7911
8547
  name: 'generate_image',
7912
8548
  description:
@@ -7998,7 +8634,7 @@ function La() {
7998
8634
  maximum: 2147483647,
7999
8635
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
8000
8636
  },
8001
- creative_mode: { type: 'boolean', default: !1, description: er('image') },
8637
+ creative_mode: { type: 'boolean', default: !1, description: cr('image') },
8002
8638
  },
8003
8639
  required: ['prompt'],
8004
8640
  additionalProperties: !0,
@@ -8035,7 +8671,7 @@ function La() {
8035
8671
  default: '480p',
8036
8672
  description: 'Video resolution (the lowest price is the default; see each model tool).',
8037
8673
  },
8038
- creative_mode: { type: 'boolean', default: !1, description: er('video') },
8674
+ creative_mode: { type: 'boolean', default: !1, description: cr('video') },
8039
8675
  priority: {
8040
8676
  type: 'boolean',
8041
8677
  default: !1,
@@ -8173,10 +8809,10 @@ function La() {
8173
8809
  additionalProperties: !0,
8174
8810
  },
8175
8811
  },
8176
- p = Na();
8177
- return [n, s, o, u, l, p, c, $a];
8812
+ p = oa();
8813
+ return [n, s, o, u, l, p, c, ta];
8178
8814
  }
8179
- function Na() {
8815
+ function oa() {
8180
8816
  return {
8181
8817
  name: 'upload_asset',
8182
8818
  description:
@@ -8223,26 +8859,26 @@ function Na() {
8223
8859
  },
8224
8860
  };
8225
8861
  }
8226
- function Xe() {
8227
- let e = La(),
8228
- t = O().map((r) => Da(r));
8229
- return [...e, ...t].map(Aa).map(Ra);
8862
+ function rt() {
8863
+ let e = sa(),
8864
+ t = D().map((r) => na(r));
8865
+ return [...e, ...t].map(ra).map(ia);
8230
8866
  }
8231
- var qa,
8232
- Ca,
8233
- $a,
8234
- tr,
8235
- rr = y(() => {
8867
+ var Zi,
8868
+ ea,
8869
+ ta,
8870
+ ur,
8871
+ mr = y(() => {
8236
8872
  'use strict';
8237
- F();
8238
- Ae();
8239
- X();
8240
- ((qa = {
8873
+ B();
8874
+ Ve();
8875
+ Q();
8876
+ ((Zi = {
8241
8877
  type: 'string',
8242
8878
  description:
8243
8879
  '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.',
8244
8880
  }),
8245
- (Ca = new Set([
8881
+ (ea = new Set([
8246
8882
  'upload_asset',
8247
8883
  'upload_media',
8248
8884
  'upload_image',
@@ -8250,7 +8886,7 @@ var qa,
8250
8886
  'check_status',
8251
8887
  'get_pricing',
8252
8888
  ])),
8253
- ($a = {
8889
+ (ta = {
8254
8890
  name: 'get_pricing',
8255
8891
  description:
8256
8892
  '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.',
@@ -8265,7 +8901,7 @@ var qa,
8265
8901
  additionalProperties: !1,
8266
8902
  },
8267
8903
  }));
8268
- tr = new Set([
8904
+ ur = new Set([
8269
8905
  'image',
8270
8906
  'images',
8271
8907
  'image_url',
@@ -8282,28 +8918,28 @@ var qa,
8282
8918
  'lipsyncing_audio',
8283
8919
  ]);
8284
8920
  });
8285
- var ur = {};
8286
- wr(ur, {
8287
- forgetToolSchemas: () => ja,
8288
- jsonRpcAnswer: () => sr,
8289
- preprocessLocalFiles: () => dr,
8290
- startStdioServer: () => cr,
8921
+ var Pr = {};
8922
+ Cr(Pr, {
8923
+ forgetToolSchemas: () => ua,
8924
+ jsonRpcAnswer: () => yr,
8925
+ preprocessLocalFiles: () => xr,
8926
+ startStdioServer: () => _r,
8291
8927
  });
8292
- function Ua(e) {
8928
+ function la(e) {
8293
8929
  let t = (r) =>
8294
8930
  !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
8295
8931
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
8296
8932
  }
8297
- function sr(e, t, r) {
8298
- let a = e?.id,
8299
- n = a == null,
8933
+ function yr(e, t, r) {
8934
+ let i = e?.id,
8935
+ n = i == null,
8300
8936
  s = null;
8301
8937
  try {
8302
8938
  s = r ? JSON.parse(r) : null;
8303
8939
  } catch {
8304
8940
  s = null;
8305
8941
  }
8306
- if (s !== null && Ua(s)) return n ? null : s;
8942
+ if (s !== null && la(s)) return n ? null : s;
8307
8943
  if (n) return null;
8308
8944
  if (!r && t >= 200 && t < 300) return;
8309
8945
  let o = s?.error,
@@ -8316,7 +8952,7 @@ function sr(e, t, r) {
8316
8952
  l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
8317
8953
  return {
8318
8954
  jsonrpc: '2.0',
8319
- id: a,
8955
+ id: i,
8320
8956
  error: {
8321
8957
  code: t === 401 ? -32001 : -32603,
8322
8958
  message: u,
@@ -8324,16 +8960,16 @@ function sr(e, t, r) {
8324
8960
  },
8325
8961
  };
8326
8962
  }
8327
- function Va() {
8963
+ function pa() {
8328
8964
  let e = process.argv.slice(2),
8329
8965
  t = e.indexOf('--api-key');
8330
8966
  return E(t >= 0 ? e[t + 1] : void 0);
8331
8967
  }
8332
- async function or(e, t, r) {
8333
- let a = j.default.resolve(e);
8334
- if (!D.default.existsSync(a) || !D.default.statSync(a).isFile())
8968
+ async function br(e, t, r) {
8969
+ let i = G.default.resolve(e);
8970
+ if (!L.default.existsSync(i) || !L.default.statSync(i).isFile())
8335
8971
  throw new Error(`File not found: ${e}`);
8336
- let n = D.default.readFileSync(a),
8972
+ let n = L.default.readFileSync(i),
8337
8973
  s = n.toString('base64'),
8338
8974
  o = n.length,
8339
8975
  u = `${r.replace(/\/$/, '')}/v1/upload`,
@@ -8358,15 +8994,15 @@ async function or(e, t, r) {
8358
8994
  mimeType: c.mime_type || c.mimeType || 'image/png',
8359
8995
  };
8360
8996
  }
8361
- function lr(e) {
8362
- return Fa.has(j.default.extname(e).toLowerCase());
8997
+ function kr(e) {
8998
+ return da.has(G.default.extname(e).toLowerCase());
8363
8999
  }
8364
- function pr(e) {
9000
+ function wr(e) {
8365
9001
  return new Error(
8366
- `Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
9002
+ `Tein uploads image, video and audio files only, and ${G.default.basename(e)} is not one.`,
8367
9003
  );
8368
9004
  }
8369
- function Ba(e) {
9005
+ function ca(e) {
8370
9006
  let t = e.trim();
8371
9007
  if (
8372
9008
  !t ||
@@ -8376,27 +9012,27 @@ function Ba(e) {
8376
9012
  `)
8377
9013
  )
8378
9014
  return null;
8379
- let r = j.default.resolve(t);
8380
- return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
9015
+ let r = G.default.resolve(t);
9016
+ return L.default.existsSync(r) && L.default.statSync(r).isFile() ? r : null;
8381
9017
  }
8382
- function Ze(e) {
9018
+ function at(e) {
8383
9019
  if (Array.isArray(e))
8384
9020
  for (let t of e) {
8385
9021
  let r = t;
8386
9022
  typeof r.name == 'string' &&
8387
9023
  r.inputSchema &&
8388
9024
  typeof r.inputSchema == 'object' &&
8389
- ee.set(r.name, r.inputSchema);
9025
+ te.set(r.name, r.inputSchema);
8390
9026
  }
8391
9027
  }
8392
- function ja() {
8393
- (ee.clear(), (Qe = 0));
9028
+ function ua() {
9029
+ (te.clear(), (it = 0));
8394
9030
  }
8395
- async function Ga(e, t) {
8396
- if (!(Date.now() - Qe < 6e4)) {
8397
- Qe = Date.now();
9031
+ async function ma(e, t) {
9032
+ if (!(Date.now() - it < 6e4)) {
9033
+ it = Date.now();
8398
9034
  try {
8399
- let a = await (
9035
+ let i = await (
8400
9036
  await fetch(e, {
8401
9037
  method: 'POST',
8402
9038
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
@@ -8404,39 +9040,39 @@ async function Ga(e, t) {
8404
9040
  signal: AbortSignal.timeout(1e4),
8405
9041
  })
8406
9042
  ).json();
8407
- Ze(a.result?.tools);
9043
+ at(i.result?.tools);
8408
9044
  } catch {}
8409
9045
  }
8410
9046
  }
8411
- function Ha(e) {
9047
+ function fa(e) {
8412
9048
  return e
8413
9049
  ? e.type === 'string'
8414
9050
  ? e.format === 'uri'
8415
9051
  : e.type === 'array' && e.items?.format === 'uri'
8416
9052
  : !1;
8417
9053
  }
8418
- async function ar(e, t, r) {
9054
+ async function fr(e, t, r) {
8419
9055
  if (typeof e != 'string') return e;
8420
- let a = Ba(e);
8421
- if (!a) return e;
8422
- if (!lr(a)) throw pr(a);
8423
- return (await or(a, t, r)).url;
9056
+ let i = ca(e);
9057
+ if (!i) return e;
9058
+ if (!kr(i)) throw wr(i);
9059
+ return (await br(i, t, r)).url;
8424
9060
  }
8425
- async function dr(e, t, r, a, n) {
8426
- (ee.size === 0 && Ze(Xe()), ee.has(e) || (await Ga(n, r)));
8427
- let s = ee.get(e)?.properties;
9061
+ async function xr(e, t, r, i, n) {
9062
+ (te.size === 0 && at(rt()), te.has(e) || (await ma(n, r)));
9063
+ let s = te.get(e)?.properties;
8428
9064
  if (!s) return t;
8429
9065
  let o = { ...t };
8430
9066
  for (let [u, l] of Object.entries(t))
8431
- if (Ha(s[u]))
9067
+ if (fa(s[u]))
8432
9068
  if (Array.isArray(l)) {
8433
9069
  let c = [];
8434
- for (let p of l) c.push(await ar(p, r, a));
9070
+ for (let p of l) c.push(await fr(p, r, i));
8435
9071
  o[u] = c;
8436
- } else o[u] = await ar(l, r, a);
9072
+ } else o[u] = await fr(l, r, i);
8437
9073
  return o;
8438
9074
  }
8439
- function za(e) {
9075
+ function ga(e) {
8440
9076
  let t = e.id ?? null;
8441
9077
  switch (e.method) {
8442
9078
  case 'initialize':
@@ -8454,7 +9090,7 @@ function za(e) {
8454
9090
  case 'ping':
8455
9091
  return { jsonrpc: '2.0', id: t, result: {} };
8456
9092
  case 'tools/list':
8457
- return { jsonrpc: '2.0', id: t, result: { tools: Xe() } };
9093
+ return { jsonrpc: '2.0', id: t, result: { tools: rt() } };
8458
9094
  case 'tools/call':
8459
9095
  return {
8460
9096
  jsonrpc: '2.0',
@@ -8477,13 +9113,13 @@ function za(e) {
8477
9113
  };
8478
9114
  }
8479
9115
  }
8480
- async function cr() {
8481
- if (ir) return;
8482
- ir = !0;
8483
- let e = Va(),
8484
- t = I(),
9116
+ async function _r() {
9117
+ if (gr) return;
9118
+ gr = !0;
9119
+ let e = pa(),
9120
+ t = P(),
8485
9121
  r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
8486
- (nr.default
9122
+ (hr.default
8487
9123
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
8488
9124
  .on('line', async (n) => {
8489
9125
  let s = n.trim();
@@ -8495,7 +9131,7 @@ async function cr() {
8495
9131
  c = o.params.arguments || {};
8496
9132
  if (l === 'get_pricing') {
8497
9133
  let p = typeof c.model == 'string' ? c.model.trim() : '',
8498
- d = `${t.replace(/\/+$/, '')}${ye(p)}`;
9134
+ d = `${t.replace(/\/+$/, '')}${ke(p)}`;
8499
9135
  try {
8500
9136
  let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
8501
9137
  h = await m.text();
@@ -8542,19 +9178,19 @@ async function cr() {
8542
9178
  !p.startsWith('data:')
8543
9179
  )
8544
9180
  try {
8545
- let d = j.default.resolve(p.trim());
8546
- if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
8547
- if (!lr(d)) throw pr(d);
8548
- let m = await or(d, e, t),
9181
+ let d = G.default.resolve(p.trim());
9182
+ if (L.default.existsSync(d) && L.default.statSync(d).isFile() && e) {
9183
+ if (!kr(d)) throw wr(d);
9184
+ let m = await br(d, e, t),
8549
9185
  h = (m.sizeBytes / 1024).toFixed(1),
8550
- be =
9186
+ we =
8551
9187
  m.mimeType.startsWith('image/') ||
8552
9188
  /\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
8553
9189
  ? `
8554
9190
 
8555
9191
  ![Uploaded Asset](${m.url})`
8556
9192
  : '',
8557
- ke = {
9193
+ xe = {
8558
9194
  jsonrpc: '2.0',
8559
9195
  id: o.id,
8560
9196
  result: {
@@ -8565,7 +9201,7 @@ async function cr() {
8565
9201
 
8566
9202
  - **URL:** ${m.url}
8567
9203
  - **Type:** \`${m.mimeType}\`
8568
- - **Size:** ${h} KB${be}
9204
+ - **Size:** ${h} KB${we}
8569
9205
 
8570
9206
  Pass this URL to any Tein generation tool.`,
8571
9207
  },
@@ -8574,7 +9210,7 @@ Pass this URL to any Tein generation tool.`,
8574
9210
  },
8575
9211
  };
8576
9212
  process.stdout.write(
8577
- JSON.stringify(ke) +
9213
+ JSON.stringify(xe) +
8578
9214
  `
8579
9215
  `,
8580
9216
  );
@@ -8601,7 +9237,7 @@ Pass this URL to any Tein generation tool.`,
8601
9237
  }
8602
9238
  if (e)
8603
9239
  try {
8604
- o.params.arguments = await dr(String(l), c, e, t, r);
9240
+ o.params.arguments = await xr(String(l), c, e, t, r);
8605
9241
  } catch (p) {
8606
9242
  let d = p instanceof Error ? p.message : String(p);
8607
9243
  process.stdout.write(
@@ -8632,10 +9268,10 @@ Pass this URL to any Tein generation tool.`,
8632
9268
  body: JSON.stringify(o),
8633
9269
  }),
8634
9270
  c = await l.text(),
8635
- p = sr(o, l.status, c);
9271
+ p = yr(o, l.status, c);
8636
9272
  if (p === null) return;
8637
9273
  if (p) {
8638
- (o?.method === 'tools/list' && Ze(p.result?.tools),
9274
+ (o?.method === 'tools/list' && at(p.result?.tools),
8639
9275
  process.stdout.write(
8640
9276
  JSON.stringify(p) +
8641
9277
  `
@@ -8644,7 +9280,7 @@ Pass this URL to any Tein generation tool.`,
8644
9280
  return;
8645
9281
  }
8646
9282
  } catch {}
8647
- let u = za(o);
9283
+ let u = ga(o);
8648
9284
  u !== null &&
8649
9285
  process.stdout.write(
8650
9286
  JSON.stringify(u) +
@@ -8667,22 +9303,22 @@ Pass this URL to any Tein generation tool.`,
8667
9303
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
8668
9304
  `));
8669
9305
  }
8670
- var D,
8671
- j,
8672
- nr,
8673
- Fa,
8674
- ee,
8675
- Qe,
8676
- ir,
8677
- mr = y(() => {
9306
+ var L,
9307
+ G,
9308
+ hr,
9309
+ da,
9310
+ te,
9311
+ it,
9312
+ gr,
9313
+ Ir = y(() => {
8678
9314
  'use strict';
8679
- ((D = _(require('node:fs'))),
8680
- (j = _(require('node:path'))),
8681
- (nr = _(require('node:readline'))));
8682
- Ge();
8683
- rr();
9315
+ ((L = I(require('node:fs'))),
9316
+ (G = I(require('node:path'))),
9317
+ (hr = I(require('node:readline'))));
9318
+ Ye();
9319
+ mr();
8684
9320
  A();
8685
- Fa = new Set([
9321
+ da = new Set([
8686
9322
  '.png',
8687
9323
  '.jpg',
8688
9324
  '.jpeg',
@@ -8708,22 +9344,22 @@ var D,
8708
9344
  '.flac',
8709
9345
  '.opus',
8710
9346
  ]);
8711
- ((ee = new Map()), (Qe = 0));
8712
- ir = !1;
9347
+ ((te = new Map()), (it = 0));
9348
+ gr = !1;
8713
9349
  require.main === module &&
8714
- cr().catch((e) => {
9350
+ _r().catch((e) => {
8715
9351
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
8716
9352
  `),
8717
9353
  process.exit(1));
8718
9354
  });
8719
9355
  });
8720
- var Pr =
9356
+ var qr =
8721
9357
  !process.env.NO_COLOR &&
8722
9358
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
8723
9359
  function k(e, t) {
8724
- return (r) => (Pr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
9360
+ return (r) => (qr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
8725
9361
  }
8726
- var i = {
9362
+ var a = {
8727
9363
  bold: k(1, 22),
8728
9364
  dim: k(2, 22),
8729
9365
  italic: k(3, 23),
@@ -8767,7 +9403,7 @@ var i = {
8767
9403
  process.stdout.isTTY
8768
9404
  ? (this.stop(),
8769
9405
  (this.timer = setInterval(() => {
8770
- let r = i.cyan(this.frames[this.current]);
9406
+ let r = a.cyan(this.frames[this.current]);
8771
9407
  (process.stdout.write(`\r${r} ${this.text} `),
8772
9408
  (this.current = (this.current + 1) % this.frames.length));
8773
9409
  }, 80)),
@@ -8784,7 +9420,7 @@ var i = {
8784
9420
  this.stop();
8785
9421
  let r = t || this.text;
8786
9422
  process.stdout.isTTY
8787
- ? process.stdout.write(`\r${i.green('\u2713')} ${r}
9423
+ ? process.stdout.write(`\r${a.green('\u2713')} ${r}
8788
9424
  `)
8789
9425
  : process.stdout.write(`[\u2713] ${r}
8790
9426
  `);
@@ -8793,7 +9429,7 @@ var i = {
8793
9429
  this.stop();
8794
9430
  let r = t || this.text;
8795
9431
  process.stdout.isTTY
8796
- ? process.stdout.write(`\r${i.red('\u2717')} ${r}
9432
+ ? process.stdout.write(`\r${a.red('\u2717')} ${r}
8797
9433
  `)
8798
9434
  : process.stdout.write(`[\u2717] ${r}
8799
9435
  `);
@@ -8805,13 +9441,13 @@ var i = {
8805
9441
  process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
8806
9442
  }
8807
9443
  };
8808
- var N = _(require('node:fs')),
8809
- q = _(require('node:path'));
8810
- var re = _(require('node:fs')),
8811
- at = _(require('node:path')),
8812
- it = require('node:stream/promises');
8813
- var te = '1.1.7';
8814
- var Ir = new Set([
9444
+ var N = I(require('node:fs')),
9445
+ C = I(require('node:path'));
9446
+ var ie = I(require('node:fs')),
9447
+ lt = I(require('node:path')),
9448
+ pt = require('node:stream/promises');
9449
+ var re = '1.1.7';
9450
+ var Ar = new Set([
8815
9451
  'account_suspended',
8816
9452
  'account_terminated',
8817
9453
  'creative_mode_restricted',
@@ -8819,59 +9455,59 @@ var Ir = new Set([
8819
9455
  'workspace_paused',
8820
9456
  ]),
8821
9457
  v = 1,
8822
- _r = 3,
9458
+ Or = 3,
8823
9459
  w = class extends Error {
8824
- constructor(t, r, a, n = {}) {
9460
+ constructor(t, r, i, n = {}) {
8825
9461
  (super(r),
8826
9462
  (this.name = 'TeinApiError'),
8827
9463
  (this.status = t),
8828
- a && (this.code = a),
9464
+ i && (this.code = i),
8829
9465
  (this.fields = n));
8830
9466
  }
8831
9467
  get exitCode() {
8832
- return this.code && Ir.has(this.code) ? _r : v;
9468
+ return this.code && Ar.has(this.code) ? Or : v;
8833
9469
  }
8834
9470
  };
8835
- function vr(e, t, r) {
8836
- let a = `HTTP ${e}${t ? ` ${t}` : ''}`;
8837
- if (!r || typeof r != 'object') return new w(e, a);
9471
+ function Rr(e, t, r) {
9472
+ let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
9473
+ if (!r || typeof r != 'object') return new w(e, i);
8838
9474
  let n = r;
8839
9475
  if (n.error && typeof n.error == 'object' && !Array.isArray(n.error)) {
8840
9476
  let p = n.error,
8841
9477
  { code: d, message: m, ...h } = p;
8842
- return new w(e, typeof m == 'string' && m ? m : a, typeof d == 'string' ? d : void 0, h);
9478
+ return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
8843
9479
  }
8844
9480
  let { error: s, code: o, message: u, ...l } = n,
8845
- c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || a;
9481
+ c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || i;
8846
9482
  return new w(e, c, typeof o == 'string' ? o : void 0, l);
8847
9483
  }
8848
- function tt(e) {
9484
+ function st(e) {
8849
9485
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
8850
9486
  }
8851
9487
  function S(e) {
8852
9488
  let t = [e.message],
8853
- r = tt(e.fields.required),
8854
- a = tt(e.fields.balance);
8855
- (r || a) &&
8856
- t.push([r ? `Required: ${r}` : '', a ? `Balance: ${a}` : ''].filter(Boolean).join(' '));
9489
+ r = st(e.fields.required),
9490
+ i = st(e.fields.balance);
9491
+ (r || i) &&
9492
+ t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
8857
9493
  let n = e.fields.org_name ?? e.fields.orgName;
8858
9494
  typeof n == 'string' && n && t.push(`Workspace: ${n}`);
8859
9495
  let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
8860
9496
  return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
8861
9497
  }
8862
- function Tr(e) {
9498
+ function Dr(e) {
8863
9499
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
8864
9500
  ? 'video'
8865
9501
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
8866
9502
  ? 'audio'
8867
9503
  : 'image';
8868
9504
  }
8869
- function rt(e) {
9505
+ function ot(e) {
8870
9506
  let t = [];
8871
9507
  for (let r of e.data ?? [])
8872
9508
  typeof r.message?.content == 'string'
8873
9509
  ? t.push({ type: 'text', text: r.message.content })
8874
- : r.url && t.push({ type: Tr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
9510
+ : r.url && t.push({ type: Dr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
8875
9511
  return t;
8876
9512
  }
8877
9513
  var K = class {
@@ -8882,22 +9518,22 @@ var K = class {
8882
9518
  return {
8883
9519
  'Content-Type': 'application/json',
8884
9520
  Authorization: `Bearer ${this.apiKey}`,
8885
- 'User-Agent': `Tein-CLI/${te}`,
9521
+ 'User-Agent': `Tein-CLI/${re}`,
8886
9522
  'X-Tein-Client': 'cli',
8887
9523
  };
8888
9524
  }
8889
- async send(t, r, a) {
9525
+ async send(t, r, i) {
8890
9526
  let n = await fetch(`${this.baseUrl}${r}`, {
8891
9527
  method: t,
8892
9528
  headers: this.getHeaders(),
8893
- ...(a === void 0 ? {} : { body: JSON.stringify(a) }),
9529
+ ...(i === void 0 ? {} : { body: JSON.stringify(i) }),
8894
9530
  });
8895
9531
  if (!n.ok) {
8896
9532
  let s = null;
8897
9533
  try {
8898
9534
  s = await n.json();
8899
9535
  } catch {}
8900
- throw vr(n.status, n.statusText, s);
9536
+ throw Rr(n.status, n.statusText, s);
8901
9537
  }
8902
9538
  return await n.json();
8903
9539
  }
@@ -8905,31 +9541,31 @@ var K = class {
8905
9541
  await this.send('GET', '/v1/jobs?limit=1');
8906
9542
  }
8907
9543
  queueJob(t, r) {
8908
- return this.send('POST', '/v1/generate', { model: t, ...r }).then((a) => {
8909
- let n = a.status,
9544
+ return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
9545
+ let n = i.status,
8910
9546
  s =
8911
9547
  n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
8912
9548
  ? n
8913
9549
  : 'processing',
8914
- o = rt(a);
9550
+ o = ot(i);
8915
9551
  return {
8916
- request_id: a.request_id || a.id || '',
8917
- model: a.model,
9552
+ request_id: i.request_id || i.id || '',
9553
+ model: i.model,
8918
9554
  status: s,
8919
9555
  ...(o.length ? { output: o } : {}),
8920
- error: a.error && typeof a.error.message == 'string' ? a.error.message : null,
8921
- ...(a.usage ? { usage: a.usage } : {}),
9556
+ error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
9557
+ ...(i.usage ? { usage: i.usage } : {}),
8922
9558
  };
8923
9559
  });
8924
9560
  }
8925
9561
  getStatus(t) {
8926
9562
  return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
8927
- let a = r.status,
9563
+ let i = r.status,
8928
9564
  n =
8929
- a === 'succeeded' || a === 'failed' || a === 'expired' || a === 'cancelled'
8930
- ? a
9565
+ i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
9566
+ ? i
8931
9567
  : 'processing',
8932
- s = rt(r),
9568
+ s = ot(r),
8933
9569
  o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
8934
9570
  return {
8935
9571
  request_id: r.id || t,
@@ -8945,65 +9581,65 @@ var K = class {
8945
9581
  return this.send('POST', '/v1/upload', { data: t });
8946
9582
  }
8947
9583
  async downloadOutput(t, r) {
8948
- let a = await fetch(t);
8949
- if (!a.ok) throw new Error(`The file could not be downloaded (HTTP ${a.status})`);
8950
- let n = at.default.dirname(r);
8951
- re.default.existsSync(n) || re.default.mkdirSync(n, { recursive: !0 });
8952
- let s = re.default.createWriteStream(r);
8953
- return (await (0, it.pipeline)(a.body, s), r);
9584
+ let i = await fetch(t);
9585
+ if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
9586
+ let n = lt.default.dirname(r);
9587
+ ie.default.existsSync(n) || ie.default.mkdirSync(n, { recursive: !0 });
9588
+ let s = ie.default.createWriteStream(r);
9589
+ return (await (0, pt.pipeline)(i.body, s), r);
8954
9590
  }
8955
9591
  };
8956
9592
  A();
8957
- function _e(e) {
9593
+ function Te(e) {
8958
9594
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
8959
9595
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
8960
9596
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
8961
9597
  r = 10 ** t,
8962
- a = Math.round(Number((e * r).toFixed(6))) / r;
8963
- return a >= 1 ? `$${a.toFixed(4)}` : `$${a.toFixed(t).replace(/0+$/, '')}`;
9598
+ i = Math.round(Number((e * r).toFixed(6))) / r;
9599
+ return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
8964
9600
  }
8965
- X();
8966
- var Bt = ['images', 'input_images', 'videos', 'audios'];
8967
- function ca(e) {
8968
- for (let t of Bt) typeof e[t] == 'string' && (e[t] = [e[t]]);
9601
+ Q();
9602
+ var er = ['images', 'input_images', 'videos', 'audios'];
9603
+ function qi(e) {
9604
+ for (let t of er) typeof e[t] == 'string' && (e[t] = [e[t]]);
8969
9605
  }
8970
- function ua(e) {
9606
+ function Ai(e) {
8971
9607
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
8972
- let t = q.default.resolve(e);
9608
+ let t = C.default.resolve(e);
8973
9609
  return N.default.existsSync(t) && N.default.statSync(t).isFile() ? t : null;
8974
9610
  }
8975
- async function ma(e, t) {
8976
- for (let r of Bt) {
9611
+ async function Oi(e, t) {
9612
+ for (let r of er) {
8977
9613
  if (!Array.isArray(e[r])) continue;
8978
- let a = [];
9614
+ let i = [];
8979
9615
  for (let n of e[r]) {
8980
9616
  if (typeof n != 'string') continue;
8981
- let s = ua(n);
8982
- a.push(s ? await t(s) : n);
9617
+ let s = Ai(n);
9618
+ i.push(s ? await t(s) : n);
8983
9619
  }
8984
- e[r] = a;
9620
+ e[r] = i;
8985
9621
  }
8986
9622
  }
8987
- var Q = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
8988
- function fa(e) {
9623
+ var Z = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
9624
+ function Ri(e) {
8989
9625
  if (e.count === void 0 || e.count === !0) return 1;
8990
9626
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
8991
- r = Q.enterprise;
9627
+ r = Z.enterprise;
8992
9628
  return (
8993
9629
  (!Number.isInteger(t) || t < 1 || t > r) &&
8994
9630
  (process.stderr
8995
- .write(`${i.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Q.starter}, Plus ${Q.plus}, Scale ${Q.scale}, Enterprise ${Q.enterprise} at once, including polling.
9631
+ .write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Z.starter}, Plus ${Z.plus}, Scale ${Z.scale}, Enterprise ${Z.enterprise} at once, including polling.
8996
9632
  `),
8997
9633
  process.exit(1)),
8998
9634
  t
8999
9635
  );
9000
9636
  }
9001
- async function ga(e, t, r, a, n) {
9637
+ async function Di(e, t, r, i, n) {
9002
9638
  n.isJson ||
9003
- process.stderr.write(`Starting ${a} ${t} jobs together...
9639
+ process.stderr.write(`Starting ${i} ${t} jobs together...
9004
9640
  `);
9005
9641
  let s = await Promise.all(
9006
- Array.from({ length: a }, async () => {
9642
+ Array.from({ length: i }, async () => {
9007
9643
  try {
9008
9644
  return { job: await e.queueJob(t, r) };
9009
9645
  } catch (l) {
@@ -9028,7 +9664,7 @@ async function ga(e, t, r, a, n) {
9028
9664
  for (; c.length;) {
9029
9665
  if ((await new Promise((d) => setTimeout(d, 2e3)), !n.isJson)) {
9030
9666
  let d = Math.round((Date.now() - l) / 1e3);
9031
- process.stderr.write(`Waiting on ${c.length} of ${a} (${d}s)...
9667
+ process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
9032
9668
  `);
9033
9669
  }
9034
9670
  let p = await Promise.all(
@@ -9060,7 +9696,7 @@ async function ga(e, t, r, a, n) {
9060
9696
  else {
9061
9697
  for (let l of o)
9062
9698
  (process.stdout.write(`${l.request_id} ${l.status}`),
9063
- l.usage?.cost !== void 0 && process.stdout.write(` ${_e(l.usage.cost)}`),
9699
+ l.usage?.cost !== void 0 && process.stdout.write(` ${Te(l.usage.cost)}`),
9064
9700
  l.error && process.stdout.write(` ${l.error}`),
9065
9701
  process.stdout.write(`
9066
9702
  `));
@@ -9073,15 +9709,15 @@ async function ga(e, t, r, a, n) {
9073
9709
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
9074
9710
  process.exit(v);
9075
9711
  }
9076
- function ha(e, t, r) {
9712
+ function Li(e, t, r) {
9077
9713
  if (r <= 1) return e;
9078
- let a = q.default.extname(e);
9079
- return `${e.slice(0, e.length - a.length)}-${t + 1}${a}`;
9714
+ let i = C.default.extname(e);
9715
+ return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
9080
9716
  }
9081
- function jt(e) {
9717
+ function tr(e) {
9082
9718
  let t = {},
9083
9719
  r = new Set(),
9084
- a = [];
9720
+ i = [];
9085
9721
  for (let n = 0; n < e.length; n++) {
9086
9722
  let s = e[n];
9087
9723
  if (s.startsWith('--')) {
@@ -9119,33 +9755,33 @@ function jt(e) {
9119
9755
  : n + 1 < e.length && !e[n + 1].startsWith('-')
9120
9756
  ? ((t[l] = e[n + 1]), n++)
9121
9757
  : (t[l] = !0);
9122
- } else a.push(s);
9758
+ } else i.push(s);
9123
9759
  }
9124
- return { command: a[0] || '', subcommand: a[1], modelSlug: a[1] || a[0], options: t, flags: r };
9760
+ return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
9125
9761
  }
9126
- async function je(e, t) {
9762
+ async function We(e, t) {
9127
9763
  let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
9128
- a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
9764
+ i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
9129
9765
  (r ||
9130
- (process.stderr.write(`${i.red('Error:')} Authentication required.
9766
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
9131
9767
  `),
9132
9768
  process.stderr
9133
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
9769
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9134
9770
  `),
9135
9771
  process.exit(1)),
9136
9772
  e ||
9137
- (process.stderr.write(`${i.red('Error:')} Missing model slug.
9773
+ (process.stderr.write(`${a.red('Error:')} Missing model slug.
9138
9774
  `),
9139
- process.stderr.write(`Usage: ${i.cyan('tein run <model-slug> --prompt "..."')}
9775
+ process.stderr.write(`Usage: ${a.cyan('tein run <model-slug> --prompt "..."')}
9140
9776
  `),
9141
- process.stderr.write(`Run ${i.cyan('tein models')} to list all available models.
9777
+ process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
9142
9778
  `),
9143
9779
  process.exit(1)));
9144
- let n = B(e),
9780
+ let n = j(e),
9145
9781
  s = !!t.json,
9146
9782
  o = !!(t.async || t.no_wait),
9147
9783
  u = typeof t.output == 'string' ? t.output : void 0,
9148
- l = fa(t),
9784
+ l = Ri(t),
9149
9785
  c = { ...t };
9150
9786
  (delete c.json,
9151
9787
  delete c.async,
@@ -9154,14 +9790,14 @@ async function je(e, t) {
9154
9790
  delete c.api_key,
9155
9791
  delete c.api_url,
9156
9792
  delete c.count);
9157
- let p = Ft(n, c);
9158
- (ca(p),
9159
- typeof p.image == 'string' && !p.images && !he(n) && ((p.images = [p.image]), delete p.image),
9793
+ let p = Zt(n, c);
9794
+ (qi(p),
9795
+ typeof p.image == 'string' && !p.images && !be(n) && ((p.images = [p.image]), delete p.image),
9160
9796
  p.image_url &&
9161
9797
  !p.first_frame_image &&
9162
9798
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
9163
9799
  (p.first_frame_image = p.image_url));
9164
- let d = new K(r, a),
9800
+ let d = new K(r, i),
9165
9801
  m = [
9166
9802
  'image',
9167
9803
  'mask_image',
@@ -9170,57 +9806,59 @@ async function je(e, t) {
9170
9806
  'lipsyncing_audio',
9171
9807
  'audio',
9172
9808
  'video',
9809
+ 'image_url',
9810
+ 'video_url',
9173
9811
  ];
9174
9812
  for (let b of m) {
9175
9813
  let g = p[b];
9176
9814
  if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
9177
- let x = q.default.resolve(g);
9815
+ let x = C.default.resolve(g);
9178
9816
  if (N.default.existsSync(x) && N.default.statSync(x).isFile()) {
9179
- let P = new T(`Uploading local file ${q.default.basename(x)} to CDN...`);
9180
- s || P.start();
9817
+ let _ = new T(`Uploading local file ${C.default.basename(x)} to CDN...`);
9818
+ s || _.start();
9181
9819
  try {
9182
- let L = N.default.readFileSync(x),
9183
- C = await d.uploadAsset(L.toString('base64'));
9184
- ((p[b] = C.url), s || P.succeed(`Uploaded ${q.default.basename(x)} to CDN`));
9185
- } catch (L) {
9186
- let C = L instanceof Error ? L.message : String(L);
9820
+ let V = N.default.readFileSync(x),
9821
+ $ = await d.uploadAsset(V.toString('base64'));
9822
+ ((p[b] = $.url), s || _.succeed(`Uploaded ${C.default.basename(x)} to CDN`));
9823
+ } catch (V) {
9824
+ let $ = V instanceof Error ? V.message : String(V);
9187
9825
  (s
9188
9826
  ? process.stdout.write(
9189
- JSON.stringify({ error: C }) +
9827
+ JSON.stringify({ error: $ }) +
9190
9828
  `
9191
9829
  `,
9192
9830
  )
9193
- : P.fail(`Upload failed: ${C}`),
9831
+ : _.fail(`Upload failed: ${$}`),
9194
9832
  process.exit(1));
9195
9833
  }
9196
9834
  }
9197
9835
  }
9198
9836
  }
9199
- await ma(p, async (b) => {
9200
- let g = new T(`Uploading local file ${q.default.basename(b)} to CDN...`);
9837
+ await Oi(p, async (b) => {
9838
+ let g = new T(`Uploading local file ${C.default.basename(b)} to CDN...`);
9201
9839
  s || g.start();
9202
9840
  try {
9203
9841
  let x = N.default.readFileSync(b),
9204
- P = await d.uploadAsset(x.toString('base64'));
9205
- return (s || g.succeed(`Uploaded ${q.default.basename(b)} to CDN`), P.url);
9842
+ _ = await d.uploadAsset(x.toString('base64'));
9843
+ return (s || g.succeed(`Uploaded ${C.default.basename(b)} to CDN`), _.url);
9206
9844
  } catch (x) {
9207
- let P = x instanceof Error ? x.message : String(x);
9845
+ let _ = x instanceof Error ? x.message : String(x);
9208
9846
  (s
9209
9847
  ? process.stdout.write(
9210
- JSON.stringify({ error: P }) +
9848
+ JSON.stringify({ error: _ }) +
9211
9849
  `
9212
9850
  `,
9213
9851
  )
9214
- : g.fail(`Upload failed: ${P}`),
9852
+ : g.fail(`Upload failed: ${_}`),
9215
9853
  process.exit(1));
9216
9854
  }
9217
9855
  });
9218
- let h = new T(`Submitting task for ${i.bold(e)}...`);
9856
+ let h = new T(`Submitting task for ${a.bold(e)}...`);
9219
9857
  s || h.start();
9220
9858
  let f;
9221
9859
  try {
9222
9860
  if (l > 1) {
9223
- await ga(d, e, p, l, { isJson: s, isAsync: o });
9861
+ await Di(d, e, p, l, { isJson: s, isAsync: o });
9224
9862
  return;
9225
9863
  }
9226
9864
  f = await d.queueJob(e, p);
@@ -9253,17 +9891,17 @@ async function je(e, t) {
9253
9891
  `
9254
9892
  `,
9255
9893
  )
9256
- : (h.succeed(`Queued successfully! Request ID: ${i.bold(f.request_id)}`),
9257
- process.stdout.write(`Check status anytime with: ${i.cyan(`tein status ${f.request_id}`)}
9894
+ : (h.succeed(`Queued successfully! Request ID: ${a.bold(f.request_id)}`),
9895
+ process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${f.request_id}`)}
9258
9896
  `));
9259
9897
  return;
9260
9898
  }
9261
- let be = Date.now(),
9262
- ke = 1500;
9899
+ let we = Date.now(),
9900
+ xe = 1500;
9263
9901
  for (; f.status === 'processing';) {
9264
- let b = Math.round((Date.now() - be) / 1e3);
9265
- (s || h.update(`Rendering ${i.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
9266
- await new Promise((g) => setTimeout(g, ke)));
9902
+ let b = Math.round((Date.now() - we) / 1e3);
9903
+ (s || h.update(`Rendering ${a.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
9904
+ await new Promise((g) => setTimeout(g, xe)));
9267
9905
  try {
9268
9906
  f = await d.getStatus(f.request_id);
9269
9907
  } catch (g) {
@@ -9287,7 +9925,7 @@ async function je(e, t) {
9287
9925
  )
9288
9926
  : h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
9289
9927
  process.exit(v)),
9290
- s || h.succeed(`Generation completed for ${i.bold(n?.name || e)}!`),
9928
+ s || h.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
9291
9929
  s)
9292
9930
  ) {
9293
9931
  process.stdout.write(
@@ -9300,53 +9938,53 @@ async function je(e, t) {
9300
9938
  if (
9301
9939
  (process.stdout.write(`
9302
9940
  `),
9303
- process.stdout.write(` ${i.bold('Status:')} ${i.green('Succeeded')}
9941
+ process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
9304
9942
  `),
9305
- process.stdout.write(` ${i.bold('Request ID:')} ${f.request_id}
9943
+ process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
9306
9944
  `),
9307
9945
  f.usage?.cost !== void 0 &&
9308
- process.stdout.write(` ${i.bold('Cost:')} ${_e(f.usage.cost)}
9946
+ process.stdout.write(` ${a.bold('Cost:')} ${Te(f.usage.cost)}
9309
9947
  `),
9310
9948
  f.output && f.output.length > 0)
9311
9949
  ) {
9312
9950
  process.stdout.write(`
9313
- ${i.bold('Outputs:')}
9951
+ ${a.bold('Outputs:')}
9314
9952
  `);
9315
9953
  let b = f.output.filter((x) => x.url).length,
9316
9954
  g = 0;
9317
9955
  for (let x = 0; x < f.output.length; x++) {
9318
- let P = f.output[x];
9319
- if (P.url) {
9320
- let L = P.layer?.name ? ` ${i.bold(P.layer.name)}` : '';
9956
+ let _ = f.output[x];
9957
+ if (_.url) {
9958
+ let V = _.layer?.name ? ` ${a.bold(_.layer.name)}` : '';
9321
9959
  if (
9322
- (process.stdout.write(` [${P.type.toUpperCase()}]${L} ${i.cyan(i.underline(P.url))}
9960
+ (process.stdout.write(` [${_.type.toUpperCase()}]${V} ${a.cyan(a.underline(_.url))}
9323
9961
  `),
9324
9962
  u)
9325
9963
  ) {
9326
- let C = ha(u, g++, b),
9327
- et = new T(`Downloading output to ${C}...`).start();
9964
+ let $ = Li(u, g++, b),
9965
+ nt = new T(`Downloading output to ${$}...`).start();
9328
9966
  try {
9329
- (await d.downloadOutput(P.url, q.default.resolve(process.cwd(), C)),
9330
- et.succeed(`Saved to ${i.bold(C)}`));
9331
- } catch (we) {
9332
- et.fail(`Failed to download: ${we instanceof Error ? we.message : we}`);
9967
+ (await d.downloadOutput(_.url, C.default.resolve(process.cwd(), $)),
9968
+ nt.succeed(`Saved to ${a.bold($)}`));
9969
+ } catch (_e) {
9970
+ nt.fail(`Failed to download: ${_e instanceof Error ? _e.message : _e}`);
9333
9971
  }
9334
9972
  }
9335
9973
  } else
9336
- P.text &&
9974
+ _.text &&
9337
9975
  process.stdout.write(`
9338
- ${P.text}
9976
+ ${_.text}
9339
9977
  `);
9340
9978
  }
9341
9979
  }
9342
9980
  process.stdout.write(`
9343
9981
  `);
9344
9982
  }
9345
- var Gt = _(require('node:readline'));
9983
+ var rr = I(require('node:readline'));
9346
9984
  A();
9347
- async function ya(e) {
9985
+ async function Vi(e) {
9348
9986
  try {
9349
- return (await new K(e, I()).checkKey(), 'ok');
9987
+ return (await new K(e, P()).checkKey(), 'ok');
9350
9988
  } catch (t) {
9351
9989
  if (t instanceof w) {
9352
9990
  if (t.status === 401) return 'invalid';
@@ -9355,95 +9993,95 @@ async function ya(e) {
9355
9993
  return 'unchecked';
9356
9994
  }
9357
9995
  }
9358
- function ba(e) {
9359
- let t = Gt.default.createInterface({ input: process.stdin, output: process.stdout });
9996
+ function Ni(e) {
9997
+ let t = rr.default.createInterface({ input: process.stdin, output: process.stdout });
9360
9998
  return new Promise((r) => {
9361
- t.question(e, (a) => {
9362
- (t.close(), r(a.trim()));
9999
+ t.question(e, (i) => {
10000
+ (t.close(), r(i.trim()));
9363
10001
  });
9364
10002
  });
9365
10003
  }
9366
- async function Z(e, t) {
10004
+ async function ee(e, t) {
9367
10005
  switch (e) {
9368
10006
  case 'login':
9369
10007
  case 'set-key': {
9370
10008
  let r = t?.trim() || '';
9371
10009
  (r ||
9372
10010
  (process.stdout.write(`
9373
- ${i.bold('Tein AI Authentication')}
10011
+ ${a.bold('Tein AI Authentication')}
9374
10012
  `),
9375
- process.stdout.write(`Get your API key at: ${i.cyan('https://tein.ai/dashboard/keys')}
10013
+ process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
9376
10014
 
9377
10015
  `),
9378
- (r = await ba('Enter your Tein API Key (sk_live_...): '))),
10016
+ (r = await Ni('Enter your Tein API Key (sk_live_...): '))),
9379
10017
  !r.startsWith('sk_live_') &&
9380
10018
  !r.startsWith('sk_test_') &&
9381
10019
  (process.stderr
9382
- .write(`${i.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10020
+ .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
9383
10021
  `),
9384
10022
  process.exit(1)));
9385
- let a = await ya(r);
9386
- (a === 'invalid' &&
10023
+ let i = await Vi(r);
10024
+ (i === 'invalid' &&
9387
10025
  (process.stderr
9388
- .write(`${i.red('Error:')} Tein did not accept this key. Copy it again from ${i.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
10026
+ .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
9389
10027
  `),
9390
10028
  process.exit(1)),
9391
- Ie({ apiKey: r }),
10029
+ ve({ apiKey: r }),
9392
10030
  process.stdout.write(`
9393
- ${i.green('\u2713')} API key saved to ${i.dim(ie())}
10031
+ ${a.green('\u2713')} API key saved to ${a.dim(ne())}
9394
10032
  `),
9395
- a === 'blocked'
10033
+ i === 'blocked'
9396
10034
  ? process.stdout
9397
- .write(`${i.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
10035
+ .write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
9398
10036
  `)
9399
- : a === 'unchecked' &&
10037
+ : i === 'unchecked' &&
9400
10038
  process.stdout
9401
- .write(`${i.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${i.cyan('tein auth set-key')} again once you are online to check it.
10039
+ .write(`${a.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${a.cyan('tein auth set-key')} again once you are online to check it.
9402
10040
  `),
9403
10041
  process.stdout
9404
- .write(`You can now run models directly using: ${i.cyan('tein run <model-slug> --prompt "..."')}
10042
+ .write(`You can now run models directly using: ${a.cyan('tein run <model-slug> --prompt "..."')}
9405
10043
 
9406
10044
  `));
9407
10045
  break;
9408
10046
  }
9409
10047
  case 'logout': {
9410
- if (!V().apiKey) {
10048
+ if (!F().apiKey) {
9411
10049
  process.stdout
9412
- .write(`${i.yellow('\u2139')} No active API key found. You are already logged out.
10050
+ .write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
9413
10051
  `);
9414
10052
  break;
9415
10053
  }
9416
- (Ie({ apiKey: '' }),
10054
+ (ve({ apiKey: '' }),
9417
10055
  process.stdout
9418
- .write(`${i.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${i.dim(ie())}
10056
+ .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(ne())}
9419
10057
  `));
9420
10058
  break;
9421
10059
  }
9422
10060
  default: {
9423
10061
  let r = E(),
9424
- a = I(),
9425
- n = V();
10062
+ i = P(),
10063
+ n = F();
9426
10064
  if (
9427
10065
  (process.stdout.write(`
9428
- ${i.bold('Tein AI CLI Configuration')}
10066
+ ${a.bold('Tein AI CLI Configuration')}
9429
10067
  `),
9430
- process.stdout.write(` Config file: ${i.dim(ie())}
10068
+ process.stdout.write(` Config file: ${a.dim(ne())}
9431
10069
  `),
9432
- process.stdout.write(` API URL: ${i.cyan(a)}
10070
+ process.stdout.write(` API URL: ${a.cyan(i)}
9433
10071
  `),
9434
10072
  !r)
9435
10073
  )
9436
- (process.stdout.write(` API Key: ${i.red('Not configured')}
10074
+ (process.stdout.write(` API Key: ${a.red('Not configured')}
9437
10075
 
9438
10076
  `),
9439
10077
  process.stdout
9440
- .write(`Run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10078
+ .write(`Run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9441
10079
 
9442
10080
  `));
9443
10081
  else {
9444
10082
  let s = `${r.slice(0, 10)}...${r.slice(-4)}`;
9445
10083
  process.stdout
9446
- .write(` API Key: ${i.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
10084
+ .write(` API Key: ${a.green(s)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
9447
10085
 
9448
10086
  `);
9449
10087
  }
@@ -9452,57 +10090,57 @@ ${i.bold('Tein AI CLI Configuration')}
9452
10090
  }
9453
10091
  }
9454
10092
  A();
9455
- ve();
9456
- X();
9457
- var ka = 3e3;
9458
- async function Ht(e) {
10093
+ Me();
10094
+ Q();
10095
+ var Ui = 3e3;
10096
+ async function ir(e) {
9459
10097
  try {
9460
- let t = await fetch(`${I(e)}/v1/pricing`, { signal: AbortSignal.timeout(ka) });
10098
+ let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(Ui) });
9461
10099
  if (!t.ok) return;
9462
10100
  let r = await t.json(),
9463
- a = {};
10101
+ i = {};
9464
10102
  for (let n of r.configs ?? []) {
9465
10103
  let s = String(n.modelSlug ?? '');
9466
- G.has(s) && (a[s] ??= []).push(Number(n.starterPrice));
10104
+ H.has(s) && (i[s] ??= []).push(Number(n.starterPrice));
9467
10105
  }
9468
- Ot(a);
10106
+ zt(i);
9469
10107
  } catch {}
9470
10108
  }
9471
- var wa = new Set(['video', 'image', 'text', 'audio', '3d']),
9472
- xa = { llm: 'text', chat: 'text', reasoning: 'text' };
9473
- async function zt(e, t) {
9474
- await Ht(t);
9475
- let r = O();
10109
+ var Fi = new Set(['video', 'image', 'text', 'audio', '3d']),
10110
+ Bi = { llm: 'text', chat: 'text', reasoning: 'text' };
10111
+ async function ar(e, t) {
10112
+ await ir(t);
10113
+ let r = D();
9476
10114
  if (e) {
9477
10115
  let s = e.toLowerCase(),
9478
- o = xa[s] ?? s;
9479
- r = wa.has(o)
10116
+ o = Bi[s] ?? s;
10117
+ r = Fi.has(o)
9480
10118
  ? r.filter((u) => u.category.toLowerCase() === o)
9481
10119
  : r.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
9482
10120
  }
9483
10121
  (process.stdout.write(`
9484
- ${i.bold('Tein AI Models Catalog')} (${r.length} available)
10122
+ ${a.bold('Tein AI Models Catalog')} (${r.length} available)
9485
10123
  `),
9486
10124
  process.stdout
9487
- .write(`${i.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
10125
+ .write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
9488
10126
 
9489
10127
  `));
9490
- let a = {};
10128
+ let i = {};
9491
10129
  for (let s of r) {
9492
10130
  let o = s.category;
9493
- (a[o] || (a[o] = []), a[o].push(s));
10131
+ (i[o] || (i[o] = []), i[o].push(s));
9494
10132
  }
9495
10133
  let n = ['Video', 'Image', 'Text', 'Audio', '3D'];
9496
10134
  for (let s of n) {
9497
- let o = a[s];
10135
+ let o = i[s];
9498
10136
  if (!(!o || o.length === 0)) {
9499
- process.stdout.write(`${i.bold(i.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
10137
+ process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
9500
10138
  `);
9501
10139
  for (let u of o) {
9502
10140
  let l = u.slug.padEnd(24),
9503
10141
  c = u.name.padEnd(22),
9504
10142
  p = u.priceFormatted.padEnd(22);
9505
- process.stdout.write(` ${i.bold(l)} ${i.gray(c)} ${i.green(p)} ${i.dim(u.vendor)}
10143
+ process.stdout.write(` ${a.bold(l)} ${a.gray(c)} ${a.green(p)} ${a.dim(u.vendor)}
9506
10144
  `);
9507
10145
  }
9508
10146
  process.stdout.write(`
@@ -9510,95 +10148,95 @@ ${i.bold('Tein AI Models Catalog')} (${r.length} available)
9510
10148
  }
9511
10149
  }
9512
10150
  process.stdout
9513
- .write(`${i.dim('Tip:')} Generate directly with ${i.cyan('tein run <model-slug> --prompt "..."')}
10151
+ .write(`${a.dim('Tip:')} Generate directly with ${a.cyan('tein run <model-slug> --prompt "..."')}
9514
10152
 
9515
10153
  `);
9516
10154
  }
9517
- async function Jt(e, t) {
9518
- G.has(e) && (await Ht(t));
9519
- let r = B(e);
10155
+ async function nr(e, t) {
10156
+ H.has(e) && (await ir(t));
10157
+ let r = j(e);
9520
10158
  (r ||
9521
- (process.stderr.write(`${i.red('Error:')} Model "${e}" not found in Tein AI registry.
10159
+ (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
9522
10160
  `),
9523
- process.stderr.write(`Run ${i.cyan('tein models')} to see all available model slugs.
10161
+ process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
9524
10162
  `),
9525
10163
  process.exit(1)),
9526
10164
  process.stdout.write(`
9527
- ${i.bold(i.cyan(r.name))} (${i.bold(r.slug)})
10165
+ ${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
9528
10166
  `),
9529
- process.stdout.write(` ${i.gray(r.description)}
10167
+ process.stdout.write(` ${a.gray(r.description)}
9530
10168
 
9531
10169
  `),
9532
- process.stdout.write(`${i.bold('Metadata:')}
10170
+ process.stdout.write(`${a.bold('Metadata:')}
9533
10171
  `),
9534
- process.stdout.write(` Category: ${i.yellow(r.category)}
10172
+ process.stdout.write(` Category: ${a.yellow(r.category)}
9535
10173
  `),
9536
10174
  process.stdout.write(` Kind: ${r.kind}
9537
10175
  `),
9538
10176
  process.stdout.write(` Vendor: ${r.vendor}
9539
10177
  `),
9540
- process.stdout.write(` Pricing: ${i.green(r.priceFormatted)}
10178
+ process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
9541
10179
 
9542
10180
  `),
9543
- process.stdout.write(`${i.bold('Parameters:')}
10181
+ process.stdout.write(`${a.bold('Parameters:')}
9544
10182
  `));
9545
- for (let a of r.parameters) {
9546
- let n = a.required ? i.red('(required)') : i.dim('(optional)'),
9547
- s = a.default !== void 0 ? i.dim(` [default: ${a.default}]`) : '';
10183
+ for (let i of r.parameters) {
10184
+ let n = i.required ? a.red('(required)') : a.dim('(optional)'),
10185
+ s = i.default !== void 0 ? a.dim(` [default: ${i.default}]`) : '';
9548
10186
  (process.stdout
9549
- .write(` ${i.bold(`--${a.name.replace(/_/g, '-')}`)} ${i.yellow(`<${a.type}>`)} ${n}${s}
10187
+ .write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${n}${s}
9550
10188
  `),
9551
- a.description &&
9552
- process.stdout.write(` ${i.gray(a.description)}
10189
+ i.description &&
10190
+ process.stdout.write(` ${a.gray(i.description)}
9553
10191
  `),
9554
- a.options &&
9555
- a.options.length > 0 &&
9556
- process.stdout.write(` Allowed values: ${i.dim(a.options.join(', '))}
10192
+ i.options &&
10193
+ i.options.length > 0 &&
10194
+ process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
9557
10195
  `),
9558
- (a.min !== void 0 || a.max !== void 0) &&
9559
- process.stdout.write(` Range: ${a.min ?? ''} to ${a.max ?? ''}
10196
+ (i.min !== void 0 || i.max !== void 0) &&
10197
+ process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
9560
10198
  `),
9561
10199
  process.stdout.write(`
9562
10200
  `));
9563
10201
  }
9564
10202
  if (
9565
- (r.parameters.some((a) => a.name === 'callback_url') ||
10203
+ (r.parameters.some((i) => i.name === 'callback_url') ||
9566
10204
  (process.stdout
9567
- .write(` ${i.bold('--callback-url')} ${i.yellow('<string>')} ${i.dim('(optional)')}
10205
+ .write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
9568
10206
  `),
9569
10207
  process.stdout
9570
- .write(` ${i.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
10208
+ .write(` ${a.gray('HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled.')}
9571
10209
 
9572
10210
  `)),
9573
- process.stdout.write(`${i.bold('Sample CLI Usage:')}
10211
+ process.stdout.write(`${a.bold('Sample CLI Usage:')}
9574
10212
  `),
9575
10213
  r.category === 'Video')
9576
10214
  )
9577
10215
  process.stdout
9578
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
10216
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
9579
10217
 
9580
10218
  `);
9581
10219
  else if (r.category === 'Image') {
9582
- let a = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
10220
+ let i = r.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
9583
10221
  process.stdout
9584
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${a} -o output.png`)}
10222
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
9585
10223
 
9586
10224
  `);
9587
10225
  } else
9588
10226
  r.category === 'Audio'
9589
10227
  ? process.stdout
9590
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
10228
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
9591
10229
 
9592
10230
  `)
9593
10231
  : process.stdout
9594
- .write(` ${i.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
10232
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
9595
10233
 
9596
10234
  `);
9597
10235
  }
9598
10236
  A();
9599
- Ge();
9600
- var Pa = 1e4,
9601
- ze = {
10237
+ Ye();
10238
+ var ji = 1e4,
10239
+ Qe = {
9602
10240
  price: '',
9603
10241
  creativeMode: 'Creative mode',
9604
10242
  priority: 'Priority',
@@ -9608,114 +10246,114 @@ var Pa = 1e4,
9608
10246
  priorityDraft: 'Priority + Draft',
9609
10247
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
9610
10248
  },
9611
- Ia = Object.keys(ze),
9612
- _a = {
10249
+ Gi = Object.keys(Qe),
10250
+ Hi = {
9613
10251
  creativeMode: 'unfiltered',
9614
10252
  creativeModePriority: 'unfilteredPriority',
9615
10253
  creativeModeDraft: 'unfilteredDraft',
9616
10254
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
9617
10255
  };
9618
- function va(e, t) {
9619
- let r = _a[t];
10256
+ function zi(e, t) {
10257
+ let r = Hi[t];
9620
10258
  return e[t] ?? (r ? e[r] : void 0);
9621
10259
  }
9622
- async function Ta(e, t) {
9623
- let r = `${I(e)}${ye(t)}`,
9624
- a;
10260
+ async function Ji(e, t) {
10261
+ let r = `${P(e)}${ke(t)}`,
10262
+ i;
9625
10263
  try {
9626
- a = await fetch(r, { signal: AbortSignal.timeout(Pa) });
10264
+ i = await fetch(r, { signal: AbortSignal.timeout(ji) });
9627
10265
  } catch {
9628
10266
  throw new Error(`Could not reach ${r}`);
9629
10267
  }
9630
- let n = await a.json().catch(() => null);
9631
- if (!a.ok || !n || n.object !== 'list' || !n.board) {
10268
+ let n = await i.json().catch(() => null);
10269
+ if (!i.ok || !n || n.object !== 'list' || !n.board) {
9632
10270
  let s =
9633
10271
  n && typeof n.error == 'string'
9634
10272
  ? n.error
9635
10273
  : n && typeof n.error == 'object' && n.error?.message
9636
10274
  ? n.error.message
9637
- : `Pricing request failed (${a.status})`;
10275
+ : `Pricing request failed (${i.status})`;
9638
10276
  throw new Error(s);
9639
10277
  }
9640
10278
  return n;
9641
10279
  }
9642
- function He(e) {
10280
+ function Xe(e) {
9643
10281
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
9644
- [r, a = ''] = t.split('.');
9645
- return `$${r}.${a.padEnd(2, '0')}`;
10282
+ [r, i = ''] = t.split('.');
10283
+ return `$${r}.${i.padEnd(2, '0')}`;
9646
10284
  }
9647
- function Je(e) {
10285
+ function Ze(e) {
9648
10286
  if (!e || typeof e.starter != 'number') return null;
9649
10287
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
9650
10288
  r = typeof e.scale == 'number' ? e.scale : t;
9651
- return `Starter ${He(e.starter)} Plus ${He(t)} Scale ${He(r)}`;
10289
+ return `Starter ${Xe(e.starter)} Plus ${Xe(t)} Scale ${Xe(r)}`;
9652
10290
  }
9653
- function Ma(e) {
10291
+ function Wi(e) {
9654
10292
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
9655
10293
  let t = [];
9656
10294
  for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
9657
- let a = e[r];
9658
- a != null && a !== '' && t.push(String(a));
10295
+ let i = e[r];
10296
+ i != null && i !== '' && t.push(String(i));
9659
10297
  }
9660
10298
  return (
9661
10299
  e.withVideo === !0 && t.push('with video'),
9662
10300
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
9663
10301
  );
9664
10302
  }
9665
- function Ka(e, t) {
9666
- let r = Ma(e);
9667
- for (let a of Ia) {
9668
- let n = Je(va(e, a));
10303
+ function Yi(e, t) {
10304
+ let r = Wi(e);
10305
+ for (let i of Gi) {
10306
+ let n = Ze(zi(e, i));
9669
10307
  if (!n) continue;
9670
- let s = ze[a] ? ` (${ze[a]})` : '';
10308
+ let s = Qe[i] ? ` (${Qe[i]})` : '';
9671
10309
  t.push(` ${r}${s} ${n}`);
9672
10310
  }
9673
10311
  }
9674
- function Sa(e, t) {
10312
+ function Xi(e, t) {
9675
10313
  let r = e.quality ? ` quality=${e.quality}` : '';
9676
10314
  t.push(
9677
- ` ${i.bold(e.slug.padEnd(26))} ${i.gray(e.name)} ${i.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
10315
+ ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
9678
10316
  );
9679
- for (let n of e.variants ?? []) Ka(n, t);
9680
- let a = e.addons;
9681
- if (Array.isArray(a))
9682
- for (let n of a) {
10317
+ for (let n of e.variants ?? []) Yi(n, t);
10318
+ let i = e.addons;
10319
+ if (Array.isArray(i))
10320
+ for (let n of i) {
9683
10321
  if (!n || typeof n != 'object') continue;
9684
10322
  let s = n,
9685
10323
  o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
9686
- u = Je(s.price);
10324
+ u = Ze(s.price);
9687
10325
  u && t.push(` ${o} (add-on) ${u}`);
9688
10326
  }
9689
10327
  t.push('');
9690
10328
  }
9691
- function Ea(e) {
10329
+ function Qi(e) {
9692
10330
  let t = [],
9693
10331
  r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
9694
- (t.push(`${i.bold('Tein prices')} ${i.green(e.currency)} ${e.count} models${r}`),
10332
+ (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
9695
10333
  t.push(
9696
- `${i.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
10334
+ `${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
9697
10335
  ),
9698
10336
  t.push(''));
9699
- let a = new Map();
10337
+ let i = new Map();
9700
10338
  for (let l of e.board.models) {
9701
10339
  let c = l.kind || 'other',
9702
- p = a.get(c) ?? [];
9703
- (p.push(l), a.set(c, p));
10340
+ p = i.get(c) ?? [];
10341
+ (p.push(l), i.set(c, p));
9704
10342
  }
9705
10343
  let n = ['video', 'image', 'audio', 'llm', 'text', '3d'],
9706
- s = [...a.keys()].sort((l, c) => {
10344
+ s = [...i.keys()].sort((l, c) => {
9707
10345
  let p = n.indexOf(l),
9708
10346
  d = n.indexOf(c);
9709
10347
  return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
9710
10348
  });
9711
10349
  for (let l of s) {
9712
- t.push(`${i.bold(i.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
9713
- for (let c of a.get(l) ?? []) Sa(c, t);
10350
+ t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
10351
+ for (let c of i.get(l) ?? []) Xi(c, t);
9714
10352
  }
9715
10353
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
9716
10354
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
9717
10355
  if (u.length) {
9718
- t.push(`${i.bold(i.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
10356
+ t.push(`${a.bold(a.cyan('\u2500\u2500 other prices \u2500\u2500'))}`);
9719
10357
  let l = new Map();
9720
10358
  for (let c of u) {
9721
10359
  let p = String(c.modelSlug ?? ''),
@@ -9724,29 +10362,29 @@ function Ea(e) {
9724
10362
  }
9725
10363
  for (let [c, p] of l) {
9726
10364
  let d = String(p[0]?.modelName ?? c);
9727
- t.push(` ${i.bold(c.padEnd(26))} ${i.gray(d)}`);
10365
+ t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
9728
10366
  for (let m of p) {
9729
10367
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
9730
- f = Je(m.prices);
10368
+ f = Ze(m.prices);
9731
10369
  f && t.push(` ${h} ${f}`);
9732
10370
  }
9733
10371
  t.push('');
9734
10372
  }
9735
10373
  }
9736
10374
  return (
9737
- t.push(`${i.dim('JSON:')} ${i.cyan('tein pricing --json')}`),
10375
+ t.push(`${a.dim('JSON:')} ${a.cyan('tein pricing --json')}`),
9738
10376
  `${t.join(`
9739
10377
  `)}
9740
10378
  `
9741
10379
  );
9742
10380
  }
9743
- async function Wt(e) {
10381
+ async function sr(e) {
9744
10382
  let t;
9745
10383
  try {
9746
- t = await Ta(e.apiUrl, e.model);
10384
+ t = await Ji(e.apiUrl, e.model);
9747
10385
  } catch (r) {
9748
- let a = r instanceof Error ? r.message : String(r);
9749
- (process.stderr.write(`${i.red('Error:')} ${a}
10386
+ let i = r instanceof Error ? r.message : String(r);
10387
+ (process.stderr.write(`${a.red('Error:')} ${i}
9750
10388
  `),
9751
10389
  process.exit(1));
9752
10390
  }
@@ -9754,32 +10392,32 @@ async function Wt(e) {
9754
10392
  e.json
9755
10393
  ? `${JSON.stringify(t, null, 2)}
9756
10394
  `
9757
- : Ea(t),
10395
+ : Qi(t),
9758
10396
  );
9759
10397
  }
9760
- var Yt = _(require('node:path'));
10398
+ var or = I(require('node:path'));
9761
10399
  A();
9762
- async function Xt(e, t) {
10400
+ async function lr(e, t) {
9763
10401
  let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
9764
- a = I(typeof t.api_url == 'string' ? t.api_url : void 0);
10402
+ i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
9765
10403
  (r ||
9766
- (process.stderr.write(`${i.red('Error:')} Authentication required.
10404
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
9767
10405
  `),
9768
10406
  process.stderr
9769
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10407
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9770
10408
  `),
9771
10409
  process.exit(1)),
9772
10410
  e ||
9773
- (process.stderr.write(`${i.red('Error:')} Missing request ID.
10411
+ (process.stderr.write(`${a.red('Error:')} Missing request ID.
9774
10412
  `),
9775
- process.stderr.write(`Usage: ${i.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
10413
+ process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
9776
10414
  `),
9777
10415
  process.exit(1)));
9778
10416
  let n = !!t.json,
9779
10417
  s = !!t.wait,
9780
10418
  o = typeof t.output == 'string' ? t.output : void 0,
9781
- u = new K(r, a),
9782
- l = new T(`Checking status of ${i.bold(e)}...`);
10419
+ u = new K(r, i),
10420
+ l = new T(`Checking status of ${a.bold(e)}...`);
9783
10421
  n || l.start();
9784
10422
  let c;
9785
10423
  try {
@@ -9808,7 +10446,7 @@ async function Xt(e, t) {
9808
10446
  let p = Date.now();
9809
10447
  for (; c.status === 'processing';) {
9810
10448
  let d = Math.round((Date.now() - p) / 1e3);
9811
- (n || l.update(`Waiting for ${i.bold(c.model)} (${d}s elapsed)...`),
10449
+ (n || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
9812
10450
  await new Promise((m) => setTimeout(m, 1500)));
9813
10451
  try {
9814
10452
  c = await u.getStatus(e);
@@ -9833,29 +10471,29 @@ async function Xt(e, t) {
9833
10471
  }
9834
10472
  if (
9835
10473
  (process.stdout.write(`
9836
- ${i.bold('Model:')} ${c.model}
10474
+ ${a.bold('Model:')} ${c.model}
9837
10475
  `),
9838
10476
  process.stdout
9839
- .write(` ${i.bold('Status:')} ${c.status === 'succeeded' ? i.green(c.status) : c.status === 'processing' ? i.yellow(c.status) : i.red(c.status)}
10477
+ .write(` ${a.bold('Status:')} ${c.status === 'succeeded' ? a.green(c.status) : c.status === 'processing' ? a.yellow(c.status) : a.red(c.status)}
9840
10478
  `),
9841
- process.stdout.write(` ${i.bold('Request ID:')} ${c.request_id}
10479
+ process.stdout.write(` ${a.bold('Request ID:')} ${c.request_id}
9842
10480
  `),
9843
10481
  c.output && c.output.length > 0)
9844
10482
  ) {
9845
10483
  process.stdout.write(`
9846
- ${i.bold('Outputs:')}
10484
+ ${a.bold('Outputs:')}
9847
10485
  `);
9848
10486
  for (let p of c.output)
9849
10487
  if (p.url) {
9850
10488
  if (
9851
- (process.stdout.write(` [${p.type.toUpperCase()}] ${i.cyan(i.underline(p.url))}
10489
+ (process.stdout.write(` [${p.type.toUpperCase()}] ${a.cyan(a.underline(p.url))}
9852
10490
  `),
9853
10491
  o)
9854
10492
  ) {
9855
10493
  let d = new T(`Downloading output to ${o}...`).start();
9856
10494
  try {
9857
- (await u.downloadOutput(p.url, Yt.default.resolve(process.cwd(), o)),
9858
- d.succeed(`Saved to ${i.bold(o)}`));
10495
+ (await u.downloadOutput(p.url, or.default.resolve(process.cwd(), o)),
10496
+ d.succeed(`Saved to ${a.bold(o)}`));
9859
10497
  } catch (m) {
9860
10498
  d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
9861
10499
  }
@@ -9869,35 +10507,35 @@ ${p.text}
9869
10507
  process.stdout.write(`
9870
10508
  `);
9871
10509
  }
9872
- var We = _(require('node:fs')),
9873
- Ye = _(require('node:path'));
10510
+ var et = I(require('node:fs')),
10511
+ tt = I(require('node:path'));
9874
10512
  A();
9875
- async function Qt(e, t = {}) {
10513
+ async function pr(e, t = {}) {
9876
10514
  let r = E(typeof t.api_key == 'string' ? t.api_key : void 0),
9877
- a = I(typeof t.api_url == 'string' ? t.api_url : void 0),
10515
+ i = P(typeof t.api_url == 'string' ? t.api_url : void 0),
9878
10516
  n = !!t.json;
9879
10517
  (r ||
9880
- (process.stderr.write(`${i.red('Error:')} Authentication required.
10518
+ (process.stderr.write(`${a.red('Error:')} Authentication required.
9881
10519
  `),
9882
10520
  process.stderr
9883
- .write(`Please run ${i.cyan('tein auth login')} or set ${i.cyan('TEIN_API_KEY')} environment variable.
10521
+ .write(`Please run ${a.cyan('tein auth login')} or set ${a.cyan('TEIN_API_KEY')} environment variable.
9884
10522
  `),
9885
10523
  process.exit(1)),
9886
10524
  e ||
9887
- (process.stderr.write(`${i.red('Error:')} Missing file path.
10525
+ (process.stderr.write(`${a.red('Error:')} Missing file path.
9888
10526
  `),
9889
- process.stderr.write(`Usage: ${i.cyan('tein upload <image.png|video.mp4>')}
10527
+ process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
9890
10528
  `),
9891
10529
  process.exit(1)));
9892
- let s = Ye.default.resolve(e);
9893
- We.default.existsSync(s) ||
9894
- (process.stderr.write(`${i.red('Error:')} File not found: ${s}
10530
+ let s = tt.default.resolve(e);
10531
+ et.default.existsSync(s) ||
10532
+ (process.stderr.write(`${a.red('Error:')} File not found: ${s}
9895
10533
  `),
9896
10534
  process.exit(1));
9897
- let o = Ye.default.basename(s),
9898
- l = We.default.readFileSync(s).toString('base64'),
9899
- c = new K(r, a),
9900
- p = new T(`Uploading ${i.bold(o)} to Tein AI CDN...`);
10535
+ let o = tt.default.basename(s),
10536
+ l = et.default.readFileSync(s).toString('base64'),
10537
+ c = new K(r, i),
10538
+ p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
9901
10539
  n || p.start();
9902
10540
  try {
9903
10541
  let d = await c.uploadAsset(l);
@@ -9909,13 +10547,13 @@ async function Qt(e, t = {}) {
9909
10547
  )
9910
10548
  : (p.succeed('Upload successful!'),
9911
10549
  process.stdout.write(`
9912
- ${i.bold('CDN URL:')} ${i.green(d.url)}
10550
+ ${a.bold('CDN URL:')} ${a.green(d.url)}
9913
10551
  `),
9914
- process.stdout.write(`${i.dim(`Key: ${d.key}`)}
10552
+ process.stdout.write(`${a.dim(`Key: ${d.key}`)}
9915
10553
 
9916
10554
  `),
9917
10555
  process.stdout.write(`Use this CDN URL directly in your CLI runs:
9918
- ${i.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
10556
+ ${a.cyan(`tein run seedance-2-5 --prompt "Animate this scene" --image "${d.url}"`)}
9919
10557
 
9920
10558
  `));
9921
10559
  } catch (d) {
@@ -9936,108 +10574,108 @@ ${i.bold('CDN URL:')} ${i.green(d.url)}
9936
10574
  process.exit(m ? m.exitCode : v));
9937
10575
  }
9938
10576
  }
9939
- X();
9940
- Ce();
9941
- function fr() {
10577
+ Q();
10578
+ Ae();
10579
+ function vr() {
9942
10580
  process.stdout.write(`
9943
- ${i.bold(i.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
10581
+ ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
9944
10582
 
9945
- ${i.bold('USAGE:')}
9946
- ${i.cyan('tein')} <command> [arguments] [options]
10583
+ ${a.bold('USAGE:')}
10584
+ ${a.cyan('tein')} <command> [arguments] [options]
9947
10585
 
9948
- ${i.bold('COMMANDS:')}
9949
- ${i.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
9950
- ${i.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
9951
- ${i.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
9952
- ${i.bold('info')} <model-slug> View parameter schemas, pricing, and options
9953
- ${i.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
9954
- ${i.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
9955
- ${i.bold('status')} <request-id> [options] Check generation progress and retrieve output files
9956
- ${i.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
10586
+ ${a.bold('COMMANDS:')}
10587
+ ${a.bold('auth')} <login|set-key|logout|status> Manage Tein API key and authentication
10588
+ ${a.bold('models')} [category] List all 25+ models (Video, Image, Audio, Text, 3D)
10589
+ ${a.bold('pricing')} [model-slug] Every published price (Starter, Plus, Scale)
10590
+ ${a.bold('info')} <model-slug> View parameter schemas, pricing, and options
10591
+ ${a.bold('upload')} <filepath> Upload local image/video directly to Tein CDN
10592
+ ${a.bold('run')} <model-slug> [options] Generate video, image, audio, or reasoning outputs
10593
+ ${a.bold('status')} <request-id> [options] Check generation progress and retrieve output files
10594
+ ${a.bold('mcp')} Launch stdio MCP server for Claude Desktop / Code
9957
10595
 
9958
- ${i.bold('GENERATION OPTIONS (for `tein run`):')}
9959
- ${i.cyan('-p, --prompt')} <text> Text prompt for generation ${i.red('(required)')}
9960
- ${i.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
9961
- ${i.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
9962
- ${i.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
9963
- ${i.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
9964
- ${i.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
9965
- ${i.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
9966
- ${i.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
9967
- ${i.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
9968
- ${i.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
9969
- ${i.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
9970
- ${i.cyan('--async, --no-wait')} Queue task and return request ID immediately
9971
- ${i.cyan('--json')} Output response in raw JSON format
9972
- ${i.cyan('--api-key')} <key> Override API key for this request
10596
+ ${a.bold('GENERATION OPTIONS (for `tein run`):')}
10597
+ ${a.cyan('-p, --prompt')} <text> Text prompt for generation ${a.red('(required)')}
10598
+ ${a.cyan('-o, --output')} <filepath> Download output file locally (e.g. video.mp4, image.png)
10599
+ ${a.cyan('--aspect-ratio')} <ratio> Aspect ratio, per model (see tein info <model-slug>)
10600
+ ${a.cyan('-d, --duration')} <seconds> Video duration in seconds (4-30s depending on model)
10601
+ ${a.cyan('-r, --resolution')} <res> Resolution (720p, 1080p, 1K, 2K, 4K)
10602
+ ${a.cyan('-q, --quality')} <quality> Quality tier (standard, fast, mini, high)
10603
+ ${a.cyan('-s, --speaker')} <speaker_id> Voice speaker ID for audio TTS models
10604
+ ${a.cyan('--image')} <url> Input image URL for image-to-video or image-to-image
10605
+ ${a.cyan('--generate-audio')} Enable native synchronized audio (Seedance 2.5)
10606
+ ${a.cyan('--finalize')} <job-id> Render a Seedance 2.5 draft at 1080p, or 4K with -r 4k (no prompt)
10607
+ ${a.cyan('--callback-url')} <url> HTTPS URL that receives the finished job
10608
+ ${a.cyan('--async, --no-wait')} Queue task and return request ID immediately
10609
+ ${a.cyan('--json')} Output response in raw JSON format
10610
+ ${a.cyan('--api-key')} <key> Override API key for this request
9973
10611
 
9974
- ${i.bold('EXAMPLES:')}
9975
- ${i.dim('# 1. Authenticate with your Tein API key')}
9976
- ${i.cyan('tein auth login')}
10612
+ ${a.bold('EXAMPLES:')}
10613
+ ${a.dim('# 1. Authenticate with your Tein API key')}
10614
+ ${a.cyan('tein auth login')}
9977
10615
 
9978
- ${i.dim('# 2. List all Video models')}
9979
- ${i.cyan('tein models video')}
10616
+ ${a.dim('# 2. List all Video models')}
10617
+ ${a.cyan('tein models video')}
9980
10618
 
9981
- ${i.dim('# 3. Every published price, or one model as JSON')}
9982
- ${i.cyan('tein pricing')}
9983
- ${i.cyan('tein pricing seedance-2-5 --json')}
10619
+ ${a.dim('# 3. Every published price, or one model as JSON')}
10620
+ ${a.cyan('tein pricing')}
10621
+ ${a.cyan('tein pricing seedance-2-5 --json')}
9984
10622
 
9985
- ${i.dim('# 4. Generate a high-quality 2K image and download it')}
9986
- ${i.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
10623
+ ${a.dim('# 4. Generate a high-quality 2K image and download it')}
10624
+ ${a.cyan('tein run gpt-image-2 --prompt "Neon Tokyo street in rain" --quality high -r 2K -o tokyo.png')}
9987
10625
 
9988
- ${i.dim('# 5. Generate a video using Seedance 2.5 with audio')}
9989
- ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
9990
- ${i.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
9991
- ${i.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
10626
+ ${a.dim('# 5. Generate a video using Seedance 2.5 with audio')}
10627
+ ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -o ocean.mp4')}
10628
+ ${a.dim('# The same at 4K (10-bit H.265; add --creative-mode true for Creative mode)')}
10629
+ ${a.cyan('tein run seedance-2-5 --prompt "Drone shot of ocean waves at sunrise" --duration 5 -r 4k -o ocean-4k.mp4')}
9992
10630
 
9993
- ${i.dim('# 6. Generate speech with Seed Audio 1.0')}
9994
- ${i.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
10631
+ ${a.dim('# 6. Generate speech with Seed Audio 1.0')}
10632
+ ${a.cyan('tein run seed-audio-1-0 --prompt "Welcome to Tein AI CLI" -o welcome.wav')}
9995
10633
 
9996
- ${i.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
9997
- ${i.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
10634
+ ${a.dim('# 7. Run deep reasoning task with GPT-6 Astra')}
10635
+ ${a.cyan('tein run gpt-6-astra --prompt "Write a TypeScript binary search tree implementation"')}
9998
10636
 
9999
10637
  `);
10000
10638
  }
10001
- async function Ja() {
10639
+ async function ha() {
10002
10640
  let e = process.argv.slice(2),
10003
- t = jt(e);
10641
+ t = tr(e);
10004
10642
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
10005
- fr();
10643
+ vr();
10006
10644
  return;
10007
10645
  }
10008
10646
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
10009
- process.stdout.write(`tein version ${te}
10647
+ process.stdout.write(`tein version ${re}
10010
10648
  `);
10011
10649
  return;
10012
10650
  }
10013
10651
  switch (t.command) {
10014
10652
  case 'auth': {
10015
- await Z(t.subcommand, t.options.key);
10653
+ await ee(t.subcommand, t.options.key);
10016
10654
  break;
10017
10655
  }
10018
10656
  case 'login': {
10019
- await Z('login', t.options.key);
10657
+ await ee('login', t.options.key);
10020
10658
  break;
10021
10659
  }
10022
10660
  case 'logout': {
10023
- await Z('logout');
10661
+ await ee('logout');
10024
10662
  break;
10025
10663
  }
10026
10664
  case 'whoami': {
10027
- await Z('status');
10665
+ await ee('status');
10028
10666
  break;
10029
10667
  }
10030
10668
  case 'models':
10031
10669
  case 'list': {
10032
- await zt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
10670
+ await ar(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
10033
10671
  break;
10034
10672
  }
10035
10673
  case 'pricing':
10036
10674
  case 'prices': {
10037
10675
  let r = t.options.model,
10038
- a = t.subcommand || (typeof r == 'string' ? r : void 0);
10039
- await Wt({
10040
- model: a,
10676
+ i = t.subcommand || (typeof r == 'string' ? r : void 0);
10677
+ await sr({
10678
+ model: i,
10041
10679
  json: !!t.options.json,
10042
10680
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
10043
10681
  });
@@ -10046,61 +10684,61 @@ async function Ja() {
10046
10684
  case 'info':
10047
10685
  case 'show': {
10048
10686
  (t.subcommand ||
10049
- (process.stderr.write(`${i.red('Error:')} Missing model slug.
10687
+ (process.stderr.write(`${a.red('Error:')} Missing model slug.
10050
10688
  `),
10051
- process.stderr.write(`Usage: ${i.cyan('tein info <model-slug>')}
10689
+ process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
10052
10690
  `),
10053
10691
  process.exit(1)),
10054
- await Jt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
10692
+ await nr(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
10055
10693
  break;
10056
10694
  }
10057
10695
  case 'upload': {
10058
10696
  let r = t.subcommand || '';
10059
- await Qt(r, t.options);
10697
+ await pr(r, t.options);
10060
10698
  break;
10061
10699
  }
10062
10700
  case 'run':
10063
10701
  case 'generate': {
10064
10702
  let r = t.subcommand || '';
10065
- await je(r, t.options);
10703
+ await We(r, t.options);
10066
10704
  break;
10067
10705
  }
10068
10706
  case 'status': {
10069
10707
  let r = t.subcommand || '';
10070
- await Xt(r, t.options);
10708
+ await lr(r, t.options);
10071
10709
  break;
10072
10710
  }
10073
10711
  case 'mcp': {
10074
- let { startStdioServer: r } = await Promise.resolve().then(() => (mr(), ur));
10712
+ let { startStdioServer: r } = await Promise.resolve().then(() => (Ir(), Pr));
10075
10713
  await r();
10076
10714
  break;
10077
10715
  }
10078
10716
  default: {
10079
10717
  if (t.command && !t.command.startsWith('-')) {
10080
- (!B(t.command) &&
10081
- !ce[t.command] &&
10718
+ (!j(t.command) &&
10719
+ !ue[t.command] &&
10082
10720
  (process.stderr.write(`
10083
- ${i.red('Error:')} Unknown command or model "${t.command}".
10084
- Run ${i.cyan('tein --help')} for the commands, or ${i.cyan('tein models')} for the model slugs.
10721
+ ${a.red('Error:')} Unknown command or model "${t.command}".
10722
+ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
10085
10723
  `),
10086
10724
  process.exit(v)),
10087
- await je(t.command, t.options));
10725
+ await We(t.command, t.options));
10088
10726
  return;
10089
10727
  }
10090
- fr();
10728
+ vr();
10091
10729
  break;
10092
10730
  }
10093
10731
  }
10094
10732
  }
10095
- Ja().catch((e) => {
10733
+ ha().catch((e) => {
10096
10734
  (e instanceof w &&
10097
10735
  (process.stderr.write(`
10098
- ${i.red('Error:')} ${S(e).join(`
10736
+ ${a.red('Error:')} ${S(e).join(`
10099
10737
  `)}
10100
10738
  `),
10101
10739
  process.exit(e.exitCode)),
10102
10740
  process.stderr.write(`
10103
- ${i.red('Fatal error:')} ${e instanceof Error ? e.message : e}
10741
+ ${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
10104
10742
  `),
10105
10743
  process.exit(v));
10106
10744
  });