@cognigy/plugin-engine 1.0.0
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/LICENSE +21 -0
- package/README.md +245 -0
- package/dist/api/client.d.ts +21 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +123 -0
- package/dist/api/client.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +141 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +36 -0
- package/dist/instructions.js.map +1 -0
- package/dist/schemas/tools.d.ts +1846 -0
- package/dist/schemas/tools.d.ts.map +1 -0
- package/dist/schemas/tools.js +581 -0
- package/dist/schemas/tools.js.map +1 -0
- package/dist/tools/definitions.d.ts +12 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +1522 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/filters.d.ts +13 -0
- package/dist/tools/filters.d.ts.map +1 -0
- package/dist/tools/filters.js +107 -0
- package/dist/tools/filters.js.map +1 -0
- package/dist/tools/handlers.d.ts +71 -0
- package/dist/tools/handlers.d.ts.map +1 -0
- package/dist/tools/handlers.js +3603 -0
- package/dist/tools/handlers.js.map +1 -0
- package/dist/tools/nodeRegistry.d.ts +37 -0
- package/dist/tools/nodeRegistry.d.ts.map +1 -0
- package/dist/tools/nodeRegistry.js +175 -0
- package/dist/tools/nodeRegistry.js.map +1 -0
- package/dist/tools/packageManagement.d.ts +140 -0
- package/dist/tools/packageManagement.d.ts.map +1 -0
- package/dist/tools/packageManagement.js +455 -0
- package/dist/tools/packageManagement.js.map +1 -0
- package/dist/tools/voiceChecklist.d.ts +80 -0
- package/dist/tools/voiceChecklist.d.ts.map +1 -0
- package/dist/tools/voiceChecklist.js +635 -0
- package/dist/tools/voiceChecklist.js.map +1 -0
- package/dist/tools/webchatSettings.d.ts +14 -0
- package/dist/tools/webchatSettings.d.ts.map +1 -0
- package/dist/tools/webchatSettings.js +462 -0
- package/dist/tools/webchatSettings.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +52 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/rateLimiter.d.ts +33 -0
- package/dist/utils/rateLimiter.d.ts.map +1 -0
- package/dist/utils/rateLimiter.js +68 -0
- package/dist/utils/rateLimiter.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice AI Go-Live checklist evaluator.
|
|
3
|
+
*
|
|
4
|
+
* Implements the deterministic ("Tier A") subset of the Voice AI guidebook
|
|
5
|
+
* Go-Live Checklist (section 3) that the Cognigy REST API can both READ and
|
|
6
|
+
* FIX. Each check inspects the flow's Set Session Config node, the AI Agent
|
|
7
|
+
* Job node, and (optionally) the endpoint / LLM resource, and reports a
|
|
8
|
+
* pass / fail / warn / na status. Auto-fixable checks carry a `fix` descriptor
|
|
9
|
+
* that the handler applies via the chart / endpoint REST routes.
|
|
10
|
+
*
|
|
11
|
+
* The evaluation is a pure function of the fetched resources so it can be
|
|
12
|
+
* unit-tested without a live Cognigy instance.
|
|
13
|
+
*/
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Recommended values
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
const USER_INPUT_TIMEOUT_MIN_MS = 5000;
|
|
18
|
+
const USER_INPUT_TIMEOUT_MAX_MS = 7000;
|
|
19
|
+
const USER_INPUT_RETRIES_MIN = 5;
|
|
20
|
+
const FLOW_INPUT_TIMEOUT_MIN_MS = 1000;
|
|
21
|
+
const FLOW_INPUT_TIMEOUT_MAX_MS = 2500;
|
|
22
|
+
const DEFAULT_FLOW_FILLER = "One moment please.";
|
|
23
|
+
const DEFAULT_AGENT_ERROR_MESSAGE = "Sorry, I ran into a problem. Let me try that again.";
|
|
24
|
+
/**
|
|
25
|
+
* Sane voice defaults applied to a freshly created Set Session Config node.
|
|
26
|
+
* These values already satisfy every Set-Session-Config config check below.
|
|
27
|
+
*/
|
|
28
|
+
export const RECOMMENDED_SESSION_CONFIG = {
|
|
29
|
+
bargeInOnSpeech: false,
|
|
30
|
+
bargeInOnDtmf: false,
|
|
31
|
+
asrEnabled: false,
|
|
32
|
+
userNoInputTimeoutEnable: true,
|
|
33
|
+
userNoInputTimeout: 6000,
|
|
34
|
+
userNoInputRetries: USER_INPUT_RETRIES_MIN,
|
|
35
|
+
flowNoInputTimeoutEnable: true,
|
|
36
|
+
flowNoInputTimeout: 1500,
|
|
37
|
+
flowNoInputSpeech: DEFAULT_FLOW_FILLER,
|
|
38
|
+
flowNoInputFail: false,
|
|
39
|
+
};
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Helpers
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
export function nodeId(n) {
|
|
44
|
+
return n?._id || n?.id || "";
|
|
45
|
+
}
|
|
46
|
+
function findByType(nodes, type) {
|
|
47
|
+
return nodes.find((n) => n?.type === type);
|
|
48
|
+
}
|
|
49
|
+
function findAllByType(nodes, type) {
|
|
50
|
+
return nodes.filter((n) => n?.type === type);
|
|
51
|
+
}
|
|
52
|
+
const SESSION_CONFIG_TYPE = "setSessionConfig";
|
|
53
|
+
const AI_AGENT_JOB_TYPE = "aiAgentJob";
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Evaluator
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
export function evaluateChecks(ctx) {
|
|
58
|
+
const nodes = Array.isArray(ctx.nodes) ? ctx.nodes : [];
|
|
59
|
+
const checks = [];
|
|
60
|
+
const sscNodes = findAllByType(nodes, SESSION_CONFIG_TYPE);
|
|
61
|
+
const ssc = sscNodes[0];
|
|
62
|
+
const sscConfig = ssc?.config ?? {};
|
|
63
|
+
const agent = findByType(nodes, AI_AGENT_JOB_TYPE);
|
|
64
|
+
const agentConfig = agent?.config ?? {};
|
|
65
|
+
// Ordering comes from the chart `next` chain via `ctx.firstNodeId`, NOT from
|
|
66
|
+
// `isEntryPoint` (a per-descriptor flag — every aiAgentJob reports `true`).
|
|
67
|
+
const firstId = ctx.firstNodeId;
|
|
68
|
+
// --- 3.1: first node is a Set Session Config node -----------------------
|
|
69
|
+
{
|
|
70
|
+
const id = "vg.session-config-first";
|
|
71
|
+
const section = "3.1 Flow Configuration";
|
|
72
|
+
const title = "First node is a Set Session Config node";
|
|
73
|
+
// A new Set Session Config node is prepended before the AI Agent node (or,
|
|
74
|
+
// lacking one, before the current first node).
|
|
75
|
+
const firstNode = firstId
|
|
76
|
+
? nodes.find((n) => nodeId(n) === firstId)
|
|
77
|
+
: undefined;
|
|
78
|
+
const target = agent ?? firstNode;
|
|
79
|
+
if (!ssc) {
|
|
80
|
+
checks.push({
|
|
81
|
+
id,
|
|
82
|
+
section,
|
|
83
|
+
title,
|
|
84
|
+
status: "fail",
|
|
85
|
+
detail: "No Set Session Config node found. Voice flows must open with one so per-session speech settings are applied before the agent runs.",
|
|
86
|
+
autoFixable: !!target,
|
|
87
|
+
...(target
|
|
88
|
+
? {
|
|
89
|
+
fix: {
|
|
90
|
+
kind: "createSessionConfig",
|
|
91
|
+
targetNodeId: nodeId(target),
|
|
92
|
+
label: "Set Session Config",
|
|
93
|
+
config: RECOMMENDED_SESSION_CONFIG,
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
: {}),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else if (!firstId) {
|
|
100
|
+
// Ordering unknown — do NOT guess from isEntryPoint.
|
|
101
|
+
checks.push({
|
|
102
|
+
id,
|
|
103
|
+
section,
|
|
104
|
+
title,
|
|
105
|
+
status: "warn",
|
|
106
|
+
detail: "A Set Session Config node exists, but flow ordering could not be determined. Verify it runs before the AI Agent node.",
|
|
107
|
+
autoFixable: false,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else if (nodeId(ssc) === firstId) {
|
|
111
|
+
checks.push({
|
|
112
|
+
id,
|
|
113
|
+
section,
|
|
114
|
+
title,
|
|
115
|
+
status: "pass",
|
|
116
|
+
detail: "Set Session Config node runs first in the flow.",
|
|
117
|
+
autoFixable: false,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
checks.push({
|
|
122
|
+
id,
|
|
123
|
+
section,
|
|
124
|
+
title,
|
|
125
|
+
status: "warn",
|
|
126
|
+
detail: "A Set Session Config node exists but is not the first node in the flow. Verify it runs before the AI Agent node.",
|
|
127
|
+
autoFixable: false,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Set Session Config value checks share this guard.
|
|
132
|
+
const sscPresent = !!ssc;
|
|
133
|
+
const sscNaDetail = "No Set Session Config node to inspect. Fix vg.session-config-first first.";
|
|
134
|
+
// --- 3.1: barge-in off --------------------------------------------------
|
|
135
|
+
pushBoolean(checks, {
|
|
136
|
+
id: "vg.barge-in-off",
|
|
137
|
+
section: "3.1 Flow Configuration",
|
|
138
|
+
title: "Barge-in off",
|
|
139
|
+
present: sscPresent,
|
|
140
|
+
naDetail: sscNaDetail,
|
|
141
|
+
ok: sscConfig.bargeInOnSpeech === false && sscConfig.bargeInOnDtmf === false,
|
|
142
|
+
passDetail: "Barge-in is disabled.",
|
|
143
|
+
failDetail: "Barge-in is enabled. Default to off unless selectively enabled with clear justification.",
|
|
144
|
+
fix: ssc
|
|
145
|
+
? {
|
|
146
|
+
kind: "patchNode",
|
|
147
|
+
nodeId: nodeId(ssc),
|
|
148
|
+
config: { bargeInOnSpeech: false, bargeInOnDtmf: false },
|
|
149
|
+
}
|
|
150
|
+
: undefined,
|
|
151
|
+
});
|
|
152
|
+
// --- 3.1: continuous ASR off --------------------------------------------
|
|
153
|
+
pushBoolean(checks, {
|
|
154
|
+
id: "vg.continuous-asr-off",
|
|
155
|
+
section: "3.1 Flow Configuration",
|
|
156
|
+
title: "Continuous ASR off",
|
|
157
|
+
present: sscPresent,
|
|
158
|
+
naDetail: sscNaDetail,
|
|
159
|
+
ok: sscConfig.asrEnabled === false,
|
|
160
|
+
passDetail: "Continuous ASR is disabled.",
|
|
161
|
+
failDetail: "Continuous ASR is enabled. Turn it off when using Flux (confidence-based end-of-turn).",
|
|
162
|
+
fix: ssc
|
|
163
|
+
? {
|
|
164
|
+
kind: "patchNode",
|
|
165
|
+
nodeId: nodeId(ssc),
|
|
166
|
+
config: { asrEnabled: false },
|
|
167
|
+
}
|
|
168
|
+
: undefined,
|
|
169
|
+
});
|
|
170
|
+
// --- 3.1: user input timeout changed from defaults ----------------------
|
|
171
|
+
{
|
|
172
|
+
const id = "vg.user-input-timeout";
|
|
173
|
+
const section = "3.1 Flow Configuration";
|
|
174
|
+
const title = "User input timeout tuned (5–7 s, ≥5 retries)";
|
|
175
|
+
if (!sscPresent) {
|
|
176
|
+
checks.push({
|
|
177
|
+
id,
|
|
178
|
+
section,
|
|
179
|
+
title,
|
|
180
|
+
status: "na",
|
|
181
|
+
detail: sscNaDetail,
|
|
182
|
+
autoFixable: false,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const timeout = Number(sscConfig.userNoInputTimeout);
|
|
187
|
+
const retries = Number(sscConfig.userNoInputRetries);
|
|
188
|
+
const timeoutOk = sscConfig.userNoInputTimeoutEnable === true &&
|
|
189
|
+
timeout >= USER_INPUT_TIMEOUT_MIN_MS &&
|
|
190
|
+
timeout <= USER_INPUT_TIMEOUT_MAX_MS;
|
|
191
|
+
const retriesOk = retries >= USER_INPUT_RETRIES_MIN;
|
|
192
|
+
const ok = timeoutOk && retriesOk;
|
|
193
|
+
checks.push({
|
|
194
|
+
id,
|
|
195
|
+
section,
|
|
196
|
+
title,
|
|
197
|
+
status: ok ? "pass" : "fail",
|
|
198
|
+
detail: ok
|
|
199
|
+
? `User input timeout ${timeout} ms with ${retries} retries.`
|
|
200
|
+
: `User input timeout/retries off recommendation (got timeout=${sscConfig.userNoInputTimeout ?? "unset"} ms, retries=${sscConfig.userNoInputRetries ?? "unset"}). Recommended: 5000–7000 ms, ≥5 retries.`,
|
|
201
|
+
autoFixable: !ok,
|
|
202
|
+
...(ok
|
|
203
|
+
? {}
|
|
204
|
+
: {
|
|
205
|
+
fix: {
|
|
206
|
+
kind: "patchNode",
|
|
207
|
+
nodeId: nodeId(ssc),
|
|
208
|
+
config: {
|
|
209
|
+
userNoInputTimeoutEnable: true,
|
|
210
|
+
userNoInputTimeout: 6000,
|
|
211
|
+
userNoInputRetries: USER_INPUT_RETRIES_MIN,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
}),
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// --- 3.1: flow input timeout enabled (~1500 ms) with filler -------------
|
|
219
|
+
{
|
|
220
|
+
const id = "vg.flow-input-timeout";
|
|
221
|
+
const section = "3.1 Flow Configuration";
|
|
222
|
+
const title = "Flow input timeout enabled (~1500 ms) with filler phrase";
|
|
223
|
+
if (!sscPresent) {
|
|
224
|
+
checks.push({
|
|
225
|
+
id,
|
|
226
|
+
section,
|
|
227
|
+
title,
|
|
228
|
+
status: "na",
|
|
229
|
+
detail: sscNaDetail,
|
|
230
|
+
autoFixable: false,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
const timeout = Number(sscConfig.flowNoInputTimeout);
|
|
235
|
+
const enabled = sscConfig.flowNoInputTimeoutEnable === true;
|
|
236
|
+
const hasFiller = typeof sscConfig.flowNoInputSpeech === "string" &&
|
|
237
|
+
sscConfig.flowNoInputSpeech.trim().length > 0;
|
|
238
|
+
const timeoutOk = timeout >= FLOW_INPUT_TIMEOUT_MIN_MS &&
|
|
239
|
+
timeout <= FLOW_INPUT_TIMEOUT_MAX_MS;
|
|
240
|
+
const ok = enabled && timeoutOk && hasFiller;
|
|
241
|
+
checks.push({
|
|
242
|
+
id,
|
|
243
|
+
section,
|
|
244
|
+
title,
|
|
245
|
+
status: ok ? "pass" : "fail",
|
|
246
|
+
detail: ok
|
|
247
|
+
? `Flow input timeout ${timeout} ms with filler phrase.`
|
|
248
|
+
: "Flow input timeout should be enabled at ~1500 ms with a filler phrase.",
|
|
249
|
+
autoFixable: !ok,
|
|
250
|
+
...(ok
|
|
251
|
+
? {}
|
|
252
|
+
: {
|
|
253
|
+
fix: {
|
|
254
|
+
kind: "patchNode",
|
|
255
|
+
nodeId: nodeId(ssc),
|
|
256
|
+
config: {
|
|
257
|
+
flowNoInputTimeoutEnable: true,
|
|
258
|
+
flowNoInputTimeout: 1500,
|
|
259
|
+
flowNoInputSpeech: hasFiller
|
|
260
|
+
? sscConfig.flowNoInputSpeech
|
|
261
|
+
: DEFAULT_FLOW_FILLER,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
}),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// --- 3.1: flow input timeout "fails on error" off -----------------------
|
|
269
|
+
pushBoolean(checks, {
|
|
270
|
+
id: "vg.flow-fails-on-error-off",
|
|
271
|
+
section: "3.1 Flow Configuration",
|
|
272
|
+
title: "Flow input timeout — fails on error off",
|
|
273
|
+
present: sscPresent,
|
|
274
|
+
naDetail: sscNaDetail,
|
|
275
|
+
ok: sscConfig.flowNoInputFail === false,
|
|
276
|
+
passDetail: "Flow input timeout does not fail the call on error.",
|
|
277
|
+
failDetail: "Flow input timeout is set to fail on error. Turn it off so the call survives a no-input.",
|
|
278
|
+
fix: ssc
|
|
279
|
+
? {
|
|
280
|
+
kind: "patchNode",
|
|
281
|
+
nodeId: nodeId(ssc),
|
|
282
|
+
config: { flowNoInputFail: false },
|
|
283
|
+
}
|
|
284
|
+
: undefined,
|
|
285
|
+
});
|
|
286
|
+
// --- 3.1: Stream to Output on (AI Agent node) ---------------------------
|
|
287
|
+
{
|
|
288
|
+
const id = "agent.stream-output";
|
|
289
|
+
const section = "3.1 Flow Configuration";
|
|
290
|
+
const title = "Stream to Output on in the AI Agent node";
|
|
291
|
+
if (!agent) {
|
|
292
|
+
checks.push({
|
|
293
|
+
id,
|
|
294
|
+
section,
|
|
295
|
+
title,
|
|
296
|
+
status: "na",
|
|
297
|
+
detail: "No AI Agent (aiAgentJob) node found in the flow.",
|
|
298
|
+
autoFixable: false,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
const ok = agentConfig.storeLocation === "stream";
|
|
303
|
+
checks.push({
|
|
304
|
+
id,
|
|
305
|
+
section,
|
|
306
|
+
title,
|
|
307
|
+
status: ok ? "pass" : "fail",
|
|
308
|
+
detail: ok
|
|
309
|
+
? "AI Agent output is streamed (storeLocation = stream)."
|
|
310
|
+
: `AI Agent output is not streamed (storeLocation = ${agentConfig.storeLocation ?? "unset"}). Streaming lowers time-to-first-audio.`,
|
|
311
|
+
autoFixable: !ok,
|
|
312
|
+
...(ok
|
|
313
|
+
? {}
|
|
314
|
+
: {
|
|
315
|
+
fix: {
|
|
316
|
+
kind: "patchNode",
|
|
317
|
+
nodeId: nodeId(agent),
|
|
318
|
+
config: { storeLocation: "stream" },
|
|
319
|
+
},
|
|
320
|
+
}),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// --- 3.1: AI Agent "fails on error" off ---------------------------------
|
|
325
|
+
{
|
|
326
|
+
const id = "agent.fails-on-error-off";
|
|
327
|
+
const section = "3.1 Flow Configuration";
|
|
328
|
+
const title = "AI Agent does not stop the flow on error";
|
|
329
|
+
if (!agent) {
|
|
330
|
+
checks.push({
|
|
331
|
+
id,
|
|
332
|
+
section,
|
|
333
|
+
title,
|
|
334
|
+
status: "na",
|
|
335
|
+
detail: "No AI Agent node found.",
|
|
336
|
+
autoFixable: false,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
const ok = agentConfig.errorHandling !== undefined &&
|
|
341
|
+
agentConfig.errorHandling !== "stop";
|
|
342
|
+
checks.push({
|
|
343
|
+
id,
|
|
344
|
+
section,
|
|
345
|
+
title,
|
|
346
|
+
status: ok ? "pass" : "fail",
|
|
347
|
+
detail: ok
|
|
348
|
+
? `AI Agent error handling = ${agentConfig.errorHandling}.`
|
|
349
|
+
: "AI Agent stops the flow on error. Set error handling to continue so the call is not dropped.",
|
|
350
|
+
autoFixable: !ok,
|
|
351
|
+
...(ok
|
|
352
|
+
? {}
|
|
353
|
+
: {
|
|
354
|
+
fix: {
|
|
355
|
+
kind: "patchNode",
|
|
356
|
+
nodeId: nodeId(agent),
|
|
357
|
+
config: { errorHandling: "continue" },
|
|
358
|
+
},
|
|
359
|
+
}),
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// --- 3.2: AI Agent error message configured -----------------------------
|
|
364
|
+
{
|
|
365
|
+
const id = "agent.error-message";
|
|
366
|
+
const section = "3.2 LLM";
|
|
367
|
+
const title = "AI Agent error message configured";
|
|
368
|
+
if (!agent) {
|
|
369
|
+
checks.push({
|
|
370
|
+
id,
|
|
371
|
+
section,
|
|
372
|
+
title,
|
|
373
|
+
status: "na",
|
|
374
|
+
detail: "No AI Agent node found.",
|
|
375
|
+
autoFixable: false,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
const msg = agentConfig.errorMessage;
|
|
380
|
+
const ok = typeof msg === "string" && msg.trim().length > 0;
|
|
381
|
+
checks.push({
|
|
382
|
+
id,
|
|
383
|
+
section,
|
|
384
|
+
title,
|
|
385
|
+
status: ok ? "pass" : "fail",
|
|
386
|
+
detail: ok
|
|
387
|
+
? "AI Agent has a configured error message."
|
|
388
|
+
: "AI Agent has no error message. Configure one so callers hear a graceful failure.",
|
|
389
|
+
autoFixable: !ok,
|
|
390
|
+
...(ok
|
|
391
|
+
? {}
|
|
392
|
+
: {
|
|
393
|
+
fix: {
|
|
394
|
+
kind: "patchNode",
|
|
395
|
+
nodeId: nodeId(agent),
|
|
396
|
+
config: { errorMessage: DEFAULT_AGENT_ERROR_MESSAGE },
|
|
397
|
+
},
|
|
398
|
+
}),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
// --- 3.2: Log LLM Latency on --------------------------------------------
|
|
403
|
+
{
|
|
404
|
+
const id = "agent.log-llm-latency";
|
|
405
|
+
const section = "3.2 LLM";
|
|
406
|
+
const title = "Log LLM Latency on";
|
|
407
|
+
if (!agent) {
|
|
408
|
+
checks.push({
|
|
409
|
+
id,
|
|
410
|
+
section,
|
|
411
|
+
title,
|
|
412
|
+
status: "na",
|
|
413
|
+
detail: "No AI Agent node found.",
|
|
414
|
+
autoFixable: false,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
const ok = agentConfig.debugLogLLMLatency === true;
|
|
419
|
+
checks.push({
|
|
420
|
+
id,
|
|
421
|
+
section,
|
|
422
|
+
title,
|
|
423
|
+
status: ok ? "pass" : "fail",
|
|
424
|
+
detail: ok
|
|
425
|
+
? "LLM latency logging is on."
|
|
426
|
+
: "LLM latency logging is off. Turn it on to diagnose voice latency.",
|
|
427
|
+
autoFixable: !ok,
|
|
428
|
+
...(ok
|
|
429
|
+
? {}
|
|
430
|
+
: {
|
|
431
|
+
fix: {
|
|
432
|
+
kind: "patchNode",
|
|
433
|
+
nodeId: nodeId(agent),
|
|
434
|
+
config: { debugLogLLMLatency: true },
|
|
435
|
+
},
|
|
436
|
+
}),
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// --- 3.6: silence overlay delay set to 0 (when configured) --------------
|
|
441
|
+
{
|
|
442
|
+
const id = "vg.silence-overlay-delay";
|
|
443
|
+
const section = "3.6 Audio Experience";
|
|
444
|
+
const title = "Silence overlay delay set to 0";
|
|
445
|
+
const configured = sscPresent &&
|
|
446
|
+
sscConfig.silenceOverlayAction !== undefined &&
|
|
447
|
+
sscConfig.silenceOverlayAction !== false &&
|
|
448
|
+
sscConfig.silenceOverlayAction !== "";
|
|
449
|
+
if (!configured) {
|
|
450
|
+
checks.push({
|
|
451
|
+
id,
|
|
452
|
+
section,
|
|
453
|
+
title,
|
|
454
|
+
status: "na",
|
|
455
|
+
detail: sscPresent
|
|
456
|
+
? "Silence overlay not configured (optional)."
|
|
457
|
+
: sscNaDetail,
|
|
458
|
+
autoFixable: false,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
const ok = Number(sscConfig.silenceOverlayDelay) === 0;
|
|
463
|
+
checks.push({
|
|
464
|
+
id,
|
|
465
|
+
section,
|
|
466
|
+
title,
|
|
467
|
+
status: ok ? "pass" : "fail",
|
|
468
|
+
detail: ok
|
|
469
|
+
? "Silence overlay delay is 0."
|
|
470
|
+
: `Silence overlay delay is ${sscConfig.silenceOverlayDelay}. Set it to 0.`,
|
|
471
|
+
autoFixable: !ok,
|
|
472
|
+
...(ok
|
|
473
|
+
? {}
|
|
474
|
+
: {
|
|
475
|
+
fix: {
|
|
476
|
+
kind: "patchNode",
|
|
477
|
+
nodeId: nodeId(ssc),
|
|
478
|
+
config: { silenceOverlayDelay: 0 },
|
|
479
|
+
},
|
|
480
|
+
}),
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
// --- 3.3: STT hints present (advisory) ----------------------------------
|
|
485
|
+
{
|
|
486
|
+
const id = "vg.stt-hints";
|
|
487
|
+
const section = "3.3 Speech Services";
|
|
488
|
+
const title = "STT hints include brand/domain terms";
|
|
489
|
+
if (!sscPresent) {
|
|
490
|
+
checks.push({
|
|
491
|
+
id,
|
|
492
|
+
section,
|
|
493
|
+
title,
|
|
494
|
+
status: "na",
|
|
495
|
+
detail: sscNaDetail,
|
|
496
|
+
autoFixable: false,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
const hints = sscConfig.sttHints;
|
|
501
|
+
const has = Array.isArray(hints) && hints.length > 0;
|
|
502
|
+
checks.push({
|
|
503
|
+
id,
|
|
504
|
+
section,
|
|
505
|
+
title,
|
|
506
|
+
status: has ? "pass" : "warn",
|
|
507
|
+
detail: has
|
|
508
|
+
? `${hints.length} STT hint(s) configured. Confirm they cover brand and domain terms.`
|
|
509
|
+
: "No STT hints configured. Add brand and domain terms to improve recognition. (Cannot be auto-filled.)",
|
|
510
|
+
autoFixable: false,
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
// --- 3.7: Output Transformer strips markdown (advisory) -----------------
|
|
515
|
+
{
|
|
516
|
+
const id = "endpoint.output-transformer";
|
|
517
|
+
const section = "3.7 Deployment";
|
|
518
|
+
const title = "Endpoint Output Transformer enabled";
|
|
519
|
+
if (ctx.endpoint === undefined) {
|
|
520
|
+
checks.push({
|
|
521
|
+
id,
|
|
522
|
+
section,
|
|
523
|
+
title,
|
|
524
|
+
status: "na",
|
|
525
|
+
detail: "Pass endpointId to audit the Output Transformer.",
|
|
526
|
+
autoFixable: false,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
else if (ctx.endpoint === null) {
|
|
530
|
+
checks.push({
|
|
531
|
+
id,
|
|
532
|
+
section,
|
|
533
|
+
title,
|
|
534
|
+
status: "warn",
|
|
535
|
+
detail: "endpointId was provided but the endpoint could not be fetched (not found or no access). Verify the id and permissions.",
|
|
536
|
+
autoFixable: false,
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
const t = ctx.endpoint.transformer ?? {};
|
|
541
|
+
const code = typeof t.transformer === "string" ? t.transformer : "";
|
|
542
|
+
const ok = t.outputTransformerEnabled === true && code.trim().length > 0;
|
|
543
|
+
checks.push({
|
|
544
|
+
id,
|
|
545
|
+
section,
|
|
546
|
+
title,
|
|
547
|
+
status: ok ? "pass" : "warn",
|
|
548
|
+
detail: ok
|
|
549
|
+
? "Output Transformer is enabled with code present. Confirm it strips markdown and fixes pronunciations."
|
|
550
|
+
: "Output Transformer is not enabled or empty. Add one that strips markdown and fixes pronunciations. (Code is not auto-generated.)",
|
|
551
|
+
autoFixable: false,
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
// --- 3.2: Fallback LLM configured (advisory) ----------------------------
|
|
556
|
+
{
|
|
557
|
+
const id = "llm.fallback";
|
|
558
|
+
const section = "3.2 LLM";
|
|
559
|
+
const title = "Fallback LLM configured";
|
|
560
|
+
if (ctx.llm === undefined) {
|
|
561
|
+
checks.push({
|
|
562
|
+
id,
|
|
563
|
+
section,
|
|
564
|
+
title,
|
|
565
|
+
status: "na",
|
|
566
|
+
detail: "Pass projectId so the agent's LLM can be resolved and inspected.",
|
|
567
|
+
autoFixable: false,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
else if (ctx.llm === null) {
|
|
571
|
+
checks.push({
|
|
572
|
+
id,
|
|
573
|
+
section,
|
|
574
|
+
title,
|
|
575
|
+
status: "warn",
|
|
576
|
+
detail: "projectId was provided but the agent's LLM could not be resolved. Verify the project has an LLM assigned.",
|
|
577
|
+
autoFixable: false,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
const fallbacks = ctx.llm.fallbacks;
|
|
582
|
+
const has = Array.isArray(fallbacks) && fallbacks.length > 0;
|
|
583
|
+
checks.push({
|
|
584
|
+
id,
|
|
585
|
+
section,
|
|
586
|
+
title,
|
|
587
|
+
status: has ? "pass" : "warn",
|
|
588
|
+
detail: has
|
|
589
|
+
? `${fallbacks.length} fallback LLM(s) configured.`
|
|
590
|
+
: "No fallback LLM configured. Add one so the call survives a primary-LLM outage. (Requires choosing a model — not auto-applied.)",
|
|
591
|
+
autoFixable: false,
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return checks;
|
|
596
|
+
}
|
|
597
|
+
function pushBoolean(checks, spec) {
|
|
598
|
+
if (!spec.present) {
|
|
599
|
+
checks.push({
|
|
600
|
+
id: spec.id,
|
|
601
|
+
section: spec.section,
|
|
602
|
+
title: spec.title,
|
|
603
|
+
status: "na",
|
|
604
|
+
detail: spec.naDetail,
|
|
605
|
+
autoFixable: false,
|
|
606
|
+
});
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
checks.push({
|
|
610
|
+
id: spec.id,
|
|
611
|
+
section: spec.section,
|
|
612
|
+
title: spec.title,
|
|
613
|
+
status: spec.ok ? "pass" : "fail",
|
|
614
|
+
detail: spec.ok ? spec.passDetail : spec.failDetail,
|
|
615
|
+
autoFixable: !spec.ok && !!spec.fix,
|
|
616
|
+
...(!spec.ok && spec.fix ? { fix: spec.fix } : {}),
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
export function summarize(checks) {
|
|
620
|
+
const summary = {
|
|
621
|
+
pass: 0,
|
|
622
|
+
fail: 0,
|
|
623
|
+
warn: 0,
|
|
624
|
+
na: 0,
|
|
625
|
+
total: checks.length,
|
|
626
|
+
fixable: 0,
|
|
627
|
+
};
|
|
628
|
+
for (const c of checks) {
|
|
629
|
+
summary[c.status] += 1;
|
|
630
|
+
if (c.autoFixable)
|
|
631
|
+
summary.fixable += 1;
|
|
632
|
+
}
|
|
633
|
+
return summary;
|
|
634
|
+
}
|
|
635
|
+
//# sourceMappingURL=voiceChecklist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceChecklist.js","sourceRoot":"","sources":["../../src/tools/voiceChecklist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA2DH,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,yBAAyB,GAAG,IAAI,CAAC;AACvC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AACvC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,yBAAyB,GA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CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { manageWebchatSchema } from '../schemas/tools.js';
|
|
3
|
+
type ManageWebchatInput = z.infer<typeof manageWebchatSchema>;
|
|
4
|
+
export declare function deepMerge(target: any, source: any): any;
|
|
5
|
+
/**
|
|
6
|
+
* Build the nested `settings` object for the Cognigy Webchat v3 POST/PATCH endpoint API.
|
|
7
|
+
*
|
|
8
|
+
* The v3 write API uses nested groups: colors, layout, behavior, startBehavior,
|
|
9
|
+
* homeScreen, teaserMessage, chatOptions, privacyNotice, businessHours,
|
|
10
|
+
* unreadMessages, maintenance, demoWebchat, fileStorageSettings, etc.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildWebchatSettings(input: ManageWebchatInput): Record<string, any>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=webchatSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webchatSettings.d.ts","sourceRoot":"","sources":["../../src/tools/webchatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAsD9D,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAmBvD;AAsBD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgSnF"}
|