@absolutejs/voice 0.0.22-beta.50 → 0.0.22-beta.51
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/dist/appKit.d.ts +9 -0
- package/dist/index.js +34 -8
- package/package.json +1 -1
package/dist/appKit.d.ts
CHANGED
|
@@ -37,7 +37,15 @@ export type VoiceAppKitRoutesOptions<TProvider extends string = string> = {
|
|
|
37
37
|
};
|
|
38
38
|
export type VoiceAppKitStatus = 'pass' | 'fail';
|
|
39
39
|
export type VoiceAppKitStatusOptions = {
|
|
40
|
+
include?: {
|
|
41
|
+
handoffs?: boolean;
|
|
42
|
+
providers?: boolean;
|
|
43
|
+
quality?: boolean;
|
|
44
|
+
sessions?: boolean;
|
|
45
|
+
workflows?: boolean;
|
|
46
|
+
};
|
|
40
47
|
path?: string;
|
|
48
|
+
preferFixtureWorkflows?: boolean;
|
|
41
49
|
};
|
|
42
50
|
export type VoiceAppKitStatusReport = {
|
|
43
51
|
checkedAt: number;
|
|
@@ -66,6 +74,7 @@ export type VoiceAppKitStatusReport = {
|
|
|
66
74
|
};
|
|
67
75
|
workflows?: {
|
|
68
76
|
failed: number;
|
|
77
|
+
source: 'fixtures' | 'live';
|
|
69
78
|
status: VoiceAppKitStatus;
|
|
70
79
|
total: number;
|
|
71
80
|
};
|
package/dist/index.js
CHANGED
|
@@ -9198,24 +9198,49 @@ var countStatus = (statuses) => ({
|
|
|
9198
9198
|
});
|
|
9199
9199
|
var summarizeVoiceAppKitStatus = async (options) => {
|
|
9200
9200
|
const links = resolveLinks(options.links);
|
|
9201
|
+
const statusOptions = options.appStatus && typeof options.appStatus === "object" ? options.appStatus : undefined;
|
|
9202
|
+
const evalOptions = options.evals === false ? undefined : options.evals;
|
|
9203
|
+
const include = statusOptions?.include;
|
|
9204
|
+
const shouldInclude = (surface) => include?.[surface] !== false;
|
|
9201
9205
|
const events = filterVoiceTraceEvents(await options.store.list());
|
|
9202
9206
|
const [quality, workflows, providers, sessions, handoffs] = await Promise.all([
|
|
9203
|
-
options.quality === false ? undefined : evaluateVoiceQuality({
|
|
9207
|
+
options.quality === false || !shouldInclude("quality") ? undefined : evaluateVoiceQuality({
|
|
9204
9208
|
events,
|
|
9205
9209
|
thresholds: options.quality?.thresholds
|
|
9206
9210
|
}),
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9211
|
+
!evalOptions || !shouldInclude("workflows") ? undefined : (async () => {
|
|
9212
|
+
const fixtureReport = await runVoiceScenarioFixtureEvals({
|
|
9213
|
+
fixtures: evalOptions.fixtures,
|
|
9214
|
+
fixtureStore: evalOptions.fixtureStore,
|
|
9215
|
+
scenarios: evalOptions.scenarios
|
|
9216
|
+
});
|
|
9217
|
+
if ((statusOptions?.preferFixtureWorkflows ?? true) && fixtureReport.total > 0) {
|
|
9218
|
+
return {
|
|
9219
|
+
failed: fixtureReport.failed,
|
|
9220
|
+
source: "fixtures",
|
|
9221
|
+
status: fixtureReport.status,
|
|
9222
|
+
total: fixtureReport.total
|
|
9223
|
+
};
|
|
9224
|
+
}
|
|
9225
|
+
const liveReport = await runVoiceScenarioEvals({
|
|
9226
|
+
events,
|
|
9227
|
+
scenarios: evalOptions.scenarios
|
|
9228
|
+
});
|
|
9229
|
+
return {
|
|
9230
|
+
failed: liveReport.failed,
|
|
9231
|
+
source: "live",
|
|
9232
|
+
status: liveReport.status,
|
|
9233
|
+
total: liveReport.total
|
|
9234
|
+
};
|
|
9235
|
+
})(),
|
|
9236
|
+
options.providerHealth === false || !shouldInclude("providers") ? undefined : summarizeVoiceProviderHealth({
|
|
9212
9237
|
events,
|
|
9213
9238
|
providers: options.llmProviders
|
|
9214
9239
|
}),
|
|
9215
|
-
options.sessions === false ? undefined : summarizeVoiceSessions({
|
|
9240
|
+
options.sessions === false || !shouldInclude("sessions") ? undefined : summarizeVoiceSessions({
|
|
9216
9241
|
events
|
|
9217
9242
|
}),
|
|
9218
|
-
options.handoffs === false ? undefined : summarizeVoiceHandoffHealth({
|
|
9243
|
+
options.handoffs === false || !shouldInclude("handoffs") ? undefined : summarizeVoiceHandoffHealth({
|
|
9219
9244
|
events
|
|
9220
9245
|
})
|
|
9221
9246
|
]);
|
|
@@ -9229,6 +9254,7 @@ var summarizeVoiceAppKitStatus = async (options) => {
|
|
|
9229
9254
|
const status = workflows.status;
|
|
9230
9255
|
surfaces.workflows = {
|
|
9231
9256
|
failed: workflows.failed,
|
|
9257
|
+
source: workflows.source,
|
|
9232
9258
|
status,
|
|
9233
9259
|
total: workflows.total
|
|
9234
9260
|
};
|