@absolutejs/voice 0.0.22-beta.496 → 0.0.22-beta.498
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/assistant.d.ts +1 -2
- package/dist/callQuota.d.ts +54 -0
- package/dist/client/costDashboard.d.ts +27 -0
- package/dist/client/liveCallViewer.d.ts +42 -0
- package/dist/client/replayTimeline.d.ts +26 -0
- package/dist/defineVoiceAssistant.d.ts +68 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +605 -37
- package/dist/recordingRedaction.d.ts +18 -0
- package/dist/retention.d.ts +37 -0
- package/dist/routeAuth.d.ts +58 -0
- package/dist/testing/index.js +1 -0
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Transcript } from "./types";
|
|
2
|
+
import { type VoiceRedactionPattern } from "./redaction";
|
|
3
|
+
export type VoiceRecordingRedactionRange = {
|
|
4
|
+
endMs: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
startMs: number;
|
|
7
|
+
};
|
|
8
|
+
export type DeriveVoiceRecordingRedactionRangesInput = {
|
|
9
|
+
/** When the recording starts in epoch ms; used to convert absolute timestamps if transcripts use them. */
|
|
10
|
+
recordingStartedAtEpochMs?: number;
|
|
11
|
+
/** Optional padding around redaction ranges, in ms (default 100). */
|
|
12
|
+
paddingMs?: number;
|
|
13
|
+
/** Patterns to test against transcripts. Defaults to DEFAULT_VOICE_REDACTION_PATTERNS. */
|
|
14
|
+
patterns?: ReadonlyArray<VoiceRedactionPattern>;
|
|
15
|
+
/** Transcripts to scan. */
|
|
16
|
+
transcripts: ReadonlyArray<Transcript>;
|
|
17
|
+
};
|
|
18
|
+
export declare const deriveVoiceRecordingRedactionRanges: (input: DeriveVoiceRecordingRedactionRangesInput) => VoiceRecordingRedactionRange[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type VoiceRetentionPolicyOptions = {
|
|
2
|
+
/** Maximum age in milliseconds; events older than this are eligible for purge. */
|
|
3
|
+
maxAgeMs: number;
|
|
4
|
+
/** Optional override that returns the timestamp for an event. Defaults to event.at. */
|
|
5
|
+
resolveAt?: (event: unknown) => number | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type VoiceRetentionStore<TRecord extends {
|
|
8
|
+
id: string;
|
|
9
|
+
}> = {
|
|
10
|
+
list: (filter?: Record<string, unknown>) => Promise<TRecord[]> | TRecord[];
|
|
11
|
+
remove: (id: string) => Promise<void> | void;
|
|
12
|
+
};
|
|
13
|
+
export type VoicePurgeReport = {
|
|
14
|
+
attempted: number;
|
|
15
|
+
failed: number;
|
|
16
|
+
purgedIds: string[];
|
|
17
|
+
reason: "expired" | "manual";
|
|
18
|
+
removed: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const purgeVoiceRetentionStore: <TRecord extends {
|
|
21
|
+
id: string;
|
|
22
|
+
}>(store: VoiceRetentionStore<TRecord>, options: VoiceRetentionPolicyOptions, now?: number) => Promise<VoicePurgeReport>;
|
|
23
|
+
export type VoiceRetentionScheduler = {
|
|
24
|
+
start: () => void;
|
|
25
|
+
stop: () => void;
|
|
26
|
+
};
|
|
27
|
+
export type CreateVoiceRetentionSchedulerOptions<TRecord extends {
|
|
28
|
+
id: string;
|
|
29
|
+
}> = {
|
|
30
|
+
intervalMs?: number;
|
|
31
|
+
onReport?: (report: VoicePurgeReport) => void;
|
|
32
|
+
policy: VoiceRetentionPolicyOptions;
|
|
33
|
+
store: VoiceRetentionStore<TRecord>;
|
|
34
|
+
};
|
|
35
|
+
export declare const createVoiceRetentionScheduler: <TRecord extends {
|
|
36
|
+
id: string;
|
|
37
|
+
}>(options: CreateVoiceRetentionSchedulerOptions<TRecord>) => VoiceRetentionScheduler;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Elysia } from "elysia";
|
|
2
|
+
export type VoiceRouteAuthDecision = {
|
|
3
|
+
allow: true;
|
|
4
|
+
} | {
|
|
5
|
+
allow: false;
|
|
6
|
+
reason: string;
|
|
7
|
+
status?: number;
|
|
8
|
+
};
|
|
9
|
+
export type VoiceRouteAuthInput = {
|
|
10
|
+
body?: string;
|
|
11
|
+
headers: Headers;
|
|
12
|
+
method: string;
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
export type VoiceRouteAuthVerifier = (input: VoiceRouteAuthInput) => Promise<VoiceRouteAuthDecision> | VoiceRouteAuthDecision;
|
|
16
|
+
export type VoiceRouteAuthOptions = {
|
|
17
|
+
bypassPaths?: ReadonlyArray<string>;
|
|
18
|
+
name?: string;
|
|
19
|
+
verify: VoiceRouteAuthVerifier;
|
|
20
|
+
};
|
|
21
|
+
export declare const createVoiceBearerAuthVerifier: (input: {
|
|
22
|
+
expectedToken: string;
|
|
23
|
+
headerName?: string;
|
|
24
|
+
}) => VoiceRouteAuthVerifier;
|
|
25
|
+
export declare const createVoiceHMACAuthVerifier: (input: {
|
|
26
|
+
secret: string;
|
|
27
|
+
toleranceMs?: number;
|
|
28
|
+
}) => VoiceRouteAuthVerifier;
|
|
29
|
+
export declare const createVoiceRouteAuth: (options: VoiceRouteAuthOptions) => Elysia<"", {
|
|
30
|
+
decorator: {};
|
|
31
|
+
store: {};
|
|
32
|
+
derive: {};
|
|
33
|
+
resolve: {};
|
|
34
|
+
}, {
|
|
35
|
+
typebox: {};
|
|
36
|
+
error: {};
|
|
37
|
+
}, {
|
|
38
|
+
schema: {};
|
|
39
|
+
standaloneSchema: {};
|
|
40
|
+
macro: {};
|
|
41
|
+
macroFn: {};
|
|
42
|
+
parser: {};
|
|
43
|
+
response: {};
|
|
44
|
+
}, {}, {
|
|
45
|
+
derive: {};
|
|
46
|
+
resolve: {};
|
|
47
|
+
schema: {};
|
|
48
|
+
standaloneSchema: {};
|
|
49
|
+
response: {};
|
|
50
|
+
}, {
|
|
51
|
+
derive: {};
|
|
52
|
+
resolve: {};
|
|
53
|
+
schema: {};
|
|
54
|
+
standaloneSchema: {};
|
|
55
|
+
response: {
|
|
56
|
+
200: Response;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
package/dist/testing/index.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -49,12 +49,18 @@ export type VoiceLexiconEntry = {
|
|
|
49
49
|
metadata?: Record<string, unknown>;
|
|
50
50
|
pronunciation?: string;
|
|
51
51
|
};
|
|
52
|
+
export type VoiceTranscriptSentiment = {
|
|
53
|
+
label: "negative" | "neutral" | "positive" | (string & {});
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
score?: number;
|
|
56
|
+
};
|
|
52
57
|
export type Transcript = {
|
|
53
58
|
id: string;
|
|
54
59
|
text: string;
|
|
55
60
|
isFinal: boolean;
|
|
56
61
|
confidence?: number;
|
|
57
62
|
language?: string;
|
|
63
|
+
sentiment?: VoiceTranscriptSentiment;
|
|
58
64
|
speaker?: string | number;
|
|
59
65
|
startedAtMs?: number;
|
|
60
66
|
endedAtMs?: number;
|
|
@@ -172,9 +178,16 @@ export type TTSAdapterSession = {
|
|
|
172
178
|
export declare const ttsAdapterSessionCanCancel: (session: TTSAdapterSession) => session is TTSAdapterSession & {
|
|
173
179
|
cancel: (reason?: string) => Promise<void>;
|
|
174
180
|
};
|
|
181
|
+
export type VoiceTTSProsody = {
|
|
182
|
+
emphasis?: number;
|
|
183
|
+
pitch?: number;
|
|
184
|
+
speed?: number;
|
|
185
|
+
style?: string;
|
|
186
|
+
};
|
|
175
187
|
export type TTSAdapterOpenOptions = {
|
|
176
188
|
sessionId: string;
|
|
177
189
|
lexicon?: VoiceLexiconEntry[];
|
|
190
|
+
prosody?: VoiceTTSProsody;
|
|
178
191
|
signal?: AbortSignal;
|
|
179
192
|
};
|
|
180
193
|
export type TTSAdapter<TOptions extends TTSAdapterOpenOptions = TTSAdapterOpenOptions> = {
|
|
@@ -739,6 +752,7 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
|
|
|
739
752
|
semanticTurnDetector?: import("./semanticTurn").VoiceSemanticTurnDetector;
|
|
740
753
|
assistantMode?: import("./assistantMode").VoiceAssistantMode;
|
|
741
754
|
modalities?: ReadonlyArray<"audio" | "text">;
|
|
755
|
+
prosody?: VoiceTTSProsody;
|
|
742
756
|
reconnect: Required<VoiceReconnectConfig>;
|
|
743
757
|
phraseHints?: VoicePhraseHint[];
|
|
744
758
|
sessionMetadata?: Record<string, unknown>;
|