@todesktop/plugin-recall 1.0.2 → 1.0.4
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/main.d.ts +9 -4
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +183 -364
- package/dist/main.js.map +1 -1
- package/dist/preload.d.ts +142 -128
- package/dist/preload.d.ts.map +1 -1
- package/dist/preload.js +212 -196
- package/dist/preload.js.map +1 -1
- package/dist/shared.d.ts +41 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js.map +1 -1
- package/dist/store.d.ts +10 -82
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +14 -7
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
- package/src/main.ts +314 -327
- package/src/preload.ts +220 -211
- package/src/shared.ts +74 -39
- package/src/store.ts +41 -166
package/src/preload.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ToDesktop Recall Desktop SDK Plugin - Preload Script
|
|
3
3
|
*
|
|
4
|
-
* This file runs in the renderer process with Node.js access
|
|
5
|
-
*
|
|
6
|
-
|
|
4
|
+
* This file runs in the renderer process with Node.js access.
|
|
5
|
+
*
|
|
6
|
+
* ToDesktop plugins should export functions; the ToDesktop runtime will
|
|
7
|
+
* attach them under `window.todesktop.recallDesktop` automatically.
|
|
8
|
+
*/
|
|
7
9
|
|
|
8
|
-
import {
|
|
10
|
+
import { ipcRenderer } from 'electron';
|
|
9
11
|
import {
|
|
10
12
|
IPC_CHANNELS,
|
|
11
13
|
ApiResponse,
|
|
@@ -22,216 +24,223 @@ import {
|
|
|
22
24
|
} from './shared';
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*/
|
|
125
|
-
async setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse> {
|
|
126
|
-
return ipcRenderer.invoke(IPC_CHANNELS.SET_CONFIG, config);
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Get current plugin configuration
|
|
131
|
-
* @returns Promise resolving to current configuration
|
|
132
|
-
*/
|
|
133
|
-
async getConfig(): Promise<ApiResponse<RecallSdkConfig>> {
|
|
134
|
-
return ipcRenderer.invoke(IPC_CHANNELS.GET_CONFIG);
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Subscribe to SDK events
|
|
139
|
-
* @param eventType The type of event to listen for
|
|
140
|
-
* @param callback Function to call when event occurs
|
|
141
|
-
* @returns Function to unsubscribe from the event
|
|
142
|
-
*/
|
|
143
|
-
addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void {
|
|
144
|
-
const channel = `recall-desktop:event:${eventType}`;
|
|
145
|
-
|
|
146
|
-
// Fire-and-forget subscribe to main
|
|
147
|
-
ipcRenderer.invoke(IPC_CHANNELS.SUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
148
|
-
|
|
149
|
-
const listener = (_event: any, data: any) => {
|
|
150
|
-
callback(data);
|
|
151
|
-
};
|
|
152
|
-
ipcRenderer.on(channel, listener);
|
|
153
|
-
|
|
154
|
-
// Return unsubscribe function
|
|
155
|
-
return () => {
|
|
156
|
-
ipcRenderer.removeListener(channel, listener);
|
|
157
|
-
ipcRenderer.invoke(IPC_CHANNELS.UNSUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Get plugin version
|
|
163
|
-
* @returns Plugin version string
|
|
164
|
-
*/
|
|
165
|
-
getVersion(): string {
|
|
166
|
-
return '1.0.0';
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Convenience method for handling meeting detection events
|
|
171
|
-
* @param callback Function to call when a meeting is detected
|
|
172
|
-
* @returns Function to unsubscribe from the event
|
|
173
|
-
*/
|
|
174
|
-
onMeetingDetected(callback: (meetingData: any) => void): () => void {
|
|
175
|
-
return this.addEventListener('meeting-detected', callback);
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Convenience method for handling recording state changes
|
|
180
|
-
* @param callback Function to call when recording state changes
|
|
181
|
-
* @returns Function to unsubscribe from the event
|
|
182
|
-
*/
|
|
183
|
-
onRecordingStateChange(callback: (stateData: any) => void): () => void {
|
|
184
|
-
return this.addEventListener('sdk-state-change', callback);
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Convenience method for handling upload progress updates
|
|
189
|
-
* @param callback Function to call when upload progress updates
|
|
190
|
-
* @returns Function to unsubscribe from the event
|
|
191
|
-
*/
|
|
192
|
-
onUploadProgress(callback: (progressData: any) => void): () => void {
|
|
193
|
-
return this.addEventListener('upload-progress', callback);
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Convenience method for handling permission status updates
|
|
198
|
-
* @param callback Function to call when permission status changes
|
|
199
|
-
* @returns Function to unsubscribe from the event
|
|
200
|
-
*/
|
|
201
|
-
onPermissionStatusChange(callback: (permissionData: any) => void): () => void {
|
|
202
|
-
return this.addEventListener('permission-status', callback);
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Convenience method for handling SDK errors
|
|
207
|
-
* @param callback Function to call when SDK errors occur
|
|
208
|
-
* @returns Function to unsubscribe from the event
|
|
209
|
-
*/
|
|
210
|
-
onError(callback: (errorData: any) => void): () => void {
|
|
211
|
-
return this.addEventListener('error', callback);
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
216
|
-
* @param callback Function to call when real-time events occur
|
|
217
|
-
* @returns Function to unsubscribe from the event
|
|
218
|
-
*/
|
|
219
|
-
onRealtimeEvent(callback: (realtimeData: any) => void): () => void {
|
|
220
|
-
return this.addEventListener('realtime-event', callback);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
27
|
+
* Initialize the Recall SDK
|
|
28
|
+
* @returns Promise resolving to initialization result
|
|
29
|
+
*/
|
|
30
|
+
export async function initSdk(): Promise<ApiResponse> {
|
|
31
|
+
return ipcRenderer.invoke(IPC_CHANNELS.INIT_SDK);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Shutdown the Recall SDK
|
|
36
|
+
* @returns Promise resolving to shutdown result
|
|
37
|
+
*/
|
|
38
|
+
export async function shutdownSdk(): Promise<ApiResponse> {
|
|
39
|
+
return ipcRenderer.invoke(IPC_CHANNELS.SHUTDOWN_SDK);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get current plugin and SDK status
|
|
44
|
+
* @returns Promise resolving to plugin status
|
|
45
|
+
*/
|
|
46
|
+
export async function getStatus(): Promise<PluginStatus> {
|
|
47
|
+
return ipcRenderer.invoke(IPC_CHANNELS.GET_STATUS);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Start recording a meeting
|
|
52
|
+
* @param windowId The meeting window ID
|
|
53
|
+
* @param uploadToken Upload token from your backend
|
|
54
|
+
* @returns Promise resolving to recording start result
|
|
55
|
+
*/
|
|
56
|
+
export async function startRecording(windowId: string, uploadToken: string): Promise<ApiResponse> {
|
|
57
|
+
const request: StartRecordingRequest = { windowId, uploadToken };
|
|
58
|
+
return ipcRenderer.invoke(IPC_CHANNELS.START_RECORDING, request);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Stop recording a meeting
|
|
63
|
+
* @param windowId The meeting window ID
|
|
64
|
+
* @returns Promise resolving to recording stop result
|
|
65
|
+
*/
|
|
66
|
+
export async function stopRecording(windowId: string): Promise<ApiResponse> {
|
|
67
|
+
const request: StopRecordingRequest = { windowId };
|
|
68
|
+
return ipcRenderer.invoke(IPC_CHANNELS.STOP_RECORDING, request);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Pause recording a meeting
|
|
73
|
+
* @param windowId The meeting window ID
|
|
74
|
+
* @returns Promise resolving to recording pause result
|
|
75
|
+
*/
|
|
76
|
+
export async function pauseRecording(windowId: string): Promise<ApiResponse> {
|
|
77
|
+
const request: PauseRecordingRequest = { windowId };
|
|
78
|
+
return ipcRenderer.invoke(IPC_CHANNELS.PAUSE_RECORDING, request);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Resume recording a meeting
|
|
83
|
+
* @param windowId The meeting window ID
|
|
84
|
+
* @returns Promise resolving to recording resume result
|
|
85
|
+
*/
|
|
86
|
+
export async function resumeRecording(windowId: string): Promise<ApiResponse> {
|
|
87
|
+
const request: ResumeRecordingRequest = { windowId };
|
|
88
|
+
return ipcRenderer.invoke(IPC_CHANNELS.RESUME_RECORDING, request);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Upload a completed recording
|
|
93
|
+
* @param windowId The meeting window ID
|
|
94
|
+
* @returns Promise resolving to upload start result
|
|
95
|
+
*/
|
|
96
|
+
export async function uploadRecording(windowId: string): Promise<ApiResponse> {
|
|
97
|
+
const request: UploadRecordingRequest = { windowId };
|
|
98
|
+
return ipcRenderer.invoke(IPC_CHANNELS.UPLOAD_RECORDING, request);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Prepare desktop audio recording for non-meeting audio capture
|
|
103
|
+
* @returns Promise resolving to desktop audio preparation result
|
|
104
|
+
*/
|
|
105
|
+
export async function prepareDesktopAudioRecording(): Promise<ApiResponse<PrepareDesktopAudioResponse>> {
|
|
106
|
+
return ipcRenderer.invoke(IPC_CHANNELS.PREPARE_DESKTOP_AUDIO);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Request a specific permission from the user
|
|
111
|
+
* @param permission The permission to request
|
|
112
|
+
* @returns Promise resolving to permission request result
|
|
113
|
+
*/
|
|
114
|
+
export async function requestPermission(permission: PermissionType): Promise<ApiResponse> {
|
|
115
|
+
return ipcRenderer.invoke(IPC_CHANNELS.REQUEST_PERMISSION, permission);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Update plugin configuration
|
|
120
|
+
* @param config Configuration updates
|
|
121
|
+
* @returns Promise resolving to update result
|
|
122
|
+
*/
|
|
123
|
+
export async function setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse> {
|
|
124
|
+
return ipcRenderer.invoke(IPC_CHANNELS.SET_CONFIG, config);
|
|
125
|
+
}
|
|
223
126
|
|
|
224
|
-
|
|
225
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Get current plugin configuration
|
|
129
|
+
* @returns Promise resolving to current configuration
|
|
130
|
+
*/
|
|
131
|
+
export async function getConfig(): Promise<ApiResponse<RecallSdkConfig>> {
|
|
132
|
+
return ipcRenderer.invoke(IPC_CHANNELS.GET_CONFIG);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Subscribe to SDK events
|
|
137
|
+
* @param eventType The type of event to listen for
|
|
138
|
+
* @param callback Function to call when event occurs
|
|
139
|
+
* @returns Function to unsubscribe from the event
|
|
140
|
+
*/
|
|
141
|
+
export function addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void {
|
|
142
|
+
const channel = `recall-desktop:event:${eventType}`;
|
|
143
|
+
|
|
144
|
+
// Fire-and-forget subscribe to main
|
|
145
|
+
ipcRenderer.invoke(IPC_CHANNELS.SUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
146
|
+
|
|
147
|
+
const listener = (_event: any, data: any) => {
|
|
148
|
+
callback(data);
|
|
149
|
+
};
|
|
150
|
+
ipcRenderer.on(channel, listener);
|
|
151
|
+
|
|
152
|
+
// Return unsubscribe function
|
|
153
|
+
return () => {
|
|
154
|
+
ipcRenderer.removeListener(channel, listener);
|
|
155
|
+
ipcRenderer.invoke(IPC_CHANNELS.UNSUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
226
158
|
|
|
227
|
-
|
|
228
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Get plugin version
|
|
161
|
+
* @returns Plugin version string
|
|
162
|
+
*/
|
|
163
|
+
export function getVersion(): string {
|
|
164
|
+
return '1.0.0';
|
|
165
|
+
}
|
|
229
166
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Convenience method for handling meeting detection events
|
|
169
|
+
* @param callback Function to call when a meeting is detected
|
|
170
|
+
* @returns Function to unsubscribe from the event
|
|
171
|
+
*/
|
|
172
|
+
export function onMeetingDetected(callback: (meetingData: any) => void): () => void {
|
|
173
|
+
return addEventListener('meeting-detected', callback);
|
|
235
174
|
}
|
|
236
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Convenience method for handling recording state changes
|
|
178
|
+
* @param callback Function to call when recording state changes
|
|
179
|
+
* @returns Function to unsubscribe from the event
|
|
180
|
+
*/
|
|
181
|
+
export function onRecordingStateChange(callback: (stateData: any) => void): () => void {
|
|
182
|
+
return addEventListener('sdk-state-change', callback);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Convenience method for handling upload progress updates
|
|
187
|
+
* @param callback Function to call when upload progress updates
|
|
188
|
+
* @returns Function to unsubscribe from the event
|
|
189
|
+
*/
|
|
190
|
+
export function onUploadProgress(callback: (progressData: any) => void): () => void {
|
|
191
|
+
return addEventListener('upload-progress', callback);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Convenience method for handling permission status updates
|
|
196
|
+
* @param callback Function to call when permission status changes
|
|
197
|
+
* @returns Function to unsubscribe from the event
|
|
198
|
+
*/
|
|
199
|
+
export function onPermissionStatusChange(callback: (permissionData: any) => void): () => void {
|
|
200
|
+
return addEventListener('permission-status', callback);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Convenience method for handling SDK errors
|
|
205
|
+
* @param callback Function to call when SDK errors occur
|
|
206
|
+
* @returns Function to unsubscribe from the event
|
|
207
|
+
*/
|
|
208
|
+
export function onError(callback: (errorData: any) => void): () => void {
|
|
209
|
+
return addEventListener('error', callback);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
214
|
+
* @param callback Function to call when real-time events occur
|
|
215
|
+
* @returns Function to unsubscribe from the event
|
|
216
|
+
*/
|
|
217
|
+
export function onRealtimeEvent(callback: (realtimeData: any) => void): () => void {
|
|
218
|
+
return addEventListener('realtime-event', callback);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Export the API type for TypeScript support (shape of the exported functions)
|
|
222
|
+
type ExportedApi = {
|
|
223
|
+
initSdk: typeof initSdk;
|
|
224
|
+
shutdownSdk: typeof shutdownSdk;
|
|
225
|
+
getStatus: typeof getStatus;
|
|
226
|
+
startRecording: typeof startRecording;
|
|
227
|
+
stopRecording: typeof stopRecording;
|
|
228
|
+
pauseRecording: typeof pauseRecording;
|
|
229
|
+
resumeRecording: typeof resumeRecording;
|
|
230
|
+
uploadRecording: typeof uploadRecording;
|
|
231
|
+
prepareDesktopAudioRecording: typeof prepareDesktopAudioRecording;
|
|
232
|
+
requestPermission: typeof requestPermission;
|
|
233
|
+
setConfig: typeof setConfig;
|
|
234
|
+
getConfig: typeof getConfig;
|
|
235
|
+
addEventListener: typeof addEventListener;
|
|
236
|
+
getVersion: typeof getVersion;
|
|
237
|
+
onMeetingDetected: typeof onMeetingDetected;
|
|
238
|
+
onRecordingStateChange: typeof onRecordingStateChange;
|
|
239
|
+
onUploadProgress: typeof onUploadProgress;
|
|
240
|
+
onPermissionStatusChange: typeof onPermissionStatusChange;
|
|
241
|
+
onError: typeof onError;
|
|
242
|
+
onRealtimeEvent: typeof onRealtimeEvent;
|
|
243
|
+
};
|
|
244
|
+
export type RecallDesktopApi = ExportedApi;
|
|
245
|
+
|
|
237
246
|
console.log('RecallDesktop: Preload script loaded successfully');
|
package/src/shared.ts
CHANGED
|
@@ -5,30 +5,30 @@
|
|
|
5
5
|
// IPC channel names - use unique namespace to avoid conflicts
|
|
6
6
|
export const IPC_CHANNELS = {
|
|
7
7
|
// SDK lifecycle
|
|
8
|
-
INIT_SDK:
|
|
9
|
-
SHUTDOWN_SDK:
|
|
10
|
-
GET_STATUS:
|
|
11
|
-
|
|
8
|
+
INIT_SDK: "recall-desktop:init-sdk",
|
|
9
|
+
SHUTDOWN_SDK: "recall-desktop:shutdown-sdk",
|
|
10
|
+
GET_STATUS: "recall-desktop:get-status",
|
|
11
|
+
|
|
12
12
|
// Recording management
|
|
13
|
-
START_RECORDING:
|
|
14
|
-
STOP_RECORDING:
|
|
15
|
-
PAUSE_RECORDING:
|
|
16
|
-
RESUME_RECORDING:
|
|
17
|
-
UPLOAD_RECORDING:
|
|
18
|
-
|
|
13
|
+
START_RECORDING: "recall-desktop:start-recording",
|
|
14
|
+
STOP_RECORDING: "recall-desktop:stop-recording",
|
|
15
|
+
PAUSE_RECORDING: "recall-desktop:pause-recording",
|
|
16
|
+
RESUME_RECORDING: "recall-desktop:resume-recording",
|
|
17
|
+
UPLOAD_RECORDING: "recall-desktop:upload-recording",
|
|
18
|
+
|
|
19
19
|
// Desktop audio recording
|
|
20
|
-
PREPARE_DESKTOP_AUDIO:
|
|
21
|
-
|
|
20
|
+
PREPARE_DESKTOP_AUDIO: "recall-desktop:prepare-desktop-audio",
|
|
21
|
+
|
|
22
22
|
// Permission management
|
|
23
|
-
REQUEST_PERMISSION:
|
|
24
|
-
|
|
23
|
+
REQUEST_PERMISSION: "recall-desktop:request-permission",
|
|
24
|
+
|
|
25
25
|
// Configuration
|
|
26
|
-
SET_CONFIG:
|
|
27
|
-
GET_CONFIG:
|
|
28
|
-
|
|
26
|
+
SET_CONFIG: "recall-desktop:set-config",
|
|
27
|
+
GET_CONFIG: "recall-desktop:get-config",
|
|
28
|
+
|
|
29
29
|
// Event subscription
|
|
30
|
-
SUBSCRIBE_EVENTS:
|
|
31
|
-
UNSUBSCRIBE_EVENTS:
|
|
30
|
+
SUBSCRIBE_EVENTS: "recall-desktop:subscribe-events",
|
|
31
|
+
UNSUBSCRIBE_EVENTS: "recall-desktop:unsubscribe-events",
|
|
32
32
|
} as const;
|
|
33
33
|
|
|
34
34
|
// Recall SDK Configuration (mirrors RecallAiSdkConfig where applicable)
|
|
@@ -38,6 +38,37 @@ export interface RecallSdkConfig {
|
|
|
38
38
|
requestPermissionsOnStartup: boolean;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// ToDesktop plugin context (subset relevant to this plugin)
|
|
42
|
+
export interface PluginContext {
|
|
43
|
+
plugin: {
|
|
44
|
+
todesktop: {
|
|
45
|
+
preferences: [
|
|
46
|
+
{
|
|
47
|
+
id: "enabled";
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
type: "checkbox";
|
|
51
|
+
spec: { value?: boolean };
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "apiUrl";
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
type: "text";
|
|
58
|
+
spec: { value?: string };
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "requestPermissionsOnStartup";
|
|
62
|
+
name: string;
|
|
63
|
+
description: string;
|
|
64
|
+
type: "checkbox";
|
|
65
|
+
spec: { value?: boolean };
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
41
72
|
// Meeting window information from SDK
|
|
42
73
|
export interface MeetingWindow {
|
|
43
74
|
id: string;
|
|
@@ -70,20 +101,20 @@ export interface UploadRecordingRequest {
|
|
|
70
101
|
|
|
71
102
|
// SDK Events from Recall SDK (mirror upstream)
|
|
72
103
|
export type RecallSdkEventType =
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
104
|
+
| "recording-started"
|
|
105
|
+
| "recording-ended"
|
|
106
|
+
| "upload-progress"
|
|
107
|
+
| "meeting-detected"
|
|
108
|
+
| "meeting-updated"
|
|
109
|
+
| "meeting-closed"
|
|
110
|
+
| "sdk-state-change"
|
|
111
|
+
| "error"
|
|
112
|
+
| "media-capture-status"
|
|
113
|
+
| "participant-capture-status"
|
|
114
|
+
| "permissions-granted"
|
|
115
|
+
| "permission-status"
|
|
116
|
+
| "realtime-event"
|
|
117
|
+
| "shutdown";
|
|
87
118
|
|
|
88
119
|
export interface RecallSdkEvent {
|
|
89
120
|
type: RecallSdkEventType;
|
|
@@ -98,7 +129,7 @@ export interface MeetingDetectedEvent {
|
|
|
98
129
|
export interface SdkStateChangeEvent {
|
|
99
130
|
sdk: {
|
|
100
131
|
state: {
|
|
101
|
-
code:
|
|
132
|
+
code: "recording" | "idle" | "paused";
|
|
102
133
|
};
|
|
103
134
|
};
|
|
104
135
|
}
|
|
@@ -126,13 +157,13 @@ export interface MeetingUpdatedEvent {
|
|
|
126
157
|
|
|
127
158
|
export interface MediaCaptureStatusEvent {
|
|
128
159
|
window: MeetingWindow;
|
|
129
|
-
type:
|
|
160
|
+
type: "video" | "audio";
|
|
130
161
|
capturing: boolean;
|
|
131
162
|
}
|
|
132
163
|
|
|
133
164
|
export interface ParticipantCaptureStatusEvent {
|
|
134
165
|
window: MeetingWindow;
|
|
135
|
-
type:
|
|
166
|
+
type: "video" | "audio" | "screenshare";
|
|
136
167
|
capturing: boolean;
|
|
137
168
|
}
|
|
138
169
|
|
|
@@ -159,7 +190,11 @@ export interface ShutdownEvent {
|
|
|
159
190
|
}
|
|
160
191
|
|
|
161
192
|
// Permission types (mirror upstream)
|
|
162
|
-
export type PermissionType =
|
|
193
|
+
export type PermissionType =
|
|
194
|
+
| "accessibility"
|
|
195
|
+
| "screen-capture"
|
|
196
|
+
| "microphone"
|
|
197
|
+
| "system-audio";
|
|
163
198
|
|
|
164
199
|
// API Response types
|
|
165
200
|
export interface ApiResponse<T = any> {
|
|
@@ -174,7 +209,7 @@ export interface PluginStatus {
|
|
|
174
209
|
sdkInitialized: boolean;
|
|
175
210
|
version: string;
|
|
176
211
|
config: RecallSdkConfig;
|
|
177
|
-
sdkState?:
|
|
212
|
+
sdkState?: "recording" | "idle" | "paused";
|
|
178
213
|
permissions?: {
|
|
179
214
|
accessibility: boolean;
|
|
180
215
|
screenCapture: boolean;
|
|
@@ -187,7 +222,7 @@ export interface PluginStatus {
|
|
|
187
222
|
export class RecallSdkError extends Error {
|
|
188
223
|
constructor(message: string, public code?: string) {
|
|
189
224
|
super(message);
|
|
190
|
-
this.name =
|
|
225
|
+
this.name = "RecallSdkError";
|
|
191
226
|
}
|
|
192
227
|
}
|
|
193
228
|
|