kordoc 4.16.2 → 4.17.0
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 +14 -13
- package/dist/{-4G6MA4X6.js → -PRAKO6M4.js} +11 -11
- package/dist/{chunk-AUWGDP4G.js → chunk-2KF5WZCR.js} +2 -2
- package/dist/{chunk-UTP2WCHS.js → chunk-4GSF2R7T.js} +4 -4
- package/dist/{chunk-TXUKTOG2.js → chunk-4XVNQAK5.js} +219 -23
- package/dist/chunk-4XVNQAK5.js.map +1 -0
- package/dist/chunk-5CDUL6PH.js +250 -0
- package/dist/chunk-5CDUL6PH.js.map +1 -0
- package/dist/{chunk-4VODJKFL.js → chunk-6RGGYQQC.js} +3 -3
- package/dist/{chunk-DES2LGFZ.js → chunk-A55JGNKD.js} +2 -2
- package/dist/chunk-AKB72TEH.cjs +248 -0
- package/dist/chunk-AKB72TEH.cjs.map +1 -0
- package/dist/{chunk-LEIAEWZ7.js → chunk-BFT5IM2R.js} +2 -2
- package/dist/{chunk-KIOQ4N37.js → chunk-BLPR4HRF.js} +2 -2
- package/dist/{chunk-JELRWAZC.js → chunk-BZG7K44Z.js} +2 -2
- package/dist/{chunk-F4NRLLY4.js → chunk-EFO6JZY6.js} +2 -2
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-JFLAM3MM.js → chunk-I5DJOP62.js} +2 -2
- package/dist/chunk-I5DJOP62.js.map +1 -0
- package/dist/chunk-J55UQC5H.cjs.map +1 -1
- package/dist/{chunk-QOCS7W7R.js → chunk-K2VYABZ3.js} +86 -43
- package/dist/chunk-K2VYABZ3.js.map +1 -0
- package/dist/chunk-MJBCXW5R.js +248 -0
- package/dist/chunk-MJBCXW5R.js.map +1 -0
- package/dist/{chunk-MLIS253L.js → chunk-ML4NHUR7.js} +2 -2
- package/dist/{chunk-GO5IFOUF.js → chunk-N6V7LQBL.js} +2 -2
- package/dist/{chunk-FKUDAIJI.cjs → chunk-O7OUX6NU.cjs} +12 -12
- package/dist/chunk-O7OUX6NU.cjs.map +1 -0
- package/dist/{chunk-S2PL227Q.js → chunk-PHID6WNG.js} +2 -2
- package/dist/{chunk-IQGIT2VX.js → chunk-QJWVMPB6.js} +34 -17
- package/dist/chunk-QJWVMPB6.js.map +1 -0
- package/dist/{chunk-STM3ORY7.cjs → chunk-QNJLLF4J.cjs} +2 -2
- package/dist/chunk-QNJLLF4J.cjs.map +1 -0
- package/dist/{chunk-FSDJLAOW.js → chunk-QPJXYJIK.js} +55 -1
- package/dist/chunk-QPJXYJIK.js.map +1 -0
- package/dist/{chunk-XTFN5WKS.cjs → chunk-R2BUANHQ.cjs} +6 -6
- package/dist/chunk-R2BUANHQ.cjs.map +1 -0
- package/dist/{chunk-OXLPVQYK.js → chunk-TDQ6XDB3.js} +3 -3
- package/dist/{chunk-SFEQYKYJ.js → chunk-WN6OD2CQ.js} +218 -22
- package/dist/chunk-WN6OD2CQ.js.map +1 -0
- package/dist/{chunk-5KS5PWJR.js → chunk-WY5JAR4O.js} +2 -2
- package/dist/{chunk-CEIATRDW.cjs → chunk-WYON5ANU.cjs} +3 -3
- package/dist/chunk-WYON5ANU.cjs.map +1 -0
- package/dist/{chunk-WDQTFAXY.cjs → chunk-XEPKOC2O.cjs} +240 -44
- package/dist/chunk-XEPKOC2O.cjs.map +1 -0
- package/dist/{chunk-7KNGSQU7.js → chunk-YZ5HHS6A.js} +2 -2
- package/dist/{chunk-P6ZDXTV6.js → chunk-ZF6KHPB7.js} +2 -2
- package/dist/chunks-YBFBLJ4G.js +10 -0
- package/dist/cli.js +36 -54
- package/dist/cli.js.map +1 -1
- package/dist/{formula-NARUOXRX.js → formula-7MMFBRGJ.js} +4 -4
- package/dist/{formula-WIMV5TUX.cjs → formula-ECNOZT36.cjs} +9 -9
- package/dist/formula-ECNOZT36.cjs.map +1 -0
- package/dist/{formula-EPKLPDU7.js → formula-SHBXRXOJ.js} +3 -3
- package/dist/{image-ocr-3WJ4QH3T.js → image-ocr-P6ECJCT2.js} +8 -8
- package/dist/{image-ocr-5BUJQ4TK.js → image-ocr-QCT3A7X5.js} +6 -6
- package/dist/{image-ocr-AXWXR6JV.cjs → image-ocr-VUDSP2B4.cjs} +15 -15
- package/dist/image-ocr-VUDSP2B4.cjs.map +1 -0
- package/dist/index.cjs +768 -710
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +106 -48
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +38 -43
- package/dist/mcp.js.map +1 -1
- package/dist/{model-bundle-IMBW7D2Z.js → model-bundle-OUHGCEZY.js} +5 -5
- package/dist/{models-SY75IBOE.js → models-6D6LMOTH.js} +5 -5
- package/dist/page-range-QHHFTL7X.cjs.map +1 -1
- package/dist/{parser-ZQM3664Z.js → parser-CTRB7PKD.js} +257 -46
- package/dist/parser-CTRB7PKD.js.map +1 -0
- package/dist/{parser-2LU4EVU3.cjs → parser-RQ4PJRTJ.cjs} +411 -200
- package/dist/parser-RQ4PJRTJ.cjs.map +1 -0
- package/dist/{parser-N6476XAC.js → parser-ZPRQ3SSU.js} +260 -49
- package/dist/parser-ZPRQ3SSU.js.map +1 -0
- package/dist/pdf-ocr-462ZFSHX.js +15 -0
- package/dist/pdf-ocr-L35FQYGP.js +18 -0
- package/dist/pdf-ocr-STK5EQFF.cjs +16 -0
- package/dist/pdf-ocr-STK5EQFF.cjs.map +1 -0
- package/dist/{profile-io-GJPKCYPT.js → profile-io-YZUW6MAN.js} +3 -3
- package/dist/{rasterize-UOALJQDS.js → rasterize-OUR2QJXX.js} +3 -3
- package/dist/{redact-doc-22SYW3KH.js → redact-doc-4OQKG4SM.js} +11 -11
- package/dist/{render-MJ4H3R23.js → render-XNO6PZJO.js} +7 -7
- package/dist/seal-CJ7C44JN.js +10 -0
- package/dist/{setup-2URYVUEO.js → setup-UU3EIHNI.js} +3 -3
- package/dist/visual-QRMRFPUK.js +20 -0
- package/dist/{watch-ALXZGTOB.js → watch-SR6Q5SQN.js} +12 -12
- package/package.json +2 -2
- package/dist/chunk-3IB7LBHC.js +0 -57
- package/dist/chunk-3IB7LBHC.js.map +0 -1
- package/dist/chunk-62W7QCEX.cjs +0 -57
- package/dist/chunk-62W7QCEX.cjs.map +0 -1
- package/dist/chunk-CEIATRDW.cjs.map +0 -1
- package/dist/chunk-FKUDAIJI.cjs.map +0 -1
- package/dist/chunk-FSDJLAOW.js.map +0 -1
- package/dist/chunk-IQGIT2VX.js.map +0 -1
- package/dist/chunk-J3IF6KGW.js +0 -59
- package/dist/chunk-J3IF6KGW.js.map +0 -1
- package/dist/chunk-JFLAM3MM.js.map +0 -1
- package/dist/chunk-QOCS7W7R.js.map +0 -1
- package/dist/chunk-SFEQYKYJ.js.map +0 -1
- package/dist/chunk-STM3ORY7.cjs.map +0 -1
- package/dist/chunk-TXUKTOG2.js.map +0 -1
- package/dist/chunk-WDQTFAXY.cjs.map +0 -1
- package/dist/chunk-XTFN5WKS.cjs.map +0 -1
- package/dist/chunks-NUNIKS2J.js +0 -10
- package/dist/formula-WIMV5TUX.cjs.map +0 -1
- package/dist/image-ocr-AXWXR6JV.cjs.map +0 -1
- package/dist/parser-2LU4EVU3.cjs.map +0 -1
- package/dist/parser-N6476XAC.js.map +0 -1
- package/dist/parser-ZQM3664Z.js.map +0 -1
- package/dist/pdf-ocr-6DEE23IP.js +0 -15
- package/dist/pdf-ocr-GHEJVPX2.cjs +0 -16
- package/dist/pdf-ocr-GHEJVPX2.cjs.map +0 -1
- package/dist/pdf-ocr-MQTWODVU.js +0 -18
- package/dist/seal-XWMRUTI4.js +0 -10
- package/dist/visual-USPS4QRC.js +0 -20
- /package/dist/{-4G6MA4X6.js.map → -PRAKO6M4.js.map} +0 -0
- /package/dist/{chunk-AUWGDP4G.js.map → chunk-2KF5WZCR.js.map} +0 -0
- /package/dist/{chunk-UTP2WCHS.js.map → chunk-4GSF2R7T.js.map} +0 -0
- /package/dist/{chunk-4VODJKFL.js.map → chunk-6RGGYQQC.js.map} +0 -0
- /package/dist/{chunk-DES2LGFZ.js.map → chunk-A55JGNKD.js.map} +0 -0
- /package/dist/{chunk-LEIAEWZ7.js.map → chunk-BFT5IM2R.js.map} +0 -0
- /package/dist/{chunk-KIOQ4N37.js.map → chunk-BLPR4HRF.js.map} +0 -0
- /package/dist/{chunk-JELRWAZC.js.map → chunk-BZG7K44Z.js.map} +0 -0
- /package/dist/{chunk-F4NRLLY4.js.map → chunk-EFO6JZY6.js.map} +0 -0
- /package/dist/{chunk-MLIS253L.js.map → chunk-ML4NHUR7.js.map} +0 -0
- /package/dist/{chunk-GO5IFOUF.js.map → chunk-N6V7LQBL.js.map} +0 -0
- /package/dist/{chunk-S2PL227Q.js.map → chunk-PHID6WNG.js.map} +0 -0
- /package/dist/{chunk-OXLPVQYK.js.map → chunk-TDQ6XDB3.js.map} +0 -0
- /package/dist/{chunk-5KS5PWJR.js.map → chunk-WY5JAR4O.js.map} +0 -0
- /package/dist/{chunk-7KNGSQU7.js.map → chunk-YZ5HHS6A.js.map} +0 -0
- /package/dist/{chunk-P6ZDXTV6.js.map → chunk-ZF6KHPB7.js.map} +0 -0
- /package/dist/{chunks-NUNIKS2J.js.map → chunks-YBFBLJ4G.js.map} +0 -0
- /package/dist/{formula-NARUOXRX.js.map → formula-7MMFBRGJ.js.map} +0 -0
- /package/dist/{formula-EPKLPDU7.js.map → formula-SHBXRXOJ.js.map} +0 -0
- /package/dist/{image-ocr-3WJ4QH3T.js.map → image-ocr-P6ECJCT2.js.map} +0 -0
- /package/dist/{image-ocr-5BUJQ4TK.js.map → image-ocr-QCT3A7X5.js.map} +0 -0
- /package/dist/{model-bundle-IMBW7D2Z.js.map → model-bundle-OUHGCEZY.js.map} +0 -0
- /package/dist/{models-SY75IBOE.js.map → models-6D6LMOTH.js.map} +0 -0
- /package/dist/{pdf-ocr-6DEE23IP.js.map → pdf-ocr-462ZFSHX.js.map} +0 -0
- /package/dist/{pdf-ocr-MQTWODVU.js.map → pdf-ocr-L35FQYGP.js.map} +0 -0
- /package/dist/{profile-io-GJPKCYPT.js.map → profile-io-YZUW6MAN.js.map} +0 -0
- /package/dist/{rasterize-UOALJQDS.js.map → rasterize-OUR2QJXX.js.map} +0 -0
- /package/dist/{redact-doc-22SYW3KH.js.map → redact-doc-4OQKG4SM.js.map} +0 -0
- /package/dist/{render-MJ4H3R23.js.map → render-XNO6PZJO.js.map} +0 -0
- /package/dist/{seal-XWMRUTI4.js.map → seal-CJ7C44JN.js.map} +0 -0
- /package/dist/{setup-2URYVUEO.js.map → setup-UU3EIHNI.js.map} +0 -0
- /package/dist/{visual-USPS4QRC.js.map → visual-QRMRFPUK.js.map} +0 -0
- /package/dist/{watch-ALXZGTOB.js.map → watch-SR6Q5SQN.js.map} +0 -0
package/dist/mcp.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
assertWithinRoot,
|
|
4
4
|
getAccessRoot,
|
|
5
5
|
isOfflineMode
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BZG7K44Z.js";
|
|
7
7
|
import {
|
|
8
8
|
APPROVAL_MAX,
|
|
9
9
|
BODY_FONTS,
|
|
@@ -20,8 +20,9 @@ import {
|
|
|
20
20
|
PRESS_CONTACT_KEYS,
|
|
21
21
|
SIZE_KEYS,
|
|
22
22
|
SIZE_PT_RANGE,
|
|
23
|
-
buildGongmunOptions
|
|
24
|
-
|
|
23
|
+
buildGongmunOptions,
|
|
24
|
+
loadGenerationImages
|
|
25
|
+
} from "./chunk-QPJXYJIK.js";
|
|
25
26
|
import {
|
|
26
27
|
BUILTIN_TEMPLATES,
|
|
27
28
|
PRESET_ALIAS,
|
|
@@ -42,25 +43,25 @@ import {
|
|
|
42
43
|
resolveBuiltinTemplate,
|
|
43
44
|
unknownFontWarnings,
|
|
44
45
|
usesGaejosikMunche
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-K2VYABZ3.js";
|
|
47
|
+
import "./chunk-2KF5WZCR.js";
|
|
48
|
+
import "./chunk-6RGGYQQC.js";
|
|
48
49
|
import "./chunk-3WSNLH4B.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-N6V7LQBL.js";
|
|
50
51
|
import {
|
|
51
52
|
detectFormat,
|
|
52
53
|
detectOle2Format,
|
|
53
54
|
detectZipFormat,
|
|
54
55
|
extractHwp5MetadataOnly
|
|
55
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-QJWVMPB6.js";
|
|
56
57
|
import "./chunk-7FCNOKOR.js";
|
|
57
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-5CDUL6PH.js";
|
|
58
59
|
import "./chunk-VQFA55IC.js";
|
|
59
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-I5DJOP62.js";
|
|
60
61
|
import {
|
|
61
62
|
blocksToMarkdown
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import "./chunk-
|
|
63
|
+
} from "./chunk-BFT5IM2R.js";
|
|
64
|
+
import "./chunk-PHID6WNG.js";
|
|
64
65
|
import {
|
|
65
66
|
KordocError,
|
|
66
67
|
VERSION,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
routeConsoleToStderr,
|
|
69
70
|
sanitizeError,
|
|
70
71
|
toArrayBuffer
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ZF6KHPB7.js";
|
|
72
73
|
|
|
73
74
|
// src/mcp.ts
|
|
74
75
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -215,13 +216,14 @@ function registerParseTools(server2) {
|
|
|
215
216
|
keep_trailing_empty_cols: z.boolean().optional().describe("\uD45C \uC624\uB978\uCABD \uB05D \uBE48 \uC5F4(\uC11C\uC2DD \uC785\uB825\uB780) \uBCF4\uC874 (#47, \uAE30\uBCF8 off: \uD6C4\uD589 \uBE48 \uC5F4 \uD2B8\uB9BC, CLI --keep-empty-cols \uB300\uC751)"),
|
|
216
217
|
keep_empty_paragraphs: z.boolean().optional().describe("\uBE48 \uBB38\uB2E8 \uBCF4\uC874 \u2014 \uBCF8\uBB38\uC740 \uBE48 paragraph \uBE14\uB85D, \uD45C \uC140\uC740 \uBE48 \uC904 (#57, \uAE30\uBCF8 off, CLI --keep-empty-paragraphs \uB300\uC751)"),
|
|
217
218
|
include_field_placeholders: z.boolean().optional().describe("\uBBF8\uAE30\uC785 \uB204\uB984\uD2C0 \uC548\uB0B4\uBB38\uB3C4 \uCD9C\uB825 \u2014 \uBE48 \uC11C\uC2DD \uBB38\uC11C\uC758 \uCE78 \uC6A9\uB3C4 \uBCF4\uC874 (#92, \uAE30\uBCF8 off, CLI --include-field-placeholders \uB300\uC751)"),
|
|
219
|
+
keep_layout_tables: z.boolean().optional().describe("\uD14C\uB450\uB9AC\uAC00 \uC548 \uBCF4\uC774\uB294 \uD2C0 \uD45C\uB3C4 \uC6D0\uBCF8 \uD45C \uAD6C\uC870 \uADF8\uB300\uB85C (\uAE30\uBCF8 off = \uBCF4\uC774\uB294 \uB300\uB85C: \uD2C0\uC740 \uAE00, \uCE78\uC73C\uB85C \uC870\uB9BD\uD55C \uBD84\uC218\uB294 \uC218\uC2DD). patch_document \uB85C \uB418\uB3CC\uB9B4 \uD3B8\uC9D1\uBCF8\uC740 \uCF1C\uC11C \uBF51\uB294\uB2E4 (CLI --keep-layout-tables)"),
|
|
218
220
|
html_tables: z.boolean().optional().describe("\uBAA8\uB4E0 \uD45C\uB97C HTML \uB85C \u2014 \uD30C\uC774\uD504 \uD45C\uB3C4 HTML \uD45C\uB85C, \uD0DC\uADF8\uB9C8\uB2E4 \uD55C \uC904\uC529 \uB4E4\uC5EC\uC368 \uB0C4 (\uAE30\uBCF8 off, CLI --html-tables \uB300\uC751)"),
|
|
219
221
|
script_tags: z.boolean().optional().describe('\uC704\xB7\uC544\uB798\uCCA8\uC790\uB97C <sup>\xB7<sub> \uB85C \uD45C\uAE30("10\u2074 m\xB2" \uAC00 "104 m2" \uB85C \uD3B4\uC9C0\uC9C0 \uC54A\uAC8C) \u2014 \uAE30\uBCF8: HWPX\xB7HWP\xB7DOCX \uCF2C, PDF \uB054(\uB17C\uBB38\xB7\uC218\uC2DD PDF \uB294 true \uAD8C\uC7A5), false \uBA74 \uBAA8\uB450 \uD3C9\uBB38. CLI --script-tags / --no-script-tags \uB300\uC751'),
|
|
220
222
|
plain: z.boolean().optional().describe("\uD3C9\uBB38 Markdown \u2014 \uADF8\uB9BC \uC790\uB9AC \uD45C\uC2DC\xB7\uB9C1\uD06C URL\xB7\uBC11\uC904/\uAD75\uAC8C \uD45C\uAE30\uB97C \uBE7C\uACE0 \uAE00\uB9CC (\uC81C\uBAA9\xB7\uBAA9\uB85D\xB7\uD45C \uAD6C\uC870\uB294 \uC720\uC9C0, \uAE30\uBCF8 off, CLI --plain \uB300\uC751)"),
|
|
221
223
|
password: z.string().optional().describe("\uC554\uD638\uB85C \uBCF4\uD638\uB41C \uBB38\uC11C\uC758 \uC5F4\uAE30 \uC554\uD638 (#59, HWPX\xB7HWP3\xB7HWP5 \uC9C0\uC6D0. \uD30C\uC2F1\uC774 ENCRYPTED\uB85C \uC2E4\uD328\uD558\uBA74 \uC774 \uC635\uC158\uC73C\uB85C \uC7AC\uC2DC\uB3C4\uD558\uC138\uC694. \uD55C\uCEF4 DRM \uBCF4\uD638 \uBB38\uC11C\uB294 \uD574\uB2F9 \uC5C6\uC74C)"),
|
|
222
224
|
tables: z.boolean().optional().describe("PDF \uD45C \uAC10\uC9C0 (\uAE30\uBCF8 true \u2014 false\uB85C \uB044\uAE30, CLI --no-tables \uB300\uC751). \uD14C\uB450\uB9AC \uBC15\uC2A4\uB97C \uD45C\uB85C \uC624\uC778\uD574 \uC77D\uAE30 \uC21C\uC11C\uAC00 \uB4A4\uC9D1\uD788\uB294 \uBB38\uC11C(2\uB2E8 \uC2DC\uD5D8\uC9C0 \uB4F1)\uC5D0\uC11C \uC790\uC5F0 \uC77D\uAE30\uC21C \uD14D\uC2A4\uD2B8\uB9CC \uBF51\uC2B5\uB2C8\uB2E4 (#64)")
|
|
223
225
|
},
|
|
224
|
-
async ({ file_path, ocr, remove_header_footer, formula_ocr, dedupe_running_headers, keep_trailing_empty_cols, keep_empty_paragraphs, include_field_placeholders, html_tables, script_tags, plain, password, tables }) => {
|
|
226
|
+
async ({ file_path, ocr, remove_header_footer, formula_ocr, dedupe_running_headers, keep_trailing_empty_cols, keep_empty_paragraphs, include_field_placeholders, keep_layout_tables, html_tables, script_tags, plain, password, tables }) => {
|
|
225
227
|
try {
|
|
226
228
|
const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, PARSE_EXTENSIONS);
|
|
227
229
|
const format = detectFormat(buffer);
|
|
@@ -243,6 +245,7 @@ function registerParseTools(server2) {
|
|
|
243
245
|
...plain ? { plain: true } : {},
|
|
244
246
|
...script_tags !== void 0 ? { scriptTags: script_tags } : {},
|
|
245
247
|
...html_tables ? { htmlTables: true } : {},
|
|
248
|
+
...keep_layout_tables ? { layoutTables: "keep" } : {},
|
|
246
249
|
...password ? { password } : {},
|
|
247
250
|
...tables === false ? { tables: false } : {}
|
|
248
251
|
});
|
|
@@ -352,7 +355,7 @@ ${markdown}`);
|
|
|
352
355
|
break;
|
|
353
356
|
case "pdf":
|
|
354
357
|
try {
|
|
355
|
-
const { extractPdfMetadataOnly } = await import("./parser-
|
|
358
|
+
const { extractPdfMetadataOnly } = await import("./parser-ZPRQ3SSU.js");
|
|
356
359
|
metadata = await extractPdfMetadataOnly(buffer);
|
|
357
360
|
} catch {
|
|
358
361
|
metadata = void 0;
|
|
@@ -528,7 +531,7 @@ ${tableMarkdown}` }]
|
|
|
528
531
|
if (!parsed.success) {
|
|
529
532
|
return { content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}` }], isError: true };
|
|
530
533
|
}
|
|
531
|
-
const { blocksToChunks } = await import("./chunks-
|
|
534
|
+
const { blocksToChunks } = await import("./chunks-YBFBLJ4G.js");
|
|
532
535
|
const chunks = blocksToChunks(parsed.blocks, { granularity, includeTableCells: include_table_cells });
|
|
533
536
|
return { content: [{ type: "text", text: capResponseText(JSON.stringify(chunks, null, 2)) }] };
|
|
534
537
|
} catch (err) {
|
|
@@ -569,7 +572,7 @@ function registerFormTools(server2) {
|
|
|
569
572
|
async ({ file_path }) => {
|
|
570
573
|
try {
|
|
571
574
|
const { buffer } = await readValidatedFile(file_path);
|
|
572
|
-
const result = await parse(buffer, { keepTrailingEmptyCols: true });
|
|
575
|
+
const result = await parse(buffer, { keepTrailingEmptyCols: true, layoutTables: "keep" });
|
|
573
576
|
if (!result.success) {
|
|
574
577
|
return {
|
|
575
578
|
content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${result.error}` }],
|
|
@@ -640,7 +643,7 @@ function registerFormTools(server2) {
|
|
|
640
643
|
const hwpxResult = require_unique ? await fillWithUniqueGuard(inputs, (vals, blocked) => fillHwpx(buffer, vals, blocked)) : { ...await fillHwpx(buffer, inputs), rejected: [] };
|
|
641
644
|
let verifyLine = null;
|
|
642
645
|
if (mask_values && hwpxResult.filled.length > 0) {
|
|
643
|
-
const reparsed = await parse(Buffer.from(hwpxResult.buffer));
|
|
646
|
+
const reparsed = await parse(Buffer.from(hwpxResult.buffer), { layoutTables: "keep" });
|
|
644
647
|
const norm = (s) => s.replace(/\\([\\`*_{}[\]()#+.!|~>-])/g, "$1").replace(/\s+/g, " ");
|
|
645
648
|
const normMd = reparsed.success ? norm(reparsed.markdown) : "";
|
|
646
649
|
const okCount = reparsed.success ? hwpxResult.filled.filter((f) => f.value !== "" && normMd.includes(norm(f.value))).length : 0;
|
|
@@ -674,7 +677,7 @@ ${filledList}
|
|
|
674
677
|
\u26A0\uFE0F output_path\uB97C \uC9C0\uC815\uD558\uBA74 \uC6D0\uBCF8 \uC11C\uC2DD\uC774 \uC720\uC9C0\uB41C HWPX \uD30C\uC77C\uB85C \uC800\uC7A5\uB429\uB2C8\uB2E4.` }]
|
|
675
678
|
};
|
|
676
679
|
}
|
|
677
|
-
const result = await parse(buffer, { keepTrailingEmptyCols: true });
|
|
680
|
+
const result = await parse(buffer, { keepTrailingEmptyCols: true, layoutTables: "keep" });
|
|
678
681
|
if (!result.success) {
|
|
679
682
|
return {
|
|
680
683
|
content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${result.error}` }],
|
|
@@ -773,7 +776,7 @@ ${previewMd}` }]
|
|
|
773
776
|
}
|
|
774
777
|
const image = new Uint8Array(await readFile2(imgResolved));
|
|
775
778
|
const ext = extname2(imgResolved).slice(1).toLowerCase();
|
|
776
|
-
const { placeSealHwpx } = await import("./seal-
|
|
779
|
+
const { placeSealHwpx } = await import("./seal-CJ7C44JN.js");
|
|
777
780
|
const result = await placeSealHwpx(buffer, [{
|
|
778
781
|
anchor,
|
|
779
782
|
occurrence,
|
|
@@ -810,7 +813,7 @@ ${previewMd}` }]
|
|
|
810
813
|
"\uC6D0\uBCF8 HWPX/HWP\uC758 \uC11C\uC2DD(\uAE00\uAF34\xB7\uD45C\xB7\uB3C4\uC7A5\uCE78\xB7\uC774\uBBF8\uC9C0)\uC744 1\uBC14\uC774\uD2B8\uB3C4 \uAC74\uB4DC\uB9AC\uC9C0 \uC54A\uACE0, \uD3B8\uC9D1\uB41C \uB9C8\uD06C\uB2E4\uC6B4\uC758 \uBC14\uB010 \uD14D\uC2A4\uD2B8\uB9CC \uC81C\uC790\uB9AC \uCE58\uD658\uD574 \uC0C8 \uBB38\uC11C\uB85C \uCD9C\uB825\uD569\uB2C8\uB2E4. parse_document\uB85C \uC5BB\uC740 \uB9C8\uD06C\uB2E4\uC6B4\uC744 \uC218\uC815\uD574 \uB118\uAE30\uC138\uC694 \u2014 \uC591\uC2DD \uBE48\uCE78 \uCC44\uC6B0\uAE30\xB7\uBB38\uAD6C \uC218\uC815\uC5D0 \uC801\uD569\uD558\uBA70 \uD55C\uCEF4 \uD55C\uAE00\uC5D0\uC11C \uBCC0\uC870 \uACBD\uACE0 \uC5C6\uC774 \uC5F4\uB9BD\uB2C8\uB2E4. (\uBE14\uB85D \uCD94\uAC00/\uC0AD\uC81C\xB7\uD45C \uAD6C\uC870 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0, \uBBF8\uC801\uC6A9 \uD56D\uBAA9\uC740 \uACB0\uACFC\uC5D0 \uBCF4\uACE0)",
|
|
811
814
|
{
|
|
812
815
|
file_path: z2.string().min(1).describe("\uC6D0\uBCF8 \uBB38\uC11C\uC758 \uC808\uB300 \uACBD\uB85C (HWPX \uB610\uB294 HWP 5.x)"),
|
|
813
|
-
edited_markdown: z2.string().min(1).describe("parse_document \uCD9C\uB825 \uB9C8\uD06C\uB2E4\uC6B4\uC744 \uD3B8\uC9D1\uD55C \uC804\uCCB4 \uB9C8\uD06C\uB2E4\uC6B4. \uBC14\uB010 \uBB38\uB2E8/\uC140 \uD14D\uC2A4\uD2B8\uB9CC \uBC18\uC601\uD558\uACE0 \uBE14\uB85D \uC218\xB7\uC21C\uC11C\uB294 \uC6D0\uBCF8\uACFC \uAC19\uAC8C \uC720\uC9C0\uD558\uC138\uC694"),
|
|
816
|
+
edited_markdown: z2.string().min(1).describe("parse_document(keep_layout_tables: true) \uCD9C\uB825 \uB9C8\uD06C\uB2E4\uC6B4\uC744 \uD3B8\uC9D1\uD55C \uC804\uCCB4 \uB9C8\uD06C\uB2E4\uC6B4. \uBC14\uB010 \uBB38\uB2E8/\uC140 \uD14D\uC2A4\uD2B8\uB9CC \uBC18\uC601\uD558\uACE0 \uBE14\uB85D \uC218\xB7\uC21C\uC11C\uB294 \uC6D0\uBCF8\uACFC \uAC19\uAC8C \uC720\uC9C0\uD558\uC138\uC694"),
|
|
814
817
|
output_path: z2.string().min(1).describe("\uCD9C\uB825 \uD30C\uC77C \uC800\uC7A5 \uC808\uB300 \uACBD\uB85C (\uC6D0\uBCF8\uACFC \uAC19\uC740 \uD655\uC7A5\uC790: .hwpx \uB610\uB294 .hwp)")
|
|
815
818
|
},
|
|
816
819
|
async ({ file_path, edited_markdown, output_path }) => {
|
|
@@ -890,7 +893,7 @@ ${previewMd}` }]
|
|
|
890
893
|
if (outPath && await isSameFile(outPath, resolved)) {
|
|
891
894
|
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 };
|
|
892
895
|
}
|
|
893
|
-
const { redactDocument } = await import("./redact-doc-
|
|
896
|
+
const { redactDocument } = await import("./redact-doc-4OQKG4SM.js");
|
|
894
897
|
const r = await redactDocument(buffer, { rules, maskChar: mask_char, filePath: file_path, dryRun: dry_run });
|
|
895
898
|
const MAX_LINES = 50;
|
|
896
899
|
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}`);
|
|
@@ -964,7 +967,7 @@ function registerRenderTools(server2) {
|
|
|
964
967
|
const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
965
968
|
const isHwp5 = resolved.toLowerCase().endsWith(".hwp");
|
|
966
969
|
if (!isHwp5 && !pages && (format === "png" || format === "svg")) {
|
|
967
|
-
const { renderHwpxToSvg } = await import("./render-
|
|
970
|
+
const { renderHwpxToSvg } = await import("./render-XNO6PZJO.js");
|
|
968
971
|
const result = await renderHwpxToSvg(buffer, { highlights, reflow: true, reflowMode: reflow_mode });
|
|
969
972
|
const summary2 = [
|
|
970
973
|
`\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})`,
|
|
@@ -976,7 +979,7 @@ function registerRenderTools(server2) {
|
|
|
976
979
|
summary2.push(`\uC800\uC7A5: ${outPath}`);
|
|
977
980
|
return { content: [{ type: "text", text: summary2.join("\n") }] };
|
|
978
981
|
}
|
|
979
|
-
const { rasterizeSvg } = await import("./rasterize-
|
|
982
|
+
const { rasterizeSvg } = await import("./rasterize-OUR2QJXX.js");
|
|
980
983
|
const raster = await rasterizeSvg(result.svg, result.width, result.height, max_width_px ? { maxWidthPx: max_width_px } : void 0);
|
|
981
984
|
if (outPath) {
|
|
982
985
|
await mkdir2(dirname3(outPath), { recursive: true });
|
|
@@ -991,7 +994,7 @@ function registerRenderTools(server2) {
|
|
|
991
994
|
]
|
|
992
995
|
};
|
|
993
996
|
}
|
|
994
|
-
const { renderDocument } = await import("./render-
|
|
997
|
+
const { renderDocument } = await import("./render-XNO6PZJO.js");
|
|
995
998
|
const { scene, assets } = await renderDocument(buffer, { format, pages, highlights, reflow: true, reflowMode: reflow_mode, maxWidthPx: max_width_px });
|
|
996
999
|
const summary = [
|
|
997
1000
|
`\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})`,
|
|
@@ -1041,7 +1044,7 @@ function registerRenderTools(server2) {
|
|
|
1041
1044
|
try {
|
|
1042
1045
|
const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
1043
1046
|
const dir = safeOutputPath(join2(output_dir, "regions.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]regions\.json$/, "");
|
|
1044
|
-
const { extractRenderedRegions } = await import("./render-
|
|
1047
|
+
const { extractRenderedRegions } = await import("./render-XNO6PZJO.js");
|
|
1045
1048
|
const regions = await extractRenderedRegions(buffer, { types: target, format, pages, paddingPt: padding_pt, reflow: true });
|
|
1046
1049
|
await mkdir2(dir, { recursive: true });
|
|
1047
1050
|
const ext = format === "jpeg" ? "jpg" : "png";
|
|
@@ -1077,7 +1080,7 @@ function registerRenderTools(server2) {
|
|
|
1077
1080
|
}
|
|
1078
1081
|
const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
1079
1082
|
const dir = output_dir ? safeOutputPath(join2(output_dir, "tables.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]tables\.json$/, "") : void 0;
|
|
1080
|
-
const { extractTables } = await import("./visual-
|
|
1083
|
+
const { extractTables } = await import("./visual-QRMRFPUK.js");
|
|
1081
1084
|
const tables = await extractTables(buffer, { policy: visual, format, paddingPt: padding_pt });
|
|
1082
1085
|
if (dir) await mkdir2(dir, { recursive: true });
|
|
1083
1086
|
const ext = format === "jpeg" ? "jpg" : "png";
|
|
@@ -1120,8 +1123,8 @@ ${json}` }] };
|
|
|
1120
1123
|
|
|
1121
1124
|
// src/mcp/tools-generate.ts
|
|
1122
1125
|
import { z as z4 } from "zod";
|
|
1123
|
-
import { readFile as readFile3, mkdir as mkdir3
|
|
1124
|
-
import {
|
|
1126
|
+
import { readFile as readFile3, mkdir as mkdir3 } from "fs/promises";
|
|
1127
|
+
import { dirname as dirname4 } from "path";
|
|
1125
1128
|
function registerGenerateTools(server2) {
|
|
1126
1129
|
server2.tool(
|
|
1127
1130
|
"extract_profile",
|
|
@@ -1134,7 +1137,7 @@ function registerGenerateTools(server2) {
|
|
|
1134
1137
|
try {
|
|
1135
1138
|
const out = safeOutputPath(output_path, PROFILE_EXTENSIONS);
|
|
1136
1139
|
const { buffer } = await readValidatedFile(hwpx_path);
|
|
1137
|
-
const { hwpxToProfile } = await import("./-
|
|
1140
|
+
const { hwpxToProfile } = await import("./-PRAKO6M4.js");
|
|
1138
1141
|
const profile = await hwpxToProfile(buffer);
|
|
1139
1142
|
await mkdir3(dirname4(out), { recursive: true });
|
|
1140
1143
|
await writeOutputFile(out, JSON.stringify(profile, null, 2));
|
|
@@ -1241,7 +1244,7 @@ function registerGenerateTools(server2) {
|
|
|
1241
1244
|
}
|
|
1242
1245
|
let profile;
|
|
1243
1246
|
if (profile_path) {
|
|
1244
|
-
const { parseFormatProfileJson } = await import("./profile-io-
|
|
1247
|
+
const { parseFormatProfileJson } = await import("./profile-io-YZUW6MAN.js");
|
|
1245
1248
|
profile = parseFormatProfileJson(await readFile3(safePath(profile_path, PROFILE_EXTENSIONS), "utf-8"));
|
|
1246
1249
|
}
|
|
1247
1250
|
const out = safeOutputPath(output_path, /* @__PURE__ */ new Set([".hwpx"]));
|
|
@@ -1252,21 +1255,13 @@ function registerGenerateTools(server2) {
|
|
|
1252
1255
|
...header ? { header } : {},
|
|
1253
1256
|
...footer ? { footer } : {}
|
|
1254
1257
|
} : void 0;
|
|
1258
|
+
const genWarnings = [];
|
|
1255
1259
|
let images;
|
|
1256
1260
|
if (image_dir) {
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
const url = m[1];
|
|
1261
|
-
if (!/^[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/.test(url) || url.includes("..")) continue;
|
|
1262
|
-
try {
|
|
1263
|
-
images ??= {};
|
|
1264
|
-
images[url] = new Uint8Array(await readFile3(join3(dir, url)));
|
|
1265
|
-
} catch {
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1261
|
+
const loaded = await loadGenerationImages(markdown, image_dir, assertWithinRoot);
|
|
1262
|
+
images = loaded.images;
|
|
1263
|
+
genWarnings.push(...loaded.warnings);
|
|
1268
1264
|
}
|
|
1269
|
-
const genWarnings = [];
|
|
1270
1265
|
const buf = await markdownToHwpx(markdown, gongmun || profile || page || images ? {
|
|
1271
1266
|
...gongmun ? { gongmun } : {},
|
|
1272
1267
|
...profile ? { profile } : {},
|