@kevisual/cnb 0.0.6 → 0.0.8
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/agent/routes/cnb-env/vscode.ts +2 -0
- package/agent/routes/index.ts +1 -1
- package/dist/keep.d.ts +43 -0
- package/dist/keep.js +2989 -0
- package/dist/opencode.js +7 -7
- package/package.json +7 -4
- package/src/keep.ts +1 -0
- package/src/workspace/keep-live.ts +181 -0
- /package/agent/routes/{user → cnb-env}/check.ts +0 -0
package/agent/routes/index.ts
CHANGED
package/dist/keep.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface KeepAliveConfig {
|
|
2
|
+
wsUrl: string;
|
|
3
|
+
cookie: string;
|
|
4
|
+
reconnectInterval?: number;
|
|
5
|
+
pingInterval?: number;
|
|
6
|
+
onMessage?: (data: Buffer | string) => void;
|
|
7
|
+
onConnect?: () => void;
|
|
8
|
+
onDisconnect?: (code: number) => void;
|
|
9
|
+
onError?: (error: Error) => void;
|
|
10
|
+
onSign?: (data: {
|
|
11
|
+
type: string;
|
|
12
|
+
data: string;
|
|
13
|
+
signedData: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface ParsedMessage {
|
|
18
|
+
type: string;
|
|
19
|
+
raw: Buffer;
|
|
20
|
+
payload?: any;
|
|
21
|
+
}
|
|
22
|
+
type MessageHandler = (msg: ParsedMessage) => void;
|
|
23
|
+
declare class WSKeepAlive {
|
|
24
|
+
private ws;
|
|
25
|
+
private config;
|
|
26
|
+
private reconnectAttempts;
|
|
27
|
+
private pingTimer;
|
|
28
|
+
private messageHandlers;
|
|
29
|
+
private url;
|
|
30
|
+
constructor(config: KeepAliveConfig);
|
|
31
|
+
private log;
|
|
32
|
+
private parseMessage;
|
|
33
|
+
connect(): void;
|
|
34
|
+
private startPing;
|
|
35
|
+
private stopPing;
|
|
36
|
+
private handleReconnect;
|
|
37
|
+
onMessage(handler: MessageHandler): () => boolean;
|
|
38
|
+
disconnect(): void;
|
|
39
|
+
}
|
|
40
|
+
declare function createKeepAlive(config: KeepAliveConfig): WSKeepAlive;
|
|
41
|
+
|
|
42
|
+
export { WSKeepAlive, createKeepAlive };
|
|
43
|
+
export type { KeepAliveConfig, ParsedMessage };
|