@siftd/connect-agent 0.2.2 → 0.2.3
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/dist/heartbeat.js +1 -1
- package/dist/websocket.d.ts +1 -1
- package/dist/websocket.js +3 -0
- package/package.json +1 -1
package/dist/heartbeat.js
CHANGED
|
@@ -10,7 +10,7 @@ import { hostname } from 'os';
|
|
|
10
10
|
import { createHash } from 'crypto';
|
|
11
11
|
import { getServerUrl, getAgentToken, getUserId, isCloudMode } from './config.js';
|
|
12
12
|
const HEARTBEAT_INTERVAL = 10000; // 10 seconds
|
|
13
|
-
const VERSION = '0.2.
|
|
13
|
+
const VERSION = '0.2.3'; // Should match package.json
|
|
14
14
|
const state = {
|
|
15
15
|
intervalId: null,
|
|
16
16
|
runnerId: null,
|
package/dist/websocket.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export type MessageHandler = (message: WebSocketMessage) => Promise<void>;
|
|
10
10
|
export type StreamHandler = (chunk: string) => void;
|
|
11
11
|
export interface WebSocketMessage {
|
|
12
|
-
type: 'message' | 'interrupt' | 'ping' | 'connected';
|
|
12
|
+
type: 'message' | 'interrupt' | 'ping' | 'pong' | 'connected';
|
|
13
13
|
id?: string;
|
|
14
14
|
content?: string;
|
|
15
15
|
timestamp?: number;
|
package/dist/websocket.js
CHANGED
|
@@ -184,6 +184,9 @@ export class AgentWebSocket {
|
|
|
184
184
|
case 'ping':
|
|
185
185
|
this.sendToServer({ type: 'pong' });
|
|
186
186
|
break;
|
|
187
|
+
case 'pong':
|
|
188
|
+
// Expected response to our ping, ignore silently
|
|
189
|
+
break;
|
|
187
190
|
case 'connected':
|
|
188
191
|
console.log('[WS] Server confirmed connection');
|
|
189
192
|
break;
|