@absolutejs/voice 0.0.22-beta.164 → 0.0.22-beta.166
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 +173 -0
- package/dist/productionReadiness.d.ts +11 -0
- package/dist/providerStackRecommendations.d.ts +61 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { assertVoiceProviderRoutingContract, runVoiceProviderRoutingContract } f
|
|
|
46
46
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
47
47
|
export { buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
48
48
|
export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
|
|
49
|
-
export { recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
49
|
+
export { buildVoiceProviderContractMatrix, evaluateVoiceProviderStackGaps, recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
50
50
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
51
51
|
export { summarizeVoiceOpsStatus } from './opsStatus';
|
|
52
52
|
export { createVoiceOpsStatusRoutes, renderVoiceOpsStatusHTML } from './opsStatusRoutes';
|
|
@@ -106,7 +106,7 @@ export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesO
|
|
|
106
106
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
107
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';
|
|
108
108
|
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
109
|
-
export type { VoiceProviderStackChoice, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
|
109
|
+
export type { VoiceProviderStackChoice, VoiceProviderStackCapabilities, VoiceProviderStackCapabilityGap, VoiceProviderStackCapabilityGapInput, VoiceProviderStackCapabilityGapReport, VoiceProviderContractCheck, VoiceProviderContractCheckStatus, VoiceProviderContractDefinition, VoiceProviderContractMatrixInput, VoiceProviderContractMatrixReport, VoiceProviderContractMatrixRow, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
|
110
110
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|
|
111
111
|
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingKindSummary, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind, VoiceRoutingSessionSummary, VoiceRoutingSessionSummaryOptions } from './resilienceRoutes';
|
|
112
112
|
export type { VoiceIOProviderRouterEvent, VoiceIOProviderRouterOptions, VoiceIOProviderRouterPolicy, VoiceIOProviderRouterPolicyConfig, VoiceSTTProviderRouterOptions, VoiceTTSProviderRouterOptions } from './providerAdapters';
|
package/dist/index.js
CHANGED
|
@@ -20139,9 +20139,11 @@ var readinessGateCodes = {
|
|
|
20139
20139
|
"Live latency proof": "voice.readiness.live_latency",
|
|
20140
20140
|
"Operator action history": "voice.readiness.operator_action_history",
|
|
20141
20141
|
"Phone agent production smoke": "voice.readiness.phone_agent_smoke",
|
|
20142
|
+
"Provider contract matrix": "voice.readiness.provider_contract_matrix",
|
|
20142
20143
|
"Provider fallback recovery": "voice.readiness.provider_fallback_recovery",
|
|
20143
20144
|
"Provider health": "voice.readiness.provider_health",
|
|
20144
20145
|
"Provider routing contracts": "voice.readiness.provider_routing_contracts",
|
|
20146
|
+
"Provider stack capabilities": "voice.readiness.provider_stack_capabilities",
|
|
20145
20147
|
"Quality gates": "voice.readiness.quality_gates",
|
|
20146
20148
|
"Reconnect recovery contracts": "voice.readiness.reconnect_contracts",
|
|
20147
20149
|
"Routing evidence": "voice.readiness.routing_evidence",
|
|
@@ -20213,6 +20215,18 @@ var resolveProviderRoutingContracts = async (options, input) => {
|
|
|
20213
20215
|
}
|
|
20214
20216
|
return typeof options.providerRoutingContracts === "function" ? await options.providerRoutingContracts(input) : options.providerRoutingContracts;
|
|
20215
20217
|
};
|
|
20218
|
+
var resolveProviderStack = async (options, input) => {
|
|
20219
|
+
if (options.providerStack === false || options.providerStack === undefined) {
|
|
20220
|
+
return;
|
|
20221
|
+
}
|
|
20222
|
+
return typeof options.providerStack === "function" ? await options.providerStack(input) : options.providerStack;
|
|
20223
|
+
};
|
|
20224
|
+
var resolveProviderContractMatrix = async (options, input) => {
|
|
20225
|
+
if (options.providerContractMatrix === false || options.providerContractMatrix === undefined) {
|
|
20226
|
+
return;
|
|
20227
|
+
}
|
|
20228
|
+
return typeof options.providerContractMatrix === "function" ? await options.providerContractMatrix(input) : options.providerContractMatrix;
|
|
20229
|
+
};
|
|
20216
20230
|
var resolvePhoneAgentSmokes = async (options, input) => {
|
|
20217
20231
|
if (options.phoneAgentSmokes === false || options.phoneAgentSmokes === undefined) {
|
|
20218
20232
|
return;
|
|
@@ -20472,6 +20486,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20472
20486
|
carriers,
|
|
20473
20487
|
agentSquadContracts,
|
|
20474
20488
|
providerRoutingContracts,
|
|
20489
|
+
providerStack,
|
|
20490
|
+
providerContractMatrix,
|
|
20475
20491
|
phoneAgentSmokes,
|
|
20476
20492
|
reconnectContracts,
|
|
20477
20493
|
bargeInReports,
|
|
@@ -20502,6 +20518,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20502
20518
|
resolveCarriers(options, { query, request }),
|
|
20503
20519
|
resolveAgentSquadContracts(options, { query, request }),
|
|
20504
20520
|
resolveProviderRoutingContracts(options, { query, request }),
|
|
20521
|
+
resolveProviderStack(options, { query, request }),
|
|
20522
|
+
resolveProviderContractMatrix(options, { query, request }),
|
|
20505
20523
|
resolvePhoneAgentSmokes(options, { query, request }),
|
|
20506
20524
|
resolveReconnectContracts(options, { query, request }),
|
|
20507
20525
|
resolveBargeInReports(options, { query, request }),
|
|
@@ -20695,6 +20713,43 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20695
20713
|
]
|
|
20696
20714
|
});
|
|
20697
20715
|
}
|
|
20716
|
+
if (providerStack) {
|
|
20717
|
+
const missingLanes = providerStack.gaps.filter((gap) => gap.status !== "pass");
|
|
20718
|
+
checks.push({
|
|
20719
|
+
detail: providerStack.status === "pass" ? `${providerStack.profile} provider stack has declared capability coverage.` : missingLanes.length > 0 ? missingLanes.map((gap) => gap.provider ? `${gap.kind.toUpperCase()} ${gap.provider} missing ${gap.missing.join(", ")}` : `${gap.kind.toUpperCase()} provider is not configured`).join("; ") + "." : "Provider stack capability coverage needs review.",
|
|
20720
|
+
href: options.links?.providerRoutingContracts ?? options.links?.resilience ?? "/resilience",
|
|
20721
|
+
label: "Provider stack capabilities",
|
|
20722
|
+
status: providerStack.status,
|
|
20723
|
+
value: providerStack.status === "pass" ? "covered" : `${providerStack.missing} missing`,
|
|
20724
|
+
actions: providerStack.status === "pass" ? [] : [
|
|
20725
|
+
{
|
|
20726
|
+
description: "Open provider capabilities and confirm the selected stack covers this readiness profile.",
|
|
20727
|
+
href: options.links?.providerRoutingContracts ?? options.links?.resilience ?? "/resilience",
|
|
20728
|
+
label: "Open provider capabilities"
|
|
20729
|
+
}
|
|
20730
|
+
]
|
|
20731
|
+
});
|
|
20732
|
+
}
|
|
20733
|
+
if (providerContractMatrix) {
|
|
20734
|
+
const blocked = providerContractMatrix.rows.filter((row) => row.status !== "pass");
|
|
20735
|
+
checks.push({
|
|
20736
|
+
detail: providerContractMatrix.status === "pass" ? `${providerContractMatrix.passed} provider contract row(s) are production-ready.` : blocked.length > 0 ? blocked.map((row) => {
|
|
20737
|
+
const issues = row.checks.filter((check) => check.status !== "pass").map((check) => check.label).join(", ");
|
|
20738
|
+
return `${row.kind.toUpperCase()} ${row.provider}: ${issues}`;
|
|
20739
|
+
}).join("; ") + "." : "Provider contract matrix needs review.",
|
|
20740
|
+
href: options.links?.providerRoutingContracts ?? options.links?.resilience ?? "/resilience",
|
|
20741
|
+
label: "Provider contract matrix",
|
|
20742
|
+
status: providerContractMatrix.status,
|
|
20743
|
+
value: `${providerContractMatrix.passed}/${providerContractMatrix.total}`,
|
|
20744
|
+
actions: providerContractMatrix.status === "pass" ? [] : [
|
|
20745
|
+
{
|
|
20746
|
+
description: "Open provider capabilities and inspect missing env, fallback, streaming, latency, or capability contracts.",
|
|
20747
|
+
href: options.links?.providerRoutingContracts ?? options.links?.resilience ?? "/resilience",
|
|
20748
|
+
label: "Open provider matrix"
|
|
20749
|
+
}
|
|
20750
|
+
]
|
|
20751
|
+
});
|
|
20752
|
+
}
|
|
20698
20753
|
if (phoneAgentSmokeSummary) {
|
|
20699
20754
|
checks.push({
|
|
20700
20755
|
detail: phoneAgentSmokeSummary.status === "pass" ? `${phoneAgentSmokeSummary.passed} phone-agent smoke contract(s) are passing.` : phoneAgentSmokeSummary.total === 0 ? "No phone-agent production smoke contracts are configured." : `${phoneAgentSmokeSummary.failed} phone-agent production smoke contract(s) failed.`,
|
|
@@ -20889,6 +20944,8 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20889
20944
|
degraded: degradedProviders,
|
|
20890
20945
|
total: providers.length
|
|
20891
20946
|
},
|
|
20947
|
+
providerStack,
|
|
20948
|
+
providerContractMatrix,
|
|
20892
20949
|
providerRecovery,
|
|
20893
20950
|
phoneAgentSmokes: phoneAgentSmokeSummary,
|
|
20894
20951
|
providerRoutingContracts: providerRoutingContractSummary,
|
|
@@ -21319,6 +21376,23 @@ var profileProviderReasons = {
|
|
|
21319
21376
|
tts: "phone-agent favors low-latency spoken response"
|
|
21320
21377
|
}
|
|
21321
21378
|
};
|
|
21379
|
+
var profileRequiredCapabilities = {
|
|
21380
|
+
"meeting-recorder": {
|
|
21381
|
+
llm: ["JSON result shaping", "summarization"],
|
|
21382
|
+
stt: ["realtime STT", "smart formatting"],
|
|
21383
|
+
tts: ["spoken playback"]
|
|
21384
|
+
},
|
|
21385
|
+
"ops-heavy": {
|
|
21386
|
+
llm: ["tool calling", "JSON result shaping", "fallback routing"],
|
|
21387
|
+
stt: ["realtime STT"],
|
|
21388
|
+
tts: ["spoken playback"]
|
|
21389
|
+
},
|
|
21390
|
+
"phone-agent": {
|
|
21391
|
+
llm: ["tool calling", "JSON result shaping", "fallback routing"],
|
|
21392
|
+
stt: ["realtime STT", "VAD events"],
|
|
21393
|
+
tts: ["streaming speech", "barge-in friendly"]
|
|
21394
|
+
}
|
|
21395
|
+
};
|
|
21322
21396
|
var chooseProvider = (available, priorities) => priorities.find((provider) => available.includes(provider)) ?? available[0];
|
|
21323
21397
|
var recommendVoiceProviderStack = (input) => {
|
|
21324
21398
|
const priorities = profileProviderPriorities[input.profile];
|
|
@@ -21350,6 +21424,103 @@ var recommendVoiceProviderStack = (input) => {
|
|
|
21350
21424
|
stacks
|
|
21351
21425
|
};
|
|
21352
21426
|
};
|
|
21427
|
+
var rollupContractStatus = (checks) => checks.some((check) => check.status === "fail") ? "fail" : checks.some((check) => check.status === "warn") ? "warn" : "pass";
|
|
21428
|
+
var buildVoiceProviderContractMatrix = (input) => {
|
|
21429
|
+
const rows = input.contracts.map((contract) => {
|
|
21430
|
+
const configured = contract.configured !== false;
|
|
21431
|
+
const missingEnv = (contract.requiredEnv ?? []).filter((name) => !contract.env?.[name]);
|
|
21432
|
+
const missingCapabilities = (contract.requiredCapabilities ?? []).filter((capability) => !includesCapability(contract.capabilities ?? [], capability));
|
|
21433
|
+
const checks = [
|
|
21434
|
+
{
|
|
21435
|
+
detail: configured ? "Provider is configured for this deployment." : "Provider is declared but not configured.",
|
|
21436
|
+
key: "configured",
|
|
21437
|
+
label: "Configured",
|
|
21438
|
+
status: configured ? "pass" : "fail"
|
|
21439
|
+
},
|
|
21440
|
+
{
|
|
21441
|
+
detail: missingEnv.length === 0 ? "Required environment is present." : `Missing env: ${missingEnv.join(", ")}.`,
|
|
21442
|
+
key: "env",
|
|
21443
|
+
label: "Required env",
|
|
21444
|
+
status: missingEnv.length === 0 ? "pass" : "fail"
|
|
21445
|
+
},
|
|
21446
|
+
{
|
|
21447
|
+
detail: contract.latencyBudgetMs !== undefined ? `Latency budget is ${contract.latencyBudgetMs}ms.` : "No latency budget declared.",
|
|
21448
|
+
key: "latencyBudget",
|
|
21449
|
+
label: "Latency budget",
|
|
21450
|
+
status: contract.latencyBudgetMs !== undefined ? "pass" : "warn"
|
|
21451
|
+
},
|
|
21452
|
+
{
|
|
21453
|
+
detail: (contract.fallbackProviders ?? []).length > 0 ? `Fallback providers: ${contract.fallbackProviders?.join(", ")}.` : "No fallback provider declared.",
|
|
21454
|
+
key: "fallback",
|
|
21455
|
+
label: "Fallback",
|
|
21456
|
+
status: (contract.fallbackProviders ?? []).length > 0 ? "pass" : "warn"
|
|
21457
|
+
},
|
|
21458
|
+
{
|
|
21459
|
+
detail: contract.streaming ? "Streaming is supported." : "Streaming support is not declared.",
|
|
21460
|
+
key: "streaming",
|
|
21461
|
+
label: "Streaming",
|
|
21462
|
+
status: contract.streaming ? "pass" : "warn"
|
|
21463
|
+
},
|
|
21464
|
+
{
|
|
21465
|
+
detail: missingCapabilities.length === 0 ? "Required capabilities are declared." : `Missing capabilities: ${missingCapabilities.join(", ")}.`,
|
|
21466
|
+
key: "capabilities",
|
|
21467
|
+
label: "Capabilities",
|
|
21468
|
+
status: missingCapabilities.length === 0 ? "pass" : "warn"
|
|
21469
|
+
}
|
|
21470
|
+
];
|
|
21471
|
+
const status = rollupContractStatus(checks);
|
|
21472
|
+
return {
|
|
21473
|
+
checks,
|
|
21474
|
+
configured,
|
|
21475
|
+
kind: contract.kind,
|
|
21476
|
+
provider: contract.provider,
|
|
21477
|
+
selected: contract.selected === true,
|
|
21478
|
+
status
|
|
21479
|
+
};
|
|
21480
|
+
});
|
|
21481
|
+
const failed = rows.filter((row) => row.status === "fail").length;
|
|
21482
|
+
const warned = rows.filter((row) => row.status === "warn").length;
|
|
21483
|
+
return {
|
|
21484
|
+
failed,
|
|
21485
|
+
passed: rows.filter((row) => row.status === "pass").length,
|
|
21486
|
+
rows,
|
|
21487
|
+
status: failed > 0 ? "fail" : warned > 0 ? "warn" : "pass",
|
|
21488
|
+
total: rows.length,
|
|
21489
|
+
warned
|
|
21490
|
+
};
|
|
21491
|
+
};
|
|
21492
|
+
var normalizeCapability = (value) => value.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
21493
|
+
var includesCapability = (capabilities, required) => {
|
|
21494
|
+
const normalizedRequired = normalizeCapability(required);
|
|
21495
|
+
return capabilities.some((capability) => {
|
|
21496
|
+
const normalizedCapability = normalizeCapability(capability);
|
|
21497
|
+
return normalizedCapability === normalizedRequired || normalizedCapability.includes(normalizedRequired) || normalizedRequired.includes(normalizedCapability);
|
|
21498
|
+
});
|
|
21499
|
+
};
|
|
21500
|
+
var evaluateVoiceProviderStackGaps = (input) => {
|
|
21501
|
+
const recommendation = input.recommendation ?? recommendVoiceProviderStack(input);
|
|
21502
|
+
const gaps = ["llm", "stt", "tts"].map((kind) => {
|
|
21503
|
+
const required = input.required?.[kind] ?? profileRequiredCapabilities[input.profile][kind];
|
|
21504
|
+
const provider = recommendation.recommended[kind];
|
|
21505
|
+
const present = provider ? [...input.capabilities?.[kind]?.[provider] ?? []] : [];
|
|
21506
|
+
const missing2 = provider ? required.filter((capability) => !includesCapability(present, capability)) : [...required];
|
|
21507
|
+
return {
|
|
21508
|
+
kind,
|
|
21509
|
+
missing: missing2,
|
|
21510
|
+
present,
|
|
21511
|
+
provider,
|
|
21512
|
+
required: [...required],
|
|
21513
|
+
status: !provider ? "fail" : missing2.length > 0 ? "warn" : "pass"
|
|
21514
|
+
};
|
|
21515
|
+
});
|
|
21516
|
+
const missing = gaps.reduce((total, gap) => total + gap.missing.length, 0);
|
|
21517
|
+
return {
|
|
21518
|
+
gaps,
|
|
21519
|
+
missing,
|
|
21520
|
+
profile: input.profile,
|
|
21521
|
+
status: gaps.some((gap) => gap.status === "fail") ? "fail" : gaps.some((gap) => gap.status === "warn") ? "warn" : "pass"
|
|
21522
|
+
};
|
|
21523
|
+
};
|
|
21353
21524
|
// src/opsConsoleRoutes.ts
|
|
21354
21525
|
import { Elysia as Elysia34 } from "elysia";
|
|
21355
21526
|
var DEFAULT_LINKS = [
|
|
@@ -24185,6 +24356,7 @@ export {
|
|
|
24185
24356
|
evaluateVoiceTrace,
|
|
24186
24357
|
evaluateVoiceTelephonyContract,
|
|
24187
24358
|
evaluateVoiceQuality,
|
|
24359
|
+
evaluateVoiceProviderStackGaps,
|
|
24188
24360
|
encodeTwilioMulawBase64,
|
|
24189
24361
|
deliverVoiceTraceEventsToSinks,
|
|
24190
24362
|
deliverVoiceIntegrationEventToSinks,
|
|
@@ -24434,6 +24606,7 @@ export {
|
|
|
24434
24606
|
claimVoiceOpsTask,
|
|
24435
24607
|
buildVoiceTraceReplay,
|
|
24436
24608
|
buildVoiceTraceDeliveryReport,
|
|
24609
|
+
buildVoiceProviderContractMatrix,
|
|
24437
24610
|
buildVoiceProductionReadinessReport,
|
|
24438
24611
|
buildVoiceProductionReadinessGate,
|
|
24439
24612
|
buildVoiceOpsTaskFromSLABreach,
|
|
@@ -11,6 +11,7 @@ import type { VoicePhoneAgentProductionSmokeReport } from './phoneAgentProductio
|
|
|
11
11
|
import type { VoiceReconnectContractReport } from './reconnectContract';
|
|
12
12
|
import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } from './audit';
|
|
13
13
|
import { type VoiceAuditSinkDeliveryStore } from './auditSinks';
|
|
14
|
+
import type { VoiceProviderContractMatrixReport, VoiceProviderStackCapabilityGapReport } from './providerStackRecommendations';
|
|
14
15
|
export type VoiceProductionReadinessStatus = 'fail' | 'pass' | 'warn';
|
|
15
16
|
export type VoiceProductionReadinessAction = {
|
|
16
17
|
description?: string;
|
|
@@ -137,6 +138,8 @@ export type VoiceProductionReadinessReport = {
|
|
|
137
138
|
degraded: number;
|
|
138
139
|
total: number;
|
|
139
140
|
};
|
|
141
|
+
providerStack?: VoiceProviderStackCapabilityGapReport;
|
|
142
|
+
providerContractMatrix?: VoiceProviderContractMatrixReport;
|
|
140
143
|
providerRecovery: VoiceProviderFallbackRecoverySummary;
|
|
141
144
|
phoneAgentSmokes?: {
|
|
142
145
|
failed: number;
|
|
@@ -297,6 +300,14 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
297
300
|
query: Record<string, unknown>;
|
|
298
301
|
request: Request;
|
|
299
302
|
}) => Promise<readonly VoiceProviderRoutingContractReport[]> | readonly VoiceProviderRoutingContractReport[]);
|
|
303
|
+
providerStack?: false | VoiceProviderStackCapabilityGapReport | ((input: {
|
|
304
|
+
query: Record<string, unknown>;
|
|
305
|
+
request: Request;
|
|
306
|
+
}) => Promise<VoiceProviderStackCapabilityGapReport> | VoiceProviderStackCapabilityGapReport);
|
|
307
|
+
providerContractMatrix?: false | VoiceProviderContractMatrixReport | ((input: {
|
|
308
|
+
query: Record<string, unknown>;
|
|
309
|
+
request: Request;
|
|
310
|
+
}) => Promise<VoiceProviderContractMatrixReport> | VoiceProviderContractMatrixReport);
|
|
300
311
|
reconnectContracts?: false | readonly VoiceReconnectContractReport[] | ((input: {
|
|
301
312
|
query: Record<string, unknown>;
|
|
302
313
|
request: Request;
|
|
@@ -15,4 +15,65 @@ export type VoiceProviderStackRecommendation<TProvider extends string = string>
|
|
|
15
15
|
recommended: Partial<Record<VoiceProviderStackKind, TProvider>>;
|
|
16
16
|
stacks: Partial<Record<VoiceProviderStackKind, VoiceProviderStackChoice<TProvider>>>;
|
|
17
17
|
};
|
|
18
|
+
export type VoiceProviderStackCapabilities<TProvider extends string = string> = Partial<Record<VoiceProviderStackKind, Partial<Record<TProvider, readonly string[]>>>>;
|
|
19
|
+
export type VoiceProviderStackCapabilityGap<TProvider extends string = string> = {
|
|
20
|
+
kind: VoiceProviderStackKind;
|
|
21
|
+
missing: string[];
|
|
22
|
+
present: string[];
|
|
23
|
+
provider?: TProvider;
|
|
24
|
+
required: string[];
|
|
25
|
+
status: 'fail' | 'pass' | 'warn';
|
|
26
|
+
};
|
|
27
|
+
export type VoiceProviderStackCapabilityGapReport<TProvider extends string = string> = {
|
|
28
|
+
gaps: VoiceProviderStackCapabilityGap<TProvider>[];
|
|
29
|
+
missing: number;
|
|
30
|
+
profile: VoiceReadinessProfileName;
|
|
31
|
+
status: 'fail' | 'pass' | 'warn';
|
|
32
|
+
};
|
|
33
|
+
export type VoiceProviderStackCapabilityGapInput<TProvider extends string = string> = VoiceProviderStackInput<TProvider> & {
|
|
34
|
+
capabilities?: VoiceProviderStackCapabilities<TProvider>;
|
|
35
|
+
recommendation?: VoiceProviderStackRecommendation<TProvider>;
|
|
36
|
+
required?: Partial<Record<VoiceProviderStackKind, readonly string[]>>;
|
|
37
|
+
};
|
|
38
|
+
export type VoiceProviderContractCheckStatus = 'fail' | 'pass' | 'warn';
|
|
39
|
+
export type VoiceProviderContractCheck = {
|
|
40
|
+
detail?: string;
|
|
41
|
+
key: string;
|
|
42
|
+
label: string;
|
|
43
|
+
status: VoiceProviderContractCheckStatus;
|
|
44
|
+
};
|
|
45
|
+
export type VoiceProviderContractDefinition<TProvider extends string = string> = {
|
|
46
|
+
capabilities?: readonly string[];
|
|
47
|
+
configured?: boolean;
|
|
48
|
+
env?: Record<string, string | undefined>;
|
|
49
|
+
fallbackProviders?: readonly TProvider[];
|
|
50
|
+
kind: VoiceProviderStackKind;
|
|
51
|
+
latencyBudgetMs?: number;
|
|
52
|
+
provider: TProvider;
|
|
53
|
+
requiredCapabilities?: readonly string[];
|
|
54
|
+
requiredEnv?: readonly string[];
|
|
55
|
+
selected?: boolean;
|
|
56
|
+
streaming?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type VoiceProviderContractMatrixInput<TProvider extends string = string> = {
|
|
59
|
+
contracts: readonly VoiceProviderContractDefinition<TProvider>[];
|
|
60
|
+
};
|
|
61
|
+
export type VoiceProviderContractMatrixRow<TProvider extends string = string> = {
|
|
62
|
+
checks: VoiceProviderContractCheck[];
|
|
63
|
+
configured: boolean;
|
|
64
|
+
kind: VoiceProviderStackKind;
|
|
65
|
+
provider: TProvider;
|
|
66
|
+
selected: boolean;
|
|
67
|
+
status: VoiceProviderContractCheckStatus;
|
|
68
|
+
};
|
|
69
|
+
export type VoiceProviderContractMatrixReport<TProvider extends string = string> = {
|
|
70
|
+
failed: number;
|
|
71
|
+
passed: number;
|
|
72
|
+
rows: VoiceProviderContractMatrixRow<TProvider>[];
|
|
73
|
+
status: VoiceProviderContractCheckStatus;
|
|
74
|
+
total: number;
|
|
75
|
+
warned: number;
|
|
76
|
+
};
|
|
18
77
|
export declare const recommendVoiceProviderStack: <TProvider extends string = string>(input: VoiceProviderStackInput<TProvider>) => VoiceProviderStackRecommendation<TProvider>;
|
|
78
|
+
export declare const buildVoiceProviderContractMatrix: <TProvider extends string = string>(input: VoiceProviderContractMatrixInput<TProvider>) => VoiceProviderContractMatrixReport<TProvider>;
|
|
79
|
+
export declare const evaluateVoiceProviderStackGaps: <TProvider extends string = string>(input: VoiceProviderStackCapabilityGapInput<TProvider>) => VoiceProviderStackCapabilityGapReport<TProvider>;
|