@cjhyy/code-shell-server 0.9.38 → 0.9.39

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.
@@ -6,6 +6,8 @@ import { markAttachmentsSent, stageFileBytes, stageImageBytes, } from "../attach
6
6
  const MAX_BYTES = 20 * 1024 * 1024;
7
7
  const TTL_MS = 15 * 60 * 1000;
8
8
  const SAFE_ID = /^[a-zA-Z0-9_-]{8,80}$/;
9
+ // Match the session/history boundary so existing dotted session IDs can attach files.
10
+ const SAFE_SESSION_ID = /^(?!.*\.\.)[A-Za-z0-9_-][A-Za-z0-9_.-]{0,127}$/;
9
11
  const emptyUploads = () => ({
10
12
  attachments: [],
11
13
  commit: async () => { },
@@ -150,7 +152,7 @@ export class HubUploads {
150
152
  }
151
153
  if (!ids.length)
152
154
  return emptyUploads();
153
- if (typeof sessionId !== "string" || !/^[a-zA-Z0-9_-]{1,128}$/.test(sessionId)) {
155
+ if (typeof sessionId !== "string" || !SAFE_SESSION_ID.test(sessionId)) {
154
156
  throw new Error("valid sessionId required for attachments");
155
157
  }
156
158
  const records = ids.map((id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell-server",
3
- "version": "0.9.38",
3
+ "version": "0.9.39",
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",
@@ -61,13 +61,13 @@
61
61
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
62
62
  },
63
63
  "dependencies": {
64
- "@cjhyy/code-shell-capability-coding": "0.9.38",
65
- "@cjhyy/code-shell-core": "0.9.38",
66
- "@cjhyy/code-shell-web": "0.9.38",
64
+ "@cjhyy/code-shell-capability-coding": "0.9.39",
65
+ "@cjhyy/code-shell-core": "0.9.39",
66
+ "@cjhyy/code-shell-web": "0.9.39",
67
67
  "@modelcontextprotocol/sdk": "^1.31.0",
68
68
  "@types/ws": "^8.18.1",
69
69
  "ws": "^8.21.0",
70
- "@cjhyy/code-shell-link": "0.9.38"
70
+ "@cjhyy/code-shell-link": "0.9.39"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=20.10"