kordoc 4.22.0 → 4.22.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 (129) hide show
  1. package/README.md +18 -9
  2. package/dist/{-KRYEEYOX.js → -C437ZARA.js} +11 -11
  3. package/dist/{chunk-HIM23MJP.js → chunk-2X64TI7I.js} +2 -2
  4. package/dist/{chunk-SP3DBTDN.js → chunk-3LJ6QO53.js} +28 -6
  5. package/dist/chunk-3LJ6QO53.js.map +1 -0
  6. package/dist/{chunk-PPYQUI3X.js → chunk-4BJZGXNM.js} +2 -2
  7. package/dist/{chunk-NKWY4UJ4.js → chunk-4GCS7WJJ.js} +2 -2
  8. package/dist/{chunk-BKEDPKXS.js → chunk-56GBOIOE.js} +2 -2
  9. package/dist/{chunk-GQJ4MFLT.cjs → chunk-AUWO57ED.cjs} +2 -2
  10. package/dist/{chunk-GQJ4MFLT.cjs.map → chunk-AUWO57ED.cjs.map} +1 -1
  11. package/dist/{chunk-2ZRU6WJQ.js → chunk-AXR7OKQY.js} +2 -2
  12. package/dist/{chunk-HI45PG3J.js → chunk-CNMUT5YW.js} +2 -2
  13. package/dist/{chunk-B4IKM3CG.js → chunk-DQXP3ELP.js} +2 -2
  14. package/dist/{chunk-EFO7H2D4.cjs → chunk-EKKZNKJD.cjs} +3 -3
  15. package/dist/{chunk-EFO7H2D4.cjs.map → chunk-EKKZNKJD.cjs.map} +1 -1
  16. package/dist/{chunk-LJSZ3HCI.cjs → chunk-ENV25MPM.cjs} +27 -26
  17. package/dist/chunk-ENV25MPM.cjs.map +1 -0
  18. package/dist/{chunk-7BJDDE7V.js → chunk-FPUBEM3F.js} +11 -11
  19. package/dist/{chunk-4W7GCW3Z.js → chunk-GFQIKYBV.js} +3 -3
  20. package/dist/{chunk-BXBOFBHR.js → chunk-GVBQVXXB.js} +2 -2
  21. package/dist/{chunk-BXBOFBHR.js.map → chunk-GVBQVXXB.js.map} +1 -1
  22. package/dist/{chunk-EXKBLZUH.cjs → chunk-I4BS4BXE.cjs} +188 -166
  23. package/dist/{chunk-EXKBLZUH.cjs.map → chunk-I4BS4BXE.cjs.map} +1 -1
  24. package/dist/{chunk-72DOHOTQ.js → chunk-IRP6QS3K.js} +3 -3
  25. package/dist/{chunk-VHDD33Q4.js → chunk-L6N4OMKR.js} +60 -28
  26. package/dist/chunk-L6N4OMKR.js.map +1 -0
  27. package/dist/{chunk-GWJV3FYA.js → chunk-L6PFPBTK.js} +2 -2
  28. package/dist/{chunk-DKSQ22RU.cjs → chunk-MED2MR6O.cjs} +6 -6
  29. package/dist/{chunk-DKSQ22RU.cjs.map → chunk-MED2MR6O.cjs.map} +1 -1
  30. package/dist/{chunk-7YVDZCHF.js → chunk-NGDMJICC.js} +29 -7
  31. package/dist/{chunk-SP3DBTDN.js.map → chunk-NGDMJICC.js.map} +1 -1
  32. package/dist/{chunk-PMVM7BS6.js → chunk-QFJCEHY7.js} +2 -2
  33. package/dist/{chunk-PMVM7BS6.js.map → chunk-QFJCEHY7.js.map} +1 -1
  34. package/dist/{chunk-DCXK7PYL.js → chunk-S4KQUVBV.js} +6 -5
  35. package/dist/{chunk-POPIFZOT.js.map → chunk-S4KQUVBV.js.map} +1 -1
  36. package/dist/{chunk-PWCVNTMX.js → chunk-U3TZVR7A.js} +2 -2
  37. package/dist/{chunk-POPIFZOT.js → chunk-UMNKY2EZ.js} +6 -5
  38. package/dist/{chunk-DCXK7PYL.js.map → chunk-UMNKY2EZ.js.map} +1 -1
  39. package/dist/{chunk-NNGZXPPA.js → chunk-UV2G6XFA.js} +2 -2
  40. package/dist/{chunk-746T2J3U.js → chunk-VUC4JJUM.js} +2 -2
  41. package/dist/{chunk-D5DRW3S5.js → chunk-YOFKJ7IM.js} +2 -2
  42. package/dist/{chunk-DZFGZBMV.js → chunk-YTEMFVZB.js} +2 -2
  43. package/dist/{chunk-GBQXV6MI.cjs → chunk-ZLFUZM7H.cjs} +3 -3
  44. package/dist/{chunk-GBQXV6MI.cjs.map → chunk-ZLFUZM7H.cjs.map} +1 -1
  45. package/dist/chunks-MPOOHZVO.js +10 -0
  46. package/dist/cli.js +30 -30
  47. package/dist/{formula-QPKCUYLS.cjs → formula-3TVRNJ66.cjs} +9 -9
  48. package/dist/{formula-QPKCUYLS.cjs.map → formula-3TVRNJ66.cjs.map} +1 -1
  49. package/dist/{formula-XSXXXRA6.js → formula-43QBPAL5.js} +4 -4
  50. package/dist/{formula-2G43QHEV.js → formula-HUENRCPJ.js} +3 -3
  51. package/dist/{image-ocr-XY3TUBYK.js → image-ocr-BAHDLDV5.js} +6 -6
  52. package/dist/{image-ocr-L46V4HIX.js → image-ocr-HYAKWJGE.js} +9 -9
  53. package/dist/{image-ocr-ZQMWJHKE.cjs → image-ocr-OC3TCXMV.cjs} +17 -17
  54. package/dist/{image-ocr-ZQMWJHKE.cjs.map → image-ocr-OC3TCXMV.cjs.map} +1 -1
  55. package/dist/index.cjs +356 -324
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +1 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +60 -28
  60. package/dist/index.js.map +1 -1
  61. package/dist/mcp.js +22 -22
  62. package/dist/{model-bundle-QFDCCCI2.js → model-bundle-23WBSECG.js} +5 -5
  63. package/dist/{models-T2QBJSY5.js → models-NRZQY45P.js} +5 -5
  64. package/dist/{parse-worker-v2-PT6LULNS.js → parse-worker-v2-DPNXGJ73.js} +12 -12
  65. package/dist/{parser-2EIOJGOS.js → parser-FNUQW2F3.js} +73 -27
  66. package/dist/parser-FNUQW2F3.js.map +1 -0
  67. package/dist/{parser-BGSWEVUB.cjs → parser-OKAQRZKM.cjs} +318 -272
  68. package/dist/parser-OKAQRZKM.cjs.map +1 -0
  69. package/dist/{parser-LM6FNKVB.js → parser-XNOLC3MZ.js} +70 -24
  70. package/dist/parser-XNOLC3MZ.js.map +1 -0
  71. package/dist/pdf-ocr-6UXBIQE6.cjs +31 -0
  72. package/dist/pdf-ocr-6UXBIQE6.cjs.map +1 -0
  73. package/dist/{pdf-ocr-GSELGUFG.js → pdf-ocr-FAGA3O6B.js} +8 -6
  74. package/dist/{pdf-ocr-C5OFY2RY.js → pdf-ocr-N5LYC5LA.js} +11 -9
  75. package/dist/{profile-io-Y2TLZ62F.js → profile-io-HC6FMYX4.js} +3 -3
  76. package/dist/{rasterize-FB6MFPS3.js → rasterize-QLTROEV2.js} +3 -3
  77. package/dist/{redact-doc-AV2EOKPP.js → redact-doc-V4KMM2QV.js} +11 -11
  78. package/dist/{render-M5BW4TLH.js → render-V4S3QLTR.js} +7 -7
  79. package/dist/seal-MQ5TB5YZ.js +10 -0
  80. package/dist/{setup-DVKUFC73.js → setup-HU7ZOQNM.js} +3 -3
  81. package/dist/visual-RLIFC4XC.js +21 -0
  82. package/dist/{watch-S35AWINM.js → watch-NPIZ6DSJ.js} +12 -12
  83. package/package.json +1 -1
  84. package/dist/chunk-7YVDZCHF.js.map +0 -1
  85. package/dist/chunk-LJSZ3HCI.cjs.map +0 -1
  86. package/dist/chunk-VHDD33Q4.js.map +0 -1
  87. package/dist/chunks-5AVQEPIH.js +0 -10
  88. package/dist/parser-2EIOJGOS.js.map +0 -1
  89. package/dist/parser-BGSWEVUB.cjs.map +0 -1
  90. package/dist/parser-LM6FNKVB.js.map +0 -1
  91. package/dist/pdf-ocr-A2UWUATF.cjs +0 -29
  92. package/dist/pdf-ocr-A2UWUATF.cjs.map +0 -1
  93. package/dist/seal-JXYWI5CN.js +0 -10
  94. package/dist/visual-DBVBTOAV.js +0 -21
  95. /package/dist/{-KRYEEYOX.js.map → -C437ZARA.js.map} +0 -0
  96. /package/dist/{chunk-HIM23MJP.js.map → chunk-2X64TI7I.js.map} +0 -0
  97. /package/dist/{chunk-PPYQUI3X.js.map → chunk-4BJZGXNM.js.map} +0 -0
  98. /package/dist/{chunk-NKWY4UJ4.js.map → chunk-4GCS7WJJ.js.map} +0 -0
  99. /package/dist/{chunk-BKEDPKXS.js.map → chunk-56GBOIOE.js.map} +0 -0
  100. /package/dist/{chunk-2ZRU6WJQ.js.map → chunk-AXR7OKQY.js.map} +0 -0
  101. /package/dist/{chunk-HI45PG3J.js.map → chunk-CNMUT5YW.js.map} +0 -0
  102. /package/dist/{chunk-B4IKM3CG.js.map → chunk-DQXP3ELP.js.map} +0 -0
  103. /package/dist/{chunk-7BJDDE7V.js.map → chunk-FPUBEM3F.js.map} +0 -0
  104. /package/dist/{chunk-4W7GCW3Z.js.map → chunk-GFQIKYBV.js.map} +0 -0
  105. /package/dist/{chunk-72DOHOTQ.js.map → chunk-IRP6QS3K.js.map} +0 -0
  106. /package/dist/{chunk-GWJV3FYA.js.map → chunk-L6PFPBTK.js.map} +0 -0
  107. /package/dist/{chunk-PWCVNTMX.js.map → chunk-U3TZVR7A.js.map} +0 -0
  108. /package/dist/{chunk-NNGZXPPA.js.map → chunk-UV2G6XFA.js.map} +0 -0
  109. /package/dist/{chunk-746T2J3U.js.map → chunk-VUC4JJUM.js.map} +0 -0
  110. /package/dist/{chunk-D5DRW3S5.js.map → chunk-YOFKJ7IM.js.map} +0 -0
  111. /package/dist/{chunk-DZFGZBMV.js.map → chunk-YTEMFVZB.js.map} +0 -0
  112. /package/dist/{chunks-5AVQEPIH.js.map → chunks-MPOOHZVO.js.map} +0 -0
  113. /package/dist/{formula-XSXXXRA6.js.map → formula-43QBPAL5.js.map} +0 -0
  114. /package/dist/{formula-2G43QHEV.js.map → formula-HUENRCPJ.js.map} +0 -0
  115. /package/dist/{image-ocr-XY3TUBYK.js.map → image-ocr-BAHDLDV5.js.map} +0 -0
  116. /package/dist/{image-ocr-L46V4HIX.js.map → image-ocr-HYAKWJGE.js.map} +0 -0
  117. /package/dist/{model-bundle-QFDCCCI2.js.map → model-bundle-23WBSECG.js.map} +0 -0
  118. /package/dist/{models-T2QBJSY5.js.map → models-NRZQY45P.js.map} +0 -0
  119. /package/dist/{parse-worker-v2-PT6LULNS.js.map → parse-worker-v2-DPNXGJ73.js.map} +0 -0
  120. /package/dist/{pdf-ocr-C5OFY2RY.js.map → pdf-ocr-FAGA3O6B.js.map} +0 -0
  121. /package/dist/{pdf-ocr-GSELGUFG.js.map → pdf-ocr-N5LYC5LA.js.map} +0 -0
  122. /package/dist/{profile-io-Y2TLZ62F.js.map → profile-io-HC6FMYX4.js.map} +0 -0
  123. /package/dist/{rasterize-FB6MFPS3.js.map → rasterize-QLTROEV2.js.map} +0 -0
  124. /package/dist/{redact-doc-AV2EOKPP.js.map → redact-doc-V4KMM2QV.js.map} +0 -0
  125. /package/dist/{render-M5BW4TLH.js.map → render-V4S3QLTR.js.map} +0 -0
  126. /package/dist/{seal-JXYWI5CN.js.map → seal-MQ5TB5YZ.js.map} +0 -0
  127. /package/dist/{setup-DVKUFC73.js.map → setup-HU7ZOQNM.js.map} +0 -0
  128. /package/dist/{visual-DBVBTOAV.js.map → visual-RLIFC4XC.js.map} +0 -0
  129. /package/dist/{watch-S35AWINM.js.map → watch-NPIZ6DSJ.js.map} +0 -0
package/dist/mcp.js CHANGED
@@ -38,33 +38,33 @@ import {
38
38
  resolveBuiltinTemplate,
39
39
  unknownFontWarnings,
40
40
  usesGaejosikMunche
41
- } from "./chunk-7BJDDE7V.js";
42
- import "./chunk-BKEDPKXS.js";
41
+ } from "./chunk-FPUBEM3F.js";
42
+ import "./chunk-56GBOIOE.js";
43
43
  import {
44
44
  detectFormat,
45
45
  detectOle2Format,
46
46
  detectZipFormat,
47
47
  extractHwp5MetadataOnly
48
- } from "./chunk-VHDD33Q4.js";
49
- import "./chunk-HIM23MJP.js";
50
- import "./chunk-2ZRU6WJQ.js";
48
+ } from "./chunk-L6N4OMKR.js";
49
+ import "./chunk-2X64TI7I.js";
50
+ import "./chunk-AXR7OKQY.js";
51
51
  import "./chunk-VKVDMH7X.js";
52
52
  import "./chunk-VQFA55IC.js";
53
53
  import "./chunk-BHVOY6V4.js";
54
- import "./chunk-BXBOFBHR.js";
54
+ import "./chunk-GVBQVXXB.js";
55
55
  import {
56
56
  blocksToMarkdown
57
- } from "./chunk-PWCVNTMX.js";
57
+ } from "./chunk-U3TZVR7A.js";
58
58
  import {
59
59
  assertWithinRoot,
60
60
  getAccessRoot,
61
61
  isOfflineMode
62
- } from "./chunk-HI45PG3J.js";
62
+ } from "./chunk-CNMUT5YW.js";
63
63
  import {
64
64
  extractFormFields,
65
65
  fillWithUniqueGuard
66
- } from "./chunk-4W7GCW3Z.js";
67
- import "./chunk-746T2J3U.js";
66
+ } from "./chunk-GFQIKYBV.js";
67
+ import "./chunk-VUC4JJUM.js";
68
68
  import {
69
69
  KordocError,
70
70
  VERSION,
@@ -72,7 +72,7 @@ import {
72
72
  routeConsoleToStderr,
73
73
  sanitizeError,
74
74
  toArrayBuffer
75
- } from "./chunk-PPYQUI3X.js";
75
+ } from "./chunk-4BJZGXNM.js";
76
76
  import "./chunk-3WSNLH4B.js";
77
77
 
78
78
  // src/mcp.ts
@@ -371,7 +371,7 @@ ${markdown}`);
371
371
  break;
372
372
  case "pdf":
373
373
  try {
374
- const { extractPdfMetadataOnly } = await import("./parser-2EIOJGOS.js");
374
+ const { extractPdfMetadataOnly } = await import("./parser-FNUQW2F3.js");
375
375
  metadata = await extractPdfMetadataOnly(buffer);
376
376
  } catch {
377
377
  metadata = void 0;
@@ -548,7 +548,7 @@ ${tableMarkdown}` }]
548
548
  if (!parsed.success) {
549
549
  return { content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}` }], isError: true };
550
550
  }
551
- const { blocksToChunks } = await import("./chunks-5AVQEPIH.js");
551
+ const { blocksToChunks } = await import("./chunks-MPOOHZVO.js");
552
552
  const chunks = blocksToChunks(parsed.blocks, { granularity, includeTableCells: include_table_cells });
553
553
  return { content: [{ type: "text", text: capResponseText(JSON.stringify(chunks, null, 2)) }] };
554
554
  } catch (err) {
@@ -818,7 +818,7 @@ ${previewMd}` }]
818
818
  }
819
819
  const image = new Uint8Array(await readFile2(imgResolved));
820
820
  const ext = extname2(imgResolved).slice(1).toLowerCase();
821
- const { placeSealHwpx } = await import("./seal-JXYWI5CN.js");
821
+ const { placeSealHwpx } = await import("./seal-MQ5TB5YZ.js");
822
822
  const result = await placeSealHwpx(buffer, [{
823
823
  anchor,
824
824
  occurrence,
@@ -935,7 +935,7 @@ ${previewMd}` }]
935
935
  if (outPath && await isSameFile(outPath, resolved)) {
936
936
  return { content: [{ type: "text", text: "output_path\uAC00 \uC785\uB825 \uD30C\uC77C\uACFC \uAC19\uC2B5\uB2C8\uB2E4 \u2014 \uC6D0\uBCF8\uC744 \uB36E\uC5B4\uC4F0\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uB978 \uACBD\uB85C\uB97C \uC9C0\uC815\uD558\uC138\uC694." }], isError: true };
937
937
  }
938
- const { redactDocument } = await import("./redact-doc-AV2EOKPP.js");
938
+ const { redactDocument } = await import("./redact-doc-V4KMM2QV.js");
939
939
  const r = await redactDocument(buffer, { rules, maskChar: mask_char, filePath: file_path, dryRun: dry_run });
940
940
  const MAX_LINES = 50;
941
941
  const listed = r.fileHits.length > 0 ? r.fileHits.map((h) => ` - [${h.rule}] ${h.masked} (${h.where} @ ${h.part})`) : r.markdownHits.map((h) => ` - [${h.rule}] ${h.masked}`);
@@ -1009,7 +1009,7 @@ function registerRenderTools(server2) {
1009
1009
  const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1010
1010
  const isHwp5 = resolved.toLowerCase().endsWith(".hwp");
1011
1011
  if (!isHwp5 && !pages && (format === "png" || format === "svg")) {
1012
- const { renderHwpxToSvg } = await import("./render-M5BW4TLH.js");
1012
+ const { renderHwpxToSvg } = await import("./render-V4S3QLTR.js");
1013
1013
  const result = await renderHwpxToSvg(buffer, { highlights, reflow: true, reflowMode: reflow_mode });
1014
1014
  const summary2 = [
1015
1015
  `\uB80C\uB354 \uC644\uB8CC: ${result.pageCount}\uD398\uC774\uC9C0, ${Math.round(result.width)}x${Math.round(result.height)}pt (\uD14D\uC2A4\uD2B8 ${result.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${result.stats.images}\xB7\uD45C ${result.stats.tables})`,
@@ -1021,7 +1021,7 @@ function registerRenderTools(server2) {
1021
1021
  summary2.push(`\uC800\uC7A5: ${outPath}`);
1022
1022
  return { content: [{ type: "text", text: summary2.join("\n") }] };
1023
1023
  }
1024
- const { rasterizeSvg } = await import("./rasterize-FB6MFPS3.js");
1024
+ const { rasterizeSvg } = await import("./rasterize-QLTROEV2.js");
1025
1025
  const raster = await rasterizeSvg(result.svg, result.width, result.height, max_width_px ? { maxWidthPx: max_width_px } : void 0);
1026
1026
  if (outPath) {
1027
1027
  await mkdir2(dirname3(outPath), { recursive: true });
@@ -1036,7 +1036,7 @@ function registerRenderTools(server2) {
1036
1036
  ]
1037
1037
  };
1038
1038
  }
1039
- const { renderDocument } = await import("./render-M5BW4TLH.js");
1039
+ const { renderDocument } = await import("./render-V4S3QLTR.js");
1040
1040
  const { scene, assets } = await renderDocument(buffer, { format, pages, highlights, reflow: true, reflowMode: reflow_mode, maxWidthPx: max_width_px });
1041
1041
  const summary = [
1042
1042
  `\uB80C\uB354 \uC644\uB8CC: \uBB38\uC11C ${scene.pages.length}\uD398\uC774\uC9C0 \uC911 ${assets.filter((a) => a.page !== void 0).length || 1}\uAC74 (\uD14D\uC2A4\uD2B8 ${scene.stats.texts}\xB7\uC774\uBBF8\uC9C0 ${scene.stats.images}\xB7\uD45C ${scene.stats.tables}\xB7\uB3C4\uD615 ${scene.stats.shapes})`,
@@ -1086,7 +1086,7 @@ function registerRenderTools(server2) {
1086
1086
  try {
1087
1087
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1088
1088
  const dir = safeOutputPath(join2(output_dir, "regions.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]regions\.json$/, "");
1089
- const { extractRenderedRegions } = await import("./render-M5BW4TLH.js");
1089
+ const { extractRenderedRegions } = await import("./render-V4S3QLTR.js");
1090
1090
  const regions = await extractRenderedRegions(buffer, { types: target, format, pages, paddingPt: padding_pt, reflow: true });
1091
1091
  await mkdir2(dir, { recursive: true });
1092
1092
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1122,7 +1122,7 @@ function registerRenderTools(server2) {
1122
1122
  }
1123
1123
  const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
1124
1124
  const dir = output_dir ? safeOutputPath(join2(output_dir, "tables.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]tables\.json$/, "") : void 0;
1125
- const { extractTables } = await import("./visual-DBVBTOAV.js");
1125
+ const { extractTables } = await import("./visual-RLIFC4XC.js");
1126
1126
  const tables = await extractTables(buffer, { policy: visual, format, paddingPt: padding_pt });
1127
1127
  if (dir) await mkdir2(dir, { recursive: true });
1128
1128
  const ext = format === "jpeg" ? "jpg" : "png";
@@ -1179,7 +1179,7 @@ function registerGenerateTools(server2) {
1179
1179
  try {
1180
1180
  const out = safeOutputPath(output_path, PROFILE_EXTENSIONS);
1181
1181
  const { buffer } = await readValidatedFile(hwpx_path);
1182
- const { hwpxToProfile } = await import("./-KRYEEYOX.js");
1182
+ const { hwpxToProfile } = await import("./-C437ZARA.js");
1183
1183
  const profile = await hwpxToProfile(buffer);
1184
1184
  await mkdir3(dirname4(out), { recursive: true });
1185
1185
  await writeOutputFile(out, JSON.stringify(profile, null, 2));
@@ -1292,7 +1292,7 @@ function registerGenerateTools(server2) {
1292
1292
  }
1293
1293
  let profile;
1294
1294
  if (profile_path) {
1295
- const { parseFormatProfileJson } = await import("./profile-io-Y2TLZ62F.js");
1295
+ const { parseFormatProfileJson } = await import("./profile-io-HC6FMYX4.js");
1296
1296
  profile = parseFormatProfileJson(await readFile3(safePath(profile_path, PROFILE_EXTENSIONS), "utf-8"));
1297
1297
  }
1298
1298
  const out = safeOutputPath(output_path, /* @__PURE__ */ new Set([".hwpx"]));
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ALL_OCR_MODELS
4
- } from "./chunk-GWJV3FYA.js";
4
+ } from "./chunk-L6PFPBTK.js";
5
5
  import {
6
6
  ALL_FORMULA_MODELS,
7
7
  getModelStatusIn,
8
8
  getModelsDir
9
- } from "./chunk-NNGZXPPA.js";
10
- import "./chunk-HI45PG3J.js";
11
- import "./chunk-PPYQUI3X.js";
9
+ } from "./chunk-UV2G6XFA.js";
10
+ import "./chunk-CNMUT5YW.js";
11
+ import "./chunk-4BJZGXNM.js";
12
12
 
13
13
  // src/shared/model-bundle.ts
14
14
  import { copyFile, mkdir } from "fs/promises";
@@ -101,4 +101,4 @@ export {
101
101
  importModels,
102
102
  modelCacheStatus
103
103
  };
104
- //# sourceMappingURL=model-bundle-QFDCCCI2.js.map
104
+ //# sourceMappingURL=model-bundle-23WBSECG.js.map
@@ -16,10 +16,10 @@ import {
16
16
  ocrSourcePath,
17
17
  parseCharacterDict,
18
18
  resolveOcrModels
19
- } from "./chunk-GWJV3FYA.js";
20
- import "./chunk-NNGZXPPA.js";
21
- import "./chunk-HI45PG3J.js";
22
- import "./chunk-PPYQUI3X.js";
19
+ } from "./chunk-L6PFPBTK.js";
20
+ import "./chunk-UV2G6XFA.js";
21
+ import "./chunk-CNMUT5YW.js";
22
+ import "./chunk-4BJZGXNM.js";
23
23
  export {
24
24
  ALL_OCR_MODELS,
25
25
  DEFAULT_OCR_MODELS,
@@ -38,4 +38,4 @@ export {
38
38
  parseCharacterDict,
39
39
  resolveOcrModels
40
40
  };
41
- //# sourceMappingURL=models-T2QBJSY5.js.map
41
+ //# sourceMappingURL=models-NRZQY45P.js.map
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  parseWorkerFile
4
- } from "./chunk-72DOHOTQ.js";
5
- import "./chunk-7BJDDE7V.js";
6
- import "./chunk-BKEDPKXS.js";
7
- import "./chunk-VHDD33Q4.js";
8
- import "./chunk-HIM23MJP.js";
9
- import "./chunk-2ZRU6WJQ.js";
4
+ } from "./chunk-IRP6QS3K.js";
5
+ import "./chunk-FPUBEM3F.js";
6
+ import "./chunk-56GBOIOE.js";
7
+ import "./chunk-L6N4OMKR.js";
8
+ import "./chunk-2X64TI7I.js";
9
+ import "./chunk-AXR7OKQY.js";
10
10
  import "./chunk-VKVDMH7X.js";
11
11
  import "./chunk-VQFA55IC.js";
12
12
  import {
13
13
  validateOcrOptions
14
14
  } from "./chunk-BHVOY6V4.js";
15
- import "./chunk-BXBOFBHR.js";
16
- import "./chunk-PWCVNTMX.js";
17
- import "./chunk-4W7GCW3Z.js";
18
- import "./chunk-746T2J3U.js";
15
+ import "./chunk-GVBQVXXB.js";
16
+ import "./chunk-U3TZVR7A.js";
17
+ import "./chunk-GFQIKYBV.js";
18
+ import "./chunk-VUC4JJUM.js";
19
19
  import {
20
20
  VERSION,
21
21
  sanitizeError
22
- } from "./chunk-PPYQUI3X.js";
22
+ } from "./chunk-4BJZGXNM.js";
23
23
  import "./chunk-3WSNLH4B.js";
24
24
 
25
25
  // src/cli/parse-worker-v2.ts
@@ -311,4 +311,4 @@ export {
311
311
  runParseWorkerV2,
312
312
  toParseOptions
313
313
  };
314
- //# sourceMappingURL=parse-worker-v2-PT6LULNS.js.map
314
+ //# sourceMappingURL=parse-worker-v2-DPNXGJ73.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToPages
4
- } from "./chunk-2ZRU6WJQ.js";
4
+ } from "./chunk-AXR7OKQY.js";
5
5
  import {
6
6
  encodePng
7
7
  } from "./chunk-VKVDMH7X.js";
@@ -62,7 +62,7 @@ import {
62
62
  stripAbsorbedRunningLines,
63
63
  trimTrailingEmptyTableCols,
64
64
  wrapJoiner
65
- } from "./chunk-SP3DBTDN.js";
65
+ } from "./chunk-3LJ6QO53.js";
66
66
  import {
67
67
  validateOcrOptions
68
68
  } from "./chunk-BHVOY6V4.js";
@@ -74,23 +74,23 @@ import {
74
74
  escapeLiteralTags,
75
75
  stripScriptTags,
76
76
  unframeLayoutTables
77
- } from "./chunk-BXBOFBHR.js";
77
+ } from "./chunk-GVBQVXXB.js";
78
78
  import {
79
79
  WINGDINGS,
80
80
  assignTableIds,
81
81
  blocksToMarkdown,
82
82
  escapeLiteralDollar
83
- } from "./chunk-PWCVNTMX.js";
83
+ } from "./chunk-U3TZVR7A.js";
84
84
  import {
85
85
  ocrModelsCached,
86
86
  resolveOcrModels
87
- } from "./chunk-GWJV3FYA.js";
88
- import "./chunk-NNGZXPPA.js";
89
- import "./chunk-HI45PG3J.js";
87
+ } from "./chunk-L6PFPBTK.js";
88
+ import "./chunk-UV2G6XFA.js";
89
+ import "./chunk-CNMUT5YW.js";
90
90
  import {
91
91
  KordocError,
92
92
  sanitizeHref
93
- } from "./chunk-PPYQUI3X.js";
93
+ } from "./chunk-4BJZGXNM.js";
94
94
 
95
95
  // src/pdf/image-extract.ts
96
96
  import { createHash } from "crypto";
@@ -686,6 +686,41 @@ function matchesCompleteRubricRow(table, owner, first) {
686
686
  return peerMarks.length === marks.length && peerMarks.every((m, i) => m.n === marks[i].n) && values(row[score.c]).join("|") === scores.join("|") && norm(peer.slice(peerMarks[peerMarks.length - 1].at)) === tail;
687
687
  });
688
688
  }
689
+ var KO_ORDER = "\uAC00\uB098\uB2E4\uB77C\uB9C8\uBC14\uC0AC\uC544\uC790\uCC28\uCE74\uD0C0\uD30C\uD558";
690
+ function itemMark(line) {
691
+ line = line.replace(/<\/?u>|~~/g, "").trim();
692
+ let m = /^(\d{1,2})([.)])(?!\d)/.exec(line);
693
+ if (m) return { style: "1" + m[2], n: +m[1] };
694
+ if (m = /^\((\d{1,2})\)/.exec(line)) return { style: "(1)", n: +m[1] };
695
+ if ((m = /^([가-하])([.)])/.exec(line)) && KO_ORDER.includes(m[1])) return { style: "\uAC00" + m[2], n: KO_ORDER.indexOf(m[1]) };
696
+ if ((m = /^\(([가-하])\)/.exec(line)) && KO_ORDER.includes(m[1])) return { style: "(\uAC00)", n: KO_ORDER.indexOf(m[1]) };
697
+ if (m = /^[①-⑳]/.exec(line)) return { style: "\u2460", n: m[0].charCodeAt(0) };
698
+ if (m = /^([A-Z])\.\s/.exec(line)) return { style: "A.", n: m[1].charCodeAt(0) };
699
+ return null;
700
+ }
701
+ function hasNumberedRowSequence(table, owner, first) {
702
+ if (first < 3) return false;
703
+ const rows = [first - 3, first - 2, first - 1, first];
704
+ const separate = (c, cs) => rows.every((r) => {
705
+ const a = owner[r]?.[c], cell = table.cells[r]?.[c];
706
+ return a?.r === r && a.c === c && a.rs === 1 && a.cs === cs && !!cell && plain(cell) && !!textOf(cell);
707
+ });
708
+ for (let c = 0; c < table.cols; c++) {
709
+ const a = owner[first]?.[c];
710
+ if (!a || !separate(c, a.cs)) continue;
711
+ const marks = rows.map((r) => {
712
+ const lines = textOf(table.cells[r][c]).split("\n"), firstMark = itemMark(lines[0]);
713
+ return firstMark && lines.slice(1).every((l) => !itemMark(l)) ? firstMark : null;
714
+ });
715
+ const head = marks[0];
716
+ if (!head || marks.some((m, i) => !m || m.style !== head.style || m.n !== head.n + i)) continue;
717
+ for (let d = 0; d < table.cols; d++) {
718
+ const side = owner[first]?.[d];
719
+ if (side && (d + side.cs <= c || d >= c + a.cs) && separate(d, side.cs)) return true;
720
+ }
721
+ }
722
+ return false;
723
+ }
689
724
 
690
725
  // src/pdf/contact-table.ts
691
726
  var CONTACT_HEAD = /^(?:담당\s*부서|<[^<>]+>)$/;
@@ -704,8 +739,25 @@ function splitContactTables(blocks) {
704
739
  const whole = PERSON.exec(r[3].text.replace(/\s+/g, " ").trim());
705
740
  return whole ? [whole] : null;
706
741
  });
707
- if (people.some((p) => !p) || rows.some((r) => !CONTACT_ROLE.test(r[2].text.replace(/\s+/g, "")) || r[2].rowSpan !== 1 || r[3].rowSpan !== 1)) continue;
742
+ if (people.some((p) => !p) || rows.some((r) => r[3].rowSpan !== 1 || r[3].colSpan !== 1)) continue;
743
+ let roleEnd = 0;
744
+ const validRoles = rows.every((r, i) => {
745
+ const role = r[2];
746
+ if (role.colSpan !== 1) return false;
747
+ if (i < roleEnd) return !role.text.trim() && role.rowSpan === 1;
748
+ if (!CONTACT_ROLE.test(role.text.replace(/\s+/g, "")) || role.rowSpan < 1 || i + role.rowSpan > t.rows) return false;
749
+ roleEnd = i + role.rowSpan;
750
+ return true;
751
+ });
752
+ if (!validRoles) continue;
708
753
  if (!people.some((p) => p.some(spaced))) continue;
754
+ const one = (text) => ({ text, colSpan: 1, rowSpan: 1 });
755
+ const part = (i, k) => one(people[i].map((p) => p[k]).join("\n"));
756
+ if (rows.some((r) => r[2].rowSpan > 1)) {
757
+ t.cells = rows.map((r, i) => [...r.slice(0, 3), part(i, 1), part(i, 2), part(i, 3)]);
758
+ t.cols = 6;
759
+ continue;
760
+ }
709
761
  const lead = [];
710
762
  let ok = true;
711
763
  for (const c of [0, 1]) {
@@ -726,8 +778,6 @@ function splitContactTables(blocks) {
726
778
  lead.push(col);
727
779
  }
728
780
  if (!ok) continue;
729
- const one = (text) => ({ text, colSpan: 1, rowSpan: 1 });
730
- const part = (i, k) => one(people[i].map((p) => p[k]).join("\n"));
731
781
  t.cells = rows.map((r, i) => [one(lead[0][i]), one(lead[1][i]), one(r[2].text), part(i, 1), part(i, 2), part(i, 3)]);
732
782
  t.cols = 6;
733
783
  }
@@ -1240,18 +1290,6 @@ function wordOverflows(u, d, x1, x2) {
1240
1290
  const last = U[U.length - 1], units = firstWordUnits(d.text);
1241
1291
  return units > 0 && last.r - last.l + units * (last.h || 10) > x2 - x1;
1242
1292
  }
1243
- var KO_ORDER = "\uAC00\uB098\uB2E4\uB77C\uB9C8\uBC14\uC0AC\uC544\uC790\uCC28\uCE74\uD0C0\uD30C\uD558";
1244
- function itemMark(line) {
1245
- line = flowText(line).trim();
1246
- let m = /^(\d{1,2})([.)])(?!\d)/.exec(line);
1247
- if (m) return { style: "1" + m[2], n: +m[1] };
1248
- if (m = /^\((\d{1,2})\)/.exec(line)) return { style: "(1)", n: +m[1] };
1249
- if ((m = /^([가-하])([.)])/.exec(line)) && KO_ORDER.includes(m[1])) return { style: "\uAC00" + m[2], n: KO_ORDER.indexOf(m[1]) };
1250
- if ((m = /^\(([가-하])\)/.exec(line)) && KO_ORDER.includes(m[1])) return { style: "(\uAC00)", n: KO_ORDER.indexOf(m[1]) };
1251
- if (m = /^[①-⑳]/.exec(line)) return { style: "\u2460", n: m[0].charCodeAt(0) };
1252
- if (m = /^([A-Z])\.\s/.exec(line)) return { style: "A.", n: m[1].charCodeAt(0) };
1253
- return null;
1254
- }
1255
1293
  function listContinues(u, d, multi = false) {
1256
1294
  const head = itemMark(d.text.trim());
1257
1295
  if (!head) return false;
@@ -1299,6 +1337,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1299
1337
  const a = serial(cell(u)), b = serial(cell(d));
1300
1338
  return a !== null && b === a + 1;
1301
1339
  })) return false;
1340
+ if (cut.ruled && hasNumberedRowSequence(table, owner, first)) return false;
1302
1341
  const contentPairs = pairs.filter(([u, d]) => hasContent(u.cell) && hasContent(d.cell));
1303
1342
  const carriedSplit = !textOnly && carried && !newCell && (contentPairs.length <= 1 || contentPairs.every(([, d]) => d.rs > 1) || !cut.ruled && contentPairs.some(([u, d]) => wordOverflows(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs])));
1304
1343
  if (!carriedSplit) {
@@ -1371,6 +1410,12 @@ function sameHeadShape(a, b) {
1371
1410
  }
1372
1411
  return tall;
1373
1412
  }
1413
+ function hasBoxTitle(t) {
1414
+ const titles = t.cells[0]?.filter((c) => c.text.trim()) ?? [];
1415
+ if (titles.length !== 1 || titles[0].rowSpan < 2) return false;
1416
+ const body = t.cells[titles[0].rowSpan];
1417
+ return !!body && body[0].colSpan === t.cols && !!body[0].text.trim();
1418
+ }
1374
1419
  function mergeCrossPageTables(blocks, pageHeights, lex) {
1375
1420
  mergeColumnFlow(blocks, pageHeights, lex);
1376
1421
  for (let i = blocks.length - 2; i >= 0; i--) {
@@ -1384,6 +1429,7 @@ function mergeCrossPageTables(blocks, pageHeights, lex) {
1384
1429
  if (!prev.table || !prev.bbox || !prev.pageNumber) continue;
1385
1430
  if (!curr || curr.type !== "table" || !curr.table || !curr.bbox || curr.pageNumber !== prev.pageNumber + 1) continue;
1386
1431
  if (startsWithUnitRow(prev.table) && startsWithUnitRow(curr.table)) continue;
1432
+ if (hasBoxTitle(prev.table) && hasBoxTitle(curr.table) && !rowTextsEqual(prev.table.cells[0], curr.table.cells[0]) && sameHeadShape(prev.table.cells[0], curr.table.cells[0])) continue;
1387
1433
  const joined = j === i + 1 || blocks.slice(i + 1, j).every((b) => besideOwn(b, prev, curr) || insideTable(b, prev) || insideTable(b, curr) || pageNumberBetween(b, prev, curr, pageHeights)) ? looksContinued(prev, curr, pageHeights) && !restartsTable(blocks, i, curr.table, pageHeights) ? joinClipParts(prev, curr, pageHeights, lex) ?? false : null : null;
1388
1434
  if (joined) {
1389
1435
  placeJoined(blocks, i, j, joined);
@@ -3327,7 +3373,7 @@ function mergeLinkRuns(markdown) {
3327
3373
 
3328
3374
  // src/pdf/formula-ocr.ts
3329
3375
  async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
3330
- const formulaMod = await import("./formula-XSXXXRA6.js");
3376
+ const formulaMod = await import("./formula-43QBPAL5.js");
3331
3377
  const { FormulaPipeline, ensureFormulaModels } = formulaMod;
3332
3378
  await ensureFormulaModels((p) => {
3333
3379
  if (p.phase === "download" && p.total) {
@@ -3753,10 +3799,10 @@ async function parsePdfDocument(buffer, options) {
3753
3799
  }
3754
3800
  if (targets.size > 0) {
3755
3801
  try {
3756
- const { runPdfOcr } = await import("./pdf-ocr-C5OFY2RY.js");
3802
+ const { runPdfOcr } = await import("./pdf-ocr-N5LYC5LA.js");
3757
3803
  const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
3758
3804
  const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
3759
- const { builtinOcrConfig } = await import("./pdf-ocr-C5OFY2RY.js");
3805
+ const { builtinOcrConfig } = await import("./pdf-ocr-N5LYC5LA.js");
3760
3806
  const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
3761
3807
  for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
3762
3808
  if (ocrPageBlocks.size > 0) {
@@ -4001,4 +4047,4 @@ export {
4001
4047
  parsePdfDocument,
4002
4048
  removeHeaderFooterBlocks
4003
4049
  };
4004
- //# sourceMappingURL=parser-2EIOJGOS.js.map
4050
+ //# sourceMappingURL=parser-FNUQW2F3.js.map