@absolutejs/voice 0.0.22-beta.4 → 0.0.22-beta.400
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 +3537 -55
- package/dist/agent.d.ts +62 -0
- package/dist/agentSquadContract.d.ts +98 -0
- package/dist/angular/index.d.ts +19 -0
- package/dist/angular/index.js +4599 -1041
- package/dist/angular/voice-agent-squad-status.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 +1 -0
- 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 +12 -0
- package/dist/angular/voice-readiness-failures.service.d.ts +13 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-session-snapshot.service.d.ts +13 -0
- package/dist/angular/voice-stream.service.d.ts +4 -0
- 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 +12 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/audit.d.ts +128 -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/campaign.d.ts +794 -0
- package/dist/campaignDialers.d.ts +111 -0
- package/dist/client/actions.d.ts +116 -0
- package/dist/client/agentSquadStatus.d.ts +37 -0
- package/dist/client/agentSquadStatusWidget.d.ts +24 -0
- package/dist/client/bargeInMonitor.d.ts +7 -0
- package/dist/client/browserMedia.d.ts +8 -0
- package/dist/client/campaignDialerProof.d.ts +23 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/deliveryRuntime.d.ts +34 -0
- package/dist/client/deliveryRuntimeWidget.d.ts +37 -0
- package/dist/client/duplex.d.ts +1 -1
- package/dist/client/htmxBootstrap.js +994 -16
- package/dist/client/index.d.ts +85 -0
- package/dist/client/index.js +9689 -10
- 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/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 +19 -0
- 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/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +32 -0
- package/dist/client/sessionSnapshot.d.ts +21 -0
- package/dist/client/sessionSnapshotWidget.d.ts +28 -0
- 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 +19 -0
- package/dist/competitiveCoverage.d.ts +141 -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 +44 -0
- package/dist/evalRoutes.d.ts +219 -0
- package/dist/fileStore.d.ts +14 -2
- package/dist/guardrails.d.ts +128 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/incidentBundle.d.ts +116 -0
- package/dist/index.d.ts +172 -9
- package/dist/index.js +34332 -3644
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +190 -0
- package/dist/mediaPipelineRoutes.d.ts +117 -0
- package/dist/modelAdapters.d.ts +151 -0
- package/dist/observabilityExport.d.ts +481 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationsRecord.d.ts +351 -0
- package/dist/opsActionAuditRoutes.d.ts +99 -0
- package/dist/opsConsoleRoutes.d.ts +80 -0
- package/dist/opsRecovery.d.ts +137 -0
- package/dist/opsStatus.d.ts +76 -0
- package/dist/opsStatusRoutes.d.ts +33 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +146 -0
- package/dist/phoneAgent.d.ts +139 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/platformCoverage.d.ts +91 -0
- package/dist/postCallAnalysis.d.ts +98 -0
- package/dist/postgresStore.d.ts +13 -2
- package/dist/productionReadiness.d.ts +691 -0
- package/dist/profileSwitchRecommendation.d.ts +350 -0
- package/dist/proofAssertions.d.ts +32 -0
- package/dist/proofRunner.d.ts +79 -0
- package/dist/proofTrends.d.ts +715 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerDecisionTraces.d.ts +130 -0
- package/dist/providerHealth.d.ts +79 -0
- 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 +76 -0
- package/dist/queue.d.ts +61 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -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/VoiceRoutingStatus.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 +39 -0
- package/dist/react/index.js +10432 -14
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +4 -0
- 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 +8 -0
- package/dist/react/useVoiceReadinessFailures.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceSessionSnapshot.d.ts +9 -0
- package/dist/react/useVoiceStream.d.ts +4 -0
- 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 +8 -0
- package/dist/readinessProfiles.d.ts +38 -0
- package/dist/realtimeChannel.d.ts +136 -0
- package/dist/realtimeProviderContracts.d.ts +133 -0
- package/dist/reconnectContract.d.ts +88 -0
- package/dist/resilienceRoutes.d.ts +146 -0
- package/dist/sessionReplay.d.ts +187 -0
- package/dist/sessionSnapshot.d.ts +98 -0
- package/dist/simulationSuite.d.ts +143 -0
- package/dist/sloCalibration.d.ts +185 -0
- package/dist/sqliteStore.d.ts +13 -2
- package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -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 +10 -0
- package/dist/svelte/createVoiceReadinessFailures.d.ts +7 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceSessionSnapshot.d.ts +13 -0
- 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 +8 -0
- package/dist/svelte/index.d.ts +20 -0
- package/dist/svelte/index.js +6188 -408
- 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/security.d.ts +182 -0
- package/dist/telephony/telnyx.d.ts +291 -0
- package/dist/telephony/twilio.d.ts +136 -2
- package/dist/telephonyMediaRoutes.d.ts +72 -0
- package/dist/telephonyOutcome.d.ts +273 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +9133 -2560
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/testing/telephony.d.ts +25 -0
- package/dist/toolContract.d.ts +161 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +31 -1
- package/dist/traceDeliveryRoutes.d.ts +86 -0
- package/dist/traceTimeline.d.ts +97 -0
- package/dist/turnLatency.d.ts +95 -0
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +240 -4
- package/dist/voiceMonitoring.d.ts +444 -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/VoiceRoutingStatus.d.ts +51 -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 +34 -0
- package/dist/vue/index.js +9874 -31
- package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/dist/vue/useVoiceController.d.ts +2 -1
- 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 +9 -0
- package/dist/vue/useVoiceReadinessFailures.d.ts +899 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceSessionSnapshot.d.ts +10 -0
- package/dist/vue/useVoiceStream.d.ts +5 -1
- 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 +9 -0
- package/dist/workflowContract.d.ts +91 -0
- package/package.json +4 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceSessionRecord, VoiceSessionStore, VoiceTranscriptQuality } from './types';
|
|
3
|
+
export type VoiceTurnQualityStatus = 'pass' | 'warn' | 'fail' | 'unknown';
|
|
4
|
+
export type VoiceTurnQualityItem = {
|
|
5
|
+
averageConfidence?: number;
|
|
6
|
+
committedAt: number;
|
|
7
|
+
correctionChanged: boolean;
|
|
8
|
+
correctionProvider?: string;
|
|
9
|
+
correctionReason?: string;
|
|
10
|
+
costUnits?: number;
|
|
11
|
+
fallbackSelectionReason?: string;
|
|
12
|
+
fallbackUsed: boolean;
|
|
13
|
+
finalTranscriptCount: number;
|
|
14
|
+
latencyMs?: number;
|
|
15
|
+
partialTranscriptCount: number;
|
|
16
|
+
selectedTranscriptCount: number;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
source?: VoiceTranscriptQuality['source'];
|
|
19
|
+
status: VoiceTurnQualityStatus;
|
|
20
|
+
text: string;
|
|
21
|
+
turnId: string;
|
|
22
|
+
};
|
|
23
|
+
export type VoiceTurnQualityReport = {
|
|
24
|
+
checkedAt: number;
|
|
25
|
+
failed: number;
|
|
26
|
+
sessions: number;
|
|
27
|
+
status: VoiceTurnQualityStatus;
|
|
28
|
+
total: number;
|
|
29
|
+
turns: VoiceTurnQualityItem[];
|
|
30
|
+
warnings: number;
|
|
31
|
+
};
|
|
32
|
+
export type VoiceTurnQualityOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
|
|
33
|
+
confidenceWarnThreshold?: number;
|
|
34
|
+
limit?: number;
|
|
35
|
+
sessionIds?: string[];
|
|
36
|
+
sessions?: TSession[];
|
|
37
|
+
store?: VoiceSessionStore<TSession>;
|
|
38
|
+
};
|
|
39
|
+
export type VoiceTurnQualityHTMLHandlerOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord> = VoiceTurnQualityOptions<TSession> & {
|
|
40
|
+
headers?: HeadersInit;
|
|
41
|
+
render?: (report: VoiceTurnQualityReport) => string | Promise<string>;
|
|
42
|
+
title?: string;
|
|
43
|
+
};
|
|
44
|
+
export type VoiceTurnQualityRoutesOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord> = VoiceTurnQualityHTMLHandlerOptions<TSession> & {
|
|
45
|
+
htmlPath?: false | string;
|
|
46
|
+
name?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const summarizeVoiceTurnQuality: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceTurnQualityOptions<TSession>) => Promise<VoiceTurnQualityReport>;
|
|
50
|
+
export declare const renderVoiceTurnQualityHTML: (report: VoiceTurnQualityReport, options?: {
|
|
51
|
+
title?: string;
|
|
52
|
+
}) => string;
|
|
53
|
+
export declare const createVoiceTurnQualityJSONHandler: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceTurnQualityOptions<TSession>) => () => Promise<VoiceTurnQualityReport>;
|
|
54
|
+
export declare const createVoiceTurnQualityHTMLHandler: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceTurnQualityHTMLHandlerOptions<TSession>) => () => Promise<Response>;
|
|
55
|
+
export declare const createVoiceTurnQualityRoutes: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceTurnQualityRoutesOptions<TSession>) => Elysia<"", {
|
|
56
|
+
decorator: {};
|
|
57
|
+
store: {};
|
|
58
|
+
derive: {};
|
|
59
|
+
resolve: {};
|
|
60
|
+
}, {
|
|
61
|
+
typebox: {};
|
|
62
|
+
error: {};
|
|
63
|
+
}, {
|
|
64
|
+
schema: {};
|
|
65
|
+
standaloneSchema: {};
|
|
66
|
+
macro: {};
|
|
67
|
+
macroFn: {};
|
|
68
|
+
parser: {};
|
|
69
|
+
response: {};
|
|
70
|
+
}, {
|
|
71
|
+
[x: string]: {
|
|
72
|
+
get: {
|
|
73
|
+
body: unknown;
|
|
74
|
+
params: {};
|
|
75
|
+
query: unknown;
|
|
76
|
+
headers: unknown;
|
|
77
|
+
response: {
|
|
78
|
+
200: VoiceTurnQualityReport;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
derive: {};
|
|
84
|
+
resolve: {};
|
|
85
|
+
schema: {};
|
|
86
|
+
standaloneSchema: {};
|
|
87
|
+
response: {};
|
|
88
|
+
}, {
|
|
89
|
+
derive: {};
|
|
90
|
+
resolve: {};
|
|
91
|
+
schema: {};
|
|
92
|
+
standaloneSchema: {};
|
|
93
|
+
response: {};
|
|
94
|
+
}>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { SessionStore } from '@absolutejs/absolute';
|
|
2
|
+
import type { MediaWebRTCStatsCollector, MediaWebRTCStatsReport, MediaWebRTCStatsReportInput, MediaWebRTCStreamContinuityInput, MediaWebRTCStreamContinuityReport } from '@absolutejs/media';
|
|
2
3
|
import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, VoiceOpsTaskAssignmentRules, VoiceIntegrationWebhookConfig, StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskPolicy, VoiceOpsTask, VoiceOpsTaskStore } from './ops';
|
|
3
4
|
import type { VoiceIntegrationSink } from './opsSinks';
|
|
4
5
|
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
5
6
|
import type { VoiceTraceEventStore } from './trace';
|
|
7
|
+
import type { VoiceLiveOpsControlState } from './liveOps';
|
|
8
|
+
import type { VoiceAuditActor, VoiceAuditEventStore } from './audit';
|
|
9
|
+
import type { VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchObservedSignals } from './profileSwitchRecommendation';
|
|
10
|
+
import type { VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryReport } from './proofTrends';
|
|
6
11
|
export type AudioFormat = {
|
|
7
12
|
container: 'raw';
|
|
8
13
|
encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
|
|
@@ -193,6 +198,15 @@ export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = Realti
|
|
|
193
198
|
open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
|
|
194
199
|
};
|
|
195
200
|
export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
|
|
201
|
+
export type VoiceReconnectClientStatus = 'idle' | 'reconnecting' | 'resumed' | 'exhausted';
|
|
202
|
+
export type VoiceReconnectClientState = {
|
|
203
|
+
attempts: number;
|
|
204
|
+
lastDisconnectAt?: number;
|
|
205
|
+
lastResumedAt?: number;
|
|
206
|
+
maxAttempts: number;
|
|
207
|
+
nextAttemptAt?: number;
|
|
208
|
+
status: VoiceReconnectClientStatus;
|
|
209
|
+
};
|
|
196
210
|
export type VoiceTurnRecord<TResult = unknown> = {
|
|
197
211
|
id: string;
|
|
198
212
|
text: string;
|
|
@@ -269,6 +283,65 @@ export type VoiceCallLifecycleState = {
|
|
|
269
283
|
lastEventAt: number;
|
|
270
284
|
startedAt: number;
|
|
271
285
|
};
|
|
286
|
+
export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
|
|
287
|
+
export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
|
|
288
|
+
export type VoiceHandoffResult = {
|
|
289
|
+
deliveredAt?: number;
|
|
290
|
+
deliveredTo?: string;
|
|
291
|
+
error?: string;
|
|
292
|
+
metadata?: Record<string, unknown>;
|
|
293
|
+
status: VoiceHandoffStatus;
|
|
294
|
+
};
|
|
295
|
+
export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
|
|
296
|
+
export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
297
|
+
action: VoiceHandoffAction;
|
|
298
|
+
context: TContext;
|
|
299
|
+
createdAt: number;
|
|
300
|
+
deliveredAt?: number;
|
|
301
|
+
deliveries?: Record<string, VoiceHandoffResult & {
|
|
302
|
+
adapterId: string;
|
|
303
|
+
adapterKind?: string;
|
|
304
|
+
}>;
|
|
305
|
+
deliveryAttempts?: number;
|
|
306
|
+
deliveryError?: string;
|
|
307
|
+
deliveryStatus: VoiceHandoffDeliveryQueueStatus;
|
|
308
|
+
id: string;
|
|
309
|
+
metadata?: Record<string, unknown>;
|
|
310
|
+
reason?: string;
|
|
311
|
+
result?: TResult;
|
|
312
|
+
session: TSession;
|
|
313
|
+
sessionId: string;
|
|
314
|
+
target?: string;
|
|
315
|
+
updatedAt: number;
|
|
316
|
+
};
|
|
317
|
+
export type VoiceHandoffDeliveryStore<TDelivery extends StoredVoiceHandoffDelivery = StoredVoiceHandoffDelivery> = {
|
|
318
|
+
get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
|
|
319
|
+
list: () => Promise<TDelivery[]> | TDelivery[];
|
|
320
|
+
remove: (id: string) => Promise<void> | void;
|
|
321
|
+
set: (id: string, delivery: TDelivery) => Promise<void> | void;
|
|
322
|
+
};
|
|
323
|
+
export type VoiceHandoffInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
324
|
+
action: VoiceHandoffAction;
|
|
325
|
+
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
326
|
+
context: TContext;
|
|
327
|
+
metadata?: Record<string, unknown>;
|
|
328
|
+
reason?: string;
|
|
329
|
+
result?: TResult;
|
|
330
|
+
session: TSession;
|
|
331
|
+
target?: string;
|
|
332
|
+
};
|
|
333
|
+
export type VoiceHandoffAdapter<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
334
|
+
actions?: VoiceHandoffAction[];
|
|
335
|
+
handoff: (input: VoiceHandoffInput<TContext, TSession, TResult>) => Promise<VoiceHandoffResult> | VoiceHandoffResult;
|
|
336
|
+
id: string;
|
|
337
|
+
kind?: string;
|
|
338
|
+
};
|
|
339
|
+
export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
340
|
+
adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
|
|
341
|
+
deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
|
|
342
|
+
enqueueOnly?: boolean;
|
|
343
|
+
failMode?: 'record' | 'throw';
|
|
344
|
+
};
|
|
272
345
|
export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
|
|
273
346
|
export type VoiceLogger = {
|
|
274
347
|
debug?: (message: string, meta?: Record<string, unknown>) => void;
|
|
@@ -416,6 +489,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
|
|
|
416
489
|
}) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
|
|
417
490
|
export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
|
|
418
491
|
context: TContext;
|
|
492
|
+
liveOps?: {
|
|
493
|
+
control: VoiceLiveOpsControlState;
|
|
494
|
+
injectedInstruction?: string;
|
|
495
|
+
};
|
|
419
496
|
session: TSession;
|
|
420
497
|
turn: VoiceTurnRecord;
|
|
421
498
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
@@ -537,6 +614,36 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
537
614
|
tasks?: VoiceOpsTaskStore;
|
|
538
615
|
webhook?: VoiceIntegrationWebhookConfig;
|
|
539
616
|
};
|
|
617
|
+
export type VoiceLiveOpsRuntimeConfig = {
|
|
618
|
+
getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
|
|
619
|
+
};
|
|
620
|
+
export type VoiceProfileSwitchGuardResolverInput<TContext = unknown> = {
|
|
621
|
+
context: TContext;
|
|
622
|
+
scenarioId?: string;
|
|
623
|
+
sessionId: string;
|
|
624
|
+
};
|
|
625
|
+
export type VoicePluginProfileSwitchGuardConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
626
|
+
actor?: VoiceAuditActor;
|
|
627
|
+
allowedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
628
|
+
audit?: VoiceAuditEventStore;
|
|
629
|
+
blockedProfileIds?: string[] | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string[] | undefined> | string[] | undefined);
|
|
630
|
+
currentProfileId?: string | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<string | undefined> | string | undefined);
|
|
631
|
+
defaultProfileId?: string;
|
|
632
|
+
defaults: VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport> | VoiceRealCallProfileDefaultsReport | VoiceRealCallProfileHistoryReport);
|
|
633
|
+
metadata?: Record<string, unknown> | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<Record<string, unknown> | undefined> | Record<string, unknown> | undefined);
|
|
634
|
+
minConfidence?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
635
|
+
maxAutoSwitchesPerSession?: number | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<number | undefined> | number | undefined);
|
|
636
|
+
mode?: VoiceProfileSwitchGuardMode | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchGuardMode | undefined> | VoiceProfileSwitchGuardMode | undefined);
|
|
637
|
+
observed?: VoiceProfileSwitchObservedSignals | ((input: VoiceProfileSwitchGuardResolverInput<TContext>) => Promise<VoiceProfileSwitchObservedSignals | undefined> | VoiceProfileSwitchObservedSignals | undefined);
|
|
638
|
+
onDecision?: (input: {
|
|
639
|
+
context: TContext;
|
|
640
|
+
decision: VoiceProfileSwitchGuardDecision;
|
|
641
|
+
scenarioId?: string;
|
|
642
|
+
sessionId: string;
|
|
643
|
+
}) => Promise<void> | void;
|
|
644
|
+
sessionMetadataKey?: string | false;
|
|
645
|
+
trace?: false | VoiceTraceEventStore;
|
|
646
|
+
};
|
|
540
647
|
export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
|
|
541
648
|
onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
|
|
542
649
|
};
|
|
@@ -557,9 +664,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
557
664
|
lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
|
|
558
665
|
phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
|
|
559
666
|
preset?: VoiceRuntimePreset;
|
|
560
|
-
stt
|
|
667
|
+
stt?: STTAdapter;
|
|
561
668
|
sttFallback?: VoiceSTTFallbackConfig;
|
|
562
669
|
sttLifecycle?: VoiceSTTLifecycle;
|
|
670
|
+
realtime?: RealtimeAdapter;
|
|
671
|
+
realtimeInputFormat?: AudioFormat;
|
|
563
672
|
tts?: TTSAdapter;
|
|
564
673
|
session: VoiceSessionStore<NoInfer<TSession>>;
|
|
565
674
|
reconnect?: VoiceReconnectConfig;
|
|
@@ -567,7 +676,10 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
567
676
|
audioConditioning?: VoiceAudioConditioningConfig;
|
|
568
677
|
logger?: VoiceLogger;
|
|
569
678
|
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
|
|
679
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
570
680
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
681
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
682
|
+
profileSwitchGuard?: VoicePluginProfileSwitchGuardConfig<TContext, TSession, TResult>;
|
|
571
683
|
trace?: VoiceTraceEventStore;
|
|
572
684
|
} & VoiceRouteConfig<TContext, TSession, TResult>;
|
|
573
685
|
export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
@@ -575,7 +687,9 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
|
|
|
575
687
|
id: string;
|
|
576
688
|
context: TContext;
|
|
577
689
|
socket: VoiceSocket;
|
|
578
|
-
stt
|
|
690
|
+
stt?: STTAdapter;
|
|
691
|
+
realtime?: RealtimeAdapter;
|
|
692
|
+
realtimeInputFormat?: AudioFormat;
|
|
579
693
|
tts?: TTSAdapter;
|
|
580
694
|
languageStrategy?: VoiceLanguageStrategy;
|
|
581
695
|
lexicon?: VoiceLexiconEntry[];
|
|
@@ -584,10 +698,13 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
|
|
|
584
698
|
trace?: VoiceTraceEventStore;
|
|
585
699
|
reconnect: Required<VoiceReconnectConfig>;
|
|
586
700
|
phraseHints?: VoicePhraseHint[];
|
|
701
|
+
sessionMetadata?: Record<string, unknown>;
|
|
587
702
|
scenarioId?: string;
|
|
588
703
|
sttLifecycle: VoiceSTTLifecycle;
|
|
589
704
|
turnDetection: VoiceResolvedTurnDetectionConfig;
|
|
590
705
|
audioConditioning?: VoiceResolvedAudioConditioningConfig;
|
|
706
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
707
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
591
708
|
route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
|
|
592
709
|
logger?: VoiceLogger;
|
|
593
710
|
};
|
|
@@ -604,15 +721,34 @@ export type VoiceClientCloseMessage = {
|
|
|
604
721
|
type: 'close';
|
|
605
722
|
reason?: string;
|
|
606
723
|
};
|
|
724
|
+
export type VoiceClientCallControlMessage = {
|
|
725
|
+
type: 'call_control';
|
|
726
|
+
action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
|
|
727
|
+
metadata?: Record<string, unknown>;
|
|
728
|
+
reason?: string;
|
|
729
|
+
target?: string;
|
|
730
|
+
};
|
|
607
731
|
export type VoiceClientPingMessage = {
|
|
608
732
|
type: 'ping';
|
|
609
733
|
};
|
|
610
|
-
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientPingMessage;
|
|
734
|
+
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
|
|
611
735
|
export type VoiceServerSessionMessage = {
|
|
612
736
|
type: 'session';
|
|
613
737
|
sessionId: string;
|
|
614
738
|
status: VoiceSessionStatus;
|
|
615
739
|
scenarioId?: string;
|
|
740
|
+
sessionMetadata?: Record<string, unknown>;
|
|
741
|
+
};
|
|
742
|
+
export type VoiceServerReplayMessage<TResult = unknown> = {
|
|
743
|
+
type: 'replay';
|
|
744
|
+
assistantTexts: string[];
|
|
745
|
+
call?: VoiceCallLifecycleState;
|
|
746
|
+
partial: string;
|
|
747
|
+
scenarioId?: string;
|
|
748
|
+
sessionId: string;
|
|
749
|
+
sessionMetadata?: Record<string, unknown>;
|
|
750
|
+
status: VoiceSessionStatus;
|
|
751
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
616
752
|
};
|
|
617
753
|
export type VoiceServerPartialMessage = {
|
|
618
754
|
type: 'partial';
|
|
@@ -642,6 +778,11 @@ export type VoiceServerCompleteMessage = {
|
|
|
642
778
|
type: 'complete';
|
|
643
779
|
sessionId: string;
|
|
644
780
|
};
|
|
781
|
+
export type VoiceServerCallLifecycleMessage = {
|
|
782
|
+
type: 'call_lifecycle';
|
|
783
|
+
event: VoiceCallLifecycleEvent;
|
|
784
|
+
sessionId: string;
|
|
785
|
+
};
|
|
645
786
|
export type VoiceServerErrorMessage = {
|
|
646
787
|
type: 'error';
|
|
647
788
|
message: string;
|
|
@@ -650,17 +791,43 @@ export type VoiceServerErrorMessage = {
|
|
|
650
791
|
export type VoiceServerPongMessage = {
|
|
651
792
|
type: 'pong';
|
|
652
793
|
};
|
|
653
|
-
export type
|
|
794
|
+
export type VoiceServerConnectionMessage = {
|
|
795
|
+
type: 'connection';
|
|
796
|
+
reconnect: VoiceReconnectClientState;
|
|
797
|
+
};
|
|
798
|
+
export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
|
|
654
799
|
export type VoiceConnectionOptions = {
|
|
800
|
+
browserMedia?: false | VoiceBrowserMediaReporterOptions;
|
|
655
801
|
protocols?: string[];
|
|
656
802
|
scenarioId?: string;
|
|
657
803
|
reconnect?: boolean;
|
|
804
|
+
reconnectReportPath?: string;
|
|
658
805
|
maxReconnectAttempts?: number;
|
|
659
806
|
pingInterval?: number;
|
|
660
807
|
sessionId?: string;
|
|
661
808
|
};
|
|
809
|
+
export type VoiceBrowserMediaReportPayload = {
|
|
810
|
+
at: number;
|
|
811
|
+
continuity?: MediaWebRTCStreamContinuityReport;
|
|
812
|
+
report: MediaWebRTCStatsReport;
|
|
813
|
+
scenarioId?: string | null;
|
|
814
|
+
sessionId?: string | null;
|
|
815
|
+
};
|
|
816
|
+
export type VoiceBrowserMediaReporterOptions = Omit<MediaWebRTCStatsReportInput, 'peerConnection'> & {
|
|
817
|
+
fetch?: typeof fetch;
|
|
818
|
+
getPeerConnection?: (() => MediaWebRTCStatsCollector | null | undefined) | (() => Promise<MediaWebRTCStatsCollector | null | undefined>);
|
|
819
|
+
getScenarioId?: () => string | null | undefined;
|
|
820
|
+
getSessionId?: () => string | null | undefined;
|
|
821
|
+
intervalMs?: number;
|
|
822
|
+
continuity?: false | Omit<MediaWebRTCStreamContinuityInput, 'previousStats' | 'stats'>;
|
|
823
|
+
onError?: (error: unknown) => void;
|
|
824
|
+
onReport?: (payload: VoiceBrowserMediaReportPayload) => void;
|
|
825
|
+
path?: string;
|
|
826
|
+
peerConnection?: MediaWebRTCStatsCollector;
|
|
827
|
+
};
|
|
662
828
|
export type VoiceCaptureOptions = {
|
|
663
829
|
channelCount?: 1 | 2;
|
|
830
|
+
onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
|
|
664
831
|
onLevel?: (level: number) => void;
|
|
665
832
|
sampleRateHz?: number;
|
|
666
833
|
};
|
|
@@ -674,6 +841,46 @@ export type VoiceBargeInOptions = {
|
|
|
674
841
|
enabled?: boolean;
|
|
675
842
|
interruptOnPartial?: boolean;
|
|
676
843
|
interruptThreshold?: number;
|
|
844
|
+
monitor?: VoiceBargeInMonitor;
|
|
845
|
+
};
|
|
846
|
+
export type VoiceBargeInTriggerReason = 'input-level' | 'manual-audio' | 'manual-interrupt' | 'partial-transcript';
|
|
847
|
+
export type VoiceBargeInMonitorEvent = {
|
|
848
|
+
at: number;
|
|
849
|
+
id: string;
|
|
850
|
+
latencyMs?: number;
|
|
851
|
+
playbackStopLatencyMs?: number;
|
|
852
|
+
reason: VoiceBargeInTriggerReason;
|
|
853
|
+
sessionId?: string | null;
|
|
854
|
+
status: 'requested' | 'stopped' | 'skipped';
|
|
855
|
+
thresholdMs?: number;
|
|
856
|
+
};
|
|
857
|
+
export type VoiceBargeInMonitorSnapshot = {
|
|
858
|
+
averageLatencyMs?: number;
|
|
859
|
+
events: VoiceBargeInMonitorEvent[];
|
|
860
|
+
failed: number;
|
|
861
|
+
lastEvent?: VoiceBargeInMonitorEvent;
|
|
862
|
+
passed: number;
|
|
863
|
+
status: 'empty' | 'fail' | 'pass' | 'warn';
|
|
864
|
+
thresholdMs: number;
|
|
865
|
+
total: number;
|
|
866
|
+
};
|
|
867
|
+
export type VoiceBargeInMonitor = {
|
|
868
|
+
getSnapshot: () => VoiceBargeInMonitorSnapshot;
|
|
869
|
+
recordRequested: (input: {
|
|
870
|
+
reason: VoiceBargeInTriggerReason;
|
|
871
|
+
sessionId?: string | null;
|
|
872
|
+
}) => VoiceBargeInMonitorEvent;
|
|
873
|
+
recordSkipped: (input: {
|
|
874
|
+
reason: VoiceBargeInTriggerReason;
|
|
875
|
+
sessionId?: string | null;
|
|
876
|
+
}) => VoiceBargeInMonitorEvent;
|
|
877
|
+
recordStopped: (input: {
|
|
878
|
+
latencyMs?: number;
|
|
879
|
+
playbackStopLatencyMs?: number;
|
|
880
|
+
reason: VoiceBargeInTriggerReason;
|
|
881
|
+
sessionId?: string | null;
|
|
882
|
+
}) => VoiceBargeInMonitorEvent;
|
|
883
|
+
subscribe: (subscriber: () => void) => () => void;
|
|
677
884
|
};
|
|
678
885
|
export type VoiceAudioPlayerOptions = {
|
|
679
886
|
autoStart?: boolean;
|
|
@@ -728,9 +935,12 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
|
|
|
728
935
|
};
|
|
729
936
|
export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
|
|
730
937
|
export type VoiceStreamState<TResult = unknown> = {
|
|
938
|
+
call: VoiceCallLifecycleState | null;
|
|
939
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
731
940
|
sessionId: string | null;
|
|
732
941
|
scenarioId: string | null;
|
|
733
942
|
status: VoiceSessionStatus | 'idle';
|
|
943
|
+
reconnect: VoiceReconnectClientState;
|
|
734
944
|
partial: string;
|
|
735
945
|
turns: VoiceTurnRecord<TResult>[];
|
|
736
946
|
assistantTexts: string[];
|
|
@@ -744,6 +954,8 @@ export type VoiceStreamState<TResult = unknown> = {
|
|
|
744
954
|
isConnected: boolean;
|
|
745
955
|
};
|
|
746
956
|
export type VoiceStream<TResult = unknown> = {
|
|
957
|
+
call: VoiceCallLifecycleState | null;
|
|
958
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
|
|
747
959
|
close: () => void;
|
|
748
960
|
start: (input?: {
|
|
749
961
|
scenarioId?: string;
|
|
@@ -755,8 +967,10 @@ export type VoiceStream<TResult = unknown> = {
|
|
|
755
967
|
getSnapshot: () => VoiceStreamState<TResult>;
|
|
756
968
|
isConnected: boolean;
|
|
757
969
|
partial: string;
|
|
970
|
+
reconnect: VoiceReconnectClientState;
|
|
758
971
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
759
972
|
sessionId: string | null;
|
|
973
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
760
974
|
scenarioId: string | null;
|
|
761
975
|
status: VoiceSessionStatus | 'idle';
|
|
762
976
|
subscribe: (subscriber: () => void) => () => void;
|
|
@@ -810,6 +1024,8 @@ export type VoiceBargeInBinding = {
|
|
|
810
1024
|
};
|
|
811
1025
|
export type VoiceController<TResult = unknown> = {
|
|
812
1026
|
bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
|
|
1027
|
+
call: VoiceCallLifecycleState | null;
|
|
1028
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
|
|
813
1029
|
close: () => void;
|
|
814
1030
|
endTurn: () => void;
|
|
815
1031
|
start: (input?: {
|
|
@@ -822,9 +1038,11 @@ export type VoiceController<TResult = unknown> = {
|
|
|
822
1038
|
isConnected: boolean;
|
|
823
1039
|
isRecording: boolean;
|
|
824
1040
|
partial: string;
|
|
1041
|
+
reconnect: VoiceReconnectClientState;
|
|
825
1042
|
recordingError: string | null;
|
|
826
1043
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
827
1044
|
sessionId: string | null;
|
|
1045
|
+
sessionMetadata: Record<string, unknown> | null;
|
|
828
1046
|
scenarioId: string | null;
|
|
829
1047
|
startRecording: () => Promise<void>;
|
|
830
1048
|
status: VoiceSessionStatus | 'idle';
|
|
@@ -853,8 +1071,23 @@ export type VoiceHTMXBindingOptions = {
|
|
|
853
1071
|
export type VoiceStoreAction<TResult = unknown> = {
|
|
854
1072
|
type: 'session';
|
|
855
1073
|
sessionId: string;
|
|
1074
|
+
sessionMetadata?: Record<string, unknown>;
|
|
856
1075
|
scenarioId?: string;
|
|
857
1076
|
status: VoiceSessionStatus;
|
|
1077
|
+
} | {
|
|
1078
|
+
type: 'replay';
|
|
1079
|
+
assistantTexts: string[];
|
|
1080
|
+
call?: VoiceCallLifecycleState;
|
|
1081
|
+
partial: string;
|
|
1082
|
+
scenarioId?: string;
|
|
1083
|
+
sessionId: string;
|
|
1084
|
+
sessionMetadata?: Record<string, unknown>;
|
|
1085
|
+
status: VoiceSessionStatus;
|
|
1086
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
1087
|
+
} | {
|
|
1088
|
+
type: 'call_lifecycle';
|
|
1089
|
+
event: VoiceCallLifecycleEvent;
|
|
1090
|
+
sessionId: string;
|
|
858
1091
|
} | {
|
|
859
1092
|
type: 'partial';
|
|
860
1093
|
transcript: Transcript;
|
|
@@ -881,6 +1114,9 @@ export type VoiceStoreAction<TResult = unknown> = {
|
|
|
881
1114
|
message: string;
|
|
882
1115
|
} | {
|
|
883
1116
|
type: 'connected';
|
|
1117
|
+
} | {
|
|
1118
|
+
type: 'connection';
|
|
1119
|
+
reconnect: VoiceReconnectClientState;
|
|
884
1120
|
} | {
|
|
885
1121
|
type: 'disconnected';
|
|
886
1122
|
};
|