@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/{chunk-QR27D67R.js → chunk-W2KDIKDF.js} +2 -2
- package/dist/{chunk-RH6IBTHH.js → chunk-WM3XI23V.js} +8 -8
- package/dist/{chunk-RH6IBTHH.js.map → chunk-WM3XI23V.js.map} +1 -1
- package/dist/cli.js +5 -5
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{utils-HHJDSSR6.js → utils-DHOODYKU.js} +2 -2
- package/dist/{watch-YAILKKKP.js → watch-RM4VNOL4.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-QR27D67R.js.map → chunk-W2KDIKDF.js.map} +0 -0
- /package/dist/{utils-HHJDSSR6.js.map → utils-DHOODYKU.js.map} +0 -0
- /package/dist/{watch-YAILKKKP.js.map → watch-RM4VNOL4.js.map} +0 -0
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
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.
|
|
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 = "
|
|
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
|
-
"
|
|
11355
|
-
"
|
|
11356
|
-
"-
|
|
11357
|
-
"-
|
|
11358
|
-
"-
|
|
11359
|
-
"-
|
|
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) {
|