@absolutejs/voice 0.0.22-beta.311 → 0.0.22-beta.312
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/dist/index.d.ts +2 -2
- package/dist/index.js +111 -2
- package/dist/mediaPipeline.d.ts +44 -0
- package/dist/mediaPipelineRoutes.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export type { VoiceRealtimeChannelAssertionInput, VoiceRealtimeChannelAssertionR
|
|
|
15
15
|
export { assertVoiceRealtimeProviderContractEvidence, buildVoiceRealtimeProviderContractMatrix, createVoiceRealtimeProviderContractMatrixPreset, createVoiceRealtimeProviderContractRoutes, evaluateVoiceRealtimeProviderContractEvidence, renderVoiceRealtimeProviderContractHTML } from './realtimeProviderContracts';
|
|
16
16
|
export type { VoiceRealtimeProviderContractAssertionInput, VoiceRealtimeProviderContractAssertionReport, VoiceRealtimeProviderContractCapability, VoiceRealtimeProviderContractCheck, VoiceRealtimeProviderContractDefinition, VoiceRealtimeProviderContractMatrixPresetOptions, VoiceRealtimeProviderContractMatrixInput, VoiceRealtimeProviderContractMatrixReport, VoiceRealtimeProviderContractRoutesOptions, VoiceRealtimeProviderContractRow, VoiceRealtimeProviderPresetProvider, VoiceRealtimeProviderContractStatus } from './realtimeProviderContracts';
|
|
17
17
|
export { buildVoiceDiagnosticsMarkdown, createVoiceDiagnosticsRoutes, resolveVoiceDiagnosticsTraceFilter } from './diagnosticsRoutes';
|
|
18
|
-
export { buildVoiceMediaInterruptionReport, buildVoiceMediaPipelineCalibrationReport, buildVoiceMediaResamplingPlan, buildVoiceMediaVadReport, createVoiceMediaFrame, createVoiceMediaFrameTransformPipeline } from './mediaPipeline';
|
|
19
|
-
export type { VoiceMediaFrame, VoiceMediaFrameKind, VoiceMediaFrameSource, VoiceMediaFrameTransform, VoiceMediaFrameTransformPipeline, VoiceMediaInterruptionInput, VoiceMediaInterruptionReport, VoiceMediaPipelineCalibrationInput, VoiceMediaPipelineCalibrationIssue, VoiceMediaPipelineCalibrationReport, VoiceMediaPipelineStatus, VoiceMediaResamplingPlan, VoiceMediaTransportAdapter, VoiceMediaVadInput, VoiceMediaVadReport, VoiceMediaVadSegment } from './mediaPipeline';
|
|
18
|
+
export { buildVoiceMediaTransportReport, buildVoiceMediaInterruptionReport, buildVoiceMediaPipelineCalibrationReport, buildVoiceMediaResamplingPlan, buildVoiceMediaVadReport, createVoiceMediaFrame, createVoiceMediaFrameTransformPipeline, createVoiceMediaTransport } from './mediaPipeline';
|
|
19
|
+
export type { VoiceMediaFrame, VoiceMediaFrameKind, VoiceMediaFrameSource, VoiceMediaFrameTransform, VoiceMediaFrameTransformPipeline, VoiceMediaInterruptionInput, VoiceMediaInterruptionReport, VoiceMediaPipelineCalibrationInput, VoiceMediaPipelineCalibrationIssue, VoiceMediaPipelineCalibrationReport, VoiceMediaPipelineStatus, VoiceMediaResamplingPlan, VoiceMediaTransport, VoiceMediaTransportAdapter, VoiceMediaTransportEvent, VoiceMediaTransportEventKind, VoiceMediaTransportOptions, VoiceMediaTransportReport, VoiceMediaTransportState, VoiceMediaVadInput, VoiceMediaVadReport, VoiceMediaVadSegment } from './mediaPipeline';
|
|
20
20
|
export { assertVoiceMediaPipelineEvidence, buildVoiceMediaPipelineReport, createVoiceMediaPipelineRoutes, evaluateVoiceMediaPipelineEvidence, renderVoiceMediaPipelineHTML, renderVoiceMediaPipelineMarkdown } from './mediaPipelineRoutes';
|
|
21
21
|
export type { VoiceMediaPipelineAssertionInput, VoiceMediaPipelineAssertionReport, VoiceMediaPipelineReport, VoiceMediaPipelineReportOptions, VoiceMediaPipelineRoutesOptions } from './mediaPipelineRoutes';
|
|
22
22
|
export { buildVoiceDemoReadyReport, createVoiceDemoReadyRoutes, renderVoiceDemoReadyHTML } from './demoReadyRoutes';
|
package/dist/index.js
CHANGED
|
@@ -11620,6 +11620,95 @@ var numericMetadata = (frame, key) => {
|
|
|
11620
11620
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
11621
11621
|
};
|
|
11622
11622
|
var createVoiceMediaFrame = (frame) => frame;
|
|
11623
|
+
var buildVoiceMediaTransportReport = (input) => {
|
|
11624
|
+
const events = input.events ?? [];
|
|
11625
|
+
const state = input.state ?? events.at(-1)?.state ?? "idle";
|
|
11626
|
+
const backpressureEvents = events.filter((event) => event.kind === "backpressure").length;
|
|
11627
|
+
const failed = state === "failed" || events.some((event) => event.kind === "error");
|
|
11628
|
+
return {
|
|
11629
|
+
backpressureEvents,
|
|
11630
|
+
checkedAt: Date.now(),
|
|
11631
|
+
closed: state === "closed",
|
|
11632
|
+
connected: state === "open",
|
|
11633
|
+
events,
|
|
11634
|
+
failed,
|
|
11635
|
+
inputFrames: events.filter((event) => event.kind === "frame-in").length,
|
|
11636
|
+
name: input.name,
|
|
11637
|
+
outputFrames: events.filter((event) => event.kind === "frame-out").length,
|
|
11638
|
+
state,
|
|
11639
|
+
status: failed ? "fail" : backpressureEvents > 0 ? "warn" : "pass"
|
|
11640
|
+
};
|
|
11641
|
+
};
|
|
11642
|
+
var createVoiceMediaTransport = (options) => {
|
|
11643
|
+
let state = "idle";
|
|
11644
|
+
const events = [];
|
|
11645
|
+
const frameHandlers = new Set;
|
|
11646
|
+
const record = (event) => {
|
|
11647
|
+
events.push({ ...event, at: Date.now(), state });
|
|
11648
|
+
};
|
|
11649
|
+
return {
|
|
11650
|
+
close: async () => {
|
|
11651
|
+
state = "closing";
|
|
11652
|
+
await options.onClose?.();
|
|
11653
|
+
state = "closed";
|
|
11654
|
+
record({ kind: "close" });
|
|
11655
|
+
},
|
|
11656
|
+
connect: async () => {
|
|
11657
|
+
try {
|
|
11658
|
+
await options.onConnect?.();
|
|
11659
|
+
state = "open";
|
|
11660
|
+
record({ kind: "connect" });
|
|
11661
|
+
} catch (error) {
|
|
11662
|
+
state = "failed";
|
|
11663
|
+
record({
|
|
11664
|
+
error: error instanceof Error ? error.message : String(error),
|
|
11665
|
+
kind: "error"
|
|
11666
|
+
});
|
|
11667
|
+
throw error;
|
|
11668
|
+
}
|
|
11669
|
+
},
|
|
11670
|
+
events: () => [...events],
|
|
11671
|
+
inputFormat: options.inputFormat,
|
|
11672
|
+
name: options.name,
|
|
11673
|
+
onFrame: (handler) => {
|
|
11674
|
+
frameHandlers.add(handler);
|
|
11675
|
+
return () => frameHandlers.delete(handler);
|
|
11676
|
+
},
|
|
11677
|
+
outputFormat: options.outputFormat,
|
|
11678
|
+
receive: async (frame) => {
|
|
11679
|
+
record({ frameId: frame.id, kind: "frame-in" });
|
|
11680
|
+
if (options.maxBufferedFrames !== undefined && events.filter((event) => event.kind === "frame-in").length > options.maxBufferedFrames) {
|
|
11681
|
+
record({
|
|
11682
|
+
bufferedFrames: events.filter((event) => event.kind === "frame-in").length,
|
|
11683
|
+
kind: "backpressure"
|
|
11684
|
+
});
|
|
11685
|
+
}
|
|
11686
|
+
for (const handler of frameHandlers) {
|
|
11687
|
+
await handler(frame);
|
|
11688
|
+
}
|
|
11689
|
+
},
|
|
11690
|
+
report: () => buildVoiceMediaTransportReport({
|
|
11691
|
+
events,
|
|
11692
|
+
name: options.name,
|
|
11693
|
+
state
|
|
11694
|
+
}),
|
|
11695
|
+
send: async (frame) => {
|
|
11696
|
+
try {
|
|
11697
|
+
await options.onSend?.(frame);
|
|
11698
|
+
record({ frameId: frame.id, kind: "frame-out" });
|
|
11699
|
+
} catch (error) {
|
|
11700
|
+
state = "failed";
|
|
11701
|
+
record({
|
|
11702
|
+
error: error instanceof Error ? error.message : String(error),
|
|
11703
|
+
frameId: frame.id,
|
|
11704
|
+
kind: "error"
|
|
11705
|
+
});
|
|
11706
|
+
throw error;
|
|
11707
|
+
}
|
|
11708
|
+
},
|
|
11709
|
+
state: () => state
|
|
11710
|
+
};
|
|
11711
|
+
};
|
|
11623
11712
|
var buildVoiceMediaResamplingPlan = (input) => {
|
|
11624
11713
|
const required = !formatMatches2(input.inputFormat, input.outputFormat);
|
|
11625
11714
|
return {
|
|
@@ -11849,7 +11938,8 @@ var buildVoiceMediaPipelineReport = (options = {}) => {
|
|
|
11849
11938
|
calibration.status,
|
|
11850
11939
|
vad.status,
|
|
11851
11940
|
interruption.status,
|
|
11852
|
-
resampling?.status ?? "pass"
|
|
11941
|
+
resampling?.status ?? "pass",
|
|
11942
|
+
options.transport?.status ?? "pass"
|
|
11853
11943
|
]);
|
|
11854
11944
|
return {
|
|
11855
11945
|
calibration,
|
|
@@ -11860,6 +11950,7 @@ var buildVoiceMediaPipelineReport = (options = {}) => {
|
|
|
11860
11950
|
resampling,
|
|
11861
11951
|
status,
|
|
11862
11952
|
surface: options.surface ?? "voice-media-pipeline",
|
|
11953
|
+
transport: options.transport,
|
|
11863
11954
|
vad
|
|
11864
11955
|
};
|
|
11865
11956
|
};
|
|
@@ -11892,6 +11983,18 @@ var evaluateVoiceMediaPipelineEvidence = (report, input = {}) => {
|
|
|
11892
11983
|
if (input.requireResamplingReady && report.calibration.resamplingRequired && !report.resampling) {
|
|
11893
11984
|
issues.push("Expected resampling plan when calibration requires resampling.");
|
|
11894
11985
|
}
|
|
11986
|
+
if (input.requireTransportConnected && !report.transport?.connected) {
|
|
11987
|
+
issues.push("Expected connected media transport evidence.");
|
|
11988
|
+
}
|
|
11989
|
+
if (input.minTransportInputFrames !== undefined && (report.transport?.inputFrames ?? 0) < input.minTransportInputFrames) {
|
|
11990
|
+
issues.push(`Expected at least ${String(input.minTransportInputFrames)} transport input frame(s), found ${String(report.transport?.inputFrames ?? 0)}.`);
|
|
11991
|
+
}
|
|
11992
|
+
if (input.minTransportOutputFrames !== undefined && (report.transport?.outputFrames ?? 0) < input.minTransportOutputFrames) {
|
|
11993
|
+
issues.push(`Expected at least ${String(input.minTransportOutputFrames)} transport output frame(s), found ${String(report.transport?.outputFrames ?? 0)}.`);
|
|
11994
|
+
}
|
|
11995
|
+
if (input.maxTransportBackpressureEvents !== undefined && (report.transport?.backpressureEvents ?? 0) > input.maxTransportBackpressureEvents) {
|
|
11996
|
+
issues.push(`Expected at most ${String(input.maxTransportBackpressureEvents)} transport backpressure event(s), found ${String(report.transport?.backpressureEvents ?? 0)}.`);
|
|
11997
|
+
}
|
|
11895
11998
|
return {
|
|
11896
11999
|
issues,
|
|
11897
12000
|
ok: issues.length === 0,
|
|
@@ -11919,6 +12022,10 @@ var renderVoiceMediaPipelineMarkdown = (report) => [
|
|
|
11919
12022
|
`- Resampling required: ${report.calibration.resamplingRequired ? "yes" : "no"}`,
|
|
11920
12023
|
`- VAD segments: ${String(report.vad.segments.length)}`,
|
|
11921
12024
|
`- Interruption frames: ${String(report.interruption.interruptionFrames)}`,
|
|
12025
|
+
`- Transport: ${report.transport ? `${report.transport.name} (${report.transport.state})` : "n/a"}`,
|
|
12026
|
+
`- Transport input frames: ${String(report.transport?.inputFrames ?? 0)}`,
|
|
12027
|
+
`- Transport output frames: ${String(report.transport?.outputFrames ?? 0)}`,
|
|
12028
|
+
`- Transport backpressure events: ${String(report.transport?.backpressureEvents ?? 0)}`,
|
|
11922
12029
|
"",
|
|
11923
12030
|
"## Issues",
|
|
11924
12031
|
"",
|
|
@@ -11932,7 +12039,7 @@ var renderVoiceMediaPipelineMarkdown = (report) => [
|
|
|
11932
12039
|
var renderVoiceMediaPipelineHTML = (report, title = "Voice Media Pipeline Proof") => {
|
|
11933
12040
|
const issues = [...report.calibration.issues, ...report.interruption.issues].map((issue) => `<li class="${escapeHtml15(issue.severity)}"><strong>${escapeHtml15(issue.code)}</strong>: ${escapeHtml15(issue.message)}</li>`).join("");
|
|
11934
12041
|
const segments = report.vad.segments.map((segment) => `<tr><td>${escapeHtml15(segment.segmentId)}</td><td>${escapeHtml15(segment.frameCount)}</td><td>${escapeHtml15(segment.durationMs ?? "n/a")}</td><td>${escapeHtml15(segment.turnId ?? "n/a")}</td></tr>`).join("");
|
|
11935
|
-
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>${escapeHtml15(title)}</title><style>body{background:#101418;color:#f7f3e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1100px;padding:32px}.hero,.card{background:#17201d;border:1px solid #2e3d36;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(20,184,166,.18),rgba(245,158,11,.12))}.eyebrow{color:#5eead4;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.3rem,6vw,4.8rem);letter-spacing:-.06em;line-height:.9;margin:.2rem 0 1rem}.summary{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.metric{background:#101814;border:1px solid #2e3d36;border-radius:18px;padding:14px}.metric span{color:#a8b5ad;display:block;font-size:.78rem;text-transform:uppercase}.metric strong{display:block;font-size:1.65rem;margin-top:5px}.status{border:1px solid #64748b;border-radius:999px;display:inline-flex;font-weight:900;padding:7px 11px}.pass{color:#86efac}.warn,.warning{color:#fde68a}.fail,.error{color:#fecaca}table{border-collapse:collapse;width:100%}td,th{border-bottom:1px solid #2e3d36;padding:10px;text-align:left}</style></head><body><main><section class="hero"><p class="eyebrow">Native media pipeline</p><h1>${escapeHtml15(title)}</h1><p class="status ${escapeHtml15(report.status)}">${escapeHtml15(report.status)}</p><p>${escapeHtml15(report.surface)}</p><section class="summary"><div class="metric"><span>Frames</span><strong>${String(report.frames)}</strong></div><div class="metric"><span>Input audio</span><strong>${String(report.calibration.inputAudioFrames)}</strong></div><div class="metric"><span>Assistant audio</span><strong>${String(report.calibration.assistantAudioFrames)}</strong></div><div class="metric"><span>Trace linked</span><strong>${String(report.calibration.traceLinkedFrames)}</strong></div><div class="metric"><span>First audio</span><strong>${escapeHtml15(report.calibration.firstAudioLatencyMs ?? "n/a")}ms</strong></div><div class="metric"><span>VAD segments</span><strong>${String(report.vad.segments.length)}</strong></div><div class="metric"><span>Interruptions</span><strong>${String(report.interruption.interruptionFrames)}</strong></div><div class="metric"><span>Resampling</span><strong>${report.calibration.resamplingRequired ? "required" : "not required"}</strong></div></section></section><section class="card"><h2>Issues</h2><ul>${issues || '<li class="pass">No media pipeline issues.</li>'}</ul></section><section class="card"><h2>VAD Segments</h2><table><thead><tr><th>Segment</th><th>Frames</th><th>Duration ms</th><th>Turn</th></tr></thead><tbody>${segments || '<tr><td colspan="4">No VAD segments.</td></tr>'}</tbody></table></section></main></body></html>`;
|
|
12042
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>${escapeHtml15(title)}</title><style>body{background:#101418;color:#f7f3e8;font-family:ui-sans-serif,system-ui,sans-serif;margin:0}main{margin:auto;max-width:1100px;padding:32px}.hero,.card{background:#17201d;border:1px solid #2e3d36;border-radius:24px;margin-bottom:16px;padding:22px}.hero{background:linear-gradient(135deg,rgba(20,184,166,.18),rgba(245,158,11,.12))}.eyebrow{color:#5eead4;font-weight:900;letter-spacing:.1em;text-transform:uppercase}h1{font-size:clamp(2.3rem,6vw,4.8rem);letter-spacing:-.06em;line-height:.9;margin:.2rem 0 1rem}.summary{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.metric{background:#101814;border:1px solid #2e3d36;border-radius:18px;padding:14px}.metric span{color:#a8b5ad;display:block;font-size:.78rem;text-transform:uppercase}.metric strong{display:block;font-size:1.65rem;margin-top:5px}.status{border:1px solid #64748b;border-radius:999px;display:inline-flex;font-weight:900;padding:7px 11px}.pass{color:#86efac}.warn,.warning{color:#fde68a}.fail,.error{color:#fecaca}table{border-collapse:collapse;width:100%}td,th{border-bottom:1px solid #2e3d36;padding:10px;text-align:left}</style></head><body><main><section class="hero"><p class="eyebrow">Native media pipeline</p><h1>${escapeHtml15(title)}</h1><p class="status ${escapeHtml15(report.status)}">${escapeHtml15(report.status)}</p><p>${escapeHtml15(report.surface)}</p><section class="summary"><div class="metric"><span>Frames</span><strong>${String(report.frames)}</strong></div><div class="metric"><span>Input audio</span><strong>${String(report.calibration.inputAudioFrames)}</strong></div><div class="metric"><span>Assistant audio</span><strong>${String(report.calibration.assistantAudioFrames)}</strong></div><div class="metric"><span>Trace linked</span><strong>${String(report.calibration.traceLinkedFrames)}</strong></div><div class="metric"><span>First audio</span><strong>${escapeHtml15(report.calibration.firstAudioLatencyMs ?? "n/a")}ms</strong></div><div class="metric"><span>VAD segments</span><strong>${String(report.vad.segments.length)}</strong></div><div class="metric"><span>Interruptions</span><strong>${String(report.interruption.interruptionFrames)}</strong></div><div class="metric"><span>Resampling</span><strong>${report.calibration.resamplingRequired ? "required" : "not required"}</strong></div><div class="metric"><span>Transport</span><strong>${escapeHtml15(report.transport?.state ?? "n/a")}</strong></div><div class="metric"><span>Transport in/out</span><strong>${String(report.transport?.inputFrames ?? 0)}/${String(report.transport?.outputFrames ?? 0)}</strong></div><div class="metric"><span>Backpressure</span><strong>${String(report.transport?.backpressureEvents ?? 0)}</strong></div></section></section><section class="card"><h2>Issues</h2><ul>${issues || '<li class="pass">No media pipeline issues.</li>'}</ul></section><section class="card"><h2>VAD Segments</h2><table><thead><tr><th>Segment</th><th>Frames</th><th>Duration ms</th><th>Turn</th></tr></thead><tbody>${segments || '<tr><td colspan="4">No VAD segments.</td></tr>'}</tbody></table></section></main></body></html>`;
|
|
11936
12043
|
};
|
|
11937
12044
|
var createVoiceMediaPipelineRoutes = (options = {}) => {
|
|
11938
12045
|
const path = options.path ?? "/api/voice/media-pipeline";
|
|
@@ -34763,6 +34870,7 @@ export {
|
|
|
34763
34870
|
createVoiceMemoryAuditSinkDeliveryStore,
|
|
34764
34871
|
createVoiceMemoryAuditEventStore,
|
|
34765
34872
|
createVoiceMemoryAssistantMemoryStore,
|
|
34873
|
+
createVoiceMediaTransport,
|
|
34766
34874
|
createVoiceMediaPipelineRoutes,
|
|
34767
34875
|
createVoiceMediaFrameTransformPipeline,
|
|
34768
34876
|
createVoiceMediaFrame,
|
|
@@ -34915,6 +35023,7 @@ export {
|
|
|
34915
35023
|
buildVoiceObservabilityArtifactIndex,
|
|
34916
35024
|
buildVoiceMonitorRunReport,
|
|
34917
35025
|
buildVoiceMediaVadReport,
|
|
35026
|
+
buildVoiceMediaTransportReport,
|
|
34918
35027
|
buildVoiceMediaResamplingPlan,
|
|
34919
35028
|
buildVoiceMediaPipelineReport,
|
|
34920
35029
|
buildVoiceMediaPipelineCalibrationReport,
|
package/dist/mediaPipeline.d.ts
CHANGED
|
@@ -43,6 +43,44 @@ export type VoiceMediaTransportAdapter = {
|
|
|
43
43
|
outputFormat?: AudioFormat;
|
|
44
44
|
send: (frame: VoiceMediaFrame) => Promise<void> | void;
|
|
45
45
|
};
|
|
46
|
+
export type VoiceMediaTransportState = 'closed' | 'closing' | 'failed' | 'idle' | 'open';
|
|
47
|
+
export type VoiceMediaTransportEventKind = 'backpressure' | 'close' | 'connect' | 'error' | 'frame-in' | 'frame-out';
|
|
48
|
+
export type VoiceMediaTransportEvent = {
|
|
49
|
+
at: number;
|
|
50
|
+
bufferedFrames?: number;
|
|
51
|
+
error?: string;
|
|
52
|
+
frameId?: string;
|
|
53
|
+
kind: VoiceMediaTransportEventKind;
|
|
54
|
+
state: VoiceMediaTransportState;
|
|
55
|
+
};
|
|
56
|
+
export type VoiceMediaTransportReport = {
|
|
57
|
+
backpressureEvents: number;
|
|
58
|
+
checkedAt: number;
|
|
59
|
+
closed: boolean;
|
|
60
|
+
connected: boolean;
|
|
61
|
+
events: readonly VoiceMediaTransportEvent[];
|
|
62
|
+
failed: boolean;
|
|
63
|
+
inputFrames: number;
|
|
64
|
+
name: string;
|
|
65
|
+
outputFrames: number;
|
|
66
|
+
state: VoiceMediaTransportState;
|
|
67
|
+
status: VoiceMediaPipelineStatus;
|
|
68
|
+
};
|
|
69
|
+
export type VoiceMediaTransport = VoiceMediaTransportAdapter & {
|
|
70
|
+
events: () => readonly VoiceMediaTransportEvent[];
|
|
71
|
+
receive: (frame: VoiceMediaFrame) => Promise<void>;
|
|
72
|
+
report: () => VoiceMediaTransportReport;
|
|
73
|
+
state: () => VoiceMediaTransportState;
|
|
74
|
+
};
|
|
75
|
+
export type VoiceMediaTransportOptions = {
|
|
76
|
+
inputFormat?: AudioFormat;
|
|
77
|
+
maxBufferedFrames?: number;
|
|
78
|
+
name: string;
|
|
79
|
+
onClose?: () => Promise<void> | void;
|
|
80
|
+
onConnect?: () => Promise<void> | void;
|
|
81
|
+
onSend?: (frame: VoiceMediaFrame) => Promise<void> | void;
|
|
82
|
+
outputFormat?: AudioFormat;
|
|
83
|
+
};
|
|
46
84
|
export type VoiceMediaPipelineCalibrationInput = {
|
|
47
85
|
expectedInputFormat?: AudioFormat;
|
|
48
86
|
expectedOutputFormat?: AudioFormat;
|
|
@@ -113,6 +151,12 @@ export type VoiceMediaInterruptionReport = {
|
|
|
113
151
|
status: VoiceMediaPipelineStatus;
|
|
114
152
|
};
|
|
115
153
|
export declare const createVoiceMediaFrame: (frame: VoiceMediaFrame) => VoiceMediaFrame;
|
|
154
|
+
export declare const buildVoiceMediaTransportReport: (input: {
|
|
155
|
+
events?: readonly VoiceMediaTransportEvent[];
|
|
156
|
+
name: string;
|
|
157
|
+
state?: VoiceMediaTransportState;
|
|
158
|
+
}) => VoiceMediaTransportReport;
|
|
159
|
+
export declare const createVoiceMediaTransport: (options: VoiceMediaTransportOptions) => VoiceMediaTransport;
|
|
116
160
|
export declare const buildVoiceMediaResamplingPlan: (input: {
|
|
117
161
|
inputFormat: AudioFormat;
|
|
118
162
|
outputFormat: AudioFormat;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { type VoiceMediaFrame, type VoiceMediaInterruptionReport, type VoiceMediaPipelineCalibrationInput, type VoiceMediaPipelineCalibrationReport, type VoiceMediaPipelineStatus, type VoiceMediaResamplingPlan, type VoiceMediaVadReport } from './mediaPipeline';
|
|
2
|
+
import { type VoiceMediaFrame, type VoiceMediaInterruptionReport, type VoiceMediaPipelineCalibrationInput, type VoiceMediaPipelineCalibrationReport, type VoiceMediaPipelineStatus, type VoiceMediaResamplingPlan, type VoiceMediaTransportReport, type VoiceMediaVadReport } from './mediaPipeline';
|
|
3
3
|
export type VoiceMediaPipelineReportOptions = VoiceMediaPipelineCalibrationInput & {
|
|
4
4
|
frames?: readonly VoiceMediaFrame[];
|
|
5
5
|
maxInterruptionLatencyMs?: number;
|
|
@@ -7,6 +7,7 @@ export type VoiceMediaPipelineReportOptions = VoiceMediaPipelineCalibrationInput
|
|
|
7
7
|
minSpeechFrames?: number;
|
|
8
8
|
speechEndThreshold?: number;
|
|
9
9
|
speechStartThreshold?: number;
|
|
10
|
+
transport?: VoiceMediaTransportReport;
|
|
10
11
|
};
|
|
11
12
|
export type VoiceMediaPipelineReport = {
|
|
12
13
|
calibration: VoiceMediaPipelineCalibrationReport;
|
|
@@ -17,6 +18,7 @@ export type VoiceMediaPipelineReport = {
|
|
|
17
18
|
resampling?: VoiceMediaResamplingPlan;
|
|
18
19
|
status: VoiceMediaPipelineStatus;
|
|
19
20
|
surface: string;
|
|
21
|
+
transport?: VoiceMediaTransportReport;
|
|
20
22
|
vad: VoiceMediaVadReport;
|
|
21
23
|
};
|
|
22
24
|
export type VoiceMediaPipelineAssertionInput = {
|
|
@@ -24,11 +26,15 @@ export type VoiceMediaPipelineAssertionInput = {
|
|
|
24
26
|
maxInterruptionLatencyMs?: number;
|
|
25
27
|
minAssistantAudioFrames?: number;
|
|
26
28
|
minInputAudioFrames?: number;
|
|
29
|
+
minTransportInputFrames?: number;
|
|
30
|
+
minTransportOutputFrames?: number;
|
|
27
31
|
minTraceLinkedFrames?: number;
|
|
28
32
|
minVadSegments?: number;
|
|
33
|
+
maxTransportBackpressureEvents?: number;
|
|
29
34
|
requireInterruptionFrame?: boolean;
|
|
30
35
|
requirePass?: boolean;
|
|
31
36
|
requireResamplingReady?: boolean;
|
|
37
|
+
requireTransportConnected?: boolean;
|
|
32
38
|
};
|
|
33
39
|
export type VoiceMediaPipelineAssertionReport = {
|
|
34
40
|
issues: string[];
|