@velaro/cli 1.4.213 → 1.4.214

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.
@@ -5,6 +5,7 @@ import { runCommand } from '../run.js';
5
5
  // velaro translation --on | --off preview the change (nothing saved)
6
6
  // velaro translation --on|--off --confirm save it (needs "Moshky can make changes" on; audit-logged)
7
7
  // velaro translation --conversation <id> explain why messages in one conversation are or are not translated
8
+ // velaro translation --allowance staff: monthly allowance, override and usage; --set-allowance N / --remove-allowance-override [--confirm]
8
9
  // REST: admin POST /mcp/copilot (tools/call: get_translation_settings, propose_/update_translation_settings, diagnose_conversation_translation)
9
10
  export async function callCopilotTool(name, args) {
10
11
  const res = await adminPost('/mcp/copilot', { jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name, arguments: args } });
@@ -20,11 +21,22 @@ export const translationCommand = {
20
21
  .option('on', { type: 'boolean', describe: 'Turn chat translation on (preview unless --confirm)' })
21
22
  .option('off', { type: 'boolean', describe: 'Turn chat translation off (preview unless --confirm)' })
22
23
  .option('confirm', { type: 'boolean', describe: 'Save the previewed change' })
23
- .option('conversation', { type: 'number', describe: 'Conversation id to diagnose' }),
24
+ .option('conversation', { type: 'number', describe: 'Conversation id to diagnose' })
25
+ .option('allowance', { type: 'boolean', describe: 'Staff: show the monthly translation allowance (cap, override, used)' })
26
+ .option('set-allowance', { type: 'number', describe: 'Staff: preview a per-site monthly character cap (add --confirm to save)' })
27
+ .option('remove-allowance-override', { type: 'boolean', describe: 'Staff: preview removing the per-site override (add --confirm to save)' })
28
+ .option('reason', { type: 'string', describe: 'Reason recorded with an allowance override' }),
24
29
  handler: runCommand(async (a) => {
25
30
  if (a.on && a.off) throw new Error('choose --on or --off, not both');
26
31
  let out;
27
- if (a.conversation) {
32
+ if (a.allowance) {
33
+ out = await callCopilotTool('get_translation_allowance', {});
34
+ } else if (a.setAllowance || a.removeAllowanceOverride) {
35
+ const args = a.removeAllowanceOverride ? { remove_override: true } : { characters_per_month: a.setAllowance };
36
+ out = a.confirm
37
+ ? await callCopilotTool('update_translation_allowance_override', { ...args, reason: a.reason, confirmed: true })
38
+ : await callCopilotTool('propose_translation_allowance_override', args);
39
+ } else if (a.conversation) {
28
40
  out = await callCopilotTool('diagnose_conversation_translation', { conversation_id: a.conversation });
29
41
  } else if (a.on || a.off) {
30
42
  const args = { chat_translations_enabled: !!a.on };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.213",
3
+ "version": "1.4.214",
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": {