@velaro/cli 1.4.136 → 1.4.137
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/ai-config.js +20 -5
- package/package.json +1 -1
|
@@ -124,7 +124,7 @@ const aiConfigCreateCommand = {
|
|
|
124
124
|
|
|
125
125
|
// ── channel overrides ─────────────────────────────────────────────────────────
|
|
126
126
|
|
|
127
|
-
const CHANNELS = ['Web', 'TwilioSms', 'TwilioIvr', 'WhatsApp', 'Facebook', 'Twitter', 'Email', 'Apple'];
|
|
127
|
+
const CHANNELS = ['All', 'Web', 'TwilioSms', 'TwilioIvr', 'WhatsApp', 'Facebook', 'Twitter', 'Email', 'Apple', 'AppleMessages'];
|
|
128
128
|
const MODES = ['additive', 'replace', 'suppress'];
|
|
129
129
|
|
|
130
130
|
const aiConfigListChannelOverridesCommand = {
|
|
@@ -154,15 +154,30 @@ const aiConfigSetChannelOverrideCommand = {
|
|
|
154
154
|
.positional('id', { type: 'number', describe: 'AI configuration ID' })
|
|
155
155
|
.option('channel', { type: 'string', choices: CHANNELS, demandOption: true, describe: 'Conversation source (PascalCase)' })
|
|
156
156
|
.option('mode', { type: 'string', choices: MODES, demandOption: true, describe: 'Override mode' })
|
|
157
|
-
.option('text', { type: 'string', describe: 'Override prompt text (omit for suppress mode)' })
|
|
157
|
+
.option('text', { type: 'string', describe: 'Override prompt text (omit for suppress mode)' })
|
|
158
|
+
.option('selection-presentation', { type: 'string', choices: ['carousel', 'list', 'text'], describe: 'How choice lists are shown' })
|
|
159
|
+
.option('max-selection-results', { type: 'number', describe: 'Max choices shown (1-25)' })
|
|
160
|
+
.option('repeat-selections-inline', { type: 'string', choices: ['always', 'collapsed'], describe: 'Repeat behavior for choice lists' })
|
|
161
|
+
.option('show-tell-me-more', { type: 'boolean', describe: 'Show the Tell me more button' })
|
|
162
|
+
.option('tell-me-more-label', { type: 'string', describe: 'Tell me more label (max 64 chars)' })
|
|
163
|
+
.option('show-follow-up-chips', { type: 'boolean', describe: 'Show follow-up suggestion chips' }),
|
|
158
164
|
handler: runCommand(async (argv) => {
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
const selOnly = [argv.selectionPresentation, argv.maxSelectionResults, argv.repeatSelectionsInline,
|
|
166
|
+
argv.showTellMeMore, argv.tellMeMoreLabel, argv.showFollowUpChips].some(v => v !== undefined);
|
|
167
|
+
if (argv.mode !== 'suppress' && !argv.text && !selOnly) {
|
|
168
|
+
console.error('--text is required for additive/replace modes (unless setting selection presentation flags).');
|
|
161
169
|
process.exit(1);
|
|
162
170
|
}
|
|
163
171
|
const existing = (await get(`/AIConfiguration/${argv.id}/channel-overrides`)) ?? [];
|
|
164
172
|
const others = existing.filter(o => o.conversationSource !== argv.channel);
|
|
165
|
-
const
|
|
173
|
+
const prior = existing.find(o => o.conversationSource === argv.channel) ?? {};
|
|
174
|
+
// PUT replaces all rows: keep selection presentation fields on this row unless a flag changes them.
|
|
175
|
+
const sel = {};
|
|
176
|
+
const flags = { selectionPresentation: argv.selectionPresentation, maxSelectionResults: argv.maxSelectionResults,
|
|
177
|
+
repeatSelectionsInline: argv.repeatSelectionsInline, showTellMeMore: argv.showTellMeMore,
|
|
178
|
+
tellMeMoreLabel: argv.tellMeMoreLabel, showFollowUpChips: argv.showFollowUpChips };
|
|
179
|
+
for (const k of Object.keys(flags)) sel[k] = flags[k] !== undefined ? flags[k] : (prior[k] ?? null);
|
|
180
|
+
const next = [...others, { conversationSource: argv.channel, mode: argv.mode, overrideText: argv.text ?? prior.overrideText ?? '', ...sel }];
|
|
166
181
|
await messagingPut(`/AIConfiguration/${argv.id}/channel-overrides`, next);
|
|
167
182
|
console.log(`Channel override set: ai-config=${argv.id} channel=${argv.channel} mode=${argv.mode}`);
|
|
168
183
|
}),
|
package/package.json
CHANGED