@absolutejs/voice 0.0.22-beta.54 → 0.0.22-beta.55
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 +109 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,115 @@ const app = new Elysia()
|
|
|
73
73
|
|
|
74
74
|
`createVoiceMemoryStore()` is dev-only. Real deployments should provide a shared store backed by Redis, Postgres, or equivalent.
|
|
75
75
|
|
|
76
|
+
## App Kit And Status Widgets
|
|
77
|
+
|
|
78
|
+
Use `createVoiceAppKitRoutes(...)` when you want a self-hosted operations surface without hand-wiring every dashboard route. It adds the ops console, quality gates, eval routes, provider health, session replay, handoff health, diagnostics, and `GET /app-kit/status`.
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { createVoiceAppKitRoutes, createVoiceFileRuntimeStorage } from '@absolutejs/voice';
|
|
82
|
+
|
|
83
|
+
const runtime = createVoiceFileRuntimeStorage({ directory: '.voice-runtime/support' });
|
|
84
|
+
|
|
85
|
+
app.use(
|
|
86
|
+
createVoiceAppKitRoutes({
|
|
87
|
+
store: runtime.traces,
|
|
88
|
+
llmProviders: ['openai', 'anthropic', 'gemini'],
|
|
89
|
+
sttProviders: ['deepgram', 'assemblyai']
|
|
90
|
+
}).routes
|
|
91
|
+
);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The status endpoint is intentionally small enough for customer-facing demos. It can report fixture-backed workflow readiness while leaving deeper live quality/session failures visible on the ops pages.
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
app.use(
|
|
98
|
+
createVoiceAppKitRoutes({
|
|
99
|
+
appStatus: {
|
|
100
|
+
include: { quality: false, sessions: false },
|
|
101
|
+
preferFixtureWorkflows: true
|
|
102
|
+
},
|
|
103
|
+
evals: { fixtures: certificationFixtures, scenarios: workflowScenarios },
|
|
104
|
+
store: runtime.traces
|
|
105
|
+
}).routes
|
|
106
|
+
);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### React Status Widget
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { VoiceOpsStatus } from '@absolutejs/voice/react';
|
|
113
|
+
|
|
114
|
+
export function OpsBadge() {
|
|
115
|
+
return <VoiceOpsStatus intervalMs={5000} />;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Vue Status Widget
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<script setup lang="ts">
|
|
123
|
+
import { VoiceOpsStatus } from '@absolutejs/voice/vue';
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<template>
|
|
127
|
+
<VoiceOpsStatus :interval-ms="5000" />
|
|
128
|
+
</template>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Svelte Status Widget
|
|
132
|
+
|
|
133
|
+
```svelte
|
|
134
|
+
<script lang="ts">
|
|
135
|
+
import { onDestroy, onMount } from 'svelte';
|
|
136
|
+
import { createVoiceOpsStatus } from '@absolutejs/voice/svelte';
|
|
137
|
+
|
|
138
|
+
const status = createVoiceOpsStatus('/app-kit/status', { intervalMs: 5000 });
|
|
139
|
+
let html = '';
|
|
140
|
+
onMount(() => status.subscribe(() => (html = status.getHTML())));
|
|
141
|
+
onDestroy(() => status.close());
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
{@html html}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Angular Status Widget
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
import { VoiceAppKitStatusService } from '@absolutejs/voice/angular';
|
|
151
|
+
|
|
152
|
+
status = inject(VoiceAppKitStatusService).connect('/app-kit/status', {
|
|
153
|
+
intervalMs: 5000
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```html
|
|
158
|
+
<h2>{{ status.report()?.status === 'pass' ? 'Passing' : 'Needs attention' }}</h2>
|
|
159
|
+
<p>{{ status.report()?.passed ?? 0 }} passing checks</p>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### HTML Or HTMX Status Widget
|
|
163
|
+
|
|
164
|
+
```html
|
|
165
|
+
<div id="voice-ops-status"></div>
|
|
166
|
+
<script type="module">
|
|
167
|
+
import { mountVoiceOpsStatus } from '@absolutejs/voice/client';
|
|
168
|
+
|
|
169
|
+
mountVoiceOpsStatus(document.querySelector('#voice-ops-status'), '/app-kit/status', {
|
|
170
|
+
intervalMs: 5000
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
For custom elements:
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
<absolute-voice-ops-status interval-ms="5000"></absolute-voice-ops-status>
|
|
179
|
+
<script type="module">
|
|
180
|
+
import { defineVoiceOpsStatusElement } from '@absolutejs/voice/client';
|
|
181
|
+
defineVoiceOpsStatusElement();
|
|
182
|
+
</script>
|
|
183
|
+
```
|
|
184
|
+
|
|
76
185
|
## Voice Assistants
|
|
77
186
|
|
|
78
187
|
Use `createVoiceAssistant(...)` when you want one product-level surface for a voice agent instead of wiring tools, guardrails, experiments, traces, and ops recipes separately. It returns a standard `onTurn` handler, plus an `ops` object you can pass to `voice(...)`.
|