MCPcopy Create free account
hub / github.com/modem-dev/hunk / postSessionApi

Function postSessionApi

scripts/daemon-memory-check.ts:405–418  ·  view source on GitHub ↗
(port: number, body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

403}
404
405async function postSessionApi(port: number, body: Record<string, unknown>) {
406 const response = await fetch(`http://127.0.0.1:${port}${HUNK_SESSION_API_PATH}`, {
407 method: "POST",
408 headers: { "content-type": "application/json" },
409 body: JSON.stringify(body),
410 });
411
412 if (!response.ok) {
413 throw new Error(
414 `Session API ${body.action} failed: ${response.status} ${await response.text()}`,
415 );
416 }
417 await response.arrayBuffer();
418}
419
420async function exerciseSessionApi(port: number, sessionIds: string[], requests: number) {
421 const actions = ["list", "context", "review", "comment-list"] as const;

Callers 1

exerciseSessionApiFunction · 0.85

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected