@cjhyy/code-shell-server 0.9.17 → 0.9.19
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.
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class PendingMobileApprovals {
|
|
9
9
|
private readonly bySession;
|
|
10
|
+
private workerGeneration;
|
|
11
|
+
/** Requests belong to the worker that can answer them, never its successor. */
|
|
12
|
+
setWorkerState(generation: number, alive: boolean): void;
|
|
10
13
|
observeOutboundLine(line: string): void;
|
|
11
14
|
resolve(requestId: string): void;
|
|
12
15
|
replayLines(sessionId: string): string[];
|
|
16
|
+
/** The desktop has a queue across sessions; return only its current pending requests. */
|
|
17
|
+
replayAllLines(): string[];
|
|
13
18
|
forgetSession(sessionId: string): void;
|
|
14
19
|
}
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export class PendingMobileApprovals {
|
|
9
9
|
bySession = new Map();
|
|
10
|
+
workerGeneration;
|
|
11
|
+
/** Requests belong to the worker that can answer them, never its successor. */
|
|
12
|
+
setWorkerState(generation, alive) {
|
|
13
|
+
if (!alive || this.workerGeneration !== generation)
|
|
14
|
+
this.bySession.clear();
|
|
15
|
+
this.workerGeneration = generation;
|
|
16
|
+
}
|
|
10
17
|
observeOutboundLine(line) {
|
|
11
18
|
let msg;
|
|
12
19
|
try {
|
|
@@ -50,6 +57,10 @@ export class PendingMobileApprovals {
|
|
|
50
57
|
replayLines(sessionId) {
|
|
51
58
|
return [...(this.bySession.get(sessionId)?.values() ?? [])];
|
|
52
59
|
}
|
|
60
|
+
/** The desktop has a queue across sessions; return only its current pending requests. */
|
|
61
|
+
replayAllLines() {
|
|
62
|
+
return [...this.bySession.values()].flatMap((pending) => [...pending.values()]);
|
|
63
|
+
}
|
|
53
64
|
forgetSession(sessionId) {
|
|
54
65
|
this.bySession.delete(sessionId);
|
|
55
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhyy/code-shell-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.19",
|
|
4
4
|
"description": "CodeShell server transport layer — mobile remote HTTP/WS host, pairing, passcode gate, tunnel, rooms, uploads, and session/attachment services. Electron-free; precursor of the auth gateway.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@cjhyy/code-shell-capability-coding": "0.9.
|
|
55
|
-
"@cjhyy/code-shell-core": "0.9.
|
|
56
|
-
"@cjhyy/code-shell-web": "0.9.
|
|
54
|
+
"@cjhyy/code-shell-capability-coding": "0.9.19",
|
|
55
|
+
"@cjhyy/code-shell-core": "0.9.19",
|
|
56
|
+
"@cjhyy/code-shell-web": "0.9.19",
|
|
57
57
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
58
58
|
"@types/ws": "^8.18.1",
|
|
59
59
|
"ws": "^8.21.0",
|
|
60
|
-
"@cjhyy/code-shell-link": "0.9.
|
|
60
|
+
"@cjhyy/code-shell-link": "0.9.19"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20.10"
|