@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.
Files changed (104) hide show
  1. package/README.md +205 -0
  2. package/dist/agent.d.ts +2 -0
  3. package/dist/angular/index.d.ts +6 -0
  4. package/dist/angular/index.js +833 -43
  5. package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
  6. package/dist/angular/voice-ops-status.component.d.ts +15 -0
  7. package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
  8. package/dist/angular/voice-provider-status.service.d.ts +12 -0
  9. package/dist/angular/voice-routing-status.service.d.ts +11 -0
  10. package/dist/angular/voice-stream.service.d.ts +2 -0
  11. package/dist/angular/voice-turn-quality.service.d.ts +12 -0
  12. package/dist/angular/voice-workflow-status.service.d.ts +12 -0
  13. package/dist/appKit.d.ts +94 -0
  14. package/dist/assistantHealth.d.ts +81 -0
  15. package/dist/client/actions.d.ts +22 -0
  16. package/dist/client/appKitStatus.d.ts +19 -0
  17. package/dist/client/connection.d.ts +3 -0
  18. package/dist/client/htmxBootstrap.js +44 -2
  19. package/dist/client/index.d.ts +26 -0
  20. package/dist/client/index.js +1290 -2
  21. package/dist/client/opsStatusWidget.d.ts +40 -0
  22. package/dist/client/providerCapabilities.d.ts +19 -0
  23. package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
  24. package/dist/client/providerSimulationControls.d.ts +33 -0
  25. package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
  26. package/dist/client/providerStatus.d.ts +19 -0
  27. package/dist/client/providerStatusWidget.d.ts +32 -0
  28. package/dist/client/routingStatus.d.ts +19 -0
  29. package/dist/client/routingStatusWidget.d.ts +28 -0
  30. package/dist/client/turnQuality.d.ts +19 -0
  31. package/dist/client/turnQualityWidget.d.ts +32 -0
  32. package/dist/client/workflowStatus.d.ts +19 -0
  33. package/dist/diagnosticsRoutes.d.ts +44 -0
  34. package/dist/evalRoutes.d.ts +213 -0
  35. package/dist/handoff.d.ts +54 -0
  36. package/dist/handoffHealth.d.ts +94 -0
  37. package/dist/index.d.ts +44 -4
  38. package/dist/index.js +5602 -175
  39. package/dist/modelAdapters.d.ts +75 -0
  40. package/dist/opsConsoleRoutes.d.ts +77 -0
  41. package/dist/opsWebhook.d.ts +126 -0
  42. package/dist/outcomeContract.d.ts +112 -0
  43. package/dist/providerAdapters.d.ts +48 -0
  44. package/dist/providerCapabilities.d.ts +92 -0
  45. package/dist/providerHealth.d.ts +79 -0
  46. package/dist/qualityRoutes.d.ts +76 -0
  47. package/dist/queue.d.ts +52 -0
  48. package/dist/react/VoiceOpsStatus.d.ts +6 -0
  49. package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
  50. package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
  51. package/dist/react/VoiceProviderStatus.d.ts +6 -0
  52. package/dist/react/VoiceRoutingStatus.d.ts +6 -0
  53. package/dist/react/VoiceTurnQuality.d.ts +6 -0
  54. package/dist/react/index.d.ts +13 -0
  55. package/dist/react/index.js +1884 -11
  56. package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
  57. package/dist/react/useVoiceController.d.ts +2 -0
  58. package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
  59. package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
  60. package/dist/react/useVoiceProviderStatus.d.ts +8 -0
  61. package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
  62. package/dist/react/useVoiceStream.d.ts +2 -0
  63. package/dist/react/useVoiceTurnQuality.d.ts +8 -0
  64. package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
  65. package/dist/resilienceRoutes.d.ts +117 -0
  66. package/dist/sessionReplay.d.ts +175 -0
  67. package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
  68. package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
  69. package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
  70. package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
  71. package/dist/svelte/createVoiceProviderStatus.d.ts +10 -0
  72. package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
  73. package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
  74. package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
  75. package/dist/svelte/index.d.ts +8 -0
  76. package/dist/svelte/index.js +1330 -3
  77. package/dist/telephonyOutcome.d.ts +143 -0
  78. package/dist/testing/index.d.ts +2 -0
  79. package/dist/testing/index.js +1537 -7
  80. package/dist/testing/ioProviderSimulator.d.ts +41 -0
  81. package/dist/testing/providerSimulator.d.ts +44 -0
  82. package/dist/toolContract.d.ts +130 -0
  83. package/dist/toolRuntime.d.ts +50 -0
  84. package/dist/trace.d.ts +1 -1
  85. package/dist/turnQuality.d.ts +94 -0
  86. package/dist/types.d.ts +84 -2
  87. package/dist/vue/VoiceOpsStatus.d.ts +30 -0
  88. package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
  89. package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
  90. package/dist/vue/VoiceProviderStatus.d.ts +51 -0
  91. package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
  92. package/dist/vue/VoiceTurnQuality.d.ts +51 -0
  93. package/dist/vue/index.d.ts +13 -0
  94. package/dist/vue/index.js +1934 -25
  95. package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
  96. package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
  97. package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
  98. package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
  99. package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
  100. package/dist/vue/useVoiceStream.d.ts +2 -0
  101. package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
  102. package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
  103. package/dist/workflowContract.d.ts +91 -0
  104. 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
+ }>;
@@ -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';