@absolutejs/voice 0.0.22-beta.24 → 0.0.22-beta.240
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 +3112 -236
- package/dist/agent.d.ts +62 -0
- package/dist/agentSquadContract.d.ts +69 -0
- package/dist/angular/index.d.ts +14 -0
- package/dist/angular/index.js +3266 -1097
- 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-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-contracts.service.d.ts +12 -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/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 +746 -0
- package/dist/campaignDialers.d.ts +90 -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 +64 -0
- package/dist/client/index.js +4594 -21
- 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/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/providerStatusWidget.d.ts +32 -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 +140 -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/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/incidentBundle.d.ts +116 -0
- package/dist/index.d.ts +128 -13
- package/dist/index.js +23685 -5200
- package/dist/latencySlo.d.ts +56 -0
- package/dist/liveLatency.d.ts +78 -0
- package/dist/liveOps.d.ts +122 -0
- package/dist/modelAdapters.d.ts +23 -2
- package/dist/observabilityExport.d.ts +428 -0
- package/dist/openaiRealtime.d.ts +27 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationsRecord.d.ts +158 -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 +115 -0
- package/dist/phoneAgent.d.ts +76 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/platformCoverage.d.ts +73 -0
- package/dist/postgresStore.d.ts +13 -2
- package/dist/productionReadiness.d.ts +466 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +1 -0
- package/dist/providerRoutingContract.d.ts +38 -0
- package/dist/providerSlo.d.ts +114 -0
- package/dist/providerStackRecommendations.d.ts +145 -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/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/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 +28 -0
- package/dist/react/index.js +4359 -33
- 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/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderContracts.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -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 +37 -0
- package/dist/reconnectContract.d.ts +87 -0
- package/dist/resilienceRoutes.d.ts +143 -0
- package/dist/sessionReplay.d.ts +12 -0
- package/dist/simulationSuite.d.ts +121 -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/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/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 +15 -0
- package/dist/svelte/index.js +4664 -439
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +254 -0
- package/dist/telephony/telnyx.d.ts +247 -0
- package/dist/telephony/twilio.d.ts +135 -2
- package/dist/telephonyOutcome.d.ts +201 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +2024 -69
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/toolContract.d.ts +133 -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/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/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/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 +26 -0
- package/dist/vue/index.js +4136 -57
- 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/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 +1 -1
- 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,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,122 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VoiceAuditEventStore } from './audit';
|
|
3
|
+
import { type VoiceTraceEventStore } from './trace';
|
|
4
|
+
export declare const VOICE_LIVE_OPS_ACTIONS: readonly ["assign", "create-task", "escalate", "force-handoff", "inject-instruction", "operator-takeover", "pause-assistant", "resume-assistant", "tag"];
|
|
5
|
+
export type VoiceLiveOpsAction = (typeof VOICE_LIVE_OPS_ACTIONS)[number];
|
|
6
|
+
export type VoiceLiveOpsControlStatus = 'assistant-paused' | 'assistant-resumed' | 'handoff-forced' | 'instruction-injected' | 'operator-takeover' | 'recorded';
|
|
7
|
+
export type VoiceLiveOpsControlState = {
|
|
8
|
+
assistantPaused: boolean;
|
|
9
|
+
handoffTarget?: string;
|
|
10
|
+
injectedInstruction?: string;
|
|
11
|
+
lastAction: VoiceLiveOpsAction;
|
|
12
|
+
lastUpdatedAt: number;
|
|
13
|
+
operator?: string;
|
|
14
|
+
operatorTakeover: boolean;
|
|
15
|
+
status: VoiceLiveOpsControlStatus;
|
|
16
|
+
tag?: string;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceLiveOpsActionInput = {
|
|
19
|
+
action: VoiceLiveOpsAction;
|
|
20
|
+
assignee?: string;
|
|
21
|
+
detail?: string;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
tag?: string;
|
|
24
|
+
};
|
|
25
|
+
export type VoiceLiveOpsActionResult = {
|
|
26
|
+
action: VoiceLiveOpsAction;
|
|
27
|
+
control: VoiceLiveOpsControlState;
|
|
28
|
+
ok: true;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
};
|
|
31
|
+
export type VoiceLiveOpsControlStore = {
|
|
32
|
+
get: (sessionId: string) => Promise<VoiceLiveOpsControlState | undefined> | VoiceLiveOpsControlState | undefined;
|
|
33
|
+
set: (sessionId: string, state: VoiceLiveOpsControlState) => Promise<void> | void;
|
|
34
|
+
};
|
|
35
|
+
export type VoiceLiveOpsControllerOptions = {
|
|
36
|
+
audit?: VoiceAuditEventStore;
|
|
37
|
+
defaultAssignee?: string;
|
|
38
|
+
defaultDetail?: string;
|
|
39
|
+
defaultTag?: string;
|
|
40
|
+
onAction?: (result: VoiceLiveOpsActionResult & {
|
|
41
|
+
assignee: string;
|
|
42
|
+
detail: string;
|
|
43
|
+
tag: string;
|
|
44
|
+
}) => Promise<void> | void;
|
|
45
|
+
store?: VoiceLiveOpsControlStore;
|
|
46
|
+
trace?: VoiceTraceEventStore;
|
|
47
|
+
};
|
|
48
|
+
export type VoiceLiveOpsRoutesOptions = VoiceLiveOpsControllerOptions & {
|
|
49
|
+
controlPath?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
path?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const createVoiceMemoryLiveOpsControlStore: () => VoiceLiveOpsControlStore;
|
|
54
|
+
export declare const getVoiceLiveOpsControlStatus: (action: VoiceLiveOpsAction) => VoiceLiveOpsControlStatus;
|
|
55
|
+
export declare const buildVoiceLiveOpsControlState: (input: VoiceLiveOpsActionInput & {
|
|
56
|
+
at?: number;
|
|
57
|
+
previous?: VoiceLiveOpsControlState;
|
|
58
|
+
}) => VoiceLiveOpsControlState;
|
|
59
|
+
export declare const createVoiceLiveOpsController: (options?: VoiceLiveOpsControllerOptions) => {
|
|
60
|
+
get: (sessionId: string) => VoiceLiveOpsControlState | Promise<VoiceLiveOpsControlState | undefined> | undefined;
|
|
61
|
+
perform: (input: VoiceLiveOpsActionInput) => Promise<VoiceLiveOpsActionResult>;
|
|
62
|
+
store: VoiceLiveOpsControlStore;
|
|
63
|
+
};
|
|
64
|
+
export declare const createVoiceLiveOpsRoutes: (options?: VoiceLiveOpsRoutesOptions) => Elysia<"", {
|
|
65
|
+
decorator: {};
|
|
66
|
+
store: {};
|
|
67
|
+
derive: {};
|
|
68
|
+
resolve: {};
|
|
69
|
+
}, {
|
|
70
|
+
typebox: {};
|
|
71
|
+
error: {};
|
|
72
|
+
}, {
|
|
73
|
+
schema: {};
|
|
74
|
+
standaloneSchema: {};
|
|
75
|
+
macro: {};
|
|
76
|
+
macroFn: {};
|
|
77
|
+
parser: {};
|
|
78
|
+
response: {};
|
|
79
|
+
}, {
|
|
80
|
+
[x: string]: {
|
|
81
|
+
post: {
|
|
82
|
+
body: unknown;
|
|
83
|
+
params: {};
|
|
84
|
+
query: unknown;
|
|
85
|
+
headers: unknown;
|
|
86
|
+
response: {
|
|
87
|
+
200: VoiceLiveOpsActionResult | {
|
|
88
|
+
error: string;
|
|
89
|
+
ok: boolean;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
} & {
|
|
95
|
+
[x: string]: {
|
|
96
|
+
get: {
|
|
97
|
+
body: unknown;
|
|
98
|
+
params: {};
|
|
99
|
+
query: unknown;
|
|
100
|
+
headers: unknown;
|
|
101
|
+
response: {
|
|
102
|
+
200: {
|
|
103
|
+
control: VoiceLiveOpsControlState | undefined;
|
|
104
|
+
ok: boolean;
|
|
105
|
+
sessionId: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
derive: {};
|
|
112
|
+
resolve: {};
|
|
113
|
+
schema: {};
|
|
114
|
+
standaloneSchema: {};
|
|
115
|
+
response: {};
|
|
116
|
+
}, {
|
|
117
|
+
derive: {};
|
|
118
|
+
resolve: {};
|
|
119
|
+
schema: {};
|
|
120
|
+
standaloneSchema: {};
|
|
121
|
+
response: {};
|
|
122
|
+
}>;
|
package/dist/modelAdapters.d.ts
CHANGED
|
@@ -36,9 +36,11 @@ export type GeminiVoiceAssistantModelOptions = {
|
|
|
36
36
|
};
|
|
37
37
|
export type VoiceProviderRouterEvent<TProvider extends string = string> = {
|
|
38
38
|
at: number;
|
|
39
|
+
attempt: number;
|
|
39
40
|
elapsedMs: number;
|
|
40
41
|
error?: string;
|
|
41
42
|
fallbackProvider?: TProvider;
|
|
43
|
+
latencyBudgetMs?: number;
|
|
42
44
|
provider: TProvider;
|
|
43
45
|
providerHealth?: VoiceProviderRouterProviderHealth<TProvider>;
|
|
44
46
|
rateLimited?: boolean;
|
|
@@ -47,18 +49,35 @@ export type VoiceProviderRouterEvent<TProvider extends string = string> = {
|
|
|
47
49
|
suppressionRemainingMs?: number;
|
|
48
50
|
suppressedUntil?: number;
|
|
49
51
|
status: 'error' | 'fallback' | 'success';
|
|
52
|
+
timedOut?: boolean;
|
|
50
53
|
};
|
|
51
54
|
export type VoiceProviderRouterFallbackMode = 'never' | 'provider-error' | 'rate-limit';
|
|
52
|
-
export type
|
|
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 | {
|
|
53
64
|
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
54
65
|
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
55
|
-
|
|
66
|
+
maxCost?: number;
|
|
67
|
+
maxLatencyMs?: number;
|
|
68
|
+
minQuality?: number;
|
|
69
|
+
scoreProvider?: (provider: TProvider, profile: VoiceProviderRouterProviderProfile | undefined) => number;
|
|
70
|
+
strategy?: VoiceProviderRouterStrategy;
|
|
71
|
+
weights?: VoiceProviderRouterPolicyWeights;
|
|
56
72
|
};
|
|
57
73
|
export type VoiceProviderRouterProviderProfile = {
|
|
58
74
|
cost?: number;
|
|
59
75
|
latencyMs?: number;
|
|
60
76
|
priority?: number;
|
|
77
|
+
quality?: number;
|
|
78
|
+
timeoutMs?: number;
|
|
61
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>>;
|
|
62
81
|
export type VoiceProviderRouterHealthOptions = {
|
|
63
82
|
cooldownMs?: number;
|
|
64
83
|
failureThreshold?: number;
|
|
@@ -79,10 +98,12 @@ export type VoiceProviderRouterOptions<TContext = unknown, TSession extends Voic
|
|
|
79
98
|
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
80
99
|
isProviderError?: (error: unknown, provider: TProvider) => boolean;
|
|
81
100
|
isRateLimitError?: (error: unknown, provider: TProvider) => boolean;
|
|
101
|
+
isTimeoutError?: (error: unknown, provider: TProvider) => boolean;
|
|
82
102
|
onProviderEvent?: (event: VoiceProviderRouterEvent<TProvider>, input: VoiceAgentModelInput<TContext, TSession>) => Promise<void> | void;
|
|
83
103
|
policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
|
|
84
104
|
providerHealth?: boolean | VoiceProviderRouterHealthOptions;
|
|
85
105
|
providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
|
|
106
|
+
timeoutMs?: number;
|
|
86
107
|
providers: Partial<Record<TProvider, VoiceAgentModel<TContext, TSession, TResult>>>;
|
|
87
108
|
selectProvider?: (input: VoiceAgentModelInput<TContext, TSession>) => TProvider | undefined | Promise<TProvider | undefined>;
|
|
88
109
|
};
|