@absolutejs/voice 0.0.22-beta.3 → 0.0.22-beta.300
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 +3232 -82
- package/dist/agent.d.ts +62 -0
- package/dist/agentSquadContract.d.ts +98 -0
- package/dist/angular/index.d.ts +17 -0
- package/dist/angular/index.js +3598 -1058
- 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-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-stream.service.d.ts +3 -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/assistant.d.ts +20 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/assistantMemory.d.ts +63 -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/campaign.d.ts +768 -0
- package/dist/campaignDialers.d.ts +111 -0
- package/dist/client/actions.d.ts +105 -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/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 +747 -15
- package/dist/client/index.d.ts +72 -0
- package/dist/client/index.js +5371 -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/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 +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/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 +17 -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 +151 -10
- package/dist/index.js +28252 -3426
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +190 -0
- package/dist/modelAdapters.d.ts +151 -0
- package/dist/observabilityExport.d.ts +481 -0
- package/dist/openaiRealtime.d.ts +27 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationsRecord.d.ts +254 -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 +559 -0
- package/dist/proofTrends.d.ts +133 -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/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/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/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 +33 -0
- package/dist/react/index.js +5188 -14
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +3 -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/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/useVoiceStream.d.ts +3 -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/reconnectContract.d.ts +88 -0
- package/dist/resilienceRoutes.d.ts +143 -0
- package/dist/sessionReplay.d.ts +187 -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/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/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 +18 -0
- package/dist/svelte/index.js +5036 -407
- 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 +135 -2
- package/dist/telephonyOutcome.d.ts +273 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +3206 -180
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/toolContract.d.ts +161 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +19 -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 +180 -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/VoiceTurnLatency.d.ts +69 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +31 -0
- package/dist/vue/index.js +4962 -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/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 +775 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceStream.d.ts +4 -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 +1 -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
|
@@ -3,6 +3,7 @@ import type { VoiceOpsDispositionTaskPolicies, VoiceOpsTaskAssignmentRule, Voice
|
|
|
3
3
|
import type { VoiceIntegrationSink } from './opsSinks';
|
|
4
4
|
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
5
5
|
import type { VoiceTraceEventStore } from './trace';
|
|
6
|
+
import type { VoiceLiveOpsControlState } from './liveOps';
|
|
6
7
|
export type AudioFormat = {
|
|
7
8
|
container: 'raw';
|
|
8
9
|
encoding: 'alaw' | 'mulaw' | 'pcm_s16le';
|
|
@@ -193,6 +194,15 @@ export type RealtimeAdapter<TOptions extends RealtimeAdapterOpenOptions = Realti
|
|
|
193
194
|
open: (options: TOptions) => Promise<RealtimeAdapterSession> | RealtimeAdapterSession;
|
|
194
195
|
};
|
|
195
196
|
export type VoiceSessionStatus = 'active' | 'reconnecting' | 'completed' | 'failed';
|
|
197
|
+
export type VoiceReconnectClientStatus = 'idle' | 'reconnecting' | 'resumed' | 'exhausted';
|
|
198
|
+
export type VoiceReconnectClientState = {
|
|
199
|
+
attempts: number;
|
|
200
|
+
lastDisconnectAt?: number;
|
|
201
|
+
lastResumedAt?: number;
|
|
202
|
+
maxAttempts: number;
|
|
203
|
+
nextAttemptAt?: number;
|
|
204
|
+
status: VoiceReconnectClientStatus;
|
|
205
|
+
};
|
|
196
206
|
export type VoiceTurnRecord<TResult = unknown> = {
|
|
197
207
|
id: string;
|
|
198
208
|
text: string;
|
|
@@ -269,6 +279,65 @@ export type VoiceCallLifecycleState = {
|
|
|
269
279
|
lastEventAt: number;
|
|
270
280
|
startedAt: number;
|
|
271
281
|
};
|
|
282
|
+
export type VoiceHandoffAction = 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
|
|
283
|
+
export type VoiceHandoffStatus = 'delivered' | 'failed' | 'skipped';
|
|
284
|
+
export type VoiceHandoffResult = {
|
|
285
|
+
deliveredAt?: number;
|
|
286
|
+
deliveredTo?: string;
|
|
287
|
+
error?: string;
|
|
288
|
+
metadata?: Record<string, unknown>;
|
|
289
|
+
status: VoiceHandoffStatus;
|
|
290
|
+
};
|
|
291
|
+
export type VoiceHandoffDeliveryQueueStatus = VoiceHandoffStatus | 'pending';
|
|
292
|
+
export type StoredVoiceHandoffDelivery<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
293
|
+
action: VoiceHandoffAction;
|
|
294
|
+
context: TContext;
|
|
295
|
+
createdAt: number;
|
|
296
|
+
deliveredAt?: number;
|
|
297
|
+
deliveries?: Record<string, VoiceHandoffResult & {
|
|
298
|
+
adapterId: string;
|
|
299
|
+
adapterKind?: string;
|
|
300
|
+
}>;
|
|
301
|
+
deliveryAttempts?: number;
|
|
302
|
+
deliveryError?: string;
|
|
303
|
+
deliveryStatus: VoiceHandoffDeliveryQueueStatus;
|
|
304
|
+
id: string;
|
|
305
|
+
metadata?: Record<string, unknown>;
|
|
306
|
+
reason?: string;
|
|
307
|
+
result?: TResult;
|
|
308
|
+
session: TSession;
|
|
309
|
+
sessionId: string;
|
|
310
|
+
target?: string;
|
|
311
|
+
updatedAt: number;
|
|
312
|
+
};
|
|
313
|
+
export type VoiceHandoffDeliveryStore<TDelivery extends StoredVoiceHandoffDelivery = StoredVoiceHandoffDelivery> = {
|
|
314
|
+
get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
|
|
315
|
+
list: () => Promise<TDelivery[]> | TDelivery[];
|
|
316
|
+
remove: (id: string) => Promise<void> | void;
|
|
317
|
+
set: (id: string, delivery: TDelivery) => Promise<void> | void;
|
|
318
|
+
};
|
|
319
|
+
export type VoiceHandoffInput<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
320
|
+
action: VoiceHandoffAction;
|
|
321
|
+
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
322
|
+
context: TContext;
|
|
323
|
+
metadata?: Record<string, unknown>;
|
|
324
|
+
reason?: string;
|
|
325
|
+
result?: TResult;
|
|
326
|
+
session: TSession;
|
|
327
|
+
target?: string;
|
|
328
|
+
};
|
|
329
|
+
export type VoiceHandoffAdapter<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
330
|
+
actions?: VoiceHandoffAction[];
|
|
331
|
+
handoff: (input: VoiceHandoffInput<TContext, TSession, TResult>) => Promise<VoiceHandoffResult> | VoiceHandoffResult;
|
|
332
|
+
id: string;
|
|
333
|
+
kind?: string;
|
|
334
|
+
};
|
|
335
|
+
export type VoiceHandoffConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
336
|
+
adapters: VoiceHandoffAdapter<TContext, TSession, TResult>[];
|
|
337
|
+
deliveryQueue?: VoiceHandoffDeliveryStore<StoredVoiceHandoffDelivery<TContext, TSession, TResult>>;
|
|
338
|
+
enqueueOnly?: boolean;
|
|
339
|
+
failMode?: 'record' | 'throw';
|
|
340
|
+
};
|
|
272
341
|
export type VoiceSessionStore<TSession extends VoiceSessionRecord = VoiceSessionRecord> = SessionStore<TSession, VoiceSessionSummary>;
|
|
273
342
|
export type VoiceLogger = {
|
|
274
343
|
debug?: (message: string, meta?: Record<string, unknown>) => void;
|
|
@@ -416,6 +485,10 @@ export type VoiceLexiconResolver<TContext = unknown> = (input: {
|
|
|
416
485
|
}) => Promise<VoiceLexiconEntry[] | void> | VoiceLexiconEntry[] | void;
|
|
417
486
|
export type VoiceOnTurnObjectHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: {
|
|
418
487
|
context: TContext;
|
|
488
|
+
liveOps?: {
|
|
489
|
+
control: VoiceLiveOpsControlState;
|
|
490
|
+
injectedInstruction?: string;
|
|
491
|
+
};
|
|
419
492
|
session: TSession;
|
|
420
493
|
turn: VoiceTurnRecord;
|
|
421
494
|
api: VoiceSessionHandle<TContext, TSession, TResult>;
|
|
@@ -537,6 +610,9 @@ export type VoiceRuntimeOpsConfig<TContext = unknown, TSession extends VoiceSess
|
|
|
537
610
|
tasks?: VoiceOpsTaskStore;
|
|
538
611
|
webhook?: VoiceIntegrationWebhookConfig;
|
|
539
612
|
};
|
|
613
|
+
export type VoiceLiveOpsRuntimeConfig = {
|
|
614
|
+
getControl: (sessionId: string) => Promise<VoiceLiveOpsControlState | null | undefined> | VoiceLiveOpsControlState | null | undefined;
|
|
615
|
+
};
|
|
540
616
|
export type VoiceNormalizedRouteConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoiceRouteConfig<TContext, TSession, TResult>, 'onTurn'> & {
|
|
541
617
|
onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
|
|
542
618
|
};
|
|
@@ -557,9 +633,11 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
557
633
|
lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
|
|
558
634
|
phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
|
|
559
635
|
preset?: VoiceRuntimePreset;
|
|
560
|
-
stt
|
|
636
|
+
stt?: STTAdapter;
|
|
561
637
|
sttFallback?: VoiceSTTFallbackConfig;
|
|
562
638
|
sttLifecycle?: VoiceSTTLifecycle;
|
|
639
|
+
realtime?: RealtimeAdapter;
|
|
640
|
+
realtimeInputFormat?: AudioFormat;
|
|
563
641
|
tts?: TTSAdapter;
|
|
564
642
|
session: VoiceSessionStore<NoInfer<TSession>>;
|
|
565
643
|
reconnect?: VoiceReconnectConfig;
|
|
@@ -567,7 +645,9 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
567
645
|
audioConditioning?: VoiceAudioConditioningConfig;
|
|
568
646
|
logger?: VoiceLogger;
|
|
569
647
|
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
|
|
648
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
570
649
|
ops?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
|
|
650
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
571
651
|
trace?: VoiceTraceEventStore;
|
|
572
652
|
} & VoiceRouteConfig<TContext, TSession, TResult>;
|
|
573
653
|
export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
@@ -575,7 +655,9 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
|
|
|
575
655
|
id: string;
|
|
576
656
|
context: TContext;
|
|
577
657
|
socket: VoiceSocket;
|
|
578
|
-
stt
|
|
658
|
+
stt?: STTAdapter;
|
|
659
|
+
realtime?: RealtimeAdapter;
|
|
660
|
+
realtimeInputFormat?: AudioFormat;
|
|
579
661
|
tts?: TTSAdapter;
|
|
580
662
|
languageStrategy?: VoiceLanguageStrategy;
|
|
581
663
|
lexicon?: VoiceLexiconEntry[];
|
|
@@ -588,6 +670,8 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
|
|
|
588
670
|
sttLifecycle: VoiceSTTLifecycle;
|
|
589
671
|
turnDetection: VoiceResolvedTurnDetectionConfig;
|
|
590
672
|
audioConditioning?: VoiceResolvedAudioConditioningConfig;
|
|
673
|
+
handoff?: VoiceHandoffConfig<TContext, TSession, TResult>;
|
|
674
|
+
liveOps?: VoiceLiveOpsRuntimeConfig;
|
|
591
675
|
route: VoiceNormalizedRouteConfig<TContext, TSession, TResult>;
|
|
592
676
|
logger?: VoiceLogger;
|
|
593
677
|
};
|
|
@@ -604,16 +688,33 @@ export type VoiceClientCloseMessage = {
|
|
|
604
688
|
type: 'close';
|
|
605
689
|
reason?: string;
|
|
606
690
|
};
|
|
691
|
+
export type VoiceClientCallControlMessage = {
|
|
692
|
+
type: 'call_control';
|
|
693
|
+
action: 'complete' | 'escalate' | 'no-answer' | 'transfer' | 'voicemail';
|
|
694
|
+
metadata?: Record<string, unknown>;
|
|
695
|
+
reason?: string;
|
|
696
|
+
target?: string;
|
|
697
|
+
};
|
|
607
698
|
export type VoiceClientPingMessage = {
|
|
608
699
|
type: 'ping';
|
|
609
700
|
};
|
|
610
|
-
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientPingMessage;
|
|
701
|
+
export type VoiceClientMessage = VoiceClientStartMessage | VoiceClientEndTurnMessage | VoiceClientCloseMessage | VoiceClientCallControlMessage | VoiceClientPingMessage;
|
|
611
702
|
export type VoiceServerSessionMessage = {
|
|
612
703
|
type: 'session';
|
|
613
704
|
sessionId: string;
|
|
614
705
|
status: VoiceSessionStatus;
|
|
615
706
|
scenarioId?: string;
|
|
616
707
|
};
|
|
708
|
+
export type VoiceServerReplayMessage<TResult = unknown> = {
|
|
709
|
+
type: 'replay';
|
|
710
|
+
assistantTexts: string[];
|
|
711
|
+
call?: VoiceCallLifecycleState;
|
|
712
|
+
partial: string;
|
|
713
|
+
scenarioId?: string;
|
|
714
|
+
sessionId: string;
|
|
715
|
+
status: VoiceSessionStatus;
|
|
716
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
717
|
+
};
|
|
617
718
|
export type VoiceServerPartialMessage = {
|
|
618
719
|
type: 'partial';
|
|
619
720
|
transcript: Transcript;
|
|
@@ -642,6 +743,11 @@ export type VoiceServerCompleteMessage = {
|
|
|
642
743
|
type: 'complete';
|
|
643
744
|
sessionId: string;
|
|
644
745
|
};
|
|
746
|
+
export type VoiceServerCallLifecycleMessage = {
|
|
747
|
+
type: 'call_lifecycle';
|
|
748
|
+
event: VoiceCallLifecycleEvent;
|
|
749
|
+
sessionId: string;
|
|
750
|
+
};
|
|
645
751
|
export type VoiceServerErrorMessage = {
|
|
646
752
|
type: 'error';
|
|
647
753
|
message: string;
|
|
@@ -650,17 +756,23 @@ export type VoiceServerErrorMessage = {
|
|
|
650
756
|
export type VoiceServerPongMessage = {
|
|
651
757
|
type: 'pong';
|
|
652
758
|
};
|
|
653
|
-
export type
|
|
759
|
+
export type VoiceServerConnectionMessage = {
|
|
760
|
+
type: 'connection';
|
|
761
|
+
reconnect: VoiceReconnectClientState;
|
|
762
|
+
};
|
|
763
|
+
export type VoiceServerMessage<TResult = unknown> = VoiceServerSessionMessage | VoiceServerReplayMessage<TResult> | VoiceServerPartialMessage | VoiceServerFinalMessage | VoiceServerTurnMessage<TResult> | VoiceServerAssistantMessage | VoiceServerAudioMessage | VoiceServerCallLifecycleMessage | VoiceServerCompleteMessage | VoiceServerErrorMessage | VoiceServerPongMessage | VoiceServerConnectionMessage;
|
|
654
764
|
export type VoiceConnectionOptions = {
|
|
655
765
|
protocols?: string[];
|
|
656
766
|
scenarioId?: string;
|
|
657
767
|
reconnect?: boolean;
|
|
768
|
+
reconnectReportPath?: string;
|
|
658
769
|
maxReconnectAttempts?: number;
|
|
659
770
|
pingInterval?: number;
|
|
660
771
|
sessionId?: string;
|
|
661
772
|
};
|
|
662
773
|
export type VoiceCaptureOptions = {
|
|
663
774
|
channelCount?: 1 | 2;
|
|
775
|
+
onAudio?: (audio: Uint8Array | ArrayBuffer, sendAudio: (audio: Uint8Array | ArrayBuffer) => void) => void;
|
|
664
776
|
onLevel?: (level: number) => void;
|
|
665
777
|
sampleRateHz?: number;
|
|
666
778
|
};
|
|
@@ -674,6 +786,46 @@ export type VoiceBargeInOptions = {
|
|
|
674
786
|
enabled?: boolean;
|
|
675
787
|
interruptOnPartial?: boolean;
|
|
676
788
|
interruptThreshold?: number;
|
|
789
|
+
monitor?: VoiceBargeInMonitor;
|
|
790
|
+
};
|
|
791
|
+
export type VoiceBargeInTriggerReason = 'input-level' | 'manual-audio' | 'manual-interrupt' | 'partial-transcript';
|
|
792
|
+
export type VoiceBargeInMonitorEvent = {
|
|
793
|
+
at: number;
|
|
794
|
+
id: string;
|
|
795
|
+
latencyMs?: number;
|
|
796
|
+
playbackStopLatencyMs?: number;
|
|
797
|
+
reason: VoiceBargeInTriggerReason;
|
|
798
|
+
sessionId?: string | null;
|
|
799
|
+
status: 'requested' | 'stopped' | 'skipped';
|
|
800
|
+
thresholdMs?: number;
|
|
801
|
+
};
|
|
802
|
+
export type VoiceBargeInMonitorSnapshot = {
|
|
803
|
+
averageLatencyMs?: number;
|
|
804
|
+
events: VoiceBargeInMonitorEvent[];
|
|
805
|
+
failed: number;
|
|
806
|
+
lastEvent?: VoiceBargeInMonitorEvent;
|
|
807
|
+
passed: number;
|
|
808
|
+
status: 'empty' | 'fail' | 'pass' | 'warn';
|
|
809
|
+
thresholdMs: number;
|
|
810
|
+
total: number;
|
|
811
|
+
};
|
|
812
|
+
export type VoiceBargeInMonitor = {
|
|
813
|
+
getSnapshot: () => VoiceBargeInMonitorSnapshot;
|
|
814
|
+
recordRequested: (input: {
|
|
815
|
+
reason: VoiceBargeInTriggerReason;
|
|
816
|
+
sessionId?: string | null;
|
|
817
|
+
}) => VoiceBargeInMonitorEvent;
|
|
818
|
+
recordSkipped: (input: {
|
|
819
|
+
reason: VoiceBargeInTriggerReason;
|
|
820
|
+
sessionId?: string | null;
|
|
821
|
+
}) => VoiceBargeInMonitorEvent;
|
|
822
|
+
recordStopped: (input: {
|
|
823
|
+
latencyMs?: number;
|
|
824
|
+
playbackStopLatencyMs?: number;
|
|
825
|
+
reason: VoiceBargeInTriggerReason;
|
|
826
|
+
sessionId?: string | null;
|
|
827
|
+
}) => VoiceBargeInMonitorEvent;
|
|
828
|
+
subscribe: (subscriber: () => void) => () => void;
|
|
677
829
|
};
|
|
678
830
|
export type VoiceAudioPlayerOptions = {
|
|
679
831
|
autoStart?: boolean;
|
|
@@ -728,9 +880,11 @@ export type VoiceHTMXOptions<TSession extends VoiceSessionRecord = VoiceSessionR
|
|
|
728
880
|
};
|
|
729
881
|
export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderer<TSession, TResult> | VoiceHTMXOptions<TSession, TResult>;
|
|
730
882
|
export type VoiceStreamState<TResult = unknown> = {
|
|
883
|
+
call: VoiceCallLifecycleState | null;
|
|
731
884
|
sessionId: string | null;
|
|
732
885
|
scenarioId: string | null;
|
|
733
886
|
status: VoiceSessionStatus | 'idle';
|
|
887
|
+
reconnect: VoiceReconnectClientState;
|
|
734
888
|
partial: string;
|
|
735
889
|
turns: VoiceTurnRecord<TResult>[];
|
|
736
890
|
assistantTexts: string[];
|
|
@@ -744,6 +898,8 @@ export type VoiceStreamState<TResult = unknown> = {
|
|
|
744
898
|
isConnected: boolean;
|
|
745
899
|
};
|
|
746
900
|
export type VoiceStream<TResult = unknown> = {
|
|
901
|
+
call: VoiceCallLifecycleState | null;
|
|
902
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
|
|
747
903
|
close: () => void;
|
|
748
904
|
start: (input?: {
|
|
749
905
|
scenarioId?: string;
|
|
@@ -755,6 +911,7 @@ export type VoiceStream<TResult = unknown> = {
|
|
|
755
911
|
getSnapshot: () => VoiceStreamState<TResult>;
|
|
756
912
|
isConnected: boolean;
|
|
757
913
|
partial: string;
|
|
914
|
+
reconnect: VoiceReconnectClientState;
|
|
758
915
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
759
916
|
sessionId: string | null;
|
|
760
917
|
scenarioId: string | null;
|
|
@@ -810,6 +967,8 @@ export type VoiceBargeInBinding = {
|
|
|
810
967
|
};
|
|
811
968
|
export type VoiceController<TResult = unknown> = {
|
|
812
969
|
bindHTMX: (options: VoiceHTMXBindingOptions) => () => void;
|
|
970
|
+
call: VoiceCallLifecycleState | null;
|
|
971
|
+
callControl: (message: Omit<VoiceClientCallControlMessage, 'type'>) => void;
|
|
813
972
|
close: () => void;
|
|
814
973
|
endTurn: () => void;
|
|
815
974
|
start: (input?: {
|
|
@@ -822,6 +981,7 @@ export type VoiceController<TResult = unknown> = {
|
|
|
822
981
|
isConnected: boolean;
|
|
823
982
|
isRecording: boolean;
|
|
824
983
|
partial: string;
|
|
984
|
+
reconnect: VoiceReconnectClientState;
|
|
825
985
|
recordingError: string | null;
|
|
826
986
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
827
987
|
sessionId: string | null;
|
|
@@ -855,6 +1015,19 @@ export type VoiceStoreAction<TResult = unknown> = {
|
|
|
855
1015
|
sessionId: string;
|
|
856
1016
|
scenarioId?: string;
|
|
857
1017
|
status: VoiceSessionStatus;
|
|
1018
|
+
} | {
|
|
1019
|
+
type: 'replay';
|
|
1020
|
+
assistantTexts: string[];
|
|
1021
|
+
call?: VoiceCallLifecycleState;
|
|
1022
|
+
partial: string;
|
|
1023
|
+
scenarioId?: string;
|
|
1024
|
+
sessionId: string;
|
|
1025
|
+
status: VoiceSessionStatus;
|
|
1026
|
+
turns: VoiceTurnRecord<TResult>[];
|
|
1027
|
+
} | {
|
|
1028
|
+
type: 'call_lifecycle';
|
|
1029
|
+
event: VoiceCallLifecycleEvent;
|
|
1030
|
+
sessionId: string;
|
|
858
1031
|
} | {
|
|
859
1032
|
type: 'partial';
|
|
860
1033
|
transcript: Transcript;
|
|
@@ -881,6 +1054,9 @@ export type VoiceStoreAction<TResult = unknown> = {
|
|
|
881
1054
|
message: string;
|
|
882
1055
|
} | {
|
|
883
1056
|
type: 'connected';
|
|
1057
|
+
} | {
|
|
1058
|
+
type: 'connection';
|
|
1059
|
+
reconnect: VoiceReconnectClientState;
|
|
884
1060
|
} | {
|
|
885
1061
|
type: 'disconnected';
|
|
886
1062
|
};
|