@velaro/cli 1.4.83 → 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.
- package/lib/commands/avatar.js +28 -4
- package/package.json +1 -1
package/lib/commands/avatar.js
CHANGED
|
@@ -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
|
|
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({
|
|
@@ -37,7 +39,7 @@ export const avatarCommand = {
|
|
|
37
39
|
describe: 'Turn on (or update) the AI Video Avatar for a site',
|
|
38
40
|
builder: y => y
|
|
39
41
|
.option('site', { type: 'number', demandOption: true, describe: 'Site ID' })
|
|
40
|
-
.option('provider', { type: 'string', describe: 'Avatar provider slug (simli, d-id, heygen). Default on first setup:
|
|
42
|
+
.option('provider', { type: 'string', describe: 'Avatar provider slug (velaro, simli, d-id, heygen). Default on first setup: velaro (Velaro Avatar). Omit on a re-run to leave the existing provider untouched.' })
|
|
41
43
|
.option('bot', { type: 'string', describe: 'Reserved for a future per-bot override (not yet implemented on this endpoint)' })
|
|
42
44
|
.option('avatar-id',{ type: 'string', describe: 'Provider-specific avatar/face ID. Omit for provider default.' })
|
|
43
45
|
.option('voice', { type: 'string', describe: 'ElevenLabs voice ID override' })
|
|
@@ -50,7 +52,7 @@ export const avatarCommand = {
|
|
|
50
52
|
// to change one field (e.g. just --voice) never silently resets provider/call-me back
|
|
51
53
|
// to a hardcoded default on an existing config.
|
|
52
54
|
const body = { enabled: true };
|
|
53
|
-
body.providerSlug = argv.provider ?? '
|
|
55
|
+
body.providerSlug = argv.provider ?? 'velaro';
|
|
54
56
|
if (argv['avatar-id'] !== undefined) body.avatarId = argv['avatar-id'];
|
|
55
57
|
if (argv.voice !== undefined) body.voiceId = argv.voice;
|
|
56
58
|
if (argv['call-me'] !== undefined) body.showCallMeOption = argv['call-me'];
|
|
@@ -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
|
-
.
|
|
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