MCPcopy Create free account
hub / github.com/benjitaylor/agentation / createSession

Function createSession

package/src/utils/sync.ts:26–41  ·  view source on GitHub ↗
(
  endpoint: string,
  url: string
)

Source from the content-addressed store, hash-verified

24 * Create a new session on the server.
25 */
26export async function createSession(
27 endpoint: string,
28 url: string
29): Promise<Session> {
30 const response = await fetch(`${endpoint}/sessions`, {
31 method: "POST",
32 headers: { "Content-Type": "application/json" },
33 body: JSON.stringify({ url }),
34 });
35
36 if (!response.ok) {
37 throw new Error(`Failed to create session: ${response.status}`);
38 }
39
40 return response.json();
41}
42
43/**
44 * Get an existing session with its annotations.

Callers 2

initSessionFunction · 0.90
syncLocalAnnotationsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…