@kendoo.agentdesk/agentdesk 0.7.2 → 0.7.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/cli/daemon.mjs +7 -2
- package/package.json +1 -1
package/cli/daemon.mjs
CHANGED
|
@@ -232,10 +232,12 @@ export async function runDaemon() {
|
|
|
232
232
|
|
|
233
233
|
function connectWs() {
|
|
234
234
|
try {
|
|
235
|
+
console.log(` ${dim}Connecting to ${DAEMON_URL}...${reset}`);
|
|
235
236
|
ws = new WebSocket(DAEMON_URL);
|
|
236
237
|
|
|
237
238
|
ws.on("open", () => {
|
|
238
|
-
send(
|
|
239
|
+
// Send auth directly — send() requires connected=true which isn't set yet
|
|
240
|
+
ws.send(JSON.stringify({ type: "auth", apiKey }));
|
|
239
241
|
});
|
|
240
242
|
|
|
241
243
|
ws.on("message", (raw) => {
|
|
@@ -284,7 +286,10 @@ export async function runDaemon() {
|
|
|
284
286
|
}
|
|
285
287
|
});
|
|
286
288
|
|
|
287
|
-
ws.on("error", () => {
|
|
289
|
+
ws.on("error", (err) => {
|
|
290
|
+
connected = false;
|
|
291
|
+
console.log(` ${red}Connection error:${reset} ${err.message}`);
|
|
292
|
+
});
|
|
288
293
|
|
|
289
294
|
ws.on("close", (code) => {
|
|
290
295
|
connected = false;
|