@absolutejs/voice 0.0.22-beta.48 → 0.0.22-beta.480
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/README.md +4556 -603
- package/dist/agent.d.ts +67 -5
- package/dist/agentSquadContract.d.ts +98 -0
- package/dist/agentTools.d.ts +133 -0
- package/dist/aiVoiceModel.d.ts +15 -0
- package/dist/amdDetector.d.ts +25 -0
- package/dist/angular/index.d.ts +24 -4
- package/dist/angular/index.js +4147 -1164
- package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
- package/dist/angular/voice-call-debugger.service.d.ts +12 -0
- package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
- package/dist/angular/voice-controller.service.d.ts +3 -1
- package/dist/angular/voice-delivery-runtime.component.d.ts +17 -0
- package/dist/angular/voice-delivery-runtime.service.d.ts +16 -0
- package/dist/angular/voice-live-ops.service.d.ts +11 -0
- package/dist/angular/voice-ops-action-center.service.d.ts +13 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-ops-status.service.d.ts +12 -0
- package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
- package/dist/angular/voice-profile-comparison.service.d.ts +12 -0
- package/dist/angular/voice-proof-trends.service.d.ts +12 -0
- package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-contracts.service.d.ts +12 -0
- package/dist/angular/voice-provider-status.service.d.ts +2 -2
- package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
- package/dist/angular/voice-reconnect-profile-evidence.service.d.ts +12 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-session-observability.service.d.ts +12 -0
- package/dist/angular/voice-session-snapshot.service.d.ts +13 -0
- package/dist/angular/voice-stream.service.d.ts +4 -1
- package/dist/angular/voice-trace-timeline.service.d.ts +12 -0
- package/dist/angular/voice-turn-latency.service.d.ts +13 -0
- package/dist/angular/voice-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-workflow-status.service.d.ts +2 -2
- package/dist/assistant.d.ts +11 -11
- package/dist/assistantHealth.d.ts +6 -6
- package/dist/assistantMemory.d.ts +3 -3
- package/dist/audioConditioning.d.ts +1 -1
- package/dist/audit.d.ts +131 -0
- package/dist/auditDeliveryRoutes.d.ts +85 -0
- package/dist/auditExport.d.ts +34 -0
- package/dist/auditRoutes.d.ts +66 -0
- package/dist/auditSinks.d.ts +151 -0
- package/dist/bargeInRoutes.d.ts +56 -0
- package/dist/browserCallProfiles.d.ts +120 -0
- package/dist/browserMediaRoutes.d.ts +62 -0
- package/dist/callDebugger.d.ts +66 -0
- package/dist/campaign.d.ts +794 -0
- package/dist/campaignDialers.d.ts +111 -0
- package/dist/client/actions.d.ts +95 -1
- package/dist/client/agentSquadStatus.d.ts +37 -0
- package/dist/client/agentSquadStatusWidget.d.ts +24 -0
- package/dist/client/audioPlayer.d.ts +2 -2
- package/dist/client/bargeInMonitor.d.ts +7 -0
- package/dist/client/browserMedia.d.ts +8 -0
- package/dist/client/callDebugger.d.ts +19 -0
- package/dist/client/callDebuggerWidget.d.ts +30 -0
- package/dist/client/campaignDialerProof.d.ts +23 -0
- package/dist/client/connection.d.ts +4 -3
- package/dist/client/controller.d.ts +1 -1
- package/dist/client/createVoiceStream.d.ts +1 -1
- package/dist/client/deliveryRuntime.d.ts +34 -0
- package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
- package/dist/client/duplex.d.ts +2 -2
- package/dist/client/htmx.d.ts +1 -1
- package/dist/client/htmxBootstrap.js +967 -14
- package/dist/client/index.d.ts +104 -11
- package/dist/client/index.js +10215 -19
- package/dist/client/liveOps.d.ts +22 -0
- package/dist/client/liveOpsWidget.d.ts +23 -0
- package/dist/client/liveTurnLatency.d.ts +41 -0
- package/dist/client/microphone.d.ts +4 -4
- package/dist/client/opsActionCenter.d.ts +54 -0
- package/dist/client/opsActionCenterWidget.d.ts +29 -0
- package/dist/client/opsActionHistory.d.ts +19 -0
- package/dist/client/opsActionHistoryWidget.d.ts +11 -0
- package/dist/client/opsStatus.d.ts +19 -0
- package/dist/client/opsStatusWidget.d.ts +40 -0
- package/dist/client/platformCoverage.d.ts +19 -0
- package/dist/client/platformCoverageWidget.d.ts +37 -0
- package/dist/client/profileComparison.d.ts +19 -0
- package/dist/client/profileComparisonWidget.d.ts +41 -0
- package/dist/client/profileSwitchRecommendation.d.ts +19 -0
- package/dist/client/profileSwitchRecommendationWidget.d.ts +12 -0
- package/dist/client/proofTrends.d.ts +19 -0
- package/dist/client/proofTrendsWidget.d.ts +37 -0
- package/dist/client/providerCapabilities.d.ts +19 -0
- package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
- package/dist/client/providerContracts.d.ts +19 -0
- package/dist/client/providerContractsWidget.d.ts +37 -0
- package/dist/client/providerSimulationControls.d.ts +33 -0
- package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
- package/dist/client/providerStatus.d.ts +1 -1
- package/dist/client/providerStatusWidget.d.ts +32 -0
- package/dist/client/readinessFailures.d.ts +19 -0
- package/dist/client/readinessFailuresWidget.d.ts +42 -0
- package/dist/client/reconnectProfileEvidence.d.ts +19 -0
- package/dist/client/reconnectProfileEvidenceWidget.d.ts +39 -0
- package/dist/client/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +32 -0
- package/dist/client/sessionObservability.d.ts +19 -0
- package/dist/client/sessionObservabilityWidget.d.ts +31 -0
- package/dist/client/sessionSnapshot.d.ts +21 -0
- package/dist/client/sessionSnapshotWidget.d.ts +33 -0
- package/dist/client/store.d.ts +1 -1
- package/dist/client/traceTimeline.d.ts +19 -0
- package/dist/client/traceTimelineWidget.d.ts +36 -0
- package/dist/client/turnLatency.d.ts +22 -0
- package/dist/client/turnLatencyWidget.d.ts +33 -0
- package/dist/client/turnQuality.d.ts +19 -0
- package/dist/client/turnQualityWidget.d.ts +32 -0
- package/dist/client/workflowStatus.d.ts +1 -1
- package/dist/competitiveCoverage.d.ts +141 -0
- package/dist/correction.d.ts +2 -2
- package/dist/costAccounting.d.ts +76 -0
- package/dist/dataControl.d.ts +180 -0
- package/dist/deliveryRuntime.d.ts +158 -0
- package/dist/deliverySinkRoutes.d.ts +117 -0
- package/dist/demoReadyRoutes.d.ts +98 -0
- package/dist/diagnosticsRoutes.d.ts +2 -2
- package/dist/evalRoutes.d.ts +10 -4
- package/dist/fileStore.d.ts +21 -7
- package/dist/generated/htmxBootstrapBundle.d.ts +1 -0
- package/dist/guardrails.d.ts +128 -0
- package/dist/handoff.d.ts +6 -6
- package/dist/handoffHealth.d.ts +5 -5
- package/dist/htmx.d.ts +1 -1
- package/dist/incidentBundle.d.ts +119 -0
- package/dist/incidentTimeline.d.ts +260 -0
- package/dist/index.d.ts +238 -72
- package/dist/index.js +38639 -6061
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +190 -0
- package/dist/logger.d.ts +1 -1
- package/dist/mediaPipelineRoutes.d.ts +171 -0
- package/dist/mediaPipelineSurfaces.d.ts +48 -0
- package/dist/memoryStore.d.ts +1 -1
- package/dist/modelAdapters.d.ts +59 -7
- package/dist/monitor.d.ts +148 -0
- package/dist/multilingualProof.d.ts +77 -0
- package/dist/observabilityExport.d.ts +501 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationalStatus.d.ts +87 -0
- package/dist/operationsRecord.d.ts +370 -0
- package/dist/ops.d.ts +12 -12
- package/dist/opsActionAuditRoutes.d.ts +99 -0
- package/dist/opsConsoleRoutes.d.ts +8 -5
- package/dist/opsPresets.d.ts +2 -2
- package/dist/opsRecovery.d.ts +137 -0
- package/dist/opsRuntime.d.ts +6 -6
- package/dist/opsSinks.d.ts +13 -13
- package/dist/opsStatus.d.ts +76 -0
- package/dist/opsStatusRoutes.d.ts +33 -0
- package/dist/opsWebhook.d.ts +6 -6
- package/dist/outcomeContract.d.ts +146 -0
- package/dist/outcomeRecipes.d.ts +4 -4
- package/dist/phoneAgent.d.ts +139 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/platformCoverage.d.ts +91 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/postCallAnalysis.d.ts +98 -0
- package/dist/postgresStore.d.ts +17 -6
- package/dist/presets.d.ts +3 -3
- package/dist/productionReadiness.d.ts +756 -0
- package/dist/profileSwitchRecommendation.d.ts +350 -0
- package/dist/proofAssertions.d.ts +32 -0
- package/dist/proofPack.d.ts +211 -0
- package/dist/proofRunner.d.ts +79 -0
- package/dist/proofTrends.d.ts +966 -0
- package/dist/providerAdapters.d.ts +16 -5
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerDecisionTraces.d.ts +130 -0
- package/dist/providerHealth.d.ts +3 -3
- package/dist/providerOrchestration.d.ts +109 -0
- package/dist/providerRouterTraces.d.ts +35 -0
- package/dist/providerRoutingContract.d.ts +71 -0
- package/dist/providerSlo.d.ts +142 -0
- package/dist/providerStackRecommendations.d.ts +187 -0
- package/dist/qualityRoutes.d.ts +4 -4
- package/dist/queue.d.ts +23 -14
- package/dist/ragTool.d.ts +47 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
- package/dist/react/VoiceCallDebuggerLaunch.d.ts +6 -0
- package/dist/react/VoiceDeliveryRuntime.d.ts +7 -0
- package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoicePlatformCoverage.d.ts +6 -0
- package/dist/react/VoiceProfileComparison.d.ts +6 -0
- package/dist/react/VoiceProfileSwitchRecommendation.d.ts +6 -0
- package/dist/react/VoiceProofTrends.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
- package/dist/react/VoiceProviderContracts.d.ts +6 -0
- package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
- package/dist/react/VoiceProviderStatus.d.ts +6 -0
- package/dist/react/VoiceReadinessFailures.d.ts +6 -0
- package/dist/react/VoiceReconnectProfileEvidence.d.ts +6 -0
- package/dist/react/VoiceRoutingStatus.d.ts +6 -0
- package/dist/react/VoiceSessionObservability.d.ts +6 -0
- package/dist/react/VoiceSessionSnapshot.d.ts +6 -0
- package/dist/react/VoiceTraceTimeline.d.ts +6 -0
- package/dist/react/VoiceTurnLatency.d.ts +6 -0
- package/dist/react/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/index.d.ts +47 -4
- package/dist/react/index.js +11230 -116
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/react/useVoiceCallDebugger.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +4 -1
- package/dist/react/useVoiceDeliveryRuntime.d.ts +13 -0
- package/dist/react/useVoiceLiveOps.d.ts +9 -0
- package/dist/react/useVoiceOpsActionCenter.d.ts +11 -0
- package/dist/react/useVoiceOpsStatus.d.ts +8 -0
- package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
- package/dist/react/useVoiceProfileComparison.d.ts +8 -0
- package/dist/react/useVoiceProfileSwitchRecommendation.d.ts +8 -0
- package/dist/react/useVoiceProofTrends.d.ts +8 -0
- package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderContracts.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
- package/dist/react/useVoiceProviderStatus.d.ts +1 -1
- package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
- package/dist/react/useVoiceReconnectProfileEvidence.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceSessionObservability.d.ts +8 -0
- package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
- package/dist/react/useVoiceStream.d.ts +4 -1
- package/dist/react/useVoiceTraceTimeline.d.ts +8 -0
- package/dist/react/useVoiceTurnLatency.d.ts +9 -0
- package/dist/react/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +1 -1
- package/dist/readinessProfiles.d.ts +45 -0
- package/dist/realtimeChannel.d.ts +136 -0
- package/dist/realtimeProviderContracts.d.ts +133 -0
- package/dist/reconnectContract.d.ts +176 -0
- package/dist/recordingStore.d.ts +21 -0
- package/dist/resilienceRoutes.d.ts +45 -5
- package/dist/routing.d.ts +1 -1
- package/dist/runtimeOps.d.ts +3 -3
- package/dist/s3Store.d.ts +18 -3
- package/dist/session.d.ts +1 -1
- package/dist/sessionObservability.d.ts +145 -0
- package/dist/sessionReplay.d.ts +19 -7
- package/dist/sessionSnapshot.d.ts +109 -0
- package/dist/simulationSuite.d.ts +143 -0
- package/dist/sloCalibration.d.ts +185 -0
- package/dist/sqliteStore.d.ts +17 -6
- package/dist/store.d.ts +1 -1
- package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/svelte/createVoiceCallDebugger.d.ts +12 -0
- package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
- package/dist/svelte/createVoiceDeliveryRuntime.d.ts +11 -0
- package/dist/svelte/createVoiceLiveOps.d.ts +13 -0
- package/dist/svelte/createVoiceOpsActionCenter.d.ts +10 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
- package/dist/svelte/createVoiceProfileComparison.d.ts +7 -0
- package/dist/svelte/createVoiceProofTrends.d.ts +7 -0
- package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
- package/dist/svelte/createVoiceProviderContracts.d.ts +10 -0
- package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
- package/dist/svelte/createVoiceProviderStatus.d.ts +4 -2
- package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
- package/dist/svelte/createVoiceReconnectProfileEvidence.d.ts +7 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceSessionObservability.d.ts +10 -0
- package/dist/svelte/createVoiceSessionSnapshot.d.ts +13 -0
- package/dist/svelte/createVoiceStream.d.ts +1 -1
- package/dist/svelte/createVoiceTraceTimeline.d.ts +10 -0
- package/dist/svelte/createVoiceTurnLatency.d.ts +11 -0
- package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +1 -1
- package/dist/svelte/index.d.ts +25 -4
- package/dist/svelte/index.js +5956 -462
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +303 -0
- package/dist/telephony/response.d.ts +1 -1
- package/dist/telephony/security.d.ts +182 -0
- package/dist/telephony/telnyx.d.ts +291 -0
- package/dist/telephony/twilio.d.ts +147 -13
- package/dist/telephonyMediaRoutes.d.ts +72 -0
- package/dist/telephonyOutcome.d.ts +273 -0
- package/dist/testing/accuracy.d.ts +1 -1
- package/dist/testing/benchmark.d.ts +9 -9
- package/dist/testing/corrected.d.ts +5 -5
- package/dist/testing/duplex.d.ts +3 -3
- package/dist/testing/fixtures.d.ts +3 -3
- package/dist/testing/index.d.ts +13 -13
- package/dist/testing/index.js +5160 -182
- package/dist/testing/ioProviderSimulator.d.ts +5 -5
- package/dist/testing/providerSimulator.d.ts +5 -5
- package/dist/testing/review.d.ts +4 -4
- package/dist/testing/sessionBenchmark.d.ts +3 -3
- package/dist/testing/stt.d.ts +3 -3
- package/dist/testing/telephony.d.ts +25 -0
- package/dist/testing/tts.d.ts +1 -1
- package/dist/toolContract.d.ts +161 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +46 -7
- package/dist/traceDeliveryRoutes.d.ts +86 -0
- package/dist/traceTimeline.d.ts +97 -0
- package/dist/turnDetection.d.ts +1 -1
- package/dist/turnLatency.d.ts +95 -0
- package/dist/turnProfiles.d.ts +2 -2
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +270 -80
- package/dist/vapiAdapter.d.ts +160 -0
- package/dist/voiceMonitoring.d.ts +444 -0
- package/dist/vue/VoiceCallDebuggerLaunch.d.ts +68 -0
- package/dist/vue/VoiceDeliveryRuntime.d.ts +30 -0
- package/dist/vue/VoiceOpsActionCenter.d.ts +13 -0
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoicePlatformCoverage.d.ts +23 -0
- package/dist/vue/VoiceProofTrends.d.ts +21 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
- package/dist/vue/VoiceProviderContracts.d.ts +21 -0
- package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
- package/dist/vue/VoiceProviderStatus.d.ts +51 -0
- package/dist/vue/VoiceReadinessFailures.d.ts +21 -0
- package/dist/vue/VoiceReconnectProfileEvidence.d.ts +21 -0
- package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
- package/dist/vue/VoiceSessionObservability.d.ts +23 -0
- package/dist/vue/VoiceSessionSnapshot.d.ts +68 -0
- package/dist/vue/VoiceTurnLatency.d.ts +69 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +42 -4
- package/dist/vue/index.js +10642 -135
- package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/vue/useVoiceCallDebugger.d.ts +10 -0
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/dist/vue/useVoiceController.d.ts +4 -2
- package/dist/vue/useVoiceDeliveryRuntime.d.ts +13 -0
- package/dist/vue/useVoiceLiveOps.d.ts +9 -0
- package/dist/vue/useVoiceOpsActionCenter.d.ts +11 -0
- package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
- package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
- package/dist/vue/useVoiceProfileComparison.d.ts +9 -0
- package/dist/vue/useVoiceProofTrends.d.ts +9 -0
- package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
- package/dist/vue/useVoiceProviderContracts.d.ts +9 -0
- package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
- package/dist/vue/useVoiceProviderStatus.d.ts +3 -3
- package/dist/vue/useVoiceReadinessFailures.d.ts +959 -0
- package/dist/vue/useVoiceReconnectProfileEvidence.d.ts +9 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceSessionObservability.d.ts +9 -0
- package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
- package/dist/vue/useVoiceStream.d.ts +5 -2
- package/dist/vue/useVoiceTraceTimeline.d.ts +9 -0
- package/dist/vue/useVoiceTurnLatency.d.ts +10 -0
- package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +3 -3
- package/dist/workflowContract.d.ts +8 -8
- package/fixtures/manifest.json +356 -197
- package/package.json +265 -256
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from "./trace";
|
|
2
|
+
export type VoiceLatencySLOStatus = "empty" | "fail" | "pass" | "warn";
|
|
3
|
+
export type VoiceLatencySLOStage = "assistant_text_to_tts_send" | "barge_in_stop" | "commit_to_assistant_text" | "final_to_commit" | "live_latency" | "provider_llm" | "provider_stt" | "provider_tts" | "speech_to_commit" | "tts_send_duration" | "tts_to_first_audio";
|
|
4
|
+
export type VoiceLatencySLOBudget = {
|
|
5
|
+
failAfterMs: number;
|
|
6
|
+
warnAfterMs?: number;
|
|
7
|
+
};
|
|
8
|
+
export type VoiceLatencySLOMeasurement = {
|
|
9
|
+
at: number;
|
|
10
|
+
latencyMs: number;
|
|
11
|
+
label: string;
|
|
12
|
+
provider?: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
stage: VoiceLatencySLOStage;
|
|
15
|
+
status: Exclude<VoiceLatencySLOStatus, "empty">;
|
|
16
|
+
turnId?: string;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceLatencySLOStageSummary = {
|
|
19
|
+
averageMs?: number;
|
|
20
|
+
budget: VoiceLatencySLOBudget;
|
|
21
|
+
failed: number;
|
|
22
|
+
label: string;
|
|
23
|
+
maxMs?: number;
|
|
24
|
+
measurements: VoiceLatencySLOMeasurement[];
|
|
25
|
+
p50Ms?: number;
|
|
26
|
+
p95Ms?: number;
|
|
27
|
+
stage: VoiceLatencySLOStage;
|
|
28
|
+
status: VoiceLatencySLOStatus;
|
|
29
|
+
total: number;
|
|
30
|
+
warnings: number;
|
|
31
|
+
};
|
|
32
|
+
export type VoiceLatencySLOGateReport = {
|
|
33
|
+
checkedAt: number;
|
|
34
|
+
failed: number;
|
|
35
|
+
measurements: VoiceLatencySLOMeasurement[];
|
|
36
|
+
stages: VoiceLatencySLOStageSummary[];
|
|
37
|
+
status: VoiceLatencySLOStatus;
|
|
38
|
+
total: number;
|
|
39
|
+
warnings: number;
|
|
40
|
+
};
|
|
41
|
+
export type VoiceLatencySLOGateOptions = {
|
|
42
|
+
budgets?: Partial<Record<VoiceLatencySLOStage, VoiceLatencySLOBudget>>;
|
|
43
|
+
events?: StoredVoiceTraceEvent[];
|
|
44
|
+
failAfterMs?: number;
|
|
45
|
+
limit?: number;
|
|
46
|
+
store?: VoiceTraceEventStore;
|
|
47
|
+
warnAfterMs?: number;
|
|
48
|
+
};
|
|
49
|
+
export type VoiceLatencySLOGateError = Error & {
|
|
50
|
+
report: VoiceLatencySLOGateReport;
|
|
51
|
+
};
|
|
52
|
+
export declare const buildVoiceLatencySLOGate: (options: VoiceLatencySLOGateOptions) => Promise<VoiceLatencySLOGateReport>;
|
|
53
|
+
export declare const assertVoiceLatencySLOGate: (options: VoiceLatencySLOGateOptions) => Promise<VoiceLatencySLOGateReport>;
|
|
54
|
+
export declare const renderVoiceLatencySLOMarkdown: (report: VoiceLatencySLOGateReport, options?: {
|
|
55
|
+
title?: string;
|
|
56
|
+
}) => string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Elysia } from "elysia";
|
|
2
|
+
import type { VoiceTraceEventStore } from "./trace";
|
|
3
|
+
export type VoiceLiveLatencyStatus = "empty" | "fail" | "pass" | "warn";
|
|
4
|
+
export type VoiceLiveLatencySample = {
|
|
5
|
+
at: number;
|
|
6
|
+
latencyMs: number;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
traceId?: string;
|
|
10
|
+
};
|
|
11
|
+
export type VoiceLiveLatencyReport = {
|
|
12
|
+
averageLatencyMs?: number;
|
|
13
|
+
checkedAt: number;
|
|
14
|
+
failed: number;
|
|
15
|
+
p50LatencyMs?: number;
|
|
16
|
+
p95LatencyMs?: number;
|
|
17
|
+
recent: VoiceLiveLatencySample[];
|
|
18
|
+
status: VoiceLiveLatencyStatus;
|
|
19
|
+
total: number;
|
|
20
|
+
warnings: number;
|
|
21
|
+
};
|
|
22
|
+
export type VoiceLiveLatencyOptions = {
|
|
23
|
+
failAfterMs?: number;
|
|
24
|
+
limit?: number;
|
|
25
|
+
store: VoiceTraceEventStore;
|
|
26
|
+
warnAfterMs?: number;
|
|
27
|
+
};
|
|
28
|
+
export type VoiceLiveLatencyRoutesOptions = VoiceLiveLatencyOptions & {
|
|
29
|
+
headers?: HeadersInit;
|
|
30
|
+
htmlPath?: false | string;
|
|
31
|
+
name?: string;
|
|
32
|
+
path?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const summarizeVoiceLiveLatency: (options: VoiceLiveLatencyOptions) => Promise<VoiceLiveLatencyReport>;
|
|
36
|
+
export declare const renderVoiceLiveLatencyHTML: (report: VoiceLiveLatencyReport, options?: {
|
|
37
|
+
title?: string;
|
|
38
|
+
}) => string;
|
|
39
|
+
export declare const createVoiceLiveLatencyRoutes: (options: VoiceLiveLatencyRoutesOptions) => Elysia<"", {
|
|
40
|
+
decorator: {};
|
|
41
|
+
store: {};
|
|
42
|
+
derive: {};
|
|
43
|
+
resolve: {};
|
|
44
|
+
}, {
|
|
45
|
+
typebox: {};
|
|
46
|
+
error: {};
|
|
47
|
+
}, {
|
|
48
|
+
schema: {};
|
|
49
|
+
standaloneSchema: {};
|
|
50
|
+
macro: {};
|
|
51
|
+
macroFn: {};
|
|
52
|
+
parser: {};
|
|
53
|
+
response: {};
|
|
54
|
+
}, {
|
|
55
|
+
[x: string]: {
|
|
56
|
+
get: {
|
|
57
|
+
body: unknown;
|
|
58
|
+
params: {};
|
|
59
|
+
query: unknown;
|
|
60
|
+
headers: unknown;
|
|
61
|
+
response: {
|
|
62
|
+
200: VoiceLiveLatencyReport;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}, {
|
|
67
|
+
derive: {};
|
|
68
|
+
resolve: {};
|
|
69
|
+
schema: {};
|
|
70
|
+
standaloneSchema: {};
|
|
71
|
+
response: {};
|
|
72
|
+
}, {
|
|
73
|
+
derive: {};
|
|
74
|
+
resolve: {};
|
|
75
|
+
schema: {};
|
|
76
|
+
standaloneSchema: {};
|
|
77
|
+
response: {};
|
|
78
|
+
}>;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { Elysia } from "elysia";
|
|
2
|
+
import { type VoiceAuditEventStore } from "./audit";
|
|
3
|
+
import { type VoiceTraceEventStore } from "./trace";
|
|
4
|
+
import type { VoiceOperationsRecord } from "./operationsRecord";
|
|
5
|
+
import type { VoiceOpsActionHistoryReport } from "./opsActionAuditRoutes";
|
|
6
|
+
import type { VoiceOpsRecoveryReport, VoiceOpsRecoveryStatus } from "./opsRecovery";
|
|
7
|
+
import type { VoiceOpsStatusReport } from "./opsStatus";
|
|
8
|
+
export declare const VOICE_LIVE_OPS_ACTIONS: readonly ["assign", "create-task", "escalate", "force-handoff", "inject-instruction", "operator-takeover", "pause-assistant", "resume-assistant", "tag"];
|
|
9
|
+
export type VoiceLiveOpsAction = (typeof VOICE_LIVE_OPS_ACTIONS)[number];
|
|
10
|
+
export type VoiceLiveOpsControlStatus = "assistant-paused" | "assistant-resumed" | "handoff-forced" | "instruction-injected" | "operator-takeover" | "recorded";
|
|
11
|
+
export type VoiceLiveOpsControlState = {
|
|
12
|
+
assistantPaused: boolean;
|
|
13
|
+
handoffTarget?: string;
|
|
14
|
+
injectedInstruction?: string;
|
|
15
|
+
lastAction: VoiceLiveOpsAction;
|
|
16
|
+
lastUpdatedAt: number;
|
|
17
|
+
operator?: string;
|
|
18
|
+
operatorTakeover: boolean;
|
|
19
|
+
status: VoiceLiveOpsControlStatus;
|
|
20
|
+
tag?: string;
|
|
21
|
+
};
|
|
22
|
+
export type VoiceLiveOpsActionInput = {
|
|
23
|
+
action: VoiceLiveOpsAction;
|
|
24
|
+
assignee?: string;
|
|
25
|
+
detail?: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
tag?: string;
|
|
28
|
+
};
|
|
29
|
+
export type VoiceLiveOpsActionResult = {
|
|
30
|
+
action: VoiceLiveOpsAction;
|
|
31
|
+
control: VoiceLiveOpsControlState;
|
|
32
|
+
ok: true;
|
|
33
|
+
sessionId: string;
|
|
34
|
+
};
|
|
35
|
+
export type VoiceLiveOpsEvidenceInput = {
|
|
36
|
+
actionHistory?: VoiceOpsActionHistoryReport;
|
|
37
|
+
maxActionHistoryFailures?: number;
|
|
38
|
+
maxOpsRecoveryIssues?: number;
|
|
39
|
+
minActionHistoryEntries?: number;
|
|
40
|
+
minInterventions?: number;
|
|
41
|
+
minOperationsRecordHandoffs?: number;
|
|
42
|
+
minOperationsRecordTasks?: number;
|
|
43
|
+
operationsRecord?: VoiceOperationsRecord;
|
|
44
|
+
opsRecovery?: VoiceOpsRecoveryReport;
|
|
45
|
+
opsStatus?: VoiceOpsStatusReport;
|
|
46
|
+
requireActionHistory?: boolean;
|
|
47
|
+
requireOperationsRecord?: boolean;
|
|
48
|
+
requireOperationsRecordAudit?: boolean;
|
|
49
|
+
requireOperationsRecordHealthy?: boolean;
|
|
50
|
+
requireOpsRecovery?: boolean;
|
|
51
|
+
requireOpsRecoveryStatus?: VoiceOpsRecoveryStatus;
|
|
52
|
+
requireOpsStatus?: boolean;
|
|
53
|
+
requireOpsStatusPass?: boolean;
|
|
54
|
+
requiredHistoryActions?: string[];
|
|
55
|
+
requiredInterventionActions?: string[];
|
|
56
|
+
};
|
|
57
|
+
export type VoiceLiveOpsEvidenceReport = {
|
|
58
|
+
actionHistoryFailed?: number;
|
|
59
|
+
actionHistoryTotal?: number;
|
|
60
|
+
historyActions: string[];
|
|
61
|
+
interventionActions: string[];
|
|
62
|
+
interventions?: number;
|
|
63
|
+
issues: string[];
|
|
64
|
+
ok: boolean;
|
|
65
|
+
operationsRecordHandoffs?: number;
|
|
66
|
+
operationsRecordStatus?: VoiceOperationsRecord["status"];
|
|
67
|
+
operationsRecordTasks?: number;
|
|
68
|
+
opsRecoveryIssues?: number;
|
|
69
|
+
opsRecoveryStatus?: VoiceOpsRecoveryStatus;
|
|
70
|
+
opsStatus?: VoiceOpsStatusReport["status"];
|
|
71
|
+
};
|
|
72
|
+
export type VoiceLiveOpsControlEvidenceInput = {
|
|
73
|
+
finalControl?: VoiceLiveOpsControlState | null;
|
|
74
|
+
maxFailedActions?: number;
|
|
75
|
+
minSnapshots?: number;
|
|
76
|
+
requireFinalAssistantPaused?: boolean;
|
|
77
|
+
requireFinalOperatorTakeover?: boolean;
|
|
78
|
+
requiredActions?: VoiceLiveOpsAction[];
|
|
79
|
+
requiredStatuses?: VoiceLiveOpsControlStatus[];
|
|
80
|
+
results?: Array<(Partial<Omit<VoiceLiveOpsActionResult, "ok">> & {
|
|
81
|
+
ok?: boolean;
|
|
82
|
+
}) | null | undefined>;
|
|
83
|
+
};
|
|
84
|
+
export type VoiceLiveOpsControlEvidenceReport = {
|
|
85
|
+
actionCount: number;
|
|
86
|
+
actions: VoiceLiveOpsAction[];
|
|
87
|
+
failedActions: number;
|
|
88
|
+
finalControl?: VoiceLiveOpsControlState;
|
|
89
|
+
finalStatus?: VoiceLiveOpsControlStatus;
|
|
90
|
+
issues: string[];
|
|
91
|
+
ok: boolean;
|
|
92
|
+
snapshots: number;
|
|
93
|
+
statuses: VoiceLiveOpsControlStatus[];
|
|
94
|
+
};
|
|
95
|
+
export type VoiceLiveOpsControlStore = {
|
|
96
|
+
get: (sessionId: string) => Promise<VoiceLiveOpsControlState | undefined> | VoiceLiveOpsControlState | undefined;
|
|
97
|
+
set: (sessionId: string, state: VoiceLiveOpsControlState) => Promise<void> | void;
|
|
98
|
+
};
|
|
99
|
+
export type VoiceLiveOpsControllerOptions = {
|
|
100
|
+
audit?: VoiceAuditEventStore;
|
|
101
|
+
defaultAssignee?: string;
|
|
102
|
+
defaultDetail?: string;
|
|
103
|
+
defaultTag?: string;
|
|
104
|
+
onAction?: (result: VoiceLiveOpsActionResult & {
|
|
105
|
+
assignee: string;
|
|
106
|
+
detail: string;
|
|
107
|
+
tag: string;
|
|
108
|
+
}) => Promise<void> | void;
|
|
109
|
+
store?: VoiceLiveOpsControlStore;
|
|
110
|
+
trace?: VoiceTraceEventStore;
|
|
111
|
+
};
|
|
112
|
+
export type VoiceLiveOpsRoutesOptions = VoiceLiveOpsControllerOptions & {
|
|
113
|
+
controlPath?: string;
|
|
114
|
+
name?: string;
|
|
115
|
+
path?: string;
|
|
116
|
+
};
|
|
117
|
+
export declare const evaluateVoiceLiveOpsEvidence: (input?: VoiceLiveOpsEvidenceInput) => VoiceLiveOpsEvidenceReport;
|
|
118
|
+
export declare const assertVoiceLiveOpsEvidence: (input?: VoiceLiveOpsEvidenceInput) => VoiceLiveOpsEvidenceReport;
|
|
119
|
+
export declare const evaluateVoiceLiveOpsControlEvidence: (input?: VoiceLiveOpsControlEvidenceInput) => VoiceLiveOpsControlEvidenceReport;
|
|
120
|
+
export declare const assertVoiceLiveOpsControlEvidence: (input?: VoiceLiveOpsControlEvidenceInput) => VoiceLiveOpsControlEvidenceReport;
|
|
121
|
+
export declare const createVoiceMemoryLiveOpsControlStore: () => VoiceLiveOpsControlStore;
|
|
122
|
+
export declare const getVoiceLiveOpsControlStatus: (action: VoiceLiveOpsAction) => VoiceLiveOpsControlStatus;
|
|
123
|
+
export declare const buildVoiceLiveOpsControlState: (input: VoiceLiveOpsActionInput & {
|
|
124
|
+
at?: number;
|
|
125
|
+
previous?: VoiceLiveOpsControlState;
|
|
126
|
+
}) => VoiceLiveOpsControlState;
|
|
127
|
+
export declare const createVoiceLiveOpsController: (options?: VoiceLiveOpsControllerOptions) => {
|
|
128
|
+
get: (sessionId: string) => VoiceLiveOpsControlState | Promise<VoiceLiveOpsControlState | undefined> | undefined;
|
|
129
|
+
perform: (input: VoiceLiveOpsActionInput) => Promise<VoiceLiveOpsActionResult>;
|
|
130
|
+
store: VoiceLiveOpsControlStore;
|
|
131
|
+
};
|
|
132
|
+
export declare const createVoiceLiveOpsRoutes: (options?: VoiceLiveOpsRoutesOptions) => Elysia<"", {
|
|
133
|
+
decorator: {};
|
|
134
|
+
store: {};
|
|
135
|
+
derive: {};
|
|
136
|
+
resolve: {};
|
|
137
|
+
}, {
|
|
138
|
+
typebox: {};
|
|
139
|
+
error: {};
|
|
140
|
+
}, {
|
|
141
|
+
schema: {};
|
|
142
|
+
standaloneSchema: {};
|
|
143
|
+
macro: {};
|
|
144
|
+
macroFn: {};
|
|
145
|
+
parser: {};
|
|
146
|
+
response: {};
|
|
147
|
+
}, {
|
|
148
|
+
[x: string]: {
|
|
149
|
+
post: {
|
|
150
|
+
body: unknown;
|
|
151
|
+
params: {};
|
|
152
|
+
query: unknown;
|
|
153
|
+
headers: unknown;
|
|
154
|
+
response: {
|
|
155
|
+
200: VoiceLiveOpsActionResult | {
|
|
156
|
+
error: string;
|
|
157
|
+
ok: boolean;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
} & {
|
|
163
|
+
[x: string]: {
|
|
164
|
+
get: {
|
|
165
|
+
body: unknown;
|
|
166
|
+
params: {};
|
|
167
|
+
query: unknown;
|
|
168
|
+
headers: unknown;
|
|
169
|
+
response: {
|
|
170
|
+
200: {
|
|
171
|
+
control: VoiceLiveOpsControlState | undefined;
|
|
172
|
+
ok: boolean;
|
|
173
|
+
sessionId: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
derive: {};
|
|
180
|
+
resolve: {};
|
|
181
|
+
schema: {};
|
|
182
|
+
standaloneSchema: {};
|
|
183
|
+
response: {};
|
|
184
|
+
}, {
|
|
185
|
+
derive: {};
|
|
186
|
+
resolve: {};
|
|
187
|
+
schema: {};
|
|
188
|
+
standaloneSchema: {};
|
|
189
|
+
response: {};
|
|
190
|
+
}>;
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VoiceLogger } from
|
|
1
|
+
import type { VoiceLogger } from "./types";
|
|
2
2
|
export declare const createNoopLogger: () => Required<VoiceLogger>;
|
|
3
3
|
export declare const resolveLogger: (logger?: VoiceLogger) => {
|
|
4
4
|
debug: (message: string, meta?: Record<string, unknown>) => void;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Elysia } from "elysia";
|
|
2
|
+
import { type MediaFrame, type MediaInterruptionReport, type MediaPipelineCalibrationIssue, type MediaPipelineCalibrationInput, type MediaPipelineCalibrationReport, type MediaPipelineStatus, type MediaProcessorGraphReport, type MediaProcessorGraphSummary, type MediaQualityReport, type MediaQualitySummary, type MediaResamplingPlan, type MediaTransportReport, type MediaTransportSummary, type MediaVadReport } from "@absolutejs/media";
|
|
3
|
+
export type VoiceMediaPipelineReportOptions = MediaPipelineCalibrationInput & {
|
|
4
|
+
frames?: readonly MediaFrame[];
|
|
5
|
+
maxInterruptionLatencyMs?: number;
|
|
6
|
+
maxMediaBackpressureEvents?: number;
|
|
7
|
+
maxMediaGapMs?: number;
|
|
8
|
+
maxMediaJitterMs?: number;
|
|
9
|
+
maxMediaTimestampDriftMs?: number;
|
|
10
|
+
maxSilenceFrames?: number;
|
|
11
|
+
minMediaSpeechRatio?: number;
|
|
12
|
+
minSpeechFrames?: number;
|
|
13
|
+
processorGraph?: MediaProcessorGraphReport;
|
|
14
|
+
speechEndThreshold?: number;
|
|
15
|
+
speechStartThreshold?: number;
|
|
16
|
+
transport?: MediaTransportReport;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceMediaPipelineReport = {
|
|
19
|
+
calibration: MediaPipelineCalibrationReport;
|
|
20
|
+
checkedAt: number;
|
|
21
|
+
frames: number;
|
|
22
|
+
interruption: MediaInterruptionReport;
|
|
23
|
+
ok: boolean;
|
|
24
|
+
quality: MediaQualityReport;
|
|
25
|
+
resampling?: MediaResamplingPlan;
|
|
26
|
+
processorGraph?: MediaProcessorGraphReport;
|
|
27
|
+
sessionIds: string[];
|
|
28
|
+
status: MediaPipelineStatus;
|
|
29
|
+
surface: string;
|
|
30
|
+
transport?: MediaTransportReport;
|
|
31
|
+
vad: MediaVadReport;
|
|
32
|
+
};
|
|
33
|
+
export type VoiceMediaPipelineAssertionInput = {
|
|
34
|
+
maxFirstAudioLatencyMs?: number;
|
|
35
|
+
maxInterruptionLatencyMs?: number;
|
|
36
|
+
maxMediaBackpressureEvents?: number;
|
|
37
|
+
maxMediaGapMs?: number;
|
|
38
|
+
maxMediaJitterMs?: number;
|
|
39
|
+
maxMediaTimestampDriftMs?: number;
|
|
40
|
+
minAssistantAudioFrames?: number;
|
|
41
|
+
minInputAudioFrames?: number;
|
|
42
|
+
minMediaSpeechRatio?: number;
|
|
43
|
+
minProcessorGraphEmittedFrames?: number;
|
|
44
|
+
minProcessorGraphNodes?: number;
|
|
45
|
+
minTransportInputFrames?: number;
|
|
46
|
+
minTransportOutputFrames?: number;
|
|
47
|
+
minTraceLinkedFrames?: number;
|
|
48
|
+
minVadSegments?: number;
|
|
49
|
+
maxTransportBackpressureEvents?: number;
|
|
50
|
+
requireInterruptionFrame?: boolean;
|
|
51
|
+
requirePass?: boolean;
|
|
52
|
+
requireProcessorGraph?: boolean;
|
|
53
|
+
requireQualityPass?: boolean;
|
|
54
|
+
requireResamplingReady?: boolean;
|
|
55
|
+
requireTransportConnected?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type VoiceMediaPipelineAssertionReport = {
|
|
58
|
+
issues: string[];
|
|
59
|
+
ok: boolean;
|
|
60
|
+
status: MediaPipelineStatus;
|
|
61
|
+
surface: string;
|
|
62
|
+
};
|
|
63
|
+
export type VoiceMediaPipelineRoutesOptions = VoiceMediaPipelineReportOptions & {
|
|
64
|
+
headers?: HeadersInit;
|
|
65
|
+
htmlPath?: false | string;
|
|
66
|
+
markdownPath?: false | string;
|
|
67
|
+
name?: string;
|
|
68
|
+
path?: string;
|
|
69
|
+
render?: (report: VoiceMediaPipelineReport) => Promise<string> | string;
|
|
70
|
+
source?: (() => Promise<VoiceMediaPipelineReportOptions> | VoiceMediaPipelineReportOptions) | VoiceMediaPipelineReportOptions;
|
|
71
|
+
title?: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const buildVoiceMediaPipelineReport: (options?: VoiceMediaPipelineReportOptions) => VoiceMediaPipelineReport;
|
|
74
|
+
export declare const evaluateVoiceMediaPipelineEvidence: (report: VoiceMediaPipelineReport, input?: VoiceMediaPipelineAssertionInput) => VoiceMediaPipelineAssertionReport;
|
|
75
|
+
export declare const assertVoiceMediaPipelineEvidence: (report: VoiceMediaPipelineReport, input?: VoiceMediaPipelineAssertionInput) => VoiceMediaPipelineAssertionReport;
|
|
76
|
+
export declare const renderVoiceMediaPipelineMarkdown: (report: VoiceMediaPipelineReport) => string;
|
|
77
|
+
export declare const renderVoiceMediaPipelineHTML: (report: VoiceMediaPipelineReport, title?: string) => string;
|
|
78
|
+
export declare const createVoiceMediaPipelineRoutes: (options?: VoiceMediaPipelineRoutesOptions) => Elysia<"", {
|
|
79
|
+
decorator: {};
|
|
80
|
+
store: {};
|
|
81
|
+
derive: {};
|
|
82
|
+
resolve: {};
|
|
83
|
+
}, {
|
|
84
|
+
typebox: {};
|
|
85
|
+
error: {};
|
|
86
|
+
}, {
|
|
87
|
+
schema: {};
|
|
88
|
+
standaloneSchema: {};
|
|
89
|
+
macro: {};
|
|
90
|
+
macroFn: {};
|
|
91
|
+
parser: {};
|
|
92
|
+
response: {};
|
|
93
|
+
}, {
|
|
94
|
+
[x: string]: {
|
|
95
|
+
get: {
|
|
96
|
+
body: unknown;
|
|
97
|
+
params: {};
|
|
98
|
+
query: unknown;
|
|
99
|
+
headers: unknown;
|
|
100
|
+
response: {
|
|
101
|
+
200: Response;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}, {
|
|
106
|
+
derive: {};
|
|
107
|
+
resolve: {};
|
|
108
|
+
schema: {};
|
|
109
|
+
standaloneSchema: {};
|
|
110
|
+
response: {};
|
|
111
|
+
}, {
|
|
112
|
+
derive: {};
|
|
113
|
+
resolve: {};
|
|
114
|
+
schema: {};
|
|
115
|
+
standaloneSchema: {};
|
|
116
|
+
response: {};
|
|
117
|
+
}>;
|
|
118
|
+
export type VoiceMediaPipelineCalibrationSummary = {
|
|
119
|
+
assistantAudioFrames: number;
|
|
120
|
+
backpressureFrames: number;
|
|
121
|
+
firstAudioLatencyMs?: number;
|
|
122
|
+
inputAudioFrames: number;
|
|
123
|
+
interruptionFrames: number;
|
|
124
|
+
issueCodes: readonly string[];
|
|
125
|
+
jitterMs?: number;
|
|
126
|
+
resamplingRequired: boolean;
|
|
127
|
+
status: MediaPipelineStatus;
|
|
128
|
+
surface: string;
|
|
129
|
+
traceLinkedFrames: number;
|
|
130
|
+
turnCommitFrames: number;
|
|
131
|
+
};
|
|
132
|
+
export type VoiceMediaPipelineProofArtifactLinks = {
|
|
133
|
+
processorGraph?: string;
|
|
134
|
+
quality?: string;
|
|
135
|
+
transport?: string;
|
|
136
|
+
};
|
|
137
|
+
export type VoiceMediaPipelineProofSummary = {
|
|
138
|
+
artifacts?: VoiceMediaPipelineProofArtifactLinks;
|
|
139
|
+
calibration: VoiceMediaPipelineCalibrationSummary;
|
|
140
|
+
checkedAt: number;
|
|
141
|
+
frames: number;
|
|
142
|
+
interruption: {
|
|
143
|
+
interruptionFrames: number;
|
|
144
|
+
issueCodes: readonly string[];
|
|
145
|
+
latenciesMs: readonly number[];
|
|
146
|
+
status: MediaPipelineStatus;
|
|
147
|
+
};
|
|
148
|
+
issueCodes: readonly string[];
|
|
149
|
+
issues: readonly MediaPipelineCalibrationIssue[];
|
|
150
|
+
ok: boolean;
|
|
151
|
+
processorGraph?: MediaProcessorGraphSummary;
|
|
152
|
+
quality: MediaQualitySummary;
|
|
153
|
+
resampling?: {
|
|
154
|
+
ratio: number;
|
|
155
|
+
required: boolean;
|
|
156
|
+
status: MediaPipelineStatus;
|
|
157
|
+
};
|
|
158
|
+
sessionIds: readonly string[];
|
|
159
|
+
status: MediaPipelineStatus;
|
|
160
|
+
surface: string;
|
|
161
|
+
transport?: MediaTransportSummary;
|
|
162
|
+
vad: {
|
|
163
|
+
inputAudioFrames: number;
|
|
164
|
+
segmentCount: number;
|
|
165
|
+
status: MediaPipelineStatus;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
export type VoiceMediaPipelineProofSummaryOptions = {
|
|
169
|
+
artifacts?: VoiceMediaPipelineProofArtifactLinks;
|
|
170
|
+
};
|
|
171
|
+
export declare const summarizeVoiceMediaPipelineReport: (report: VoiceMediaPipelineReport, options?: VoiceMediaPipelineProofSummaryOptions) => VoiceMediaPipelineProofSummary;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type MediaProcessorGraphSummary, type MediaQualitySummary, type MediaTransportSummary } from "@absolutejs/media";
|
|
2
|
+
import type { VoiceIncidentTimelineEvent } from "./incidentTimeline";
|
|
3
|
+
import type { VoiceMediaPipelineReport } from "./mediaPipelineRoutes";
|
|
4
|
+
import type { VoiceProductionReadinessCheck } from "./productionReadiness";
|
|
5
|
+
export type VoiceMediaPipelineIssueSource = "calibration" | "interruption" | "processor-graph" | "quality" | "transport";
|
|
6
|
+
export type VoiceMediaPipelineIssueEntry = {
|
|
7
|
+
code: string;
|
|
8
|
+
message: string;
|
|
9
|
+
severity: "error" | "warning";
|
|
10
|
+
source: VoiceMediaPipelineIssueSource;
|
|
11
|
+
surface: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const extractVoiceMediaPipelineIssueEntries: (report: VoiceMediaPipelineReport) => readonly VoiceMediaPipelineIssueEntry[];
|
|
14
|
+
export type VoiceMediaPipelineReadinessOptions = {
|
|
15
|
+
baseHref?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const buildVoiceMediaPipelineReadinessChecks: (report: VoiceMediaPipelineReport, options?: VoiceMediaPipelineReadinessOptions) => readonly VoiceProductionReadinessCheck[];
|
|
19
|
+
export type VoiceMediaPipelineIncidentOptions = {
|
|
20
|
+
baseHref?: string;
|
|
21
|
+
category?: VoiceIncidentTimelineEvent["category"];
|
|
22
|
+
now?: () => number;
|
|
23
|
+
source?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const buildVoiceMediaPipelineIncidentEvents: (report: VoiceMediaPipelineReport, options?: VoiceMediaPipelineIncidentOptions) => readonly VoiceIncidentTimelineEvent[];
|
|
26
|
+
export type VoiceMediaPipelineArtifactKind = "processor-graph" | "quality" | "transport";
|
|
27
|
+
export type VoiceMediaPipelineArtifactRecord = {
|
|
28
|
+
href?: string;
|
|
29
|
+
jsonPath: string;
|
|
30
|
+
kind: VoiceMediaPipelineArtifactKind;
|
|
31
|
+
markdownPath: string;
|
|
32
|
+
summary: MediaProcessorGraphSummary | MediaQualitySummary | MediaTransportSummary;
|
|
33
|
+
};
|
|
34
|
+
export type VoiceMediaPipelineArtifactWriteOptions = {
|
|
35
|
+
dir: string;
|
|
36
|
+
hrefBase?: string;
|
|
37
|
+
report: VoiceMediaPipelineReport;
|
|
38
|
+
slugPrefix?: string;
|
|
39
|
+
};
|
|
40
|
+
export type VoiceMediaPipelineArtifactWriteResult = {
|
|
41
|
+
artifacts: VoiceMediaPipelineArtifactRecord[];
|
|
42
|
+
hrefs: {
|
|
43
|
+
processorGraph?: string;
|
|
44
|
+
quality?: string;
|
|
45
|
+
transport?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const writeVoiceMediaPipelineArtifacts: (options: VoiceMediaPipelineArtifactWriteOptions) => Promise<VoiceMediaPipelineArtifactWriteResult>;
|
package/dist/memoryStore.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { VoiceSessionRecord, VoiceSessionStore } from
|
|
1
|
+
import type { VoiceSessionRecord, VoiceSessionStore } from "./types";
|
|
2
2
|
export declare const createVoiceMemoryStore: <TSession extends VoiceSessionRecord = VoiceSessionRecord>() => VoiceSessionStore<TSession>;
|
package/dist/modelAdapters.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput } from
|
|
2
|
-
import type { VoiceSessionRecord } from
|
|
1
|
+
import type { VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput } from "./agent";
|
|
2
|
+
import type { VoiceSessionRecord } from "./types";
|
|
3
3
|
export type VoiceJSONAssistantModelHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: VoiceAgentModelInput<TContext, TSession>) => Promise<Record<string, unknown> | VoiceAgentModelOutput<TResult>> | Record<string, unknown> | VoiceAgentModelOutput<TResult>;
|
|
4
4
|
export type VoiceJSONAssistantModelOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
5
5
|
generate: VoiceJSONAssistantModelHandler<TContext, TSession, TResult>;
|
|
@@ -48,21 +48,36 @@ export type VoiceProviderRouterEvent<TProvider extends string = string> = {
|
|
|
48
48
|
selectedProvider: TProvider;
|
|
49
49
|
suppressionRemainingMs?: number;
|
|
50
50
|
suppressedUntil?: number;
|
|
51
|
-
status:
|
|
51
|
+
status: "error" | "fallback" | "success";
|
|
52
52
|
timedOut?: boolean;
|
|
53
53
|
};
|
|
54
|
-
export type VoiceProviderRouterFallbackMode =
|
|
55
|
-
export type
|
|
54
|
+
export type VoiceProviderRouterFallbackMode = "never" | "provider-error" | "rate-limit";
|
|
55
|
+
export type VoiceProviderRouterStrategy = "balanced" | "ordered" | "prefer-cheapest" | "prefer-fastest" | "prefer-selected" | "quality-first";
|
|
56
|
+
export type VoiceProviderRouterPolicyPreset = "balanced" | "cost-cap" | "cost-first" | "latency-first" | "quality-first";
|
|
57
|
+
export type VoiceProviderRouterPolicyWeights = {
|
|
58
|
+
cost?: number;
|
|
59
|
+
latencyMs?: number;
|
|
60
|
+
priority?: number;
|
|
61
|
+
quality?: number;
|
|
62
|
+
};
|
|
63
|
+
export type VoiceProviderRouterPolicy<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = VoiceProviderRouterStrategy | VoiceProviderRouterPolicyPreset | {
|
|
56
64
|
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
57
65
|
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
58
|
-
|
|
66
|
+
maxCost?: number;
|
|
67
|
+
maxLatencyMs?: number;
|
|
68
|
+
minQuality?: number;
|
|
69
|
+
scoreProvider?: (provider: TProvider, profile: VoiceProviderRouterProviderProfile | undefined) => number;
|
|
70
|
+
strategy?: VoiceProviderRouterStrategy;
|
|
71
|
+
weights?: VoiceProviderRouterPolicyWeights;
|
|
59
72
|
};
|
|
60
73
|
export type VoiceProviderRouterProviderProfile = {
|
|
61
74
|
cost?: number;
|
|
62
75
|
latencyMs?: number;
|
|
63
76
|
priority?: number;
|
|
77
|
+
quality?: number;
|
|
64
78
|
timeoutMs?: number;
|
|
65
79
|
};
|
|
80
|
+
export declare const resolveVoiceProviderRoutingPolicyPreset: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string>(preset: VoiceProviderRouterPolicyPreset, options?: Omit<Extract<VoiceProviderRouterPolicy<TContext, TSession, TProvider>, Record<string, unknown>>, "strategy">) => Extract<VoiceProviderRouterPolicy<TContext, TSession, TProvider>, Record<string, unknown>>;
|
|
66
81
|
export type VoiceProviderRouterHealthOptions = {
|
|
67
82
|
cooldownMs?: number;
|
|
68
83
|
failureThreshold?: number;
|
|
@@ -74,9 +89,44 @@ export type VoiceProviderRouterProviderHealth<TProvider extends string = string>
|
|
|
74
89
|
lastFailureAt?: number;
|
|
75
90
|
lastRateLimitedAt?: number;
|
|
76
91
|
provider: TProvider;
|
|
77
|
-
status:
|
|
92
|
+
status: "healthy" | "suppressed";
|
|
78
93
|
suppressedUntil?: number;
|
|
79
94
|
};
|
|
95
|
+
export type VoiceProviderOrchestrationSurface<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = {
|
|
96
|
+
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
97
|
+
fallback?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
98
|
+
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
99
|
+
maxCost?: number;
|
|
100
|
+
maxLatencyMs?: number;
|
|
101
|
+
minQuality?: number;
|
|
102
|
+
policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
|
|
103
|
+
providerHealth?: boolean | VoiceProviderRouterHealthOptions;
|
|
104
|
+
providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
|
|
105
|
+
strategy?: VoiceProviderRouterStrategy;
|
|
106
|
+
timeoutMs?: number;
|
|
107
|
+
weights?: VoiceProviderRouterPolicyWeights;
|
|
108
|
+
};
|
|
109
|
+
export type VoiceProviderOrchestrationProfile<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string, TSurface extends string = string> = {
|
|
110
|
+
defaultSurface?: TSurface;
|
|
111
|
+
id: string;
|
|
112
|
+
resolve: (surface?: TSurface) => VoiceProviderOrchestrationResolvedSurface<TContext, TSession, TProvider>;
|
|
113
|
+
surfaces: Record<TSurface, VoiceProviderOrchestrationSurface<TContext, TSession, TProvider>>;
|
|
114
|
+
};
|
|
115
|
+
export type VoiceProviderOrchestrationProfileOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string, TSurface extends string = string> = {
|
|
116
|
+
defaultSurface?: TSurface;
|
|
117
|
+
id: string;
|
|
118
|
+
surfaces: Record<TSurface, VoiceProviderOrchestrationSurface<TContext, TSession, TProvider>>;
|
|
119
|
+
};
|
|
120
|
+
export type VoiceProviderOrchestrationResolvedSurface<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = {
|
|
121
|
+
allowProviders?: VoiceProviderOrchestrationSurface<TContext, TSession, TProvider>["allowProviders"];
|
|
122
|
+
fallback?: VoiceProviderOrchestrationSurface<TContext, TSession, TProvider>["fallback"];
|
|
123
|
+
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
124
|
+
policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
|
|
125
|
+
providerHealth?: boolean | VoiceProviderRouterHealthOptions;
|
|
126
|
+
providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
|
|
127
|
+
timeoutMs?: number;
|
|
128
|
+
};
|
|
129
|
+
export declare const createVoiceProviderOrchestrationProfile: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string, TSurface extends string = string>(options: VoiceProviderOrchestrationProfileOptions<TContext, TSession, TProvider, TSurface>) => VoiceProviderOrchestrationProfile<TContext, TSession, TProvider, TSurface>;
|
|
80
130
|
export type VoiceProviderRouterOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown, TProvider extends string = string> = {
|
|
81
131
|
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
82
132
|
fallback?: TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
@@ -85,6 +135,8 @@ export type VoiceProviderRouterOptions<TContext = unknown, TSession extends Voic
|
|
|
85
135
|
isRateLimitError?: (error: unknown, provider: TProvider) => boolean;
|
|
86
136
|
isTimeoutError?: (error: unknown, provider: TProvider) => boolean;
|
|
87
137
|
onProviderEvent?: (event: VoiceProviderRouterEvent<TProvider>, input: VoiceAgentModelInput<TContext, TSession>) => Promise<void> | void;
|
|
138
|
+
orchestrationProfile?: VoiceProviderOrchestrationProfile<TContext, TSession, TProvider>;
|
|
139
|
+
orchestrationSurface?: string;
|
|
88
140
|
policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
|
|
89
141
|
providerHealth?: boolean | VoiceProviderRouterHealthOptions;
|
|
90
142
|
providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
|