@recallai/desktop-sdk 2025.3.10-1bc3e77db2432fdba486ca1ae026ab23db716966 → 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.
- package/desktop_sdk_macos_exe +0 -0
- package/desktop_sdk_macos_frameworks.tar +0 -0
- package/index.js +25 -15
- package/package.json +1 -1
package/desktop_sdk_macos_exe
CHANGED
|
Binary file
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -39,6 +39,7 @@ const pendingCommands = {};
|
|
|
39
39
|
function startProcess() {
|
|
40
40
|
proc = spawn(exe_path, { stdio: ['pipe', 'pipe', 'pipe', 'pipe'] });
|
|
41
41
|
const extraStream = proc.stdio[3];
|
|
42
|
+
|
|
42
43
|
const rl = readline.createInterface({ input: extraStream, crlfDelay: Infinity });
|
|
43
44
|
const rlStdout = readline.createInterface({ input: proc.stdout, crlfDelay: Infinity });
|
|
44
45
|
const rlStderr = readline.createInterface({ input: proc.stderr, crlfDelay: Infinity });
|
|
@@ -55,21 +56,30 @@ function startProcess() {
|
|
|
55
56
|
try {
|
|
56
57
|
const data = JSON.parse(line);
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
pendingCommand
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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;
|
|
73
83
|
}
|
|
74
84
|
} catch (err) {
|
|
75
85
|
console.error("Desktop SDK: Failed to parse incoming data:", err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recallai/desktop-sdk",
|
|
3
|
-
"version": "2025.03.
|
|
3
|
+
"version": "2025.03.11-4760e126f4114e4e2e43e81c97c69fe2f8aa9d70",
|
|
4
4
|
"description": "Recall Desktop SDK (Alpha)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|