Enforce session workspace boundaries

This commit is contained in:
武阳
2026-05-08 17:09:07 +08:00
parent 5b14f55736
commit 0bbba2b936
13 changed files with 509 additions and 52 deletions
+16
View File
@@ -110,6 +110,22 @@ export function accountSessionOutputRoot(accountId: string, sessionId: string) {
return path.join(accountBaseRoot(accountId), "sessions", sessionId, "output");
}
export function accountSessionScratchpadRoot(
accountId: string,
sessionId: string,
) {
return path.join(
accountBaseRoot(accountId),
"sessions",
sessionId,
"scratchpad",
);
}
export function accountSessionRoot(accountId: string, sessionId: string) {
return path.join(accountBaseRoot(accountId), "sessions", sessionId);
}
async function createSession(account: UserRecord) {
const token = randomBytes(32).toString("hex");
const sessionsFile = await readSessions();