@absolutejs/voice 0.0.21 → 0.0.22-beta.0

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 (39) hide show
  1. package/README.md +499 -2
  2. package/dist/angular/index.js +90 -0
  3. package/dist/angular/voice-controller.service.d.ts +6 -0
  4. package/dist/angular/voice-stream.service.d.ts +6 -0
  5. package/dist/client/actions.d.ts +41 -0
  6. package/dist/client/audioPlayer.d.ts +40 -0
  7. package/dist/client/duplex.d.ts +3 -0
  8. package/dist/client/htmxBootstrap.js +84 -0
  9. package/dist/client/index.d.ts +2 -0
  10. package/dist/client/index.js +507 -5
  11. package/dist/correction.d.ts +18 -1
  12. package/dist/fileStore.d.ts +27 -0
  13. package/dist/index.d.ts +12 -1
  14. package/dist/index.js +2425 -33
  15. package/dist/ops.d.ts +100 -0
  16. package/dist/react/index.js +86 -0
  17. package/dist/react/useVoiceController.d.ts +6 -0
  18. package/dist/react/useVoiceStream.d.ts +6 -0
  19. package/dist/routing.d.ts +3 -0
  20. package/dist/runtimeOps.d.ts +23 -0
  21. package/dist/svelte/index.js +84 -0
  22. package/dist/telephony/response.d.ts +7 -0
  23. package/dist/telephony/twilio.d.ts +116 -0
  24. package/dist/testing/benchmark.d.ts +59 -4
  25. package/dist/testing/corrected.d.ts +41 -0
  26. package/dist/testing/duplex.d.ts +59 -0
  27. package/dist/testing/fixtures.d.ts +18 -2
  28. package/dist/testing/index.d.ts +5 -0
  29. package/dist/testing/index.js +4940 -307
  30. package/dist/testing/review.d.ts +143 -0
  31. package/dist/testing/sessionBenchmark.d.ts +25 -0
  32. package/dist/testing/stt.d.ts +2 -1
  33. package/dist/testing/telephony.d.ts +70 -0
  34. package/dist/testing/tts.d.ts +73 -0
  35. package/dist/types.d.ts +290 -3
  36. package/dist/vue/index.js +90 -0
  37. package/dist/vue/useVoiceController.d.ts +11 -0
  38. package/dist/vue/useVoiceStream.d.ts +11 -0
  39. package/package.json +115 -1
@@ -0,0 +1,41 @@
1
+ import type { VoiceLexiconEntry, VoicePhraseHint, VoiceTurnCorrectionHandler } from '../types';
2
+ import { type VoiceExpectedTermAccuracy, type VoiceSTTBenchmarkReport } from './benchmark';
3
+ import type { VoiceSessionBenchmarkReport } from './sessionBenchmark';
4
+ import type { VoiceTestFixture } from './fixtures';
5
+ export type VoiceCorrectionHintProfile = 'generic' | 'benchmark-seeded';
6
+ type VoiceCorrectionAuditSlice<TReport> = {
7
+ fixtureIds: string[];
8
+ raw: TReport;
9
+ generic: TReport;
10
+ experimental: TReport;
11
+ benchmarkSeeded: TReport;
12
+ };
13
+ export type VoiceCorrectionBenchmarkAudit = {
14
+ raw: VoiceSTTBenchmarkReport;
15
+ generic: VoiceSTTBenchmarkReport;
16
+ experimental: VoiceSTTBenchmarkReport;
17
+ benchmarkSeeded: VoiceSTTBenchmarkReport;
18
+ holdout: VoiceCorrectionAuditSlice<VoiceSTTBenchmarkReport>;
19
+ lexicalHoldout: VoiceCorrectionAuditSlice<VoiceSTTBenchmarkReport>;
20
+ };
21
+ export type VoiceSessionCorrectionAudit = {
22
+ raw: VoiceSessionBenchmarkReport;
23
+ generic: VoiceSessionBenchmarkReport;
24
+ experimental: VoiceSessionBenchmarkReport;
25
+ benchmarkSeeded: VoiceSessionBenchmarkReport;
26
+ holdout: VoiceCorrectionAuditSlice<VoiceSessionBenchmarkReport>;
27
+ lexicalHoldout: VoiceCorrectionAuditSlice<VoiceSessionBenchmarkReport>;
28
+ };
29
+ export declare const isCorrectionHoldoutFixtureId: (fixtureId: string) => boolean;
30
+ export declare const buildFixturePhraseHints: (fixture: Pick<VoiceTestFixture, "expectedTerms" | "expectedText">, profile?: VoiceCorrectionHintProfile) => VoicePhraseHint[];
31
+ export declare const buildCodeSwitchBenchmarkLexicon: (fixture: Pick<VoiceTestFixture, "expectedTerms" | "expectedText" | "language" | "tags">) => VoiceLexiconEntry[];
32
+ export declare const buildCodeSwitchBenchmarkPhraseHints: (fixture: Pick<VoiceTestFixture, "expectedTerms" | "expectedText" | "language" | "tags">) => VoicePhraseHint[];
33
+ export declare const createCodeSwitchBenchmarkCorrectionHandler: () => VoiceTurnCorrectionHandler;
34
+ export declare const createBenchmarkCorrectionHandler: (profile: VoiceCorrectionHintProfile) => VoiceTurnCorrectionHandler;
35
+ export declare const scoreCorrectedExpectedTerms: (actualText: string, expectedTerms: string[] | undefined) => VoiceExpectedTermAccuracy;
36
+ export declare const applyCorrectedBenchmarkReport: (report: VoiceSTTBenchmarkReport, fixtures: VoiceTestFixture[], profile?: VoiceCorrectionHintProfile) => VoiceSTTBenchmarkReport;
37
+ export declare const applyExperimentalBenchmarkReport: (report: VoiceSTTBenchmarkReport, fixtures: VoiceTestFixture[]) => VoiceSTTBenchmarkReport;
38
+ export declare const applyLexiconCorrectedBenchmarkReport: (report: VoiceSTTBenchmarkReport, fixtures: VoiceTestFixture[], buildLexicon: (fixture: Pick<VoiceTestFixture, "expectedTerms" | "expectedText" | "language" | "tags">) => VoiceLexiconEntry[]) => VoiceSTTBenchmarkReport;
39
+ export declare const buildCorrectionBenchmarkAudit: (rawReport: VoiceSTTBenchmarkReport, fixtures: VoiceTestFixture[]) => VoiceCorrectionBenchmarkAudit;
40
+ export declare const buildSessionCorrectionAudit: (raw: VoiceSessionBenchmarkReport, generic: VoiceSessionBenchmarkReport, experimental: VoiceSessionBenchmarkReport, benchmarkSeeded: VoiceSessionBenchmarkReport, scenarios: Array<Pick<VoiceTestFixture, "expectedTerms" | "expectedText" | "expectedTurnTexts" | "id">>) => VoiceSessionCorrectionAudit;
41
+ export {};
@@ -0,0 +1,59 @@
1
+ import type { VoiceBargeInOptions } from '../types';
2
+ export type VoiceDuplexBenchmarkScenario = {
3
+ expectedInterruptCount: number;
4
+ id: string;
5
+ initialPartial?: string;
6
+ interruptDelayMs?: number;
7
+ level?: number;
8
+ mode: 'audio-send' | 'input-level' | 'partial';
9
+ partial?: string;
10
+ title: string;
11
+ };
12
+ export type VoiceDuplexBenchmarkScenarioResult = {
13
+ actualInterruptCount: number;
14
+ elapsedMs: number;
15
+ expectedInterruptCount: number;
16
+ fixtureId: string;
17
+ interruptLatencyMs?: number;
18
+ mode: VoiceDuplexBenchmarkScenario['mode'];
19
+ passes: boolean;
20
+ title: string;
21
+ };
22
+ export type VoiceDuplexBenchmarkSummary = {
23
+ averageElapsedMs: number;
24
+ averageInterruptLatencyMs?: number;
25
+ passCount: number;
26
+ passRate: number;
27
+ scenarioCount: number;
28
+ };
29
+ export type VoiceDuplexBenchmarkReport = {
30
+ fixtures: VoiceDuplexBenchmarkScenarioResult[];
31
+ generatedAt: number;
32
+ summary: VoiceDuplexBenchmarkSummary;
33
+ };
34
+ export type VoiceDuplexBenchmarkOptions = {
35
+ bargeIn?: VoiceBargeInOptions;
36
+ defaultInterruptDelayMs?: number;
37
+ };
38
+ export declare const getDefaultVoiceDuplexBenchmarkScenarios: () => {
39
+ expectedInterruptCount: number;
40
+ id: string;
41
+ initialPartial?: string;
42
+ interruptDelayMs?: number;
43
+ level?: number;
44
+ mode: "audio-send" | "input-level" | "partial";
45
+ partial?: string;
46
+ title: string;
47
+ }[];
48
+ export declare const runVoiceDuplexBenchmarkScenario: (scenario: VoiceDuplexBenchmarkScenario, options?: VoiceDuplexBenchmarkOptions) => Promise<VoiceDuplexBenchmarkScenarioResult>;
49
+ export declare const summarizeVoiceDuplexBenchmark: (fixtures: VoiceDuplexBenchmarkScenarioResult[]) => VoiceDuplexBenchmarkSummary;
50
+ export declare const runVoiceDuplexBenchmark: (scenarios?: {
51
+ expectedInterruptCount: number;
52
+ id: string;
53
+ initialPartial?: string;
54
+ interruptDelayMs?: number;
55
+ level?: number;
56
+ mode: "audio-send" | "input-level" | "partial";
57
+ partial?: string;
58
+ title: string;
59
+ }[], options?: VoiceDuplexBenchmarkOptions) => Promise<VoiceDuplexBenchmarkReport>;
@@ -1,10 +1,11 @@
1
- import type { AudioFormat } from '../types';
1
+ import type { AudioFormat, VoiceExpectedSpeakerTurn } from '../types';
2
2
  export type VoiceTestFixtureManifestEntry = {
3
3
  id: string;
4
4
  title: string;
5
5
  audioPath: string;
6
6
  expectedText: string;
7
7
  expectedTerms?: string[];
8
+ expectedSpeakerTurns?: VoiceExpectedSpeakerTurn[];
8
9
  expectedTurnTexts?: string[];
9
10
  chunkDurationMs?: number;
10
11
  language?: string;
@@ -18,5 +19,20 @@ export type VoiceTestFixture = Omit<VoiceTestFixtureManifestEntry, 'audioPath'>
18
19
  audioPath: string;
19
20
  format: AudioFormat;
20
21
  };
22
+ export type VoiceTelephonyFixtureOptions = {
23
+ includeAccents?: boolean;
24
+ targetSampleRateHz?: number;
25
+ };
26
+ export type VoiceMultiSpeakerFixtureOptions = {
27
+ silenceMs?: number;
28
+ };
29
+ export type VoiceFixtureLoadOptions = {
30
+ directories?: string[];
31
+ includeBundled?: boolean;
32
+ };
21
33
  export declare const getVoiceFixtureDirectory: () => Promise<string>;
22
- export declare const loadVoiceTestFixtures: (fixtureDirectory?: string) => Promise<VoiceTestFixture[]>;
34
+ export declare const resolveVoiceFixtureDirectories: (input?: string | string[] | VoiceFixtureLoadOptions) => Promise<string[]>;
35
+ export declare const createTelephonyVoiceTestFixtures: (fixtures: VoiceTestFixture[], options?: VoiceTelephonyFixtureOptions) => VoiceTestFixture[];
36
+ export declare const createMultiSpeakerVoiceTestFixtures: (fixtures: VoiceTestFixture[], options?: VoiceMultiSpeakerFixtureOptions) => VoiceTestFixture[];
37
+ export declare const createJargonVoiceTestFixtures: (fixtures: VoiceTestFixture[]) => VoiceTestFixture[];
38
+ export declare const loadVoiceTestFixtures: (fixtureDirectory?: string | string[] | VoiceFixtureLoadOptions) => Promise<VoiceTestFixture[]>;
@@ -1,6 +1,11 @@
1
1
  export * from './accuracy';
2
2
  export * from './benchmark';
3
+ export * from './corrected';
4
+ export * from './duplex';
3
5
  export * from './fixtures';
4
6
  export * from './resilience';
7
+ export * from './review';
5
8
  export * from './sessionBenchmark';
6
9
  export * from './stt';
10
+ export * from './telephony';
11
+ export * from './tts';