@absolutejs/voice 0.0.22-beta.12 → 0.0.22-beta.121
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 +411 -3
- package/dist/agent.d.ts +2 -0
- package/dist/angular/index.d.ts +9 -0
- package/dist/angular/index.js +1278 -44
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
- package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-provider-capabilities.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 +2 -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/appKit.d.ts +100 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/bargeInRoutes.d.ts +56 -0
- package/dist/campaign.d.ts +610 -0
- package/dist/campaignDialers.d.ts +90 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -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/duplex.d.ts +1 -1
- package/dist/client/htmxBootstrap.js +587 -13
- package/dist/client/index.d.ts +40 -0
- package/dist/client/index.js +2028 -8
- package/dist/client/liveTurnLatency.d.ts +41 -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/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 +32 -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/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +213 -0
- package/dist/fileStore.d.ts +3 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +77 -8
- package/dist/index.js +12658 -3061
- package/dist/liveLatency.d.ts +78 -0
- package/dist/modelAdapters.d.ts +41 -2
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +112 -0
- package/dist/phoneAgent.d.ts +58 -0
- package/dist/postgresStore.d.ts +5 -0
- package/dist/productionReadiness.d.ts +121 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +61 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.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 +18 -0
- package/dist/react/index.js +2606 -12
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/react/useVoiceController.d.ts +2 -0
- package/dist/react/useVoiceProviderCapabilities.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 +2 -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/resilienceRoutes.d.ts +142 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/simulationSuite.d.ts +120 -0
- package/dist/sqliteStore.d.ts +5 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
- package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoiceProviderCapabilities.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 +11 -0
- package/dist/svelte/index.js +1849 -4
- 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 +132 -0
- package/dist/telephonyOutcome.d.ts +201 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +2640 -21
- 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 +1 -1
- package/dist/traceTimeline.d.ts +93 -0
- package/dist/turnLatency.d.ts +95 -0
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +125 -2
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -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 +17 -0
- package/dist/vue/index.js +2520 -29
- package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/dist/vue/useVoiceController.d.ts +1 -1
- package/dist/vue/useVoiceProviderCapabilities.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 +3 -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,9 @@
|
|
|
1
|
+
import { type VoiceAppKitStatusClientOptions } from '../client/appKitStatus';
|
|
2
|
+
import type { VoiceAppKitStatusReport } from '../appKit';
|
|
3
|
+
export declare function useVoiceAppKitStatus(path?: string, options?: VoiceAppKitStatusClientOptions): {
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceAppKitStatusReport | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceAppKitStatusReport | undefined, VoiceAppKitStatusReport | undefined>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VoiceCampaignDialerProofClientOptions } from '../client/campaignDialerProof';
|
|
2
|
+
import type { VoiceCampaignDialerProofReport, VoiceCampaignDialerProofStatus } from '../campaignDialers';
|
|
3
|
+
export declare function useVoiceCampaignDialerProof(path?: string, options?: VoiceCampaignDialerProofClientOptions): {
|
|
4
|
+
error: import("vue").ShallowRef<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").ShallowRef<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceCampaignDialerProofStatus | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceCampaignDialerProofReport | undefined, VoiceCampaignDialerProofReport | undefined>;
|
|
8
|
+
runProof: () => Promise<VoiceCampaignDialerProofReport>;
|
|
9
|
+
status: import("vue").ShallowRef<VoiceCampaignDialerProofStatus | undefined, VoiceCampaignDialerProofStatus | undefined>;
|
|
10
|
+
updatedAt: import("vue").ShallowRef<number | undefined, number | undefined>;
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VoiceControllerOptions, VoiceTurnRecord } from '../types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function useVoiceController<TResult = unknown>(path: string, options?: VoiceControllerOptions): {
|
|
3
3
|
assistantAudio: import("vue").ShallowRef<{
|
|
4
4
|
chunk: Uint8Array;
|
|
5
5
|
format: import("..").AudioFormat;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceProviderCapabilitiesClientOptions } from '../client/providerCapabilities';
|
|
2
|
+
import type { VoiceProviderCapabilityReport } from '../providerCapabilities';
|
|
3
|
+
export declare function useVoiceProviderCapabilities<TProvider extends string = string>(path?: string, options?: VoiceProviderCapabilitiesClientOptions): {
|
|
4
|
+
error: import("vue").ShallowRef<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").ShallowRef<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceProviderCapabilityReport<TProvider> | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceProviderCapabilityReport<TProvider> | undefined, VoiceProviderCapabilityReport<TProvider> | undefined>;
|
|
8
|
+
updatedAt: import("vue").ShallowRef<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VoiceProviderSimulationControlsOptions } from '../client/providerSimulationControls';
|
|
2
|
+
export declare function useVoiceProviderSimulationControls<TProvider extends string = string>(options: VoiceProviderSimulationControlsOptions<TProvider>): {
|
|
3
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
4
|
+
isRunning: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
lastResult: import("vue").Ref<{
|
|
6
|
+
fallbackProvider?: import("vue").UnwrapRef<TProvider> | undefined;
|
|
7
|
+
mode: import("../testing").VoiceIOProviderFailureSimulationMode;
|
|
8
|
+
provider: import("vue").UnwrapRef<TProvider>;
|
|
9
|
+
sessionId: string;
|
|
10
|
+
status: "simulated";
|
|
11
|
+
suppressedUntil?: number | undefined;
|
|
12
|
+
} | null, import("../testing").VoiceIOProviderFailureSimulationResult<TProvider> | {
|
|
13
|
+
fallbackProvider?: import("vue").UnwrapRef<TProvider> | undefined;
|
|
14
|
+
mode: import("../testing").VoiceIOProviderFailureSimulationMode;
|
|
15
|
+
provider: import("vue").UnwrapRef<TProvider>;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
status: "simulated";
|
|
18
|
+
suppressedUntil?: number | undefined;
|
|
19
|
+
} | null>;
|
|
20
|
+
mode: import("vue").Ref<import("../testing").VoiceIOProviderFailureSimulationMode | null, import("../testing").VoiceIOProviderFailureSimulationMode | null>;
|
|
21
|
+
provider: [TProvider | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & TProvider, import("vue").Ref<import("vue").Ref<any, any> & TProvider, import("vue").Ref<any, any> & TProvider>, import("vue").Ref<any, any> & TProvider> : import("vue").Ref<import("vue").UnwrapRef<TProvider> | null, TProvider | import("vue").UnwrapRef<TProvider> | null>;
|
|
22
|
+
run: (provider: TProvider, mode: import("../testing").VoiceIOProviderFailureSimulationMode) => Promise<import("../testing").VoiceIOProviderFailureSimulationResult<TProvider> | null>;
|
|
23
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceProviderStatusClientOptions } from '../client/providerStatus';
|
|
2
|
+
import type { VoiceProviderHealthSummary } from '../providerHealth';
|
|
3
|
+
export declare function useVoiceProviderStatus<TProvider extends string = string>(path?: string, options?: VoiceProviderStatusClientOptions): {
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
providers: import("vue").ShallowRef<VoiceProviderHealthSummary<TProvider>[], VoiceProviderHealthSummary<TProvider>[]>;
|
|
7
|
+
refresh: () => Promise<VoiceProviderHealthSummary<TProvider>[]>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VoiceRoutingStatusClientOptions } from '../client/routingStatus';
|
|
2
|
+
export declare function useVoiceRoutingStatus(path?: string, options?: VoiceRoutingStatusClientOptions): {
|
|
3
|
+
decision: import("vue").ShallowRef<import("..").VoiceRoutingEvent | null, import("..").VoiceRoutingEvent | null>;
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<import("..").VoiceRoutingEvent | null>;
|
|
7
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VoiceConnectionOptions, VoiceTurnRecord } from '../types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function useVoiceStream<TResult = unknown>(path: string, options?: VoiceConnectionOptions): {
|
|
3
3
|
assistantAudio: import("vue").ShallowRef<{
|
|
4
4
|
chunk: Uint8Array;
|
|
5
5
|
format: import("..").AudioFormat;
|
|
@@ -12,6 +12,8 @@ export declare const useVoiceStream: <TResult = unknown>(path: string, options?:
|
|
|
12
12
|
turnId?: string;
|
|
13
13
|
}[]>;
|
|
14
14
|
assistantTexts: import("vue").ShallowRef<string[], string[]>;
|
|
15
|
+
call: import("vue").ShallowRef<import("..").VoiceCallLifecycleState | null, import("..").VoiceCallLifecycleState | null>;
|
|
16
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
15
17
|
close: () => void;
|
|
16
18
|
endTurn: () => void;
|
|
17
19
|
error: import("vue").Ref<string | null, string | null>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceTraceTimelineClientOptions } from '../client/traceTimeline';
|
|
2
|
+
import type { VoiceTraceTimelineReport } from '../traceTimeline';
|
|
3
|
+
export declare function useVoiceTraceTimeline(path?: string, options?: VoiceTraceTimelineClientOptions): {
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceTraceTimelineReport | null>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceTraceTimelineReport | null, VoiceTraceTimelineReport | null>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VoiceTurnLatencyClientOptions } from '../client/turnLatency';
|
|
2
|
+
import type { VoiceTurnLatencyReport } from '../turnLatency';
|
|
3
|
+
export declare function useVoiceTurnLatency(path?: string, options?: VoiceTurnLatencyClientOptions): {
|
|
4
|
+
error: import("vue").ShallowRef<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").ShallowRef<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceTurnLatencyReport | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceTurnLatencyReport | undefined, VoiceTurnLatencyReport | undefined>;
|
|
8
|
+
runProof: () => Promise<VoiceTurnLatencyReport | undefined>;
|
|
9
|
+
updatedAt: import("vue").ShallowRef<number | undefined, number | undefined>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceTurnQualityClientOptions } from '../client/turnQuality';
|
|
2
|
+
import type { VoiceTurnQualityReport } from '../turnQuality';
|
|
3
|
+
export declare function useVoiceTurnQuality(path?: string, options?: VoiceTurnQualityClientOptions): {
|
|
4
|
+
error: import("vue").ShallowRef<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").ShallowRef<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceTurnQualityReport | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceTurnQualityReport | undefined, VoiceTurnQualityReport | undefined>;
|
|
8
|
+
updatedAt: import("vue").ShallowRef<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceWorkflowStatusClientOptions } from '../client/workflowStatus';
|
|
2
|
+
import type { VoiceScenarioEvalReport } from '../evalRoutes';
|
|
3
|
+
export declare function useVoiceWorkflowStatus(path?: string, options?: VoiceWorkflowStatusClientOptions): {
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoiceScenarioEvalReport | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceScenarioEvalReport | undefined, VoiceScenarioEvalReport | undefined>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { VoiceScenarioEvalDefinition } from './evalRoutes';
|
|
2
|
+
import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
|
|
3
|
+
import type { VoiceOnTurnHandler, VoiceRouteResult, VoiceSessionRecord, VoiceTurnRecord } from './types';
|
|
4
|
+
export type VoiceWorkflowOutcome = 'complete' | 'transfer' | 'escalate' | 'voicemail' | 'no-answer';
|
|
5
|
+
export type VoiceWorkflowContractFieldMatch = 'boolean' | 'non-empty' | 'number' | 'string' | 'truthy';
|
|
6
|
+
export type VoiceWorkflowContractField = {
|
|
7
|
+
aliases?: string[];
|
|
8
|
+
label?: string;
|
|
9
|
+
match?: VoiceWorkflowContractFieldMatch;
|
|
10
|
+
path: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type VoiceWorkflowContractDefinition<TResult = unknown> = {
|
|
14
|
+
description?: string;
|
|
15
|
+
fields?: VoiceWorkflowContractField[];
|
|
16
|
+
forbiddenHandoffActions?: string[];
|
|
17
|
+
id: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
maxProviderErrors?: number;
|
|
20
|
+
maxSessionErrors?: number;
|
|
21
|
+
minSessions?: number;
|
|
22
|
+
minTurns?: number;
|
|
23
|
+
outcome?: VoiceWorkflowOutcome;
|
|
24
|
+
requiredAssistantIncludes?: string[];
|
|
25
|
+
requiredDisposition?: string;
|
|
26
|
+
requiredHandoffActions?: string[];
|
|
27
|
+
requiredLifecycleTypes?: string[];
|
|
28
|
+
requiredTranscriptIncludes?: string[];
|
|
29
|
+
scenarioId?: string;
|
|
30
|
+
validate?: (input: {
|
|
31
|
+
result: TResult | undefined;
|
|
32
|
+
routeResult: VoiceRouteResult<TResult>;
|
|
33
|
+
}) => VoiceWorkflowContractValidationIssue[];
|
|
34
|
+
};
|
|
35
|
+
export type VoiceWorkflowContractPresetName = 'appointment-booking' | 'lead-qualification' | 'support-triage' | 'transfer-handoff' | 'voicemail-callback';
|
|
36
|
+
export type VoiceWorkflowContractPresetOptions<TResult = unknown> = Partial<Omit<VoiceWorkflowContractDefinition<TResult>, 'fields' | 'id'>> & {
|
|
37
|
+
fields?: VoiceWorkflowContractField[];
|
|
38
|
+
id?: string;
|
|
39
|
+
};
|
|
40
|
+
export type VoiceWorkflowContractValidationIssue = {
|
|
41
|
+
code: string;
|
|
42
|
+
field?: string;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
export type VoiceWorkflowContractValidation = {
|
|
46
|
+
contractId: string;
|
|
47
|
+
issues: VoiceWorkflowContractValidationIssue[];
|
|
48
|
+
missingFields: string[];
|
|
49
|
+
outcome?: VoiceWorkflowOutcome;
|
|
50
|
+
pass: boolean;
|
|
51
|
+
requiredFields: string[];
|
|
52
|
+
};
|
|
53
|
+
export type VoiceWorkflowContract<TResult = unknown> = {
|
|
54
|
+
assertRouteResult: (routeResult: VoiceRouteResult<TResult>) => void;
|
|
55
|
+
definition: VoiceWorkflowContractDefinition<TResult>;
|
|
56
|
+
toScenarioEval: (overrides?: Partial<VoiceScenarioEvalDefinition>) => VoiceScenarioEvalDefinition;
|
|
57
|
+
validateRouteResult: (routeResult: VoiceRouteResult<TResult>) => VoiceWorkflowContractValidation;
|
|
58
|
+
};
|
|
59
|
+
export type VoiceWorkflowContractTracePayload = {
|
|
60
|
+
contractId: string;
|
|
61
|
+
issues: VoiceWorkflowContractValidationIssue[];
|
|
62
|
+
missingFields: string[];
|
|
63
|
+
outcome?: VoiceWorkflowOutcome;
|
|
64
|
+
requiredFields: string[];
|
|
65
|
+
status: 'pass' | 'fail';
|
|
66
|
+
};
|
|
67
|
+
export declare const validateVoiceWorkflowRouteResult: <TResult = unknown>(definition: VoiceWorkflowContractDefinition<TResult>, routeResult: VoiceRouteResult<TResult>) => VoiceWorkflowContractValidation;
|
|
68
|
+
export declare const createVoiceWorkflowScenario: <TResult = unknown>(definition: VoiceWorkflowContractDefinition<TResult>, overrides?: Partial<VoiceScenarioEvalDefinition>) => VoiceScenarioEvalDefinition;
|
|
69
|
+
export declare const createVoiceWorkflowContract: <TResult = unknown>(definition: VoiceWorkflowContractDefinition<TResult>) => VoiceWorkflowContract<TResult>;
|
|
70
|
+
export declare const createVoiceWorkflowContractPreset: <TResult = unknown>(name: VoiceWorkflowContractPresetName, options?: VoiceWorkflowContractPresetOptions<TResult>) => VoiceWorkflowContract<TResult>;
|
|
71
|
+
export declare const recordVoiceWorkflowContractTrace: (input: {
|
|
72
|
+
at?: number;
|
|
73
|
+
contractId?: string;
|
|
74
|
+
scenarioId?: string;
|
|
75
|
+
sessionId: string;
|
|
76
|
+
store: VoiceTraceEventStore;
|
|
77
|
+
traceId?: string;
|
|
78
|
+
turnId?: string;
|
|
79
|
+
validation: VoiceWorkflowContractValidation;
|
|
80
|
+
}) => Promise<StoredVoiceTraceEvent<VoiceWorkflowContractTracePayload>>;
|
|
81
|
+
export declare const createVoiceWorkflowContractHandler: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(input: {
|
|
82
|
+
contract?: VoiceWorkflowContract<TResult> | VoiceWorkflowContractDefinition<TResult>;
|
|
83
|
+
handler: VoiceOnTurnHandler<TContext, TSession, TResult>;
|
|
84
|
+
resolveContract?: (args: {
|
|
85
|
+
context: TContext;
|
|
86
|
+
result: VoiceRouteResult<TResult>;
|
|
87
|
+
session: TSession;
|
|
88
|
+
turn: VoiceTurnRecord;
|
|
89
|
+
}) => VoiceWorkflowContract<TResult> | VoiceWorkflowContractDefinition<TResult> | undefined;
|
|
90
|
+
store?: VoiceTraceEventStore;
|
|
91
|
+
}) => VoiceOnTurnHandler<TContext, TSession, TResult>;
|