@velaro/cli 1.4.213 → 1.4.215
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/lib/commands/contacts.js +13 -1
- package/lib/commands/translation.js +14 -2
- package/package.json +1 -1
package/lib/commands/contacts.js
CHANGED
|
@@ -171,6 +171,12 @@ async function addTagHandler(argv) {
|
|
|
171
171
|
console.log(result.success ? `\n✅ Tag ${argv.tagId} added to contact #${argv.id}.\n` : '\nFailed to add tag.\n');
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// DELETE Contacts/{id}/Tags/{tagId} -> ContactsController.RemoveTag
|
|
175
|
+
async function removeTagHandler(argv) {
|
|
176
|
+
const result = await request('DELETE', `Contacts/${argv.id}/Tags/${argv.tagId}`);
|
|
177
|
+
console.log(result && result.success ? `\nTag ${argv.tagId} removed from contact #${argv.id}.\n` : '\nFailed to remove tag.\n');
|
|
178
|
+
}
|
|
179
|
+
|
|
174
180
|
const tagsCommand = {
|
|
175
181
|
command: 'tags <subcommand>',
|
|
176
182
|
describe: 'Manage contact tags',
|
|
@@ -182,7 +188,13 @@ const tagsCommand = {
|
|
|
182
188
|
builder: (y2) => y2.positional('id', { type: 'number' }).positional('tagId', { type: 'number' }),
|
|
183
189
|
handler: runCommand(addTagHandler),
|
|
184
190
|
})
|
|
185
|
-
.
|
|
191
|
+
.command({
|
|
192
|
+
command: 'remove <id> <tagId>',
|
|
193
|
+
describe: 'Remove a tag from a contact',
|
|
194
|
+
builder: (y2) => y2.positional('id', { type: 'number' }).positional('tagId', { type: 'number' }),
|
|
195
|
+
handler: runCommand(removeTagHandler),
|
|
196
|
+
})
|
|
197
|
+
.demandCommand(1, 'Specify a tags subcommand: list | add | remove'),
|
|
186
198
|
handler: () => {},
|
|
187
199
|
};
|
|
188
200
|
|
|
@@ -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.
|
|
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