@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.
- package/README.md +884 -4
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +759 -3
- package/dist/angular/voice-controller.service.d.ts +27 -0
- package/dist/angular/voice-stream.service.d.ts +6 -0
- package/dist/audioConditioning.d.ts +3 -0
- package/dist/client/actions.d.ts +48 -0
- package/dist/client/audioPlayer.d.ts +40 -0
- package/dist/client/connection.d.ts +5 -0
- package/dist/client/controller.d.ts +2 -0
- package/dist/client/duplex.d.ts +3 -0
- package/dist/client/htmxBootstrap.js +660 -167
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +991 -6
- package/dist/client/microphone.d.ts +4 -2
- package/dist/correction.d.ts +33 -0
- package/dist/fileStore.d.ts +27 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +3721 -298
- package/dist/ops.d.ts +100 -0
- package/dist/presets.d.ts +13 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +728 -3
- package/dist/react/useVoiceController.d.ts +26 -0
- package/dist/react/useVoiceStream.d.ts +7 -0
- package/dist/routing.d.ts +3 -0
- package/dist/runtimeOps.d.ts +23 -0
- package/dist/store.d.ts +2 -2
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +691 -3
- package/dist/telephony/response.d.ts +7 -0
- package/dist/telephony/twilio.d.ts +116 -0
- package/dist/testing/benchmark.d.ts +93 -2
- package/dist/testing/corrected.d.ts +41 -0
- package/dist/testing/duplex.d.ts +59 -0
- package/dist/testing/fixtures.d.ts +18 -2
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.js +6247 -402
- package/dist/testing/review.d.ts +143 -0
- package/dist/testing/sessionBenchmark.d.ts +92 -2
- package/dist/testing/stt.d.ts +3 -1
- package/dist/testing/telephony.d.ts +70 -0
- package/dist/testing/tts.d.ts +73 -0
- package/dist/turnDetection.d.ts +5 -1
- package/dist/turnProfiles.d.ts +6 -0
- package/dist/types.d.ts +487 -10
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +750 -3
- package/dist/vue/useVoiceController.d.ts +30 -0
- package/dist/vue/useVoiceStream.d.ts +11 -0
- package/fixtures/README.md +9 -0
- package/fixtures/manifest.json +59 -1
- package/fixtures/pcm/dialogue-three-clean.pcm +0 -0
- package/fixtures/pcm/dialogue-three-mixed.pcm +0 -0
- package/fixtures/pcm/dialogue-two-clean.pcm +0 -0
- package/fixtures/pcm/dialogue-two-noisy.pcm +0 -0
- package/package.json +135 -1
package/dist/ops.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { VoiceCallDisposition, VoiceSessionRecord, VoiceSessionSummary } from './types';
|
|
2
|
+
import type { StoredVoiceCallReviewArtifact } from './testing/review';
|
|
3
|
+
export type VoiceOpsTaskStatus = 'open' | 'in-progress' | 'done';
|
|
4
|
+
export type VoiceOpsTaskKind = 'callback' | 'escalation' | 'transfer-check' | 'retry-review';
|
|
5
|
+
export type VoiceOpsTaskHistoryEntry = {
|
|
6
|
+
actor: string;
|
|
7
|
+
at: number;
|
|
8
|
+
detail?: string;
|
|
9
|
+
type: 'created' | 'assigned' | 'started' | 'completed' | 'reopened';
|
|
10
|
+
};
|
|
11
|
+
export type VoiceOpsTask = {
|
|
12
|
+
assignee?: string;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
description: string;
|
|
15
|
+
history: VoiceOpsTaskHistoryEntry[];
|
|
16
|
+
id: string;
|
|
17
|
+
intakeId?: string;
|
|
18
|
+
kind: VoiceOpsTaskKind;
|
|
19
|
+
outcome?: VoiceCallDisposition;
|
|
20
|
+
recommendedAction: string;
|
|
21
|
+
reviewId?: string;
|
|
22
|
+
status: VoiceOpsTaskStatus;
|
|
23
|
+
target?: string;
|
|
24
|
+
title: string;
|
|
25
|
+
updatedAt: number;
|
|
26
|
+
};
|
|
27
|
+
export type StoredVoiceOpsTask = VoiceOpsTask;
|
|
28
|
+
export type VoiceOpsTaskStore<TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask> = {
|
|
29
|
+
get: (id: string) => Promise<TTask | undefined> | TTask | undefined;
|
|
30
|
+
list: () => Promise<TTask[]> | TTask[];
|
|
31
|
+
remove: (id: string) => Promise<void> | void;
|
|
32
|
+
set: (id: string, task: TTask) => Promise<void> | void;
|
|
33
|
+
};
|
|
34
|
+
export type VoiceOpsTaskSummary = {
|
|
35
|
+
byKind: Array<[VoiceOpsTaskKind, number]>;
|
|
36
|
+
byOutcome: Array<[string, number]>;
|
|
37
|
+
done: number;
|
|
38
|
+
inProgress: number;
|
|
39
|
+
open: number;
|
|
40
|
+
topAssignees: Array<[string, number]>;
|
|
41
|
+
topTargets: Array<[string, number]>;
|
|
42
|
+
total: number;
|
|
43
|
+
};
|
|
44
|
+
export type VoiceIntegrationEventType = 'call.completed' | 'review.saved' | 'task.created' | 'task.updated';
|
|
45
|
+
export type VoiceIntegrationEvent = {
|
|
46
|
+
createdAt: number;
|
|
47
|
+
deliveredAt?: number;
|
|
48
|
+
deliveredTo?: string;
|
|
49
|
+
deliveryError?: string;
|
|
50
|
+
id: string;
|
|
51
|
+
payload: Record<string, unknown>;
|
|
52
|
+
type: VoiceIntegrationEventType;
|
|
53
|
+
};
|
|
54
|
+
export type StoredVoiceIntegrationEvent = VoiceIntegrationEvent;
|
|
55
|
+
export type VoiceIntegrationEventStore<TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent> = {
|
|
56
|
+
get: (id: string) => Promise<TEvent | undefined> | TEvent | undefined;
|
|
57
|
+
list: () => Promise<TEvent[]> | TEvent[];
|
|
58
|
+
remove: (id: string) => Promise<void> | void;
|
|
59
|
+
set: (id: string, event: TEvent) => Promise<void> | void;
|
|
60
|
+
};
|
|
61
|
+
export declare const withVoiceOpsTaskId: <TTask extends Omit<VoiceOpsTask, "id"> = Omit<VoiceOpsTask, "id">>(id: string, task: TTask) => TTask & {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
export declare const withVoiceIntegrationEventId: <TEvent extends Omit<VoiceIntegrationEvent, "id"> = Omit<VoiceIntegrationEvent, "id">>(id: string, event: TEvent) => TEvent & {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
export declare const buildVoiceOpsTaskFromReview: (review: StoredVoiceCallReviewArtifact) => StoredVoiceOpsTask | null;
|
|
68
|
+
export declare const assignVoiceOpsTask: (task: StoredVoiceOpsTask, owner: string, input?: {
|
|
69
|
+
at?: number;
|
|
70
|
+
actor?: string;
|
|
71
|
+
}) => StoredVoiceOpsTask;
|
|
72
|
+
export declare const startVoiceOpsTask: (task: StoredVoiceOpsTask, input?: {
|
|
73
|
+
at?: number;
|
|
74
|
+
actor?: string;
|
|
75
|
+
detail?: string;
|
|
76
|
+
}) => StoredVoiceOpsTask;
|
|
77
|
+
export declare const completeVoiceOpsTask: (task: StoredVoiceOpsTask, input?: {
|
|
78
|
+
at?: number;
|
|
79
|
+
actor?: string;
|
|
80
|
+
detail?: string;
|
|
81
|
+
}) => StoredVoiceOpsTask;
|
|
82
|
+
export declare const reopenVoiceOpsTask: (task: StoredVoiceOpsTask, input?: {
|
|
83
|
+
at?: number;
|
|
84
|
+
actor?: string;
|
|
85
|
+
detail?: string;
|
|
86
|
+
}) => StoredVoiceOpsTask;
|
|
87
|
+
export declare const listVoiceOpsTasks: (tasks: StoredVoiceOpsTask[]) => VoiceOpsTask[];
|
|
88
|
+
export declare const summarizeVoiceOpsTasks: (tasks: StoredVoiceOpsTask[]) => VoiceOpsTaskSummary;
|
|
89
|
+
export declare const createVoiceIntegrationEvent: <TPayload extends Record<string, unknown> = Record<string, unknown>>(type: VoiceIntegrationEventType, payload: TPayload, input?: {
|
|
90
|
+
createdAt?: number;
|
|
91
|
+
id?: string;
|
|
92
|
+
}) => StoredVoiceIntegrationEvent;
|
|
93
|
+
export declare const createVoiceCallCompletedEvent: (input: {
|
|
94
|
+
disposition?: VoiceCallDisposition;
|
|
95
|
+
session: VoiceSessionRecord;
|
|
96
|
+
sessionSummary?: VoiceSessionSummary;
|
|
97
|
+
}) => StoredVoiceIntegrationEvent;
|
|
98
|
+
export declare const createVoiceReviewSavedEvent: (review: StoredVoiceCallReviewArtifact) => StoredVoiceIntegrationEvent;
|
|
99
|
+
export declare const createVoiceTaskCreatedEvent: (task: StoredVoiceOpsTask) => StoredVoiceIntegrationEvent;
|
|
100
|
+
export declare const createVoiceTaskUpdatedEvent: (task: StoredVoiceOpsTask) => StoredVoiceIntegrationEvent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VoiceCaptureOptions, VoiceConnectionOptions, VoiceResolvedAudioConditioningConfig, VoiceResolvedTurnDetectionConfig, VoiceRuntimePreset, VoiceSTTLifecycle } from './types';
|
|
2
|
+
export type VoiceResolvedRuntimePreset = {
|
|
3
|
+
audioConditioning?: VoiceResolvedAudioConditioningConfig;
|
|
4
|
+
capture: {
|
|
5
|
+
channelCount: NonNullable<VoiceCaptureOptions['channelCount']>;
|
|
6
|
+
sampleRateHz: NonNullable<VoiceCaptureOptions['sampleRateHz']>;
|
|
7
|
+
};
|
|
8
|
+
connection: VoiceConnectionOptions;
|
|
9
|
+
name: VoiceRuntimePreset;
|
|
10
|
+
sttLifecycle: VoiceSTTLifecycle;
|
|
11
|
+
turnDetection: VoiceResolvedTurnDetectionConfig;
|
|
12
|
+
};
|
|
13
|
+
export declare const resolveVoiceRuntimePreset: (name?: VoiceRuntimePreset) => VoiceResolvedRuntimePreset;
|
package/dist/react/index.d.ts
CHANGED