@absolutejs/voice 0.0.22-beta.246 → 0.0.22-beta.247
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 +21 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ These are the primitive-first paths a Vapi-style buyer usually needs. Each path
|
|
|
37
37
|
| Phone voice assistant | `createVoicePhoneAgent(...)` | carrier matrix, setup instructions, phone smoke contract, production readiness, operations record | phone setup HTML/JSON, smoke HTML/JSON, framework status UI |
|
|
38
38
|
| Multi-specialist support flow | `createVoiceAgentSquad(...)` | squad contract, handoff traces, context traces, operations record | Agent Squad status hooks/composables/services/widgets |
|
|
39
39
|
| Business actions and tools | `createVoiceAgentTool(...)` plus agent tool runtime | tool contracts, audit events, integration events, outcome contracts | operations record, action center, contract routes |
|
|
40
|
-
| Guardrails and policy checks | `createVoiceGuardrailPolicy(...)`
|
|
40
|
+
| Guardrails and policy checks | `createVoiceGuardrailPolicy(...)`, `createVoiceGuardrailRuntime(...)`, and `createVoiceGuardrailRoutes(...)` | live assistant/tool enforcement, blocking/warning decisions, redacted content, `assistant.guardrail` trace events | guardrail JSON/Markdown routes and operations record traces |
|
|
41
41
|
| Provider routing and fallback | provider routers, health checks, simulation controls | provider contract matrix, provider-stage traces, latency SLO reports | provider contract hooks/composables/services/widgets |
|
|
42
42
|
| Production operations | ops status, ops recovery, production readiness, delivery runtime | readiness gates, recovery report, incident Markdown, delivery queues | ops action center, delivery runtime UI, operations record |
|
|
43
43
|
| Outbound campaigns | `createVoiceCampaignRoutes(...)` | recipient validation, consent/dedupe, carrier dry-run, campaign readiness | campaign routes and operations-record-linked attempt proof |
|
|
@@ -116,14 +116,33 @@ app.use(
|
|
|
116
116
|
|
|
117
117
|
## Guardrails
|
|
118
118
|
|
|
119
|
-
Use `
|
|
119
|
+
Use `createVoiceGuardrailRuntime(...)` when you need code-owned live enforcement for what an agent may say, what tool payloads may contain, or which transcript content should warn/redact before downstream workflow. Use `createVoiceGuardrailRoutes(...)` beside it when you also want JSON/Markdown proof. The primitive does not force a moderation vendor or hosted dashboard; it emits `assistant.guardrail` trace events from the runtime and route surfaces.
|
|
120
120
|
|
|
121
121
|
```ts
|
|
122
122
|
import {
|
|
123
|
+
createVoiceGuardrailRuntime,
|
|
123
124
|
createVoiceGuardrailRoutes,
|
|
124
125
|
voiceGuardrailPolicyPresets
|
|
125
126
|
} from '@absolutejs/voice';
|
|
126
127
|
|
|
128
|
+
const guardrails = createVoiceGuardrailRuntime({
|
|
129
|
+
blockResult: ({ decision }) => ({
|
|
130
|
+
assistantText: 'I need to route this to a human specialist.',
|
|
131
|
+
escalate: {
|
|
132
|
+
reason: `guardrail-blocked-${decision.stage}`
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
policies: [voiceGuardrailPolicyPresets.supportSafeDefaults],
|
|
136
|
+
trace: runtime.traces
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const assistant = createVoiceAssistant({
|
|
140
|
+
guardrails: guardrails.assistantGuardrails,
|
|
141
|
+
id: 'support',
|
|
142
|
+
model,
|
|
143
|
+
tools: guardrails.wrapTools([lookupCustomerTool, createTicketTool])
|
|
144
|
+
});
|
|
145
|
+
|
|
127
146
|
app.use(
|
|
128
147
|
createVoiceGuardrailRoutes({
|
|
129
148
|
path: '/api/voice/guardrails',
|