@cjhyy/code-shell-server 0.9.27 → 0.9.28
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.
|
@@ -22,6 +22,7 @@ import { basename, dirname, extname, join, resolve } from "node:path";
|
|
|
22
22
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
23
23
|
import { WebSocketServer } from "ws";
|
|
24
24
|
import { SessionManager, SettingsManager } from "@cjhyy/code-shell-core";
|
|
25
|
+
import { readOutputJournal, readOutputJournalLegacyBase } from "@cjhyy/code-shell-core/internal";
|
|
25
26
|
import { AccessPasscode } from "../mobile-remote/access-passcode.js";
|
|
26
27
|
import { resolveSafe } from "../mobile-remote/mobile-static.js";
|
|
27
28
|
import { contentTypeFor } from "../static-files.js";
|
|
@@ -1134,7 +1135,7 @@ function replyToHostSessionQuery(message, sessionManager, workspaceCwd, isRunnin
|
|
|
1134
1135
|
result: { type: "sessions", data: sessions },
|
|
1135
1136
|
});
|
|
1136
1137
|
}
|
|
1137
|
-
if (queryType !== "session_detail")
|
|
1138
|
+
if (queryType !== "session_detail" && queryType !== "output_journal")
|
|
1138
1139
|
return undefined;
|
|
1139
1140
|
const sessionId = message.params?.sessionId;
|
|
1140
1141
|
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
@@ -1149,7 +1150,28 @@ function replyToHostSessionQuery(message, sessionManager, workspaceCwd, isRunnin
|
|
|
1149
1150
|
if (resolve(state.cwd) !== workspaceCwd) {
|
|
1150
1151
|
return hostQueryError(message.id, -32001, "Session not found in this workspace");
|
|
1151
1152
|
}
|
|
1152
|
-
|
|
1153
|
+
if (queryType === "output_journal") {
|
|
1154
|
+
const data = readOutputJournal(sessionManager.getStorageDir(), sessionId, {
|
|
1155
|
+
after: message.params?.after,
|
|
1156
|
+
through: message.params?.through,
|
|
1157
|
+
maxBytes: message.params?.maxBytes,
|
|
1158
|
+
maxFrames: message.params?.maxFrames,
|
|
1159
|
+
});
|
|
1160
|
+
return JSON.stringify({
|
|
1161
|
+
jsonrpc: "2.0",
|
|
1162
|
+
id: message.id,
|
|
1163
|
+
result: { type: "output_journal", data },
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
const journal = message.params?.outputRecovery === true
|
|
1167
|
+
? readOutputJournal(sessionManager.getStorageDir(), sessionId)
|
|
1168
|
+
: undefined;
|
|
1169
|
+
const legacy = journal && journal.status !== "unavailable"
|
|
1170
|
+
? readOutputJournalLegacyBase(sessionManager.getStorageDir(), sessionId, journal.legacyBaseThroughEventId)
|
|
1171
|
+
: undefined;
|
|
1172
|
+
const transcript = legacy
|
|
1173
|
+
? legacy.events
|
|
1174
|
+
: readHubTranscript(sessionManager.getStorageDir(), sessionId);
|
|
1153
1175
|
return JSON.stringify({
|
|
1154
1176
|
jsonrpc: "2.0",
|
|
1155
1177
|
id: message.id,
|
|
@@ -1157,6 +1179,7 @@ function replyToHostSessionQuery(message, sessionManager, workspaceCwd, isRunnin
|
|
|
1157
1179
|
type: "session_detail",
|
|
1158
1180
|
data: {
|
|
1159
1181
|
state,
|
|
1182
|
+
...(legacy ? { outputJournal: journal, legacyBaseComplete: legacy.complete } : {}),
|
|
1160
1183
|
...(runReplay ? runReplay.snapshot(sessionId, transcript) : { transcript }),
|
|
1161
1184
|
running: isRunning(sessionId),
|
|
1162
1185
|
},
|
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.28",
|
|
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",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cjhyy/code-shell-capability-coding": "0.9.
|
|
64
|
-
"@cjhyy/code-shell-core": "0.9.
|
|
65
|
-
"@cjhyy/code-shell-web": "0.9.
|
|
66
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
63
|
+
"@cjhyy/code-shell-capability-coding": "0.9.28",
|
|
64
|
+
"@cjhyy/code-shell-core": "0.9.28",
|
|
65
|
+
"@cjhyy/code-shell-web": "0.9.28",
|
|
66
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
67
67
|
"@types/ws": "^8.18.1",
|
|
68
68
|
"ws": "^8.21.0",
|
|
69
|
-
"@cjhyy/code-shell-link": "0.9.
|
|
69
|
+
"@cjhyy/code-shell-link": "0.9.28"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=20.10"
|