@velaro/cli 1.4.67 → 1.4.68

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.
@@ -220,19 +220,39 @@ const triageRulesCommand = {
220
220
  };
221
221
 
222
222
  const setTriageRuleCommand = {
223
- command: 'set-triage-rule <label> <enabled>',
224
- describe: `Enable or disable one fixed AI triage label (${VALID_LABELS.join(', ')})`,
223
+ command: 'set-triage-rule [label] [enabled]',
224
+ describe: `Enable/disable one fixed AI triage label (${VALID_LABELS.join(', ')}) and/or set --triage-mode`,
225
225
  builder: (y) => y
226
226
  .positional('label', { type: 'string', describe: `Label: ${VALID_LABELS.join(', ')}` })
227
- .positional('enabled', { type: 'string', describe: 'true or false', choices: ['true', 'false'] }),
227
+ .positional('enabled', { type: 'string', describe: 'true or false', choices: ['true', 'false'] })
228
+ .option('triage-mode', { type: 'string', choices: ['off', 'economy'], describe: 'off (default) or economy (skip AI call for obvious messages)' }),
228
229
  handler: async (argv) => {
229
230
  const { label, enabled } = argv;
230
- if (!VALID_LABELS.includes(label)) {
231
- console.error(`Invalid label "${label}". Valid values: ${VALID_LABELS.join(', ')}`);
231
+ const mode = argv['triage-mode'];
232
+ if (!label && !mode) {
233
+ console.error('Provide <label> <enabled> and/or --triage-mode <off|economy>.');
232
234
  process.exit(1);
233
235
  }
234
- const result = await messagingPut('/Focus/triage-rules', [{ Label: label, Enabled: enabled === 'true' }]);
235
- console.log(`\n ${GRN}✓${RESET} Label "${label}" ${enabled === 'true' ? 'enabled' : 'disabled'}. Effective labels: ${(result?.effectiveLabels ?? []).join(', ')}\n`);
236
+ let labels;
237
+ if (label) {
238
+ if (!VALID_LABELS.includes(label)) {
239
+ console.error(`Invalid label "${label}". Valid values: ${VALID_LABELS.join(', ')}`);
240
+ process.exit(1);
241
+ }
242
+ if (enabled !== 'true' && enabled !== 'false') {
243
+ console.error('<enabled> must be true or false.');
244
+ process.exit(1);
245
+ }
246
+ labels = [{ Label: label, Enabled: enabled === 'true' }];
247
+ }
248
+ const body = mode ? { ...(labels ? { labels } : {}), triageMode: mode } : labels;
249
+ const result = await messagingPut('/Focus/triage-rules', body);
250
+ if (label) console.log(`
251
+ ${GRN}✓${RESET} Label "${label}" ${enabled === 'true' ? 'enabled' : 'disabled'}.`);
252
+ if (mode) console.log(`
253
+ ${GRN}✓${RESET} Triage mode set to ${mode}.`);
254
+ console.log(` Effective labels: ${(result?.effectiveLabels ?? []).join(', ')}
255
+ `);
236
256
  },
237
257
  };
238
258
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.67",
3
+ "version": "1.4.68",
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": {