@absolutejs/voice 0.0.22-beta.8 → 0.0.22-beta.80
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 +56 -7
- package/dist/index.js +6919 -128
- 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/postgresStore.d.ts +2 -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/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/sqliteStore.d.ts +2 -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/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +154 -0
- package/dist/telephony/telnyx.d.ts +139 -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 +2541 -14
- 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,201 @@
|
|
|
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
|
+
duplicate?: boolean;
|
|
59
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
60
|
+
idempotencyKey?: string;
|
|
61
|
+
routeResult: VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
62
|
+
sessionId?: string;
|
|
63
|
+
};
|
|
64
|
+
export type StoredVoiceTelephonyWebhookDecision<TResult = unknown> = VoiceTelephonyWebhookDecision<TResult> & {
|
|
65
|
+
createdAt: number;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
};
|
|
68
|
+
export type VoiceTelephonyWebhookIdempotencyStore<TResult = unknown> = {
|
|
69
|
+
get: (key: string) => Promise<StoredVoiceTelephonyWebhookDecision<TResult> | undefined> | StoredVoiceTelephonyWebhookDecision<TResult> | undefined;
|
|
70
|
+
set: (key: string, decision: StoredVoiceTelephonyWebhookDecision<TResult>) => Promise<void> | void;
|
|
71
|
+
};
|
|
72
|
+
export type VoiceTelephonyWebhookVerificationResult = {
|
|
73
|
+
ok: true;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
reason: 'invalid-signature' | 'missing-secret' | 'missing-signature' | 'unsupported-provider';
|
|
77
|
+
};
|
|
78
|
+
export type VoiceTelephonyWebhookHandlerOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
79
|
+
apply?: boolean | ((input: VoiceTelephonyWebhookDecision<TResult>) => boolean);
|
|
80
|
+
context?: TContext;
|
|
81
|
+
getSessionHandle?: (input: {
|
|
82
|
+
context: TContext;
|
|
83
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
84
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
85
|
+
request: Request;
|
|
86
|
+
sessionId?: string;
|
|
87
|
+
}) => Promise<VoiceSessionHandle<TContext, TSession, TResult> | undefined> | VoiceSessionHandle<TContext, TSession, TResult> | undefined;
|
|
88
|
+
idempotency?: {
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
key?: (input: {
|
|
91
|
+
body: unknown;
|
|
92
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
93
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
94
|
+
query: Record<string, unknown>;
|
|
95
|
+
request: Request;
|
|
96
|
+
sessionId?: string;
|
|
97
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
98
|
+
store?: VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
99
|
+
};
|
|
100
|
+
onDecision?: (input: VoiceTelephonyWebhookDecision<TResult> & {
|
|
101
|
+
context: TContext;
|
|
102
|
+
request: Request;
|
|
103
|
+
}) => Promise<void> | void;
|
|
104
|
+
parse?: (input: VoiceTelephonyWebhookParseInput) => Promise<VoiceTelephonyOutcomeProviderEvent> | VoiceTelephonyOutcomeProviderEvent;
|
|
105
|
+
policy?: VoiceTelephonyOutcomePolicy;
|
|
106
|
+
provider?: VoiceTelephonyWebhookProvider;
|
|
107
|
+
requireVerification?: boolean;
|
|
108
|
+
resolveSessionId?: (input: {
|
|
109
|
+
body: unknown;
|
|
110
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
111
|
+
query: Record<string, unknown>;
|
|
112
|
+
request: Request;
|
|
113
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
114
|
+
result?: TResult | ((input: {
|
|
115
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
116
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
117
|
+
sessionId?: string;
|
|
118
|
+
}) => Promise<TResult | undefined> | TResult | undefined);
|
|
119
|
+
signingSecret?: string;
|
|
120
|
+
verificationUrl?: string | ((input: {
|
|
121
|
+
query: Record<string, unknown>;
|
|
122
|
+
request: Request;
|
|
123
|
+
}) => string);
|
|
124
|
+
verify?: (input: {
|
|
125
|
+
body: unknown;
|
|
126
|
+
headers: Headers;
|
|
127
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
128
|
+
query: Record<string, unknown>;
|
|
129
|
+
rawBody: string;
|
|
130
|
+
request: Request;
|
|
131
|
+
}) => Promise<VoiceTelephonyWebhookVerificationResult> | VoiceTelephonyWebhookVerificationResult;
|
|
132
|
+
};
|
|
133
|
+
export type VoiceTelephonyWebhookRoutesOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult> & {
|
|
134
|
+
name?: string;
|
|
135
|
+
path?: string;
|
|
136
|
+
};
|
|
137
|
+
export declare class VoiceTelephonyWebhookVerificationError extends Error {
|
|
138
|
+
result: VoiceTelephonyWebhookVerificationResult;
|
|
139
|
+
constructor(result: VoiceTelephonyWebhookVerificationResult);
|
|
140
|
+
}
|
|
141
|
+
export declare const createMemoryVoiceTelephonyWebhookIdempotencyStore: <TResult = unknown>() => VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
142
|
+
export declare const createVoiceTelephonyOutcomePolicy: (policy?: VoiceTelephonyOutcomePolicy) => Required<Pick<VoiceTelephonyOutcomePolicy, "completedStatuses" | "escalationStatuses" | "failedAsNoAnswer" | "failedStatuses" | "includeProviderPayload" | "machineDetectionVoicemailValues" | "noAnswerOnZeroDuration" | "noAnswerSipCodes" | "noAnswerStatuses" | "transferStatuses" | "voicemailStatuses">> & VoiceTelephonyOutcomePolicy;
|
|
143
|
+
export declare const resolveVoiceTelephonyOutcome: (event: VoiceTelephonyOutcomeProviderEvent, policyInput?: VoiceTelephonyOutcomePolicy) => VoiceTelephonyOutcomeDecision;
|
|
144
|
+
export declare const voiceTelephonyOutcomeToRouteResult: <TResult = unknown>(decision: VoiceTelephonyOutcomeDecision, result?: TResult) => VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
145
|
+
export declare const applyVoiceTelephonyOutcome: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(api: VoiceSessionHandle<TContext, TSession, TResult>, decision: VoiceTelephonyOutcomeDecision, result?: TResult) => Promise<void>;
|
|
146
|
+
export declare const signVoiceTwilioWebhook: (input: {
|
|
147
|
+
authToken: string;
|
|
148
|
+
body?: unknown;
|
|
149
|
+
url: string;
|
|
150
|
+
}) => Promise<string>;
|
|
151
|
+
export declare const verifyVoiceTwilioWebhookSignature: (input: {
|
|
152
|
+
authToken?: string;
|
|
153
|
+
body?: unknown;
|
|
154
|
+
headers: Headers;
|
|
155
|
+
url: string;
|
|
156
|
+
}) => Promise<VoiceTelephonyWebhookVerificationResult>;
|
|
157
|
+
export declare const parseVoiceTelephonyWebhookEvent: (input: VoiceTelephonyWebhookParseInput) => VoiceTelephonyOutcomeProviderEvent;
|
|
158
|
+
export declare const createVoiceTelephonyWebhookHandler: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult>) => (input: {
|
|
159
|
+
query?: Record<string, unknown>;
|
|
160
|
+
request: Request;
|
|
161
|
+
}) => Promise<VoiceTelephonyWebhookDecision<TResult>>;
|
|
162
|
+
export declare const createVoiceTelephonyWebhookRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
|
|
163
|
+
decorator: {};
|
|
164
|
+
store: {};
|
|
165
|
+
derive: {};
|
|
166
|
+
resolve: {};
|
|
167
|
+
}, {
|
|
168
|
+
typebox: {};
|
|
169
|
+
error: {};
|
|
170
|
+
}, {
|
|
171
|
+
schema: {};
|
|
172
|
+
standaloneSchema: {};
|
|
173
|
+
macro: {};
|
|
174
|
+
macroFn: {};
|
|
175
|
+
parser: {};
|
|
176
|
+
response: {};
|
|
177
|
+
}, {
|
|
178
|
+
[x: string]: {
|
|
179
|
+
post: {
|
|
180
|
+
body: unknown;
|
|
181
|
+
params: {};
|
|
182
|
+
query: unknown;
|
|
183
|
+
headers: unknown;
|
|
184
|
+
response: {
|
|
185
|
+
200: Response | VoiceTelephonyWebhookDecision<TResult>;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
derive: {};
|
|
191
|
+
resolve: {};
|
|
192
|
+
schema: {};
|
|
193
|
+
standaloneSchema: {};
|
|
194
|
+
response: {};
|
|
195
|
+
}, {
|
|
196
|
+
derive: {};
|
|
197
|
+
resolve: {};
|
|
198
|
+
schema: {};
|
|
199
|
+
standaloneSchema: {};
|
|
200
|
+
response: {};
|
|
201
|
+
}>;
|
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';
|