@cjhyy/code-shell-server 0.8.12 → 0.8.13
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/sessions-service.js +6 -2
- package/package.json +4 -4
package/dist/sessions-service.js
CHANGED
|
@@ -7,9 +7,13 @@ import * as fs from "node:fs/promises";
|
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
const SAFE_ID = /^[A-Za-z0-9_.-]+$/;
|
|
9
9
|
const QUICK_CHAT_SESSION_PREFIX = "qchat-";
|
|
10
|
+
const PANEL_TASK_SESSION_PREFIX = "panel-task-";
|
|
10
11
|
function isQuickChatSessionId(id) {
|
|
11
12
|
return id.startsWith(QUICK_CHAT_SESSION_PREFIX);
|
|
12
13
|
}
|
|
14
|
+
function isInternalEphemeralSessionId(id) {
|
|
15
|
+
return isQuickChatSessionId(id) || id.startsWith(PANEL_TASK_SESSION_PREFIX);
|
|
16
|
+
}
|
|
13
17
|
export async function listSessions(baseDir = sessionsRoot()) {
|
|
14
18
|
try {
|
|
15
19
|
const entries = await fs.readdir(baseDir, { withFileTypes: true });
|
|
@@ -20,7 +24,7 @@ export async function listSessions(baseDir = sessionsRoot()) {
|
|
|
20
24
|
if (!e.name.endsWith(".jsonl") && !e.name.endsWith(".json"))
|
|
21
25
|
continue;
|
|
22
26
|
const id = e.name.replace(/\.jsonl?$/, "");
|
|
23
|
-
if (
|
|
27
|
+
if (isInternalEphemeralSessionId(id))
|
|
24
28
|
continue;
|
|
25
29
|
const full = path.join(baseDir, e.name);
|
|
26
30
|
try {
|
|
@@ -162,7 +166,7 @@ export async function listDiskSessions(opts, baseDir = sessionsRoot()) {
|
|
|
162
166
|
return { sessions: [], nextCursor: null };
|
|
163
167
|
throw e;
|
|
164
168
|
}
|
|
165
|
-
const candidates = entries.filter((e) => e.isDirectory() && SAFE_ID.test(e.name) && !
|
|
169
|
+
const candidates = entries.filter((e) => e.isDirectory() && SAFE_ID.test(e.name) && !isInternalEphemeralSessionId(e.name));
|
|
166
170
|
const stats = await Promise.all(candidates.map(async (e) => {
|
|
167
171
|
try {
|
|
168
172
|
return { id: e.name, mtime: (await fs.stat(path.join(baseDir, e.name))).mtimeMs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhyy/code-shell-server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
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",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@cjhyy/code-shell-capability-coding": "0.8.
|
|
43
|
-
"@cjhyy/code-shell-core": "0.8.
|
|
44
|
-
"@cjhyy/code-shell-web": "0.8.
|
|
42
|
+
"@cjhyy/code-shell-capability-coding": "0.8.13",
|
|
43
|
+
"@cjhyy/code-shell-core": "0.8.13",
|
|
44
|
+
"@cjhyy/code-shell-web": "0.8.13",
|
|
45
45
|
"@types/ws": "^8.18.1",
|
|
46
46
|
"ws": "^8.21.0"
|
|
47
47
|
},
|