@absolutejs/voice 0.0.22-beta.170 → 0.0.22-beta.172
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 +5 -3
- package/dist/productionReadiness.d.ts +1 -0
- 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
|
@@ -20737,14 +20737,15 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20737
20737
|
const issues = row.checks.filter((check) => check.status !== "pass").map((check) => check.label).join(", ");
|
|
20738
20738
|
return `${row.kind.toUpperCase()} ${row.provider}: ${issues}`;
|
|
20739
20739
|
}).join("; ") + "." : "Provider contract matrix needs review.",
|
|
20740
|
-
href: options.links?.
|
|
20740
|
+
href: options.links?.providerContracts ?? "/provider-contracts",
|
|
20741
20741
|
label: "Provider contract matrix",
|
|
20742
|
+
proofSource: proofSource("providerContractMatrix", "providerContracts"),
|
|
20742
20743
|
status: providerContractMatrix.status,
|
|
20743
20744
|
value: `${providerContractMatrix.passed}/${providerContractMatrix.total}`,
|
|
20744
20745
|
actions: providerContractMatrix.status === "pass" ? [] : [
|
|
20745
20746
|
{
|
|
20746
20747
|
description: "Open provider capabilities and inspect missing env, fallback, streaming, latency, or capability contracts.",
|
|
20747
|
-
href: options.links?.
|
|
20748
|
+
href: options.links?.providerContracts ?? "/provider-contracts",
|
|
20748
20749
|
label: "Open provider matrix"
|
|
20749
20750
|
}
|
|
20750
20751
|
]
|
|
@@ -20916,6 +20917,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
20916
20917
|
liveLatency: "/traces",
|
|
20917
20918
|
opsActions: "/voice/ops-actions",
|
|
20918
20919
|
phoneAgentSmoke: "/sessions",
|
|
20920
|
+
providerContracts: "/provider-contracts",
|
|
20919
20921
|
providerRoutingContracts: "/resilience",
|
|
20920
20922
|
quality: "/quality",
|
|
20921
20923
|
reconnectContracts: "/sessions",
|
|
@@ -21596,7 +21598,7 @@ var renderVoiceProviderContractMatrixHTML = (report, options = {}) => {
|
|
|
21596
21598
|
<ul>${checks}</ul>
|
|
21597
21599
|
</article>`;
|
|
21598
21600
|
}).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>`;
|
|
21601
|
+
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
21602
|
};
|
|
21601
21603
|
var createVoiceProviderContractMatrixJSONHandler = (matrix) => async () => buildVoiceProviderContractMatrix(await resolveProviderContractMatrixInput(matrix));
|
|
21602
21604
|
var createVoiceProviderContractMatrixHTMLHandler = (options) => async () => {
|