@absolutejs/voice 0.0.20 → 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 (57) hide show
  1. package/README.md +884 -4
  2. package/dist/angular/index.d.ts +1 -0
  3. package/dist/angular/index.js +759 -3
  4. package/dist/angular/voice-controller.service.d.ts +27 -0
  5. package/dist/angular/voice-stream.service.d.ts +6 -0
  6. package/dist/audioConditioning.d.ts +3 -0
  7. package/dist/client/actions.d.ts +48 -0
  8. package/dist/client/audioPlayer.d.ts +40 -0
  9. package/dist/client/connection.d.ts +5 -0
  10. package/dist/client/controller.d.ts +2 -0
  11. package/dist/client/duplex.d.ts +3 -0
  12. package/dist/client/htmxBootstrap.js +660 -167
  13. package/dist/client/index.d.ts +3 -0
  14. package/dist/client/index.js +991 -6
  15. package/dist/client/microphone.d.ts +4 -2
  16. package/dist/correction.d.ts +33 -0
  17. package/dist/fileStore.d.ts +27 -0
  18. package/dist/index.d.ts +15 -0
  19. package/dist/index.js +3721 -298
  20. package/dist/ops.d.ts +100 -0
  21. package/dist/presets.d.ts +13 -0
  22. package/dist/react/index.d.ts +1 -0
  23. package/dist/react/index.js +728 -3
  24. package/dist/react/useVoiceController.d.ts +26 -0
  25. package/dist/react/useVoiceStream.d.ts +7 -0
  26. package/dist/routing.d.ts +3 -0
  27. package/dist/runtimeOps.d.ts +23 -0
  28. package/dist/store.d.ts +2 -2
  29. package/dist/svelte/index.d.ts +1 -0
  30. package/dist/svelte/index.js +691 -3
  31. package/dist/telephony/response.d.ts +7 -0
  32. package/dist/telephony/twilio.d.ts +116 -0
  33. package/dist/testing/benchmark.d.ts +93 -2
  34. package/dist/testing/corrected.d.ts +41 -0
  35. package/dist/testing/duplex.d.ts +59 -0
  36. package/dist/testing/fixtures.d.ts +18 -2
  37. package/dist/testing/index.d.ts +5 -0
  38. package/dist/testing/index.js +6247 -402
  39. package/dist/testing/review.d.ts +143 -0
  40. package/dist/testing/sessionBenchmark.d.ts +92 -2
  41. package/dist/testing/stt.d.ts +3 -1
  42. package/dist/testing/telephony.d.ts +70 -0
  43. package/dist/testing/tts.d.ts +73 -0
  44. package/dist/turnDetection.d.ts +5 -1
  45. package/dist/turnProfiles.d.ts +6 -0
  46. package/dist/types.d.ts +487 -10
  47. package/dist/vue/index.d.ts +1 -0
  48. package/dist/vue/index.js +750 -3
  49. package/dist/vue/useVoiceController.d.ts +30 -0
  50. package/dist/vue/useVoiceStream.d.ts +11 -0
  51. package/fixtures/README.md +9 -0
  52. package/fixtures/manifest.json +59 -1
  53. package/fixtures/pcm/dialogue-three-clean.pcm +0 -0
  54. package/fixtures/pcm/dialogue-three-mixed.pcm +0 -0
  55. package/fixtures/pcm/dialogue-two-clean.pcm +0 -0
  56. package/fixtures/pcm/dialogue-two-noisy.pcm +0 -0
  57. package/package.json +135 -1
@@ -0,0 +1,26 @@
1
+ import type { VoiceControllerOptions } from '../types';
2
+ export declare const useVoiceController: <TResult = unknown>(path: string, options?: VoiceControllerOptions) => {
3
+ bindHTMX: (options: import("..").VoiceHTMXBindingOptions) => () => void;
4
+ close: () => void;
5
+ endTurn: () => void;
6
+ sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
7
+ startRecording: () => Promise<void>;
8
+ stopRecording: () => void;
9
+ toggleRecording: () => Promise<void>;
10
+ sessionId: string | null;
11
+ scenarioId: string | null;
12
+ status: import("..").VoiceSessionStatus | "idle";
13
+ partial: string;
14
+ turns: import("..").VoiceTurnRecord<TResult>[];
15
+ assistantTexts: string[];
16
+ assistantAudio: Array<{
17
+ chunk: Uint8Array;
18
+ format: import("..").AudioFormat;
19
+ receivedAt: number;
20
+ turnId?: string;
21
+ }>;
22
+ error: string | null;
23
+ isConnected: boolean;
24
+ isRecording: boolean;
25
+ recordingError: string | null;
26
+ };
@@ -4,10 +4,17 @@ export declare const useVoiceStream: <TResult = unknown>(path: string, options?:
4
4
  endTurn: () => void;
5
5
  sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
6
6
  sessionId: string | null;
7
+ scenarioId: string | null;
7
8
  status: import("..").VoiceSessionStatus | "idle";
8
9
  partial: string;
9
10
  turns: import("..").VoiceTurnRecord<TResult>[];
10
11
  assistantTexts: string[];
12
+ assistantAudio: Array<{
13
+ chunk: Uint8Array;
14
+ format: import("..").AudioFormat;
15
+ receivedAt: number;
16
+ turnId?: string;
17
+ }>;
11
18
  error: string | null;
12
19
  isConnected: boolean;
13
20
  };
@@ -0,0 +1,3 @@
1
+ import type { VoiceSTTRoutingCorrectionMode, VoiceSTTRoutingGoal, VoiceSTTRoutingStrategy, VoiceTurnCorrectionHandler } from './types';
2
+ export declare const resolveVoiceSTTRoutingStrategy: (goal?: VoiceSTTRoutingGoal) => VoiceSTTRoutingStrategy;
3
+ export declare const createVoiceSTTRoutingCorrectionHandler: (mode?: VoiceSTTRoutingCorrectionMode) => VoiceTurnCorrectionHandler | undefined;
@@ -0,0 +1,23 @@
1
+ import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact } from './testing/review';
2
+ import type { VoiceOpsTask } from './ops';
3
+ import type { VoiceCallDisposition, VoiceRuntimeOpsConfig, VoiceSessionHandle, VoiceSessionRecord } from './types';
4
+ export declare const createVoiceCallReviewFromSession: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(input: {
5
+ disposition: VoiceCallDisposition;
6
+ generatedAt?: number;
7
+ reason?: string;
8
+ session: TSession;
9
+ target?: string;
10
+ }) => VoiceCallReviewArtifact;
11
+ export declare const recordVoiceRuntimeOps: <TContext, TSession extends VoiceSessionRecord, TResult>(input: {
12
+ api: VoiceSessionHandle<TContext, TSession, TResult>;
13
+ config?: VoiceRuntimeOpsConfig<TContext, TSession, TResult>;
14
+ context: TContext;
15
+ disposition: VoiceCallDisposition;
16
+ metadata?: Record<string, unknown>;
17
+ reason?: string;
18
+ session: TSession;
19
+ target?: string;
20
+ }) => Promise<{
21
+ review: StoredVoiceCallReviewArtifact | undefined;
22
+ task: VoiceOpsTask | undefined;
23
+ } | undefined>;
package/dist/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Transcript, VoiceSessionRecord, VoiceSessionSummary } from './types';
2
2
  export declare const createId: () => `${string}-${string}-${string}-${string}-${string}`;
3
3
  export declare const createTranscript: (text: string, input?: Partial<Transcript>) => Transcript;
4
- export declare const createVoiceSessionRecord: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(id: string) => TSession;
5
- export declare const resetVoiceSessionRecord: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(id: string, existing?: TSession) => TSession;
4
+ export declare const createVoiceSessionRecord: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(id: string, scenarioId?: string) => TSession;
5
+ export declare const resetVoiceSessionRecord: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(id: string, existing?: TSession, scenarioId?: string) => TSession;
6
6
  export declare const toVoiceSessionSummary: (session: VoiceSessionRecord) => VoiceSessionSummary;
@@ -1 +1,2 @@
1
1
  export { createVoiceStream } from './createVoiceStream';
2
+ export { createVoiceController } from '../client/controller';