@absolutejs/voice 0.0.22-beta.104 → 0.0.22-beta.106
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 +67 -28
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6078 -5875
- package/dist/phoneAgent.d.ts +41 -0
- package/dist/simulationSuite.d.ts +105 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Pick the path that matches what you are building:
|
|
|
23
23
|
- Phone voice agent: mount Twilio, Telnyx, or Plivo routes, normalize carrier outcomes, inspect carrier readiness, and persist call lifecycle traces.
|
|
24
24
|
- Production readiness: mount `createVoiceAppKitRoutes(...)` to get ops console/status, quality, evals, provider health, sessions, handoffs, diagnostics, and readiness gates.
|
|
25
25
|
- Provider routing and fallback: use LLM/STT/TTS provider routers, provider health, provider simulation controls, and cost/latency-aware routing policies.
|
|
26
|
-
- Evals and simulation: run scenario fixtures, workflow contracts, tool contracts, outcome contracts, baseline comparisons, and saved benchmark artifacts before live traffic.
|
|
26
|
+
- Evals and simulation: mount `createVoiceSimulationSuiteRoutes(...)` to run scenario fixtures, workflow contracts, tool contracts, outcome contracts, baseline comparisons, and saved benchmark artifacts before live traffic.
|
|
27
27
|
|
|
28
28
|
## How This Differs From Hosted Voice Platforms
|
|
29
29
|
|
|
@@ -189,14 +189,48 @@ Recommended proof routes:
|
|
|
189
189
|
- `/live-latency`: browser-measured speech-to-assistant p50/p95 latency.
|
|
190
190
|
- `/turn-quality`: STT confidence, correction, fallback, and transcript diagnostics.
|
|
191
191
|
|
|
192
|
+
## Simulation Suite Path
|
|
193
|
+
|
|
194
|
+
Use `createVoiceSimulationSuiteRoutes(...)` when you want one pre-production proof surface for the things that usually live in separate dashboards or scripts:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import {
|
|
198
|
+
createVoiceSimulationSuiteRoutes,
|
|
199
|
+
createVoiceFileRuntimeStorage
|
|
200
|
+
} from '@absolutejs/voice';
|
|
201
|
+
|
|
202
|
+
const runtime = createVoiceFileRuntimeStorage({
|
|
203
|
+
directory: '.voice-runtime/support'
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
app.use(
|
|
207
|
+
createVoiceSimulationSuiteRoutes({
|
|
208
|
+
htmlPath: '/voice/simulations',
|
|
209
|
+
path: '/api/voice/simulations',
|
|
210
|
+
store: runtime.traces,
|
|
211
|
+
scenarios: workflowScenarios,
|
|
212
|
+
fixtureStore: scenarioFixtureStore,
|
|
213
|
+
tools: toolContracts,
|
|
214
|
+
outcomes: {
|
|
215
|
+
contracts: outcomeContracts,
|
|
216
|
+
events: runtime.events,
|
|
217
|
+
reviews: runtime.reviews,
|
|
218
|
+
sessions: runtime.session,
|
|
219
|
+
tasks: runtime.tasks
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
);
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The suite rolls up session quality, scenario evals, fixture simulations, tool contracts, and outcome contracts into one pass/fail report. It is the code-owned equivalent of "test this voice flow before production" without requiring a hosted voice-agent dashboard.
|
|
226
|
+
|
|
192
227
|
## Phone Voice Agent Path
|
|
193
228
|
|
|
194
229
|
Use the telephony primitives when the agent needs to answer or place calls through your own carrier account:
|
|
195
230
|
|
|
196
231
|
```ts
|
|
197
232
|
import {
|
|
198
|
-
|
|
199
|
-
createVoiceTelephonyCarrierMatrixRoutes,
|
|
233
|
+
createVoicePhoneAgent,
|
|
200
234
|
createVoiceTelephonyOutcomePolicy
|
|
201
235
|
} from '@absolutejs/voice';
|
|
202
236
|
import { deepgram } from '@absolutejs/voice-deepgram';
|
|
@@ -207,35 +241,40 @@ const outcomePolicy = createVoiceTelephonyOutcomePolicy({
|
|
|
207
241
|
|
|
208
242
|
app
|
|
209
243
|
.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
|
|
244
|
+
createVoicePhoneAgent({
|
|
245
|
+
matrix: {
|
|
246
|
+
path: '/api/carriers',
|
|
247
|
+
title: 'AbsoluteJS Voice Carrier Matrix'
|
|
229
248
|
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
249
|
+
carriers: [
|
|
250
|
+
{
|
|
251
|
+
provider: 'twilio',
|
|
252
|
+
options: {
|
|
253
|
+
context: {},
|
|
254
|
+
outcomePolicy,
|
|
255
|
+
session: runtime.session,
|
|
256
|
+
stt: deepgram({ apiKey: process.env.DEEPGRAM_API_KEY! }),
|
|
257
|
+
streamPath: '/api/voice/twilio/stream',
|
|
258
|
+
twiml: {
|
|
259
|
+
path: '/api/voice/twilio',
|
|
260
|
+
streamUrl: process.env.TWILIO_STREAM_URL
|
|
261
|
+
},
|
|
262
|
+
webhook: {
|
|
263
|
+
path: '/api/voice/twilio/webhook',
|
|
264
|
+
signingSecret: process.env.TWILIO_AUTH_TOKEN
|
|
265
|
+
},
|
|
266
|
+
async onTurn({ turn }) {
|
|
267
|
+
return { assistantText: `I heard: ${turn.text}` };
|
|
268
|
+
},
|
|
269
|
+
onComplete: async () => {}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}).routes
|
|
235
274
|
);
|
|
236
275
|
```
|
|
237
276
|
|
|
238
|
-
|
|
277
|
+
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
278
|
|
|
240
279
|
## App Kit And Status Widgets
|
|
241
280
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { createVoiceAssistantHealthHTMLHandler, createVoiceAssistantHealthJSONHa
|
|
|
5
5
|
export { createVoiceBargeInRoutes, renderVoiceBargeInHTML, summarizeVoiceBargeIn } from './bargeInRoutes';
|
|
6
6
|
export { buildVoiceDiagnosticsMarkdown, createVoiceDiagnosticsRoutes, resolveVoiceDiagnosticsTraceFilter } from './diagnosticsRoutes';
|
|
7
7
|
export { compareVoiceEvalBaseline, createVoiceFileEvalBaselineStore, createVoiceFileScenarioFixtureStore, createVoiceEvalRoutes, renderVoiceEvalBaselineHTML, renderVoiceEvalHTML, renderVoiceScenarioEvalHTML, renderVoiceScenarioFixtureEvalHTML, runVoiceScenarioEvals, runVoiceScenarioFixtureEvals, runVoiceSessionEvals } from './evalRoutes';
|
|
8
|
+
export { createVoiceSimulationSuiteRoutes, renderVoiceSimulationSuiteHTML, runVoiceSimulationSuite } from './simulationSuite';
|
|
8
9
|
export { createVoiceWorkflowContract, createVoiceWorkflowContractHandler, createVoiceWorkflowContractPreset, createVoiceWorkflowScenario, recordVoiceWorkflowContractTrace, validateVoiceWorkflowRouteResult } from './workflowContract';
|
|
9
10
|
export { createVoiceSessionListRoutes, createVoiceSessionReplayHTMLHandler, createVoiceSessionReplayJSONHandler, createVoiceSessionReplayRoutes, createVoiceSessionsHTMLHandler, createVoiceSessionsJSONHandler, renderVoiceSessionsHTML, summarizeVoiceSessions, summarizeVoiceSessionReplay } from './sessionReplay';
|
|
10
11
|
export { createVoiceAgent, createVoiceAgentSquad, createVoiceAgentTool } from './agent';
|
|
@@ -15,6 +16,7 @@ export { createVoiceLiveLatencyRoutes, renderVoiceLiveLatencyHTML, summarizeVoic
|
|
|
15
16
|
export { createVoiceTurnQualityHTMLHandler, createVoiceTurnQualityJSONHandler, createVoiceTurnQualityRoutes, renderVoiceTurnQualityHTML, summarizeVoiceTurnQuality } from './turnQuality';
|
|
16
17
|
export { createVoiceOutcomeContractHTMLHandler, createVoiceOutcomeContractJSONHandler, createVoiceOutcomeContractRoutes, renderVoiceOutcomeContractHTML, runVoiceOutcomeContractSuite } from './outcomeContract';
|
|
17
18
|
export { applyVoiceTelephonyOutcome, createMemoryVoiceTelephonyWebhookIdempotencyStore, createVoiceTelephonyOutcomePolicy, createVoiceTelephonyWebhookHandler, createVoiceTelephonyWebhookRoutes, parseVoiceTelephonyWebhookEvent, resolveVoiceTelephonyOutcome, signVoiceTwilioWebhook, verifyVoiceTwilioWebhookSignature, voiceTelephonyOutcomeToRouteResult } from './telephonyOutcome';
|
|
19
|
+
export { createVoicePhoneAgent } from './phoneAgent';
|
|
18
20
|
export { createStoredVoiceCallReviewArtifact, createStoredVoiceExternalObjectMap, createStoredVoiceIntegrationEvent, createStoredVoiceOpsTask, createVoiceFileExternalObjectMapStore, createVoiceFileAssistantMemoryStore, createVoiceFileIntegrationEventStore, createVoiceFileReviewStore, createVoiceFileRuntimeStorage, createVoiceFileSessionStore, createVoiceFileTaskStore, createVoiceFileTraceSinkDeliveryStore, createVoiceFileTraceEventStore } from './fileStore';
|
|
19
21
|
export { createVoiceAssistantMemoryHandle, createVoiceAssistantMemoryRecord, createVoiceMemoryAssistantMemoryStore, resolveVoiceAssistantMemoryNamespace } from './assistantMemory';
|
|
20
22
|
export { createAnthropicVoiceAssistantModel, createGeminiVoiceAssistantModel, createJSONVoiceAssistantModel, createOpenAIVoiceAssistantModel, resolveVoiceProviderRoutingPolicyPreset, createVoiceProviderRouter } from './modelAdapters';
|
|
@@ -57,6 +59,7 @@ export type { VoiceAssistantHealthFailure, VoiceAssistantHealthHTMLHandlerOption
|
|
|
57
59
|
export type { VoiceAssistantMemoryBinding, VoiceAssistantMemoryHandle, VoiceAssistantMemoryOptions, VoiceAssistantMemoryRecord, VoiceAssistantMemoryStore } from './assistantMemory';
|
|
58
60
|
export type { VoiceDiagnosticsRoutesOptions } from './diagnosticsRoutes';
|
|
59
61
|
export type { VoiceEvalBaselineComparison, VoiceEvalBaselineComparisonOptions, VoiceEvalBaselineStore, VoiceEvalBaselineSummary, VoiceEvalLink, VoiceEvalReport, VoiceEvalRoutesOptions, VoiceEvalSessionReport, VoiceEvalStatus, VoiceEvalTrendBucket, VoiceScenarioEvalDefinition, VoiceScenarioEvalReport, VoiceScenarioEvalResult, VoiceScenarioEvalSessionResult, VoiceScenarioFixture, VoiceScenarioFixtureEvalReport, VoiceScenarioFixtureEvalResult, VoiceScenarioFixtureStore } from './evalRoutes';
|
|
62
|
+
export type { VoiceSimulationSuiteEvalRoutesOptions, VoiceSimulationSuiteOptions, VoiceSimulationSuiteReport, VoiceSimulationSuiteRoutesOptions, VoiceSimulationSuiteSectionSummary, VoiceSimulationSuiteStatus } from './simulationSuite';
|
|
60
63
|
export type { VoiceWorkflowContract, VoiceWorkflowContractDefinition, VoiceWorkflowContractField, VoiceWorkflowContractFieldMatch, VoiceWorkflowContractPresetName, VoiceWorkflowContractPresetOptions, VoiceWorkflowContractTracePayload, VoiceWorkflowContractValidation, VoiceWorkflowContractValidationIssue, VoiceWorkflowOutcome } from './workflowContract';
|
|
61
64
|
export type { VoiceSessionListHTMLHandlerOptions, VoiceSessionListItem, VoiceSessionListOptions, VoiceSessionListRoutesOptions, VoiceSessionListStatus, VoiceSessionReplay, VoiceSessionReplayHTMLHandlerOptions, VoiceSessionReplayOptions, VoiceSessionReplayRoutesOptions, VoiceSessionReplayTurn } from './sessionReplay';
|
|
62
65
|
export type { AnthropicVoiceAssistantModelOptions, GeminiVoiceAssistantModelOptions, OpenAIVoiceAssistantModelOptions, VoiceProviderRouterEvent, VoiceProviderRouterFallbackMode, VoiceProviderRouterHealthOptions, VoiceProviderRouterOptions, VoiceProviderRouterPolicy, VoiceProviderRouterPolicyPreset, VoiceProviderRouterPolicyWeights, VoiceProviderRouterProviderHealth, VoiceProviderRouterProviderProfile, VoiceProviderRouterStrategy, VoiceJSONAssistantModelHandler, VoiceJSONAssistantModelOptions } from './modelAdapters';
|
|
@@ -68,6 +71,7 @@ export type { VoiceLiveLatencyOptions, VoiceLiveLatencyReport, VoiceLiveLatencyR
|
|
|
68
71
|
export type { VoiceTurnQualityHTMLHandlerOptions, VoiceTurnQualityItem, VoiceTurnQualityOptions, VoiceTurnQualityReport, VoiceTurnQualityRoutesOptions, VoiceTurnQualityStatus } from './turnQuality';
|
|
69
72
|
export type { VoiceOutcomeContractDefinition, VoiceOutcomeContractHTMLHandlerOptions, VoiceOutcomeContractIssue, VoiceOutcomeContractOptions, VoiceOutcomeContractReport, VoiceOutcomeContractRoutesOptions, VoiceOutcomeContractStatus, VoiceOutcomeContractSuiteReport } from './outcomeContract';
|
|
70
73
|
export type { VoiceTelephonyOutcomeAction, VoiceTelephonyOutcomeDecision, VoiceTelephonyOutcomePolicy, VoiceTelephonyOutcomeProviderEvent, VoiceTelephonyOutcomeRouteResult, VoiceTelephonyOutcomeStatusDecision, VoiceTelephonyWebhookDecision, VoiceTelephonyWebhookHandlerOptions, VoiceTelephonyWebhookIdempotencyStore, VoiceTelephonyWebhookParseInput, VoiceTelephonyWebhookProvider, VoiceTelephonyWebhookRoutesOptions, VoiceTelephonyWebhookVerificationResult, StoredVoiceTelephonyWebhookDecision } from './telephonyOutcome';
|
|
74
|
+
export type { VoicePhoneAgentCarrier, VoicePhoneAgentPlivoCarrier, VoicePhoneAgentRoutes, VoicePhoneAgentRoutesOptions, VoicePhoneAgentTelnyxCarrier, VoicePhoneAgentTwilioCarrier } from './phoneAgent';
|
|
71
75
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
72
76
|
export type { VoiceProductionReadinessAction, VoiceProductionReadinessCheck, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
73
77
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|