Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/server/src/git-http.ts?version=258&format=json
58 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 178, 1 version changed it

You're reading version 258. The newest is 318, and no version since then changed this file. Go to the newestCompare with 318

1import type { HttpClient } from "isomorphic-git";
2
3/** Stream Git HTTP request chunks without a second complete upload buffer. */
4export function gitHttp(fetcher: typeof fetch = fetch): HttpClient {
5 return {
6 async request({ url, method = "GET", headers = {}, body, signal, fetchOptions = {} }) {
7 const input = body as AsyncIterable<Uint8Array> | Iterable<Uint8Array> | undefined;
8 const iterator = input
9 ? Symbol.asyncIterator in input
10 ? input[Symbol.asyncIterator]()
11 : input[Symbol.iterator]()
12 : undefined;
13 const stream = iterator
14 ? new ReadableStream<Uint8Array>(
15 {
16 async pull(controller) {
17 try {
18 const next = await iterator.next();
19 if (next.done) controller.close();
20 else controller.enqueue(next.value);
21 } catch (error) {
22 controller.error(error);
23 }
24 },
25 async cancel() {
26 await iterator.return?.();
27 },
28 },
29 { highWaterMark: 0 },
30 )
31 : undefined;
32 let response: Response;
33 try {
34 const options: RequestInit & { duplex?: string } = {
35 ...fetchOptions,
36 method,
37 headers,
38 body: stream,
39 signal: signal ?? fetchOptions.signal,
40 ...(stream ? { duplex: "half" } : {}),
41 };
42 response = await fetcher(url, options);
43 } catch (error) {
44 await iterator?.return?.();
45 throw error;
46 }
47 const responseBody = response.body;
48 return {
49 url: response.url,
50 method,
51 statusCode: response.status,
52 statusMessage: response.statusText,
53 headers: Object.fromEntries(response.headers.entries()),
54 body: responseBody ? responseBody[Symbol.asyncIterator]() : (async function* () {})(),
55 };
56 },
57 };