@recallai/desktop-sdk 2025.7.7-1c83dd6a1ab8d86561f53873bf7f654ed1b9f2cf → 2025.7.7-f204539e896e9b2cb79d5ba7269eb4c589f5407b
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/index.js +19 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -37,11 +37,13 @@ function flushLogBuffer() {
|
|
|
37
37
|
logBuffer = [];
|
|
38
38
|
logIndex = 0;
|
|
39
39
|
|
|
40
|
-
for (const idx in buf)
|
|
41
|
-
|
|
40
|
+
for (const idx in buf) {
|
|
41
|
+
const { level, log, echo } = buf[idx];
|
|
42
|
+
doLog(level, [log], echo);
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
async function doLog(level, log) {
|
|
46
|
+
async function doLog(level, log, echo = true) {
|
|
45
47
|
try {
|
|
46
48
|
const levelMap = {
|
|
47
49
|
"info": "log",
|
|
@@ -49,11 +51,13 @@ async function doLog(level, log) {
|
|
|
49
51
|
"error": "error"
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
if (echo)
|
|
55
|
+
console[levelMap[level] ?? "log"](...log);
|
|
53
56
|
|
|
54
57
|
let logPayload = {
|
|
55
58
|
log: log.join(" "),
|
|
56
|
-
level: level
|
|
59
|
+
level: level,
|
|
60
|
+
echo
|
|
57
61
|
};
|
|
58
62
|
|
|
59
63
|
let idx = logIndex++;
|
|
@@ -82,6 +86,10 @@ function logError(...log) {
|
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
function emitEvent(type, payload) {
|
|
89
|
+
if (type !== "upload-progress" && type !== "realtime-event") {
|
|
90
|
+
doLog("info", ["Receiving event: " + type + " | " + JSON.stringify(payload)], false);
|
|
91
|
+
}
|
|
92
|
+
|
|
85
93
|
for (const listener of listeners) {
|
|
86
94
|
if (listener.type === type)
|
|
87
95
|
listener.callback(payload);
|
|
@@ -220,7 +228,12 @@ function sendCommand(command, params = {}) {
|
|
|
220
228
|
params
|
|
221
229
|
};
|
|
222
230
|
|
|
223
|
-
|
|
231
|
+
let payloadStr = JSON.stringify(payload);
|
|
232
|
+
proc.stdin.write(payloadStr + "\n");
|
|
233
|
+
|
|
234
|
+
if (command !== "log") {
|
|
235
|
+
doLog("info", ["Sending command: " + payloadStr], false);
|
|
236
|
+
}
|
|
224
237
|
});
|
|
225
238
|
}
|
|
226
239
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recallai/desktop-sdk",
|
|
3
|
-
"version": "2025.07.07-
|
|
3
|
+
"version": "2025.07.07-f204539e896e9b2cb79d5ba7269eb4c589f5407b",
|
|
4
4
|
"description": "Recall Desktop SDK (Alpha)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|