@absolutejs/voice 0.0.22-beta.104 → 0.0.22-beta.105
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 +31 -27
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5371 -5268
- package/dist/phoneAgent.d.ts +41 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,8 +195,7 @@ Use the telephony primitives when the agent needs to answer or place calls throu
|
|
|
195
195
|
|
|
196
196
|
```ts
|
|
197
197
|
import {
|
|
198
|
-
|
|
199
|
-
createVoiceTelephonyCarrierMatrixRoutes,
|
|
198
|
+
createVoicePhoneAgent,
|
|
200
199
|
createVoiceTelephonyOutcomePolicy
|
|
201
200
|
} from '@absolutejs/voice';
|
|
202
201
|
import { deepgram } from '@absolutejs/voice-deepgram';
|
|
@@ -207,35 +206,40 @@ const outcomePolicy = createVoiceTelephonyOutcomePolicy({
|
|
|
207
206
|
|
|
208
207
|
app
|
|
209
208
|
.use(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
)
|
|
215
|
-
.use(
|
|
216
|
-
createTwilioVoiceRoutes({
|
|
217
|
-
context: {},
|
|
218
|
-
outcomePolicy,
|
|
219
|
-
session: runtime.session,
|
|
220
|
-
stt: deepgram({ apiKey: process.env.DEEPGRAM_API_KEY! }),
|
|
221
|
-
streamPath: '/api/voice/twilio/stream',
|
|
222
|
-
twiml: {
|
|
223
|
-
path: '/api/voice/twilio',
|
|
224
|
-
streamUrl: process.env.TWILIO_STREAM_URL
|
|
225
|
-
},
|
|
226
|
-
webhook: {
|
|
227
|
-
path: '/api/voice/twilio/webhook',
|
|
228
|
-
signingSecret: process.env.TWILIO_AUTH_TOKEN
|
|
229
|
-
},
|
|
230
|
-
async onTurn({ turn }) {
|
|
231
|
-
return { assistantText: `I heard: ${turn.text}` };
|
|
209
|
+
createVoicePhoneAgent({
|
|
210
|
+
matrix: {
|
|
211
|
+
path: '/api/carriers',
|
|
212
|
+
title: 'AbsoluteJS Voice Carrier Matrix'
|
|
232
213
|
},
|
|
233
|
-
|
|
234
|
-
|
|
214
|
+
carriers: [
|
|
215
|
+
{
|
|
216
|
+
provider: 'twilio',
|
|
217
|
+
options: {
|
|
218
|
+
context: {},
|
|
219
|
+
outcomePolicy,
|
|
220
|
+
session: runtime.session,
|
|
221
|
+
stt: deepgram({ apiKey: process.env.DEEPGRAM_API_KEY! }),
|
|
222
|
+
streamPath: '/api/voice/twilio/stream',
|
|
223
|
+
twiml: {
|
|
224
|
+
path: '/api/voice/twilio',
|
|
225
|
+
streamUrl: process.env.TWILIO_STREAM_URL
|
|
226
|
+
},
|
|
227
|
+
webhook: {
|
|
228
|
+
path: '/api/voice/twilio/webhook',
|
|
229
|
+
signingSecret: process.env.TWILIO_AUTH_TOKEN
|
|
230
|
+
},
|
|
231
|
+
async onTurn({ turn }) {
|
|
232
|
+
return { assistantText: `I heard: ${turn.text}` };
|
|
233
|
+
},
|
|
234
|
+
onComplete: async () => {}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}).routes
|
|
235
239
|
);
|
|
236
240
|
```
|
|
237
241
|
|
|
238
|
-
|
|
242
|
+
The wrapper mounts selected carrier routes and a readiness matrix. Telnyx and Plivo use the same wrapper with `{ provider: 'telnyx', options: ... }` or `{ provider: 'plivo', options: ... }`. The lower-level `createTwilioVoiceRoutes(...)`, `createTelnyxVoiceRoutes(...)`, and `createPlivoVoiceRoutes(...)` helpers remain available when you need carrier-specific control.
|
|
239
243
|
|
|
240
244
|
## App Kit And Status Widgets
|
|
241
245
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { createVoiceLiveLatencyRoutes, renderVoiceLiveLatencyHTML, summarizeVoic
|
|
|
15
15
|
export { createVoiceTurnQualityHTMLHandler, createVoiceTurnQualityJSONHandler, createVoiceTurnQualityRoutes, renderVoiceTurnQualityHTML, summarizeVoiceTurnQuality } from './turnQuality';
|
|
16
16
|
export { createVoiceOutcomeContractHTMLHandler, createVoiceOutcomeContractJSONHandler, createVoiceOutcomeContractRoutes, renderVoiceOutcomeContractHTML, runVoiceOutcomeContractSuite } from './outcomeContract';
|
|
17
17
|
export { applyVoiceTelephonyOutcome, createMemoryVoiceTelephonyWebhookIdempotencyStore, createVoiceTelephonyOutcomePolicy, createVoiceTelephonyWebhookHandler, createVoiceTelephonyWebhookRoutes, parseVoiceTelephonyWebhookEvent, resolveVoiceTelephonyOutcome, signVoiceTwilioWebhook, verifyVoiceTwilioWebhookSignature, voiceTelephonyOutcomeToRouteResult } from './telephonyOutcome';
|
|
18
|
+
export { createVoicePhoneAgent } from './phoneAgent';
|
|
18
19
|
export { createStoredVoiceCallReviewArtifact, createStoredVoiceExternalObjectMap, createStoredVoiceIntegrationEvent, createStoredVoiceOpsTask, createVoiceFileExternalObjectMapStore, createVoiceFileAssistantMemoryStore, createVoiceFileIntegrationEventStore, createVoiceFileReviewStore, createVoiceFileRuntimeStorage, createVoiceFileSessionStore, createVoiceFileTaskStore, createVoiceFileTraceSinkDeliveryStore, createVoiceFileTraceEventStore } from './fileStore';
|
|
19
20
|
export { createVoiceAssistantMemoryHandle, createVoiceAssistantMemoryRecord, createVoiceMemoryAssistantMemoryStore, resolveVoiceAssistantMemoryNamespace } from './assistantMemory';
|
|
20
21
|
export { createAnthropicVoiceAssistantModel, createGeminiVoiceAssistantModel, createJSONVoiceAssistantModel, createOpenAIVoiceAssistantModel, resolveVoiceProviderRoutingPolicyPreset, createVoiceProviderRouter } from './modelAdapters';
|
|
@@ -68,6 +69,7 @@ export type { VoiceLiveLatencyOptions, VoiceLiveLatencyReport, VoiceLiveLatencyR
|
|
|
68
69
|
export type { VoiceTurnQualityHTMLHandlerOptions, VoiceTurnQualityItem, VoiceTurnQualityOptions, VoiceTurnQualityReport, VoiceTurnQualityRoutesOptions, VoiceTurnQualityStatus } from './turnQuality';
|
|
69
70
|
export type { VoiceOutcomeContractDefinition, VoiceOutcomeContractHTMLHandlerOptions, VoiceOutcomeContractIssue, VoiceOutcomeContractOptions, VoiceOutcomeContractReport, VoiceOutcomeContractRoutesOptions, VoiceOutcomeContractStatus, VoiceOutcomeContractSuiteReport } from './outcomeContract';
|
|
70
71
|
export type { VoiceTelephonyOutcomeAction, VoiceTelephonyOutcomeDecision, VoiceTelephonyOutcomePolicy, VoiceTelephonyOutcomeProviderEvent, VoiceTelephonyOutcomeRouteResult, VoiceTelephonyOutcomeStatusDecision, VoiceTelephonyWebhookDecision, VoiceTelephonyWebhookHandlerOptions, VoiceTelephonyWebhookIdempotencyStore, VoiceTelephonyWebhookParseInput, VoiceTelephonyWebhookProvider, VoiceTelephonyWebhookRoutesOptions, VoiceTelephonyWebhookVerificationResult, StoredVoiceTelephonyWebhookDecision } from './telephonyOutcome';
|
|
72
|
+
export type { VoicePhoneAgentCarrier, VoicePhoneAgentPlivoCarrier, VoicePhoneAgentRoutes, VoicePhoneAgentRoutesOptions, VoicePhoneAgentTelnyxCarrier, VoicePhoneAgentTwilioCarrier } from './phoneAgent';
|
|
71
73
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
72
74
|
export type { VoiceProductionReadinessAction, VoiceProductionReadinessCheck, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
73
75
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|