MCPcopy
hub / github.com/benjitaylor/agentation / createSession

Function createSession

mcp/src/server/sqlite.ts:329–351  ·  view source on GitHub ↗
(url: string, projectId?: string)

Source from the content-addressed store, hash-verified

327 return {
328 // Sessions
329 createSession(url: string, projectId?: string): Session {
330 const session: Session = {
331 id: generateId(),
332 url,
333 status: "active",
334 createdAt: new Date().toISOString(),
335 projectId,
336 };
337
338 stmts.insertSession.run({
339 id: session.id,
340 url: session.url,
341 status: session.status,
342 createdAt: session.createdAt,
343 projectId: session.projectId ?? null,
344 metadata: null,
345 });
346
347 const event = eventBus.emit("session.created", session.id, session);
348 persistEvent(event);
349
350 return session;
351 },
352
353 getSession(id: string): Session | undefined {
354 const row = stmts.getSession.get(id) as Record<string, unknown> | undefined;

Callers

nothing calls this directly

Calls 3

persistEventFunction · 0.85
emitMethod · 0.80
generateIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…