kordoc 4.22.1 → 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.
- package/README.md +4 -1
- package/dist/{-FYKHW5G6.js → -C437ZARA.js} +11 -11
- package/dist/{chunk-5SVJU22Z.js → chunk-2X64TI7I.js} +2 -2
- package/dist/{chunk-JHHXTNZQ.js → chunk-3LJ6QO53.js} +28 -6
- package/dist/chunk-3LJ6QO53.js.map +1 -0
- package/dist/{chunk-TSZQ4LMV.js → chunk-4BJZGXNM.js} +2 -2
- package/dist/{chunk-3H5QG6I2.js → chunk-4GCS7WJJ.js} +2 -2
- package/dist/{chunk-7FASIFQP.js → chunk-56GBOIOE.js} +2 -2
- package/dist/{chunk-M2CBEXHN.cjs → chunk-AUWO57ED.cjs} +2 -2
- package/dist/{chunk-M2CBEXHN.cjs.map → chunk-AUWO57ED.cjs.map} +1 -1
- package/dist/{chunk-5FD3LAKC.js → chunk-AXR7OKQY.js} +2 -2
- package/dist/{chunk-IB5TO2CO.js → chunk-CNMUT5YW.js} +2 -2
- package/dist/{chunk-ATODI25J.js → chunk-DQXP3ELP.js} +2 -2
- package/dist/{chunk-OSFB5SQS.cjs → chunk-EKKZNKJD.cjs} +3 -3
- package/dist/{chunk-OSFB5SQS.cjs.map → chunk-EKKZNKJD.cjs.map} +1 -1
- package/dist/{chunk-EXVTF6XE.cjs → chunk-ENV25MPM.cjs} +24 -24
- package/dist/{chunk-EXVTF6XE.cjs.map → chunk-ENV25MPM.cjs.map} +1 -1
- package/dist/{chunk-YE4IN3D7.js → chunk-FPUBEM3F.js} +11 -11
- package/dist/{chunk-5VBAHUGC.js → chunk-GFQIKYBV.js} +3 -3
- package/dist/{chunk-MDS3GH43.js → chunk-GVBQVXXB.js} +2 -2
- package/dist/{chunk-ZECSXHYP.cjs → chunk-I4BS4BXE.cjs} +188 -166
- package/dist/{chunk-ZECSXHYP.cjs.map → chunk-I4BS4BXE.cjs.map} +1 -1
- package/dist/{chunk-7RND4SNB.js → chunk-IRP6QS3K.js} +3 -3
- package/dist/{chunk-R37TFXMP.js → chunk-L6N4OMKR.js} +60 -28
- package/dist/chunk-L6N4OMKR.js.map +1 -0
- package/dist/{chunk-IK4W2M4P.js → chunk-L6PFPBTK.js} +2 -2
- package/dist/{chunk-RO7AORMO.cjs → chunk-MED2MR6O.cjs} +6 -6
- package/dist/{chunk-RO7AORMO.cjs.map → chunk-MED2MR6O.cjs.map} +1 -1
- package/dist/{chunk-MGJYVNDX.js → chunk-NGDMJICC.js} +29 -7
- package/dist/{chunk-JHHXTNZQ.js.map → chunk-NGDMJICC.js.map} +1 -1
- package/dist/{chunk-SMPK5TUQ.js → chunk-QFJCEHY7.js} +2 -2
- package/dist/{chunk-M4JC7TXG.js → chunk-S4KQUVBV.js} +4 -4
- package/dist/{chunk-AIAIBNIB.js → chunk-U3TZVR7A.js} +2 -2
- package/dist/{chunk-QH4B3PL7.js → chunk-UMNKY2EZ.js} +4 -4
- package/dist/{chunk-DOBJ7BW5.js → chunk-UV2G6XFA.js} +2 -2
- package/dist/{chunk-LHO7E3RW.js → chunk-VUC4JJUM.js} +2 -2
- package/dist/{chunk-3SPOIAST.js → chunk-YOFKJ7IM.js} +2 -2
- package/dist/{chunk-ME4NQSLE.js → chunk-YTEMFVZB.js} +2 -2
- package/dist/{chunk-B35C5HJK.cjs → chunk-ZLFUZM7H.cjs} +3 -3
- package/dist/{chunk-B35C5HJK.cjs.map → chunk-ZLFUZM7H.cjs.map} +1 -1
- package/dist/chunks-MPOOHZVO.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-PYDSQGLS.cjs → formula-3TVRNJ66.cjs} +9 -9
- package/dist/{formula-PYDSQGLS.cjs.map → formula-3TVRNJ66.cjs.map} +1 -1
- package/dist/{formula-JBTYYSKB.js → formula-43QBPAL5.js} +4 -4
- package/dist/{formula-RUS4SF3O.js → formula-HUENRCPJ.js} +3 -3
- package/dist/{image-ocr-VA6WV6E4.js → image-ocr-BAHDLDV5.js} +6 -6
- package/dist/{image-ocr-QJT4EIQU.js → image-ocr-HYAKWJGE.js} +9 -9
- package/dist/{image-ocr-PLNNCEOR.cjs → image-ocr-OC3TCXMV.cjs} +17 -17
- package/dist/{image-ocr-PLNNCEOR.cjs.map → image-ocr-OC3TCXMV.cjs.map} +1 -1
- package/dist/index.cjs +356 -324
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +60 -28
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-U2YY7ATC.js → model-bundle-23WBSECG.js} +5 -5
- package/dist/{models-BOJ2SFCR.js → models-NRZQY45P.js} +5 -5
- package/dist/{parse-worker-v2-ZHMFK3U3.js → parse-worker-v2-DPNXGJ73.js} +12 -12
- package/dist/{parser-HM6N7J4R.js → parser-FNUQW2F3.js} +73 -27
- package/dist/parser-FNUQW2F3.js.map +1 -0
- package/dist/{parser-6337Z4U2.cjs → parser-OKAQRZKM.cjs} +318 -272
- package/dist/parser-OKAQRZKM.cjs.map +1 -0
- package/dist/{parser-A2EWLK2J.js → parser-XNOLC3MZ.js} +70 -24
- package/dist/parser-XNOLC3MZ.js.map +1 -0
- package/dist/pdf-ocr-6UXBIQE6.cjs +31 -0
- package/dist/{pdf-ocr-PGXNUFU7.cjs.map → pdf-ocr-6UXBIQE6.cjs.map} +1 -1
- package/dist/{pdf-ocr-JDER5BHI.js → pdf-ocr-FAGA3O6B.js} +6 -6
- package/dist/{pdf-ocr-MEVC6HXG.js → pdf-ocr-N5LYC5LA.js} +9 -9
- package/dist/{profile-io-OJ23SPYO.js → profile-io-HC6FMYX4.js} +3 -3
- package/dist/{rasterize-76CWCLSU.js → rasterize-QLTROEV2.js} +3 -3
- package/dist/{redact-doc-EZQIHRVT.js → redact-doc-V4KMM2QV.js} +11 -11
- package/dist/{render-JZFJPFWK.js → render-V4S3QLTR.js} +7 -7
- package/dist/seal-MQ5TB5YZ.js +10 -0
- package/dist/{setup-RIVS74JN.js → setup-HU7ZOQNM.js} +3 -3
- package/dist/visual-RLIFC4XC.js +21 -0
- package/dist/{watch-WMH222E5.js → watch-NPIZ6DSJ.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-MGJYVNDX.js.map +0 -1
- package/dist/chunk-R37TFXMP.js.map +0 -1
- package/dist/chunks-4XIAEJEX.js +0 -10
- package/dist/parser-6337Z4U2.cjs.map +0 -1
- package/dist/parser-A2EWLK2J.js.map +0 -1
- package/dist/parser-HM6N7J4R.js.map +0 -1
- package/dist/pdf-ocr-PGXNUFU7.cjs +0 -31
- package/dist/seal-P2NOP4LC.js +0 -10
- package/dist/visual-R5GGZBTU.js +0 -21
- /package/dist/{-FYKHW5G6.js.map → -C437ZARA.js.map} +0 -0
- /package/dist/{chunk-5SVJU22Z.js.map → chunk-2X64TI7I.js.map} +0 -0
- /package/dist/{chunk-TSZQ4LMV.js.map → chunk-4BJZGXNM.js.map} +0 -0
- /package/dist/{chunk-3H5QG6I2.js.map → chunk-4GCS7WJJ.js.map} +0 -0
- /package/dist/{chunk-7FASIFQP.js.map → chunk-56GBOIOE.js.map} +0 -0
- /package/dist/{chunk-5FD3LAKC.js.map → chunk-AXR7OKQY.js.map} +0 -0
- /package/dist/{chunk-IB5TO2CO.js.map → chunk-CNMUT5YW.js.map} +0 -0
- /package/dist/{chunk-ATODI25J.js.map → chunk-DQXP3ELP.js.map} +0 -0
- /package/dist/{chunk-YE4IN3D7.js.map → chunk-FPUBEM3F.js.map} +0 -0
- /package/dist/{chunk-5VBAHUGC.js.map → chunk-GFQIKYBV.js.map} +0 -0
- /package/dist/{chunk-MDS3GH43.js.map → chunk-GVBQVXXB.js.map} +0 -0
- /package/dist/{chunk-7RND4SNB.js.map → chunk-IRP6QS3K.js.map} +0 -0
- /package/dist/{chunk-IK4W2M4P.js.map → chunk-L6PFPBTK.js.map} +0 -0
- /package/dist/{chunk-SMPK5TUQ.js.map → chunk-QFJCEHY7.js.map} +0 -0
- /package/dist/{chunk-M4JC7TXG.js.map → chunk-S4KQUVBV.js.map} +0 -0
- /package/dist/{chunk-AIAIBNIB.js.map → chunk-U3TZVR7A.js.map} +0 -0
- /package/dist/{chunk-QH4B3PL7.js.map → chunk-UMNKY2EZ.js.map} +0 -0
- /package/dist/{chunk-DOBJ7BW5.js.map → chunk-UV2G6XFA.js.map} +0 -0
- /package/dist/{chunk-LHO7E3RW.js.map → chunk-VUC4JJUM.js.map} +0 -0
- /package/dist/{chunk-3SPOIAST.js.map → chunk-YOFKJ7IM.js.map} +0 -0
- /package/dist/{chunk-ME4NQSLE.js.map → chunk-YTEMFVZB.js.map} +0 -0
- /package/dist/{chunks-4XIAEJEX.js.map → chunks-MPOOHZVO.js.map} +0 -0
- /package/dist/{formula-JBTYYSKB.js.map → formula-43QBPAL5.js.map} +0 -0
- /package/dist/{formula-RUS4SF3O.js.map → formula-HUENRCPJ.js.map} +0 -0
- /package/dist/{image-ocr-VA6WV6E4.js.map → image-ocr-BAHDLDV5.js.map} +0 -0
- /package/dist/{image-ocr-QJT4EIQU.js.map → image-ocr-HYAKWJGE.js.map} +0 -0
- /package/dist/{model-bundle-U2YY7ATC.js.map → model-bundle-23WBSECG.js.map} +0 -0
- /package/dist/{models-BOJ2SFCR.js.map → models-NRZQY45P.js.map} +0 -0
- /package/dist/{parse-worker-v2-ZHMFK3U3.js.map → parse-worker-v2-DPNXGJ73.js.map} +0 -0
- /package/dist/{pdf-ocr-JDER5BHI.js.map → pdf-ocr-FAGA3O6B.js.map} +0 -0
- /package/dist/{pdf-ocr-MEVC6HXG.js.map → pdf-ocr-N5LYC5LA.js.map} +0 -0
- /package/dist/{profile-io-OJ23SPYO.js.map → profile-io-HC6FMYX4.js.map} +0 -0
- /package/dist/{rasterize-76CWCLSU.js.map → rasterize-QLTROEV2.js.map} +0 -0
- /package/dist/{redact-doc-EZQIHRVT.js.map → redact-doc-V4KMM2QV.js.map} +0 -0
- /package/dist/{render-JZFJPFWK.js.map → render-V4S3QLTR.js.map} +0 -0
- /package/dist/{seal-P2NOP4LC.js.map → seal-MQ5TB5YZ.js.map} +0 -0
- /package/dist/{setup-RIVS74JN.js.map → setup-HU7ZOQNM.js.map} +0 -0
- /package/dist/{visual-R5GGZBTU.js.map → visual-RLIFC4XC.js.map} +0 -0
- /package/dist/{watch-WMH222E5.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-
|
|
42
|
-
import "./chunk-
|
|
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-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
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-
|
|
54
|
+
import "./chunk-GVBQVXXB.js";
|
|
55
55
|
import {
|
|
56
56
|
blocksToMarkdown
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-U3TZVR7A.js";
|
|
58
58
|
import {
|
|
59
59
|
assertWithinRoot,
|
|
60
60
|
getAccessRoot,
|
|
61
61
|
isOfflineMode
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CNMUT5YW.js";
|
|
63
63
|
import {
|
|
64
64
|
extractFormFields,
|
|
65
65
|
fillWithUniqueGuard
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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("./-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-L6PFPBTK.js";
|
|
5
5
|
import {
|
|
6
6
|
ALL_FORMULA_MODELS,
|
|
7
7
|
getModelStatusIn,
|
|
8
8
|
getModelsDir
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
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-
|
|
104
|
+
//# sourceMappingURL=model-bundle-23WBSECG.js.map
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
ocrSourcePath,
|
|
17
17
|
parseCharacterDict,
|
|
18
18
|
resolveOcrModels
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
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-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
77
|
+
} from "./chunk-GVBQVXXB.js";
|
|
78
78
|
import {
|
|
79
79
|
WINGDINGS,
|
|
80
80
|
assignTableIds,
|
|
81
81
|
blocksToMarkdown,
|
|
82
82
|
escapeLiteralDollar
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-U3TZVR7A.js";
|
|
84
84
|
import {
|
|
85
85
|
ocrModelsCached,
|
|
86
86
|
resolveOcrModels
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
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-
|
|
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) =>
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
4050
|
+
//# sourceMappingURL=parser-FNUQW2F3.js.map
|