MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / write

Function write

ui/src/lib/adapter.ts:344–355  ·  view source on GitHub ↗

A write: the marker header, and a JSON body when there is one to send.

(path: string, method: string, body?: unknown, signal?: AbortSignal)

Source from the content-addressed store, hash-verified

342
343 /** A write: the marker header, and a JSON body when there is one to send. */
344 function write<T>(path: string, method: string, body?: unknown, signal?: AbortSignal): Promise<T> {
345 const headers: Record<string, string> = {
346 accept: 'application/json',
347 [WRITE_HEADER]: '1',
348 };
349 if (body !== undefined) headers['content-type'] = 'application/json';
350 return call<T>(
351 path,
352 { method, headers, ...(body === undefined ? {} : { body: JSON.stringify(body) }) },
353 signal
354 );
355 }
356
357 return {
358 stats: (signal) => getJson<WireStats>('api/stats', signal),

Callers 1

createHttpAdapterFunction · 0.70

Calls 1

callFunction · 0.70

Tested by

no test coverage detected