@webex/internal-plugin-llm 3.11.0 → 3.12.0-auth-prejoin-fetch.1

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/src/llm.types.ts CHANGED
@@ -1,9 +1,78 @@
1
+ export enum DataChannelTokenType {
2
+ Default = 'llm-default-session',
3
+ PracticeSession = 'llm-practice-session',
4
+ }
5
+
6
+ type DataChannelTokenKey = DataChannelTokenType | string;
7
+
8
+ /**
9
+ * Latencies (in milliseconds) captured during register + websocket connect.
10
+ */
11
+ type RegisterAndConnectTiming = {
12
+ clientLLMDatachannelResponseTime?: number;
13
+ clientLLMWebSocketConnectTime?: number;
14
+ };
15
+
1
16
  interface ILLMChannel {
2
- registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
3
- isConnected: () => boolean;
4
- getBinding: () => string;
5
- getLocusUrl: () => string;
6
- disconnectLLM: (options: {code: number; reason: string}) => Promise<void>;
17
+ registerAndConnect: (
18
+ locusUrl: string,
19
+ datachannelUrl: string,
20
+ datachannelToken?: string,
21
+ sessionId?: string
22
+ ) => Promise<RegisterAndConnectTiming | undefined>;
23
+ isConnected: (sessionId?: string) => boolean;
24
+ getBinding: (sessionId?: string) => string;
25
+ getLocusUrl: (sessionId?: string) => string;
26
+ getDatachannelUrl: (sessionId?: string) => string;
27
+ getWebSocketUrl: (sessionId?: string) => string | undefined;
28
+ disconnectLLM: (
29
+ options: {code: number; reason: string},
30
+ sessionId?: string,
31
+ ownerMeetingId?: string
32
+ ) => Promise<boolean>;
33
+ disconnectAllLLM: (options?: {code: number; reason: string}) => Promise<void>;
34
+ setOwnerMeetingId: (ownerMeetingId: string | undefined, sessionId?: string) => void;
35
+ getOwnerMeetingId: (sessionId?: string) => string | undefined;
36
+ resolveSessionOwnership: (
37
+ ownerMeetingId?: string,
38
+ sessionId?: string
39
+ ) => {
40
+ currentOwner: string | undefined;
41
+ isOwner: boolean;
42
+ };
43
+ getDatachannelToken: (
44
+ tokenKey?: DataChannelTokenKey,
45
+ ownerMeetingId?: string
46
+ ) => string | undefined;
47
+ setDatachannelToken: (
48
+ datachannelToken: string,
49
+ tokenKey?: DataChannelTokenKey,
50
+ ownerMeetingId?: string
51
+ ) => void;
52
+ clearDatachannelToken: (tokenKey: DataChannelTokenKey, ownerMeetingId: string) => void;
53
+ setRefreshHandler: (
54
+ handler: () => Promise<{
55
+ body: {datachannelToken: string; datachannelTokenType: DataChannelTokenType};
56
+ }>,
57
+ sessionId?: string,
58
+ ownerMeetingId?: string
59
+ ) => void;
60
+ refreshDataChannelToken: (sessionId?: string) => Promise<{
61
+ body: {datachannelToken: string; datachannelTokenType: DataChannelTokenType};
62
+ } | null>;
63
+ getLocusUrlByDatachannelUrl: (requestUrl: string) => string | undefined;
64
+ getSessionIdByDatachannelUrl: (requestUrl: string) => string | undefined;
65
+ getAllConnections: () => Map<
66
+ string,
67
+ {
68
+ webSocketUrl?: string;
69
+ binding?: string;
70
+ locusUrl?: string;
71
+ datachannelUrl?: string;
72
+ ownerMeetingId?: string;
73
+ }
74
+ >;
7
75
  }
76
+
8
77
  // eslint-disable-next-line import/prefer-default-export
9
- export type {ILLMChannel};
78
+ export type {ILLMChannel, DataChannelTokenKey, RegisterAndConnectTiming};