@velaro/cli 1.4.109 → 1.4.110
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/bin/velaro.js +2 -0
- package/lib/commands/avatar.js +27 -2
- package/lib/commands/image.js +39 -0
- package/lib/commands/support.js +11 -0
- package/lib/image.js +32 -0
- package/lib/image.test.js +19 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -40,6 +40,7 @@ import { signatureCommand } from '../lib/commands/signature.js';
|
|
|
40
40
|
import { articleCommand } from '../lib/commands/article.js';
|
|
41
41
|
import { sharepointCommand } from '../lib/commands/sharepoint.js';
|
|
42
42
|
import { calendlyCommand } from '../lib/commands/calendly.js';
|
|
43
|
+
import { imageCommand } from '../lib/commands/image.js';
|
|
43
44
|
import { copilotStudioCommand } from '../lib/commands/copilotstudio.js';
|
|
44
45
|
import { acuityCommand } from '../lib/commands/acuity.js';
|
|
45
46
|
import { avatarCommand } from '../lib/commands/avatar.js';
|
|
@@ -200,6 +201,7 @@ await yargs(hideBin(process.argv))
|
|
|
200
201
|
.command(articleCommand)
|
|
201
202
|
.command(sharepointCommand)
|
|
202
203
|
.command(calendlyCommand)
|
|
204
|
+
.command(imageCommand)
|
|
203
205
|
.command(copilotStudioCommand)
|
|
204
206
|
.command(acuityCommand)
|
|
205
207
|
.command(avatarCommand)
|
package/lib/commands/avatar.js
CHANGED
|
@@ -128,20 +128,45 @@ export const avatarCommand = {
|
|
|
128
128
|
.option('site', { type: 'number', demandOption: true, describe: 'Site ID' })
|
|
129
129
|
.option('max-minutes', { type: 'number', describe: 'Monthly avatar video minutes cap (whole number 1-100000)' })
|
|
130
130
|
.option('max-tts-chars', { type: 'number', describe: 'Monthly avatar TTS character cap (whole number 1-100000000)' })
|
|
131
|
+
.option('voice-stability', { type: 'number', describe: 'ElevenLabs stability 0-1 (lower = livelier, default 0.35)' })
|
|
132
|
+
.option('voice-similarity', { type: 'number', describe: 'ElevenLabs similarity boost 0-1 (default 0.8)' })
|
|
133
|
+
.option('voice-style', { type: 'number', describe: 'ElevenLabs style 0-1 (higher = more animated, default 0.45)' })
|
|
134
|
+
.option('voice-speed', { type: 'number', describe: 'ElevenLabs speed 0.7-1.2 (default 1.05)' })
|
|
135
|
+
.option('background-mode', { type: 'string', describe: 'Backdrop frame: none | color | gradient | image' })
|
|
136
|
+
.option('background-value', { type: 'string', describe: 'color #1e293b | gradient "#1e293b,#7c3aed" | https image URL' })
|
|
137
|
+
.option('regular-chat', { type: 'boolean', describe: 'Allow the avatar in the regular chat on pages matching --url-rules' })
|
|
138
|
+
.option('zoom', { type: 'number', describe: 'Camera closeness: zoom 100-250 percent (160 = head and shoulders)' })
|
|
139
|
+
.option('focal-x', { type: 'number', describe: 'Framing focal X 0-100 (default 50)' })
|
|
140
|
+
.option('focal-y', { type: 'number', describe: 'Framing focal Y 0-100 (default 35)' })
|
|
141
|
+
.option('shape', { type: 'string', describe: 'rounded | circle | square' })
|
|
142
|
+
.option('corner-radius', { type: 'number', describe: 'Corner radius 0-48 px (rounded shape)' })
|
|
143
|
+
.option('mirror', { type: 'boolean', describe: 'Mirror the video horizontally' })
|
|
144
|
+
.option('speaking-ring', { type: 'boolean', describe: 'Ring around the avatar while active' })
|
|
145
|
+
.option('muted', { type: 'boolean', describe: 'Start muted' })
|
|
146
|
+
.option('volume', { type: 'number', describe: 'Volume 0-100' })
|
|
147
|
+
.option('align', { type: 'string', describe: 'left | center | right' })
|
|
148
|
+
.option('greeting', { type: 'string', describe: 'Line spoken at session start (empty clears)' })
|
|
149
|
+
.option('voice-map', { type: 'string', describe: 'JSON map of language code to ElevenLabs voice id, e.g. {"es":"id"} (empty clears)' })
|
|
150
|
+
.option('url-rules', { type: 'string', describe: 'Pages for regular-chat avatar, separated by \\n or commas: plain = URL contains, re:<regex>. Empty string clears.' })
|
|
131
151
|
.option('motion-level', { type: 'string', describe: 'Body motion: off | subtle | natural | expressive. Empty string resets to the default.' })
|
|
132
152
|
.option('motion-intensity', { type: 'number', describe: 'Body motion strength percent (25-150).' }),
|
|
133
153
|
handler: runCommand(async argv => {
|
|
134
154
|
const body = {};
|
|
135
155
|
applyMotionArgs(body, argv);
|
|
156
|
+
for (const [opt, key] of [['voice-stability', 'voiceStability'], ['voice-similarity', 'voiceSimilarity'], ['voice-style', 'voiceStyle'], ['voice-speed', 'voiceSpeed'], ['background-mode', 'backgroundMode'], ['background-value', 'backgroundValue'], ['regular-chat', 'regularChatEnabled'], ['zoom', 'zoomPercent'], ['focal-x', 'focalX'], ['focal-y', 'focalY'], ['shape', 'shape'], ['corner-radius', 'cornerRadiusPx'], ['mirror', 'mirror'], ['speaking-ring', 'speakingRing'], ['muted', 'mutedByDefault'], ['volume', 'volume'], ['align', 'align'], ['greeting', 'greetingLine'], ['voice-map', 'voiceIdByLanguage']]) {
|
|
157
|
+
if (argv[opt] !== undefined) body[key] = argv[opt];
|
|
158
|
+
}
|
|
159
|
+
if (argv['url-rules'] !== undefined) body.regularChatUrlRules = String(argv['url-rules']).replace(/\\n|,/g, '\n');
|
|
136
160
|
for (const [opt, key, max] of [['max-minutes', 'maxAvatarMinutesPerMonth', 100000], ['max-tts-chars', 'maxAvatarTtsChars', 100000000]]) {
|
|
137
161
|
if (argv[opt] === undefined) continue;
|
|
138
162
|
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)`);
|
|
139
163
|
body[key] = argv[opt];
|
|
140
164
|
}
|
|
141
|
-
if (!Object.keys(body).length) throw new Error('Provide --max-minutes, --
|
|
165
|
+
if (!Object.keys(body).length) throw new Error('Provide at least one setting (--max-minutes, --voice-style, --background-mode, --regular-chat, --motion-level, ...)');
|
|
142
166
|
const data = await request('POST', `/Avatar/superadmin/config?siteId=${argv.site}`, body);
|
|
143
167
|
if (!data.success) throw new Error(data.error || 'Set avatar caps failed');
|
|
144
|
-
console.log(
|
|
168
|
+
console.log(`
|
|
169
|
+
✓ Avatar settings updated for site ${argv.site}`);
|
|
145
170
|
console.log(` Body motion: ${data.motionLevel || '(default: natural)'} @ ${data.motionIntensityPercent ?? 100}%`);
|
|
146
171
|
console.log(` Max minutes/mo: ${data.maxAvatarMinutesPerMonth}`);
|
|
147
172
|
console.log(` Max TTS chars/mo: ${data.maxAvatarTtsChars}\n`);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { validateImageArgs, buildBrandImageArgs } from '../image.js';
|
|
3
|
+
|
|
4
|
+
// velaro image generate|composite
|
|
5
|
+
// Logos are NEVER AI-generated: the real SVG from the official asset library is composited after generation.
|
|
6
|
+
function run(sub, argv) {
|
|
7
|
+
const v = validateImageArgs({ prompt: argv.prompt, logo: argv.logo, logoPlacement: argv.logoPlacement });
|
|
8
|
+
if (!v.ok) { console.error(v.error); process.exit(2); }
|
|
9
|
+
const r = spawnSync(process.execPath, buildBrandImageArgs(sub, argv), { stdio: 'inherit' });
|
|
10
|
+
process.exit(r.status ?? 1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const logoOpts = y => y
|
|
14
|
+
.option('logo', { type: 'string', describe: 'Official logo asset: lockup, lockup-white, lockup-black, icon, icon-white or an official SVG file name' })
|
|
15
|
+
.option('logo-placement', { type: 'string', describe: 'cx,cy,width in pixels of the image (required with --logo)' })
|
|
16
|
+
.option('curvature', { type: 'number', describe: 'Cylinder wrap 0-0.9 (default 0.55)' })
|
|
17
|
+
.option('out', { type: 'string', demandOption: true, describe: 'Output PNG path' });
|
|
18
|
+
|
|
19
|
+
export const imageCommand = {
|
|
20
|
+
command: 'image <subcommand>',
|
|
21
|
+
describe: 'Brand images: generate via Studio and composite the REAL logo (never AI-generated)',
|
|
22
|
+
builder: yargs => yargs
|
|
23
|
+
.command({
|
|
24
|
+
command: 'generate',
|
|
25
|
+
describe: 'Generate an image via Studio; with --logo the prompt gets "no logo, no text" and the real SVG is composited',
|
|
26
|
+
builder: y => logoOpts(y)
|
|
27
|
+
.option('prompt', { type: 'string', demandOption: true })
|
|
28
|
+
.option('size', { type: 'string', default: '1024x1024' }),
|
|
29
|
+
handler: argv => run('generate', argv),
|
|
30
|
+
})
|
|
31
|
+
.command({
|
|
32
|
+
command: 'composite',
|
|
33
|
+
describe: 'Composite the real logo onto an existing image',
|
|
34
|
+
builder: y => logoOpts(y).option('base', { type: 'string', demandOption: true }).demandOption('logo'),
|
|
35
|
+
handler: argv => run('composite', argv),
|
|
36
|
+
})
|
|
37
|
+
.demandCommand(1),
|
|
38
|
+
handler: () => {},
|
|
39
|
+
};
|
package/lib/commands/support.js
CHANGED
|
@@ -181,6 +181,13 @@ async function connectionEvidence(args) {
|
|
|
181
181
|
console.log(JSON.stringify(result, null, 2));
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
async function hubspotCalls(args) {
|
|
185
|
+
// velaro-messaging SupportToolsController.GetHubSpotCallLoggingAsync (staff-only, read-only).
|
|
186
|
+
const take = args.take ? `?take=${encodeURIComponent(args.take)}` : '';
|
|
187
|
+
const result = await messagingGet(`SupportTools/sites/${args.site}/hubspot/calls${take}`);
|
|
188
|
+
console.log(JSON.stringify(result, null, 2));
|
|
189
|
+
}
|
|
190
|
+
|
|
184
191
|
export function supportCommand(yargs) {
|
|
185
192
|
return yargs
|
|
186
193
|
.command('connection-timeline', 'Raw ordered agent connection events (connect/disconnect/reconnect) for one agent in a time window (Velaro staff, read-only)', y => y
|
|
@@ -190,6 +197,10 @@ export function supportCommand(yargs) {
|
|
|
190
197
|
.option('to', { type: 'string', desc: 'ISO end (default: now)' })
|
|
191
198
|
.option('limit', { type: 'number', default: 2000, desc: 'Max events (1-5000)' })
|
|
192
199
|
, a => connectionTimeline(a))
|
|
200
|
+
.command('hubspot-calls', 'HubSpot call-logging snapshot for a site: connection state and the last N calls with their HubSpot log row (Velaro staff, read-only)', y => y
|
|
201
|
+
.option('site', { type: 'number', demandOption: true, desc: 'Site ID' })
|
|
202
|
+
.option('take', { type: 'number', desc: 'Number of recent calls (default 20)' })
|
|
203
|
+
, a => hubspotCalls(a))
|
|
193
204
|
.command('connection-evidence', 'Dispute-grade connection evidence for a site: Velaro probe uptime, incidents (incl. excluded, with reason), per-agent disconnects and client-vs-server reconciliation (Velaro staff, read-only)', y => y
|
|
194
205
|
.option('site', { type: 'number', demandOption: true, desc: 'Site ID' })
|
|
195
206
|
.option('from', { type: 'string', desc: 'ISO start (default: 30 days before --to)' })
|
package/lib/image.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Brand image helper for `velaro image`. RULE: Velaro logos are NEVER AI-generated.
|
|
2
|
+
// Generate WITHOUT a logo, then composite the real SVG from the official asset library
|
|
3
|
+
// (velaro-marketing/assets/brand/logos-2026/SVG) via velaro-marketing/scripts/brand-image.cjs.
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
|
|
7
|
+
const LOGO_WORDS = /\b(logo|wordmark|monogram|brand mark|emblem)\b/i;
|
|
8
|
+
|
|
9
|
+
export function marketingRepo(env = process.env) {
|
|
10
|
+
return env.VELARO_MARKETING_REPO || path.join(os.homedir(), 'source', 'repos', 'velaro-marketing');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Guard: a prompt asking the model to draw a logo must use --logo instead.
|
|
14
|
+
export function validateImageArgs({ prompt, logo, logoPlacement }) {
|
|
15
|
+
if (!logo && prompt && LOGO_WORDS.test(prompt) && !/no logo/i.test(prompt)) {
|
|
16
|
+
return { ok: false, error: 'Prompt asks the image model for a logo/brand text. Logos are NEVER AI-generated: pass --logo <asset-name> (lockup, lockup-white, lockup-black, icon, icon-white, or an official SVG file name) and --logo-placement cx,cy,width.' };
|
|
17
|
+
}
|
|
18
|
+
if (logo && !/^\s*-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?\s*,\s*\d+(\.\d+)?\s*$/.test(String(logoPlacement || ''))) {
|
|
19
|
+
return { ok: false, error: '--logo requires --logo-placement cx,cy,width (pixels in the generated image).' };
|
|
20
|
+
}
|
|
21
|
+
return { ok: true };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Builds the argv for scripts/brand-image.cjs.
|
|
25
|
+
export function buildBrandImageArgs(sub, a, env = process.env) {
|
|
26
|
+
const script = path.join(marketingRepo(env), 'scripts', 'brand-image.cjs');
|
|
27
|
+
const args = [script, sub];
|
|
28
|
+
const add = (k, v) => { if (v !== undefined && v !== null && v !== '') args.push(`--${k}`, String(v)); };
|
|
29
|
+
add('prompt', a.prompt); add('base', a.base); add('out', a.out); add('size', a.size);
|
|
30
|
+
add('logo', a.logo); add('logo-placement', a.logoPlacement); add('curvature', a.curvature);
|
|
31
|
+
return args;
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateImageArgs, buildBrandImageArgs } from './image.js';
|
|
4
|
+
|
|
5
|
+
test('rejects a prompt that asks the model to draw a logo without --logo', () => {
|
|
6
|
+
assert.equal(validateImageArgs({ prompt: 'white mug with a Velaro logo' }).ok, false);
|
|
7
|
+
assert.equal(validateImageArgs({ prompt: 'white mug, no logo' }).ok, true);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('--logo requires a cx,cy,width placement', () => {
|
|
11
|
+
assert.equal(validateImageArgs({ prompt: 'mug', logo: 'lockup' }).ok, false);
|
|
12
|
+
assert.equal(validateImageArgs({ prompt: 'mug', logo: 'lockup', logoPlacement: '510,600,250' }).ok, true);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('builds argv for the marketing brand-image script', () => {
|
|
16
|
+
const a = buildBrandImageArgs('generate', { prompt: 'mug', out: 'x.png', logo: 'lockup', logoPlacement: '1,2,3' }, { VELARO_MARKETING_REPO: '/m' });
|
|
17
|
+
assert.ok(a[0].replace(/\\/g, '/').endsWith('/m/scripts/brand-image.cjs'));
|
|
18
|
+
assert.deepEqual(a.slice(1), ['generate', '--prompt', 'mug', '--out', 'x.png', '--logo', 'lockup', '--logo-placement', '1,2,3']);
|
|
19
|
+
});
|
package/package.json
CHANGED