@absolutejs/voice 0.0.22-beta.253 → 0.0.22-beta.255
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.
|
@@ -65,5 +65,34 @@ export type VoiceAgentSquadContractRunOptions<TContext = unknown, TSession exten
|
|
|
65
65
|
squad: VoiceAgent<TContext, TSession, TResult>;
|
|
66
66
|
trace?: VoiceTraceEventStore;
|
|
67
67
|
};
|
|
68
|
+
export type VoiceAgentSquadContractAssertionInput = {
|
|
69
|
+
maxBlockedHandoffs?: number;
|
|
70
|
+
maxFailed?: number;
|
|
71
|
+
maxIssues?: number;
|
|
72
|
+
minContracts?: number;
|
|
73
|
+
minHandoffs?: number;
|
|
74
|
+
requiredContractIds?: string[];
|
|
75
|
+
requiredFinalAgentIds?: string[];
|
|
76
|
+
requiredHandoffStatuses?: VoiceAgentSquadHandoffStatus[];
|
|
77
|
+
requiredHandoffTargets?: string[];
|
|
78
|
+
requiredScenarioIds?: string[];
|
|
79
|
+
};
|
|
80
|
+
export type VoiceAgentSquadContractAssertionReport = {
|
|
81
|
+
blockedHandoffs: number;
|
|
82
|
+
contractIds: string[];
|
|
83
|
+
failed: number;
|
|
84
|
+
finalAgentIds: string[];
|
|
85
|
+
handoffStatuses: VoiceAgentSquadHandoffStatus[];
|
|
86
|
+
handoffTargets: string[];
|
|
87
|
+
handoffs: number;
|
|
88
|
+
issues: string[];
|
|
89
|
+
issueCount: number;
|
|
90
|
+
ok: boolean;
|
|
91
|
+
passed: number;
|
|
92
|
+
scenarioIds: string[];
|
|
93
|
+
total: number;
|
|
94
|
+
};
|
|
68
95
|
export declare const runVoiceAgentSquadContract: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoiceAgentSquadContractRunOptions<TContext, TSession, TResult>) => Promise<VoiceAgentSquadContractReport<TResult>>;
|
|
69
96
|
export declare const assertVoiceAgentSquadContract: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoiceAgentSquadContractRunOptions<TContext, TSession, TResult>) => Promise<VoiceAgentSquadContractReport<TResult>>;
|
|
97
|
+
export declare const evaluateVoiceAgentSquadContractEvidence: (reports: readonly VoiceAgentSquadContractReport[], input?: VoiceAgentSquadContractAssertionInput) => VoiceAgentSquadContractAssertionReport;
|
|
98
|
+
export declare const assertVoiceAgentSquadContractEvidence: (reports: readonly VoiceAgentSquadContractReport[], input?: VoiceAgentSquadContractAssertionInput) => VoiceAgentSquadContractAssertionReport;
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { createVoiceSimulationSuiteRoutes, renderVoiceSimulationSuiteHTML, runVo
|
|
|
32
32
|
export { createVoiceWorkflowContract, createVoiceWorkflowContractHandler, createVoiceWorkflowContractPreset, createVoiceWorkflowScenario, recordVoiceWorkflowContractTrace, validateVoiceWorkflowRouteResult } from './workflowContract';
|
|
33
33
|
export { createVoiceSessionListRoutes, createVoiceSessionReplayHTMLHandler, createVoiceSessionReplayJSONHandler, createVoiceSessionReplayRoutes, createVoiceSessionsHTMLHandler, createVoiceSessionsJSONHandler, renderVoiceSessionsHTML, summarizeVoiceProviderFallbackRecovery, summarizeVoiceSessions, summarizeVoiceSessionReplay } from './sessionReplay';
|
|
34
34
|
export { createVoiceAgent, createVoiceAgentSquad, createVoiceAgentTool } from './agent';
|
|
35
|
-
export { assertVoiceAgentSquadContract, runVoiceAgentSquadContract } from './agentSquadContract';
|
|
35
|
+
export { assertVoiceAgentSquadContractEvidence, assertVoiceAgentSquadContract, evaluateVoiceAgentSquadContractEvidence, runVoiceAgentSquadContract } from './agentSquadContract';
|
|
36
36
|
export { createVoiceToolIdempotencyKey, createVoiceToolRuntime } from './toolRuntime';
|
|
37
37
|
export { createVoiceToolContract, createVoiceToolContractHTMLHandler, createVoiceToolContractJSONHandler, createVoiceToolContractRoutes, createVoiceToolRuntimeContractDefaults, renderVoiceToolContractHTML, runVoiceToolContractSuite, runVoiceToolContract } from './toolContract';
|
|
38
38
|
export { createVoiceTurnLatencyHTMLHandler, createVoiceTurnLatencyJSONHandler, createVoiceTurnLatencyRoutes, renderVoiceTurnLatencyHTML, summarizeVoiceTurnLatency } from './turnLatency';
|
|
@@ -49,12 +49,12 @@ export { createOpenAIRealtimeAdapter } from './openaiRealtime';
|
|
|
49
49
|
export { createOpenAIVoiceTTS } from './openaiTTS';
|
|
50
50
|
export { createVoiceProviderHealthHTMLHandler, createVoiceProviderHealthJSONHandler, createVoiceProviderHealthRoutes, renderVoiceProviderHealthHTML, summarizeVoiceProviderHealth } from './providerHealth';
|
|
51
51
|
export { createVoiceProviderCapabilityHTMLHandler, createVoiceProviderCapabilityJSONHandler, createVoiceProviderCapabilityRoutes, renderVoiceProviderCapabilityHTML, summarizeVoiceProviderCapabilities } from './providerCapabilities';
|
|
52
|
-
export { assertVoiceProviderRoutingContract, runVoiceProviderRoutingContract } from './providerRoutingContract';
|
|
52
|
+
export { assertVoiceProviderRoutingContractEvidence, assertVoiceProviderRoutingContract, evaluateVoiceProviderRoutingContractEvidence, runVoiceProviderRoutingContract } from './providerRoutingContract';
|
|
53
53
|
export { assertVoiceProviderSloEvidence, buildVoiceProviderSloReport, createVoiceProviderSloRoutes, evaluateVoiceProviderSloEvidence, renderVoiceProviderSloHTML, renderVoiceProviderSloMarkdown } from './providerSlo';
|
|
54
54
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
55
55
|
export { assertVoiceProductionReadinessEvidence, buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, evaluateVoiceProductionReadinessEvidence, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
56
56
|
export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
|
|
57
|
-
export { buildVoiceProviderContractMatrix, createVoiceProviderContractMatrixHTMLHandler, createVoiceProviderContractMatrixJSONHandler, createVoiceProviderContractMatrixPreset, createVoiceProviderContractMatrixRoutes, evaluateVoiceProviderStackGaps, renderVoiceProviderContractMatrixHTML, recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
57
|
+
export { assertVoiceProviderContractMatrixEvidence, assertVoiceProviderStackEvidence, buildVoiceProviderContractMatrix, createVoiceProviderContractMatrixHTMLHandler, createVoiceProviderContractMatrixJSONHandler, createVoiceProviderContractMatrixPreset, createVoiceProviderContractMatrixRoutes, evaluateVoiceProviderContractMatrixEvidence, evaluateVoiceProviderStackEvidence, evaluateVoiceProviderStackGaps, renderVoiceProviderContractMatrixHTML, recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
58
58
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
59
59
|
export { assertVoiceOperationsRecordGuardrails, buildVoiceOperationsRecord, createVoiceOperationsRecordRoutes, evaluateVoiceOperationsRecordGuardrails, renderVoiceOperationsRecordGuardrailMarkdown, renderVoiceOperationsRecordHTML, renderVoiceOperationsRecordIncidentMarkdown } from './operationsRecord';
|
|
60
60
|
export { assertVoiceObservabilityExportDeliveryEvidence, assertVoiceObservabilityExportRecord, assertVoiceObservabilityExportReplayEvidence, buildVoiceObservabilityArtifactIndex, buildVoiceObservabilityExportDeliveryHistory, buildVoiceObservabilityExportReplayReport, buildVoiceObservabilityExport, assertVoiceObservabilityExportSchema, createVoiceObservabilityExportSchema, createVoiceFileObservabilityExportDeliveryReceiptStore, createVoiceMemoryObservabilityExportDeliveryReceiptStore, createVoiceObservabilityExportRoutes, createVoiceObservabilityExportReplayRoutes, deliverVoiceObservabilityExport, evaluateVoiceObservabilityExportDeliveryEvidence, evaluateVoiceObservabilityExportReplayEvidence, loadVoiceObservabilityExportReplaySource, replayVoiceObservabilityExport, renderVoiceObservabilityExportReplayHTML, renderVoiceObservabilityExportMarkdown, validateVoiceObservabilityExportRecord, voiceObservabilityExportSchemaId, voiceObservabilityExportSchemaVersion } from './observabilityExport';
|
|
@@ -108,7 +108,7 @@ export type { OpenAIVoiceTTSOptions, OpenAIVoiceTTSVoice } from './openaiTTS';
|
|
|
108
108
|
export type { OpenAIRealtimeAdapterOptions, OpenAIRealtimeModel, OpenAIRealtimeNoiseReduction, OpenAIRealtimeResponseMode, OpenAIRealtimeTranscriptionModel, OpenAIRealtimeVoice } from './openaiRealtime';
|
|
109
109
|
export type { VoiceProviderHealthStatus, VoiceProviderHealthSummary, VoiceProviderHealthSummaryOptions } from './providerHealth';
|
|
110
110
|
export type { VoiceProviderCapabilityDefinition, VoiceProviderCapabilityHandlerOptions, VoiceProviderCapabilityHTMLHandlerOptions, VoiceProviderCapabilityKind, VoiceProviderCapabilityOptions, VoiceProviderCapabilityReport, VoiceProviderCapabilityRoutesOptions, VoiceProviderCapabilitySummary } from './providerCapabilities';
|
|
111
|
-
export type { VoiceProviderRoutingContractDefinition, VoiceProviderRoutingContractIssue, VoiceProviderRoutingContractReport, VoiceProviderRoutingContractRunOptions, VoiceProviderRoutingExpectation, VoiceProviderRoutingStatus } from './providerRoutingContract';
|
|
111
|
+
export type { VoiceProviderRoutingContractAssertionInput, VoiceProviderRoutingContractAssertionReport, VoiceProviderRoutingContractDefinition, VoiceProviderRoutingContractIssue, VoiceProviderRoutingContractReport, VoiceProviderRoutingContractRunOptions, VoiceProviderRoutingExpectation, VoiceProviderRoutingStatus } from './providerRoutingContract';
|
|
112
112
|
export type { VoiceProviderSloAssertionInput, VoiceProviderSloAssertionReport, VoiceProviderSloIssue, VoiceProviderSloKindReport, VoiceProviderSloMetric, VoiceProviderSloReport, VoiceProviderSloReportOptions, VoiceProviderSloRoutesOptions, VoiceProviderSloSessionReport, VoiceProviderSloStatus, VoiceProviderSloThresholdConfig, VoiceProviderSloThresholds } from './providerSlo';
|
|
113
113
|
export type { VoiceTurnLatencyHTMLHandlerOptions, VoiceTurnLatencyItem, VoiceTurnLatencyOptions, VoiceTurnLatencyReport, VoiceTurnLatencyRoutesOptions, VoiceTurnLatencyStage, VoiceTurnLatencyStatus } from './turnLatency';
|
|
114
114
|
export type { VoiceLiveLatencyOptions, VoiceLiveLatencyReport, VoiceLiveLatencyRoutesOptions, VoiceLiveLatencySample, VoiceLiveLatencyStatus } from './liveLatency';
|
|
@@ -122,7 +122,7 @@ export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesO
|
|
|
122
122
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
123
123
|
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessAssertionInput, VoiceProductionReadinessAssertionReport, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
124
124
|
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
125
|
-
export type { VoiceProviderStackChoice, VoiceProviderStackCapabilities, VoiceProviderStackCapabilityGap, VoiceProviderStackCapabilityGapInput, VoiceProviderStackCapabilityGapReport, VoiceProviderContractCheck, VoiceProviderContractCheckStatus, VoiceProviderContractDefinition, VoiceProviderContractMatrixHandlerOptions, VoiceProviderContractMatrixHTMLHandlerOptions, VoiceProviderContractMatrixInput, VoiceProviderContractMatrixPresetOptions, VoiceProviderContractMatrixReport, VoiceProviderContractMatrixRoutesOptions, VoiceProviderContractMatrixRow, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
|
125
|
+
export type { VoiceProviderStackChoice, VoiceProviderStackCapabilities, VoiceProviderStackCapabilityGap, VoiceProviderStackCapabilityGapInput, VoiceProviderStackCapabilityGapReport, VoiceProviderContractCheck, VoiceProviderContractCheckStatus, VoiceProviderContractDefinition, VoiceProviderContractMatrixAssertionInput, VoiceProviderContractMatrixAssertionReport, VoiceProviderContractMatrixHandlerOptions, VoiceProviderContractMatrixHTMLHandlerOptions, VoiceProviderContractMatrixInput, VoiceProviderContractMatrixPresetOptions, VoiceProviderContractMatrixReport, VoiceProviderContractMatrixRoutesOptions, VoiceProviderContractMatrixRow, VoiceProviderStackAssertionInput, VoiceProviderStackAssertionReport, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
|
126
126
|
export type { VoiceOperationsRecord, VoiceOperationsRecordAgentHandoff, VoiceOperationsRecordAuditSummary, VoiceOperationsRecordGuardrailAssertionInput, VoiceOperationsRecordGuardrailAssertionReport, VoiceOperationsRecordGuardrailDecision, VoiceOperationsRecordGuardrailFinding, VoiceOperationsRecordGuardrailSummary, VoiceOperationsRecordIntegrationEventSummary, VoiceOperationsRecordOptions, VoiceOperationsRecordOutcome, VoiceOperationsRecordProviderDecision, VoiceOperationsRecordReviewSummary, VoiceOperationsRecordRoutesOptions, VoiceOperationsRecordStatus, VoiceOperationsRecordTaskSummary, VoiceOperationsRecordTranscriptTurn, VoiceOperationsRecordTool } from './operationsRecord';
|
|
127
127
|
export type { VoiceObservabilityExportArtifact, VoiceObservabilityExportArtifactChecksum, VoiceObservabilityExportArtifactFreshness, VoiceObservabilityExportArtifactIndex, VoiceObservabilityExportArtifactIndexItem, VoiceObservabilityExportArtifactKind, VoiceObservabilityExportDeliveryAssertionInput, VoiceObservabilityExportDeliveryAssertionReport, VoiceObservabilityExportDeliverySummary, VoiceObservabilityExportDeliveryDestination, VoiceObservabilityExportDeliveryDestinationResult, VoiceObservabilityExportDeliveryHistory, VoiceObservabilityExportDeliveryOptions, VoiceObservabilityExportDeliveryReceipt, VoiceObservabilityExportDeliveryReceiptStore, VoiceObservabilityExportDeliveryReport, VoiceObservabilityExportEnvelope, VoiceObservabilityExportIssue, VoiceObservabilityExportIssueCode, VoiceObservabilityExportOptions, VoiceObservabilityExportIngestedRecordKind, VoiceObservabilityExportRedactionSummary, VoiceObservabilityExportRecordValidationOptions, VoiceObservabilityExportReplayIssue, VoiceObservabilityExportReplayIssueCode, VoiceObservabilityExportReplayAssertionInput, VoiceObservabilityExportReplayAssertionReport, VoiceObservabilityExportReplayRecords, VoiceObservabilityExportReplayReport, VoiceObservabilityExportReplayRoutesOptions, VoiceObservabilityExportReplaySource, VoiceObservabilityExportReport, VoiceObservabilityExportRoutesOptions, VoiceObservabilityExportSchema, VoiceObservabilityExportStatus, VoiceObservabilityExportValidationIssue, VoiceObservabilityExportValidationResult } from './observabilityExport';
|
|
128
128
|
export type { VoiceOpsRecoveryFailedSession, VoiceOpsRecoveryInterventionSummary, VoiceOpsRecoveryIssue, VoiceOpsRecoveryIssueCode, VoiceOpsRecoveryLinks, VoiceOpsRecoveryProviderSummary, VoiceOpsRecoveryReport, VoiceOpsRecoveryReportOptions, VoiceOpsRecoveryRoutesOptions, VoiceOpsRecoveryStatus } from './opsRecovery';
|
|
@@ -131,7 +131,7 @@ export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQua
|
|
|
131
131
|
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingKindSummary, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind, VoiceRoutingSessionSummary, VoiceRoutingSessionSummaryOptions } from './resilienceRoutes';
|
|
132
132
|
export type { VoiceIOProviderRouterEvent, VoiceIOProviderRouterOptions, VoiceIOProviderRouterPolicy, VoiceIOProviderRouterPolicyConfig, VoiceSTTProviderRouterOptions, VoiceTTSProviderRouterOptions } from './providerAdapters';
|
|
133
133
|
export type { VoiceAgent, VoiceAgentMessage, VoiceAgentMessageRole, VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput, VoiceAgentOptions, VoiceAgentRunResult, VoiceAgentSquadContextPolicyResult, VoiceAgentSquadHandoffPolicyResult, VoiceAgentSquadHandoffStatus, VoiceAgentSquadOptions, VoiceAgentSquadState, VoiceAgentSquadStateHandoff, VoiceAgentTool, VoiceAgentToolCall, VoiceAgentToolResult } from './agent';
|
|
134
|
-
export type { VoiceAgentSquadContractDefinition, VoiceAgentSquadContractIssue, VoiceAgentSquadContractOutcome, VoiceAgentSquadContractReport, VoiceAgentSquadContractRunOptions, VoiceAgentSquadContractTurn, VoiceAgentSquadContractTurnReport, VoiceAgentSquadHandoffExpectation, VoiceAgentSquadTurnExpectation } from './agentSquadContract';
|
|
134
|
+
export type { VoiceAgentSquadContractAssertionInput, VoiceAgentSquadContractAssertionReport, VoiceAgentSquadContractDefinition, VoiceAgentSquadContractIssue, VoiceAgentSquadContractOutcome, VoiceAgentSquadContractReport, VoiceAgentSquadContractRunOptions, VoiceAgentSquadContractTurn, VoiceAgentSquadContractTurnReport, VoiceAgentSquadHandoffExpectation, VoiceAgentSquadTurnExpectation } from './agentSquadContract';
|
|
135
135
|
export type { VoiceToolRetryDelay, VoiceToolRuntime, VoiceToolRuntimeExecuteInput, VoiceToolRuntimeOptions, VoiceToolRuntimeResult } from './toolRuntime';
|
|
136
136
|
export type { VoiceToolContractCase, VoiceToolContractCaseReport, VoiceToolContractDefinition, VoiceToolContractExpectation, VoiceToolContractHandlerOptions, VoiceToolContractHTMLHandlerOptions, VoiceToolContractIssue, VoiceToolContractReport, VoiceToolContractRoutesOptions, VoiceToolContractSuiteReport } from './toolContract';
|
|
137
137
|
export type { VoiceOpsRuntime, VoiceOpsRuntimeConfig, VoiceOpsRuntimeSummary, VoiceOpsRuntimeSinkWorkerConfig, VoiceOpsRuntimeTaskWorkerConfig, VoiceOpsRuntimeTickResult, VoiceOpsRuntimeWebhookWorkerConfig } from './opsRuntime';
|
package/dist/index.js
CHANGED
|
@@ -15983,6 +15983,91 @@ var assertVoiceAgentSquadContract = async (options) => {
|
|
|
15983
15983
|
}
|
|
15984
15984
|
return report;
|
|
15985
15985
|
};
|
|
15986
|
+
var evaluateVoiceAgentSquadContractEvidence = (reports, input = {}) => {
|
|
15987
|
+
const issues = [];
|
|
15988
|
+
const maxFailed = input.maxFailed ?? 0;
|
|
15989
|
+
const maxIssues = input.maxIssues ?? 0;
|
|
15990
|
+
const maxBlockedHandoffs = input.maxBlockedHandoffs ?? Infinity;
|
|
15991
|
+
const allHandoffs = reports.flatMap((report) => report.turns.flatMap((turn) => turn.handoffs));
|
|
15992
|
+
const contractIds = [...new Set(reports.map((report) => report.contractId))].sort();
|
|
15993
|
+
const scenarioIds = [
|
|
15994
|
+
...new Set(reports.map((report) => report.scenarioId).filter((scenarioId) => Boolean(scenarioId)))
|
|
15995
|
+
].sort();
|
|
15996
|
+
const finalAgentIds = [
|
|
15997
|
+
...new Set(reports.flatMap((report) => report.turns.map((turn) => turn.agentId)))
|
|
15998
|
+
].sort();
|
|
15999
|
+
const handoffTargets = [
|
|
16000
|
+
...new Set(allHandoffs.map((handoff) => handoff.targetAgentId).filter((target) => Boolean(target)))
|
|
16001
|
+
].sort();
|
|
16002
|
+
const handoffStatuses = [
|
|
16003
|
+
...new Set(allHandoffs.map((handoff) => handoff.status).filter((status) => status !== undefined))
|
|
16004
|
+
].sort();
|
|
16005
|
+
const failed = reports.filter((report) => !report.pass).length;
|
|
16006
|
+
const issueCount = reports.reduce((total, report) => total + report.issues.length, 0);
|
|
16007
|
+
const blockedHandoffs = allHandoffs.filter((handoff) => handoff.status === "blocked").length;
|
|
16008
|
+
if (input.minContracts !== undefined && reports.length < input.minContracts) {
|
|
16009
|
+
issues.push(`Expected at least ${String(input.minContracts)} agent squad contract(s), found ${String(reports.length)}.`);
|
|
16010
|
+
}
|
|
16011
|
+
if (failed > maxFailed) {
|
|
16012
|
+
issues.push(`Expected at most ${String(maxFailed)} failing agent squad contract(s), found ${String(failed)}.`);
|
|
16013
|
+
}
|
|
16014
|
+
if (issueCount > maxIssues) {
|
|
16015
|
+
issues.push(`Expected at most ${String(maxIssues)} agent squad contract issue(s), found ${String(issueCount)}.`);
|
|
16016
|
+
}
|
|
16017
|
+
if (input.minHandoffs !== undefined && allHandoffs.length < input.minHandoffs) {
|
|
16018
|
+
issues.push(`Expected at least ${String(input.minHandoffs)} agent squad handoff(s), found ${String(allHandoffs.length)}.`);
|
|
16019
|
+
}
|
|
16020
|
+
if (blockedHandoffs > maxBlockedHandoffs) {
|
|
16021
|
+
issues.push(`Expected at most ${String(maxBlockedHandoffs)} blocked agent squad handoff(s), found ${String(blockedHandoffs)}.`);
|
|
16022
|
+
}
|
|
16023
|
+
for (const contractId of input.requiredContractIds ?? []) {
|
|
16024
|
+
if (!contractIds.includes(contractId)) {
|
|
16025
|
+
issues.push(`Missing agent squad contract: ${contractId}.`);
|
|
16026
|
+
}
|
|
16027
|
+
}
|
|
16028
|
+
for (const scenarioId of input.requiredScenarioIds ?? []) {
|
|
16029
|
+
if (!scenarioIds.includes(scenarioId)) {
|
|
16030
|
+
issues.push(`Missing agent squad scenario: ${scenarioId}.`);
|
|
16031
|
+
}
|
|
16032
|
+
}
|
|
16033
|
+
for (const agentId of input.requiredFinalAgentIds ?? []) {
|
|
16034
|
+
if (!finalAgentIds.includes(agentId)) {
|
|
16035
|
+
issues.push(`Missing final agent: ${agentId}.`);
|
|
16036
|
+
}
|
|
16037
|
+
}
|
|
16038
|
+
for (const target of input.requiredHandoffTargets ?? []) {
|
|
16039
|
+
if (!handoffTargets.includes(target)) {
|
|
16040
|
+
issues.push(`Missing agent squad handoff target: ${target}.`);
|
|
16041
|
+
}
|
|
16042
|
+
}
|
|
16043
|
+
for (const status of input.requiredHandoffStatuses ?? []) {
|
|
16044
|
+
if (!handoffStatuses.includes(status)) {
|
|
16045
|
+
issues.push(`Missing agent squad handoff status: ${status}.`);
|
|
16046
|
+
}
|
|
16047
|
+
}
|
|
16048
|
+
return {
|
|
16049
|
+
blockedHandoffs,
|
|
16050
|
+
contractIds,
|
|
16051
|
+
failed,
|
|
16052
|
+
finalAgentIds,
|
|
16053
|
+
handoffStatuses,
|
|
16054
|
+
handoffTargets,
|
|
16055
|
+
handoffs: allHandoffs.length,
|
|
16056
|
+
issues,
|
|
16057
|
+
issueCount,
|
|
16058
|
+
ok: issues.length === 0,
|
|
16059
|
+
passed: reports.length - failed,
|
|
16060
|
+
scenarioIds,
|
|
16061
|
+
total: reports.length
|
|
16062
|
+
};
|
|
16063
|
+
};
|
|
16064
|
+
var assertVoiceAgentSquadContractEvidence = (reports, input = {}) => {
|
|
16065
|
+
const report = evaluateVoiceAgentSquadContractEvidence(reports, input);
|
|
16066
|
+
if (!report.ok) {
|
|
16067
|
+
throw new Error(`Voice agent squad contract evidence assertion failed: ${report.issues.join(" ")}`);
|
|
16068
|
+
}
|
|
16069
|
+
return report;
|
|
16070
|
+
};
|
|
15986
16071
|
// src/turnLatency.ts
|
|
15987
16072
|
import { Elysia as Elysia25 } from "elysia";
|
|
15988
16073
|
var DEFAULT_WARN_AFTER_MS = 1800;
|
|
@@ -22146,6 +22231,110 @@ var assertVoiceProviderRoutingContract = async (options) => {
|
|
|
22146
22231
|
}
|
|
22147
22232
|
return report;
|
|
22148
22233
|
};
|
|
22234
|
+
var evaluateVoiceProviderRoutingContractEvidence = (reports, input = {}) => {
|
|
22235
|
+
const issues = [];
|
|
22236
|
+
const maxFailed = input.maxFailed ?? 0;
|
|
22237
|
+
const maxIssues = input.maxIssues ?? 0;
|
|
22238
|
+
const events = reports.flatMap((report) => report.events);
|
|
22239
|
+
const contractIds = [...new Set(reports.map((report) => report.contractId))].sort();
|
|
22240
|
+
const scenarioIds = [
|
|
22241
|
+
...new Set(reports.map((report) => report.scenarioId).filter((scenarioId) => Boolean(scenarioId)))
|
|
22242
|
+
].sort();
|
|
22243
|
+
const kinds = [...new Set(events.map((event) => event.kind))].sort();
|
|
22244
|
+
const operations = [
|
|
22245
|
+
...new Set(events.map((event) => event.operation).filter((operation) => Boolean(operation)))
|
|
22246
|
+
].sort();
|
|
22247
|
+
const providers = [
|
|
22248
|
+
...new Set(events.map((event) => event.provider).filter((provider) => Boolean(provider)))
|
|
22249
|
+
].sort();
|
|
22250
|
+
const selectedProviders = [
|
|
22251
|
+
...new Set(events.map((event) => event.selectedProvider).filter((provider) => Boolean(provider)))
|
|
22252
|
+
].sort();
|
|
22253
|
+
const fallbackProviders = [
|
|
22254
|
+
...new Set(events.map((event) => event.fallbackProvider).filter((provider) => Boolean(provider)))
|
|
22255
|
+
].sort();
|
|
22256
|
+
const statuses = [
|
|
22257
|
+
...new Set(events.map((event) => event.status).filter((status) => status !== undefined))
|
|
22258
|
+
].sort();
|
|
22259
|
+
const failed = reports.filter((report) => !report.pass).length;
|
|
22260
|
+
const issueCount = reports.reduce((total, report) => total + report.issues.length, 0);
|
|
22261
|
+
if (input.minContracts !== undefined && reports.length < input.minContracts) {
|
|
22262
|
+
issues.push(`Expected at least ${String(input.minContracts)} provider routing contract(s), found ${String(reports.length)}.`);
|
|
22263
|
+
}
|
|
22264
|
+
if (failed > maxFailed) {
|
|
22265
|
+
issues.push(`Expected at most ${String(maxFailed)} failing provider routing contract(s), found ${String(failed)}.`);
|
|
22266
|
+
}
|
|
22267
|
+
if (issueCount > maxIssues) {
|
|
22268
|
+
issues.push(`Expected at most ${String(maxIssues)} provider routing contract issue(s), found ${String(issueCount)}.`);
|
|
22269
|
+
}
|
|
22270
|
+
if (input.minEvents !== undefined && events.length < input.minEvents) {
|
|
22271
|
+
issues.push(`Expected at least ${String(input.minEvents)} provider routing event(s), found ${String(events.length)}.`);
|
|
22272
|
+
}
|
|
22273
|
+
for (const contractId of input.requiredContractIds ?? []) {
|
|
22274
|
+
if (!contractIds.includes(contractId)) {
|
|
22275
|
+
issues.push(`Missing provider routing contract: ${contractId}.`);
|
|
22276
|
+
}
|
|
22277
|
+
}
|
|
22278
|
+
for (const scenarioId of input.requiredScenarioIds ?? []) {
|
|
22279
|
+
if (!scenarioIds.includes(scenarioId)) {
|
|
22280
|
+
issues.push(`Missing provider routing scenario: ${scenarioId}.`);
|
|
22281
|
+
}
|
|
22282
|
+
}
|
|
22283
|
+
for (const kind of input.requiredKinds ?? []) {
|
|
22284
|
+
if (!kinds.includes(kind)) {
|
|
22285
|
+
issues.push(`Missing provider routing kind: ${kind}.`);
|
|
22286
|
+
}
|
|
22287
|
+
}
|
|
22288
|
+
for (const operation of input.requiredOperations ?? []) {
|
|
22289
|
+
if (!operations.includes(operation)) {
|
|
22290
|
+
issues.push(`Missing provider routing operation: ${operation}.`);
|
|
22291
|
+
}
|
|
22292
|
+
}
|
|
22293
|
+
for (const provider of input.requiredProviders ?? []) {
|
|
22294
|
+
if (!providers.includes(provider)) {
|
|
22295
|
+
issues.push(`Missing provider routing provider: ${provider}.`);
|
|
22296
|
+
}
|
|
22297
|
+
}
|
|
22298
|
+
for (const provider of input.requiredSelectedProviders ?? []) {
|
|
22299
|
+
if (!selectedProviders.includes(provider)) {
|
|
22300
|
+
issues.push(`Missing selected provider: ${provider}.`);
|
|
22301
|
+
}
|
|
22302
|
+
}
|
|
22303
|
+
for (const provider of input.requiredFallbackProviders ?? []) {
|
|
22304
|
+
if (!fallbackProviders.includes(provider)) {
|
|
22305
|
+
issues.push(`Missing fallback provider: ${provider}.`);
|
|
22306
|
+
}
|
|
22307
|
+
}
|
|
22308
|
+
for (const status of input.requiredStatuses ?? []) {
|
|
22309
|
+
if (!statuses.includes(status)) {
|
|
22310
|
+
issues.push(`Missing provider routing status: ${status}.`);
|
|
22311
|
+
}
|
|
22312
|
+
}
|
|
22313
|
+
return {
|
|
22314
|
+
contractIds,
|
|
22315
|
+
events: events.length,
|
|
22316
|
+
failed,
|
|
22317
|
+
fallbackProviders,
|
|
22318
|
+
issues,
|
|
22319
|
+
issueCount,
|
|
22320
|
+
kinds,
|
|
22321
|
+
ok: issues.length === 0,
|
|
22322
|
+
operations,
|
|
22323
|
+
passed: reports.length - failed,
|
|
22324
|
+
providers,
|
|
22325
|
+
scenarioIds,
|
|
22326
|
+
selectedProviders,
|
|
22327
|
+
statuses,
|
|
22328
|
+
total: reports.length
|
|
22329
|
+
};
|
|
22330
|
+
};
|
|
22331
|
+
var assertVoiceProviderRoutingContractEvidence = (reports, input = {}) => {
|
|
22332
|
+
const report = evaluateVoiceProviderRoutingContractEvidence(reports, input);
|
|
22333
|
+
if (!report.ok) {
|
|
22334
|
+
throw new Error(`Voice provider routing contract evidence assertion failed: ${report.issues.join(" ")}`);
|
|
22335
|
+
}
|
|
22336
|
+
return report;
|
|
22337
|
+
};
|
|
22149
22338
|
// src/providerSlo.ts
|
|
22150
22339
|
import { Elysia as Elysia37 } from "elysia";
|
|
22151
22340
|
var defaultThresholds = {
|
|
@@ -26730,6 +26919,12 @@ var recommendVoiceProviderStack = (input) => {
|
|
|
26730
26919
|
};
|
|
26731
26920
|
};
|
|
26732
26921
|
var rollupContractStatus = (checks) => checks.some((check) => check.status === "fail") ? "fail" : checks.some((check) => check.status === "warn") ? "warn" : "pass";
|
|
26922
|
+
var statusRank2 = {
|
|
26923
|
+
pass: 0,
|
|
26924
|
+
warn: 1,
|
|
26925
|
+
fail: 2
|
|
26926
|
+
};
|
|
26927
|
+
var statusExceeds = (actual, max) => statusRank2[actual] > statusRank2[max];
|
|
26733
26928
|
var buildVoiceProviderContractMatrix = (input) => {
|
|
26734
26929
|
const rows = input.contracts.map((contract) => {
|
|
26735
26930
|
const configured = contract.configured !== false;
|
|
@@ -26830,6 +27025,76 @@ var buildVoiceProviderContractMatrix = (input) => {
|
|
|
26830
27025
|
warned
|
|
26831
27026
|
};
|
|
26832
27027
|
};
|
|
27028
|
+
var evaluateVoiceProviderContractMatrixEvidence = (report, input = {}) => {
|
|
27029
|
+
const issues = [];
|
|
27030
|
+
const maxStatus = input.maxStatus ?? "pass";
|
|
27031
|
+
const maxFailed = input.maxFailed ?? 0;
|
|
27032
|
+
const maxWarned = input.maxWarned ?? 0;
|
|
27033
|
+
const minRows = input.minRows ?? 1;
|
|
27034
|
+
const requireAllSelected = input.requireAllSelected ?? false;
|
|
27035
|
+
const kinds = [...new Set(report.rows.map((row) => row.kind))].sort();
|
|
27036
|
+
const providers = [...new Set(report.rows.map((row) => row.provider))].sort();
|
|
27037
|
+
const selectedKinds = [
|
|
27038
|
+
...new Set(report.rows.filter((row) => row.selected).map((row) => row.kind))
|
|
27039
|
+
].sort();
|
|
27040
|
+
if (statusExceeds(report.status, maxStatus)) {
|
|
27041
|
+
issues.push(`Expected provider contract matrix status at most ${maxStatus}, found ${report.status}.`);
|
|
27042
|
+
}
|
|
27043
|
+
if (report.failed > maxFailed) {
|
|
27044
|
+
issues.push(`Expected at most ${String(maxFailed)} failing provider contract row(s), found ${String(report.failed)}.`);
|
|
27045
|
+
}
|
|
27046
|
+
if (report.warned > maxWarned) {
|
|
27047
|
+
issues.push(`Expected at most ${String(maxWarned)} warning provider contract row(s), found ${String(report.warned)}.`);
|
|
27048
|
+
}
|
|
27049
|
+
if (report.total < minRows) {
|
|
27050
|
+
issues.push(`Expected at least ${String(minRows)} provider contract row(s), found ${String(report.total)}.`);
|
|
27051
|
+
}
|
|
27052
|
+
for (const kind of input.requiredKinds ?? []) {
|
|
27053
|
+
if (!kinds.includes(kind)) {
|
|
27054
|
+
issues.push(`Missing provider contract kind: ${kind}.`);
|
|
27055
|
+
}
|
|
27056
|
+
}
|
|
27057
|
+
for (const provider of input.requiredProviders ?? []) {
|
|
27058
|
+
if (!providers.includes(provider)) {
|
|
27059
|
+
issues.push(`Missing provider contract provider: ${provider}.`);
|
|
27060
|
+
}
|
|
27061
|
+
}
|
|
27062
|
+
for (const kind of input.selectedKinds ?? []) {
|
|
27063
|
+
if (!selectedKinds.includes(kind)) {
|
|
27064
|
+
issues.push(`Missing selected provider contract kind: ${kind}.`);
|
|
27065
|
+
}
|
|
27066
|
+
}
|
|
27067
|
+
for (const key of input.requiredCheckKeys ?? []) {
|
|
27068
|
+
const missingRows = report.rows.filter((row) => !row.checks.some((check) => check.key === key)).length;
|
|
27069
|
+
if (missingRows > 0) {
|
|
27070
|
+
issues.push(`Provider contract check ${key} is missing from ${String(missingRows)} row(s).`);
|
|
27071
|
+
}
|
|
27072
|
+
}
|
|
27073
|
+
if (requireAllSelected) {
|
|
27074
|
+
const unselected = report.rows.filter((row) => !row.selected).length;
|
|
27075
|
+
if (unselected > 0) {
|
|
27076
|
+
issues.push(`Expected every provider contract row to be selected, found ${String(unselected)} unselected row(s).`);
|
|
27077
|
+
}
|
|
27078
|
+
}
|
|
27079
|
+
return {
|
|
27080
|
+
failed: report.failed,
|
|
27081
|
+
issues,
|
|
27082
|
+
kinds,
|
|
27083
|
+
ok: issues.length === 0,
|
|
27084
|
+
providers,
|
|
27085
|
+
selectedKinds,
|
|
27086
|
+
status: report.status,
|
|
27087
|
+
total: report.total,
|
|
27088
|
+
warned: report.warned
|
|
27089
|
+
};
|
|
27090
|
+
};
|
|
27091
|
+
var assertVoiceProviderContractMatrixEvidence = (report, input = {}) => {
|
|
27092
|
+
const assertion = evaluateVoiceProviderContractMatrixEvidence(report, input);
|
|
27093
|
+
if (!assertion.ok) {
|
|
27094
|
+
throw new Error(`Voice provider contract matrix assertion failed: ${assertion.issues.join(" ")}`);
|
|
27095
|
+
}
|
|
27096
|
+
return assertion;
|
|
27097
|
+
};
|
|
26833
27098
|
var createVoiceProviderContractMatrixPreset = (profile, options) => {
|
|
26834
27099
|
const contracts = ["llm", "stt", "tts"].flatMap((kind) => {
|
|
26835
27100
|
const providers = options.providers[kind] ?? [];
|
|
@@ -26965,6 +27230,65 @@ var evaluateVoiceProviderStackGaps = (input) => {
|
|
|
26965
27230
|
status: gaps.some((gap) => gap.status === "fail") ? "fail" : gaps.some((gap) => gap.status === "warn") ? "warn" : "pass"
|
|
26966
27231
|
};
|
|
26967
27232
|
};
|
|
27233
|
+
var evaluateVoiceProviderStackEvidence = (report, input = {}) => {
|
|
27234
|
+
const issues = [];
|
|
27235
|
+
const maxStatus = input.maxStatus ?? "pass";
|
|
27236
|
+
const maxMissing = input.maxMissing ?? 0;
|
|
27237
|
+
const requireProviders = input.requireProviders ?? true;
|
|
27238
|
+
const kinds = [...new Set(report.gaps.map((gap) => gap.kind))].sort();
|
|
27239
|
+
const providers = [
|
|
27240
|
+
...new Set(report.gaps.map((gap) => gap.provider).filter((provider) => provider !== undefined))
|
|
27241
|
+
].sort();
|
|
27242
|
+
if (statusExceeds(report.status, maxStatus)) {
|
|
27243
|
+
issues.push(`Expected provider stack status at most ${maxStatus}, found ${report.status}.`);
|
|
27244
|
+
}
|
|
27245
|
+
if (report.missing > maxMissing) {
|
|
27246
|
+
issues.push(`Expected at most ${String(maxMissing)} missing provider stack capability/capabilities, found ${String(report.missing)}.`);
|
|
27247
|
+
}
|
|
27248
|
+
for (const kind of input.requiredKinds ?? []) {
|
|
27249
|
+
if (!kinds.includes(kind)) {
|
|
27250
|
+
issues.push(`Missing provider stack kind: ${kind}.`);
|
|
27251
|
+
}
|
|
27252
|
+
}
|
|
27253
|
+
for (const provider of input.requiredProviders ?? []) {
|
|
27254
|
+
if (!providers.includes(provider)) {
|
|
27255
|
+
issues.push(`Missing provider stack provider: ${provider}.`);
|
|
27256
|
+
}
|
|
27257
|
+
}
|
|
27258
|
+
for (const [kind, capabilities] of Object.entries(input.requiredCapabilities ?? {})) {
|
|
27259
|
+
const gap = report.gaps.find((entry) => entry.kind === kind);
|
|
27260
|
+
if (!gap) {
|
|
27261
|
+
issues.push(`Missing provider stack kind: ${kind}.`);
|
|
27262
|
+
continue;
|
|
27263
|
+
}
|
|
27264
|
+
for (const capability of capabilities) {
|
|
27265
|
+
if (!includesCapability(gap.present, capability)) {
|
|
27266
|
+
issues.push(`Missing provider stack capability for ${kind}: ${capability}.`);
|
|
27267
|
+
}
|
|
27268
|
+
}
|
|
27269
|
+
}
|
|
27270
|
+
if (requireProviders) {
|
|
27271
|
+
const missingProviders = report.gaps.filter((gap) => !gap.provider).map((gap) => gap.kind);
|
|
27272
|
+
if (missingProviders.length > 0) {
|
|
27273
|
+
issues.push(`Missing provider stack provider for kind(s): ${missingProviders.join(", ")}.`);
|
|
27274
|
+
}
|
|
27275
|
+
}
|
|
27276
|
+
return {
|
|
27277
|
+
issues,
|
|
27278
|
+
kinds,
|
|
27279
|
+
missing: report.missing,
|
|
27280
|
+
ok: issues.length === 0,
|
|
27281
|
+
providers,
|
|
27282
|
+
status: report.status
|
|
27283
|
+
};
|
|
27284
|
+
};
|
|
27285
|
+
var assertVoiceProviderStackEvidence = (report, input = {}) => {
|
|
27286
|
+
const assertion = evaluateVoiceProviderStackEvidence(report, input);
|
|
27287
|
+
if (!assertion.ok) {
|
|
27288
|
+
throw new Error(`Voice provider stack assertion failed: ${assertion.issues.join(" ")}`);
|
|
27289
|
+
}
|
|
27290
|
+
return assertion;
|
|
27291
|
+
};
|
|
26968
27292
|
// src/opsConsoleRoutes.ts
|
|
26969
27293
|
import { Elysia as Elysia44 } from "elysia";
|
|
26970
27294
|
var DEFAULT_LINKS = [
|
|
@@ -30374,7 +30698,10 @@ export {
|
|
|
30374
30698
|
evaluateVoiceTelephonyContract,
|
|
30375
30699
|
evaluateVoiceQuality,
|
|
30376
30700
|
evaluateVoiceProviderStackGaps,
|
|
30701
|
+
evaluateVoiceProviderStackEvidence,
|
|
30377
30702
|
evaluateVoiceProviderSloEvidence,
|
|
30703
|
+
evaluateVoiceProviderRoutingContractEvidence,
|
|
30704
|
+
evaluateVoiceProviderContractMatrixEvidence,
|
|
30378
30705
|
evaluateVoiceProofTrendEvidence,
|
|
30379
30706
|
evaluateVoiceProductionReadinessEvidence,
|
|
30380
30707
|
evaluateVoicePlatformCoverage,
|
|
@@ -30382,6 +30709,7 @@ export {
|
|
|
30382
30709
|
evaluateVoiceObservabilityExportReplayEvidence,
|
|
30383
30710
|
evaluateVoiceObservabilityExportDeliveryEvidence,
|
|
30384
30711
|
evaluateVoiceGuardrailPolicy,
|
|
30712
|
+
evaluateVoiceAgentSquadContractEvidence,
|
|
30385
30713
|
encodeTwilioMulawBase64,
|
|
30386
30714
|
deliverVoiceTraceEventsToSinks,
|
|
30387
30715
|
deliverVoiceObservabilityExport,
|
|
@@ -30693,8 +31021,11 @@ export {
|
|
|
30693
31021
|
buildVoiceAuditDeliveryReport,
|
|
30694
31022
|
buildEmptyVoiceProofTrendReport,
|
|
30695
31023
|
assignVoiceOpsTask,
|
|
31024
|
+
assertVoiceProviderStackEvidence,
|
|
30696
31025
|
assertVoiceProviderSloEvidence,
|
|
31026
|
+
assertVoiceProviderRoutingContractEvidence,
|
|
30697
31027
|
assertVoiceProviderRoutingContract,
|
|
31028
|
+
assertVoiceProviderContractMatrixEvidence,
|
|
30698
31029
|
assertVoiceProofTrendEvidence,
|
|
30699
31030
|
assertVoiceProductionReadinessEvidence,
|
|
30700
31031
|
assertVoicePlatformCoverage,
|
|
@@ -30704,6 +31035,7 @@ export {
|
|
|
30704
31035
|
assertVoiceObservabilityExportRecord,
|
|
30705
31036
|
assertVoiceObservabilityExportDeliveryEvidence,
|
|
30706
31037
|
assertVoiceLatencySLOGate,
|
|
31038
|
+
assertVoiceAgentSquadContractEvidence,
|
|
30707
31039
|
assertVoiceAgentSquadContract,
|
|
30708
31040
|
applyVoiceTelephonyOutcome,
|
|
30709
31041
|
applyVoiceOpsTaskPolicy,
|
|
@@ -34,5 +34,38 @@ export type VoiceProviderRoutingContractRunOptions = {
|
|
|
34
34
|
events?: StoredVoiceTraceEvent[] | VoiceRoutingEvent[];
|
|
35
35
|
store?: VoiceTraceEventStore;
|
|
36
36
|
};
|
|
37
|
+
export type VoiceProviderRoutingContractAssertionInput = {
|
|
38
|
+
maxFailed?: number;
|
|
39
|
+
maxIssues?: number;
|
|
40
|
+
minContracts?: number;
|
|
41
|
+
minEvents?: number;
|
|
42
|
+
requiredContractIds?: string[];
|
|
43
|
+
requiredFallbackProviders?: string[];
|
|
44
|
+
requiredKinds?: VoiceRoutingEventKind[];
|
|
45
|
+
requiredOperations?: string[];
|
|
46
|
+
requiredProviders?: string[];
|
|
47
|
+
requiredScenarioIds?: string[];
|
|
48
|
+
requiredSelectedProviders?: string[];
|
|
49
|
+
requiredStatuses?: VoiceProviderRoutingStatus[];
|
|
50
|
+
};
|
|
51
|
+
export type VoiceProviderRoutingContractAssertionReport = {
|
|
52
|
+
contractIds: string[];
|
|
53
|
+
events: number;
|
|
54
|
+
failed: number;
|
|
55
|
+
fallbackProviders: string[];
|
|
56
|
+
issues: string[];
|
|
57
|
+
issueCount: number;
|
|
58
|
+
kinds: VoiceRoutingEventKind[];
|
|
59
|
+
ok: boolean;
|
|
60
|
+
operations: string[];
|
|
61
|
+
passed: number;
|
|
62
|
+
providers: string[];
|
|
63
|
+
scenarioIds: string[];
|
|
64
|
+
selectedProviders: string[];
|
|
65
|
+
statuses: VoiceProviderRoutingStatus[];
|
|
66
|
+
total: number;
|
|
67
|
+
};
|
|
37
68
|
export declare const runVoiceProviderRoutingContract: (options: VoiceProviderRoutingContractRunOptions) => Promise<VoiceProviderRoutingContractReport>;
|
|
38
69
|
export declare const assertVoiceProviderRoutingContract: (options: VoiceProviderRoutingContractRunOptions) => Promise<VoiceProviderRoutingContractReport>;
|
|
70
|
+
export declare const evaluateVoiceProviderRoutingContractEvidence: (reports: readonly VoiceProviderRoutingContractReport[], input?: VoiceProviderRoutingContractAssertionInput) => VoiceProviderRoutingContractAssertionReport;
|
|
71
|
+
export declare const assertVoiceProviderRoutingContractEvidence: (reports: readonly VoiceProviderRoutingContractReport[], input?: VoiceProviderRoutingContractAssertionInput) => VoiceProviderRoutingContractAssertionReport;
|
|
@@ -31,6 +31,22 @@ export type VoiceProviderStackCapabilityGapReport<TProvider extends string = str
|
|
|
31
31
|
profile: VoiceReadinessProfileName;
|
|
32
32
|
status: 'fail' | 'pass' | 'warn';
|
|
33
33
|
};
|
|
34
|
+
export type VoiceProviderStackAssertionInput<TProvider extends string = string> = {
|
|
35
|
+
maxMissing?: number;
|
|
36
|
+
maxStatus?: VoiceProviderContractCheckStatus;
|
|
37
|
+
requireProviders?: boolean;
|
|
38
|
+
requiredKinds?: VoiceProviderStackKind[];
|
|
39
|
+
requiredProviders?: TProvider[];
|
|
40
|
+
requiredCapabilities?: Partial<Record<VoiceProviderStackKind, readonly string[]>>;
|
|
41
|
+
};
|
|
42
|
+
export type VoiceProviderStackAssertionReport<TProvider extends string = string> = {
|
|
43
|
+
issues: string[];
|
|
44
|
+
kinds: VoiceProviderStackKind[];
|
|
45
|
+
missing: number;
|
|
46
|
+
ok: boolean;
|
|
47
|
+
providers: TProvider[];
|
|
48
|
+
status: VoiceProviderContractCheckStatus;
|
|
49
|
+
};
|
|
34
50
|
export type VoiceProviderStackCapabilityGapInput<TProvider extends string = string> = VoiceProviderStackInput<TProvider> & {
|
|
35
51
|
capabilities?: VoiceProviderStackCapabilities<TProvider>;
|
|
36
52
|
recommendation?: VoiceProviderStackRecommendation<TProvider>;
|
|
@@ -106,8 +122,32 @@ export type VoiceProviderContractMatrixReport<TProvider extends string = string>
|
|
|
106
122
|
total: number;
|
|
107
123
|
warned: number;
|
|
108
124
|
};
|
|
125
|
+
export type VoiceProviderContractMatrixAssertionInput<TProvider extends string = string> = {
|
|
126
|
+
maxFailed?: number;
|
|
127
|
+
maxStatus?: VoiceProviderContractCheckStatus;
|
|
128
|
+
maxWarned?: number;
|
|
129
|
+
minRows?: number;
|
|
130
|
+
requireAllSelected?: boolean;
|
|
131
|
+
requiredCheckKeys?: string[];
|
|
132
|
+
requiredKinds?: VoiceProviderStackKind[];
|
|
133
|
+
requiredProviders?: TProvider[];
|
|
134
|
+
selectedKinds?: VoiceProviderStackKind[];
|
|
135
|
+
};
|
|
136
|
+
export type VoiceProviderContractMatrixAssertionReport<TProvider extends string = string> = {
|
|
137
|
+
failed: number;
|
|
138
|
+
issues: string[];
|
|
139
|
+
kinds: VoiceProviderStackKind[];
|
|
140
|
+
ok: boolean;
|
|
141
|
+
providers: TProvider[];
|
|
142
|
+
selectedKinds: VoiceProviderStackKind[];
|
|
143
|
+
status: VoiceProviderContractCheckStatus;
|
|
144
|
+
total: number;
|
|
145
|
+
warned: number;
|
|
146
|
+
};
|
|
109
147
|
export declare const recommendVoiceProviderStack: <TProvider extends string = string>(input: VoiceProviderStackInput<TProvider>) => VoiceProviderStackRecommendation<TProvider>;
|
|
110
148
|
export declare const buildVoiceProviderContractMatrix: <TProvider extends string = string>(input: VoiceProviderContractMatrixInput<TProvider>) => VoiceProviderContractMatrixReport<TProvider>;
|
|
149
|
+
export declare const evaluateVoiceProviderContractMatrixEvidence: <TProvider extends string = string>(report: VoiceProviderContractMatrixReport<TProvider>, input?: VoiceProviderContractMatrixAssertionInput<TProvider>) => VoiceProviderContractMatrixAssertionReport<TProvider>;
|
|
150
|
+
export declare const assertVoiceProviderContractMatrixEvidence: <TProvider extends string = string>(report: VoiceProviderContractMatrixReport<TProvider>, input?: VoiceProviderContractMatrixAssertionInput<TProvider>) => VoiceProviderContractMatrixAssertionReport<TProvider>;
|
|
111
151
|
export declare const createVoiceProviderContractMatrixPreset: <TProvider extends string = string>(profile: VoiceReadinessProfileName, options: VoiceProviderContractMatrixPresetOptions<TProvider>) => VoiceProviderContractMatrixInput<TProvider>;
|
|
112
152
|
export declare const renderVoiceProviderContractMatrixHTML: <TProvider extends string = string>(report: VoiceProviderContractMatrixReport<TProvider>, options?: {
|
|
113
153
|
title?: string;
|
|
@@ -143,3 +183,5 @@ export declare const createVoiceProviderContractMatrixRoutes: <TProvider extends
|
|
|
143
183
|
response: {};
|
|
144
184
|
}>;
|
|
145
185
|
export declare const evaluateVoiceProviderStackGaps: <TProvider extends string = string>(input: VoiceProviderStackCapabilityGapInput<TProvider>) => VoiceProviderStackCapabilityGapReport<TProvider>;
|
|
186
|
+
export declare const evaluateVoiceProviderStackEvidence: <TProvider extends string = string>(report: VoiceProviderStackCapabilityGapReport<TProvider>, input?: VoiceProviderStackAssertionInput<TProvider>) => VoiceProviderStackAssertionReport<TProvider>;
|
|
187
|
+
export declare const assertVoiceProviderStackEvidence: <TProvider extends string = string>(report: VoiceProviderStackCapabilityGapReport<TProvider>, input?: VoiceProviderStackAssertionInput<TProvider>) => VoiceProviderStackAssertionReport<TProvider>;
|