@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
@@ -1,7 +1,9 @@
1
+ import type { VoiceCaptureOptions } from '../types';
1
2
  type MicrophoneCaptureOptions = {
2
- channelCount?: 1 | 2;
3
+ channelCount?: VoiceCaptureOptions['channelCount'];
4
+ onLevel?: VoiceCaptureOptions['onLevel'];
3
5
  onAudio: (audio: Uint8Array) => void;
4
- sampleRateHz?: number;
6
+ sampleRateHz?: VoiceCaptureOptions['sampleRateHz'];
5
7
  };
6
8
  type MicrophoneCapture = {
7
9
  start: () => Promise<void>;
@@ -0,0 +1,33 @@
1
+ import type { VoiceCorrectionRiskTier, VoiceDomainTerm, VoiceLexiconEntry, VoicePhraseHint, VoiceTurnCorrectionHandler } from './types';
2
+ export type VoicePhraseHintCorrectionMatch = {
3
+ alias: string;
4
+ hint: VoicePhraseHint;
5
+ };
6
+ export type VoicePhraseHintCorrectionResult = {
7
+ changed: boolean;
8
+ matches: VoicePhraseHintCorrectionMatch[];
9
+ text: string;
10
+ };
11
+ export type VoicePhraseHintCorrectionOptions = {
12
+ provider?: string;
13
+ reason?: string;
14
+ };
15
+ export type VoiceLexiconCorrectionOptions = VoicePhraseHintCorrectionOptions;
16
+ export type VoiceDomainHintGenerationOptions = {
17
+ riskTier?: VoiceCorrectionRiskTier;
18
+ };
19
+ export type VoiceRiskyTurnCorrectionHandlerOptions = VoicePhraseHintCorrectionOptions & {
20
+ maxAverageConfidence?: number;
21
+ riskTier?: Exclude<VoiceCorrectionRiskTier, 'safe'>;
22
+ };
23
+ export type VoicePhraseHintCorrectionRunOptions = {
24
+ riskTier?: VoiceCorrectionRiskTier;
25
+ };
26
+ export declare const applyPhraseHintCorrections: (text: string, phraseHints: VoicePhraseHint[]) => VoicePhraseHintCorrectionResult;
27
+ export declare const applyRiskTieredPhraseHintCorrections: (text: string, phraseHints: VoicePhraseHint[], options?: VoicePhraseHintCorrectionRunOptions) => VoicePhraseHintCorrectionResult;
28
+ export declare const createDomainPhraseHints: (terms: VoiceDomainTerm[], options?: VoiceDomainHintGenerationOptions) => VoicePhraseHint[];
29
+ export declare const createDomainLexicon: (terms: VoiceDomainTerm[]) => VoiceLexiconEntry[];
30
+ export declare const createPhraseHintCorrectionHandler: (options?: VoicePhraseHintCorrectionOptions) => VoiceTurnCorrectionHandler;
31
+ export declare const applyLexiconCorrections: (text: string, lexicon: VoiceLexiconEntry[]) => VoicePhraseHintCorrectionResult;
32
+ export declare const createLexiconCorrectionHandler: (options?: VoiceLexiconCorrectionOptions) => VoiceTurnCorrectionHandler;
33
+ export declare const createRiskyTurnCorrectionHandler: (options?: VoiceRiskyTurnCorrectionHandlerOptions) => VoiceTurnCorrectionHandler;
@@ -0,0 +1,27 @@
1
+ import type { StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEvent, VoiceIntegrationEventStore, VoiceOpsTask, VoiceOpsTaskStore } from './ops';
2
+ import type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
3
+ import type { VoiceSessionRecord, VoiceSessionStore } from './types';
4
+ export type VoiceFileStoreOptions = {
5
+ directory: string;
6
+ pretty?: boolean;
7
+ };
8
+ export type VoiceFileRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent> = {
9
+ events: VoiceIntegrationEventStore<TEvent>;
10
+ reviews: VoiceCallReviewStore<TReview>;
11
+ session: VoiceSessionStore<TSession>;
12
+ tasks: VoiceOpsTaskStore<TTask>;
13
+ };
14
+ export declare const createVoiceFileSessionStore: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceFileStoreOptions) => VoiceSessionStore<TSession>;
15
+ export declare const createVoiceFileReviewStore: <TArtifact extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact>(options: VoiceFileStoreOptions) => VoiceCallReviewStore<TArtifact>;
16
+ export declare const createVoiceFileTaskStore: <TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask>(options: VoiceFileStoreOptions) => VoiceOpsTaskStore<TTask>;
17
+ export declare const createVoiceFileIntegrationEventStore: <TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent>(options: VoiceFileStoreOptions) => VoiceIntegrationEventStore<TEvent>;
18
+ export declare const createVoiceFileRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent>(options: VoiceFileStoreOptions) => VoiceFileRuntimeStorage<TSession, TReview, TTask, TEvent>;
19
+ export declare const createStoredVoiceCallReviewArtifact: <TArtifact extends VoiceCallReviewArtifact = VoiceCallReviewArtifact>(id: string, artifact: TArtifact) => TArtifact & {
20
+ id: string;
21
+ };
22
+ export declare const createStoredVoiceOpsTask: <TTask extends Omit<VoiceOpsTask, "id"> = Omit<VoiceOpsTask, "id">>(id: string, task: TTask) => TTask & {
23
+ id: string;
24
+ };
25
+ export declare const createStoredVoiceIntegrationEvent: <TEvent extends Omit<VoiceIntegrationEvent, "id"> = Omit<VoiceIntegrationEvent, "id">>(id: string, event: TEvent) => TEvent & {
26
+ id: string;
27
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,20 @@
1
1
  export { voice } from './plugin';
2
+ export { createStoredVoiceCallReviewArtifact, createStoredVoiceIntegrationEvent, createStoredVoiceOpsTask, createVoiceFileIntegrationEventStore, createVoiceFileReviewStore, createVoiceFileRuntimeStorage, createVoiceFileSessionStore, createVoiceFileTaskStore } from './fileStore';
2
3
  export { createVoiceMemoryStore } from './memoryStore';
4
+ export { assignVoiceOpsTask, buildVoiceOpsTaskFromReview, completeVoiceOpsTask, createVoiceCallCompletedEvent, createVoiceIntegrationEvent, createVoiceReviewSavedEvent, createVoiceTaskCreatedEvent, createVoiceTaskUpdatedEvent, listVoiceOpsTasks, reopenVoiceOpsTask, startVoiceOpsTask, summarizeVoiceOpsTasks, withVoiceIntegrationEventId, withVoiceOpsTaskId } from './ops';
3
5
  export { createVoiceSession } from './session';
6
+ export { createVoiceCallReviewFromSession, recordVoiceRuntimeOps } from './runtimeOps';
4
7
  export { createId, createVoiceSessionRecord } from './store';
8
+ export { createVoiceSTTRoutingCorrectionHandler, resolveVoiceSTTRoutingStrategy } from './routing';
9
+ export { applyRiskTieredPhraseHintCorrections, applyPhraseHintCorrections, createDomainLexicon, createDomainPhraseHints, createPhraseHintCorrectionHandler, createRiskyTurnCorrectionHandler } from './correction';
10
+ export { conditionAudioChunk, resolveAudioConditioningConfig } from './audioConditioning';
11
+ export { resolveVoiceRuntimePreset } from './presets';
12
+ export { resolveTurnDetectionConfig, TURN_PROFILE_DEFAULTS } from './turnProfiles';
13
+ export { createVoiceCallReviewFromLiveTelephonyReport, createVoiceCallReviewRecorder, renderVoiceCallReviewHTML, renderVoiceCallReviewMarkdown } from './testing/review';
14
+ export type { StoredVoiceCallReviewArtifact, VoiceCallReviewArtifact, VoiceCallReviewConfig, VoiceCallReviewPostCallSummary, VoiceCallReviewRecorder, VoiceCallReviewRecorderOptions, VoiceCallReviewStore, VoiceCallReviewSummary, VoiceCallReviewTimelineEvent } from './testing/review';
15
+ export type { VoiceFileRuntimeStorage, VoiceFileStoreOptions } from './fileStore';
16
+ export type { StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEvent, VoiceIntegrationEventStore, VoiceIntegrationEventType, VoiceOpsTask, VoiceOpsTaskHistoryEntry, VoiceOpsTaskKind, VoiceOpsTaskStatus, VoiceOpsTaskStore, VoiceOpsTaskSummary } from './ops';
17
+ export { createTwilioMediaStreamBridge, createTwilioVoiceResponse, decodeTwilioMulawBase64, encodeTwilioMulawBase64, transcodePCMToTwilioOutboundPayload, transcodeTwilioInboundPayloadToPCM16 } from './telephony/twilio';
18
+ export { shapeTelephonyAssistantText } from './telephony/response';
19
+ export type { TelephonyResponseShapeMode, TelephonyResponseShapeOptions } from './telephony/response';
5
20
  export * from './types';