@velaro/cli 1.4.63 → 1.4.65
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.
|
@@ -25,6 +25,14 @@ export const experienceImpactCommand = {
|
|
|
25
25
|
console.log(`\nExperience Impact ${d.range?.from}..${d.range?.to}`);
|
|
26
26
|
console.log(` Experience index: ${s.experienceIndex} / 100`);
|
|
27
27
|
console.log(` Adherence ${s.adherencePct}% | Service level ${s.serviceLevelPct}% | Missed chats ${s.missedChats} | Avg wait ${s.avgWaitSec}s | CSAT ${s.csatAvg ?? '-'} (${s.csatResponses ?? 0})`);
|
|
28
|
+
const b = d.botVsHuman;
|
|
29
|
+
if (b) {
|
|
30
|
+
console.log(` Bots vs humans (bot containment ${b.containmentRatePct}%)`);
|
|
31
|
+
for (const [label, k] of [['Bot only', 'botOnly'], ['Bot to human', 'handoff'], ['Human only', 'humanOnly']]) {
|
|
32
|
+
const x = b[k] ?? {};
|
|
33
|
+
console.log(` ${label}: ${x.chats} chats | avg wait ${x.avgWaitSec}s | missed ${x.missed} | CSAT ${x.csatResponses ? x.csatAvg : '-'} (${x.csatResponses ?? 0})`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
28
36
|
for (const i of d.insights ?? []) console.log(` [${i.severity}] ${i.text}`);
|
|
29
37
|
for (const a of d.agents ?? []) {
|
|
30
38
|
console.log(` [${a.agentId}] ${a.name}: index ${a.experienceIndex} adherence ${a.adherencePct}% CSAT ${a.csatAvg ?? '-'} handled ${a.handled}`);
|
package/lib/commands/migrate.js
CHANGED
|
@@ -8,7 +8,8 @@ export const migrateCommand = {
|
|
|
8
8
|
yargs
|
|
9
9
|
.command(migrateExportCommand)
|
|
10
10
|
.command(migrateLivefluenceCommand)
|
|
11
|
-
.
|
|
11
|
+
.command(migrateUrlRulesCommand)
|
|
12
|
+
.demandCommand(1, 'Specify a subcommand: export, livefluence, url-rules'),
|
|
12
13
|
handler: () => {},
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -132,3 +133,27 @@ const migrateLivefluenceCommand = {
|
|
|
132
133
|
console.log(`${'─'.repeat(60)}\n`);
|
|
133
134
|
}),
|
|
134
135
|
};
|
|
136
|
+
|
|
137
|
+
// -- seed v20 URL routing rules from a v10 rules JSON file ---------------------
|
|
138
|
+
|
|
139
|
+
const migrateUrlRulesCommand = {
|
|
140
|
+
command: 'url-rules',
|
|
141
|
+
describe: 'Seed v20 use-ai routing rules (path-only "url contains") from a v10 rules JSON file',
|
|
142
|
+
builder: (y) =>
|
|
143
|
+
y
|
|
144
|
+
.option('site', { type: 'number', alias: 's', demandOption: true, describe: 'V20 destination site ID' })
|
|
145
|
+
.option('ai-config-id', { type: 'number', alias: 'a', demandOption: true, describe: 'AI config on that site that receives the routed chats' })
|
|
146
|
+
.option('file', { type: 'string', alias: 'f', demandOption: true, describe: 'JSON array of {name, urls[]} in v10 priority order' })
|
|
147
|
+
.option('dry-run', { type: 'boolean', default: false }),
|
|
148
|
+
handler: runCommand(async (argv) => {
|
|
149
|
+
const { readFileSync } = await import('fs');
|
|
150
|
+
const src = JSON.parse(readFileSync(argv.file, 'utf8'));
|
|
151
|
+
const rules = src.map((r, i) => ({ name: r.name, priority: (i + 1) * 10, paths: r.urls || [] }));
|
|
152
|
+
const result = await post('/DatabaseTool/V10SeedUrlRules', {
|
|
153
|
+
siteId: argv.site, aiConfigId: argv['ai-config-id'], dryRun: argv['dry-run'], rules,
|
|
154
|
+
});
|
|
155
|
+
for (const i of result.createdItems || []) console.log(` + [${i.priority}] ${i.name} (${i.pathCount} paths)`);
|
|
156
|
+
for (const i of result.skippedItems || []) console.log(` - ${i.name}: ${i.reason}`);
|
|
157
|
+
console.log(`\n ${result.dryRun ? 'DRY RUN: ' : ''}created ${result.created}, skipped ${result.skipped}`);
|
|
158
|
+
}),
|
|
159
|
+
};
|
package/package.json
CHANGED