kordoc 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/{-3B5FDXW2.js → -LPEXY73L.js} +5 -5
  2. package/dist/{chunk-ZQOGTAT5.cjs → chunk-7UXZTZBJ.cjs} +2 -2
  3. package/dist/{chunk-ZQOGTAT5.cjs.map → chunk-7UXZTZBJ.cjs.map} +1 -1
  4. package/dist/{chunk-MZA7AXHN.js → chunk-GFS4QWB6.js} +2 -2
  5. package/dist/{chunk-PNXOUDS7.js → chunk-I6CX2RK4.js} +2 -2
  6. package/dist/{chunk-5TK4X4JQ.js → chunk-RMGYE4LT.js} +5 -5
  7. package/dist/{chunk-FU25KFFZ.js → chunk-UR34PYAC.js} +3 -3
  8. package/dist/chunk-UR34PYAC.js.map +1 -0
  9. package/dist/{chunk-5DL6VCIJ.js → chunk-YXEE3DEQ.js} +2 -2
  10. package/dist/cli.js +7 -7
  11. package/dist/index.cjs +119 -119
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.js +3 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp.js +5 -5
  16. package/dist/{parser-DKIA66MN.js → parser-664URIIW.js} +2 -2
  17. package/dist/{parser-6B7BUSX3.cjs → parser-AT22HMF5.cjs} +14 -14
  18. package/dist/{parser-6B7BUSX3.cjs.map → parser-AT22HMF5.cjs.map} +1 -1
  19. package/dist/{parser-VCJTQVAH.js → parser-LJOS7VZM.js} +3 -3
  20. package/dist/render-XWOEGE3U.js +9 -0
  21. package/dist/{watch-MQTMNUSB.js → watch-CZF6NA2V.js} +5 -5
  22. package/package.json +1 -1
  23. package/dist/chunk-FU25KFFZ.js.map +0 -1
  24. package/dist/render-4I72JOAR.js +0 -9
  25. /package/dist/{-3B5FDXW2.js.map → -LPEXY73L.js.map} +0 -0
  26. /package/dist/{chunk-MZA7AXHN.js.map → chunk-GFS4QWB6.js.map} +0 -0
  27. /package/dist/{chunk-PNXOUDS7.js.map → chunk-I6CX2RK4.js.map} +0 -0
  28. /package/dist/{chunk-5TK4X4JQ.js.map → chunk-RMGYE4LT.js.map} +0 -0
  29. /package/dist/{chunk-5DL6VCIJ.js.map → chunk-YXEE3DEQ.js.map} +0 -0
  30. /package/dist/{parser-DKIA66MN.js.map → parser-664URIIW.js.map} +0 -0
  31. /package/dist/{parser-VCJTQVAH.js.map → parser-LJOS7VZM.js.map} +0 -0
  32. /package/dist/{render-4I72JOAR.js.map → render-XWOEGE3U.js.map} +0 -0
  33. /package/dist/{watch-MQTMNUSB.js.map → watch-CZF6NA2V.js.map} +0 -0
package/dist/mcp.js CHANGED
@@ -10,22 +10,22 @@ import {
10
10
  parse,
11
11
  patchHwp,
12
12
  patchHwpx
13
- } from "./chunk-5TK4X4JQ.js";
13
+ } from "./chunk-RMGYE4LT.js";
14
14
  import {
15
15
  detectFormat,
16
16
  detectZipFormat
17
17
  } from "./chunk-MEPHGCPQ.js";
18
- import "./chunk-FU25KFFZ.js";
18
+ import "./chunk-UR34PYAC.js";
19
19
  import {
20
20
  blocksToMarkdown
21
- } from "./chunk-5DL6VCIJ.js";
21
+ } from "./chunk-YXEE3DEQ.js";
22
22
  import "./chunk-MOL7MDBG.js";
23
23
  import {
24
24
  KordocError,
25
25
  VERSION,
26
26
  sanitizeError,
27
27
  toArrayBuffer
28
- } from "./chunk-MZA7AXHN.js";
28
+ } from "./chunk-GFS4QWB6.js";
29
29
 
30
30
  // src/mcp.ts
31
31
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -196,7 +196,7 @@ server.tool(
196
196
  break;
197
197
  case "pdf":
198
198
  try {
199
- const { extractPdfMetadataOnly } = await import("./parser-VCJTQVAH.js");
199
+ const { extractPdfMetadataOnly } = await import("./parser-LJOS7VZM.js");
200
200
  metadata = await extractPdfMetadataOnly(buffer);
201
201
  } catch {
202
202
  metadata = void 0;
@@ -6,7 +6,7 @@ import {
6
6
  blocksToMarkdown,
7
7
  safeMax,
8
8
  safeMin
9
- } from "./chunk-PNXOUDS7.js";
9
+ } from "./chunk-I6CX2RK4.js";
10
10
  import {
11
11
  parsePageRange
12
12
  } from "./chunk-GE43BE46.js";
@@ -3356,4 +3356,4 @@ export {
3356
3356
  parsePdfDocument,
3357
3357
  removeHeaderFooterBlocks
3358
3358
  };
3359
- //# sourceMappingURL=parser-DKIA66MN.js.map
3359
+ //# sourceMappingURL=parser-664URIIW.js.map
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkZQOGTAT5cjs = require('./chunk-ZQOGTAT5.cjs');
9
+ var _chunk7UXZTZBJcjs = require('./chunk-7UXZTZBJ.cjs');
10
10
 
11
11
 
12
12
  var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
@@ -1976,14 +1976,14 @@ function isProseSpread(items) {
1976
1976
  for (let i = 1; i < sorted.length; i++) {
1977
1977
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
1978
1978
  }
1979
- const maxGap = _chunkZQOGTAT5cjs.safeMax.call(void 0, gaps);
1979
+ const maxGap = _chunk7UXZTZBJcjs.safeMax.call(void 0, gaps);
1980
1980
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
1981
1981
  return maxGap < 40 && avgLen < 5;
1982
1982
  }
1983
1983
  function detectColumns(yLines) {
1984
1984
  const allItems = yLines.flat();
1985
1985
  if (allItems.length === 0) return null;
1986
- const pageWidth = _chunkZQOGTAT5cjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkZQOGTAT5cjs.safeMin.call(void 0, allItems.map((i) => i.x));
1986
+ const pageWidth = _chunk7UXZTZBJcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunk7UXZTZBJcjs.safeMin.call(void 0, allItems.map((i) => i.x));
1987
1987
  if (pageWidth < 100) return null;
1988
1988
  let bigoLineIdx = -1;
1989
1989
  for (let i = 0; i < yLines.length; i++) {
@@ -2205,9 +2205,9 @@ function detectHeadings(blocks, medianFontSize) {
2205
2205
  if (/^\d+$/.test(text)) continue;
2206
2206
  const ratio = block.style.fontSize / medianFontSize;
2207
2207
  let level = 0;
2208
- if (ratio >= _chunkZQOGTAT5cjs.HEADING_RATIO_H1) level = 1;
2209
- else if (ratio >= _chunkZQOGTAT5cjs.HEADING_RATIO_H2) level = 2;
2210
- else if (ratio >= _chunkZQOGTAT5cjs.HEADING_RATIO_H3) level = 3;
2208
+ if (ratio >= _chunk7UXZTZBJcjs.HEADING_RATIO_H1) level = 1;
2209
+ else if (ratio >= _chunk7UXZTZBJcjs.HEADING_RATIO_H2) level = 2;
2210
+ else if (ratio >= _chunk7UXZTZBJcjs.HEADING_RATIO_H3) level = 3;
2211
2211
  if (level > 0) {
2212
2212
  block.type = "heading";
2213
2213
  block.level = level;
@@ -2726,7 +2726,7 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
2726
2726
  }
2727
2727
  if (remaining.length > 0) {
2728
2728
  const allY = remaining.map((i) => i.y);
2729
- const pageH = _chunkZQOGTAT5cjs.safeMax.call(void 0, allY) - _chunkZQOGTAT5cjs.safeMin.call(void 0, allY);
2729
+ const pageH = _chunk7UXZTZBJcjs.safeMax.call(void 0, allY) - _chunk7UXZTZBJcjs.safeMin.call(void 0, allY);
2730
2730
  const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
2731
2731
  const textBlocks = [];
2732
2732
  for (const group of groups) {
@@ -2902,7 +2902,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false) {
2902
2902
  blocks.push({ type: "paragraph", text: tableText, pageNumber: pageNum, bbox, style: dominantStyle(items) });
2903
2903
  } else {
2904
2904
  const allY = items.map((i) => i.y);
2905
- const pageHeight = _chunkZQOGTAT5cjs.safeMax.call(void 0, allY) - _chunkZQOGTAT5cjs.safeMin.call(void 0, allY);
2905
+ const pageHeight = _chunk7UXZTZBJcjs.safeMax.call(void 0, allY) - _chunk7UXZTZBJcjs.safeMin.call(void 0, allY);
2906
2906
  const gapThreshold = Math.max(15, pageHeight * 0.03);
2907
2907
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
2908
2908
  for (const group of orderedGroups) {
@@ -3155,7 +3155,7 @@ async function loadPdfWithTimeout(buffer) {
3155
3155
  new Promise((_, reject) => {
3156
3156
  timer = setTimeout(() => {
3157
3157
  loadingTask.destroy();
3158
- reject(new (0, _chunkZQOGTAT5cjs.KordocError)("PDF \uB85C\uB529 \uD0C0\uC784\uC544\uC6C3 (30\uCD08 \uCD08\uACFC)"));
3158
+ reject(new (0, _chunk7UXZTZBJcjs.KordocError)("PDF \uB85C\uB529 \uD0C0\uC784\uC544\uC6C3 (30\uCD08 \uCD08\uACFC)"));
3159
3159
  }, PDF_LOAD_TIMEOUT_MS);
3160
3160
  })
3161
3161
  ]);
@@ -3168,7 +3168,7 @@ async function parsePdfDocument(buffer, options) {
3168
3168
  const doc = await loadPdfWithTimeout(buffer);
3169
3169
  try {
3170
3170
  const pageCount = doc.numPages;
3171
- if (pageCount === 0) throw new (0, _chunkZQOGTAT5cjs.KordocError)("PDF\uC5D0 \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
3171
+ if (pageCount === 0) throw new (0, _chunk7UXZTZBJcjs.KordocError)("PDF\uC5D0 \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
3172
3172
  const metadata = { pageCount };
3173
3173
  await extractPdfMetadata(doc, metadata);
3174
3174
  const blocks = [];
@@ -3228,11 +3228,11 @@ async function parsePdfDocument(buffer, options) {
3228
3228
  pageText += pageText ? "\n" + t : t;
3229
3229
  }
3230
3230
  pageQuality.push(computePageQuality(i, pageText));
3231
- if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0, _chunkZQOGTAT5cjs.KordocError)("\uD14D\uC2A4\uD2B8 \uCD94\uCD9C \uD06C\uAE30 \uCD08\uACFC");
3231
+ if (totalTextBytes > MAX_TOTAL_TEXT) throw new (0, _chunk7UXZTZBJcjs.KordocError)("\uD14D\uC2A4\uD2B8 \uCD94\uCD9C \uD06C\uAE30 \uCD08\uACFC");
3232
3232
  parsedPages++;
3233
3233
  _optionalChain([options, 'optionalAccess', _36 => _36.onProgress, 'optionalCall', _37 => _37(parsedPages, totalTarget)]);
3234
3234
  } catch (pageErr) {
3235
- if (pageErr instanceof _chunkZQOGTAT5cjs.KordocError) throw pageErr;
3235
+ if (pageErr instanceof _chunk7UXZTZBJcjs.KordocError) throw pageErr;
3236
3236
  warnings.push({ page: i, message: `\uD398\uC774\uC9C0 ${i} \uD30C\uC2F1 \uC2E4\uD328: ${pageErr instanceof Error ? pageErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
3237
3237
  }
3238
3238
  }
@@ -3300,7 +3300,7 @@ async function parsePdfDocument(buffer, options) {
3300
3300
  detectKoreanListBlocks(blocks);
3301
3301
  const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3302
3302
  sanitizeBlockControlChars(blocks);
3303
- let markdown = cleanPdfText(_chunkZQOGTAT5cjs.blocksToMarkdown.call(void 0, blocks));
3303
+ let markdown = cleanPdfText(_chunk7UXZTZBJcjs.blocksToMarkdown.call(void 0, blocks));
3304
3304
  return {
3305
3305
  markdown,
3306
3306
  blocks,
@@ -3359,4 +3359,4 @@ async function extractPdfMetadataOnly(buffer) {
3359
3359
 
3360
3360
 
3361
3361
  exports.cleanPdfText = cleanPdfText; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.detectTableCaptions = detectTableCaptions; exports.extractPdfMetadataOnly = extractPdfMetadataOnly; exports.mergeCrossPageTables = mergeCrossPageTables; exports.parsePdfDocument = parsePdfDocument; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks;
3362
- //# sourceMappingURL=parser-6B7BUSX3.cjs.map
3362
+ //# sourceMappingURL=parser-AT22HMF5.cjs.map