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

Function sideBand

e2e/scenarios/custom-tools.test.ts:36–47  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

34const FLUSH = textEncoder.encode("0000");
35
36const sideBand = (bytes: Uint8Array): Uint8Array => {
37 const chunks: Uint8Array[] = [pktLine("NAK\n")];
38 for (let offset = 0; offset < bytes.length; offset += 60_000) {
39 const chunk = bytes.subarray(offset, offset + 60_000);
40 const payload = new Uint8Array(chunk.length + 1);
41 payload[0] = 1;
42 payload.set(chunk, 1);
43 chunks.push(pktLine(payload));
44 }
45 chunks.push(FLUSH);
46 return concat(chunks);
47};
48
49const advertisement = (sha: string): Uint8Array =>
50 concat([

Callers 1

Calls 4

setMethod · 0.80
pushMethod · 0.80
pktLineFunction · 0.70
concatFunction · 0.70

Tested by

no test coverage detected