@clazic/kordoc 2.4.16 → 2.4.17

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/dist/index.d.cts CHANGED
@@ -421,6 +421,7 @@ interface UnifiedOcrProgressEvent {
421
421
  total?: number;
422
422
  code?: UnifiedOcrErrorCode;
423
423
  message?: string;
424
+ model?: string;
424
425
  }
425
426
  interface UnifiedOcrOptions {
426
427
  workspaceDir?: string;
package/dist/index.d.ts CHANGED
@@ -421,6 +421,7 @@ interface UnifiedOcrProgressEvent {
421
421
  total?: number;
422
422
  code?: UnifiedOcrErrorCode;
423
423
  message?: string;
424
+ model?: string;
424
425
  }
425
426
  interface UnifiedOcrOptions {
426
427
  workspaceDir?: string;
package/dist/index.js CHANGED
@@ -3115,7 +3115,7 @@ import JSZip2 from "jszip";
3115
3115
  import { DOMParser } from "@xmldom/xmldom";
3116
3116
 
3117
3117
  // src/utils.ts
3118
- var VERSION = true ? "2.4.15" : "0.0.0-dev";
3118
+ var VERSION = true ? "2.4.17" : "0.0.0-dev";
3119
3119
  function toArrayBuffer(buf) {
3120
3120
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
3121
3121
  return buf.buffer;
@@ -11349,14 +11349,14 @@ var DEFAULT_STAGE_WEIGHTS = {
11349
11349
  proofread: 10,
11350
11350
  merge: 5
11351
11351
  };
11352
- var OCR_PROMPT2 = "\uC774 \uC774\uBBF8\uC9C0 1\uC7A5\uC758 \uD14D\uC2A4\uD2B8\uC640 \uD45C\uB97C \uC694\uC57D \uC5C6\uC774 \uADF8\uB300\uB85C Markdown\uC73C\uB85C \uCD94\uCD9C\uD558\uC138\uC694. \uC808\uB300\uB85C \uB0B4\uC6A9\uC744 \uCD94\uCE21\uD558\uAC70\uB098 \uBC14\uAFB8\uC9C0 \uB9C8\uC138\uC694.";
11352
+ var OCR_PROMPT2 = "Extract all text and tables from this image exactly as-is into Markdown. Do not summarize, infer, or alter the content in any way.";
11353
11353
  var PROOFREAD_PROMPT = [
11354
- "\uC544\uB798 Markdown\uC744 \uBE44\uD30C\uAD34 \uAD50\uC815\uB9CC \uC218\uD589\uD558\uC138\uC694.",
11355
- "\uADDC\uCE59:",
11356
- "- \uC0AC\uC2E4 \uCD94\uAC00/\uC0AD\uC81C/\uCD94\uCE21 \uAE08\uC9C0",
11357
- "- \uC22B\uC790, \uB2E8\uC704, \uACE0\uC720\uBA85\uC0AC \uBCC0\uACBD \uAE08\uC9C0",
11358
- "- \uC624\uD0C8\uC790, \uB744\uC5B4\uC4F0\uAE30, \uC904\uBC14\uAFC8, Markdown \uAD6C\uC870\uB9CC \uAD50\uC815",
11359
- "- \uACB0\uACFC\uB294 Markdown \uBCF8\uBB38\uB9CC \uCD9C\uB825"
11354
+ "Perform non-destructive proofreading only on the Markdown below.",
11355
+ "Rules:",
11356
+ "- Do not add, remove, or infer any facts",
11357
+ "- Do not change numbers, units, or proper nouns",
11358
+ "- Correct only typos, spacing, line breaks, and Markdown structure",
11359
+ "- Output the corrected Markdown body only"
11360
11360
  ].join("\n");
11361
11361
  function elapsedMs(startAt) {
11362
11362
  return Math.round(performance.now() - startAt);
@@ -11391,7 +11391,7 @@ async function runUnifiedOcrPipeline(inputPath, options = {}) {
11391
11391
  await mkdir(diffDir, { recursive: true });
11392
11392
  const timingsMs = {};
11393
11393
  const markStageStart = (stage, message) => emitProgress(options.onEvent, stage, 0, stageWeights, { message, type: "stage_start" });
11394
- const markStageProgress = (stage, stagePercent, current, total, message) => emitProgress(options.onEvent, stage, stagePercent, stageWeights, { type: "stage_progress", current, total, message });
11394
+ const markStageProgress = (stage, stagePercent, current, total, message, model) => emitProgress(options.onEvent, stage, stagePercent, stageWeights, { type: "stage_progress", current, total, message, model });
11395
11395
  const markStageDone = (stage, message) => emitProgress(options.onEvent, stage, 100, stageWeights, { message, type: "stage_done" });
11396
11396
  let currentStage = "convert";
11397
11397
  const logStage = (level, stage, event, message, meta) => {
@@ -11496,7 +11496,7 @@ async function runUnifiedOcrPipeline(inputPath, options = {}) {
11496
11496
  const pagePath = join4(rawDir, `page_${String(i + 1).padStart(4, "0")}.md`);
11497
11497
  await writeFile(pagePath, markdown, "utf-8");
11498
11498
  rawPagePaths.push(pagePath);
11499
- markStageProgress("ocr", Math.round((i + 1) / images.length * 100), i + 1, images.length, `OCR ${i + 1}/${images.length}`);
11499
+ markStageProgress("ocr", Math.round((i + 1) / images.length * 100), i + 1, images.length, `OCR ${i + 1}/${images.length}`, selectedModel);
11500
11500
  logStage("debug", "ocr", "progress", "\uD398\uC774\uC9C0 OCR \uC644\uB8CC", { page: i + 1, total: images.length });
11501
11501
  }
11502
11502
  timingsMs.ocr = elapsedMs(ocrStart);
@@ -11620,7 +11620,8 @@ function emitProgress(cb, stage, stagePercent, weights, extra) {
11620
11620
  current: extra.current,
11621
11621
  total: extra.total,
11622
11622
  code: extra.code,
11623
- message: extra.message
11623
+ message: extra.message,
11624
+ model: extra.model
11624
11625
  });
11625
11626
  }
11626
11627
  async function convertWithLibreOffice(buffer, ext) {