@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/cli.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
markdownToHwpx,
|
|
5
5
|
markdownToXlsx,
|
|
6
6
|
parse
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WM3XI23V.js";
|
|
8
8
|
import "./chunk-YW5G6BCJ.js";
|
|
9
9
|
import {
|
|
10
10
|
VERSION,
|
|
11
11
|
toArrayBuffer
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-W2KDIKDF.js";
|
|
13
13
|
import "./chunk-MOL7MDBG.js";
|
|
14
14
|
import "./chunk-7FMKAV4P.js";
|
|
15
15
|
import "./chunk-34WIGIQC.js";
|
|
@@ -177,7 +177,7 @@ async function runParse(files, opts) {
|
|
|
177
177
|
saveImages(absPath);
|
|
178
178
|
}
|
|
179
179
|
} catch (err) {
|
|
180
|
-
const { sanitizeError } = await import("./utils-
|
|
180
|
+
const { sanitizeError } = await import("./utils-DHOODYKU.js");
|
|
181
181
|
process.stderr.write(`
|
|
182
182
|
[kordoc] ERROR: ${fileName} \u2014 ${sanitizeError(err)}
|
|
183
183
|
`);
|
|
@@ -259,7 +259,7 @@ program.command("convert <input>").description("\uB9C8\uD06C\uB2E4\uC6B4 \uD30C\
|
|
|
259
259
|
`));
|
|
260
260
|
}
|
|
261
261
|
} catch (err) {
|
|
262
|
-
const { sanitizeError } = await import("./utils-
|
|
262
|
+
const { sanitizeError } = await import("./utils-DHOODYKU.js");
|
|
263
263
|
process.stderr.write(` FAIL
|
|
264
264
|
`);
|
|
265
265
|
process.stderr.write(` \u2192 ${sanitizeError(err)}
|
|
@@ -291,7 +291,7 @@ program.command("init-env").description("kordoc\uC6A9 .env \uD15C\uD50C\uB9BF \u
|
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
program.command("watch <dir>").description("\uB514\uB809\uD1A0\uB9AC \uAC10\uC2DC \u2014 \uC0C8 \uBB38\uC11C \uC790\uB3D9 \uBCC0\uD658").option("--webhook <url>", "\uACB0\uACFC \uC804\uC1A1 \uC6F9\uD6C5 URL").option("-d, --out-dir <dir>", "\uBCC0\uD658 \uACB0\uACFC \uCD9C\uB825 \uB514\uB809\uD1A0\uB9AC").option("-p, --pages <range>", "\uD398\uC774\uC9C0/\uC139\uC158 \uBC94\uC704").option("--format <type>", "\uCD9C\uB825 \uD615\uC2DD: markdown \uB610\uB294 json", "markdown").option("--silent", "\uC9C4\uD589 \uBA54\uC2DC\uC9C0 \uC228\uAE30\uAE30").action(async (dir, opts) => {
|
|
294
|
-
const { watchDirectory } = await import("./watch-
|
|
294
|
+
const { watchDirectory } = await import("./watch-RM4VNOL4.js");
|
|
295
295
|
await watchDirectory({
|
|
296
296
|
dir,
|
|
297
297
|
outDir: opts.outDir,
|
package/dist/index.cjs
CHANGED
|
@@ -3138,7 +3138,7 @@ var import_jszip2 = __toESM(require("jszip"), 1);
|
|
|
3138
3138
|
var import_xmldom = require("@xmldom/xmldom");
|
|
3139
3139
|
|
|
3140
3140
|
// src/utils.ts
|
|
3141
|
-
var VERSION = true ? "2.4.
|
|
3141
|
+
var VERSION = true ? "2.4.17" : "0.0.0-dev";
|
|
3142
3142
|
function toArrayBuffer(buf) {
|
|
3143
3143
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
3144
3144
|
return buf.buffer;
|
|
@@ -11372,14 +11372,14 @@ var DEFAULT_STAGE_WEIGHTS = {
|
|
|
11372
11372
|
proofread: 10,
|
|
11373
11373
|
merge: 5
|
|
11374
11374
|
};
|
|
11375
|
-
var OCR_PROMPT2 = "
|
|
11375
|
+
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.";
|
|
11376
11376
|
var PROOFREAD_PROMPT = [
|
|
11377
|
-
"
|
|
11378
|
-
"
|
|
11379
|
-
"-
|
|
11380
|
-
"-
|
|
11381
|
-
"-
|
|
11382
|
-
"-
|
|
11377
|
+
"Perform non-destructive proofreading only on the Markdown below.",
|
|
11378
|
+
"Rules:",
|
|
11379
|
+
"- Do not add, remove, or infer any facts",
|
|
11380
|
+
"- Do not change numbers, units, or proper nouns",
|
|
11381
|
+
"- Correct only typos, spacing, line breaks, and Markdown structure",
|
|
11382
|
+
"- Output the corrected Markdown body only"
|
|
11383
11383
|
].join("\n");
|
|
11384
11384
|
function elapsedMs(startAt) {
|
|
11385
11385
|
return Math.round(import_node_perf_hooks.performance.now() - startAt);
|
|
@@ -11414,7 +11414,7 @@ async function runUnifiedOcrPipeline(inputPath, options = {}) {
|
|
|
11414
11414
|
await (0, import_promises2.mkdir)(diffDir, { recursive: true });
|
|
11415
11415
|
const timingsMs = {};
|
|
11416
11416
|
const markStageStart = (stage, message) => emitProgress(options.onEvent, stage, 0, stageWeights, { message, type: "stage_start" });
|
|
11417
|
-
const markStageProgress = (stage, stagePercent, current, total, message) => emitProgress(options.onEvent, stage, stagePercent, stageWeights, { type: "stage_progress", current, total, message });
|
|
11417
|
+
const markStageProgress = (stage, stagePercent, current, total, message, model) => emitProgress(options.onEvent, stage, stagePercent, stageWeights, { type: "stage_progress", current, total, message, model });
|
|
11418
11418
|
const markStageDone = (stage, message) => emitProgress(options.onEvent, stage, 100, stageWeights, { message, type: "stage_done" });
|
|
11419
11419
|
let currentStage = "convert";
|
|
11420
11420
|
const logStage = (level, stage, event, message, meta) => {
|
|
@@ -11519,7 +11519,7 @@ async function runUnifiedOcrPipeline(inputPath, options = {}) {
|
|
|
11519
11519
|
const pagePath = (0, import_path5.join)(rawDir, `page_${String(i + 1).padStart(4, "0")}.md`);
|
|
11520
11520
|
await (0, import_promises2.writeFile)(pagePath, markdown, "utf-8");
|
|
11521
11521
|
rawPagePaths.push(pagePath);
|
|
11522
|
-
markStageProgress("ocr", Math.round((i + 1) / images.length * 100), i + 1, images.length, `OCR ${i + 1}/${images.length}
|
|
11522
|
+
markStageProgress("ocr", Math.round((i + 1) / images.length * 100), i + 1, images.length, `OCR ${i + 1}/${images.length}`, selectedModel);
|
|
11523
11523
|
logStage("debug", "ocr", "progress", "\uD398\uC774\uC9C0 OCR \uC644\uB8CC", { page: i + 1, total: images.length });
|
|
11524
11524
|
}
|
|
11525
11525
|
timingsMs.ocr = elapsedMs(ocrStart);
|
|
@@ -11643,7 +11643,8 @@ function emitProgress(cb, stage, stagePercent, weights, extra) {
|
|
|
11643
11643
|
current: extra.current,
|
|
11644
11644
|
total: extra.total,
|
|
11645
11645
|
code: extra.code,
|
|
11646
|
-
message: extra.message
|
|
11646
|
+
message: extra.message,
|
|
11647
|
+
model: extra.model
|
|
11647
11648
|
});
|
|
11648
11649
|
}
|
|
11649
11650
|
async function convertWithLibreOffice(buffer, ext) {
|