MCPcopy Create free account
hub / github.com/codeaashu/claude-code / register

Method register

src/server/web/session-store.ts:53–67  ·  view source on GitHub ↗

* Register a newly spawned PTY under a fresh session token. * @param userId - ID of the owning user (defaults to "default" for single-user deployments).

(pty: IPty, userId = "default")

Source from the content-addressed store, hash-verified

51 * @param userId - ID of the owning user (defaults to "default" for single-user deployments).
52 */
53 register(pty: IPty, userId = "default"): StoredSession {
54 const token = crypto.randomUUID();
55 const session: StoredSession = {
56 token,
57 userId,
58 pty,
59 scrollback: new ScrollbackBuffer(this.scrollbackBytes),
60 ws: null,
61 createdAt: new Date(),
62 lastActive: new Date(),
63 graceTimer: null,
64 };
65 this.sessions.set(token, session);
66 return session;
67 }
68
69 get(token: string): StoredSession | undefined {
70 return this.sessions.get(token);

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected