@velaro/cli 1.4.84 → 1.4.85

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.
@@ -29,7 +29,9 @@ export const avatarCommand = {
29
29
  console.log(` Voice ID: ${data.voiceId || '(site default)'}`);
30
30
  console.log(` Enabled: ${data.enabled ? 'yes' : 'no'}`);
31
31
  console.log(` "Call me": ${data.showCallMeOption ? 'yes' : 'no'}`);
32
- console.log(` Callback window: ${data.callbackConfirmWindowMinutes} min\n`);
32
+ console.log(` Callback window: ${data.callbackConfirmWindowMinutes} min`);
33
+ console.log(` Max minutes/mo: ${data.maxAvatarMinutesPerMonth ?? '(plan default)'}`);
34
+ console.log(` Max TTS chars/mo: ${data.maxAvatarTtsChars ?? '(plan default)'}\n`);
33
35
  }),
34
36
  })
35
37
  .command({
@@ -71,5 +73,27 @@ export const avatarCommand = {
71
73
  console.log(`\n✓ AI Video Avatar disabled for site ${argv.site}\n`);
72
74
  }),
73
75
  })
74
- .demandCommand(1, 'Specify a subcommand: get | enable | disable'),
76
+ .command({
77
+ command: 'set',
78
+ describe: "Set a site's monthly avatar caps (finite only, audited)",
79
+ builder: y => y
80
+ .option('site', { type: 'number', demandOption: true, describe: 'Site ID' })
81
+ .option('max-minutes', { type: 'number', describe: 'Monthly avatar video minutes cap (whole number 1-100000)' })
82
+ .option('max-tts-chars', { type: 'number', describe: 'Monthly avatar TTS character cap (whole number 1-100000000)' }),
83
+ handler: runCommand(async argv => {
84
+ const body = {};
85
+ for (const [opt, key, max] of [['max-minutes', 'maxAvatarMinutesPerMonth', 100000], ['max-tts-chars', 'maxAvatarTtsChars', 100000000]]) {
86
+ if (argv[opt] === undefined) continue;
87
+ if (!Number.isInteger(argv[opt]) || argv[opt] < 1 || argv[opt] > max) throw new Error(`--${opt} must be a whole number between 1 and ${max} (never unlimited)`);
88
+ body[key] = argv[opt];
89
+ }
90
+ if (!Object.keys(body).length) throw new Error('Provide --max-minutes and/or --max-tts-chars');
91
+ const data = await request('POST', `/Avatar/superadmin/config?siteId=${argv.site}`, body);
92
+ if (!data.success) throw new Error(data.error || 'Set avatar caps failed');
93
+ console.log(`\n✓ Avatar caps updated for site ${argv.site}`);
94
+ console.log(` Max minutes/mo: ${data.maxAvatarMinutesPerMonth}`);
95
+ console.log(` Max TTS chars/mo: ${data.maxAvatarTtsChars}\n`);
96
+ }),
97
+ })
98
+ .demandCommand(1, 'Specify a subcommand: get | enable | disable | set'),
75
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.84",
3
+ "version": "1.4.85",
4
4
  "description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
5
5
  "type": "module",
6
6
  "bin": {