| 30 | }); |
| 31 | |
| 32 | const requestFor = (method: "GET" | "POST", sessionId: string, authenticated = true): Request => |
| 33 | new Request("https://executor.test/mcp", { |
| 34 | method, |
| 35 | headers: { |
| 36 | ...(authenticated ? { authorization: "Bearer test" } : {}), |
| 37 | "mcp-session-id": sessionId, |
| 38 | ...(method === "POST" ? { "content-type": "application/json" } : {}), |
| 39 | }, |
| 40 | ...(method === "POST" |
| 41 | ? { |
| 42 | body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/list", params: {} }), |
| 43 | } |
| 44 | : {}), |
| 45 | }); |
| 46 | |
| 47 | const makeHarness = (owner: "not_found" | "terminated" = "not_found") => { |
| 48 | const ownerChecks = { count: 0 }; |