kordoc 4.25.3 → 4.25.4
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 +3 -3
- package/dist/{chunk-NCZRKC5G.js → chunk-35WXNRU4.js} +4 -4
- package/dist/{chunk-BAYK74RD.js → chunk-4XD2IEF7.js} +10 -10
- package/dist/{chunk-JYZGHREO.js → chunk-A5DP2XNA.js} +6 -6
- package/dist/{chunk-H5JMMJSH.js → chunk-CO2A2WC5.js} +2 -2
- package/dist/{chunk-CKRFG6QS.js → chunk-E6GI46SG.js} +2 -2
- package/dist/{chunk-MLGR4AJ6.js → chunk-ERNLA4BH.js} +2 -2
- package/dist/{chunk-EL3TM6NH.js → chunk-FDGWDXAD.js} +2 -2
- package/dist/{chunk-FZNY4DWZ.js → chunk-FLHUJYGP.js} +2 -2
- package/dist/{chunk-Q4YOIJQF.js → chunk-FVDYN3E7.js} +3 -3
- package/dist/{chunk-G6HRSHV2.js → chunk-HR2KFPXI.js} +4 -4
- package/dist/{chunk-WYH2DSPZ.js → chunk-JKWHGHNW.js} +3 -3
- package/dist/{chunk-BP54NHUP.js → chunk-JNRXFGHU.js} +2 -2
- package/dist/{chunk-BP54NHUP.js.map → chunk-JNRXFGHU.js.map} +2 -2
- package/dist/{chunk-ZD2KWXR2.js → chunk-KLWTVM6B.js} +2 -2
- package/dist/{chunk-ATOUJ2QT.js → chunk-LQ3FFPJ6.js} +5 -5
- package/dist/{chunk-YJ6ZL7O2.js → chunk-M2V4WP7W.js} +33 -22
- package/dist/chunk-M2V4WP7W.js.map +7 -0
- package/dist/chunk-M3E5NYSN.js +45 -0
- package/dist/chunk-M3E5NYSN.js.map +7 -0
- package/dist/{chunk-Q525ZJZK.js → chunk-MGVESXR2.js} +129 -17
- package/dist/chunk-MGVESXR2.js.map +7 -0
- package/dist/{chunk-MJDPJ5XQ.js → chunk-PVZRQRIE.js} +3 -3
- package/dist/{chunk-NOKFHQ6K.js → chunk-RVUX6HWM.js} +2 -2
- package/dist/{chunk-7LVAULK7.js → chunk-RZOEJ5TZ.js} +2 -2
- package/dist/{chunk-S2DA7IZJ.js → chunk-SEX4BBAX.js} +2 -2
- package/dist/{chunk-HUN4CRUL.js → chunk-T7CUC2NM.js} +6 -6
- package/dist/{chunk-HWUAMWA2.js → chunk-TWAXYEO2.js} +2 -2
- package/dist/{chunk-H76I34IS.js → chunk-UAUB6Y5Z.js} +6 -6
- package/dist/{chunk-PEN2SUJQ.js → chunk-V2TGRTXA.js} +2 -2
- package/dist/{chunk-GRKTIXRO.js → chunk-XS7MBWUH.js} +2 -2
- package/dist/{chunk-44JOWCSX.js → chunk-ZG6RALGH.js} +8 -8
- package/dist/{chunk-5TRTCMDI.js → chunk-ZVBVGSXC.js} +2 -40
- package/dist/{chunk-5TRTCMDI.js.map → chunk-ZVBVGSXC.js.map} +3 -3
- package/dist/chunks-WSSD23QG.js +10 -0
- package/dist/cli.js +52 -41
- package/dist/cli.js.map +2 -2
- package/dist/{formula-3QN7DVFM.js → formula-TAHOTZCD.js} +4 -4
- package/dist/{generator-O5RTSTX6.js → generator-UNGTBZVD.js} +7 -7
- package/dist/{hancom-ZJR546EJ.js → hancom-Q3SEMBRZ.js} +2 -2
- package/dist/{image-ocr-LA3LCRXK.js → image-ocr-E3KNVXGP.js} +19 -16
- package/dist/image-ocr-E3KNVXGP.js.map +7 -0
- package/dist/index.cjs +276 -35
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +21 -20
- package/dist/mcp.js +34 -33
- package/dist/mcp.js.map +1 -1
- package/dist/memo-BK5AJ3GY.js +15 -0
- package/dist/{model-bundle-HEEEA6YP.js → model-bundle-SNYPWRM5.js} +5 -5
- package/dist/{models-BS5CBYRY.js → models-EMLB76WT.js} +5 -5
- package/dist/page-images-HZ2DRJGX.js +94 -0
- package/dist/page-images-HZ2DRJGX.js.map +7 -0
- package/dist/{parse-worker-v2-J4OWXPNE.js → parse-worker-v2-XQPQK5RR.js} +26 -23
- package/dist/parse-worker-v2-XQPQK5RR.js.map +7 -0
- package/dist/{parser-OGWIHRB7.js → parser-MAPRIHZS.js} +33 -18
- package/dist/{parser-OGWIHRB7.js.map → parser-MAPRIHZS.js.map} +3 -3
- package/dist/{pdf-ocr-DLE7J6MD.js → pdf-ocr-GB3Z5UHQ.js} +13 -10
- package/dist/{profile-io-3RT4KWON.js → profile-io-EVGG3THS.js} +3 -3
- package/dist/{rasterize-UBAGOEIC.js → rasterize-7PQL2TCQ.js} +3 -3
- package/dist/{redact-doc-7CKGFON7.js → redact-doc-364J2TKR.js} +22 -21
- package/dist/{redact-doc-7CKGFON7.js.map → redact-doc-364J2TKR.js.map} +1 -1
- package/dist/{render-HOLN6Y7J.js → render-AZ5YXHUA.js} +10 -10
- package/dist/{rewrite-fallback-O6TBXS3M.js → rewrite-fallback-VTXOOSUU.js} +12 -12
- package/dist/seal-A3HZQLN5.js +14 -0
- package/dist/{setup-HVPORSZU.js → setup-6NQLZAV2.js} +3 -3
- package/dist/{to-hwpx-VPK7TIL6.js → to-hwpx-ULUHUGBZ.js} +7 -7
- package/dist/visual-VXECTX4R.js +39 -0
- package/dist/{watch-LSDUKNBM.js → watch-5FI3NIL2.js} +23 -22
- package/dist/{watch-LSDUKNBM.js.map → watch-5FI3NIL2.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-Q525ZJZK.js.map +0 -7
- package/dist/chunk-YJ6ZL7O2.js.map +0 -7
- package/dist/chunks-EBMYAFDM.js +0 -10
- package/dist/image-ocr-LA3LCRXK.js.map +0 -7
- package/dist/memo-ZKU7B66X.js +0 -15
- package/dist/parse-worker-v2-J4OWXPNE.js.map +0 -7
- package/dist/seal-EYDUKV3T.js +0 -14
- package/dist/visual-IWW6J4I4.js +0 -38
- /package/dist/{chunk-NCZRKC5G.js.map → chunk-35WXNRU4.js.map} +0 -0
- /package/dist/{chunk-BAYK74RD.js.map → chunk-4XD2IEF7.js.map} +0 -0
- /package/dist/{chunk-JYZGHREO.js.map → chunk-A5DP2XNA.js.map} +0 -0
- /package/dist/{chunk-H5JMMJSH.js.map → chunk-CO2A2WC5.js.map} +0 -0
- /package/dist/{chunk-CKRFG6QS.js.map → chunk-E6GI46SG.js.map} +0 -0
- /package/dist/{chunk-MLGR4AJ6.js.map → chunk-ERNLA4BH.js.map} +0 -0
- /package/dist/{chunk-EL3TM6NH.js.map → chunk-FDGWDXAD.js.map} +0 -0
- /package/dist/{chunk-FZNY4DWZ.js.map → chunk-FLHUJYGP.js.map} +0 -0
- /package/dist/{chunk-Q4YOIJQF.js.map → chunk-FVDYN3E7.js.map} +0 -0
- /package/dist/{chunk-G6HRSHV2.js.map → chunk-HR2KFPXI.js.map} +0 -0
- /package/dist/{chunk-WYH2DSPZ.js.map → chunk-JKWHGHNW.js.map} +0 -0
- /package/dist/{chunk-ZD2KWXR2.js.map → chunk-KLWTVM6B.js.map} +0 -0
- /package/dist/{chunk-ATOUJ2QT.js.map → chunk-LQ3FFPJ6.js.map} +0 -0
- /package/dist/{chunk-MJDPJ5XQ.js.map → chunk-PVZRQRIE.js.map} +0 -0
- /package/dist/{chunk-NOKFHQ6K.js.map → chunk-RVUX6HWM.js.map} +0 -0
- /package/dist/{chunk-7LVAULK7.js.map → chunk-RZOEJ5TZ.js.map} +0 -0
- /package/dist/{chunk-S2DA7IZJ.js.map → chunk-SEX4BBAX.js.map} +0 -0
- /package/dist/{chunk-HUN4CRUL.js.map → chunk-T7CUC2NM.js.map} +0 -0
- /package/dist/{chunk-HWUAMWA2.js.map → chunk-TWAXYEO2.js.map} +0 -0
- /package/dist/{chunk-H76I34IS.js.map → chunk-UAUB6Y5Z.js.map} +0 -0
- /package/dist/{chunk-PEN2SUJQ.js.map → chunk-V2TGRTXA.js.map} +0 -0
- /package/dist/{chunk-GRKTIXRO.js.map → chunk-XS7MBWUH.js.map} +0 -0
- /package/dist/{chunk-44JOWCSX.js.map → chunk-ZG6RALGH.js.map} +0 -0
- /package/dist/{chunks-EBMYAFDM.js.map → chunks-WSSD23QG.js.map} +0 -0
- /package/dist/{formula-3QN7DVFM.js.map → formula-TAHOTZCD.js.map} +0 -0
- /package/dist/{generator-O5RTSTX6.js.map → generator-UNGTBZVD.js.map} +0 -0
- /package/dist/{hancom-ZJR546EJ.js.map → hancom-Q3SEMBRZ.js.map} +0 -0
- /package/dist/{memo-ZKU7B66X.js.map → memo-BK5AJ3GY.js.map} +0 -0
- /package/dist/{model-bundle-HEEEA6YP.js.map → model-bundle-SNYPWRM5.js.map} +0 -0
- /package/dist/{models-BS5CBYRY.js.map → models-EMLB76WT.js.map} +0 -0
- /package/dist/{pdf-ocr-DLE7J6MD.js.map → pdf-ocr-GB3Z5UHQ.js.map} +0 -0
- /package/dist/{profile-io-3RT4KWON.js.map → profile-io-EVGG3THS.js.map} +0 -0
- /package/dist/{rasterize-UBAGOEIC.js.map → rasterize-7PQL2TCQ.js.map} +0 -0
- /package/dist/{render-HOLN6Y7J.js.map → render-AZ5YXHUA.js.map} +0 -0
- /package/dist/{rewrite-fallback-O6TBXS3M.js.map → rewrite-fallback-VTXOOSUU.js.map} +0 -0
- /package/dist/{seal-EYDUKV3T.js.map → seal-A3HZQLN5.js.map} +0 -0
- /package/dist/{setup-HVPORSZU.js.map → setup-6NQLZAV2.js.map} +0 -0
- /package/dist/{to-hwpx-VPK7TIL6.js.map → to-hwpx-ULUHUGBZ.js.map} +0 -0
- /package/dist/{visual-IWW6J4I4.js.map → visual-VXECTX4R.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -212,6 +212,13 @@ interface ParseOptions {
|
|
|
212
212
|
* `true`: 블록을 만드는 데 쓴 줄. `"all"`: 거기에 저신뢰(conf < 0.5)로 버린 줄도 `dropped: true` 로 함께.
|
|
213
213
|
* 사용자 OcrProvider·HWP 삽입 그림 OCR 에는 줄 좌표가 없어 해당 없음 */
|
|
214
214
|
ocrLines?: boolean | "all";
|
|
215
|
+
/** `ocrLines` 의 연장 — 줄마다 인식 모델의 상위 읽기 후보를 이 개수까지 `candidates` 로 낸다 (1~5 정수, 기본 0 = 끔 — 끄면 출력 불변).
|
|
216
|
+
* `ocrLines` 와 함께 쓴다 */
|
|
217
|
+
ocrLineCandidates?: number;
|
|
218
|
+
/** 기존 OCR 경로가 읽은 페이지를 그대로 결과 `pageImages` 로 낸다 (PDF·이미지 입력, 기본 false — 끄면 출력 불변, `ocr: false` 여도 낸다).
|
|
219
|
+
* `true`·`"png"`: PNG. `"webp"`: 무손실 WebP(optional dependency `sharp`, 없으면 PNG 로 내고 경고).
|
|
220
|
+
* 누적 128MB·래스터 픽셀 합계 10억(1,000페이지)에 닿은 뒤의 페이지는 빼고 경고(`SKIPPED_IMAGE`)한다 */
|
|
221
|
+
pageImages?: boolean | "png" | "webp";
|
|
215
222
|
/** 내장 OCR 글줄 검출 모델. 기본 `"mobile"`(PP-OCRv5 mobile det, ~5MB). `"server"`: PP-OCRv5 server det(~88MB, 첫 사용 시
|
|
216
223
|
* 다운로드 — 작은 글자에 강하지만 느리다). `"medium"`: PP-OCRv6 medium det(~62MB, 첫 사용 시 다운로드 — 기울임·흐림·스캔·잡음 같은
|
|
217
224
|
* 열화 입력에 강하고 깨끗한 PDF 는 기본이 낫다). 객체: 로컬 ONNX 파일(`path` 절대 경로 + `sha256` 필수, 다르면 로드 거부) */
|
|
@@ -439,6 +446,8 @@ interface ParseSuccess extends ParseResultBase {
|
|
|
439
446
|
qualitySummary?: DocumentQualitySummary;
|
|
440
447
|
/** 내장 OCR 이 읽은 쪽별 글줄 — `ocrLines` 옵션을 켠 PDF·이미지 입력에서만(OCR 을 돌린 쪽이 없으면 빈 배열). 쪽 번호 순 */
|
|
441
448
|
ocrLines?: OcrPageLines[];
|
|
449
|
+
/** OCR 경로가 읽은 페이지 래스터 — `pageImages` 옵션을 켠 PDF·이미지 입력에서만. 쪽 번호 순 */
|
|
450
|
+
pageImages?: PageImage[];
|
|
442
451
|
/** 문서의 메모(한글 "메모 넣기") — 메모가 있는 HWPX·HWP5 문서에서만, 문서 순서 (#180). 본문 마크다운에는 섞지 않는다
|
|
443
452
|
* (`memos` 옵션을 켜면 끝에 모아 낸다) */
|
|
444
453
|
memos?: MemoNote[];
|
|
@@ -502,6 +511,27 @@ interface OcrLine {
|
|
|
502
511
|
confidence: number;
|
|
503
512
|
/** 저신뢰로 버려 블록에 들어가지 않은 줄 (`ocrLines: "all"` 일 때만) */
|
|
504
513
|
dropped?: true;
|
|
514
|
+
/** 인식 모델의 읽기 후보, 확률 내림차순 (`ocrLineCandidates` 를 켰을 때만). 줄 상자 하나를 읽어 그대로 낸 줄에만 있다 —
|
|
515
|
+
* 이어 붙였거나 다시 읽어 고친 줄에는 없다 */
|
|
516
|
+
candidates?: OcrLineCandidate[];
|
|
517
|
+
}
|
|
518
|
+
/** OCR 줄의 읽기 후보. `text` 는 표기 후처리 전의 인식 결과(앞뒤 공백만 뗌)라 줄의 `text` 와 기호·글머리에서 다를 수 있다.
|
|
519
|
+
* `probability` 는 그 읽기의 확률(같은 글이 되는 CTC 정렬을 모두 더한 값, 0~1)이라 같은 줄의 후보끼리 견줄 수 있다 — 줄의 `confidence`(가장 유력한 정렬에서 글자별 최고 확률의 평균)와는 다른 척도 */
|
|
520
|
+
interface OcrLineCandidate {
|
|
521
|
+
text: string;
|
|
522
|
+
probability: number;
|
|
523
|
+
}
|
|
524
|
+
/** 페이지 래스터 하나 (ParseSuccess.pageImages 항목) — `OcrPageLines` 의 좌표가 가리키는 래스터다. 이미지 입력은 EXIF 방향대로 세운
|
|
525
|
+
* 이미지(OCR 이 기울기를 보정했으면 보정한 것), PDF 는 OCR 배율로 렌더링한 페이지. `filename`·`mimeType`·`data` 는 `ExtractedImage` 와 같다 */
|
|
526
|
+
interface PageImage {
|
|
527
|
+
pageNumber: number;
|
|
528
|
+
/** 예: page_001.png */
|
|
529
|
+
filename: string;
|
|
530
|
+
/** 래스터 폭·높이 (px) */
|
|
531
|
+
width: number;
|
|
532
|
+
height: number;
|
|
533
|
+
mimeType: "image/png" | "image/webp";
|
|
534
|
+
data: Uint8Array;
|
|
505
535
|
}
|
|
506
536
|
/** 페이지 한 장의 마크다운 (#68). ParseSuccess.pages 항목. */
|
|
507
537
|
interface PageMarkdown {
|
|
@@ -3113,4 +3143,4 @@ interface FillFormOutput {
|
|
|
3113
3143
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
3114
3144
|
|
|
3115
3145
|
export { AGENCY_COMMON_NAME, BUILTIN_TEMPLATES, DEFAULT_REDACT_RULES, HwpxSession, PRESET_ALIAS, SPACE_EM_FIXED, SPACE_EM_FONT, VERSION, ValueCursor, addMemoHwpx, agencyNames, agencyStyle, applyMeasuredLayout, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildAgencyPack, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, convertToHwpx, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, formatGateFinding, gongmunGate, gongmunLintWarnings, hasStructuredCellContent, hwpToHwpx, hwpxToHwp, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintBlocks, lintBudgetText, lintGongmunText, lintLogicText, lintMuncheText, lintSlopText, loadAgencyPack, logicLintWarnings, markdownToHwpx, markdownToPdf, measurePdfLayout, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, packRoleWarnings, packSummary, packTemplate, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, placeTotalRow, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, resolvePackKind, runLintSuite, scanSectionXml, simulateWrap, simulateWrapKeepWord, slopLintWarnings, unknownFontWarnings, usesGaejosikMunche, usesLogicStructure, validateHwpx };
|
|
3116
|
-
export type { AddMemoResult, AgencyFont, AgencyPack, AgencyPressStyle, AgencyReportStyle, AgencyStyle, BlockCapability, BlockCapabilityInfo, BlockDiff, BlockEdit, BlockFinding, BlockSourceRef, BorderDef, BorderFillDef, BoundingBox, BuiltinTemplate, CellCapability, CellContext, CellDiff, CellProfile, CharPrDef, ChunkOptions, ClassifyContext, ClickHereField, ConvertToHwpxResult, DiffChangeType, DiffResult, DocChunk, DocumentMetadata, DocumentQualitySummary, ErrorCode, ExtractRegionOptions, ExtractTableVisualOptions, ExtractedImage, ExtractedTable, ExtractedTableCrop, FileType, FillFormOutput, FillInput, FillOutputFormat, FillResult, FillValue, FormField, FormFieldSchema, FormFieldType, FormResult, FormSchemaResult, FormatProfile, GongmunFont, GongmunGateAxis, GongmunGateFinding, GongmunGateResult, GongmunLintFinding, GongmunNumbering, GongmunOptions, GongmunPreset, GongmunPresetInput, HwpToHwpxOptions, HwpxFillResult, HwpxTheme, HwpxToHwpOptions, IRBlock, IRBlockType, IRCell, IRTable, ImageData, InlineStyle, LintBlock, LintBlocksResult, LintSuiteOptions, LintSuiteResult, MarkdownOptions, MarkdownToHwpxOptions, MeasureOptions, MeasuredLayoutResult, MemoNote, MemoOp, MemoPlacement, MuncheLineKind, MuncheLintFinding, OcrLine, OcrModelFile, OcrPageLines, OcrProvider, OutlineItem, PackKindInfo, PackManifest, PackSample, PageBBox, PageMargin, PageMarkdown, PageOptions, PageQuality, ParseFailure, ParseOptions, ParseResult, ParseSuccess, ParseWarning, PatchOptions, PatchResult, PatchSkip, PdfLayoutLevel, PdfLayoutSpec, PlaceSealResult, PrintOptions, PrintPreset, RedactHit, RedactOptions, RedactRule, RedactTextResult, RegionAsset, RenderAsset, RenderDocumentOptions, RenderDocumentResult, RenderFormat, RenderObjectType, RenderRegion, RenderScene, RenderSourceFormat, RenderSvgOptions, RenderSvgResult, ScanCell, ScanParaKind, ScanParagraph, ScanTable, ScenePage, SceneRenderOptions, SceneRenderResult, SealOp, SealPlacement, SectionScan, SpliceEdit, TRange, TableProfile, TableRepresentation, TableVisualPolicy, TotalRowPosition, ValidateIssue, ValidateResult, WarningCode, WatchOptions, WrapMode, WrapResult };
|
|
3146
|
+
export type { AddMemoResult, AgencyFont, AgencyPack, AgencyPressStyle, AgencyReportStyle, AgencyStyle, BlockCapability, BlockCapabilityInfo, BlockDiff, BlockEdit, BlockFinding, BlockSourceRef, BorderDef, BorderFillDef, BoundingBox, BuiltinTemplate, CellCapability, CellContext, CellDiff, CellProfile, CharPrDef, ChunkOptions, ClassifyContext, ClickHereField, ConvertToHwpxResult, DiffChangeType, DiffResult, DocChunk, DocumentMetadata, DocumentQualitySummary, ErrorCode, ExtractRegionOptions, ExtractTableVisualOptions, ExtractedImage, ExtractedTable, ExtractedTableCrop, FileType, FillFormOutput, FillInput, FillOutputFormat, FillResult, FillValue, FormField, FormFieldSchema, FormFieldType, FormResult, FormSchemaResult, FormatProfile, GongmunFont, GongmunGateAxis, GongmunGateFinding, GongmunGateResult, GongmunLintFinding, GongmunNumbering, GongmunOptions, GongmunPreset, GongmunPresetInput, HwpToHwpxOptions, HwpxFillResult, HwpxTheme, HwpxToHwpOptions, IRBlock, IRBlockType, IRCell, IRTable, ImageData, InlineStyle, LintBlock, LintBlocksResult, LintSuiteOptions, LintSuiteResult, MarkdownOptions, MarkdownToHwpxOptions, MeasureOptions, MeasuredLayoutResult, MemoNote, MemoOp, MemoPlacement, MuncheLineKind, MuncheLintFinding, OcrLine, OcrLineCandidate, OcrModelFile, OcrPageLines, OcrProvider, OutlineItem, PackKindInfo, PackManifest, PackSample, PageBBox, PageImage, PageMargin, PageMarkdown, PageOptions, PageQuality, ParseFailure, ParseOptions, ParseResult, ParseSuccess, ParseWarning, PatchOptions, PatchResult, PatchSkip, PdfLayoutLevel, PdfLayoutSpec, PlaceSealResult, PrintOptions, PrintPreset, RedactHit, RedactOptions, RedactRule, RedactTextResult, RegionAsset, RenderAsset, RenderDocumentOptions, RenderDocumentResult, RenderFormat, RenderObjectType, RenderRegion, RenderScene, RenderSourceFormat, RenderSvgOptions, RenderSvgResult, ScanCell, ScanParaKind, ScanParagraph, ScanTable, ScenePage, SceneRenderOptions, SceneRenderResult, SealOp, SealPlacement, SectionScan, SpliceEdit, TRange, TableProfile, TableRepresentation, TableVisualPolicy, TotalRowPosition, ValidateIssue, ValidateResult, WarningCode, WatchOptions, WrapMode, WrapResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -212,6 +212,13 @@ interface ParseOptions {
|
|
|
212
212
|
* `true`: 블록을 만드는 데 쓴 줄. `"all"`: 거기에 저신뢰(conf < 0.5)로 버린 줄도 `dropped: true` 로 함께.
|
|
213
213
|
* 사용자 OcrProvider·HWP 삽입 그림 OCR 에는 줄 좌표가 없어 해당 없음 */
|
|
214
214
|
ocrLines?: boolean | "all";
|
|
215
|
+
/** `ocrLines` 의 연장 — 줄마다 인식 모델의 상위 읽기 후보를 이 개수까지 `candidates` 로 낸다 (1~5 정수, 기본 0 = 끔 — 끄면 출력 불변).
|
|
216
|
+
* `ocrLines` 와 함께 쓴다 */
|
|
217
|
+
ocrLineCandidates?: number;
|
|
218
|
+
/** 기존 OCR 경로가 읽은 페이지를 그대로 결과 `pageImages` 로 낸다 (PDF·이미지 입력, 기본 false — 끄면 출력 불변, `ocr: false` 여도 낸다).
|
|
219
|
+
* `true`·`"png"`: PNG. `"webp"`: 무손실 WebP(optional dependency `sharp`, 없으면 PNG 로 내고 경고).
|
|
220
|
+
* 누적 128MB·래스터 픽셀 합계 10억(1,000페이지)에 닿은 뒤의 페이지는 빼고 경고(`SKIPPED_IMAGE`)한다 */
|
|
221
|
+
pageImages?: boolean | "png" | "webp";
|
|
215
222
|
/** 내장 OCR 글줄 검출 모델. 기본 `"mobile"`(PP-OCRv5 mobile det, ~5MB). `"server"`: PP-OCRv5 server det(~88MB, 첫 사용 시
|
|
216
223
|
* 다운로드 — 작은 글자에 강하지만 느리다). `"medium"`: PP-OCRv6 medium det(~62MB, 첫 사용 시 다운로드 — 기울임·흐림·스캔·잡음 같은
|
|
217
224
|
* 열화 입력에 강하고 깨끗한 PDF 는 기본이 낫다). 객체: 로컬 ONNX 파일(`path` 절대 경로 + `sha256` 필수, 다르면 로드 거부) */
|
|
@@ -439,6 +446,8 @@ interface ParseSuccess extends ParseResultBase {
|
|
|
439
446
|
qualitySummary?: DocumentQualitySummary;
|
|
440
447
|
/** 내장 OCR 이 읽은 쪽별 글줄 — `ocrLines` 옵션을 켠 PDF·이미지 입력에서만(OCR 을 돌린 쪽이 없으면 빈 배열). 쪽 번호 순 */
|
|
441
448
|
ocrLines?: OcrPageLines[];
|
|
449
|
+
/** OCR 경로가 읽은 페이지 래스터 — `pageImages` 옵션을 켠 PDF·이미지 입력에서만. 쪽 번호 순 */
|
|
450
|
+
pageImages?: PageImage[];
|
|
442
451
|
/** 문서의 메모(한글 "메모 넣기") — 메모가 있는 HWPX·HWP5 문서에서만, 문서 순서 (#180). 본문 마크다운에는 섞지 않는다
|
|
443
452
|
* (`memos` 옵션을 켜면 끝에 모아 낸다) */
|
|
444
453
|
memos?: MemoNote[];
|
|
@@ -502,6 +511,27 @@ interface OcrLine {
|
|
|
502
511
|
confidence: number;
|
|
503
512
|
/** 저신뢰로 버려 블록에 들어가지 않은 줄 (`ocrLines: "all"` 일 때만) */
|
|
504
513
|
dropped?: true;
|
|
514
|
+
/** 인식 모델의 읽기 후보, 확률 내림차순 (`ocrLineCandidates` 를 켰을 때만). 줄 상자 하나를 읽어 그대로 낸 줄에만 있다 —
|
|
515
|
+
* 이어 붙였거나 다시 읽어 고친 줄에는 없다 */
|
|
516
|
+
candidates?: OcrLineCandidate[];
|
|
517
|
+
}
|
|
518
|
+
/** OCR 줄의 읽기 후보. `text` 는 표기 후처리 전의 인식 결과(앞뒤 공백만 뗌)라 줄의 `text` 와 기호·글머리에서 다를 수 있다.
|
|
519
|
+
* `probability` 는 그 읽기의 확률(같은 글이 되는 CTC 정렬을 모두 더한 값, 0~1)이라 같은 줄의 후보끼리 견줄 수 있다 — 줄의 `confidence`(가장 유력한 정렬에서 글자별 최고 확률의 평균)와는 다른 척도 */
|
|
520
|
+
interface OcrLineCandidate {
|
|
521
|
+
text: string;
|
|
522
|
+
probability: number;
|
|
523
|
+
}
|
|
524
|
+
/** 페이지 래스터 하나 (ParseSuccess.pageImages 항목) — `OcrPageLines` 의 좌표가 가리키는 래스터다. 이미지 입력은 EXIF 방향대로 세운
|
|
525
|
+
* 이미지(OCR 이 기울기를 보정했으면 보정한 것), PDF 는 OCR 배율로 렌더링한 페이지. `filename`·`mimeType`·`data` 는 `ExtractedImage` 와 같다 */
|
|
526
|
+
interface PageImage {
|
|
527
|
+
pageNumber: number;
|
|
528
|
+
/** 예: page_001.png */
|
|
529
|
+
filename: string;
|
|
530
|
+
/** 래스터 폭·높이 (px) */
|
|
531
|
+
width: number;
|
|
532
|
+
height: number;
|
|
533
|
+
mimeType: "image/png" | "image/webp";
|
|
534
|
+
data: Uint8Array;
|
|
505
535
|
}
|
|
506
536
|
/** 페이지 한 장의 마크다운 (#68). ParseSuccess.pages 항목. */
|
|
507
537
|
interface PageMarkdown {
|
|
@@ -3113,4 +3143,4 @@ interface FillFormOutput {
|
|
|
3113
3143
|
declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
|
|
3114
3144
|
|
|
3115
3145
|
export { AGENCY_COMMON_NAME, BUILTIN_TEMPLATES, DEFAULT_REDACT_RULES, HwpxSession, PRESET_ALIAS, SPACE_EM_FIXED, SPACE_EM_FONT, VERSION, ValueCursor, addMemoHwpx, agencyNames, agencyStyle, applyMeasuredLayout, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildAgencyPack, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, convertToHwpx, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, formatGateFinding, gongmunGate, gongmunLintWarnings, hasStructuredCellContent, hwpToHwpx, hwpxToHwp, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintBlocks, lintBudgetText, lintGongmunText, lintLogicText, lintMuncheText, lintSlopText, loadAgencyPack, logicLintWarnings, markdownToHwpx, markdownToPdf, measurePdfLayout, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, packRoleWarnings, packSummary, packTemplate, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, placeTotalRow, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, resolvePackKind, runLintSuite, scanSectionXml, simulateWrap, simulateWrapKeepWord, slopLintWarnings, unknownFontWarnings, usesGaejosikMunche, usesLogicStructure, validateHwpx };
|
|
3116
|
-
export type { AddMemoResult, AgencyFont, AgencyPack, AgencyPressStyle, AgencyReportStyle, AgencyStyle, BlockCapability, BlockCapabilityInfo, BlockDiff, BlockEdit, BlockFinding, BlockSourceRef, BorderDef, BorderFillDef, BoundingBox, BuiltinTemplate, CellCapability, CellContext, CellDiff, CellProfile, CharPrDef, ChunkOptions, ClassifyContext, ClickHereField, ConvertToHwpxResult, DiffChangeType, DiffResult, DocChunk, DocumentMetadata, DocumentQualitySummary, ErrorCode, ExtractRegionOptions, ExtractTableVisualOptions, ExtractedImage, ExtractedTable, ExtractedTableCrop, FileType, FillFormOutput, FillInput, FillOutputFormat, FillResult, FillValue, FormField, FormFieldSchema, FormFieldType, FormResult, FormSchemaResult, FormatProfile, GongmunFont, GongmunGateAxis, GongmunGateFinding, GongmunGateResult, GongmunLintFinding, GongmunNumbering, GongmunOptions, GongmunPreset, GongmunPresetInput, HwpToHwpxOptions, HwpxFillResult, HwpxTheme, HwpxToHwpOptions, IRBlock, IRBlockType, IRCell, IRTable, ImageData, InlineStyle, LintBlock, LintBlocksResult, LintSuiteOptions, LintSuiteResult, MarkdownOptions, MarkdownToHwpxOptions, MeasureOptions, MeasuredLayoutResult, MemoNote, MemoOp, MemoPlacement, MuncheLineKind, MuncheLintFinding, OcrLine, OcrModelFile, OcrPageLines, OcrProvider, OutlineItem, PackKindInfo, PackManifest, PackSample, PageBBox, PageMargin, PageMarkdown, PageOptions, PageQuality, ParseFailure, ParseOptions, ParseResult, ParseSuccess, ParseWarning, PatchOptions, PatchResult, PatchSkip, PdfLayoutLevel, PdfLayoutSpec, PlaceSealResult, PrintOptions, PrintPreset, RedactHit, RedactOptions, RedactRule, RedactTextResult, RegionAsset, RenderAsset, RenderDocumentOptions, RenderDocumentResult, RenderFormat, RenderObjectType, RenderRegion, RenderScene, RenderSourceFormat, RenderSvgOptions, RenderSvgResult, ScanCell, ScanParaKind, ScanParagraph, ScanTable, ScenePage, SceneRenderOptions, SceneRenderResult, SealOp, SealPlacement, SectionScan, SpliceEdit, TRange, TableProfile, TableRepresentation, TableVisualPolicy, TotalRowPosition, ValidateIssue, ValidateResult, WarningCode, WatchOptions, WrapMode, WrapResult };
|
|
3146
|
+
export type { AddMemoResult, AgencyFont, AgencyPack, AgencyPressStyle, AgencyReportStyle, AgencyStyle, BlockCapability, BlockCapabilityInfo, BlockDiff, BlockEdit, BlockFinding, BlockSourceRef, BorderDef, BorderFillDef, BoundingBox, BuiltinTemplate, CellCapability, CellContext, CellDiff, CellProfile, CharPrDef, ChunkOptions, ClassifyContext, ClickHereField, ConvertToHwpxResult, DiffChangeType, DiffResult, DocChunk, DocumentMetadata, DocumentQualitySummary, ErrorCode, ExtractRegionOptions, ExtractTableVisualOptions, ExtractedImage, ExtractedTable, ExtractedTableCrop, FileType, FillFormOutput, FillInput, FillOutputFormat, FillResult, FillValue, FormField, FormFieldSchema, FormFieldType, FormResult, FormSchemaResult, FormatProfile, GongmunFont, GongmunGateAxis, GongmunGateFinding, GongmunGateResult, GongmunLintFinding, GongmunNumbering, GongmunOptions, GongmunPreset, GongmunPresetInput, HwpToHwpxOptions, HwpxFillResult, HwpxTheme, HwpxToHwpOptions, IRBlock, IRBlockType, IRCell, IRTable, ImageData, InlineStyle, LintBlock, LintBlocksResult, LintSuiteOptions, LintSuiteResult, MarkdownOptions, MarkdownToHwpxOptions, MeasureOptions, MeasuredLayoutResult, MemoNote, MemoOp, MemoPlacement, MuncheLineKind, MuncheLintFinding, OcrLine, OcrLineCandidate, OcrModelFile, OcrPageLines, OcrProvider, OutlineItem, PackKindInfo, PackManifest, PackSample, PageBBox, PageImage, PageMargin, PageMarkdown, PageOptions, PageQuality, ParseFailure, ParseOptions, ParseResult, ParseSuccess, ParseWarning, PatchOptions, PatchResult, PatchSkip, PdfLayoutLevel, PdfLayoutSpec, PlaceSealResult, PrintOptions, PrintPreset, RedactHit, RedactOptions, RedactRule, RedactTextResult, RegionAsset, RenderAsset, RenderDocumentOptions, RenderDocumentResult, RenderFormat, RenderObjectType, RenderRegion, RenderScene, RenderSourceFormat, RenderSvgOptions, RenderSvgResult, ScanCell, ScanParaKind, ScanParagraph, ScanTable, ScenePage, SceneRenderOptions, SceneRenderResult, SealOp, SealPlacement, SectionScan, SpliceEdit, TRange, TableProfile, TableRepresentation, TableVisualPolicy, TotalRowPosition, ValidateIssue, ValidateResult, WarningCode, WatchOptions, WrapMode, WrapResult };
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
usesGaejosikMunche,
|
|
56
56
|
usesLogicStructure,
|
|
57
57
|
validateHwpx
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-M2V4WP7W.js";
|
|
59
59
|
import {
|
|
60
60
|
blocksToPdf,
|
|
61
61
|
extractRenderedRegions,
|
|
@@ -65,17 +65,17 @@ import {
|
|
|
65
65
|
renderHtml,
|
|
66
66
|
renderHwp5Pages,
|
|
67
67
|
renderSceneToHtml
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import "./chunk-
|
|
68
|
+
} from "./chunk-ZG6RALGH.js";
|
|
69
|
+
import "./chunk-XS7MBWUH.js";
|
|
70
70
|
import {
|
|
71
71
|
blocksToPages
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-JKWHGHNW.js";
|
|
73
73
|
import {
|
|
74
74
|
extractClickHereFields,
|
|
75
75
|
patchHwp,
|
|
76
76
|
patchHwpx
|
|
77
|
-
} from "./chunk-
|
|
78
|
-
import "./chunk-
|
|
77
|
+
} from "./chunk-4XD2IEF7.js";
|
|
78
|
+
import "./chunk-V2TGRTXA.js";
|
|
79
79
|
import "./chunk-3UIIEZBT.js";
|
|
80
80
|
import {
|
|
81
81
|
AGENCY_COMMON_NAME,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
markdownToHwpx,
|
|
87
87
|
normalizeGongmunPreset,
|
|
88
88
|
placeTotalRow
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-T7CUC2NM.js";
|
|
90
90
|
import {
|
|
91
91
|
SPACE_EM_FIXED,
|
|
92
92
|
SPACE_EM_FONT,
|
|
@@ -96,14 +96,14 @@ import {
|
|
|
96
96
|
renderHwpxToSvg,
|
|
97
97
|
simulateWrap,
|
|
98
98
|
simulateWrapKeepWord
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-FVDYN3E7.js";
|
|
100
100
|
import {
|
|
101
101
|
addMemoHwpx
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-UAUB6Y5Z.js";
|
|
103
103
|
import {
|
|
104
104
|
placeSealHwpx
|
|
105
|
-
} from "./chunk-
|
|
106
|
-
import "./chunk-
|
|
105
|
+
} from "./chunk-35WXNRU4.js";
|
|
106
|
+
import "./chunk-FLHUJYGP.js";
|
|
107
107
|
import {
|
|
108
108
|
ValueCursor,
|
|
109
109
|
applySplices,
|
|
@@ -117,16 +117,16 @@ import {
|
|
|
117
117
|
isLabelCell,
|
|
118
118
|
scanSectionXml
|
|
119
119
|
} from "./chunk-OP4EPPXU.js";
|
|
120
|
-
import "./chunk-
|
|
120
|
+
import "./chunk-CO2A2WC5.js";
|
|
121
121
|
import "./chunk-HVXDD6QZ.js";
|
|
122
122
|
import {
|
|
123
123
|
convertToHwpx,
|
|
124
124
|
hwpToHwpx
|
|
125
|
-
} from "./chunk-
|
|
126
|
-
import "./chunk-
|
|
125
|
+
} from "./chunk-A5DP2XNA.js";
|
|
126
|
+
import "./chunk-LQ3FFPJ6.js";
|
|
127
127
|
import "./chunk-T3CW5OXA.js";
|
|
128
128
|
import "./chunk-CG6DUPWU.js";
|
|
129
|
-
import "./chunk-
|
|
129
|
+
import "./chunk-SEX4BBAX.js";
|
|
130
130
|
import "./chunk-63UKHBUV.js";
|
|
131
131
|
import {
|
|
132
132
|
DEFAULT_REDACT_RULES,
|
|
@@ -135,7 +135,7 @@ import {
|
|
|
135
135
|
} from "./chunk-MQCNWXMU.js";
|
|
136
136
|
import {
|
|
137
137
|
blocksToChunks
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-KLWTVM6B.js";
|
|
139
139
|
import "./chunk-W5CMIZUB.js";
|
|
140
140
|
import {
|
|
141
141
|
detectFormat,
|
|
@@ -147,18 +147,19 @@ import {
|
|
|
147
147
|
isZipFile
|
|
148
148
|
} from "./chunk-YZ3IKQLX.js";
|
|
149
149
|
import "./chunk-O5YMQ22P.js";
|
|
150
|
-
import "./chunk-
|
|
150
|
+
import "./chunk-ZVBVGSXC.js";
|
|
151
|
+
import "./chunk-M3E5NYSN.js";
|
|
151
152
|
import "./chunk-G5XEBGZD.js";
|
|
152
|
-
import "./chunk-
|
|
153
|
+
import "./chunk-JNRXFGHU.js";
|
|
153
154
|
import {
|
|
154
155
|
blocksToMarkdown,
|
|
155
156
|
flattenLayoutTables,
|
|
156
157
|
hasStructuredCellContent
|
|
157
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-E6GI46SG.js";
|
|
158
159
|
import "./chunk-RJCXOE4N.js";
|
|
159
160
|
import {
|
|
160
161
|
VERSION
|
|
161
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-RZOEJ5TZ.js";
|
|
162
163
|
export {
|
|
163
164
|
AGENCY_COMMON_NAME,
|
|
164
165
|
BUILTIN_TEMPLATES,
|
package/dist/mcp.js
CHANGED
|
@@ -51,16 +51,16 @@ import {
|
|
|
51
51
|
unknownFontWarnings,
|
|
52
52
|
usesGaejosikMunche,
|
|
53
53
|
usesLogicStructure
|
|
54
|
-
} from "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
54
|
+
} from "./chunk-M2V4WP7W.js";
|
|
55
|
+
import "./chunk-ZG6RALGH.js";
|
|
56
|
+
import "./chunk-XS7MBWUH.js";
|
|
57
|
+
import "./chunk-JKWHGHNW.js";
|
|
58
58
|
import {
|
|
59
59
|
extractHwpxMetadataOnly,
|
|
60
60
|
patchHwp,
|
|
61
61
|
patchHwpx
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import "./chunk-
|
|
62
|
+
} from "./chunk-4XD2IEF7.js";
|
|
63
|
+
import "./chunk-V2TGRTXA.js";
|
|
64
64
|
import "./chunk-3UIIEZBT.js";
|
|
65
65
|
import {
|
|
66
66
|
AGENCY_COMMON_NAME,
|
|
@@ -68,29 +68,29 @@ import {
|
|
|
68
68
|
agencyNames,
|
|
69
69
|
incompatibleGongmunWarnings,
|
|
70
70
|
markdownToHwpx
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
71
|
+
} from "./chunk-T7CUC2NM.js";
|
|
72
|
+
import "./chunk-FVDYN3E7.js";
|
|
73
|
+
import "./chunk-UAUB6Y5Z.js";
|
|
74
|
+
import "./chunk-35WXNRU4.js";
|
|
75
|
+
import "./chunk-FLHUJYGP.js";
|
|
76
76
|
import {
|
|
77
77
|
extractFormFields,
|
|
78
78
|
fillWithUniqueGuard
|
|
79
79
|
} from "./chunk-OP4EPPXU.js";
|
|
80
|
-
import "./chunk-
|
|
80
|
+
import "./chunk-CO2A2WC5.js";
|
|
81
81
|
import "./chunk-HVXDD6QZ.js";
|
|
82
82
|
import {
|
|
83
83
|
hwpToHwpx
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-A5DP2XNA.js";
|
|
85
85
|
import {
|
|
86
86
|
extractHwp5MetadataOnly
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-LQ3FFPJ6.js";
|
|
88
88
|
import "./chunk-T3CW5OXA.js";
|
|
89
89
|
import "./chunk-CG6DUPWU.js";
|
|
90
|
-
import "./chunk-
|
|
90
|
+
import "./chunk-SEX4BBAX.js";
|
|
91
91
|
import "./chunk-63UKHBUV.js";
|
|
92
92
|
import "./chunk-MQCNWXMU.js";
|
|
93
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-KLWTVM6B.js";
|
|
94
94
|
import "./chunk-W5CMIZUB.js";
|
|
95
95
|
import {
|
|
96
96
|
detectFormat,
|
|
@@ -98,18 +98,19 @@ import {
|
|
|
98
98
|
detectZipFormat
|
|
99
99
|
} from "./chunk-YZ3IKQLX.js";
|
|
100
100
|
import "./chunk-O5YMQ22P.js";
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-ZVBVGSXC.js";
|
|
102
|
+
import "./chunk-M3E5NYSN.js";
|
|
102
103
|
import "./chunk-G5XEBGZD.js";
|
|
103
|
-
import "./chunk-
|
|
104
|
+
import "./chunk-JNRXFGHU.js";
|
|
104
105
|
import {
|
|
105
106
|
blocksToMarkdown
|
|
106
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-E6GI46SG.js";
|
|
107
108
|
import "./chunk-RJCXOE4N.js";
|
|
108
109
|
import {
|
|
109
110
|
assertWithinRoot,
|
|
110
111
|
getAccessRoot,
|
|
111
112
|
isOfflineMode
|
|
112
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-RVUX6HWM.js";
|
|
113
114
|
import {
|
|
114
115
|
KordocError,
|
|
115
116
|
VERSION,
|
|
@@ -117,7 +118,7 @@ import {
|
|
|
117
118
|
routeConsoleToStderr,
|
|
118
119
|
sanitizeError,
|
|
119
120
|
toArrayBuffer
|
|
120
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-RZOEJ5TZ.js";
|
|
121
122
|
|
|
122
123
|
// src/mcp.ts
|
|
123
124
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -448,7 +449,7 @@ ${markdown}`);
|
|
|
448
449
|
break;
|
|
449
450
|
case "pdf":
|
|
450
451
|
try {
|
|
451
|
-
const { extractPdfMetadataOnly } = await import("./parser-
|
|
452
|
+
const { extractPdfMetadataOnly } = await import("./parser-MAPRIHZS.js");
|
|
452
453
|
metadata = await extractPdfMetadataOnly(buffer);
|
|
453
454
|
} catch {
|
|
454
455
|
metadata = void 0;
|
|
@@ -625,7 +626,7 @@ ${tableMarkdown}` }]
|
|
|
625
626
|
if (!parsed.success) {
|
|
626
627
|
return { content: [{ type: "text", text: `\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}` }], isError: true };
|
|
627
628
|
}
|
|
628
|
-
const { blocksToChunks } = await import("./chunks-
|
|
629
|
+
const { blocksToChunks } = await import("./chunks-WSSD23QG.js");
|
|
629
630
|
const chunks = blocksToChunks(parsed.blocks, { granularity, includeTableCells: include_table_cells });
|
|
630
631
|
return { content: [{ type: "text", text: capResponseText(JSON.stringify(chunks, null, 2)) }] };
|
|
631
632
|
} catch (err) {
|
|
@@ -905,7 +906,7 @@ ${previewMd}` }]
|
|
|
905
906
|
}
|
|
906
907
|
const image = new Uint8Array(await readFile2(imgResolved));
|
|
907
908
|
const ext = extname2(imgResolved).slice(1).toLowerCase();
|
|
908
|
-
const { placeSealHwpx } = await import("./seal-
|
|
909
|
+
const { placeSealHwpx } = await import("./seal-A3HZQLN5.js");
|
|
909
910
|
const result = await placeSealHwpx(buffer, [{
|
|
910
911
|
anchor,
|
|
911
912
|
occurrence,
|
|
@@ -961,7 +962,7 @@ ${previewMd}` }]
|
|
|
961
962
|
if (format !== "hwpx") {
|
|
962
963
|
return { content: [{ type: "text", text: `add_memo \uB294 HWPX\xB7HWP 5.x \uD30C\uC77C\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4 (\uAC10\uC9C0\uB41C \uD3EC\uB9F7: ${format}).` }], isError: true };
|
|
963
964
|
}
|
|
964
|
-
const { addMemoHwpx } = await import("./memo-
|
|
965
|
+
const { addMemoHwpx } = await import("./memo-BK5AJ3GY.js");
|
|
965
966
|
const result = await addMemoHwpx(buffer, [{ anchor, text, author, occurrence }]);
|
|
966
967
|
await mkdir(dirname2(outPath), { recursive: true });
|
|
967
968
|
await writeOutputFile(outPath, Buffer.from(result.buffer));
|
|
@@ -1003,7 +1004,7 @@ ${previewMd}` }]
|
|
|
1003
1004
|
}
|
|
1004
1005
|
const original = new Uint8Array(buffer);
|
|
1005
1006
|
const result = isHwpx ? await patchHwpx(original, edited_markdown, structure === false ? { structure: false } : void 0) : await patchHwp(original, edited_markdown);
|
|
1006
|
-
const { needsRewrite, rewriteEdited, rewritePath } = await import("./rewrite-fallback-
|
|
1007
|
+
const { needsRewrite, rewriteEdited, rewritePath } = await import("./rewrite-fallback-VTXOOSUU.js");
|
|
1007
1008
|
const rewrite = needsRewrite(result) ? await rewriteEdited(original, isHwpx, edited_markdown, result.success) : null;
|
|
1008
1009
|
const rwOut = rewrite ? safeOutputPath(rewritePath(out), /* @__PURE__ */ new Set([".hwpx"])) : void 0;
|
|
1009
1010
|
if (rewrite && rwOut) {
|
|
@@ -1072,7 +1073,7 @@ ${rewriteLine}` }] };
|
|
|
1072
1073
|
if (outPath && await isSameFile(outPath, resolved)) {
|
|
1073
1074
|
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 };
|
|
1074
1075
|
}
|
|
1075
|
-
const { redactDocument } = await import("./redact-doc-
|
|
1076
|
+
const { redactDocument } = await import("./redact-doc-364J2TKR.js");
|
|
1076
1077
|
const r = await redactDocument(buffer, { rules, maskChar: mask_char, filePath: file_path, dryRun: dry_run });
|
|
1077
1078
|
const MAX_LINES = 50;
|
|
1078
1079
|
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}`);
|
|
@@ -1147,7 +1148,7 @@ function registerRenderTools(server2) {
|
|
|
1147
1148
|
const { buffer, resolved } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
1148
1149
|
const isHwp5 = resolved.toLowerCase().endsWith(".hwp");
|
|
1149
1150
|
if (!isHwp5 && !pages && (format === "png" || format === "svg")) {
|
|
1150
|
-
const { renderHwpxToSvg } = await import("./render-
|
|
1151
|
+
const { renderHwpxToSvg } = await import("./render-AZ5YXHUA.js");
|
|
1151
1152
|
const result = await renderHwpxToSvg(buffer, { highlights, reflow: true, reflowMode: reflow_mode, password });
|
|
1152
1153
|
const summary2 = [
|
|
1153
1154
|
`\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})`,
|
|
@@ -1159,7 +1160,7 @@ function registerRenderTools(server2) {
|
|
|
1159
1160
|
summary2.push(`\uC800\uC7A5: ${outPath}`);
|
|
1160
1161
|
return { content: [{ type: "text", text: summary2.join("\n") }] };
|
|
1161
1162
|
}
|
|
1162
|
-
const { rasterizeSvg } = await import("./rasterize-
|
|
1163
|
+
const { rasterizeSvg } = await import("./rasterize-7PQL2TCQ.js");
|
|
1163
1164
|
const raster = await rasterizeSvg(result.svg, result.width, result.height, max_width_px ? { maxWidthPx: max_width_px } : void 0);
|
|
1164
1165
|
if (outPath) {
|
|
1165
1166
|
await mkdir2(dirname3(outPath), { recursive: true });
|
|
@@ -1174,7 +1175,7 @@ function registerRenderTools(server2) {
|
|
|
1174
1175
|
]
|
|
1175
1176
|
};
|
|
1176
1177
|
}
|
|
1177
|
-
const { renderDocument } = await import("./render-
|
|
1178
|
+
const { renderDocument } = await import("./render-AZ5YXHUA.js");
|
|
1178
1179
|
const { scene, assets } = await renderDocument(buffer, { format, pages, highlights, reflow: true, reflowMode: reflow_mode, maxWidthPx: max_width_px, password });
|
|
1179
1180
|
const summary = [
|
|
1180
1181
|
`\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})`,
|
|
@@ -1224,7 +1225,7 @@ function registerRenderTools(server2) {
|
|
|
1224
1225
|
try {
|
|
1225
1226
|
const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
1226
1227
|
const dir = safeOutputPath(join2(output_dir, "regions.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]regions\.json$/, "");
|
|
1227
|
-
const { extractRenderedRegions } = await import("./render-
|
|
1228
|
+
const { extractRenderedRegions } = await import("./render-AZ5YXHUA.js");
|
|
1228
1229
|
const regions = await extractRenderedRegions(buffer, { types: target, format, pages, paddingPt: padding_pt, reflow: true });
|
|
1229
1230
|
await mkdir2(dir, { recursive: true });
|
|
1230
1231
|
const ext = format === "jpeg" ? "jpg" : "png";
|
|
@@ -1260,7 +1261,7 @@ function registerRenderTools(server2) {
|
|
|
1260
1261
|
}
|
|
1261
1262
|
const { buffer } = await readValidatedFile(file_path, MAX_FILE_SIZE, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|
|
1262
1263
|
const dir = output_dir ? safeOutputPath(join2(output_dir, "tables.json"), /* @__PURE__ */ new Set([".json"])).replace(/[\\/]tables\.json$/, "") : void 0;
|
|
1263
|
-
const { extractTables } = await import("./visual-
|
|
1264
|
+
const { extractTables } = await import("./visual-VXECTX4R.js");
|
|
1264
1265
|
const tables = await extractTables(buffer, { policy: visual, format, paddingPt: padding_pt });
|
|
1265
1266
|
if (dir) await mkdir2(dir, { recursive: true });
|
|
1266
1267
|
const ext = format === "jpeg" ? "jpg" : "png";
|
|
@@ -1484,7 +1485,7 @@ ${g.blocking.map((f) => `- ${formatGateFinding(f)}`).join("\n")}` }],
|
|
|
1484
1485
|
}
|
|
1485
1486
|
let profile;
|
|
1486
1487
|
if (profile_path) {
|
|
1487
|
-
const { parseFormatProfileJson } = await import("./profile-io-
|
|
1488
|
+
const { parseFormatProfileJson } = await import("./profile-io-EVGG3THS.js");
|
|
1488
1489
|
profile = parseFormatProfileJson(await readFile3(safePath(profile_path, PROFILE_EXTENSIONS), "utf-8"));
|
|
1489
1490
|
}
|
|
1490
1491
|
const out = safeOutputPath(output_path, /* @__PURE__ */ new Set([".hwpx", ".hwp"]));
|