@absolutejs/voice 0.0.22-beta.2 → 0.0.22-beta.200
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 +1370 -50
- package/dist/agent.d.ts +62 -0
- package/dist/agentSquadContract.d.ts +69 -0
- package/dist/angular/index.d.ts +13 -0
- package/dist/angular/index.js +3100 -1051
- 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-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-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 +44 -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 +746 -0
- package/dist/campaignDialers.d.ts +90 -0
- package/dist/client/actions.d.ts +105 -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 +60 -0
- package/dist/client/index.js +4308 -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/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/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 +213 -0
- package/dist/fileStore.d.ts +17 -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 +130 -11
- package/dist/index.js +21890 -3707
- 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 +114 -0
- package/dist/openaiRealtime.d.ts +27 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/operationsRecord.d.ts +157 -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 +112 -0
- package/dist/phoneAgent.d.ts +62 -0
- package/dist/phoneAgentProductionSmoke.d.ts +115 -0
- package/dist/postgresStore.d.ts +13 -2
- package/dist/productionReadiness.d.ts +407 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/providerRoutingContract.d.ts +38 -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/VoiceDeliveryRuntime.d.ts +7 -0
- package/dist/react/VoiceOpsActionCenter.d.ts +5 -0
- package/dist/react/VoiceOpsStatus.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 +25 -0
- package/dist/react/index.js +3903 -14
- 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/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/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 +36 -0
- package/dist/reconnectContract.d.ts +87 -0
- package/dist/resilienceRoutes.d.ts +142 -0
- package/dist/sessionReplay.d.ts +187 -0
- package/dist/simulationSuite.d.ts +120 -0
- package/dist/sqliteStore.d.ts +13 -2
- 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/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/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 +14 -0
- package/dist/svelte/index.js +4446 -406
- 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 +2 -0
- package/dist/testing/index.js +2996 -156
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/toolContract.d.ts +130 -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 +96 -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/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 +24 -0
- package/dist/vue/index.js +3829 -31
- 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/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/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
|
+
}>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput } from './agent';
|
|
2
|
+
import type { VoiceSessionRecord } from './types';
|
|
3
|
+
export type VoiceJSONAssistantModelHandler<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = (input: VoiceAgentModelInput<TContext, TSession>) => Promise<Record<string, unknown> | VoiceAgentModelOutput<TResult>> | Record<string, unknown> | VoiceAgentModelOutput<TResult>;
|
|
4
|
+
export type VoiceJSONAssistantModelOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
5
|
+
generate: VoiceJSONAssistantModelHandler<TContext, TSession, TResult>;
|
|
6
|
+
mapOutput?: (output: Record<string, unknown>) => VoiceAgentModelOutput<TResult>;
|
|
7
|
+
};
|
|
8
|
+
export type OpenAIVoiceAssistantModelOptions = {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
maxOutputTokens?: number;
|
|
13
|
+
model?: string;
|
|
14
|
+
onUsage?: (usage: Record<string, unknown>) => Promise<void> | void;
|
|
15
|
+
temperature?: number;
|
|
16
|
+
};
|
|
17
|
+
export type AnthropicVoiceAssistantModelOptions = {
|
|
18
|
+
apiKey: string;
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
fetch?: typeof fetch;
|
|
21
|
+
maxOutputTokens?: number;
|
|
22
|
+
model?: string;
|
|
23
|
+
onUsage?: (usage: Record<string, unknown>) => Promise<void> | void;
|
|
24
|
+
temperature?: number;
|
|
25
|
+
version?: string;
|
|
26
|
+
};
|
|
27
|
+
export type GeminiVoiceAssistantModelOptions = {
|
|
28
|
+
apiKey: string;
|
|
29
|
+
baseUrl?: string;
|
|
30
|
+
fetch?: typeof fetch;
|
|
31
|
+
maxOutputTokens?: number;
|
|
32
|
+
maxRetries?: number;
|
|
33
|
+
model?: string;
|
|
34
|
+
onUsage?: (usage: Record<string, unknown>) => Promise<void> | void;
|
|
35
|
+
temperature?: number;
|
|
36
|
+
};
|
|
37
|
+
export type VoiceProviderRouterEvent<TProvider extends string = string> = {
|
|
38
|
+
at: number;
|
|
39
|
+
attempt: number;
|
|
40
|
+
elapsedMs: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
fallbackProvider?: TProvider;
|
|
43
|
+
latencyBudgetMs?: number;
|
|
44
|
+
provider: TProvider;
|
|
45
|
+
providerHealth?: VoiceProviderRouterProviderHealth<TProvider>;
|
|
46
|
+
rateLimited?: boolean;
|
|
47
|
+
recovered?: boolean;
|
|
48
|
+
selectedProvider: TProvider;
|
|
49
|
+
suppressionRemainingMs?: number;
|
|
50
|
+
suppressedUntil?: number;
|
|
51
|
+
status: 'error' | 'fallback' | 'success';
|
|
52
|
+
timedOut?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type VoiceProviderRouterFallbackMode = 'never' | 'provider-error' | 'rate-limit';
|
|
55
|
+
export type VoiceProviderRouterStrategy = 'balanced' | 'ordered' | 'prefer-cheapest' | 'prefer-fastest' | 'prefer-selected' | 'quality-first';
|
|
56
|
+
export type VoiceProviderRouterPolicyPreset = 'balanced' | 'cost-cap' | 'cost-first' | 'latency-first' | 'quality-first';
|
|
57
|
+
export type VoiceProviderRouterPolicyWeights = {
|
|
58
|
+
cost?: number;
|
|
59
|
+
latencyMs?: number;
|
|
60
|
+
priority?: number;
|
|
61
|
+
quality?: number;
|
|
62
|
+
};
|
|
63
|
+
export type VoiceProviderRouterPolicy<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TProvider extends string = string> = VoiceProviderRouterStrategy | VoiceProviderRouterPolicyPreset | {
|
|
64
|
+
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
65
|
+
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
66
|
+
maxCost?: number;
|
|
67
|
+
maxLatencyMs?: number;
|
|
68
|
+
minQuality?: number;
|
|
69
|
+
scoreProvider?: (provider: TProvider, profile: VoiceProviderRouterProviderProfile | undefined) => number;
|
|
70
|
+
strategy?: VoiceProviderRouterStrategy;
|
|
71
|
+
weights?: VoiceProviderRouterPolicyWeights;
|
|
72
|
+
};
|
|
73
|
+
export type VoiceProviderRouterProviderProfile = {
|
|
74
|
+
cost?: number;
|
|
75
|
+
latencyMs?: number;
|
|
76
|
+
priority?: number;
|
|
77
|
+
quality?: number;
|
|
78
|
+
timeoutMs?: number;
|
|
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>>;
|
|
81
|
+
export type VoiceProviderRouterHealthOptions = {
|
|
82
|
+
cooldownMs?: number;
|
|
83
|
+
failureThreshold?: number;
|
|
84
|
+
now?: () => number;
|
|
85
|
+
rateLimitCooldownMs?: number;
|
|
86
|
+
};
|
|
87
|
+
export type VoiceProviderRouterProviderHealth<TProvider extends string = string> = {
|
|
88
|
+
consecutiveFailures: number;
|
|
89
|
+
lastFailureAt?: number;
|
|
90
|
+
lastRateLimitedAt?: number;
|
|
91
|
+
provider: TProvider;
|
|
92
|
+
status: 'healthy' | 'suppressed';
|
|
93
|
+
suppressedUntil?: number;
|
|
94
|
+
};
|
|
95
|
+
export type VoiceProviderRouterOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown, TProvider extends string = string> = {
|
|
96
|
+
allowProviders?: readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
97
|
+
fallback?: TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
|
|
98
|
+
fallbackMode?: VoiceProviderRouterFallbackMode;
|
|
99
|
+
isProviderError?: (error: unknown, provider: TProvider) => boolean;
|
|
100
|
+
isRateLimitError?: (error: unknown, provider: TProvider) => boolean;
|
|
101
|
+
isTimeoutError?: (error: unknown, provider: TProvider) => boolean;
|
|
102
|
+
onProviderEvent?: (event: VoiceProviderRouterEvent<TProvider>, input: VoiceAgentModelInput<TContext, TSession>) => Promise<void> | void;
|
|
103
|
+
policy?: VoiceProviderRouterPolicy<TContext, TSession, TProvider>;
|
|
104
|
+
providerHealth?: boolean | VoiceProviderRouterHealthOptions;
|
|
105
|
+
providerProfiles?: Partial<Record<TProvider, VoiceProviderRouterProviderProfile>>;
|
|
106
|
+
timeoutMs?: number;
|
|
107
|
+
providers: Partial<Record<TProvider, VoiceAgentModel<TContext, TSession, TResult>>>;
|
|
108
|
+
selectProvider?: (input: VoiceAgentModelInput<TContext, TSession>) => TProvider | undefined | Promise<TProvider | undefined>;
|
|
109
|
+
};
|
|
110
|
+
export declare const createJSONVoiceAssistantModel: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoiceJSONAssistantModelOptions<TContext, TSession, TResult>) => VoiceAgentModel<TContext, TSession, TResult>;
|
|
111
|
+
export declare const createVoiceProviderRouter: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown, TProvider extends string = string>(options: VoiceProviderRouterOptions<TContext, TSession, TResult, TProvider>) => VoiceAgentModel<TContext, TSession, TResult>;
|
|
112
|
+
export declare const createOpenAIVoiceAssistantModel: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: OpenAIVoiceAssistantModelOptions) => VoiceAgentModel<TContext, TSession, TResult>;
|
|
113
|
+
export declare const createAnthropicVoiceAssistantModel: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: AnthropicVoiceAssistantModelOptions) => VoiceAgentModel<TContext, TSession, TResult>;
|
|
114
|
+
export declare const createGeminiVoiceAssistantModel: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: GeminiVoiceAssistantModelOptions) => VoiceAgentModel<TContext, TSession, TResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RealtimeAdapter } from './types';
|
|
2
|
+
export type OpenAIRealtimeModel = 'gpt-realtime' | 'gpt-realtime-mini' | 'gpt-4o-realtime-preview' | 'gpt-4o-mini-realtime-preview' | (string & {});
|
|
3
|
+
export type OpenAIRealtimeVoice = 'alloy' | 'ash' | 'ballad' | 'cedar' | 'coral' | 'echo' | 'marin' | 'sage' | 'shimmer' | 'verse' | {
|
|
4
|
+
id: string;
|
|
5
|
+
} | (string & {});
|
|
6
|
+
export type OpenAIRealtimeTranscriptionModel = 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | 'whisper-1' | (string & {});
|
|
7
|
+
export type OpenAIRealtimeNoiseReduction = 'near_field' | 'far_field';
|
|
8
|
+
export type OpenAIRealtimeResponseMode = 'audio' | 'text';
|
|
9
|
+
export type OpenAIRealtimeAdapterOptions = {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
autoCommitSilenceMs?: number;
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
emitResponseTranscripts?: boolean;
|
|
14
|
+
inputTranscriptionLanguage?: string;
|
|
15
|
+
inputTranscriptionModel?: OpenAIRealtimeTranscriptionModel | null;
|
|
16
|
+
inputTranscriptionPrompt?: string;
|
|
17
|
+
instructions?: string;
|
|
18
|
+
maxOutputTokens?: number | 'inf';
|
|
19
|
+
model?: OpenAIRealtimeModel;
|
|
20
|
+
noiseReduction?: OpenAIRealtimeNoiseReduction;
|
|
21
|
+
responseMode?: OpenAIRealtimeResponseMode;
|
|
22
|
+
speed?: number;
|
|
23
|
+
temperature?: number;
|
|
24
|
+
voice?: OpenAIRealtimeVoice;
|
|
25
|
+
webSocket?: typeof WebSocket;
|
|
26
|
+
};
|
|
27
|
+
export declare const createOpenAIRealtimeAdapter: (options: OpenAIRealtimeAdapterOptions) => RealtimeAdapter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TTSAdapter, TTSAdapterOpenOptions, VoiceLexiconEntry } from './types';
|
|
2
|
+
export type OpenAIVoiceTTSVoice = 'alloy' | 'ash' | 'ballad' | 'cedar' | 'coral' | 'echo' | 'fable' | 'marin' | 'nova' | 'onyx' | 'sage' | 'shimmer' | 'verse' | (string & {});
|
|
3
|
+
export type OpenAIVoiceTTSOptions = {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
instructions?: string | ((input: {
|
|
8
|
+
lexicon?: VoiceLexiconEntry[];
|
|
9
|
+
sessionId: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}) => Promise<string | undefined> | string | undefined);
|
|
12
|
+
model?: 'gpt-4o-mini-tts' | 'tts-1' | 'tts-1-hd' | (string & {});
|
|
13
|
+
speed?: number;
|
|
14
|
+
voice?: OpenAIVoiceTTSVoice | {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const createOpenAIVoiceTTS: (options: OpenAIVoiceTTSOptions) => TTSAdapter<TTSAdapterOpenOptions>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
|
|
3
|
+
import type { StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
|
|
4
|
+
import { type VoiceSessionReplay } from './sessionReplay';
|
|
5
|
+
import type { StoredVoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
|
|
6
|
+
import { type VoiceTraceTimelineEvent, type VoiceTraceTimelineProviderSummary } from './traceTimeline';
|
|
7
|
+
import { type StoredVoiceTraceEvent, type VoiceTraceEvaluationOptions, type VoiceTraceEventStore, type VoiceTraceRedactionConfig, type VoiceTraceSummary } from './trace';
|
|
8
|
+
export type VoiceOperationsRecordStatus = 'failed' | 'healthy' | 'warning';
|
|
9
|
+
export type VoiceOperationsRecordOutcome = {
|
|
10
|
+
assistantReplies: number;
|
|
11
|
+
complete: boolean;
|
|
12
|
+
escalated: boolean;
|
|
13
|
+
noAnswer: boolean;
|
|
14
|
+
transferred: boolean;
|
|
15
|
+
voicemail: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type VoiceOperationsRecordAgentHandoff = {
|
|
18
|
+
at: number;
|
|
19
|
+
fromAgentId?: string;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
reason?: string;
|
|
22
|
+
status?: string;
|
|
23
|
+
summary?: string;
|
|
24
|
+
targetAgentId?: string;
|
|
25
|
+
turnId?: string;
|
|
26
|
+
};
|
|
27
|
+
export type VoiceOperationsRecordTool = {
|
|
28
|
+
at: number;
|
|
29
|
+
elapsedMs?: number;
|
|
30
|
+
error?: string;
|
|
31
|
+
status?: string;
|
|
32
|
+
toolCallId?: string;
|
|
33
|
+
toolName?: string;
|
|
34
|
+
turnId?: string;
|
|
35
|
+
};
|
|
36
|
+
export type VoiceOperationsRecordTranscriptTurn = {
|
|
37
|
+
assistantReplies: string[];
|
|
38
|
+
committedText?: string;
|
|
39
|
+
errors: string[];
|
|
40
|
+
id: string;
|
|
41
|
+
transcripts: string[];
|
|
42
|
+
};
|
|
43
|
+
export type VoiceOperationsRecordProviderDecision = {
|
|
44
|
+
at: number;
|
|
45
|
+
elapsedMs?: number;
|
|
46
|
+
error?: string;
|
|
47
|
+
fallbackProvider?: string;
|
|
48
|
+
provider?: string;
|
|
49
|
+
reason?: string;
|
|
50
|
+
selectedProvider?: string;
|
|
51
|
+
status?: string;
|
|
52
|
+
type: StoredVoiceTraceEvent['type'];
|
|
53
|
+
turnId?: string;
|
|
54
|
+
};
|
|
55
|
+
export type VoiceOperationsRecordAuditSummary = {
|
|
56
|
+
error: number;
|
|
57
|
+
events: StoredVoiceAuditEvent[];
|
|
58
|
+
skipped: number;
|
|
59
|
+
success: number;
|
|
60
|
+
total: number;
|
|
61
|
+
};
|
|
62
|
+
export type VoiceOperationsRecordReviewSummary = {
|
|
63
|
+
failed: number;
|
|
64
|
+
reviews: StoredVoiceCallReviewArtifact[];
|
|
65
|
+
total: number;
|
|
66
|
+
};
|
|
67
|
+
export type VoiceOperationsRecordTaskSummary = {
|
|
68
|
+
done: number;
|
|
69
|
+
inProgress: number;
|
|
70
|
+
open: number;
|
|
71
|
+
overdue: number;
|
|
72
|
+
tasks: StoredVoiceOpsTask[];
|
|
73
|
+
total: number;
|
|
74
|
+
};
|
|
75
|
+
export type VoiceOperationsRecordIntegrationEventSummary = {
|
|
76
|
+
delivered: number;
|
|
77
|
+
events: StoredVoiceIntegrationEvent[];
|
|
78
|
+
failed: number;
|
|
79
|
+
pending: number;
|
|
80
|
+
sinkDeliveries: number;
|
|
81
|
+
skipped: number;
|
|
82
|
+
total: number;
|
|
83
|
+
};
|
|
84
|
+
export type VoiceOperationsRecord = {
|
|
85
|
+
audit?: VoiceOperationsRecordAuditSummary;
|
|
86
|
+
checkedAt: number;
|
|
87
|
+
handoffs: VoiceOperationsRecordAgentHandoff[];
|
|
88
|
+
integrationEvents?: VoiceOperationsRecordIntegrationEventSummary;
|
|
89
|
+
outcome: VoiceOperationsRecordOutcome;
|
|
90
|
+
providerDecisions: VoiceOperationsRecordProviderDecision[];
|
|
91
|
+
providers: VoiceTraceTimelineProviderSummary[];
|
|
92
|
+
replay: VoiceSessionReplay;
|
|
93
|
+
reviews?: VoiceOperationsRecordReviewSummary;
|
|
94
|
+
sessionId: string;
|
|
95
|
+
status: VoiceOperationsRecordStatus;
|
|
96
|
+
summary: VoiceTraceSummary;
|
|
97
|
+
tasks?: VoiceOperationsRecordTaskSummary;
|
|
98
|
+
timeline: VoiceTraceTimelineEvent[];
|
|
99
|
+
tools: VoiceOperationsRecordTool[];
|
|
100
|
+
traceEvents: StoredVoiceTraceEvent[];
|
|
101
|
+
transcript: VoiceOperationsRecordTranscriptTurn[];
|
|
102
|
+
};
|
|
103
|
+
export type VoiceOperationsRecordOptions = {
|
|
104
|
+
audit?: VoiceAuditEventStore;
|
|
105
|
+
evaluation?: VoiceTraceEvaluationOptions;
|
|
106
|
+
events?: StoredVoiceTraceEvent[];
|
|
107
|
+
integrationEvents?: VoiceIntegrationEventStore;
|
|
108
|
+
redact?: VoiceTraceRedactionConfig;
|
|
109
|
+
reviews?: VoiceCallReviewStore;
|
|
110
|
+
sessionId: string;
|
|
111
|
+
store?: VoiceTraceEventStore;
|
|
112
|
+
tasks?: VoiceOpsTaskStore;
|
|
113
|
+
};
|
|
114
|
+
export type VoiceOperationsRecordRoutesOptions = Omit<VoiceOperationsRecordOptions, 'sessionId'> & {
|
|
115
|
+
headers?: HeadersInit;
|
|
116
|
+
htmlPath?: false | string;
|
|
117
|
+
incidentHtmlPath?: false | string;
|
|
118
|
+
incidentPath?: false | string;
|
|
119
|
+
name?: string;
|
|
120
|
+
path?: string;
|
|
121
|
+
render?: (record: VoiceOperationsRecord) => string | Promise<string>;
|
|
122
|
+
renderIncidentMarkdown?: (record: VoiceOperationsRecord) => string | Promise<string>;
|
|
123
|
+
title?: string;
|
|
124
|
+
};
|
|
125
|
+
export declare const buildVoiceOperationsRecord: (options: VoiceOperationsRecordOptions) => Promise<VoiceOperationsRecord>;
|
|
126
|
+
export declare const renderVoiceOperationsRecordIncidentMarkdown: (record: VoiceOperationsRecord) => string;
|
|
127
|
+
export declare const renderVoiceOperationsRecordHTML: (record: VoiceOperationsRecord, options?: {
|
|
128
|
+
title?: string;
|
|
129
|
+
}) => string;
|
|
130
|
+
export declare const createVoiceOperationsRecordRoutes: (options: VoiceOperationsRecordRoutesOptions) => Elysia<"", {
|
|
131
|
+
decorator: {};
|
|
132
|
+
store: {};
|
|
133
|
+
derive: {};
|
|
134
|
+
resolve: {};
|
|
135
|
+
}, {
|
|
136
|
+
typebox: {};
|
|
137
|
+
error: {};
|
|
138
|
+
}, {
|
|
139
|
+
schema: {};
|
|
140
|
+
standaloneSchema: {};
|
|
141
|
+
macro: {};
|
|
142
|
+
macroFn: {};
|
|
143
|
+
parser: {};
|
|
144
|
+
response: {};
|
|
145
|
+
}, {}, {
|
|
146
|
+
derive: {};
|
|
147
|
+
resolve: {};
|
|
148
|
+
schema: {};
|
|
149
|
+
standaloneSchema: {};
|
|
150
|
+
response: {};
|
|
151
|
+
}, {
|
|
152
|
+
derive: {};
|
|
153
|
+
resolve: {};
|
|
154
|
+
schema: {};
|
|
155
|
+
standaloneSchema: {};
|
|
156
|
+
response: {};
|
|
157
|
+
}>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
|
|
3
|
+
import { type VoiceTraceEventStore } from './trace';
|
|
4
|
+
export type VoiceOpsActionAuditRecord = {
|
|
5
|
+
actionId: string;
|
|
6
|
+
body?: unknown;
|
|
7
|
+
error?: string;
|
|
8
|
+
ok: boolean;
|
|
9
|
+
ranAt: number;
|
|
10
|
+
status: number;
|
|
11
|
+
};
|
|
12
|
+
export type VoiceOpsActionAuditRoutesOptions = {
|
|
13
|
+
audit?: VoiceAuditEventStore;
|
|
14
|
+
historyHtmlPath?: false | string;
|
|
15
|
+
historyPath?: false | string;
|
|
16
|
+
name?: string;
|
|
17
|
+
path?: string;
|
|
18
|
+
trace?: VoiceTraceEventStore;
|
|
19
|
+
};
|
|
20
|
+
export type VoiceOpsActionHistoryEntry = {
|
|
21
|
+
actionId: string;
|
|
22
|
+
at: number;
|
|
23
|
+
error?: string;
|
|
24
|
+
eventId: string;
|
|
25
|
+
ok: boolean;
|
|
26
|
+
status?: number;
|
|
27
|
+
traceId?: string;
|
|
28
|
+
};
|
|
29
|
+
export type VoiceOpsActionHistoryReport = {
|
|
30
|
+
checkedAt: number;
|
|
31
|
+
entries: VoiceOpsActionHistoryEntry[];
|
|
32
|
+
failed: number;
|
|
33
|
+
passed: number;
|
|
34
|
+
total: number;
|
|
35
|
+
};
|
|
36
|
+
export declare const recordVoiceOpsActionAudit: (record: VoiceOpsActionAuditRecord, options: Pick<VoiceOpsActionAuditRoutesOptions, "audit" | "trace">) => Promise<{
|
|
37
|
+
audit: StoredVoiceAuditEvent<Record<string, unknown>> | (Omit<import("./audit").VoiceAuditEvent<Record<string, unknown>>, "at" | "id"> & {
|
|
38
|
+
at: number;
|
|
39
|
+
id: string;
|
|
40
|
+
}) | undefined;
|
|
41
|
+
ok: boolean;
|
|
42
|
+
trace: (import("./trace").VoiceTraceEvent<Record<string, unknown>> & {
|
|
43
|
+
id: string;
|
|
44
|
+
}) | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const createVoiceOpsActionAuditRoutes: (options: VoiceOpsActionAuditRoutesOptions) => Elysia<"", {
|
|
47
|
+
decorator: {};
|
|
48
|
+
store: {};
|
|
49
|
+
derive: {};
|
|
50
|
+
resolve: {};
|
|
51
|
+
}, {
|
|
52
|
+
typebox: {};
|
|
53
|
+
error: {};
|
|
54
|
+
}, {
|
|
55
|
+
schema: {};
|
|
56
|
+
standaloneSchema: {};
|
|
57
|
+
macro: {};
|
|
58
|
+
macroFn: {};
|
|
59
|
+
parser: {};
|
|
60
|
+
response: {};
|
|
61
|
+
}, {
|
|
62
|
+
[x: string]: {
|
|
63
|
+
post: {
|
|
64
|
+
body: unknown;
|
|
65
|
+
params: {};
|
|
66
|
+
query: unknown;
|
|
67
|
+
headers: unknown;
|
|
68
|
+
response: {
|
|
69
|
+
200: {
|
|
70
|
+
audit: StoredVoiceAuditEvent<Record<string, unknown>> | (Omit<import("./audit").VoiceAuditEvent<Record<string, unknown>>, "at" | "id"> & {
|
|
71
|
+
at: number;
|
|
72
|
+
id: string;
|
|
73
|
+
}) | undefined;
|
|
74
|
+
ok: boolean;
|
|
75
|
+
trace: (import("./trace").VoiceTraceEvent<Record<string, unknown>> & {
|
|
76
|
+
id: string;
|
|
77
|
+
}) | undefined;
|
|
78
|
+
} | {
|
|
79
|
+
error: string;
|
|
80
|
+
ok: boolean;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
derive: {};
|
|
87
|
+
resolve: {};
|
|
88
|
+
schema: {};
|
|
89
|
+
standaloneSchema: {};
|
|
90
|
+
response: {};
|
|
91
|
+
}, {
|
|
92
|
+
derive: {};
|
|
93
|
+
resolve: {};
|
|
94
|
+
schema: {};
|
|
95
|
+
standaloneSchema: {};
|
|
96
|
+
response: {};
|
|
97
|
+
}>;
|
|
98
|
+
export declare const buildVoiceOpsActionHistoryReport: (options: Pick<VoiceOpsActionAuditRoutesOptions, "audit">) => Promise<VoiceOpsActionHistoryReport>;
|
|
99
|
+
export declare const renderVoiceOpsActionHistoryHTML: (report: VoiceOpsActionHistoryReport) => string;
|