@velaro/cli 1.4.100 → 1.4.101

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.
@@ -12,7 +12,8 @@ export const migrateCommand = {
12
12
  .command(migrateTeamsCommand)
13
13
  .command(migrateWorkflowsCommand)
14
14
  .command(migrateRulesCommand)
15
- .demandCommand(1, 'Specify a subcommand: export, livefluence, url-rules, teams, workflows, rules'),
15
+ .command(migrateAdviseCommand)
16
+ .demandCommand(1, 'Specify a subcommand: export, livefluence, url-rules, teams, workflows, rules, advise'),
16
17
  handler: () => {},
17
18
  };
18
19
 
@@ -321,3 +322,52 @@ const migrateRulesCommand = {
321
322
  .demandCommand(1, 'Specify: list, set-enabled'),
322
323
  handler: () => {},
323
324
  };
325
+
326
+ // ── conversion advisor: consolidated v20 design from a v10 site or an intent list ──
327
+
328
+ const migrateAdviseCommand = {
329
+ command: 'advise',
330
+ describe: 'Livefluence conversion advisor: recommend (dry run, default) or build (--apply) a consolidated v20 routing design. Staff only.',
331
+ builder: (y) =>
332
+ y
333
+ .option('v10-site-id', { type: 'number', alias: 'v', describe: 'V10 (Livefluence) site to read (omit when using --intents)' })
334
+ .option('v20-site-id', { type: 'number', alias: 's', describe: 'V20 destination site ID', demandOption: true })
335
+ .option('intents', { type: 'string', describe: 'JSON array (or @file.json) of intents: [{"intent":"support","paths":["/support"],"device":"any","target":"Service team + troubleshooting AI node"}]' })
336
+ .option('apply', { type: 'boolean', default: false, describe: 'Create missing teams and DISABLED workflows (default: dry run + diff)' })
337
+ .option('include-non-routing', { type: 'boolean', default: false, describe: 'Also read v10 rules with IsRouting=false (group-assignment rules)' }),
338
+ handler: runCommand(async (argv) => {
339
+ let intents = null;
340
+ if (argv.intents) {
341
+ const raw = argv.intents.startsWith('@')
342
+ ? (await import('node:fs')).readFileSync(argv.intents.slice(1), 'utf8')
343
+ : argv.intents;
344
+ intents = JSON.parse(raw);
345
+ }
346
+ if (!intents && !argv['v10-site-id']) throw new Error('Give -v <v10 site> or --intents.');
347
+
348
+ const result = await post('/DatabaseTool/ConversionAdvisor', {
349
+ v10SiteId: intents ? null : argv['v10-site-id'],
350
+ v20SiteId: argv['v20-site-id'],
351
+ apply: argv.apply,
352
+ includeNonRouting: argv['include-non-routing'],
353
+ intents,
354
+ });
355
+
356
+ console.log(`\n${'─'.repeat(60)}`);
357
+ console.log(` Conversion advisor (${result.source}) -> V20 site ${result.v20SiteId} ${result.dryRun ? 'DRY RUN' : 'APPLIED (all workflows disabled)'}`);
358
+ if (result.v10RuleCount) console.log(` ${result.v10RuleCount} v10 rule(s) -> ${result.consolidatedWorkflows} workflow(s)`);
359
+ console.log(`${'─'.repeat(60)}\n`);
360
+ for (const t of result.teams ?? [])
361
+ console.log(` team ${t.status.padEnd(8)} ${t.name}${t.v10Members ? ` (${t.v10Members} v10 members, assign v20 agents by hand)` : ''}`);
362
+ console.log('');
363
+ for (const w of result.workflows ?? []) {
364
+ console.log(` [${w.status}] #${w.priority} ${w.name} mode=${w.mode}${w.device !== 'any' ? ` device=${w.device}` : ''}`);
365
+ console.log(` team: ${w.teamName ?? '-'} AI node: ${w.aiNodeName ?? '-'} condition groups (OR): ${w.conditionGroups}`);
366
+ if (w.statusReason) console.log(` ${w.statusReason}`);
367
+ for (const x of w.warnings ?? []) console.log(` ! ${x}`);
368
+ }
369
+ if (result.existingNotInPlan?.length) console.log(`\n Already on the v20 site, not in this plan: ${result.existingNotInPlan.join(', ')}`);
370
+ for (const n of result.notes ?? []) console.log(` note: ${n}`);
371
+ console.log(`\n ${result.message}\n`);
372
+ }),
373
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.100",
3
+ "version": "1.4.101",
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": {