@velaro/cli 1.4.61 → 1.4.62

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 CHANGED
@@ -39,6 +39,7 @@ import { integrationCommand } from '../lib/commands/integration.js';
39
39
  import { appointmentsCommand } from '../lib/commands/appointments.js';
40
40
  import { bookingCommand } from '../lib/commands/booking.js';
41
41
  import { reportCommand } from '../lib/commands/report.js';
42
+ import { scheduleAdherenceCommand } from '../lib/commands/schedule-adherence.js';
42
43
  import { conversationEfficiencyCommand } from '../lib/commands/conversation-efficiency.js';
43
44
  import { dbCommand } from '../lib/commands/db.js';
44
45
  import { focusCommand } from '../lib/commands/focus.js';
@@ -139,6 +140,7 @@ await yargs(hideBin(process.argv))
139
140
  .command(bookingCommand)
140
141
  .command(reportCommand)
141
142
  .command(conversationEfficiencyCommand)
143
+ .command(scheduleAdherenceCommand)
142
144
  .command(dbCommand)
143
145
  .command(focusCommand)
144
146
  .command(automationDraftCommand)
@@ -0,0 +1,33 @@
1
+ import { messagingGet } from '../api.js';
2
+ import { runCommand } from '../run.js';
3
+
4
+ // -- velaro schedule-adherence --------------------------------------------------
5
+ // Staff-only. siteId is an EXPLICIT argument (SupportTools-style), never derived from the caller.
6
+ // Backend: velaro-messaging GET /Reports/sites/{siteId}/schedule-adherence-diagnostics
7
+ // (IsSuperAdminAsync allowSupport gate; role=agent requires agentId, fails closed).
8
+
9
+ export const scheduleAdherenceCommand = {
10
+ command: 'schedule-adherence <siteId>',
11
+ describe: 'Staff: schedule adherence overview/breakdown/intraday/timeline for a site as manager or agent',
12
+ builder: (y) => y
13
+ .positional('siteId', { type: 'number', describe: 'Target customer site ID' })
14
+ .option('role', { type: 'string', choices: ['manager', 'agent'], default: 'manager', describe: 'Scope to apply' })
15
+ .option('agent-id', { type: 'number', describe: 'WorkspaceUser id (required for --role agent)' })
16
+ .option('start', { type: 'string', describe: 'yyyy-MM-dd' })
17
+ .option('end', { type: 'string', describe: 'yyyy-MM-dd' })
18
+ .option('tz', { type: 'string', describe: 'IANA time zone override' })
19
+ .option('json', { type: 'boolean', default: false, describe: 'Raw JSON output' }),
20
+ handler: runCommand(async (argv) => {
21
+ if (argv.role === 'agent' && !argv.agentId) throw new Error('--agent-id is required with --role agent');
22
+ const qs = new URLSearchParams({ detail: 'true', role: argv.role });
23
+ if (argv.agentId) qs.set('agentId', String(argv.agentId));
24
+ for (const k of ['start', 'end', 'tz']) if (argv[k]) qs.set(k, argv[k]);
25
+ const d = await messagingGet(`/Reports/sites/${argv.siteId}/schedule-adherence-diagnostics?${qs}`);
26
+ if (argv.json) { console.log(JSON.stringify(d, null, 2)); return; }
27
+ console.log(`\nSite ${d.siteId} scope=${d.scope} ${d.range?.start}..${d.range?.end} tz=${d.timeZone} invariantsPass=${d.invariantsPass}`);
28
+ console.log(` Totals: sched ${d.totals?.scheduledMinutes}m adherent ${d.totals?.adherentMinutes}m avg ${d.totals?.avgAdherencePercent}%`);
29
+ for (const a of d.agents ?? []) {
30
+ console.log(` [${a.agentId}] ${a.agentName}: ${a.adherencePercent}% status=${a.currentStatus ?? '-'} days=${a.days?.length ?? 0} shiftsToday=${a.timeline?.shifts?.length ?? 0}`);
31
+ }
32
+ }),
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.61",
3
+ "version": "1.4.62",
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": {