@absolutejs/voice 0.0.22-beta.162 → 0.0.22-beta.164
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 +4 -2
- package/dist/index.js +167 -0
- package/dist/providerStackRecommendations.d.ts +18 -0
- package/dist/readinessProfiles.d.ts +15 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,8 @@ 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
|
+
export { recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
49
50
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
50
51
|
export { summarizeVoiceOpsStatus } from './opsStatus';
|
|
51
52
|
export { createVoiceOpsStatusRoutes, renderVoiceOpsStatusHTML } from './opsStatusRoutes';
|
|
@@ -104,7 +105,8 @@ export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmok
|
|
|
104
105
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
105
106
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
106
107
|
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';
|
|
108
|
+
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
109
|
+
export type { VoiceProviderStackChoice, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
|
108
110
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|
|
109
111
|
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingKindSummary, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind, VoiceRoutingSessionSummary, VoiceRoutingSessionSummaryOptions } from './resilienceRoutes';
|
|
110
112
|
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,104 @@ 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
|
+
};
|
|
21287
|
+
// src/providerStackRecommendations.ts
|
|
21288
|
+
var profileProviderPriorities = {
|
|
21289
|
+
"meeting-recorder": {
|
|
21290
|
+
llm: ["openai", "anthropic", "gemini"],
|
|
21291
|
+
stt: ["deepgram", "assemblyai", "openai"],
|
|
21292
|
+
tts: ["openai", "elevenlabs"]
|
|
21293
|
+
},
|
|
21294
|
+
"ops-heavy": {
|
|
21295
|
+
llm: ["anthropic", "openai", "gemini"],
|
|
21296
|
+
stt: ["deepgram", "assemblyai", "openai"],
|
|
21297
|
+
tts: ["openai", "elevenlabs"]
|
|
21298
|
+
},
|
|
21299
|
+
"phone-agent": {
|
|
21300
|
+
llm: ["openai", "anthropic", "gemini"],
|
|
21301
|
+
stt: ["deepgram", "assemblyai", "openai"],
|
|
21302
|
+
tts: ["openai", "elevenlabs"]
|
|
21303
|
+
}
|
|
21304
|
+
};
|
|
21305
|
+
var profileProviderReasons = {
|
|
21306
|
+
"meeting-recorder": {
|
|
21307
|
+
llm: "meeting-recorder favors strong summarization and extraction quality",
|
|
21308
|
+
stt: "meeting-recorder favors accurate long-form transcription",
|
|
21309
|
+
tts: "meeting-recorder usually needs optional, low-friction spoken playback"
|
|
21310
|
+
},
|
|
21311
|
+
"ops-heavy": {
|
|
21312
|
+
llm: "ops-heavy deployments favor dependable reasoning for review and escalation flows",
|
|
21313
|
+
stt: "ops-heavy deployments keep STT recommendation available for live proof surfaces",
|
|
21314
|
+
tts: "ops-heavy deployments keep TTS recommendation available for operator demos"
|
|
21315
|
+
},
|
|
21316
|
+
"phone-agent": {
|
|
21317
|
+
llm: "phone-agent favors low-latency turn handling and tool orchestration",
|
|
21318
|
+
stt: "phone-agent favors low-latency realtime transcription",
|
|
21319
|
+
tts: "phone-agent favors low-latency spoken response"
|
|
21320
|
+
}
|
|
21321
|
+
};
|
|
21322
|
+
var chooseProvider = (available, priorities) => priorities.find((provider) => available.includes(provider)) ?? available[0];
|
|
21323
|
+
var recommendVoiceProviderStack = (input) => {
|
|
21324
|
+
const priorities = profileProviderPriorities[input.profile];
|
|
21325
|
+
const stacks = {};
|
|
21326
|
+
const recommended = {};
|
|
21327
|
+
const reasons = [];
|
|
21328
|
+
for (const kind of ["llm", "stt", "tts"]) {
|
|
21329
|
+
const available = input.providers[kind] ?? [];
|
|
21330
|
+
const provider = chooseProvider(available, priorities[kind]);
|
|
21331
|
+
const alternatives = provider ? available.filter((candidate) => candidate !== provider) : [...available];
|
|
21332
|
+
const kindReasons = [
|
|
21333
|
+
profileProviderReasons[input.profile][kind],
|
|
21334
|
+
provider ? `${provider} is the recommended ${kind.toUpperCase()} provider from the configured set` : `no ${kind.toUpperCase()} providers are configured`
|
|
21335
|
+
];
|
|
21336
|
+
if (provider) {
|
|
21337
|
+
recommended[kind] = provider;
|
|
21338
|
+
}
|
|
21339
|
+
stacks[kind] = {
|
|
21340
|
+
alternatives,
|
|
21341
|
+
provider,
|
|
21342
|
+
reasons: kindReasons
|
|
21343
|
+
};
|
|
21344
|
+
reasons.push(...kindReasons);
|
|
21345
|
+
}
|
|
21346
|
+
return {
|
|
21347
|
+
profile: input.profile,
|
|
21348
|
+
reasons,
|
|
21349
|
+
recommended,
|
|
21350
|
+
stacks
|
|
21351
|
+
};
|
|
21352
|
+
};
|
|
21188
21353
|
// src/opsConsoleRoutes.ts
|
|
21189
21354
|
import { Elysia as Elysia34 } from "elysia";
|
|
21190
21355
|
var DEFAULT_LINKS = [
|
|
@@ -24000,6 +24165,8 @@ export {
|
|
|
24000
24165
|
recordVoiceOperatorAuditEvent,
|
|
24001
24166
|
recordVoiceHandoffAuditEvent,
|
|
24002
24167
|
recordVoiceAuditEvent,
|
|
24168
|
+
recommendVoiceReadinessProfile,
|
|
24169
|
+
recommendVoiceProviderStack,
|
|
24003
24170
|
pruneVoiceTraceEvents,
|
|
24004
24171
|
parseVoiceTelephonyWebhookEvent,
|
|
24005
24172
|
matchesVoiceOpsTaskAssignmentRule,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VoiceReadinessProfileName } from './readinessProfiles';
|
|
2
|
+
export type VoiceProviderStackKind = 'llm' | 'stt' | 'tts';
|
|
3
|
+
export type VoiceProviderStackInput<TProvider extends string = string> = {
|
|
4
|
+
profile: VoiceReadinessProfileName;
|
|
5
|
+
providers: Partial<Record<VoiceProviderStackKind, readonly TProvider[]>>;
|
|
6
|
+
};
|
|
7
|
+
export type VoiceProviderStackChoice<TProvider extends string = string> = {
|
|
8
|
+
alternatives: TProvider[];
|
|
9
|
+
provider?: TProvider;
|
|
10
|
+
reasons: string[];
|
|
11
|
+
};
|
|
12
|
+
export type VoiceProviderStackRecommendation<TProvider extends string = string> = {
|
|
13
|
+
profile: VoiceReadinessProfileName;
|
|
14
|
+
reasons: string[];
|
|
15
|
+
recommended: Partial<Record<VoiceProviderStackKind, TProvider>>;
|
|
16
|
+
stacks: Partial<Record<VoiceProviderStackKind, VoiceProviderStackChoice<TProvider>>>;
|
|
17
|
+
};
|
|
18
|
+
export declare const recommendVoiceProviderStack: <TProvider extends string = string>(input: VoiceProviderStackInput<TProvider>) => VoiceProviderStackRecommendation<TProvider>;
|
|
@@ -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;
|