token-goat 2.9.13 → 2.9.14

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 (44) hide show
  1. package/README.md +13 -0
  2. package/dist/token-goat-chunk-2ESBO4IN.mjs +209 -0
  3. package/dist/token-goat-chunk-3BTK54F3.mjs +1733 -0
  4. package/dist/{token-goat-chunk-2WC4ZUXN.mjs → token-goat-chunk-3XQPEJMV.mjs} +1 -1
  5. package/dist/token-goat-chunk-4SDX3QP3.mjs +122 -0
  6. package/dist/token-goat-chunk-7OGKZ7AP.mjs +142 -0
  7. package/dist/token-goat-chunk-AH6QILZM.mjs +26 -0
  8. package/dist/token-goat-chunk-AMYCQJX4.mjs +1548 -0
  9. package/dist/{token-goat-chunk-6B44WLIF.mjs → token-goat-chunk-ASVVF4JV.mjs} +10 -7
  10. package/dist/{token-goat-chunk-3ESRORNM.mjs → token-goat-chunk-DAMXYVIW.mjs} +12026 -11796
  11. package/dist/{token-goat-chunk-YOA4N6WA.mjs → token-goat-chunk-DBNY4RLN.mjs} +2 -2
  12. package/dist/token-goat-chunk-EG3663UT.mjs +226 -0
  13. package/dist/token-goat-chunk-EZNVAIR3.mjs +21 -0
  14. package/dist/token-goat-chunk-GMOUBOX4.mjs +386 -0
  15. package/dist/{token-goat-chunk-B3CTCQTH.mjs → token-goat-chunk-HF6H7RNK.mjs} +1 -1
  16. package/dist/{token-goat-chunk-ZZI3IDQZ.mjs → token-goat-chunk-IT6O3PNN.mjs} +2874 -7088
  17. package/dist/token-goat-chunk-NEI4NC54.mjs +424 -0
  18. package/dist/token-goat-chunk-O5WAMISC.mjs +167 -0
  19. package/dist/{token-goat-chunk-RDITECDL.mjs → token-goat-chunk-PGGDW7DZ.mjs} +28 -13
  20. package/dist/token-goat-chunk-POBYR64E.mjs +1632 -0
  21. package/dist/{token-goat-chunk-4NXUKV7D.mjs → token-goat-chunk-PRJVGIC5.mjs} +6 -4
  22. package/dist/{token-goat-chunk-U7X6LQD2.mjs → token-goat-chunk-RUDOKYPJ.mjs} +10160 -10053
  23. package/dist/token-goat-chunk-SAQ5PG4L.mjs +2634 -0
  24. package/dist/{token-goat-chunk-UMXJN7DI.mjs → token-goat-chunk-T2IWWTHB.mjs} +288 -2654
  25. package/dist/{token-goat-chunk-JOXLE672.mjs → token-goat-chunk-VZYD4OZB.mjs} +1164 -92
  26. package/dist/token-goat-chunk-XEH6KBWW.mjs +23 -0
  27. package/dist/token-goat-chunk-XQF5J25J.mjs +33 -0
  28. package/dist/token-goat-chunk-XTQAOTSO.mjs +89 -0
  29. package/dist/{token-goat-chunk-QWSUZWFP.mjs → token-goat-chunk-XVZ4MNQC.mjs} +587 -587
  30. package/dist/token-goat-chunk-Y4AFKTHK.mjs +22 -0
  31. package/dist/token-goat-chunk-YHGTGG6K.mjs +396 -0
  32. package/dist/{token-goat-chunk-FZU7GMUS.mjs → token-goat-chunk-YTQHZJXW.mjs} +20 -11
  33. package/dist/token-goat-chunk-Z6UXPYJA.mjs +62 -0
  34. package/dist/token-goat-chunk-ZD4EM4LR.mjs +30 -0
  35. package/dist/token-goat-chunk-ZFM4PWXL.mjs +585 -0
  36. package/dist/{token-goat-chunk-FQCNJV4V.mjs → token-goat-chunk-ZYNNQ36L.mjs} +116 -330
  37. package/dist/token-goat-hook.mjs +12 -8
  38. package/dist/token-goat.core.mjs +22 -10
  39. package/docs/cli.md +1 -0
  40. package/package.json +4 -2
  41. package/dist/token-goat-chunk-JVNPCQB7.mjs +0 -31
  42. package/dist/token-goat-chunk-P2PU4CR5.mjs +0 -26
  43. package/dist/token-goat-chunk-QKXBGBQR.mjs +0 -3653
  44. package/dist/token-goat-chunk-UM47DRD3.mjs +0 -242
@@ -0,0 +1,23 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ pptxAllSlidesText,
5
+ pptxNotesText,
6
+ pptxOutline,
7
+ pptxSlideText,
8
+ pptxTextGrep
9
+ } from "./token-goat-chunk-2ESBO4IN.mjs";
10
+ import "./token-goat-chunk-YHGTGG6K.mjs";
11
+ import "./token-goat-chunk-XTQAOTSO.mjs";
12
+ import "./token-goat-chunk-AH6QILZM.mjs";
13
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
14
+ import "./token-goat-chunk-AMYCQJX4.mjs";
15
+ import "./token-goat-chunk-GMOUBOX4.mjs";
16
+ import "./token-goat-chunk-A37V4PBF.mjs";
17
+ export {
18
+ pptxAllSlidesText,
19
+ pptxNotesText,
20
+ pptxOutline,
21
+ pptxSlideText,
22
+ pptxTextGrep
23
+ };
@@ -0,0 +1,33 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ XlsxScanTooLargeError,
5
+ allSheetsHeadText,
6
+ formatXlsxColumns,
7
+ formatXlsxRange,
8
+ headSheet,
9
+ listSheets,
10
+ querySheet,
11
+ rangeSheet,
12
+ xlsxColumns
13
+ } from "./token-goat-chunk-ZFM4PWXL.mjs";
14
+ import "./token-goat-chunk-EG3663UT.mjs";
15
+ import "./token-goat-chunk-3BTK54F3.mjs";
16
+ import "./token-goat-chunk-YHGTGG6K.mjs";
17
+ import "./token-goat-chunk-XTQAOTSO.mjs";
18
+ import "./token-goat-chunk-AH6QILZM.mjs";
19
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
20
+ import "./token-goat-chunk-AMYCQJX4.mjs";
21
+ import "./token-goat-chunk-GMOUBOX4.mjs";
22
+ import "./token-goat-chunk-A37V4PBF.mjs";
23
+ export {
24
+ XlsxScanTooLargeError,
25
+ allSheetsHeadText,
26
+ formatXlsxColumns,
27
+ formatXlsxRange,
28
+ headSheet,
29
+ listSheets,
30
+ querySheet,
31
+ rangeSheet,
32
+ xlsxColumns
33
+ };
@@ -0,0 +1,89 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ DocumentRefusedError
5
+ } from "./token-goat-chunk-Y4AFKTHK.mjs";
6
+ import {
7
+ init_define_import_meta_env
8
+ } from "./token-goat-chunk-A37V4PBF.mjs";
9
+
10
+ // src/zip_bounds.ts
11
+ init_define_import_meta_env();
12
+ var MAX_ZIP_INPUT_BYTES = 50 * 1024 * 1024;
13
+ var MAX_ZIP_OUTPUT_BYTES = 500 * 1024 * 1024;
14
+ var STREAM_CHUNK_BYTES = 64 * 1024;
15
+ var ZipOutputTooLargeError = class extends DocumentRefusedError {
16
+ constructor(entryName, limitBytes, decompressedSoFarBytes) {
17
+ super(
18
+ `zip entry '${entryName}' is over the ${Math.round(limitBytes / (1024 * 1024))}MB decompressed-size limit (over ${Math.round(decompressedSoFarBytes / (1024 * 1024))}MB decompressed so far)`,
19
+ "ZipOutputTooLargeError"
20
+ );
21
+ }
22
+ };
23
+ var ZipInputTooLargeError = class extends DocumentRefusedError {
24
+ constructor(filePath, sizeBytes, limitBytes) {
25
+ super(
26
+ `${filePath} is ${Math.round(sizeBytes / (1024 * 1024))}MB, over the ${Math.round(limitBytes / (1024 * 1024))}MB limit for zip-format archives`,
27
+ "ZipInputTooLargeError"
28
+ );
29
+ }
30
+ };
31
+ function concatChunks(chunks, total) {
32
+ const out = new Uint8Array(total);
33
+ let offset = 0;
34
+ for (const chunk of chunks) {
35
+ out.set(chunk, offset);
36
+ offset += chunk.length;
37
+ }
38
+ return out;
39
+ }
40
+ function unzipBounded(mod, data, opts) {
41
+ mod.unzipSync(data, { filter: () => false });
42
+ const results = {};
43
+ let firstError;
44
+ let totalDecompressed = 0;
45
+ const unzip = new mod.Unzip((file) => {
46
+ if (firstError !== void 0 || !opts.shouldExtract(file.name)) return;
47
+ if (typeof file.originalSize === "number" && totalDecompressed + file.originalSize > opts.limitBytes) {
48
+ firstError = new ZipOutputTooLargeError(file.name, opts.limitBytes, totalDecompressed + file.originalSize);
49
+ return;
50
+ }
51
+ const chunks = [];
52
+ let entryTotal = 0;
53
+ file.ondata = (err, chunk, final) => {
54
+ if (firstError !== void 0) return;
55
+ if (err) {
56
+ firstError = err instanceof Error ? err : new Error(String(err));
57
+ return;
58
+ }
59
+ entryTotal += chunk.length;
60
+ totalDecompressed += chunk.length;
61
+ if (totalDecompressed > opts.limitBytes) {
62
+ firstError = new ZipOutputTooLargeError(file.name, opts.limitBytes, totalDecompressed);
63
+ return;
64
+ }
65
+ chunks.push(chunk);
66
+ if (final) results[file.name] = concatChunks(chunks, entryTotal);
67
+ };
68
+ file.start();
69
+ });
70
+ unzip.register(mod.UnzipInflate);
71
+ let offset = 0;
72
+ for (; ; ) {
73
+ const end = Math.min(offset + STREAM_CHUNK_BYTES, data.length);
74
+ const isFinal = end >= data.length;
75
+ unzip.push(data.subarray(offset, end), isFinal);
76
+ offset = end;
77
+ if (firstError !== void 0 || isFinal) break;
78
+ }
79
+ if (firstError !== void 0) throw firstError;
80
+ return results;
81
+ }
82
+
83
+ export {
84
+ MAX_ZIP_INPUT_BYTES,
85
+ MAX_ZIP_OUTPUT_BYTES,
86
+ ZipOutputTooLargeError,
87
+ ZipInputTooLargeError,
88
+ unzipBounded
89
+ };