@velaro/mcp-server 0.6.61 → 0.6.63

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +53 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "0.6.61",
3
+ "version": "0.6.63",
4
4
  "description": "Velaro MCP server — connect Claude and other AI agents directly to your Velaro account: KB, workflows, bots, conversations, contacts, routing, and more.",
5
5
  "type": "module",
6
6
  "bin": {
package/server.js CHANGED
@@ -1451,6 +1451,24 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
1451
1451
  },
1452
1452
 
1453
1453
  // ── Livefluence Migration ─────────────────────────────────────────────────
1454
+ {
1455
+ name: 'livefluence_seed_url_rules',
1456
+ description: 'Velaro staff only. Seed v20 use-ai routing rules on a target site from v10 URL rules. Each rule matches "url contains <path>" with scheme/host stripped (path-only), so a demo page path triggers the same rule as the customer real URL. Idempotent. Domain-only URLs are skipped. Use dry_run=true first.',
1457
+ inputSchema: {
1458
+ type: 'object',
1459
+ properties: {
1460
+ site_id: { type: 'number', description: 'V20 destination site ID' },
1461
+ ai_config_id: { type: 'number', description: 'AI config on that site that receives routed chats' },
1462
+ dry_run: { type: 'boolean', description: 'Preview without writing' },
1463
+ rules: {
1464
+ type: 'array',
1465
+ description: 'Rules in priority order',
1466
+ items: { type: 'object', properties: { name: { type: 'string' }, priority: { type: 'number' }, paths: { type: 'array', items: { type: 'string' } } }, required: ['name', 'priority', 'paths'] },
1467
+ },
1468
+ },
1469
+ required: ['site_id', 'ai_config_id', 'rules'],
1470
+ },
1471
+ },
1454
1472
  {
1455
1473
  name: 'livefluence_migrate',
1456
1474
  description: 'Migrate a Livefluence (V10) customer to Velaro V20. Reads REAL routing rules from the V10 config database and creates V20 canvas workflows (conversation_opened trigger + transferToAI or routeToTeam action nodes). Auto-matches V10 groups to V20 teams/AI configs by name. Use dry_run=true to preview first. All workflows created DISABLED — review conditions in the canvas then enable. Note: V10 expression conditions are NOT auto-converted; add them manually after migration.',
@@ -2535,6 +2553,18 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
2535
2553
  required: ['siteId'],
2536
2554
  },
2537
2555
  },
2556
+ {
2557
+ name: 'experience_impact_report',
2558
+ description: 'Experience Impact report: shows how staffing and schedule adherence affect customer experience. Returns a 0-100 experience index (adherence 25, service level 30, missed-chat rate 20, CSAT 25), per-interval staffing vs chat demand (scheduled vs actual agents, missed chats, wait time, CSAT), per-agent rows, and plain-language insights. Scoped to the caller site.',
2559
+ inputSchema: {
2560
+ type: 'object',
2561
+ properties: {
2562
+ from: { type: 'string', description: 'yyyy-MM-dd start (default: 7 days ago).' },
2563
+ to: { type: 'string', description: 'yyyy-MM-dd end (default: today).' },
2564
+ teamId: { type: 'number', description: 'Optional team ID to narrow the report.' },
2565
+ },
2566
+ },
2567
+ },
2538
2568
  // -- Staff: schedule adherence by site + role (SupportTools-style: explicit siteId, never auth-derived) --
2539
2569
  // Backend: velaro-messaging ReportsController.ScheduleAdherenceDiagnosticsAsync, gated by
2540
2570
  // IsSuperAdminAsync(allowSupport: true) -> 403 for non-staff. role=agent REQUIRES agentId (fails closed).
@@ -5784,6 +5814,13 @@ async function handleTool(name, args) {
5784
5814
  return lines.join('\n');
5785
5815
  }
5786
5816
 
5817
+ case 'livefluence_seed_url_rules': {
5818
+ const result = await api('POST', '/DatabaseTool/V10SeedUrlRules', {
5819
+ siteId: args.site_id, aiConfigId: args.ai_config_id, dryRun: !!args.dry_run, rules: args.rules,
5820
+ });
5821
+ return JSON.stringify(result, null, 2);
5822
+ }
5823
+
5787
5824
  case 'livefluence_migrate': {
5788
5825
  const result = await api('POST', '/DatabaseTool/V10Migrate', {
5789
5826
  v10SiteId: args.v10_site_id,
@@ -7205,6 +7242,22 @@ async function handleTool(name, args) {
7205
7242
  ).join('\n');
7206
7243
  }
7207
7244
 
7245
+ case 'experience_impact_report': {
7246
+ const qs = new URLSearchParams();
7247
+ for (const k of ['from', 'to', 'teamId']) if (args[k] != null && args[k] !== '') qs.set(k, String(args[k]));
7248
+ const r = await messagingGet(`/Reports/experience-impact${qs.toString() ? '?' + qs : ''}`);
7249
+ const sm = r.summary ?? {};
7250
+ const lines = [
7251
+ `=== Experience Impact ${r.range?.from ?? ''}..${r.range?.to ?? ''} ===`,
7252
+ `Experience index: ${sm.experienceIndex ?? '-'} / 100`,
7253
+ `Adherence ${sm.adherencePct ?? '-'}% | Service level ${sm.serviceLevelPct ?? '-'}% | Missed chats ${sm.missedChats ?? '-'} | Avg wait ${sm.avgWaitSec ?? '-'}s | CSAT ${sm.csatAvg ?? '-'} (${sm.csatResponses ?? 0} responses)`,
7254
+ ...(r.insights ?? []).map(i => ` [${i.severity}] ${i.text}`),
7255
+ `Intervals: ${(r.intervals ?? []).length} | Agents: ${(r.agents ?? []).length}`,
7256
+ ];
7257
+ for (const a of r.agents ?? []) lines.push(` ${a.name}: index ${a.experienceIndex} | adherence ${a.adherencePct}% | CSAT ${a.csatAvg ?? '-'} | handled ${a.handled}`);
7258
+ return lines.join('\n');
7259
+ }
7260
+
7208
7261
  case 'support_schedule_adherence': {
7209
7262
  if (args.role === 'agent' && !args.agentId) throw new Error('agentId is required when role=agent');
7210
7263
  const qs = new URLSearchParams({ detail: 'true' });