@teinai/cli 1.1.48 → 1.1.50

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 +240 -188
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14,10 +14,10 @@ var y = (e, t, r) => () => {
14
14
  throw ((r = [i]), i);
15
15
  }
16
16
  };
17
- var Ii = (e, t) => {
17
+ var vi = (e, t) => {
18
18
  for (var r in t) Se(e, r, { get: t[r], enumerable: !0 });
19
19
  },
20
- vi = (e, t, r, i) => {
20
+ Ii = (e, t, r, i) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
22
  for (let n of ki(t))
23
23
  !Pi.call(e, n) &&
@@ -27,7 +27,7 @@ var Ii = (e, t) => {
27
27
  };
28
28
  var M = (e, t, r) => (
29
29
  (r = e != null ? wi(_i(e)) : {}),
30
- vi(t || !e || !e.__esModule ? Se(r, 'default', { value: e, enumerable: !0 }) : r, e)
30
+ Ii(t || !e || !e.__esModule ? Se(r, 'default', { value: e, enumerable: !0 }) : r, e)
31
31
  );
32
32
  function Si(e) {
33
33
  for (let t of e)
@@ -162,6 +162,7 @@ var ue,
162
162
  },
163
163
  { slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro', 'seedream-5-5'] },
164
164
  { slug: 'seed', name: 'Seed', models: ['seed-audio-1-0', 'seed-2-1-turbo'] },
165
+ { slug: 'omnihuman', name: 'OmniHuman', models: ['omnihuman-2-0'] },
165
166
  { slug: 'wan', name: 'Wan', models: ['wan-3-0', 'wan-3-0-prime', 'wan-2-5-image'] },
166
167
  { slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
167
168
  { slug: 'minimax', name: 'Hailuo', models: ['minimax-h3', 'minimax-h3-turbo'] },
@@ -1993,6 +1994,29 @@ var ue,
1993
1994
  axes: {},
1994
1995
  from: { variant: 'standard' },
1995
1996
  },
1997
+ {
1998
+ slug: 'omnihuman-2-0',
1999
+ name: 'OmniHuman 2.0',
2000
+ family: 'omnihuman',
2001
+ vendor: 'ByteDance',
2002
+ desc: "ByteDance's OmniHuman 2.0 \u2014 one photo and an audio track become a 720p video of the person speaking, singing or performing, up to 5 minutes in one shot, with an optional prompt for camera and body movement.",
2003
+ kind: 'video',
2004
+ unit: '/sec',
2005
+ api: { model: 'omnihuman-2-0' },
2006
+ variants: [
2007
+ {
2008
+ id: '720p',
2009
+ price: { starter: 0.0875, plus: 0.0831, scale: 0.0778 },
2010
+ label: '720p',
2011
+ resolution: '720p',
2012
+ },
2013
+ ],
2014
+ unfiltered: null,
2015
+ priority: null,
2016
+ draft: null,
2017
+ axes: { resolution: ['720p'] },
2018
+ from: { variant: '720p' },
2019
+ },
1996
2020
  {
1997
2021
  slug: 'nano-banana-2',
1998
2022
  name: 'Nano Banana 2',
@@ -6476,7 +6500,9 @@ var De,
6476
6500
  Re();
6477
6501
  ((De = {
6478
6502
  ...ue,
6479
- families: ue.families.map((e) => ({ ...e, models: e.models.filter((t) => !Z(t)) })),
6503
+ families: ue.families
6504
+ .map((e) => ({ ...e, models: e.models.filter((t) => !Z(t)) }))
6505
+ .filter((e) => e.models.length > 0),
6480
6506
  models: ue.models.filter((e) => !Z(e.slug)),
6481
6507
  }),
6482
6508
  (qt = me.filter((e) => !Z(e.slug))),
@@ -6827,11 +6853,11 @@ function or(e, t) {
6827
6853
  var ar,
6828
6854
  Ji,
6829
6855
  nr,
6830
- ds,
6856
+ cs,
6831
6857
  Yi,
6832
6858
  sr,
6833
6859
  Ge,
6834
- cs,
6860
+ us,
6835
6861
  He,
6836
6862
  ze = y(() => {
6837
6863
  'use strict';
@@ -6983,7 +7009,7 @@ var ar,
6983
7009
  seed: !0,
6984
7010
  },
6985
7011
  ]),
6986
- (ds = nr.map((e) => e.slug)),
7012
+ (cs = nr.map((e) => e.slug)),
6987
7013
  (Yi = new Map(nr.map((e) => [e.slug, e]))));
6988
7014
  ((sr = 'EXAVITQu4vr4xnSDxMaL'),
6989
7015
  (Ge = {
@@ -7008,7 +7034,7 @@ var ar,
7008
7034
  pqHfZKP75CvOlQylNhV4: 'Bill',
7009
7035
  pNInz6obpgDQGcFmaJgB: 'Adam',
7010
7036
  }),
7011
- (cs = Object.keys(Ge)),
7037
+ (us = Object.keys(Ge)),
7012
7038
  (He = [
7013
7039
  'mp3_44100_128',
7014
7040
  'mp3_22050_32',
@@ -7215,10 +7241,10 @@ var we,
7215
7241
  cr,
7216
7242
  We,
7217
7243
  mr,
7218
- gs,
7219
7244
  hs,
7220
7245
  ys,
7221
7246
  bs,
7247
+ ws,
7222
7248
  fr = y(() => {
7223
7249
  'use strict';
7224
7250
  ((we = 'enhancor-ultrafine'),
@@ -7227,10 +7253,10 @@ var we,
7227
7253
  (cr = 'Enhancor Deblur'));
7228
7254
  ((We = { skin: [2, 3, 4], noSkin: [2, 3, 4, 8, 16] }),
7229
7255
  (mr = 2),
7230
- (gs = 24 * 1024 * 1024),
7231
- (hs = 4096 * 4096),
7232
- (ys = 30 * 6e4),
7233
- (bs = 120 * 6e4));
7256
+ (hs = 24 * 1024 * 1024),
7257
+ (ys = 4096 * 4096),
7258
+ (bs = 30 * 6e4),
7259
+ (ws = 120 * 6e4));
7234
7260
  });
7235
7261
  var ra,
7236
7262
  gr,
@@ -7319,14 +7345,14 @@ function oa(e, t) {
7319
7345
  let r = t.filter((i) => Number.isFinite(i) && i > 0);
7320
7346
  return r.length ? `from ${te(Math.min(...r))}${e}` : null;
7321
7347
  }
7322
- function Ir(e) {
7348
+ function vr(e) {
7323
7349
  for (let t of ce) {
7324
7350
  let r = Y[t],
7325
7351
  i = r ? oa(r.unit, e[t] ?? []) : null;
7326
7352
  r && i && (r.priceFormatted = i);
7327
7353
  }
7328
7354
  }
7329
- function C(e, t) {
7355
+ function $(e, t) {
7330
7356
  let r = e.axes?.resolution ?? [
7331
7357
  ...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
7332
7358
  ];
@@ -7338,7 +7364,7 @@ function C(e, t) {
7338
7364
  ...(t ? { description: t } : {}),
7339
7365
  };
7340
7366
  }
7341
- function vr(e) {
7367
+ function Ir(e) {
7342
7368
  if (!e.endpoints?.length) return null;
7343
7369
  let t = e.endpoints.filter((r) => Ht(e.slug, r.id));
7344
7370
  return {
@@ -7438,7 +7464,7 @@ function Ze(e, t) {
7438
7464
  max: t.maxSec,
7439
7465
  description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
7440
7466
  },
7441
- C(e),
7467
+ $(e),
7442
7468
  { name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
7443
7469
  ...t.references.map((r) =>
7444
7470
  r.endsWith('s')
@@ -7461,7 +7487,7 @@ function fa(e, t) {
7461
7487
  );
7462
7488
  }
7463
7489
  function ga(e) {
7464
- let t = vr(e);
7490
+ let t = Ir(e);
7465
7491
  return [
7466
7492
  S('Image prompt text. Supports complex composition and text instructions.'),
7467
7493
  ...(t ? [t] : []),
@@ -7471,7 +7497,7 @@ function ga(e) {
7471
7497
  default: 'low',
7472
7498
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
7473
7499
  },
7474
- C(
7500
+ $(
7475
7501
  e,
7476
7502
  e.slug === 'gpt-image-2'
7477
7503
  ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${St}`
@@ -7537,7 +7563,7 @@ function ha(e) {
7537
7563
  description: 'Images to edit or use as reference (up to 14).',
7538
7564
  },
7539
7565
  { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...Wt(e.slug)] },
7540
- C(e),
7566
+ $(e),
7541
7567
  {
7542
7568
  name: 'n',
7543
7569
  type: 'slider',
@@ -7689,7 +7715,7 @@ function lt(e) {
7689
7715
  }
7690
7716
  function _a(e) {
7691
7717
  if (e.slug === 'seed-2-1-turbo') return ba;
7692
- let t = vr(e);
7718
+ let t = Ir(e);
7693
7719
  return [
7694
7720
  ...(e.slug === 'gemini-3.1-pro-preview'
7695
7721
  ? xa()
@@ -7709,7 +7735,7 @@ function et() {
7709
7735
  description: 'The photo to fix: one JPEG or PNG URL.',
7710
7736
  };
7711
7737
  }
7712
- function Ia(e) {
7738
+ function va(e) {
7713
7739
  return [
7714
7740
  {
7715
7741
  name: 'video_url',
@@ -7718,7 +7744,7 @@ function Ia(e) {
7718
7744
  description:
7719
7745
  'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
7720
7746
  },
7721
- C(
7747
+ $(
7722
7748
  e,
7723
7749
  'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
7724
7750
  ),
@@ -7731,7 +7757,7 @@ function Ia(e) {
7731
7757
  },
7732
7758
  ];
7733
7759
  }
7734
- function va() {
7760
+ function Ia() {
7735
7761
  return [
7736
7762
  {
7737
7763
  name: 'mode',
@@ -7803,10 +7829,36 @@ function va() {
7803
7829
  ];
7804
7830
  }
7805
7831
  function Ta(e) {
7832
+ return [
7833
+ {
7834
+ name: 'image',
7835
+ type: 'string',
7836
+ required: !0,
7837
+ description:
7838
+ 'One clear photo of the person (or people) to animate, as a public https URL. JPEG, PNG, WEBP, BMP, TIFF or GIF; each side 300-6000 px; aspect ratio (width / height) 0.4-2.5. The Tein CLI and local MCP client read a file path on your machine and upload it first.',
7839
+ },
7840
+ {
7841
+ name: 'audio',
7842
+ type: 'string',
7843
+ required: !0,
7844
+ description:
7845
+ 'The speech, singing or music to perform, as a public https URL: MP3 or WAV, 4-300 seconds, up to 15 MB. The video runs about as long as the audio (usually under a second longer) and is billed per second of the video made, to the nearest whole second.',
7846
+ },
7847
+ {
7848
+ name: 'prompt',
7849
+ type: 'string',
7850
+ description:
7851
+ 'Optional direction for camera, body movement, expression or scene (up to 2000 characters), in Chinese, English, Japanese, Korean, Spanish (Mexican) or Indonesian. The lips follow the audio either way.',
7852
+ },
7853
+ $(e, 'Output resolution. 720p only.'),
7854
+ ];
7855
+ }
7856
+ function Ma(e) {
7806
7857
  let t = e.slug;
7807
- if (e.family === 'tein-labs' && e.kind === 'image') return va();
7808
- if (me.some((i) => i.slug === t)) return Ia(e);
7858
+ if (e.family === 'tein-labs' && e.kind === 'image') return Ia();
7859
+ if (me.some((i) => i.slug === t)) return va(e);
7809
7860
  if (e.kind === 'llm') return _a(e);
7861
+ if (e.family === 'omnihuman') return Ta(e);
7810
7862
  if (e.editVariants?.length) return ga(e);
7811
7863
  let r = je(t);
7812
7864
  if (r) return lr(r);
@@ -7821,7 +7873,7 @@ function Ta(e) {
7821
7873
  case 'seedance-2-lite':
7822
7874
  return kr(_r);
7823
7875
  case 'seedance-2-mini':
7824
- return Qe(Ma, t);
7876
+ return Qe(Sa, t);
7825
7877
  case 'nano-banana-2':
7826
7878
  case 'nano-banana-2.1':
7827
7879
  case 'nano-banana-pro':
@@ -7835,7 +7887,7 @@ function Ta(e) {
7835
7887
  description:
7836
7888
  'Reference images. The first is free; each one after it adds the extra reference image charge (see the price).',
7837
7889
  },
7838
- C(e),
7890
+ $(e),
7839
7891
  {
7840
7892
  name: 'aspect_ratio',
7841
7893
  type: 'select',
@@ -7854,7 +7906,7 @@ function Ta(e) {
7854
7906
  description:
7855
7907
  'Reference images to edit or combine (up to 16). Leave empty for text to image. Each reference image is billed.',
7856
7908
  },
7857
- { ...C(e, '1K, 2K or 4K (about 16 megapixels).'), default: '2K' },
7909
+ { ...$(e, '1K, 2K or 4K (about 16 megapixels).'), default: '2K' },
7858
7910
  {
7859
7911
  name: 'aspect_ratio',
7860
7912
  type: 'select',
@@ -7902,7 +7954,7 @@ function Ta(e) {
7902
7954
  description:
7903
7955
  'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
7904
7956
  },
7905
- C(
7957
+ $(
7906
7958
  e,
7907
7959
  '1K and 1.5K are one price, 2K the next, 4K (up to 3840x2160 or 2880x2880) the top. 4K needs an aspect_ratio other than adaptive, or exact pixels in size. layer_decomposition takes 1K, 1.5K, 2K or auto (keep the input size), billed at the 2K price.',
7908
7960
  ),
@@ -7954,7 +8006,7 @@ function Ta(e) {
7954
8006
  type: 'string[]',
7955
8007
  description: 'Up to 3 reference images, each billed at the published add-on price.',
7956
8008
  },
7957
- C(e),
8009
+ $(e),
7958
8010
  {
7959
8011
  name: 'aspect_ratio',
7960
8012
  type: 'select',
@@ -7973,7 +8025,7 @@ function Ta(e) {
7973
8025
  case 'z-image-pro':
7974
8026
  return [
7975
8027
  S('Image prompt text: subject, scene, style, composition and lighting.'),
7976
- C(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
8028
+ $(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
7977
8029
  {
7978
8030
  name: 'aspect_ratio',
7979
8031
  type: 'select',
@@ -8204,7 +8256,7 @@ function Ta(e) {
8204
8256
  description:
8205
8257
  'video: the character faces as in the reference video (better for complex motion, up to 30 s). image: as in the image (better for following camera moves, up to 10 s).',
8206
8258
  },
8207
- C(e),
8259
+ $(e),
8208
8260
  {
8209
8261
  name: 'keep_original_sound',
8210
8262
  type: 'boolean',
@@ -8262,7 +8314,7 @@ function Ta(e) {
8262
8314
  description:
8263
8315
  'Video length in seconds (3 to 15). With a last frame 3 to 10; for video_extend the seconds added (3 to 10). Not taken by video_edit, which bills the input video length.',
8264
8316
  },
8265
- { ...C(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
8317
+ { ...$(e, '1080p and 4k are upscaled. Sound is always included.'), default: '720p' },
8266
8318
  {
8267
8319
  name: 'aspect_ratio',
8268
8320
  type: 'select',
@@ -8316,7 +8368,7 @@ function Ta(e) {
8316
8368
  description: 'Video length in whole seconds: 4 to 15 at 720p, 4 to 30 at 1080p.',
8317
8369
  },
8318
8370
  {
8319
- ...C(
8371
+ ...$(
8320
8372
  e,
8321
8373
  'Sound is the same price on or off. 1080p takes about 6 to 16 minutes (up to about 28 for a 21-30 s clip); 720p about 2 to 4.',
8322
8374
  ),
@@ -8414,7 +8466,7 @@ function $r(e) {
8414
8466
  description: `The photo to ${e}: one JPEG, PNG or WebP URL, up to 24 MB and 16.7 MP, with a shorter side of at least 256 px. HEIC/HEIF isn't supported.`,
8415
8467
  };
8416
8468
  }
8417
- function Sa() {
8469
+ function Ka() {
8418
8470
  return {
8419
8471
  slug: we,
8420
8472
  name: dr,
@@ -8446,7 +8498,7 @@ function Sa() {
8446
8498
  ],
8447
8499
  };
8448
8500
  }
8449
- function Ka() {
8501
+ function Ea() {
8450
8502
  return {
8451
8503
  slug: xe,
8452
8504
  name: cr,
@@ -8474,10 +8526,10 @@ function rt(e, t = e.api.model) {
8474
8526
  ...(r.length ? { priceNotes: r } : {}),
8475
8527
  unit: e.unit,
8476
8528
  primaryToolName: at[e.kind],
8477
- parameters: pa(e, Ta(e)),
8529
+ parameters: pa(e, Ma(e)),
8478
8530
  };
8479
8531
  }
8480
- function Ea() {
8532
+ function $a() {
8481
8533
  let e = {};
8482
8534
  for (let t of ge())
8483
8535
  if (t.slug !== 'seedance-2-fast') {
@@ -8488,18 +8540,18 @@ function Ea() {
8488
8540
  if (t.slug === 'seedance-2') {
8489
8541
  let r = rt(t);
8490
8542
  ((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
8491
- (r.priceFormatted = $a(t)),
8543
+ (r.priceFormatted = Ca(t)),
8492
8544
  (e['seedance-2'] = r));
8493
8545
  continue;
8494
8546
  }
8495
8547
  t.slug.startsWith('claude-') || (e[t.api.model] = rt(t));
8496
8548
  }
8497
- (Object.assign(e, rr()), (e[we] = Sa()), (e[xe] = Ka()));
8549
+ (Object.assign(e, rr()), (e[we] = Ka()), (e[xe] = Ea()));
8498
8550
  for (let [t, r] of Object.entries(be))
8499
8551
  e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
8500
8552
  return e;
8501
8553
  }
8502
- function $a(e = F('seedance-2')) {
8554
+ function Ca(e = F('seedance-2')) {
8503
8555
  let t = F('seedance-2-fast'),
8504
8556
  r = e ? it(e) : '';
8505
8557
  if (!t) return r;
@@ -8513,7 +8565,7 @@ function Rr(e) {
8513
8565
  i && typeof r == 'string' && r.trim() && (i.priceFormatted = r.trim());
8514
8566
  }
8515
8567
  }
8516
- function Ie(e) {
8568
+ function ve(e) {
8517
8569
  return !!e?.parameters.some((t) => t.name === 'image');
8518
8570
  }
8519
8571
  function j(e) {
@@ -8523,9 +8575,9 @@ function j(e) {
8523
8575
  function Or(e) {
8524
8576
  return !br(e.slug) || e.parameters.some((t) => t.name === 'priority')
8525
8577
  ? e
8526
- : { ...e, parameters: [...e.parameters, Ca] };
8578
+ : { ...e, parameters: [...e.parameters, Aa] };
8527
8579
  }
8528
- function Aa(e, t, r) {
8580
+ function Ra(e, t, r) {
8529
8581
  if (
8530
8582
  e.startsWith('enhancor-skin-fix-') ||
8531
8583
  ur(e) ||
@@ -8562,13 +8614,13 @@ function qr(e, t) {
8562
8614
  let r = { ...t };
8563
8615
  if (e?.slug === 'seedance-2-5') {
8564
8616
  let i = (n) => typeof n != 'string' || !n.trim();
8565
- for (let n of Ra) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
8617
+ for (let n of Oa) (i(r.finalize) && !i(r[n]) && (r.finalize = r[n]), delete r[n]);
8566
8618
  if (!i(r.finalize)) return r;
8567
8619
  }
8568
8620
  for (let i of e?.parameters ?? [])
8569
8621
  i.default !== void 0 &&
8570
8622
  r[i.name] === void 0 &&
8571
- Aa(e.slug, i.name, t) &&
8623
+ Ra(e.slug, i.name, t) &&
8572
8624
  (r[i.name] = i.default);
8573
8625
  return r;
8574
8626
  }
@@ -8598,12 +8650,12 @@ var na,
8598
8650
  Sr,
8599
8651
  Kr,
8600
8652
  _r,
8601
- Ma,
8653
+ Sa,
8602
8654
  Cr,
8603
8655
  Ar,
8604
8656
  Y,
8605
- Ca,
8606
- Ra,
8657
+ Aa,
8658
+ Oa,
8607
8659
  ie = y(() => {
8608
8660
  'use strict';
8609
8661
  Kt();
@@ -8866,7 +8918,7 @@ var na,
8866
8918
  default: 'adaptive',
8867
8919
  options: ['21:9', '16:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
8868
8920
  description:
8869
- 'Aspect ratio. Edit, Extend, Image to Video and First & Last Frame only accept adaptive.',
8921
+ 'Aspect ratio. Edit and Extend only accept adaptive (another ratio is refused). Image to Video and First & Last Frame always use adaptive: the video follows the shape of the first frame, and any other ratio is ignored.',
8870
8922
  },
8871
8923
  {
8872
8924
  name: 'bitrate_mode',
@@ -9081,7 +9133,7 @@ var na,
9081
9133
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
9082
9134
  },
9083
9135
  ]),
9084
- (Ma = [
9136
+ (Sa = [
9085
9137
  {
9086
9138
  name: 'prompt',
9087
9139
  type: 'string',
@@ -9167,17 +9219,17 @@ var na,
9167
9219
  options: We.noSkin.map(String),
9168
9220
  description: `Full only: ${We.noSkin.join(', ')}. The output is the photo times the scale (a 500 x 500 photo at 4 is 2000 x 2000), at most 48 megapixels: a scale past that is refused with the scales that fit.`,
9169
9221
  }));
9170
- Y = Ea();
9171
- Ca = {
9222
+ Y = $a();
9223
+ Aa = {
9172
9224
  name: 'priority',
9173
9225
  type: 'boolean',
9174
9226
  default: !1,
9175
9227
  description:
9176
9228
  "Sent straight to Google's own API, skipping the shared queue, at Google's price + 10% (per output image and per input image, the same on every plan). If Google can not serve it, the request fails and nothing is charged.",
9177
9229
  };
9178
- Ra = ['draft_task_id', 'draft_generation_id'];
9230
+ Oa = ['draft_task_id', 'draft_generation_id'];
9179
9231
  });
9180
- function ve(e) {
9232
+ function Ie(e) {
9181
9233
  let t = '/v1/pricing/models',
9182
9234
  r = e?.trim();
9183
9235
  return r ? `${t}?model=${encodeURIComponent(r)}` : t;
@@ -9200,14 +9252,14 @@ function ii(e) {
9200
9252
  'The Acceptable Use Policy applies.',
9201
9253
  ].join(' ');
9202
9254
  }
9203
- function mn(e) {
9204
- if (ln.has(e.name)) return e;
9255
+ function fn(e) {
9256
+ if (pn.has(e.name)) return e;
9205
9257
  let t = e.inputSchema.properties;
9206
9258
  return !t || t.callback_url
9207
9259
  ? e
9208
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: on } } };
9260
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: ln } } };
9209
9261
  }
9210
- function fn(e) {
9262
+ function gn(e) {
9211
9263
  let t = e.inputSchema.properties;
9212
9264
  if (!t) return e;
9213
9265
  let r = !1,
@@ -9220,7 +9272,7 @@ function fn(e) {
9220
9272
  : (i[n] = s);
9221
9273
  return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
9222
9274
  }
9223
- function gn(e) {
9275
+ function hn(e) {
9224
9276
  switch (e.type) {
9225
9277
  case 'string':
9226
9278
  return {
@@ -9275,11 +9327,11 @@ function gn(e) {
9275
9327
  return { type: 'string', description: e.description };
9276
9328
  }
9277
9329
  }
9278
- function hn(e, t) {
9330
+ function yn(e, t) {
9279
9331
  let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
9280
9332
  i = {},
9281
9333
  n = [];
9282
- for (let o of e.parameters) ((i[o.name] = gn(o)), o.required && n.push(o.name));
9334
+ for (let o of e.parameters) ((i[o.name] = hn(o)), o.required && n.push(o.name));
9283
9335
  let s = {
9284
9336
  type: 'object',
9285
9337
  properties: i,
@@ -9292,8 +9344,8 @@ function hn(e, t) {
9292
9344
  inputSchema: s,
9293
9345
  };
9294
9346
  }
9295
- function yn() {
9296
- let e = D().filter((u) => u.category === 'Image' && !Ie(u)),
9347
+ function bn() {
9348
+ let e = D().filter((u) => u.category === 'Image' && !ve(u)),
9297
9349
  t = D().filter((u) => u.category === 'Video'),
9298
9350
  r = D().filter((u) => u.category === 'Text'),
9299
9351
  i = D().filter((u) => u.category === 'Audio'),
@@ -9564,10 +9616,10 @@ function yn() {
9564
9616
  additionalProperties: !0,
9565
9617
  },
9566
9618
  },
9567
- d = bn();
9568
- return [n, s, o, p, l, d, c, pn, ...ni];
9619
+ d = wn();
9620
+ return [n, s, o, p, l, d, c, dn, ...ni];
9569
9621
  }
9570
- function bn() {
9622
+ function wn() {
9571
9623
  return {
9572
9624
  name: 'upload_asset',
9573
9625
  description:
@@ -9615,18 +9667,18 @@ function bn() {
9615
9667
  };
9616
9668
  }
9617
9669
  function yt() {
9618
- let e = yn(),
9619
- t = D().map((r) => hn(r));
9620
- return [...e, ...t].map(mn).map(fn);
9670
+ let e = bn(),
9671
+ t = D().map((r) => yn(r));
9672
+ return [...e, ...t].map(fn).map(gn);
9621
9673
  }
9622
- var on,
9623
- ln,
9674
+ var ln,
9624
9675
  pn,
9625
9676
  dn,
9626
9677
  cn,
9627
9678
  un,
9679
+ mn,
9628
9680
  ni,
9629
- Eo,
9681
+ $o,
9630
9682
  ai,
9631
9683
  si = y(() => {
9632
9684
  'use strict';
@@ -9634,12 +9686,12 @@ var on,
9634
9686
  Xe();
9635
9687
  Ye();
9636
9688
  ie();
9637
- ((on = {
9689
+ ((ln = {
9638
9690
  type: 'string',
9639
9691
  description:
9640
9692
  '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.',
9641
9693
  }),
9642
- (ln = new Set([
9694
+ (pn = new Set([
9643
9695
  'upload_asset',
9644
9696
  'upload_media',
9645
9697
  'upload_image',
@@ -9650,7 +9702,7 @@ var on,
9650
9702
  'get_usage',
9651
9703
  'get_balance_history',
9652
9704
  ])),
9653
- (pn = {
9705
+ (dn = {
9654
9706
  name: 'get_pricing',
9655
9707
  description:
9656
9708
  '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. price_texts has the current "from" price of each model. No API key is required; with one, your_prices lists the prices your workspace pays (Your price) next to the published price of each row on its price list. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
@@ -9665,13 +9717,13 @@ var on,
9665
9717
  additionalProperties: !1,
9666
9718
  },
9667
9719
  }),
9668
- (dn = {
9720
+ (cn = {
9669
9721
  name: 'get_balance',
9670
9722
  description:
9671
9723
  "Your Tein workspace's balance right now, what this API key can still spend (the balance, or less when the key has its own spending limit), credits on hold, and the workspace's usage this month and in the last 30 days from every channel (website, API, MCP, CLI, workflows). Use it before a run to check the balance covers it, or to show the balance in an app. Nothing runs and nothing is charged. The same payload as GET /v1/balance.",
9672
9724
  inputSchema: { type: 'object', properties: {}, additionalProperties: !1 },
9673
9725
  }),
9674
- (cn = {
9726
+ (un = {
9675
9727
  name: 'get_usage',
9676
9728
  description:
9677
9729
  "Your Tein workspace's usage in detail, the same numbers as the dashboard's Usage page: total spend and requests (succeeded, failed, running), this API key's own share, and breakdowns by model, by channel (website, api, mcp, cli), by API key, and over time. Covers every run of the workspace, wherever it was started. Nothing runs and nothing is charged. The same payload as GET /v1/usage.",
@@ -9702,7 +9754,7 @@ var on,
9702
9754
  additionalProperties: !1,
9703
9755
  },
9704
9756
  }),
9705
- (un = {
9757
+ (mn = {
9706
9758
  name: 'get_balance_history',
9707
9759
  description:
9708
9760
  "Your Tein balance's history, newest first, the same list as the Billing page: top ups, each run's charge (with its job_id and model), refunds, credits from Tein and adjustments, each with the balance after it. Nothing runs and nothing is charged. The same payload as GET /v1/balance/transactions.",
@@ -9720,8 +9772,8 @@ var on,
9720
9772
  additionalProperties: !1,
9721
9773
  },
9722
9774
  }),
9723
- (ni = [dn, cn, un]),
9724
- (Eo = new Set(ni.map((e) => e.name))));
9775
+ (ni = [cn, un, mn]),
9776
+ ($o = new Set(ni.map((e) => e.name))));
9725
9777
  ai = new Set([
9726
9778
  'image',
9727
9779
  'images',
@@ -9740,13 +9792,13 @@ var on,
9740
9792
  ]);
9741
9793
  });
9742
9794
  var hi = {};
9743
- Ii(hi, {
9744
- forgetToolSchemas: () => Pn,
9795
+ vi(hi, {
9796
+ forgetToolSchemas: () => vn,
9745
9797
  jsonRpcAnswer: () => di,
9746
9798
  preprocessLocalFiles: () => fi,
9747
9799
  startStdioServer: () => gi,
9748
9800
  });
9749
- function wn(e) {
9801
+ function xn(e) {
9750
9802
  let t = (r) =>
9751
9803
  !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
9752
9804
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
@@ -9760,7 +9812,7 @@ function di(e, t, r) {
9760
9812
  } catch {
9761
9813
  s = null;
9762
9814
  }
9763
- if (s !== null && wn(s)) return n ? null : s;
9815
+ if (s !== null && xn(s)) return n ? null : s;
9764
9816
  if (n) return null;
9765
9817
  if (!r && t >= 200 && t < 300) return;
9766
9818
  let o = s?.error,
@@ -9781,7 +9833,7 @@ function di(e, t, r) {
9781
9833
  },
9782
9834
  };
9783
9835
  }
9784
- function xn() {
9836
+ function kn() {
9785
9837
  let e = process.argv.slice(2),
9786
9838
  t = e.indexOf('--api-key');
9787
9839
  return _(t >= 0 ? e[t + 1] : void 0);
@@ -9816,14 +9868,14 @@ async function ci(e, t, r) {
9816
9868
  };
9817
9869
  }
9818
9870
  function ui(e) {
9819
- return kn.has(Q.default.extname(e).toLowerCase());
9871
+ return _n.has(Q.default.extname(e).toLowerCase());
9820
9872
  }
9821
9873
  function mi(e) {
9822
9874
  return new Error(
9823
9875
  `Tein uploads image, video and audio files only, and ${Q.default.basename(e)} is not one.`,
9824
9876
  );
9825
9877
  }
9826
- function _n(e) {
9878
+ function Pn(e) {
9827
9879
  let t = e.trim();
9828
9880
  if (
9829
9881
  !t ||
@@ -9846,7 +9898,7 @@ function wt(e) {
9846
9898
  se.set(r.name, r.inputSchema);
9847
9899
  }
9848
9900
  }
9849
- function Pn() {
9901
+ function vn() {
9850
9902
  (se.clear(), (bt = 0));
9851
9903
  }
9852
9904
  async function In(e, t) {
@@ -9865,7 +9917,7 @@ async function In(e, t) {
9865
9917
  } catch {}
9866
9918
  }
9867
9919
  }
9868
- function vn(e) {
9920
+ function Tn(e) {
9869
9921
  return e
9870
9922
  ? e.type === 'string'
9871
9923
  ? e.format === 'uri'
@@ -9874,7 +9926,7 @@ function vn(e) {
9874
9926
  }
9875
9927
  async function oi(e, t, r) {
9876
9928
  if (typeof e != 'string') return e;
9877
- let i = _n(e);
9929
+ let i = Pn(e);
9878
9930
  if (!i) return e;
9879
9931
  if (!ui(i)) throw mi(i);
9880
9932
  return (await ci(i, t, r)).url;
@@ -9885,7 +9937,7 @@ async function fi(e, t, r, i, n) {
9885
9937
  if (!s) return t;
9886
9938
  let o = { ...t };
9887
9939
  for (let [p, l] of Object.entries(t))
9888
- if (vn(s[p]))
9940
+ if (Tn(s[p]))
9889
9941
  if (Array.isArray(l)) {
9890
9942
  let c = [];
9891
9943
  for (let d of l) c.push(await oi(d, r, i));
@@ -9893,7 +9945,7 @@ async function fi(e, t, r, i, n) {
9893
9945
  } else o[p] = await oi(l, r, i);
9894
9946
  return o;
9895
9947
  }
9896
- function Tn(e) {
9948
+ function Mn(e) {
9897
9949
  let t = e.id ?? null;
9898
9950
  switch (e.method) {
9899
9951
  case 'initialize':
@@ -9937,7 +9989,7 @@ function Tn(e) {
9937
9989
  async function gi() {
9938
9990
  if (li) return;
9939
9991
  li = !0;
9940
- let e = xn(),
9992
+ let e = kn(),
9941
9993
  t = x(),
9942
9994
  r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
9943
9995
  (pi.default
@@ -9952,7 +10004,7 @@ async function gi() {
9952
10004
  c = o.params.arguments || {};
9953
10005
  if (l === 'get_pricing') {
9954
10006
  let d = typeof c.model == 'string' ? c.model.trim() : '',
9955
- u = `${t.replace(/\/+$/, '')}${ve(d)}`;
10007
+ u = `${t.replace(/\/+$/, '')}${Ie(d)}`;
9956
10008
  try {
9957
10009
  let m = await fetch(u, {
9958
10010
  signal: AbortSignal.timeout(1e4),
@@ -10104,7 +10156,7 @@ Pass this URL to any Tein generation tool.`,
10104
10156
  return;
10105
10157
  }
10106
10158
  } catch {}
10107
- let p = Tn(o);
10159
+ let p = Mn(o);
10108
10160
  p !== null &&
10109
10161
  process.stdout.write(
10110
10162
  JSON.stringify(p) +
@@ -10130,7 +10182,7 @@ Pass this URL to any Tein generation tool.`,
10130
10182
  var N,
10131
10183
  Q,
10132
10184
  pi,
10133
- kn,
10185
+ _n,
10134
10186
  se,
10135
10187
  bt,
10136
10188
  li,
@@ -10143,7 +10195,7 @@ var N,
10143
10195
  si();
10144
10196
  R();
10145
10197
  oe();
10146
- kn = new Set([
10198
+ _n = new Set([
10147
10199
  '.png',
10148
10200
  '.jpg',
10149
10201
  '.jpeg',
@@ -10204,7 +10256,7 @@ var a = {
10204
10256
  bgCyan: k(46, 49),
10205
10257
  bgGreen: k(42, 49),
10206
10258
  },
10207
- $ = class {
10259
+ C = class {
10208
10260
  constructor(t = '') {
10209
10261
  this.frames = [
10210
10262
  '\u280B',
@@ -10269,8 +10321,8 @@ var a = {
10269
10321
  var G = M(require('node:fs')),
10270
10322
  O = M(require('node:path'));
10271
10323
  var le = M(require('node:fs')),
10272
- It = M(require('node:path')),
10273
- vt = require('node:stream/promises');
10324
+ vt = M(require('node:path')),
10325
+ It = require('node:stream/promises');
10274
10326
  oe();
10275
10327
  var Ei = new Set([
10276
10328
  'account_suspended',
@@ -10419,10 +10471,10 @@ var K = class {
10419
10471
  async downloadOutput(t, r) {
10420
10472
  let i = await fetch(t);
10421
10473
  if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
10422
- let n = It.default.dirname(r);
10474
+ let n = vt.default.dirname(r);
10423
10475
  le.default.existsSync(n) || le.default.mkdirSync(n, { recursive: !0 });
10424
10476
  let s = le.default.createWriteStream(r);
10425
- return (await (0, vt.pipeline)(i.body, s), r);
10477
+ return (await (0, It.pipeline)(i.body, s), r);
10426
10478
  }
10427
10479
  };
10428
10480
  R();
@@ -10436,28 +10488,28 @@ function Ce(e) {
10436
10488
  }
10437
10489
  ie();
10438
10490
  var Lr = ['images', 'input_images', 'videos', 'audios'];
10439
- function Oa(e) {
10491
+ function qa(e) {
10440
10492
  for (let t of Lr) typeof e[t] == 'string' && (e[t] = [e[t]]);
10441
10493
  }
10442
- function qa(e) {
10494
+ function La(e) {
10443
10495
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
10444
10496
  let t = O.default.resolve(e);
10445
10497
  return G.default.existsSync(t) && G.default.statSync(t).isFile() ? t : null;
10446
10498
  }
10447
- async function La(e, t) {
10499
+ async function Da(e, t) {
10448
10500
  for (let r of Lr) {
10449
10501
  if (!Array.isArray(e[r])) continue;
10450
10502
  let i = [];
10451
10503
  for (let n of e[r]) {
10452
10504
  if (typeof n != 'string') continue;
10453
- let s = qa(n);
10505
+ let s = La(n);
10454
10506
  i.push(s ? await t(s) : n);
10455
10507
  }
10456
10508
  e[r] = i;
10457
10509
  }
10458
10510
  }
10459
10511
  var ae = { starter: 10, plus: 25, scale: 40, enterprise: 200 };
10460
- function Da(e) {
10512
+ function Na(e) {
10461
10513
  if (e.count === void 0 || e.count === !0) return 1;
10462
10514
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
10463
10515
  r = ae.enterprise;
@@ -10470,7 +10522,7 @@ function Da(e) {
10470
10522
  t
10471
10523
  );
10472
10524
  }
10473
- async function Na(e, t, r, i, n) {
10525
+ async function Ua(e, t, r, i, n) {
10474
10526
  n.isJson ||
10475
10527
  process.stderr.write(`Starting ${i} ${t} jobs together...
10476
10528
  `);
@@ -10548,7 +10600,7 @@ async function Na(e, t, r, i, n) {
10548
10600
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
10549
10601
  process.exit(T);
10550
10602
  }
10551
- function Ua(e, t, r) {
10603
+ function Va(e, t, r) {
10552
10604
  if (r <= 1) return e;
10553
10605
  let i = O.default.extname(e);
10554
10606
  return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
@@ -10620,7 +10672,7 @@ async function pt(e, t) {
10620
10672
  s = !!t.json,
10621
10673
  o = !!(t.async || t.no_wait),
10622
10674
  p = typeof t.output == 'string' ? t.output : void 0,
10623
- l = Da(t),
10675
+ l = Na(t),
10624
10676
  c = { ...t };
10625
10677
  (delete c.json,
10626
10678
  delete c.async,
@@ -10630,8 +10682,8 @@ async function pt(e, t) {
10630
10682
  delete c.api_url,
10631
10683
  delete c.count);
10632
10684
  let d = qr(n, c);
10633
- (Oa(d),
10634
- typeof d.image == 'string' && !d.images && !Ie(n) && ((d.images = [d.image]), delete d.image),
10685
+ (qa(d),
10686
+ typeof d.image == 'string' && !d.images && !ve(n) && ((d.images = [d.image]), delete d.image),
10635
10687
  d.image_url &&
10636
10688
  !d.first_frame_image &&
10637
10689
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
@@ -10651,14 +10703,14 @@ async function pt(e, t) {
10651
10703
  for (let w of m) {
10652
10704
  let h = d[w];
10653
10705
  if (typeof h == 'string' && !h.startsWith('http://') && !h.startsWith('https://')) {
10654
- let I = O.default.resolve(h);
10655
- if (G.default.existsSync(I) && G.default.statSync(I).isFile()) {
10656
- let v = new $(`Uploading local file ${O.default.basename(I)} to CDN...`);
10657
- s || v.start();
10706
+ let v = O.default.resolve(h);
10707
+ if (G.default.existsSync(v) && G.default.statSync(v).isFile()) {
10708
+ let I = new C(`Uploading local file ${O.default.basename(v)} to CDN...`);
10709
+ s || I.start();
10658
10710
  try {
10659
- let V = G.default.readFileSync(I),
10711
+ let V = G.default.readFileSync(v),
10660
10712
  q = await u.uploadAsset(V.toString('base64'));
10661
- ((d[w] = q.url), s || v.succeed(`Uploaded ${O.default.basename(I)} to CDN`));
10713
+ ((d[w] = q.url), s || I.succeed(`Uploaded ${O.default.basename(v)} to CDN`));
10662
10714
  } catch (V) {
10663
10715
  let q = V instanceof Error ? V.message : String(V);
10664
10716
  (s
@@ -10667,37 +10719,37 @@ async function pt(e, t) {
10667
10719
  `
10668
10720
  `,
10669
10721
  )
10670
- : v.fail(`Upload failed: ${q}`),
10722
+ : I.fail(`Upload failed: ${q}`),
10671
10723
  process.exit(1));
10672
10724
  }
10673
10725
  }
10674
10726
  }
10675
10727
  }
10676
- await La(d, async (w) => {
10677
- let h = new $(`Uploading local file ${O.default.basename(w)} to CDN...`);
10728
+ await Da(d, async (w) => {
10729
+ let h = new C(`Uploading local file ${O.default.basename(w)} to CDN...`);
10678
10730
  s || h.start();
10679
10731
  try {
10680
- let I = G.default.readFileSync(w),
10681
- v = await u.uploadAsset(I.toString('base64'));
10682
- return (s || h.succeed(`Uploaded ${O.default.basename(w)} to CDN`), v.url);
10683
- } catch (I) {
10684
- let v = I instanceof Error ? I.message : String(I);
10732
+ let v = G.default.readFileSync(w),
10733
+ I = await u.uploadAsset(v.toString('base64'));
10734
+ return (s || h.succeed(`Uploaded ${O.default.basename(w)} to CDN`), I.url);
10735
+ } catch (v) {
10736
+ let I = v instanceof Error ? v.message : String(v);
10685
10737
  (s
10686
10738
  ? process.stdout.write(
10687
- JSON.stringify({ error: v }) +
10739
+ JSON.stringify({ error: I }) +
10688
10740
  `
10689
10741
  `,
10690
10742
  )
10691
- : h.fail(`Upload failed: ${v}`),
10743
+ : h.fail(`Upload failed: ${I}`),
10692
10744
  process.exit(1));
10693
10745
  }
10694
10746
  });
10695
- let g = new $(`Submitting task for ${a.bold(e)}...`);
10747
+ let g = new C(`Submitting task for ${a.bold(e)}...`);
10696
10748
  s || g.start();
10697
10749
  let f;
10698
10750
  try {
10699
10751
  if (l > 1) {
10700
- await Na(u, e, d, l, { isJson: s, isAsync: o });
10752
+ await Ua(u, e, d, l, { isJson: s, isAsync: o });
10701
10753
  return;
10702
10754
  }
10703
10755
  f = await u.queueJob(e, d);
@@ -10789,30 +10841,30 @@ async function pt(e, t) {
10789
10841
  process.stdout.write(`
10790
10842
  ${a.bold('Outputs:')}
10791
10843
  `);
10792
- let w = f.output.filter((I) => I.url).length,
10844
+ let w = f.output.filter((v) => v.url).length,
10793
10845
  h = 0;
10794
- for (let I = 0; I < f.output.length; I++) {
10795
- let v = f.output[I];
10796
- if (v.url) {
10797
- let V = v.layer?.name ? ` ${a.bold(v.layer.name)}` : '';
10846
+ for (let v = 0; v < f.output.length; v++) {
10847
+ let I = f.output[v];
10848
+ if (I.url) {
10849
+ let V = I.layer?.name ? ` ${a.bold(I.layer.name)}` : '';
10798
10850
  if (
10799
- (process.stdout.write(` [${v.type.toUpperCase()}]${V} ${a.cyan(a.underline(v.url))}
10851
+ (process.stdout.write(` [${I.type.toUpperCase()}]${V} ${a.cyan(a.underline(I.url))}
10800
10852
  `),
10801
10853
  p)
10802
10854
  ) {
10803
- let q = Ua(p, h++, w),
10804
- xt = new $(`Downloading output to ${q}...`).start();
10855
+ let q = Va(p, h++, w),
10856
+ xt = new C(`Downloading output to ${q}...`).start();
10805
10857
  try {
10806
- (await u.downloadOutput(v.url, O.default.resolve(process.cwd(), q)),
10858
+ (await u.downloadOutput(I.url, O.default.resolve(process.cwd(), q)),
10807
10859
  xt.succeed(`Saved to ${a.bold(q)}`));
10808
10860
  } catch (Me) {
10809
10861
  xt.fail(`Failed to download: ${Me instanceof Error ? Me.message : Me}`);
10810
10862
  }
10811
10863
  }
10812
10864
  } else
10813
- v.text &&
10865
+ I.text &&
10814
10866
  process.stdout.write(`
10815
- ${v.text}
10867
+ ${I.text}
10816
10868
  `);
10817
10869
  }
10818
10870
  }
@@ -10821,7 +10873,7 @@ ${v.text}
10821
10873
  }
10822
10874
  var Nr = M(require('node:readline'));
10823
10875
  R();
10824
- async function Va(e) {
10876
+ async function Fa(e) {
10825
10877
  try {
10826
10878
  return (await new K(e, x()).checkKey(), 'ok');
10827
10879
  } catch (t) {
@@ -10832,7 +10884,7 @@ async function Va(e) {
10832
10884
  return 'unchecked';
10833
10885
  }
10834
10886
  }
10835
- function Fa(e) {
10887
+ function Ba(e) {
10836
10888
  let t = Nr.default.createInterface({ input: process.stdin, output: process.stdout });
10837
10889
  return new Promise((r) => {
10838
10890
  t.question(e, (i) => {
@@ -10852,14 +10904,14 @@ ${a.bold('Tein AI Authentication')}
10852
10904
  process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
10853
10905
 
10854
10906
  `),
10855
- (r = await Fa('Enter your Tein API Key (sk_live_...): '))),
10907
+ (r = await Ba('Enter your Tein API Key (sk_live_...): '))),
10856
10908
  !r.startsWith('sk_live_') &&
10857
10909
  !r.startsWith('sk_test_') &&
10858
10910
  (process.stderr
10859
10911
  .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
10860
10912
  `),
10861
10913
  process.exit(1)));
10862
- let i = await Va(r);
10914
+ let i = await Fa(r);
10863
10915
  (i === 'invalid' &&
10864
10916
  (process.stderr
10865
10917
  .write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
@@ -10937,7 +10989,7 @@ function P(e) {
10937
10989
  function Ur(e) {
10938
10990
  return `${e} ${e === 1 ? 'request' : 'requests'}`;
10939
10991
  }
10940
- function Ba(e) {
10992
+ function ja(e) {
10941
10993
  let t = [
10942
10994
  ['Balance', P(e.balance)],
10943
10995
  ['Available to this key', P(e.available)],
@@ -11015,7 +11067,7 @@ async function Vr(e) {
11015
11067
  }
11016
11068
  process.stdout.write(`
11017
11069
  ${a.bold('Tein balance')}
11018
- ${Ba(n).join(`
11070
+ ${ja(n).join(`
11019
11071
  `)}
11020
11072
 
11021
11073
  `);
@@ -11078,7 +11130,7 @@ function dt(e) {
11078
11130
  .trimEnd()}`,
11079
11131
  );
11080
11132
  }
11081
- function ja(e) {
11133
+ function Ga(e) {
11082
11134
  let t = e.summary,
11083
11135
  r = [
11084
11136
  ` Window ${e.from.slice(0, 10)} to ${e.to.slice(0, 10)} (${e.range})${e.filters.model ? `, model ${e.filters.model}` : ''}${e.filters.channel ? `, channel ${e.filters.channel}` : ''}`,
@@ -11120,12 +11172,12 @@ async function Gr(e) {
11120
11172
  }
11121
11173
  process.stdout.write(`
11122
11174
  ${a.bold('Tein usage')}
11123
- ${ja(i).join(`
11175
+ ${Ga(i).join(`
11124
11176
  `)}
11125
11177
 
11126
11178
  `);
11127
11179
  }
11128
- function Ga(e) {
11180
+ function Ha(e) {
11129
11181
  return e.data.length
11130
11182
  ? dt([
11131
11183
  ['When (UTC)', 'Amount', 'Balance after', 'What'],
@@ -11157,7 +11209,7 @@ async function Hr(e) {
11157
11209
  : '';
11158
11210
  process.stdout.write(`
11159
11211
  ${a.bold('Tein balance history')}
11160
- ${Ga(i).join(`
11212
+ ${Ha(i).join(`
11161
11213
  `)}${n}
11162
11214
 
11163
11215
  `);
@@ -11167,7 +11219,7 @@ Ae();
11167
11219
  ie();
11168
11220
  R();
11169
11221
  ct();
11170
- var Ha = 1e4,
11222
+ var za = 1e4,
11171
11223
  zr = {
11172
11224
  price: '',
11173
11225
  creativeMode: 'Creative mode',
@@ -11178,23 +11230,23 @@ var Ha = 1e4,
11178
11230
  priorityDraft: 'Priority + Draft',
11179
11231
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
11180
11232
  },
11181
- za = Object.keys(zr),
11182
- Wa = {
11233
+ Wa = Object.keys(zr),
11234
+ Ja = {
11183
11235
  creativeMode: 'unfiltered',
11184
11236
  creativeModePriority: 'unfilteredPriority',
11185
11237
  creativeModeDraft: 'unfilteredDraft',
11186
11238
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
11187
11239
  };
11188
- function Ja(e, t) {
11189
- let r = Wa[t];
11240
+ function Ya(e, t) {
11241
+ let r = Ja[t];
11190
11242
  return e[t] ?? (r ? e[r] : void 0);
11191
11243
  }
11192
- async function Ya(e, t, r = _()) {
11193
- let i = `${x(e)}${ve(t)}`,
11244
+ async function Xa(e, t, r = _()) {
11245
+ let i = `${x(e)}${Ie(t)}`,
11194
11246
  n;
11195
11247
  try {
11196
11248
  n = await fetch(i, {
11197
- signal: AbortSignal.timeout(Ha),
11249
+ signal: AbortSignal.timeout(za),
11198
11250
  ...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
11199
11251
  });
11200
11252
  } catch {
@@ -11235,7 +11287,7 @@ function ut(e) {
11235
11287
  function mt(e, t, r, i = !1) {
11236
11288
  return `${e}|${i ? 'edit/' : ''}${t}|${r}`;
11237
11289
  }
11238
- function Xa(e) {
11290
+ function Qa(e) {
11239
11291
  let t = new Map();
11240
11292
  for (let r of e ?? []) {
11241
11293
  let i = r.addon ? `addon/${r.addon}` : (r.variant ?? '');
@@ -11243,7 +11295,7 @@ function Xa(e) {
11243
11295
  }
11244
11296
  return t;
11245
11297
  }
11246
- function Qa(e) {
11298
+ function Za(e) {
11247
11299
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
11248
11300
  let t = [];
11249
11301
  for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
@@ -11255,10 +11307,10 @@ function Qa(e) {
11255
11307
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
11256
11308
  );
11257
11309
  }
11258
- function Za(e, t, r, i, n) {
11259
- let s = Qa(t);
11260
- for (let o of za) {
11261
- let p = X(Ja(t, o));
11310
+ function en(e, t, r, i, n) {
11311
+ let s = Za(t);
11312
+ for (let o of Wa) {
11313
+ let p = X(Ya(t, o));
11262
11314
  if (!p) continue;
11263
11315
  let l = Wr(o);
11264
11316
  r.push(` ${s}${l} ${p}`);
@@ -11266,12 +11318,12 @@ function Za(e, t, r, i, n) {
11266
11318
  c && (n.add(c), r.push(` ${a.yellow('Your price')} ${X(c.price) ?? ''}`));
11267
11319
  }
11268
11320
  }
11269
- function en(e, t, r, i) {
11321
+ function tn(e, t, r, i) {
11270
11322
  let n = e.quality ? ` quality=${e.quality}` : '';
11271
11323
  t.push(
11272
11324
  ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${n}`)}`,
11273
11325
  );
11274
- for (let o of e.variants ?? []) Za(e.slug, o, t, r, i);
11326
+ for (let o of e.variants ?? []) en(e.slug, o, t, r, i);
11275
11327
  let s = e.addons;
11276
11328
  if (Array.isArray(s))
11277
11329
  for (let o of s) {
@@ -11287,7 +11339,7 @@ function en(e, t, r, i) {
11287
11339
  typeof o == 'string' && o.trim() && t.push(` ${a.dim(o.trim())}`);
11288
11340
  t.push('');
11289
11341
  }
11290
- function tn(e) {
11342
+ function rn(e) {
11291
11343
  let t = [],
11292
11344
  r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
11293
11345
  (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
@@ -11300,7 +11352,7 @@ function tn(e) {
11300
11352
  `${a.yellow('Your price')} ${a.dim('rows are the prices your workspace pays instead of the published ones.')}`,
11301
11353
  ),
11302
11354
  t.push(''));
11303
- let n = Xa(i),
11355
+ let n = Qa(i),
11304
11356
  s = new Set(),
11305
11357
  o = new Map();
11306
11358
  for (let m of e.board.models) {
@@ -11316,7 +11368,7 @@ function tn(e) {
11316
11368
  });
11317
11369
  for (let m of l) {
11318
11370
  t.push(`${a.bold(a.cyan(`\u2500\u2500 ${m} \u2500\u2500`))}`);
11319
- for (let g of o.get(m) ?? []) en(g, t, n, s);
11371
+ for (let g of o.get(m) ?? []) tn(g, t, n, s);
11320
11372
  }
11321
11373
  let c = i.filter((m) => !s.has(m));
11322
11374
  if (c.length) {
@@ -11357,7 +11409,7 @@ function tn(e) {
11357
11409
  async function Jr(e) {
11358
11410
  let t;
11359
11411
  try {
11360
- t = await Ya(e.apiUrl, e.model);
11412
+ t = await Xa(e.apiUrl, e.model);
11361
11413
  } catch (r) {
11362
11414
  let i = r instanceof Error ? r.message : String(r);
11363
11415
  (process.stderr.write(`${a.red('Error:')} ${i}
@@ -11368,15 +11420,15 @@ async function Jr(e) {
11368
11420
  e.json
11369
11421
  ? `${JSON.stringify(t, null, 2)}
11370
11422
  `
11371
- : tn(t),
11423
+ : rn(t),
11372
11424
  );
11373
11425
  }
11374
- var rn = 3e3;
11426
+ var an = 3e3;
11375
11427
  async function Yr(e, t) {
11376
11428
  let r = t ?? _();
11377
11429
  try {
11378
11430
  let i = await fetch(`${x(e)}/v1/pricing`, {
11379
- signal: AbortSignal.timeout(rn),
11431
+ signal: AbortSignal.timeout(an),
11380
11432
  ...(r ? { headers: { Authorization: `Bearer ${r}` } } : {}),
11381
11433
  });
11382
11434
  if (!i.ok) return { live: !1, yourPrices: null };
@@ -11386,28 +11438,28 @@ async function Yr(e, t) {
11386
11438
  let l = String(p.modelSlug ?? '');
11387
11439
  ce.has(l) && (s[l] ??= []).push(Number(p.starterPrice));
11388
11440
  }
11389
- (Ir(s), Rr(n.price_texts));
11441
+ (vr(s), Rr(n.price_texts));
11390
11442
  let o = n.your_prices?.rows;
11391
11443
  return { live: !0, yourPrices: Array.isArray(o) ? o : null };
11392
11444
  } catch {
11393
11445
  return { live: !1, yourPrices: null };
11394
11446
  }
11395
11447
  }
11396
- function an(e) {
11448
+ function nn(e) {
11397
11449
  return j(e.slug) ? e.slug : e.model;
11398
11450
  }
11399
11451
  function Xr(e, t) {
11400
- return (t ?? []).filter((r) => r && an(r) === e);
11452
+ return (t ?? []).filter((r) => r && nn(r) === e);
11401
11453
  }
11402
- var nn = new Set(['video', 'image', 'text', 'audio', '3d']),
11403
- sn = { llm: 'text', chat: 'text', reasoning: 'text' };
11454
+ var sn = new Set(['video', 'image', 'text', 'audio', '3d']),
11455
+ on = { llm: 'text', chat: 'text', reasoning: 'text' };
11404
11456
  async function Qr(e, t) {
11405
11457
  let r = await Yr(t),
11406
11458
  i = D();
11407
11459
  if (e) {
11408
11460
  let o = e.toLowerCase(),
11409
- p = sn[o] ?? o;
11410
- i = nn.has(p)
11461
+ p = on[o] ?? o;
11462
+ i = sn.has(p)
11411
11463
  ? i.filter((l) => l.category.toLowerCase() === p)
11412
11464
  : i.filter((l) => l.kind.toLowerCase().includes(o) || l.slug.toLowerCase().includes(o));
11413
11465
  }
@@ -11569,7 +11621,7 @@ async function ti(e, t) {
11569
11621
  s = !!t.wait,
11570
11622
  o = typeof t.output == 'string' ? t.output : void 0,
11571
11623
  p = new K(r, i),
11572
- l = new $(`Checking status of ${a.bold(e)}...`);
11624
+ l = new C(`Checking status of ${a.bold(e)}...`);
11573
11625
  n || l.start();
11574
11626
  let c;
11575
11627
  try {
@@ -11642,7 +11694,7 @@ ${a.bold('Outputs:')}
11642
11694
  `),
11643
11695
  o)
11644
11696
  ) {
11645
- let u = new $(`Downloading output to ${o}...`).start();
11697
+ let u = new C(`Downloading output to ${o}...`).start();
11646
11698
  try {
11647
11699
  (await p.downloadOutput(d.url, ei.default.resolve(process.cwd(), o)),
11648
11700
  u.succeed(`Saved to ${a.bold(o)}`));
@@ -11687,7 +11739,7 @@ async function ri(e, t = {}) {
11687
11739
  let o = gt.default.basename(s),
11688
11740
  l = ft.default.readFileSync(s).toString('base64'),
11689
11741
  c = new K(r, i),
11690
- d = new $(`Uploading ${a.bold(o)} to Tein AI CDN...`);
11742
+ d = new C(`Uploading ${a.bold(o)} to Tein AI CDN...`);
11691
11743
  n || d.start();
11692
11744
  try {
11693
11745
  let u = await c.uploadAsset(l);
@@ -11811,7 +11863,7 @@ ${a.bold('EXAMPLES:')}
11811
11863
 
11812
11864
  `);
11813
11865
  }
11814
- async function Mn() {
11866
+ async function Sn() {
11815
11867
  let e = process.argv.slice(2),
11816
11868
  t = Dr(e);
11817
11869
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
@@ -11918,7 +11970,7 @@ Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for t
11918
11970
  }
11919
11971
  }
11920
11972
  }
11921
- Mn().catch((e) => {
11973
+ Sn().catch((e) => {
11922
11974
  (e instanceof b &&
11923
11975
  (process.stderr.write(`
11924
11976
  ${a.red('Error:')} ${E(e).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teinai/cli",
3
- "version": "1.1.48",
3
+ "version": "1.1.50",
4
4
  "description": "Official CLI for Tein AI models (Video, Image, Audio, LLM, 3D)",
5
5
  "main": "index.js",
6
6
  "bin": {