@recallai/desktop-sdk 2025.3.6-99ee4c63083d29e18674e5cefba29ecf5f82e371 → 2025.3.10-1bc3e77db2432fdba486ca1ae026ab23db716966
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/desktop_sdk_macos_exe +0 -0
- package/{desktop_sdk_macos.framework.tar → desktop_sdk_macos_frameworks.tar} +0 -0
- package/index.d.ts +14 -8
- package/index.js +110 -24
- package/package.json +11 -19
- package/unpack-frameworks.sh +16 -0
- package/prebuilds/darwin-arm64/@recallai+desktop-sdk.node +0 -0
- package/unpack-framework.sh +0 -16
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -34,7 +34,14 @@ declare module '@recallai/desktop-sdk' {
|
|
|
34
34
|
export function startRecording(config: StartRecordingConfig): void;
|
|
35
35
|
export function stopRecording(config: StopRecordingConfig): void;
|
|
36
36
|
export function uploadRecording(config: UploadRecordingConfig): void;
|
|
37
|
-
export function prepareDesktopAudioRecording(): string
|
|
37
|
+
export function prepareDesktopAudioRecording(): Promise<string>;
|
|
38
|
+
|
|
39
|
+
export interface RecallAiSdkWindow {
|
|
40
|
+
id: string;
|
|
41
|
+
title: string | undefined;
|
|
42
|
+
url: string | undefined;
|
|
43
|
+
platform: string;
|
|
44
|
+
}
|
|
38
45
|
|
|
39
46
|
export interface RecallAiSdkConfig {
|
|
40
47
|
api_url: string;
|
|
@@ -51,24 +58,23 @@ declare module '@recallai/desktop-sdk' {
|
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
export interface RecordingStartEvent {
|
|
54
|
-
window:
|
|
61
|
+
window: RecallAiSdkWindow;
|
|
55
62
|
}
|
|
56
63
|
export interface RecordingStopEvent {
|
|
57
|
-
window:
|
|
64
|
+
window: RecallAiSdkWindow;
|
|
58
65
|
}
|
|
59
66
|
export interface UploadProgressEvent {
|
|
60
67
|
window: { id: string };
|
|
61
68
|
progress: number;
|
|
62
69
|
}
|
|
63
70
|
export interface MeetingDetectedEvent {
|
|
64
|
-
window:
|
|
71
|
+
window: RecallAiSdkWindow;
|
|
65
72
|
}
|
|
66
73
|
export interface MeetingUpdatedEvent {
|
|
67
|
-
window:
|
|
68
|
-
title: string;
|
|
74
|
+
window: RecallAiSdkWindow;
|
|
69
75
|
}
|
|
70
76
|
export interface MeetingClosedEvent {
|
|
71
|
-
window:
|
|
77
|
+
window: RecallAiSdkWindow;
|
|
72
78
|
}
|
|
73
79
|
export interface SdkStateChangeEvent {
|
|
74
80
|
sdk: {
|
|
@@ -78,7 +84,7 @@ declare module '@recallai/desktop-sdk' {
|
|
|
78
84
|
};
|
|
79
85
|
}
|
|
80
86
|
export interface MediaCaptureStatusEvent {
|
|
81
|
-
window:
|
|
87
|
+
window: RecallAiSdkWindow;
|
|
82
88
|
type: 'video' | 'audio';
|
|
83
89
|
capturing: boolean;
|
|
84
90
|
}
|
package/index.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
const
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { spawn } = require('child_process');
|
|
3
|
+
const readline = require('node:readline');
|
|
4
|
+
const { v4: uuidv4 } = require('uuid');
|
|
2
5
|
|
|
3
|
-
process.env['BOT_ID']='00000000-0000-0000-0000-000000000000';
|
|
6
|
+
process.env['BOT_ID'] = '00000000-0000-0000-0000-000000000000';
|
|
4
7
|
process.env['BOT_IMAGE_KIND'] = 'mono_web';
|
|
5
|
-
process.env['POD_IP']="1.2.3.4";
|
|
8
|
+
process.env['POD_IP'] = "1.2.3.4";
|
|
6
9
|
|
|
7
10
|
process.env['AWS_REGION'] = 'us-east-1';
|
|
8
11
|
process.env['AWS_DEFAULT_REGION'] = 'us-east-1';
|
|
9
|
-
process.env['S3_BUCKET']='';
|
|
10
|
-
process.env['DATABASE_URL']='';
|
|
12
|
+
process.env['S3_BUCKET'] = '';
|
|
13
|
+
process.env['DATABASE_URL'] = '';
|
|
11
14
|
|
|
12
|
-
process.env['DEEPGRAM_USERNAME']='';
|
|
13
|
-
process.env['DEEPGRAM_PASSWORD']='';
|
|
14
|
-
process.env['SVIX_API_KEY']='';
|
|
15
|
+
process.env['DEEPGRAM_USERNAME'] = '';
|
|
16
|
+
process.env['DEEPGRAM_PASSWORD'] = '';
|
|
17
|
+
process.env['SVIX_API_KEY'] = '';
|
|
15
18
|
|
|
16
19
|
// process.env['NO_COLOR']=1;
|
|
17
|
-
process.env['GOOGLE_LOGIN_MAXIMUM_CONCURRENT_ASSIGNMENTS']=5;
|
|
20
|
+
process.env['GOOGLE_LOGIN_MAXIMUM_CONCURRENT_ASSIGNMENTS'] = 5;
|
|
18
21
|
|
|
19
22
|
process.env['MEETING_API_BASE_URL'] = '';
|
|
20
23
|
|
|
21
|
-
process.env['ZOOM_OAUTH_ACCESS_TOKEN_MINIMUM_LIFETIME_SECONDS']=60;
|
|
22
|
-
process.env['ZOOM_OAUTH_CREDENTIAL_ERROR_THRESHOLD']=1;
|
|
24
|
+
process.env['ZOOM_OAUTH_ACCESS_TOKEN_MINIMUM_LIFETIME_SECONDS'] = 60;
|
|
25
|
+
process.env['ZOOM_OAUTH_CREDENTIAL_ERROR_THRESHOLD'] = 1;
|
|
23
26
|
|
|
24
27
|
process.env['DATADOG_API_KEY'] = '';
|
|
25
28
|
|
|
@@ -27,45 +30,128 @@ process.env["GST_DEBUG"] = "2";
|
|
|
27
30
|
// process.env["GST_DEBUG_NO_COLOR"] = "1";
|
|
28
31
|
process.env["GST_DEBUG_DUMP_DOT_DIR"] = "/tmp/gst.nocommit";
|
|
29
32
|
|
|
33
|
+
const exe_path = path.join(__dirname, "desktop_sdk_macos_exe");
|
|
34
|
+
|
|
35
|
+
let proc;
|
|
36
|
+
const listeners = [];
|
|
37
|
+
const pendingCommands = {};
|
|
38
|
+
|
|
39
|
+
function startProcess() {
|
|
40
|
+
proc = spawn(exe_path, { stdio: ['pipe', 'pipe', 'pipe', 'pipe'] });
|
|
41
|
+
const extraStream = proc.stdio[3];
|
|
42
|
+
const rl = readline.createInterface({ input: extraStream, crlfDelay: Infinity });
|
|
43
|
+
const rlStdout = readline.createInterface({ input: proc.stdout, crlfDelay: Infinity });
|
|
44
|
+
const rlStderr = readline.createInterface({ input: proc.stderr, crlfDelay: Infinity });
|
|
45
|
+
|
|
46
|
+
rlStdout.on('line', (data) => {
|
|
47
|
+
if (process.env.RECALLAI_DESKTOP_SDK_DEV) console.log(data);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
rlStderr.on('line', (data) => {
|
|
51
|
+
if (process.env.RECALLAI_DESKTOP_SDK_DEV) console.error(data);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
rl.on('line', (line) => {
|
|
55
|
+
try {
|
|
56
|
+
const data = JSON.parse(line);
|
|
57
|
+
|
|
58
|
+
if (data.type === "event") {
|
|
59
|
+
const event = JSON.parse(data.event);
|
|
60
|
+
for (const { type, callback } of listeners) {
|
|
61
|
+
if (type === event.type) callback(event.payload);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (data.type === "response" && data.commandId) {
|
|
65
|
+
const pendingCommand = pendingCommands[data.commandId];
|
|
66
|
+
if (pendingCommand) {
|
|
67
|
+
pendingCommand.resolve(data.result);
|
|
68
|
+
delete pendingCommands[data.commandId];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
console.error("Desktop SDK: Unexpected payload:", data);
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.error("Desktop SDK: Failed to parse incoming data:", err);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
proc.on('error', (error) => {
|
|
80
|
+
console.error(`Desktop SDK: Process error: ${error.message}`);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
proc.on('close', (code) => {
|
|
84
|
+
console.error(`Desktop SDK: Process exited with code ${code}. Restarting...`);
|
|
85
|
+
startProcess();
|
|
86
|
+
|
|
87
|
+
for (const { type, callback } of listeners) {
|
|
88
|
+
if (type === 'error')
|
|
89
|
+
callback({
|
|
90
|
+
type: "crash",
|
|
91
|
+
message: "The Desktop SDK server process crashed and has restarted."
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function sendJSON(obj) {
|
|
98
|
+
if (proc && proc.stdin) {
|
|
99
|
+
proc.stdin.write(JSON.stringify(obj) + "\n");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
30
103
|
function init(options) {
|
|
31
104
|
let { api_url, dev } = options;
|
|
32
|
-
|
|
33
105
|
if (!dev && (!api_url || !api_url.startsWith("https"))) {
|
|
34
106
|
throw new Error(`api_url must be an https url, got: ${api_url}`);
|
|
35
107
|
}
|
|
36
|
-
|
|
37
|
-
|
|
108
|
+
sendJSON({
|
|
109
|
+
command: "init",
|
|
110
|
+
config: JSON.stringify(options)
|
|
111
|
+
});
|
|
38
112
|
}
|
|
39
113
|
|
|
40
114
|
function startRecording(config) {
|
|
41
|
-
|
|
115
|
+
sendJSON({ command: "startRecording", config: JSON.stringify(config) });
|
|
42
116
|
}
|
|
43
117
|
|
|
44
118
|
function stopRecording({ windowId }) {
|
|
45
|
-
|
|
119
|
+
sendJSON({
|
|
120
|
+
command: "stopRecording",
|
|
121
|
+
windowId
|
|
122
|
+
});
|
|
46
123
|
}
|
|
47
124
|
|
|
48
125
|
function uploadRecording({ windowId }) {
|
|
49
|
-
|
|
126
|
+
sendJSON({
|
|
127
|
+
command: "uploadRecording",
|
|
128
|
+
windowId
|
|
129
|
+
});
|
|
50
130
|
}
|
|
51
131
|
|
|
52
132
|
function prepareDesktopAudioRecording() {
|
|
53
|
-
return
|
|
133
|
+
return new Promise((resolve, reject) => {
|
|
134
|
+
let commandId = uuidv4();
|
|
135
|
+
pendingCommands[commandId] = { resolve, reject };
|
|
136
|
+
sendJSON({
|
|
137
|
+
command: "prepareDesktopAudioRecording",
|
|
138
|
+
commandId
|
|
139
|
+
});
|
|
140
|
+
});
|
|
54
141
|
}
|
|
55
142
|
|
|
56
143
|
function addEventListener(type, callback) {
|
|
57
|
-
|
|
58
|
-
let obj = JSON.parse(eventJson);
|
|
59
|
-
if (obj.type === type)
|
|
60
|
-
callback(obj.payload);
|
|
61
|
-
});
|
|
144
|
+
listeners.push({ type, callback });
|
|
62
145
|
}
|
|
63
146
|
|
|
147
|
+
// Start the process initially
|
|
148
|
+
startProcess();
|
|
149
|
+
|
|
64
150
|
module.exports = {
|
|
65
151
|
init,
|
|
66
152
|
addEventListener,
|
|
67
153
|
startRecording,
|
|
68
154
|
stopRecording,
|
|
69
155
|
uploadRecording,
|
|
70
|
-
prepareDesktopAudioRecording
|
|
156
|
+
prepareDesktopAudioRecording,
|
|
71
157
|
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"scripts": {
|
|
14
|
-
"make-prebuilds": "prebuildify -t v22.9.0 --napi",
|
|
15
|
-
"build": "node-gyp configure build",
|
|
16
|
-
"install": "./unpack-framework.sh && node-gyp-build"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"prebuildify": "^6.0.1"
|
|
20
|
-
}
|
|
2
|
+
"name": "@recallai/desktop-sdk",
|
|
3
|
+
"version": "2025.03.10-1bc3e77db2432fdba486ca1ae026ab23db716966",
|
|
4
|
+
"description": "Recall Desktop SDK (Alpha)",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"uuid": "^11.1.0"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"install": "./unpack-frameworks.sh"
|
|
12
|
+
}
|
|
21
13
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -x
|
|
4
|
+
|
|
5
|
+
if [[ ! -z "$RECALL_LOCAL_BUILD" ]]; then
|
|
6
|
+
echo "Recalling local build, skipping framework unpacking"
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
mkdir -p Frameworks
|
|
11
|
+
|
|
12
|
+
pushd Frameworks
|
|
13
|
+
tar xvf ../desktop_sdk_macos_frameworks.tar
|
|
14
|
+
popd
|
|
15
|
+
|
|
16
|
+
rm desktop_sdk_macos_frameworks.tar
|
|
Binary file
|
package/unpack-framework.sh
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
|
|
5
|
-
if [[ ! -z "$RECALL_LOCAL_BUILD" ]]; then
|
|
6
|
-
echo "Recalling local build, skipping framework unpacking"
|
|
7
|
-
exit 0
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
mkdir -p desktop_sdk_macos.framework
|
|
11
|
-
|
|
12
|
-
pushd desktop_sdk_macos.framework
|
|
13
|
-
tar xvf ../desktop_sdk_macos.framework.tar
|
|
14
|
-
popd
|
|
15
|
-
|
|
16
|
-
rm desktop_sdk_macos.framework.tar
|