@absolutejs/voice 0.0.22-beta.162 → 0.0.22-beta.163
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/index.d.ts +2 -2
- package/dist/index.js +100 -0
- package/dist/readinessProfiles.d.ts +15 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export { createVoiceProviderCapabilityHTMLHandler, createVoiceProviderCapability
|
|
|
45
45
|
export { assertVoiceProviderRoutingContract, runVoiceProviderRoutingContract } from './providerRoutingContract';
|
|
46
46
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
47
47
|
export { buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
48
|
-
export { createVoiceReadinessProfile } from './readinessProfiles';
|
|
48
|
+
export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
|
|
49
49
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
50
50
|
export { summarizeVoiceOpsStatus } from './opsStatus';
|
|
51
51
|
export { createVoiceOpsStatusRoutes, renderVoiceOpsStatusHTML } from './opsStatusRoutes';
|
|
@@ -104,7 +104,7 @@ export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmok
|
|
|
104
104
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
105
105
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
106
106
|
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
107
|
-
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
107
|
+
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
108
108
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|
|
109
109
|
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingKindSummary, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind, VoiceRoutingSessionSummary, VoiceRoutingSessionSummaryOptions } from './resilienceRoutes';
|
|
110
110
|
export type { VoiceIOProviderRouterEvent, VoiceIOProviderRouterOptions, VoiceIOProviderRouterPolicy, VoiceIOProviderRouterPolicyConfig, VoiceSTTProviderRouterOptions, VoiceTTSProviderRouterOptions } from './providerAdapters';
|
package/dist/index.js
CHANGED
|
@@ -20969,6 +20969,73 @@ var createVoiceProductionReadinessRoutes = (options) => {
|
|
|
20969
20969
|
return routes;
|
|
20970
20970
|
};
|
|
20971
20971
|
// src/readinessProfiles.ts
|
|
20972
|
+
var profileSurfaceLabels = {
|
|
20973
|
+
"meeting-recorder": {
|
|
20974
|
+
bargeInReports: "barge-in proof configured",
|
|
20975
|
+
providerRoutingContracts: "provider routing contracts configured",
|
|
20976
|
+
reconnectContracts: "reconnect contracts configured"
|
|
20977
|
+
},
|
|
20978
|
+
"ops-heavy": {
|
|
20979
|
+
audit: "audit evidence configured",
|
|
20980
|
+
auditDeliveries: "audit delivery queue configured",
|
|
20981
|
+
deliveryRuntime: "delivery runtime configured",
|
|
20982
|
+
opsActionHistory: "operator action history configured",
|
|
20983
|
+
traceDeliveries: "trace delivery queue configured"
|
|
20984
|
+
},
|
|
20985
|
+
"phone-agent": {
|
|
20986
|
+
auditDeliveries: "audit delivery queue configured",
|
|
20987
|
+
carriers: "carrier readiness configured",
|
|
20988
|
+
deliveryRuntime: "delivery runtime configured",
|
|
20989
|
+
phoneAgentSmokes: "phone-agent smoke proof configured",
|
|
20990
|
+
providerRoutingContracts: "provider routing contracts configured",
|
|
20991
|
+
traceDeliveries: "trace delivery queue configured"
|
|
20992
|
+
}
|
|
20993
|
+
};
|
|
20994
|
+
var profileRequiredKeys = {
|
|
20995
|
+
"meeting-recorder": [
|
|
20996
|
+
"bargeInReports",
|
|
20997
|
+
"providerRoutingContracts",
|
|
20998
|
+
"reconnectContracts"
|
|
20999
|
+
],
|
|
21000
|
+
"ops-heavy": [
|
|
21001
|
+
"audit",
|
|
21002
|
+
"opsActionHistory",
|
|
21003
|
+
"auditDeliveries",
|
|
21004
|
+
"traceDeliveries",
|
|
21005
|
+
"deliveryRuntime"
|
|
21006
|
+
],
|
|
21007
|
+
"phone-agent": [
|
|
21008
|
+
"carriers",
|
|
21009
|
+
"phoneAgentSmokes",
|
|
21010
|
+
"providerRoutingContracts",
|
|
21011
|
+
"auditDeliveries",
|
|
21012
|
+
"traceDeliveries",
|
|
21013
|
+
"deliveryRuntime"
|
|
21014
|
+
]
|
|
21015
|
+
};
|
|
21016
|
+
var configuredProfileKeys = (options) => {
|
|
21017
|
+
const configured = new Set;
|
|
21018
|
+
for (const key of [
|
|
21019
|
+
"audit",
|
|
21020
|
+
"auditDeliveries",
|
|
21021
|
+
"bargeInReports",
|
|
21022
|
+
"carriers",
|
|
21023
|
+
"deliveryRuntime",
|
|
21024
|
+
"opsActionHistory",
|
|
21025
|
+
"phoneAgentSmokes",
|
|
21026
|
+
"providerRoutingContracts",
|
|
21027
|
+
"reconnectContracts",
|
|
21028
|
+
"traceDeliveries"
|
|
21029
|
+
]) {
|
|
21030
|
+
if (isConfigured(options[key])) {
|
|
21031
|
+
configured.add(key);
|
|
21032
|
+
}
|
|
21033
|
+
}
|
|
21034
|
+
if (configured.has("audit")) {
|
|
21035
|
+
configured.add("opsActionHistory");
|
|
21036
|
+
}
|
|
21037
|
+
return configured;
|
|
21038
|
+
};
|
|
20972
21039
|
var auditStoreFromOptions = (audit) => {
|
|
20973
21040
|
if (!audit) {
|
|
20974
21041
|
return;
|
|
@@ -21185,6 +21252,38 @@ var createVoiceReadinessProfile = (profile, options = {}) => {
|
|
|
21185
21252
|
traceDeliveries: options.traceDeliveries
|
|
21186
21253
|
});
|
|
21187
21254
|
};
|
|
21255
|
+
var recommendVoiceReadinessProfile = (options) => {
|
|
21256
|
+
const configured = configuredProfileKeys(options);
|
|
21257
|
+
const scores = ["phone-agent", "meeting-recorder", "ops-heavy"].map((profile) => {
|
|
21258
|
+
const required = profileRequiredKeys[profile];
|
|
21259
|
+
const configuredKeys = required.filter((key) => configured.has(key));
|
|
21260
|
+
const missing = required.filter((key) => !configured.has(key));
|
|
21261
|
+
const reasons = configuredKeys.map((key) => profileSurfaceLabels[profile][key] ?? `${key} configured`);
|
|
21262
|
+
return {
|
|
21263
|
+
configured: configuredKeys,
|
|
21264
|
+
confidence: required.length === 0 ? 0 : Math.round(configuredKeys.length / required.length * 100) / 100,
|
|
21265
|
+
missing,
|
|
21266
|
+
profile,
|
|
21267
|
+
reasons
|
|
21268
|
+
};
|
|
21269
|
+
});
|
|
21270
|
+
const [best] = scores.toSorted((left, right) => {
|
|
21271
|
+
if (right.confidence !== left.confidence) {
|
|
21272
|
+
return right.confidence - left.confidence;
|
|
21273
|
+
}
|
|
21274
|
+
return right.configured.length - left.configured.length;
|
|
21275
|
+
});
|
|
21276
|
+
if (!best) {
|
|
21277
|
+
throw new Error("No voice readiness profiles are available.");
|
|
21278
|
+
}
|
|
21279
|
+
return {
|
|
21280
|
+
confidence: best.confidence,
|
|
21281
|
+
missing: best.missing,
|
|
21282
|
+
profile: best.profile,
|
|
21283
|
+
reasons: best.reasons,
|
|
21284
|
+
scores
|
|
21285
|
+
};
|
|
21286
|
+
};
|
|
21188
21287
|
// src/opsConsoleRoutes.ts
|
|
21189
21288
|
import { Elysia as Elysia34 } from "elysia";
|
|
21190
21289
|
var DEFAULT_LINKS = [
|
|
@@ -24000,6 +24099,7 @@ export {
|
|
|
24000
24099
|
recordVoiceOperatorAuditEvent,
|
|
24001
24100
|
recordVoiceHandoffAuditEvent,
|
|
24002
24101
|
recordVoiceAuditEvent,
|
|
24102
|
+
recommendVoiceReadinessProfile,
|
|
24003
24103
|
pruneVoiceTraceEvents,
|
|
24004
24104
|
parseVoiceTelephonyWebhookEvent,
|
|
24005
24105
|
matchesVoiceOpsTaskAssignmentRule,
|
|
@@ -17,4 +17,19 @@ export type VoiceReadinessProfileOptions = {
|
|
|
17
17
|
traceDeliveries?: VoiceProductionReadinessTraceDeliveryOptions;
|
|
18
18
|
};
|
|
19
19
|
export type VoiceReadinessProfileRoutesOptions = Partial<Omit<VoiceProductionReadinessRoutesOptions, 'store'>>;
|
|
20
|
+
export type VoiceReadinessProfileRecommendationScore = {
|
|
21
|
+
configured: string[];
|
|
22
|
+
confidence: number;
|
|
23
|
+
missing: string[];
|
|
24
|
+
profile: VoiceReadinessProfileName;
|
|
25
|
+
reasons: string[];
|
|
26
|
+
};
|
|
27
|
+
export type VoiceReadinessProfileRecommendation = {
|
|
28
|
+
confidence: number;
|
|
29
|
+
missing: string[];
|
|
30
|
+
profile: VoiceReadinessProfileName;
|
|
31
|
+
reasons: string[];
|
|
32
|
+
scores: VoiceReadinessProfileRecommendationScore[];
|
|
33
|
+
};
|
|
20
34
|
export declare const createVoiceReadinessProfile: (profile: VoiceReadinessProfileName, options?: VoiceReadinessProfileOptions) => VoiceReadinessProfileRoutesOptions;
|
|
35
|
+
export declare const recommendVoiceReadinessProfile: (options: VoiceReadinessProfileOptions) => VoiceReadinessProfileRecommendation;
|