@velaro/cli 1.4.154 → 1.4.156
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/report.js +35 -0
- package/package.json +1 -1
package/lib/commands/report.js
CHANGED
|
@@ -706,6 +706,41 @@ const countryGetCommand = {
|
|
|
706
706
|
for (const a of r.agents ?? []) {
|
|
707
707
|
fmtRow(a.agentName ?? '', `${a.bucket} eng ${a.engagements} handled ${a.handled} csat ${fmtNum(a.csatAvg)}${a.agentCountryNotSet ? ' [country not set]' : ''}`);
|
|
708
708
|
}
|
|
709
|
+
if (r.concordance) {
|
|
710
|
+
const c = r.concordance;
|
|
711
|
+
const who = c.handledBasis === 'agentCountry' ? 'agent' : 'team';
|
|
712
|
+
section(`Concordance (visitor country vs ${who} country)`);
|
|
713
|
+
// Rates may arrive as 0-1 fractions or 0-100 percents; the exact counts decide which. A null rate prints a dash, never an estimate.
|
|
714
|
+
const frac = c.matchRate != null && c.totalEngagements ? Math.abs(c.matchRate - c.matchedEngagements / c.totalEngagements) < 0.005 : (c.matchRate != null && c.matchRate <= 1);
|
|
715
|
+
const p = (v) => (v == null ? '-' : `${Math.round((frac ? v * 100 : v) * 10) / 10}%`);
|
|
716
|
+
const pctTxt = c.matchRate == null || !c.totalEngagements ? '-' : p(c.matchRate);
|
|
717
|
+
const range = c.matchRateCi && pctTxt !== '-' ? ` (95% range ${p(c.matchRateCi.low)} to ${p(c.matchRateCi.high)})` : '';
|
|
718
|
+
console.log(` ${pctTxt} matched${range} (${c.matchedEngagements} of ${c.totalEngagements})`);
|
|
719
|
+
if (c.lowSample) console.log(' Small sample, treat as a rough guide.');
|
|
720
|
+
if (c.unassigned > 0) console.log(` Not assigned to anyone: ${c.unassigned} chats (not counted).${Array.isArray(c.unassignedByVisitorBucket) && c.unassignedByVisitorBucket.some((u) => u.engagements > 0) ? ` By visitor region: ${c.unassignedByVisitorBucket.filter((u) => u.engagements > 0).map((u) => `${u.visitorBucket} ${u.engagements}`).join(', ')}.` : ''}`);
|
|
721
|
+
if (c.unknownLocation > 0) console.log(` No location detected: ${c.unknownLocation} chats (not counted).`);
|
|
722
|
+
for (const row of c.rows ?? []) {
|
|
723
|
+
fmtRow(`${row.visitorBucket} visitor -> ${row.handledBucket} ${who}`, String(row.engagements));
|
|
724
|
+
}
|
|
725
|
+
if (Array.isArray(c.byHandledGroup) && c.byHandledGroup.length) {
|
|
726
|
+
section('Concordance by handling group');
|
|
727
|
+
for (const g of c.byHandledGroup) {
|
|
728
|
+
fmtRow(g.group ?? '', `${g.bucket ?? '-'} chats ${g.total} matched ${g.matched} rate ${p(g.matchRate)}${g.ci ? ` range ${p(g.ci.low)} to ${p(g.ci.high)}` : ''}`);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
if (Array.isArray(c.trend) && c.trend.length) {
|
|
732
|
+
section('Concordance daily match rate');
|
|
733
|
+
for (const d of c.trend) fmtRow(String(d.date).slice(0, 10), `${p(d.matchRate)} (${d.matched} of ${d.total})`);
|
|
734
|
+
}
|
|
735
|
+
if (c.comparison) {
|
|
736
|
+
section('Matched vs mismatched chats');
|
|
737
|
+
const f = (v, s = '') => (v == null ? '-' : `${v}${s}`);
|
|
738
|
+
for (const [label, side] of [['matched', c.comparison.matched], ['mismatched', c.comparison.mismatched]]) {
|
|
739
|
+
if (!side) continue;
|
|
740
|
+
fmtRow(label, `chats ${f(side.engagements)} 1st resp ${f(side.avgFirstResponseSeconds, 's')} handle ${f(side.avgHandleTimeSeconds, 's')} transfers ${f(side.transfers)} csat ${f(side.csatAvg)} (${side.csatCount ?? 0})`);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
709
744
|
}),
|
|
710
745
|
};
|
|
711
746
|
|
package/package.json
CHANGED