{"record":{"id":"7eefdae660acfe69","repo":"paperclipai/paperclip","slug":"package-has-too-many-files-to-zip-entries-lengt","errorCode":null,"errorMessage":"Package has too many files to zip (${entries.length}; the zip format caps at ${ZIP_MAX_ENTRIES}).","messagePattern":"Package has too many files to zip \\((.+?); the zip format caps at (.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/zip.ts","lineNumber":55,"sourceCode":"    crc ^= byte;\n    for (let bit = 0; bit < 8; bit += 1) {\n      crc = (crc & 1) === 1 ? (crc >>> 1) ^ 0xedb88320 : crc >>> 1;\n    }\n  }\n  return (crc ^ 0xffffffff) >>> 0;\n}\n\n/**\n * Build a stored (uncompressed) zip of `files` under a single `rootPath/`\n * top-level directory — the layout `readZipArchive` folds back into the\n * inline `{ rootPath, files }` bundle. Entries are written in sorted path\n * order and carry no timestamps, so the same content always produces the\n * same bytes and a re-run resumes its content-addressed transfer.\n */\nexport function createStoredZipArchive(files: Record<string, Uint8Array>, rootPath: string): Uint8Array {\n  const entries = Object.entries(files).sort(([left], [right]) => left.localeCompare(right));\n  if (entries.length > ZIP_MAX_ENTRIES) {\n    throw new Error(`Package has too many files to zip (${entries.length}; the zip format caps at ${ZIP_MAX_ENTRIES}).`);\n  }\n  const encoder = new TextEncoder();\n  const localChunks: Uint8Array[] = [];\n  const centralChunks: Uint8Array[] = [];\n  let localOffset = 0;\n\n  for (const [relativePath, body] of entries) {\n    const fileName = encoder.encode(`${rootPath}/${relativePath}`);\n    const checksum = crc32(body);\n\n    const localHeader = new Uint8Array(30 + fileName.length);\n    writeUint32(localHeader, 0, 0x04034b50);\n    writeUint16(localHeader, 4, 20);\n    writeUint16(localHeader, 6, 0x0800);\n    writeUint16(localHeader, 8, 0);\n    writeUint32(localHeader, 14, checksum);\n    writeUint32(localHeader, 18, body.length);\n    writeUint32(localHeader, 22, body.length);","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/zip.ts#L37-L73","documentation":"createStoredZipArchive counts entries against the zip format's hard entry limit; too many files means the package cannot be represented as a single non-zip64 archive.","triggerScenarios":"Thrown at cli/src/commands/client/zip.ts:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of files in the package below the zip entry cap."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}