@absolutejs/voice 0.0.22-beta.170 → 0.0.22-beta.171
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 +40 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2073,6 +2073,46 @@ if (!report.pass) {
|
|
|
2073
2073
|
|
|
2074
2074
|
Pass provider routing contract reports into production readiness through `providerRoutingContracts`. Readiness fails when a fallback contract fails, so model-routing regressions become deploy blockers instead of dashboard-only surprises.
|
|
2075
2075
|
|
|
2076
|
+
Use `createVoiceProviderContractMatrixPreset(...)` when you want readiness proof for the whole provider stack without hand-writing every LLM, STT, and TTS contract row. The preset stays primitive: you still own provider lists, selected providers, latency budgets, env, capabilities, and route mounting.
|
|
2077
|
+
|
|
2078
|
+
```ts
|
|
2079
|
+
import {
|
|
2080
|
+
buildVoiceProviderContractMatrix,
|
|
2081
|
+
createVoiceProviderContractMatrixPreset,
|
|
2082
|
+
createVoiceProviderContractMatrixRoutes
|
|
2083
|
+
} from '@absolutejs/voice';
|
|
2084
|
+
|
|
2085
|
+
const providerContracts = () =>
|
|
2086
|
+
createVoiceProviderContractMatrixPreset('phone-agent', {
|
|
2087
|
+
env: process.env,
|
|
2088
|
+
providers: {
|
|
2089
|
+
llm: ['openai', 'anthropic', 'gemini'],
|
|
2090
|
+
stt: ['deepgram', 'assemblyai'],
|
|
2091
|
+
tts: ['openai', 'emergency']
|
|
2092
|
+
},
|
|
2093
|
+
selected: {
|
|
2094
|
+
llm: 'openai',
|
|
2095
|
+
stt: 'deepgram',
|
|
2096
|
+
tts: 'openai'
|
|
2097
|
+
},
|
|
2098
|
+
latencyBudgets: {
|
|
2099
|
+
openai: 900,
|
|
2100
|
+
deepgram: 250,
|
|
2101
|
+
assemblyai: 900,
|
|
2102
|
+
emergency: 80
|
|
2103
|
+
},
|
|
2104
|
+
remediationHref: '/provider-contracts'
|
|
2105
|
+
});
|
|
2106
|
+
|
|
2107
|
+
const app = createVoiceProviderContractMatrixRoutes({
|
|
2108
|
+
htmlPath: '/provider-contracts',
|
|
2109
|
+
path: '/api/provider-contracts',
|
|
2110
|
+
load: () => buildVoiceProviderContractMatrix(providerContracts())
|
|
2111
|
+
});
|
|
2112
|
+
```
|
|
2113
|
+
|
|
2114
|
+
The preset maps common provider names to env checks, streaming defaults, fallback rows, and profile-required capabilities. Override `configured`, `capabilities`, `fallbackProviders`, or `streaming` whenever your deployment uses custom adapters or local fallbacks.
|
|
2115
|
+
|
|
2076
2116
|
For full control, pass an object policy:
|
|
2077
2117
|
|
|
2078
2118
|
```ts
|
package/dist/index.js
CHANGED
|
@@ -21596,7 +21596,7 @@ var renderVoiceProviderContractMatrixHTML = (report, options = {}) => {
|
|
|
21596
21596
|
<ul>${checks}</ul>
|
|
21597
21597
|
</article>`;
|
|
21598
21598
|
}).join("");
|
|
21599
|
-
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml36(title)}</title><style>body{background:#0f1412;color:#f7f3e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1180px;padding:32px}.hero,.row{background:#17201b;border:1px solid #2d3b32;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(34,197,94,.16),rgba(125,211,252,.12))}.eyebrow{color:#86efac;font-size:.78rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.4rem,6vw,5rem);letter-spacing:-.06em;line-height:.9;margin:.2rem 0 1rem}h2{margin:.2rem 0}.summary{display:flex;flex-wrap:wrap;gap:10px}.pill,.status{border:1px solid #3f4f45;border-radius:999px;display:inline-flex;padding:8px 12px}.status.pass,.row.pass,.pass{border-color:rgba(34,197,94,.65)}.status.warn,.row.warn,.warn{border-color:rgba(245,158,11,.7)}.status.fail,.row.fail,.fail{border-color:rgba(239,68,68,.75)}.row{display:grid;gap:20px;grid-template-columns:minmax(180px,.45fr) 1fr}.row ul{display:grid;gap:10px;list-style:none;margin:0;padding:0}.row li{background:#111814;border:1px solid #2d3b32;border-radius:16px;display:grid;gap:4px;padding:12px}.row li span{color:#b8c2ba}.row li em{color:#f9d77e;font-style:normal}.row li a{color:#86efac}@media(max-width:760px){main{padding:18px}.row{grid-template-columns:1fr}}</style></head><body><main><section class="hero"><p class="eyebrow">Provider contracts</p><h1>${escapeHtml36(title)}</h1><p>Self-hosted provider proof for configured state, required env, latency budgets, fallback, streaming, and declared capabilities.</p><div class="summary"><span class="pill">${String(report.passed)} passing</span><span class="pill">${String(report.warned)} warning</span><span class="pill">${String(report.failed)} failing</span><span class="pill">${String(report.total)} total</span></div></section>${rows || '<article class="row"><p>No provider contracts configured.</p></article>'}</main></body></html>`;
|
|
21599
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml36(title)}</title><style>body{background:#0f1412;color:#f7f3e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1180px;padding:32px}.hero,.primitive,.row{background:#17201b;border:1px solid #2d3b32;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(34,197,94,.16),rgba(125,211,252,.12))}.primitive{background:#111814;border-color:#41604a}.eyebrow{color:#86efac;font-size:.78rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.4rem,6vw,5rem);letter-spacing:-.06em;line-height:.9;margin:.2rem 0 1rem}h2{margin:.2rem 0}.summary{display:flex;flex-wrap:wrap;gap:10px}.pill,.status{border:1px solid #3f4f45;border-radius:999px;display:inline-flex;padding:8px 12px}.primitive code{color:#bbf7d0}.primitive p{color:#c8d8ca;line-height:1.55;margin:.45rem 0 0}.status.pass,.row.pass,.pass{border-color:rgba(34,197,94,.65)}.status.warn,.row.warn,.warn{border-color:rgba(245,158,11,.7)}.status.fail,.row.fail,.fail{border-color:rgba(239,68,68,.75)}.row{display:grid;gap:20px;grid-template-columns:minmax(180px,.45fr) 1fr}.row ul{display:grid;gap:10px;list-style:none;margin:0;padding:0}.row li{background:#111814;border:1px solid #2d3b32;border-radius:16px;display:grid;gap:4px;padding:12px}.row li span{color:#b8c2ba}.row li em{color:#f9d77e;font-style:normal}.row li a{color:#86efac}@media(max-width:760px){main{padding:18px}.row{grid-template-columns:1fr}}</style></head><body><main><section class="hero"><p class="eyebrow">Provider contracts</p><h1>${escapeHtml36(title)}</h1><p>Self-hosted provider proof for configured state, required env, latency budgets, fallback, streaming, and declared capabilities.</p><div class="summary"><span class="pill">${String(report.passed)} passing</span><span class="pill">${String(report.warned)} warning</span><span class="pill">${String(report.failed)} failing</span><span class="pill">${String(report.total)} total</span></div></section><section class="primitive"><p class="eyebrow">One package primitive</p><h2><code>createVoiceProviderContractMatrixPreset(...)</code> builds this matrix</h2><p>Give AbsoluteJS your configured LLM, STT, and TTS providers once. It turns them into deploy-checkable proof for env, fallback, streaming, latency budgets, selected providers, and profile-required capabilities without a hosted dashboard.</p></section>${rows || '<article class="row"><p>No provider contracts configured.</p></article>'}</main></body></html>`;
|
|
21600
21600
|
};
|
|
21601
21601
|
var createVoiceProviderContractMatrixJSONHandler = (matrix) => async () => buildVoiceProviderContractMatrix(await resolveProviderContractMatrixInput(matrix));
|
|
21602
21602
|
var createVoiceProviderContractMatrixHTMLHandler = (options) => async () => {
|