@absolutejs/voice 0.0.22-beta.7 → 0.0.22-beta.70
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 +205 -0
- package/dist/agent.d.ts +2 -0
- package/dist/angular/index.d.ts +6 -0
- package/dist/angular/index.js +833 -43
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -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-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-workflow-status.service.d.ts +12 -0
- package/dist/appKit.d.ts +94 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/htmxBootstrap.js +44 -2
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.js +1290 -2
- 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/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/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +44 -4
- package/dist/index.js +5602 -175
- package/dist/modelAdapters.d.ts +75 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +112 -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 +52 -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/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +1884 -11
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -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/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/resilienceRoutes.d.ts +117 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -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/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +8 -0
- package/dist/svelte/index.js +1330 -3
- package/dist/telephonyOutcome.d.ts +143 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +1537 -7
- 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/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +84 -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/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.js +1934 -25
- package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
- 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 +2 -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,143 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceCallDisposition, VoiceRouteResult, VoiceSessionHandle, VoiceSessionRecord } from './types';
|
|
3
|
+
export type VoiceTelephonyOutcomeAction = 'complete' | 'escalate' | 'ignore' | 'no-answer' | 'transfer' | 'voicemail';
|
|
4
|
+
export type VoiceTelephonyOutcomeProviderEvent = {
|
|
5
|
+
answeredBy?: string;
|
|
6
|
+
durationMs?: number;
|
|
7
|
+
from?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
provider?: string;
|
|
10
|
+
reason?: string;
|
|
11
|
+
sipCode?: number;
|
|
12
|
+
status?: string;
|
|
13
|
+
target?: string;
|
|
14
|
+
to?: string;
|
|
15
|
+
};
|
|
16
|
+
export type VoiceTelephonyOutcomeDecision = {
|
|
17
|
+
action: VoiceTelephonyOutcomeAction;
|
|
18
|
+
confidence: 'high' | 'low' | 'medium';
|
|
19
|
+
disposition?: VoiceCallDisposition;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
reason?: string;
|
|
22
|
+
source: 'answered-by' | 'duration' | 'explicit-target' | 'policy' | 'sip' | 'status';
|
|
23
|
+
target?: string;
|
|
24
|
+
};
|
|
25
|
+
export type VoiceTelephonyOutcomeStatusDecision = VoiceTelephonyOutcomeAction | Omit<VoiceTelephonyOutcomeDecision, 'confidence' | 'source'> & {
|
|
26
|
+
confidence?: VoiceTelephonyOutcomeDecision['confidence'];
|
|
27
|
+
source?: VoiceTelephonyOutcomeDecision['source'];
|
|
28
|
+
};
|
|
29
|
+
export type VoiceTelephonyOutcomePolicy = {
|
|
30
|
+
completedStatuses?: string[];
|
|
31
|
+
escalationStatuses?: string[];
|
|
32
|
+
failedAsNoAnswer?: boolean;
|
|
33
|
+
failedStatuses?: string[];
|
|
34
|
+
includeProviderPayload?: boolean;
|
|
35
|
+
machineDetectionVoicemailValues?: string[];
|
|
36
|
+
metadata?: Record<string, unknown>;
|
|
37
|
+
minAnsweredDurationMs?: number;
|
|
38
|
+
noAnswerOnZeroDuration?: boolean;
|
|
39
|
+
noAnswerSipCodes?: number[];
|
|
40
|
+
noAnswerStatuses?: string[];
|
|
41
|
+
statusMap?: Record<string, VoiceTelephonyOutcomeStatusDecision>;
|
|
42
|
+
transferStatuses?: string[];
|
|
43
|
+
transferTarget?: string | ((event: VoiceTelephonyOutcomeProviderEvent) => string | undefined);
|
|
44
|
+
voicemailStatuses?: string[];
|
|
45
|
+
};
|
|
46
|
+
export type VoiceTelephonyOutcomeRouteResult<TResult = unknown> = VoiceRouteResult<TResult>;
|
|
47
|
+
export type VoiceTelephonyWebhookProvider = 'generic' | 'plivo' | 'telnyx' | 'twilio';
|
|
48
|
+
export type VoiceTelephonyWebhookParseInput = {
|
|
49
|
+
body: unknown;
|
|
50
|
+
headers: Headers;
|
|
51
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
52
|
+
query: Record<string, unknown>;
|
|
53
|
+
request: Request;
|
|
54
|
+
};
|
|
55
|
+
export type VoiceTelephonyWebhookDecision<TResult = unknown> = {
|
|
56
|
+
applied: boolean;
|
|
57
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
58
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
59
|
+
routeResult: VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
60
|
+
sessionId?: string;
|
|
61
|
+
};
|
|
62
|
+
export type VoiceTelephonyWebhookHandlerOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
63
|
+
apply?: boolean | ((input: VoiceTelephonyWebhookDecision<TResult>) => boolean);
|
|
64
|
+
context?: TContext;
|
|
65
|
+
getSessionHandle?: (input: {
|
|
66
|
+
context: TContext;
|
|
67
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
68
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
69
|
+
request: Request;
|
|
70
|
+
sessionId?: string;
|
|
71
|
+
}) => Promise<VoiceSessionHandle<TContext, TSession, TResult> | undefined> | VoiceSessionHandle<TContext, TSession, TResult> | undefined;
|
|
72
|
+
onDecision?: (input: VoiceTelephonyWebhookDecision<TResult> & {
|
|
73
|
+
context: TContext;
|
|
74
|
+
request: Request;
|
|
75
|
+
}) => Promise<void> | void;
|
|
76
|
+
parse?: (input: VoiceTelephonyWebhookParseInput) => Promise<VoiceTelephonyOutcomeProviderEvent> | VoiceTelephonyOutcomeProviderEvent;
|
|
77
|
+
policy?: VoiceTelephonyOutcomePolicy;
|
|
78
|
+
provider?: VoiceTelephonyWebhookProvider;
|
|
79
|
+
resolveSessionId?: (input: {
|
|
80
|
+
body: unknown;
|
|
81
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
82
|
+
query: Record<string, unknown>;
|
|
83
|
+
request: Request;
|
|
84
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
85
|
+
result?: TResult | ((input: {
|
|
86
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
87
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
88
|
+
sessionId?: string;
|
|
89
|
+
}) => Promise<TResult | undefined> | TResult | undefined);
|
|
90
|
+
};
|
|
91
|
+
export type VoiceTelephonyWebhookRoutesOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult> & {
|
|
92
|
+
name?: string;
|
|
93
|
+
path?: string;
|
|
94
|
+
};
|
|
95
|
+
export declare const createVoiceTelephonyOutcomePolicy: (policy?: VoiceTelephonyOutcomePolicy) => Required<Pick<VoiceTelephonyOutcomePolicy, "completedStatuses" | "escalationStatuses" | "failedAsNoAnswer" | "failedStatuses" | "includeProviderPayload" | "machineDetectionVoicemailValues" | "noAnswerOnZeroDuration" | "noAnswerSipCodes" | "noAnswerStatuses" | "transferStatuses" | "voicemailStatuses">> & VoiceTelephonyOutcomePolicy;
|
|
96
|
+
export declare const resolveVoiceTelephonyOutcome: (event: VoiceTelephonyOutcomeProviderEvent, policyInput?: VoiceTelephonyOutcomePolicy) => VoiceTelephonyOutcomeDecision;
|
|
97
|
+
export declare const voiceTelephonyOutcomeToRouteResult: <TResult = unknown>(decision: VoiceTelephonyOutcomeDecision, result?: TResult) => VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
98
|
+
export declare const applyVoiceTelephonyOutcome: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(api: VoiceSessionHandle<TContext, TSession, TResult>, decision: VoiceTelephonyOutcomeDecision, result?: TResult) => Promise<void>;
|
|
99
|
+
export declare const parseVoiceTelephonyWebhookEvent: (input: VoiceTelephonyWebhookParseInput) => VoiceTelephonyOutcomeProviderEvent;
|
|
100
|
+
export declare const createVoiceTelephonyWebhookHandler: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult>) => (input: {
|
|
101
|
+
query?: Record<string, unknown>;
|
|
102
|
+
request: Request;
|
|
103
|
+
}) => Promise<VoiceTelephonyWebhookDecision<TResult>>;
|
|
104
|
+
export declare const createVoiceTelephonyWebhookRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
|
|
105
|
+
decorator: {};
|
|
106
|
+
store: {};
|
|
107
|
+
derive: {};
|
|
108
|
+
resolve: {};
|
|
109
|
+
}, {
|
|
110
|
+
typebox: {};
|
|
111
|
+
error: {};
|
|
112
|
+
}, {
|
|
113
|
+
schema: {};
|
|
114
|
+
standaloneSchema: {};
|
|
115
|
+
macro: {};
|
|
116
|
+
macroFn: {};
|
|
117
|
+
parser: {};
|
|
118
|
+
response: {};
|
|
119
|
+
}, {
|
|
120
|
+
[x: string]: {
|
|
121
|
+
post: {
|
|
122
|
+
body: unknown;
|
|
123
|
+
params: {};
|
|
124
|
+
query: unknown;
|
|
125
|
+
headers: unknown;
|
|
126
|
+
response: {
|
|
127
|
+
200: VoiceTelephonyWebhookDecision<TResult>;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
}, {
|
|
132
|
+
derive: {};
|
|
133
|
+
resolve: {};
|
|
134
|
+
schema: {};
|
|
135
|
+
standaloneSchema: {};
|
|
136
|
+
response: {};
|
|
137
|
+
}, {
|
|
138
|
+
derive: {};
|
|
139
|
+
resolve: {};
|
|
140
|
+
schema: {};
|
|
141
|
+
standaloneSchema: {};
|
|
142
|
+
response: {};
|
|
143
|
+
}>;
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './benchmark';
|
|
|
3
3
|
export * from './corrected';
|
|
4
4
|
export * from './duplex';
|
|
5
5
|
export * from './fixtures';
|
|
6
|
+
export * from './ioProviderSimulator';
|
|
7
|
+
export * from './providerSimulator';
|
|
6
8
|
export * from './resilience';
|
|
7
9
|
export * from './review';
|
|
8
10
|
export * from './sessionBenchmark';
|