(token: string, browser = false)
| 73 | ); |
| 74 | |
| 75 | const initSession = async (token: string, browser = false): Promise<string> => { |
| 76 | const res = await mcp( |
| 77 | token, |
| 78 | { |
| 79 | jsonrpc: "2.0", |
| 80 | id: 1, |
| 81 | method: "initialize", |
| 82 | params: { |
| 83 | protocolVersion: "2025-03-26", |
| 84 | capabilities: {}, |
| 85 | clientInfo: { name: "t", version: "1" }, |
| 86 | }, |
| 87 | }, |
| 88 | undefined, |
| 89 | browser, |
| 90 | ); |
| 91 | expect(res.status).toBe(200); |
| 92 | expect(res.headers.get("content-type")).toContain("application/json"); |
| 93 | const sessionId = res.headers.get("mcp-session-id") ?? ""; |
| 94 | expect(sessionId).not.toBe(""); |
| 95 | await res.text(); |
| 96 | await mcp(token, { jsonrpc: "2.0", method: "notifications/initialized" }, sessionId, browser); |
| 97 | return sessionId; |
| 98 | }; |
| 99 | |
| 100 | const account = (token: string, path: string, init?: RequestInit) => |
| 101 | handler( |
no test coverage detected