@innovatorved/code-lab 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +6 -6
  4. package/dist/code-lab-sql.esm.js +19 -19
  5. package/dist/code-lab-sql.umd.js +20 -20
  6. package/dist/code-lab.css +1 -1
  7. package/dist/code-lab.d.ts +47 -38
  8. package/dist/code-lab.esm.js +1183 -1909
  9. package/dist/code-lab.js +1182 -1906
  10. package/dist/extensions/cpp.esm.js +132 -8760
  11. package/dist/extensions/cpp.js +124 -8770
  12. package/dist/extensions/guided-lab.esm.js +33 -6836
  13. package/dist/extensions/guided-lab.js +33 -6854
  14. package/dist/extensions/javascript.esm.js +1 -36
  15. package/dist/extensions/javascript.js +1 -58
  16. package/dist/extensions/python.esm.js +113 -8122
  17. package/dist/extensions/python.js +113 -8140
  18. package/dist/extensions/typescript.esm.js +1 -55
  19. package/dist/extensions/typescript.js +1 -77
  20. package/dist/index.d.ts +1 -1
  21. package/dist/logger.d.ts +4 -20
  22. package/dist/modular-kernel.d.ts +0 -5
  23. package/dist/packages/core/src/errors.d.ts +5 -1
  24. package/dist/packages/fs/src/backends.d.ts +0 -27
  25. package/dist/packages/fs/src/index.d.ts +1 -1
  26. package/dist/packages/ui/src/html.d.ts +1 -0
  27. package/dist/packages/ui/src/index.d.ts +1 -0
  28. package/dist/{apps/web/src/index.d.ts → packages/ui/src/kernel.d.ts} +3 -11
  29. package/dist/packages/ui/src/observability.d.ts +1 -1
  30. package/dist/packages/ui/src/settings-dialog.d.ts +0 -1
  31. package/dist/preview-sw.js +1 -1
  32. package/dist/runtime.d.ts +3 -0
  33. package/dist/runtime.esm.js +78 -78
  34. package/dist/runtime.js +78 -78
  35. package/dist/schemas.d.ts +10 -1
  36. package/dist/schemas.esm.js +33 -6815
  37. package/dist/schemas.js +33 -6831
  38. package/dist/shell.esm.js +277 -285
  39. package/dist/shell.js +277 -285
  40. package/dist/terminal.esm.js +9 -7
  41. package/dist/terminal.js +7 -7
  42. package/dist/workbench/command-palette.d.ts +0 -4
  43. package/dist/workbench/editor.d.ts +0 -4
  44. package/dist/workbench/index.d.ts +0 -22
  45. package/dist/workbench/intellisense.d.ts +1 -8
  46. package/dist/workbench/xterm-adapter.d.ts +0 -1
  47. package/package.json +4 -13
  48. package/dist/code-lab.umd.js +0 -6117
  49. package/dist/packages/editor/src/index.d.ts +0 -118
  50. package/dist/packages/preview/src/index.d.ts +0 -34
  51. package/dist/packages/runtime/src/index.d.ts +0 -47
  52. package/dist/packages/terminal/src/index.d.ts +0 -54
  53. package/dist/workbench/drawer.d.ts +0 -18
  54. package/dist/workbench/file-tree.d.ts +0 -11
  55. package/dist/workbench/guided-pane.d.ts +0 -11
  56. package/dist/workbench/styles.d.ts +0 -4
  57. package/dist/workbench/toolbar.d.ts +0 -17
  58. package/packages/commands/README.md +0 -7
  59. package/packages/commands/package.json +0 -16
  60. package/packages/commands/src/index.ts +0 -467
  61. package/packages/commands/tsconfig.json +0 -22
  62. package/packages/core/README.md +0 -12
  63. package/packages/core/package.json +0 -13
  64. package/packages/core/src/di.ts +0 -147
  65. package/packages/core/src/disposable.ts +0 -112
  66. package/packages/core/src/errors.ts +0 -205
  67. package/packages/core/src/events.ts +0 -157
  68. package/packages/core/src/index.ts +0 -49
  69. package/packages/core/src/path.ts +0 -118
  70. package/packages/core/src/registry.ts +0 -61
  71. package/packages/core/tsconfig.json +0 -19
  72. package/packages/editor/README.md +0 -9
  73. package/packages/editor/package.json +0 -18
  74. package/packages/editor/src/index.ts +0 -344
  75. package/packages/editor/tsconfig.json +0 -24
  76. package/packages/fs/README.md +0 -7
  77. package/packages/fs/package.json +0 -16
  78. package/packages/fs/src/backends.ts +0 -301
  79. package/packages/fs/src/index.ts +0 -18
  80. package/packages/fs/src/types.ts +0 -44
  81. package/packages/fs/src/vfs-service.ts +0 -257
  82. package/packages/fs/tsconfig.json +0 -22
  83. package/packages/preview/README.md +0 -3
  84. package/packages/preview/package.json +0 -16
  85. package/packages/preview/src/index.ts +0 -125
  86. package/packages/preview/tsconfig.json +0 -22
  87. package/packages/runtime/README.md +0 -3
  88. package/packages/runtime/package.json +0 -17
  89. package/packages/runtime/src/index.ts +0 -134
  90. package/packages/runtime/tsconfig.json +0 -23
  91. package/packages/settings/README.md +0 -7
  92. package/packages/settings/package.json +0 -16
  93. package/packages/settings/src/builtin-schemas.ts +0 -262
  94. package/packages/settings/src/configuration-service.ts +0 -609
  95. package/packages/settings/src/index.ts +0 -38
  96. package/packages/settings/src/jsonc.ts +0 -189
  97. package/packages/settings/src/schema.ts +0 -164
  98. package/packages/settings/tsconfig.json +0 -22
  99. package/packages/sql/README.md +0 -12
  100. package/packages/sql/package.json +0 -13
  101. package/packages/sql/src/completions.ts +0 -359
  102. package/packages/sql/src/diagnostics.ts +0 -200
  103. package/packages/sql/src/formatter.ts +0 -271
  104. package/packages/sql/src/index.ts +0 -54
  105. package/packages/sql/src/sql-editor.ts +0 -802
  106. package/packages/sql/src/styles.ts +0 -524
  107. package/packages/sql/src/tokenizer.ts +0 -457
  108. package/packages/sql/src/types.ts +0 -148
  109. package/packages/sql/tsconfig.json +0 -19
  110. package/packages/terminal/README.md +0 -3
  111. package/packages/terminal/package.json +0 -16
  112. package/packages/terminal/src/index.ts +0 -183
  113. package/packages/terminal/tsconfig.json +0 -22
  114. package/packages/ui/README.md +0 -8
  115. package/packages/ui/package.json +0 -18
  116. package/packages/ui/src/index.ts +0 -40
  117. package/packages/ui/src/observability.ts +0 -173
  118. package/packages/ui/src/plugin-registry.ts +0 -289
  119. package/packages/ui/src/settings-dialog.ts +0 -939
  120. package/packages/ui/src/themes.ts +0 -333
  121. package/packages/ui/tsconfig.json +0 -24
  122. package/src/code-lab.css +0 -8584
  123. package/src/csp.ts +0 -590
  124. package/src/diagnostics.ts +0 -287
  125. package/src/extensions/cpp.ts +0 -2389
  126. package/src/extensions/guided-lab.ts +0 -64
  127. package/src/extensions/javascript.ts +0 -54
  128. package/src/extensions/python.ts +0 -1737
  129. package/src/extensions/typescript.ts +0 -85
  130. package/src/extensions/umbrella.ts +0 -5
  131. package/src/html.ts +0 -88
  132. package/src/index.ts +0 -129
  133. package/src/logger.ts +0 -139
  134. package/src/modular-kernel.ts +0 -11
  135. package/src/preview-sw.js +0 -296
  136. package/src/runtime/test-harness.ts +0 -57
  137. package/src/runtime.ts +0 -10480
  138. package/src/sample.html +0 -304
  139. package/src/schemas.ts +0 -366
  140. package/src/scm.ts +0 -2453
  141. package/src/search.ts +0 -433
  142. package/src/shell.ts +0 -10987
  143. package/src/storage.ts +0 -773
  144. package/src/terminal.ts +0 -1400
  145. package/src/workbench/command-palette.ts +0 -381
  146. package/src/workbench/diff-editor.ts +0 -470
  147. package/src/workbench/drawer.ts +0 -157
  148. package/src/workbench/editor.ts +0 -49
  149. package/src/workbench/file-tree.ts +0 -51
  150. package/src/workbench/guided-pane.ts +0 -43
  151. package/src/workbench/icons.ts +0 -255
  152. package/src/workbench/index.ts +0 -44
  153. package/src/workbench/intellisense.ts +0 -1871
  154. package/src/workbench/share.ts +0 -128
  155. package/src/workbench/styles.ts +0 -211
  156. package/src/workbench/toolbar.ts +0 -182
  157. package/src/workbench/xterm-adapter.ts +0 -1571
  158. package/src/workbench.ts +0 -22132
  159. package/src/zip.ts +0 -348
package/src/zip.ts DELETED
@@ -1,348 +0,0 @@
1
- /**
2
- * @innovatorved/code-lab — Zero-Dependency PKZip v2.0 Archive Engine
3
- * ============================================================================
4
- * Pure TypeScript implementation of PKZip 2.0 (Store method 0 + UTF-8 flag
5
- * bit 11 + IEEE 802.3 CRC32) for browser and Node/Bun project export & import.
6
- *
7
- * Includes built-in Zip-Slip path traversal sanitization and header integrity
8
- * verification.
9
- *
10
- * Strict leaf module: fully typed, zero explicit any, zero empty catches.
11
- */
12
-
13
- const LOCAL_FILE_HEADER_SIG = 0x04034b50;
14
- const CENTRAL_DIR_HEADER_SIG = 0x02014b50;
15
- const END_OF_CENTRAL_DIR_SIG = 0x06054b50;
16
- const UTF8_FLAG = 0x0800;
17
-
18
- /** Precomputed IEEE 802.3 CRC32 lookup table. */
19
- const CRC32_TABLE = new Uint32Array(256);
20
- for (let i = 0; i < 256; i++) {
21
- let c = i;
22
- for (let k = 0; k < 8; k++) {
23
- c = (c & 1) !== 0 ? (0xedb88320 ^ (c >>> 1)) : (c >>> 1);
24
- }
25
- CRC32_TABLE[i] = c >>> 0;
26
- }
27
-
28
- const textEncoder = new TextEncoder();
29
- const textDecoder = new TextDecoder('utf-8');
30
-
31
- /**
32
- * Converts a string or byte buffer into a `Uint8Array`.
33
- */
34
- export function toUint8Array(input: string | Uint8Array | ArrayBuffer): Uint8Array {
35
- if (typeof input === 'string') {
36
- return textEncoder.encode(input);
37
- }
38
- if (input instanceof Uint8Array) {
39
- return input;
40
- }
41
- if (input instanceof ArrayBuffer) {
42
- return new Uint8Array(input);
43
- }
44
- return new Uint8Array(0);
45
- }
46
-
47
- /**
48
- * Computes the standard IEEE 802.3 CRC32 checksum of a string or byte array.
49
- */
50
- export function computeCrc32(data: string | Uint8Array | ArrayBuffer): number {
51
- const bytes = toUint8Array(data);
52
- let crc = 0xffffffff;
53
- for (let i = 0; i < bytes.length; i++) {
54
- const index = (crc ^ bytes[i]) & 0xff;
55
- crc = (crc >>> 8) ^ CRC32_TABLE[index];
56
- }
57
- return (crc ^ 0xffffffff) >>> 0;
58
- }
59
-
60
- const DANGEROUS_PATH_SEGMENTS: ReadonlySet<string> = new Set([
61
- '__proto__',
62
- 'constructor',
63
- 'prototype'
64
- ]);
65
-
66
- const MAX_ZIP_ENTRIES = 10000;
67
- const MAX_ZIP_UNCOMPRESSED_BYTES = 100 * 1024 * 1024; // 100 MB
68
-
69
- /**
70
- * Sanitizes an archive entry path to prevent Zip-Slip directory traversal attacks
71
- * and prototype-pollution key injection.
72
- * Normalizes backslashes, strips drive prefixes and leading slashes, and collapses
73
- * or removes `..` and `.` segments so the resulting path is strictly relative.
74
- */
75
- export function sanitizeZipPath(rawPath: string): string {
76
- const normalized = String(rawPath || '')
77
- .replace(/\\/g, '/')
78
- .replace(/^[A-Za-z]:/, '');
79
- const parts = normalized.split('/');
80
- const safeParts: string[] = [];
81
- for (const part of parts) {
82
- const trimmed = part.trim();
83
- if (!trimmed || trimmed === '.') continue;
84
- if (DANGEROUS_PATH_SEGMENTS.has(trimmed)) {
85
- return '';
86
- }
87
- if (trimmed === '..') {
88
- if (safeParts.length > 0) {
89
- safeParts.pop();
90
- }
91
- continue;
92
- }
93
- safeParts.push(trimmed);
94
- }
95
- return safeParts.join('/');
96
- }
97
-
98
- function writeUInt16LE(buf: Uint8Array, offset: number, value: number): void {
99
- buf[offset] = value & 0xff;
100
- buf[offset + 1] = (value >>> 8) & 0xff;
101
- }
102
-
103
- function writeUInt32LE(buf: Uint8Array, offset: number, value: number): void {
104
- buf[offset] = value & 0xff;
105
- buf[offset + 1] = (value >>> 8) & 0xff;
106
- buf[offset + 2] = (value >>> 16) & 0xff;
107
- buf[offset + 3] = (value >>> 24) & 0xff;
108
- }
109
-
110
- function readUInt16LE(buf: Uint8Array, offset: number): number {
111
- return (buf[offset] | (buf[offset + 1] << 8)) >>> 0;
112
- }
113
-
114
- function readUInt32LE(buf: Uint8Array, offset: number): number {
115
- return (
116
- (buf[offset] |
117
- (buf[offset + 1] << 8) |
118
- (buf[offset + 2] << 16) |
119
- (buf[offset + 3] << 24)) >>> 0
120
- );
121
- }
122
-
123
- interface ZipEntryInternal {
124
- nameBytes: Uint8Array;
125
- dataBytes: Uint8Array;
126
- crc32: number;
127
- offset: number;
128
- }
129
-
130
- /**
131
- * Creates a standard PKZip v2.0 archive from a map of file paths to contents.
132
- */
133
- export function createZip(
134
- files: Record<string, string | Uint8Array>
135
- ): Uint8Array {
136
- const entries: ZipEntryInternal[] = [];
137
- let localSectionSize = 0;
138
- let centralDirSize = 0;
139
-
140
- const rawKeys = Object.keys(files || {});
141
- for (const rawKey of rawKeys) {
142
- const safePath = sanitizeZipPath(rawKey);
143
- if (!safePath) continue;
144
-
145
- const rawContent = files[rawKey];
146
- const dataBytes = toUint8Array(rawContent);
147
- const nameBytes = textEncoder.encode(safePath);
148
- const crc = computeCrc32(dataBytes);
149
-
150
- entries.push({
151
- nameBytes,
152
- dataBytes,
153
- crc32: crc,
154
- offset: localSectionSize
155
- });
156
-
157
- localSectionSize += 30 + nameBytes.length + dataBytes.length;
158
- centralDirSize += 46 + nameBytes.length;
159
- }
160
-
161
- const totalSize = localSectionSize + centralDirSize + 22;
162
- const out = new Uint8Array(totalSize);
163
- let cursor = 0;
164
-
165
- // 1. Write Local File Headers + File Data
166
- for (const entry of entries) {
167
- writeUInt32LE(out, cursor, LOCAL_FILE_HEADER_SIG);
168
- writeUInt16LE(out, cursor + 4, 20); // Version needed to extract (2.0)
169
- writeUInt16LE(out, cursor + 6, UTF8_FLAG); // General purpose bit flag (UTF-8)
170
- writeUInt16LE(out, cursor + 8, 0); // Compression method: 0 (Store)
171
- writeUInt16LE(out, cursor + 10, 0); // Last mod file time
172
- writeUInt16LE(out, cursor + 12, 0x2100); // Last mod file date (1980-01-01)
173
- writeUInt32LE(out, cursor + 14, entry.crc32);
174
- writeUInt32LE(out, cursor + 18, entry.dataBytes.length); // Compressed size
175
- writeUInt32LE(out, cursor + 22, entry.dataBytes.length); // Uncompressed size
176
- writeUInt16LE(out, cursor + 26, entry.nameBytes.length); // File name length
177
- writeUInt16LE(out, cursor + 28, 0); // Extra field length
178
- cursor += 30;
179
-
180
- out.set(entry.nameBytes, cursor);
181
- cursor += entry.nameBytes.length;
182
-
183
- out.set(entry.dataBytes, cursor);
184
- cursor += entry.dataBytes.length;
185
- }
186
-
187
- const centralDirOffset = cursor;
188
-
189
- // 2. Write Central Directory File Headers
190
- for (const entry of entries) {
191
- writeUInt32LE(out, cursor, CENTRAL_DIR_HEADER_SIG);
192
- writeUInt16LE(out, cursor + 4, 20); // Version made by
193
- writeUInt16LE(out, cursor + 6, 20); // Version needed to extract
194
- writeUInt16LE(out, cursor + 8, UTF8_FLAG); // General purpose bit flag
195
- writeUInt16LE(out, cursor + 10, 0); // Compression method: Store
196
- writeUInt16LE(out, cursor + 12, 0); // Last mod file time
197
- writeUInt16LE(out, cursor + 14, 0x2100); // Last mod file date
198
- writeUInt32LE(out, cursor + 16, entry.crc32);
199
- writeUInt32LE(out, cursor + 20, entry.dataBytes.length); // Compressed size
200
- writeUInt32LE(out, cursor + 24, entry.dataBytes.length); // Uncompressed size
201
- writeUInt16LE(out, cursor + 28, entry.nameBytes.length); // File name length
202
- writeUInt16LE(out, cursor + 30, 0); // Extra field length
203
- writeUInt16LE(out, cursor + 32, 0); // File comment length
204
- writeUInt16LE(out, cursor + 34, 0); // Disk number start
205
- writeUInt16LE(out, cursor + 36, 0); // Internal file attributes
206
- writeUInt32LE(out, cursor + 38, 0); // External file attributes
207
- writeUInt32LE(out, cursor + 42, entry.offset); // Relative offset of local header
208
- cursor += 46;
209
-
210
- out.set(entry.nameBytes, cursor);
211
- cursor += entry.nameBytes.length;
212
- }
213
-
214
- // 3. Write End of Central Directory Record (EOCD)
215
- writeUInt32LE(out, cursor, END_OF_CENTRAL_DIR_SIG);
216
- writeUInt16LE(out, cursor + 4, 0); // Number of this disk
217
- writeUInt16LE(out, cursor + 6, 0); // Disk where central directory starts
218
- writeUInt16LE(out, cursor + 8, entries.length); // Number of central dir records on this disk
219
- writeUInt16LE(out, cursor + 10, entries.length); // Total number of central dir records
220
- writeUInt32LE(out, cursor + 12, centralDirSize); // Size of central directory
221
- writeUInt32LE(out, cursor + 16, centralDirOffset); // Offset of start of central directory
222
- writeUInt16LE(out, cursor + 20, 0); // Comment length
223
-
224
- return out;
225
- }
226
-
227
- /**
228
- * Extracts a PKZip v2.0 archive into a UTF-8 file dictionary (`Record<string, string>`).
229
- * Validates magic headers, checks boundaries, and sanitizes paths against Zip-Slip.
230
- */
231
- export function extractZip(
232
- data: Uint8Array | ArrayBuffer
233
- ): Record<string, string> {
234
- const bytes = toUint8Array(data);
235
- if (bytes.length < 22) {
236
- throw new Error('Invalid or truncated ZIP archive: buffer shorter than minimum 22-byte EOCD record');
237
- }
238
-
239
- // Locate End of Central Directory (EOCD) signature scanning backwards from end
240
- let eocdOffset = -1;
241
- const minSearchOffset = Math.max(0, bytes.length - 65557);
242
- for (let i = bytes.length - 22; i >= minSearchOffset; i--) {
243
- if (readUInt32LE(bytes, i) === END_OF_CENTRAL_DIR_SIG) {
244
- eocdOffset = i;
245
- break;
246
- }
247
- }
248
-
249
- if (eocdOffset === -1) {
250
- throw new Error('Invalid ZIP archive: End of Central Directory (PK\\x05\\x06) signature not found');
251
- }
252
-
253
- const totalEntries = readUInt16LE(bytes, eocdOffset + 10);
254
- if (totalEntries > MAX_ZIP_ENTRIES) {
255
- throw new Error(`ZIP archive exceeds maximum allowed entry count (${MAX_ZIP_ENTRIES})`);
256
- }
257
- const centralDirSize = readUInt32LE(bytes, eocdOffset + 12);
258
- const centralDirOffset = readUInt32LE(bytes, eocdOffset + 16);
259
-
260
- if (centralDirOffset + centralDirSize > bytes.length) {
261
- throw new Error('Corrupted ZIP archive: Central Directory extends past end of buffer');
262
- }
263
-
264
- const result: Record<string, string> = Object.create(null) as Record<string, string>;
265
- let cdCursor = centralDirOffset;
266
- let totalExtractedBytes = 0;
267
-
268
- for (let i = 0; i < totalEntries; i++) {
269
- if (cdCursor + 46 > bytes.length) {
270
- throw new Error('Corrupted ZIP archive: truncated Central Directory header');
271
- }
272
-
273
- const sig = readUInt32LE(bytes, cdCursor);
274
- if (sig !== CENTRAL_DIR_HEADER_SIG) {
275
- throw new Error(`Corrupted ZIP archive: invalid Central Directory signature 0x${sig.toString(16)}`);
276
- }
277
-
278
- const compressionMethod = readUInt16LE(bytes, cdCursor + 10);
279
- const expectedCrc = readUInt32LE(bytes, cdCursor + 16);
280
- const compressedSize = readUInt32LE(bytes, cdCursor + 20);
281
- const fileNameLen = readUInt16LE(bytes, cdCursor + 28);
282
- const extraLen = readUInt16LE(bytes, cdCursor + 30);
283
- const commentLen = readUInt16LE(bytes, cdCursor + 32);
284
- const localHeaderOffset = readUInt32LE(bytes, cdCursor + 42);
285
-
286
- const nameStart = cdCursor + 46;
287
- const nameEnd = nameStart + fileNameLen;
288
- if (nameEnd > bytes.length) {
289
- throw new Error('Corrupted ZIP archive: file name exceeds buffer');
290
- }
291
-
292
- const rawName = textDecoder.decode(bytes.subarray(nameStart, nameEnd));
293
- cdCursor = nameEnd + extraLen + commentLen;
294
-
295
- // Skip explicit directory entries
296
- if (rawName.endsWith('/')) continue;
297
-
298
- const safeName = sanitizeZipPath(rawName);
299
- if (!safeName) continue;
300
-
301
- if (localHeaderOffset + 30 > bytes.length) {
302
- throw new Error(`Corrupted ZIP archive: local header offset out of bounds for ${safeName}`);
303
- }
304
-
305
- const localSig = readUInt32LE(bytes, localHeaderOffset);
306
- if (localSig !== LOCAL_FILE_HEADER_SIG) {
307
- throw new Error(`Corrupted ZIP archive: invalid Local File Header signature for ${safeName}`);
308
- }
309
-
310
- const localNameLen = readUInt16LE(bytes, localHeaderOffset + 26);
311
- const localExtraLen = readUInt16LE(bytes, localHeaderOffset + 28);
312
- const dataStart = localHeaderOffset + 30 + localNameLen + localExtraLen;
313
- const dataEnd = dataStart + compressedSize;
314
-
315
- if (dataEnd > bytes.length) {
316
- throw new Error(`Corrupted ZIP archive: file data truncated for ${safeName}`);
317
- }
318
-
319
- totalExtractedBytes += compressedSize;
320
- if (totalExtractedBytes > MAX_ZIP_UNCOMPRESSED_BYTES) {
321
- throw new Error(`ZIP archive exceeds maximum uncompressed size limit (${MAX_ZIP_UNCOMPRESSED_BYTES} bytes)`);
322
- }
323
-
324
- const rawFileBytes = bytes.subarray(dataStart, dataEnd);
325
- if (compressionMethod !== 0) {
326
- throw new Error(`Unsupported ZIP compression method ${compressionMethod} for ${safeName} (only Store=0 is supported)`);
327
- }
328
-
329
- const actualCrc = computeCrc32(rawFileBytes);
330
- if (actualCrc !== expectedCrc) {
331
- throw new Error(
332
- `CRC32 integrity mismatch for ${safeName}: expected 0x${expectedCrc.toString(16)}, got 0x${actualCrc.toString(16)}`
333
- );
334
- }
335
-
336
- result[safeName] = textDecoder.decode(rawFileBytes);
337
- }
338
-
339
- return { ...result };
340
- }
341
-
342
- export default {
343
- createZip,
344
- extractZip,
345
- computeCrc32,
346
- sanitizeZipPath,
347
- toUint8Array
348
- };