MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / jsonFrom

Function jsonFrom

e2e/src/surfaces/mcp.ts:212–221  ·  view source on GitHub ↗
(response: Response, label: string)

Source from the content-addressed store, hash-verified

210}
211
212const jsonFrom = async <T>(response: Response, label: string): Promise<T> => {
213 const text = await response.text();
214 if (!text) {
215 throw new Error(`${label}: empty response body (status ${response.status})`);
216 }
217 if (!response.ok) {
218 throw new Error(`${label}: request failed (status ${response.status}): ${text}`);
219 }
220 return JSON.parse(text) as T;
221};
222
223const mintBearerFlow = async (target: Target, email: string): Promise<string> => {
224 const consent = target.mcpConsent?.({

Callers

nothing calls this directly

Calls 1

textMethod · 0.65

Tested by

no test coverage detected