@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.
Files changed (2) hide show
  1. package/README.md +21 -2
  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(...)` plus `createVoiceGuardrailRoutes(...)` | blocking/warning decisions, redacted content, `assistant.guardrail` trace events | guardrail JSON/Markdown routes and operations record traces |
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 `createVoiceGuardrailRoutes(...)` when you need code-owned policy checks for what an agent may say, what tool payloads may contain, or which transcript content should warn/redact before downstream workflow. The primitive does not force a moderation vendor or hosted dashboard; it returns JSON/Markdown proof and can emit `assistant.guardrail` trace events.
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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.246",
3
+ "version": "0.0.22-beta.247",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",