MCPcopy
hub / github.com/cursor/community-plugins / archiveSizeGuard

Function archiveSizeGuard

apps/cursor/src/lib/plugins/scan.ts:334–354  ·  view source on GitHub ↗
(tag: string)

Source from the content-addressed store, hash-verified

332}
333
334function archiveSizeGuard(tag: string) {
335 let downloaded = 0;
336 return new Transform({
337 transform(chunk: Buffer, _encoding, callback) {
338 downloaded += chunk.length;
339 if (downloaded > REPO_ARCHIVE_MAX_BYTES) {
340 callback(
341 new UnscannableRepoError(
342 `Repository archive exceeded the ${REPO_ARCHIVE_MAX_BYTES}-byte scan limit.`,
343 ),
344 );
345 return;
346 }
347 callback(null, chunk);
348 },
349 final(callback) {
350 logInfo(tag, "GitHub archive download complete", { downloaded });
351 callback();
352 },
353 });
354}
355
356async function cloneRepo(
357 owner: string,

Callers 1

cloneRepoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected