@recallai/desktop-sdk 2025.3.10-c18606cef6870cb32f0a93f033607151e239d235 → 2025.3.11-4760e126f4114e4e2e43e81c97c69fe2f8aa9d70

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.
Binary file
package/index.d.ts CHANGED
@@ -34,7 +34,7 @@ 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
38
 
39
39
  export interface RecallAiSdkWindow {
40
40
  id: string;
package/index.js CHANGED
@@ -1,25 +1,28 @@
1
- const addon = require('node-gyp-build')(__dirname);
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,138 @@ 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
+
43
+ const rl = readline.createInterface({ input: extraStream, crlfDelay: Infinity });
44
+ const rlStdout = readline.createInterface({ input: proc.stdout, crlfDelay: Infinity });
45
+ const rlStderr = readline.createInterface({ input: proc.stderr, crlfDelay: Infinity });
46
+
47
+ rlStdout.on('line', (data) => {
48
+ if (process.env.RECALLAI_DESKTOP_SDK_DEV) console.log(data);
49
+ });
50
+
51
+ rlStderr.on('line', (data) => {
52
+ if (process.env.RECALLAI_DESKTOP_SDK_DEV) console.error(data);
53
+ });
54
+
55
+ rl.on('line', (line) => {
56
+ try {
57
+ const data = JSON.parse(line);
58
+
59
+ switch (data.type) {
60
+ case "event":
61
+ const event = JSON.parse(data.event);
62
+ for (const { type, callback } of listeners) {
63
+ if (type === event.type) callback(event.payload);
64
+ }
65
+ break;
66
+
67
+ case "response":
68
+ const pendingCommand = pendingCommands[data.commandId];
69
+ if (pendingCommand) {
70
+ pendingCommand.resolve(data.result);
71
+ delete pendingCommands[data.commandId];
72
+ }
73
+ break;
74
+ case "status":
75
+ const status = data.status;
76
+
77
+ if (status == "success")
78
+ break;
79
+ else if (status == "error")
80
+ console.error(`Desktop SDK: Error response from command. ${data.command} - ${data.status}`);
81
+
82
+ break;
83
+ }
84
+ } catch (err) {
85
+ console.error("Desktop SDK: Failed to parse incoming data:", err);
86
+ }
87
+ });
88
+
89
+ proc.on('error', (error) => {
90
+ console.error(`Desktop SDK: Process error: ${error.message}`);
91
+ });
92
+
93
+ proc.on('close', (code) => {
94
+ console.error(`Desktop SDK: Process exited with code ${code}. Restarting...`);
95
+ startProcess();
96
+
97
+ for (const { type, callback } of listeners) {
98
+ if (type === 'error')
99
+ callback({
100
+ type: "crash",
101
+ message: "The Desktop SDK server process crashed and has restarted."
102
+ });
103
+ }
104
+ });
105
+ }
106
+
107
+ function sendJSON(obj) {
108
+ if (proc && proc.stdin) {
109
+ proc.stdin.write(JSON.stringify(obj) + "\n");
110
+ }
111
+ }
112
+
30
113
  function init(options) {
31
114
  let { api_url, dev } = options;
32
-
33
115
  if (!dev && (!api_url || !api_url.startsWith("https"))) {
34
116
  throw new Error(`api_url must be an https url, got: ${api_url}`);
35
117
  }
36
-
37
- addon.init(JSON.stringify(options));
118
+ sendJSON({
119
+ command: "init",
120
+ config: JSON.stringify(options)
121
+ });
38
122
  }
39
123
 
40
124
  function startRecording(config) {
41
- addon.start_recording(JSON.stringify(config));
125
+ sendJSON({ command: "startRecording", config: JSON.stringify(config) });
42
126
  }
43
127
 
44
128
  function stopRecording({ windowId }) {
45
- addon.stop_recording(windowId);
129
+ sendJSON({
130
+ command: "stopRecording",
131
+ windowId
132
+ });
46
133
  }
47
134
 
48
135
  function uploadRecording({ windowId }) {
49
- addon.upload_recording(windowId);
136
+ sendJSON({
137
+ command: "uploadRecording",
138
+ windowId
139
+ });
50
140
  }
51
141
 
52
142
  function prepareDesktopAudioRecording() {
53
- return addon.prepare_desktop_audio_recording();
143
+ return new Promise((resolve, reject) => {
144
+ let commandId = uuidv4();
145
+ pendingCommands[commandId] = { resolve, reject };
146
+ sendJSON({
147
+ command: "prepareDesktopAudioRecording",
148
+ commandId
149
+ });
150
+ });
54
151
  }
55
152
 
56
153
  function addEventListener(type, callback) {
57
- addon.callback((eventJson) => {
58
- let obj = JSON.parse(eventJson);
59
- if (obj.type === type)
60
- callback(obj.payload);
61
- });
154
+ listeners.push({ type, callback });
62
155
  }
63
156
 
157
+ // Start the process initially
158
+ startProcess();
159
+
64
160
  module.exports = {
65
161
  init,
66
162
  addEventListener,
67
163
  startRecording,
68
164
  stopRecording,
69
165
  uploadRecording,
70
- prepareDesktopAudioRecording
166
+ prepareDesktopAudioRecording,
71
167
  };
package/package.json CHANGED
@@ -1,21 +1,13 @@
1
1
  {
2
- "name": "@recallai/desktop-sdk",
3
- "version": "2025.03.10-c18606cef6870cb32f0a93f033607151e239d235",
4
- "description": "Recall Desktop SDK (Alpha)",
5
- "gypfile": true,
6
- "main": "./index.js",
7
- "types": "./index.d.ts",
8
- "dependencies": {
9
- "node-addon-api": "^7.1.0",
10
- "node-gyp": "^10.2.0",
11
- "node-gyp-build": "^4.8.2"
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.11-4760e126f4114e4e2e43e81c97c69fe2f8aa9d70",
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
@@ -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