@opencxh/domain 1.19.0 → 1.20.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AIMessageInput, AIMessageOutput } from '../ai-message/types';
|
|
2
|
-
import { Transcript } from '../transcript/types';
|
|
3
2
|
export type CallStatus = "new" | "connecting" | "ringing" | "connected" | "held" | "ended" | "failed";
|
|
4
3
|
export type CallDirection = "inbound" | "outbound";
|
|
5
4
|
export type CallType = "audio" | "video" | "data" | "screen-share";
|
|
@@ -111,8 +110,17 @@ export type ChatEventPayload = {
|
|
|
111
110
|
initiator?: ChatMember;
|
|
112
111
|
raw?: any;
|
|
113
112
|
};
|
|
113
|
+
export type TranscriptAddedSegment = {
|
|
114
|
+
speaker: 'local' | 'remote';
|
|
115
|
+
speakerLabel?: string;
|
|
116
|
+
text: string;
|
|
117
|
+
startedAt: number;
|
|
118
|
+
endedAt: number;
|
|
119
|
+
};
|
|
114
120
|
export type TranscriptAddedPayload = {
|
|
115
|
-
|
|
121
|
+
text: string;
|
|
122
|
+
segments?: TranscriptAddedSegment[];
|
|
123
|
+
finalized: boolean;
|
|
116
124
|
};
|
|
117
125
|
export type MeetingPayload = {
|
|
118
126
|
title: string;
|
package/dist/platform/media.d.ts
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Speaker = 'local' | 'remote';
|
|
2
|
+
export interface AudioSegment {
|
|
2
3
|
sessionId: string;
|
|
4
|
+
speaker: Speaker;
|
|
5
|
+
speakerId?: string;
|
|
3
6
|
buffer: Float32Array;
|
|
4
7
|
sampleRate: number;
|
|
5
|
-
|
|
8
|
+
startedAt: number;
|
|
9
|
+
endedAt: number;
|
|
10
|
+
avgRMS: number;
|
|
11
|
+
isFinal: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TranscriptWord {
|
|
14
|
+
text: string;
|
|
15
|
+
startedAt: number;
|
|
16
|
+
endedAt: number;
|
|
17
|
+
}
|
|
18
|
+
export interface TranscriptSegment {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
speaker: Speaker;
|
|
21
|
+
speakerId?: string;
|
|
22
|
+
speakerLabel?: string;
|
|
23
|
+
text: string;
|
|
24
|
+
words?: TranscriptWord[];
|
|
25
|
+
partial: boolean;
|
|
26
|
+
startedAt: number;
|
|
27
|
+
endedAt: number;
|
|
28
|
+
language?: string;
|
|
29
|
+
confidence?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AudioPipelineOptions {
|
|
32
|
+
silenceThreshold: number;
|
|
33
|
+
minRMS: number;
|
|
34
|
+
speechFrameRatio: number;
|
|
35
|
+
silenceDurationMs: number;
|
|
36
|
+
maxSpeechDurationMs: number;
|
|
37
|
+
overlapMs: number;
|
|
6
38
|
}
|
|
7
39
|
export type MediaPermissionKind = "microphone" | "camera";
|
|
8
40
|
export type MediaPermissionState = "granted" | "denied" | "prompt" | "unsupported";
|
package/dist/platform/sdk.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { InvokeOptions, SSEMessage } from './api';
|
|
3
3
|
import { CommsAccount, Session } from './communication';
|
|
4
4
|
import { PlatformConfig, PlatformContext } from './kernel';
|
|
5
|
-
import {
|
|
5
|
+
import { AudioPipelineOptions, AudioSegment, MediaPermissionKind, MediaPermissionState, MediaPermissionStatus, TranscriptSegment } from './media';
|
|
6
6
|
import { ServiceCallOptions, ServiceMap } from './services';
|
|
7
7
|
import { DeepPartial, DeviceList, UserSettings } from './settings';
|
|
8
8
|
import { ExtensionConfig, ToastConfig } from './ui';
|
|
@@ -55,13 +55,26 @@ export interface InternalSDK<LocalServices extends ServiceMap = {}, TranslationK
|
|
|
55
55
|
setActiveSession(sessionId: string): Promise<void>;
|
|
56
56
|
registerAccount(organizationId: string, userId: string, providerId: string, config: any): Promise<CommsAccount>;
|
|
57
57
|
handleSessionAction(sessionId: string, actionId: string, ...args: any[]): Promise<void>;
|
|
58
|
+
transcripts: {
|
|
59
|
+
ingest(segments: TranscriptSegment[]): void;
|
|
60
|
+
byCallSession$(sessionId: string): Observable<TranscriptSegment[]>;
|
|
61
|
+
deltas$(sessionId: string): Observable<TranscriptSegment[]>;
|
|
62
|
+
partials$(sessionId: string): Observable<TranscriptSegment>;
|
|
63
|
+
persist(sessionId: string): Promise<void>;
|
|
64
|
+
clear(sessionId: string): void;
|
|
65
|
+
setPersister(fn: (sessionId: string, segments: TranscriptSegment[], opts: {
|
|
66
|
+
finalize: boolean;
|
|
67
|
+
}) => Promise<void>): void;
|
|
68
|
+
};
|
|
58
69
|
};
|
|
59
70
|
readonly media: {
|
|
60
71
|
localStream$: Observable<MediaStream | null>;
|
|
61
|
-
|
|
72
|
+
audioSegments$: Observable<AudioSegment>;
|
|
62
73
|
devices$: Observable<DeviceList>;
|
|
63
74
|
permissions$: Observable<MediaPermissionStatus>;
|
|
64
|
-
|
|
75
|
+
emitAudioSegment(segment: AudioSegment): void;
|
|
76
|
+
configureAudioPipeline(opts: Partial<AudioPipelineOptions>): void;
|
|
77
|
+
setAudioPipelineEnabled(enabled: boolean): void;
|
|
65
78
|
setInputDevice(deviceId: string): Promise<void>;
|
|
66
79
|
toggleMute(mute?: boolean): void;
|
|
67
80
|
attachProviderStream(sessionId: string, stream: MediaStream): void;
|
package/dist/platform/ui.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface ToastConfig {
|
|
|
20
20
|
onClick: () => void;
|
|
21
21
|
}[];
|
|
22
22
|
}
|
|
23
|
+
export type ExtensionContext = 'global' | 'call' | 'interaction';
|
|
23
24
|
export interface ExtensionConfig {
|
|
24
25
|
id: string;
|
|
25
26
|
slot: string;
|
|
@@ -27,6 +28,7 @@ export interface ExtensionConfig {
|
|
|
27
28
|
resource: string;
|
|
28
29
|
icon?: string;
|
|
29
30
|
priority?: number;
|
|
31
|
+
contexts?: ExtensionContext[];
|
|
30
32
|
conditions?: {
|
|
31
33
|
[key: string]: any;
|
|
32
34
|
};
|