@velaro/cli 1.4.135 → 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.
|
@@ -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
|
}),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// velaro part-finder find "<part, model or description>" Run the same lookup the bot uses (shows the trace)
|
|
4
4
|
// velaro part-finder config get Show the order, time limits, confidence and no-result action
|
|
5
5
|
// velaro part-finder config set [--enabled true|false] [--order matrix,erp,catalog_exact,spec_search] [--disable erp,...]
|
|
6
|
-
// [--item-noun part|product|service|plan|policy|course] [--min-confidence 0.8] [--no-result handoff|categories|handoff_and_categories|capture_lead]
|
|
6
|
+
// [--item-noun part|product|service|plan|policy|course] [--min-confidence 0.8] [--on-no-result handoff|categories|handoff_and_categories|capture_lead]
|
|
7
7
|
// velaro part-finder sources list|sync|preview|remove [id] Matrix sources (SharePoint, OneDrive); preview shows the diff, nothing applied
|
|
8
8
|
// velaro part-finder sources add --url <share link> [--type sharepoint|onedrive] [--load-mode preload|live] [--sync-hours N] [--auto-approve]
|
|
9
9
|
// velaro part-finder misses [--dismiss <id>] What customers asked that found nothing
|
|
@@ -56,9 +56,9 @@ export function buildConfigPatch(current, flags) {
|
|
|
56
56
|
if (t !== '' && !/^[\p{L}\p{N} -]+$/u.test(t)) throw new Error('--item-noun can use letters, digits, spaces and hyphens only.');
|
|
57
57
|
patch.itemNoun = t === '' ? 'item' : t;
|
|
58
58
|
}
|
|
59
|
-
if (flags['no-result'] !== undefined) {
|
|
60
|
-
if (!NO_RESULT_ACTIONS.includes(flags['no-result'])) throw new Error(`--no-result must be one of ${NO_RESULT_ACTIONS.join(', ')}.`);
|
|
61
|
-
patch.noResultAction = flags['no-result'];
|
|
59
|
+
if (flags['on-no-result'] !== undefined) {
|
|
60
|
+
if (!NO_RESULT_ACTIONS.includes(flags['on-no-result'])) throw new Error(`--on-no-result must be one of ${NO_RESULT_ACTIONS.join(', ')}.`);
|
|
61
|
+
patch.noResultAction = flags['on-no-result'];
|
|
62
62
|
}
|
|
63
63
|
if (flags.enabled !== undefined) patch.enabled = String(flags.enabled) === 'true';
|
|
64
64
|
if (Object.keys(patch).length === 0) throw new Error('Nothing to change. Pass at least one flag.');
|
|
@@ -116,7 +116,7 @@ export const partFinderCommand = {
|
|
|
116
116
|
.option('disable', { type: 'string' })
|
|
117
117
|
.option('enable', { type: 'string' })
|
|
118
118
|
.option('min-confidence', { type: 'string' })
|
|
119
|
-
.option('no-result', { type: 'string' })
|
|
119
|
+
.option('on-no-result', { type: 'string' })
|
|
120
120
|
.option('item-noun', { type: 'string', describe: 'what you call the things customers look for: part, product, service, plan, policy, course (default item)' })
|
|
121
121
|
.option('json', J),
|
|
122
122
|
runCommand(async (a) => {
|
package/lib/part-finder.test.js
CHANGED
|
@@ -37,8 +37,8 @@ test('rejects unknown steps, duplicates, and switching off both matrix and catal
|
|
|
37
37
|
test('validates confidence and the no-result action, and refuses an empty change', () => {
|
|
38
38
|
assert.equal(buildConfigPatch(current(), { 'min-confidence': '0.9' }).minConfidence, 0.9);
|
|
39
39
|
assert.throws(() => buildConfigPatch(current(), { 'min-confidence': '2' }), /between 0 and 1/);
|
|
40
|
-
assert.equal(buildConfigPatch(current(), { 'no-result': 'capture_lead' }).noResultAction, 'capture_lead');
|
|
41
|
-
assert.throws(() => buildConfigPatch(current(), { 'no-result': 'shrug' }), /must be one of/);
|
|
40
|
+
assert.equal(buildConfigPatch(current(), { 'on-no-result': 'capture_lead' }).noResultAction, 'capture_lead');
|
|
41
|
+
assert.throws(() => buildConfigPatch(current(), { 'on-no-result': 'shrug' }), /must be one of/);
|
|
42
42
|
assert.equal(buildConfigPatch(current(), { enabled: 'false' }).enabled, false);
|
|
43
43
|
assert.throws(() => buildConfigPatch(current(), {}), /Nothing to change/);
|
|
44
44
|
});
|
package/package.json
CHANGED