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

Function exerciseSessionApi

scripts/daemon-memory-check.ts:420–438  ·  view source on GitHub ↗
(port: number, sessionIds: string[], requests: number)

Source from the content-addressed store, hash-verified

418}
419
420async function exerciseSessionApi(port: number, sessionIds: string[], requests: number) {
421 const actions = ["list", "context", "review", "comment-list"] as const;
422 for (let index = 0; index < requests; index += 1) {
423 const action = actions[index % actions.length];
424 const sessionId = sessionIds[index % sessionIds.length];
425 if (action === "list") {
426 await postSessionApi(port, { action });
427 } else if (action === "review") {
428 await postSessionApi(port, {
429 action,
430 selector: { sessionId },
431 includePatch: true,
432 includeNotes: true,
433 });
434 } else {
435 await postSessionApi(port, { action, selector: { sessionId } });
436 }
437 }
438}
439
440async function closeSockets(sockets: WebSocket[]) {
441 await Promise.all(

Callers 1

mainFunction · 0.85

Calls 1

postSessionApiFunction · 0.85

Tested by

no test coverage detected