@clazic/kordoc 2.4.6 → 2.4.8
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/{batch-provider-PNDCSGQW.js → batch-provider-VX7CY6UH.js} +17 -6
- package/dist/batch-provider-VX7CY6UH.js.map +1 -0
- package/dist/{chunk-A2FNPGBS.js → chunk-7ORDFSF4.js} +2 -2
- package/dist/{chunk-L2CLLZ4S.js → chunk-JO37HXVZ.js} +8 -8
- package/dist/{chunk-L2CLLZ4S.js.map → chunk-JO37HXVZ.js.map} +1 -1
- package/dist/{chunk-JOGAFNIL.js → chunk-YC2MEB7R.js} +6 -3
- package/dist/chunk-YC2MEB7R.js.map +1 -0
- package/dist/{chunk-4PP34NVQ.js → chunk-YW5G6BCJ.js} +2 -2
- package/dist/chunk-YW5G6BCJ.js.map +1 -0
- package/dist/cli.js +9 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +24 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +4 -4
- package/dist/{provider-7F7NEDTN.js → provider-PYZL2VNN.js} +2 -2
- package/dist/{resolve-TZVGVOVD.js → resolve-BGOGWG6E.js} +4 -4
- package/dist/{utils-RQ4S2RVN.js → utils-HAVLKXCA.js} +2 -2
- package/dist/{watch-3EIG5EVL.js → watch-YQ3ZQM2I.js} +16 -9
- package/dist/watch-YQ3ZQM2I.js.map +1 -0
- package/package.json +2 -2
- package/dist/batch-provider-PNDCSGQW.js.map +0 -1
- package/dist/chunk-4PP34NVQ.js.map +0 -1
- package/dist/chunk-JOGAFNIL.js.map +0 -1
- package/dist/watch-3EIG5EVL.js.map +0 -1
- /package/dist/{chunk-A2FNPGBS.js.map → chunk-7ORDFSF4.js.map} +0 -0
- /package/dist/{provider-7F7NEDTN.js.map → provider-PYZL2VNN.js.map} +0 -0
- /package/dist/{resolve-TZVGVOVD.js.map → resolve-BGOGWG6E.js.map} +0 -0
- /package/dist/{utils-RQ4S2RVN.js.map → utils-HAVLKXCA.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -2068,6 +2068,7 @@ function callCli(mode, imagePath) {
|
|
|
2068
2068
|
encoding: "utf-8",
|
|
2069
2069
|
timeout: 6e5,
|
|
2070
2070
|
maxBuffer: 10 * 1024 * 1024,
|
|
2071
|
+
shell: process.platform === "win32",
|
|
2071
2072
|
// claude: /tmp에서 실행하여 프로젝트 CLAUDE.md의 규칙 간섭 방지
|
|
2072
2073
|
...mode === "claude" ? { cwd: tmpdir() } : {}
|
|
2073
2074
|
});
|
|
@@ -2090,8 +2091,9 @@ function callCodexCli(imagePath) {
|
|
|
2090
2091
|
encoding: "utf-8",
|
|
2091
2092
|
timeout: 18e4,
|
|
2092
2093
|
maxBuffer: 10 * 1024 * 1024,
|
|
2093
|
-
input: ""
|
|
2094
|
+
input: "",
|
|
2094
2095
|
// stdin EOF 즉시 전달 (대화형 입력 차단)
|
|
2096
|
+
shell: process.platform === "win32"
|
|
2095
2097
|
});
|
|
2096
2098
|
if (result.error) {
|
|
2097
2099
|
throw new Error(`codex CLI \uC2E4\uD589 \uC2E4\uD328: ${result.error.message}`);
|
|
@@ -2113,9 +2115,10 @@ function callCodexCli(imagePath) {
|
|
|
2113
2115
|
}
|
|
2114
2116
|
}
|
|
2115
2117
|
function buildCliArgs(mode, imagePath) {
|
|
2118
|
+
const normalizedPath = imagePath.replace(/\\/g, "/");
|
|
2116
2119
|
const promptWithImage = `${OCR_PROMPT}
|
|
2117
2120
|
|
|
2118
|
-
\uC774\uBBF8\uC9C0: @${
|
|
2121
|
+
\uC774\uBBF8\uC9C0: @${normalizedPath}`;
|
|
2119
2122
|
switch (mode) {
|
|
2120
2123
|
case "gemini": {
|
|
2121
2124
|
const args = ["--prompt", promptWithImage, "--yolo"];
|
|
@@ -2245,14 +2248,20 @@ __export(batch_provider_exports, {
|
|
|
2245
2248
|
DEFAULT_BATCH_SIZES: () => DEFAULT_BATCH_SIZES,
|
|
2246
2249
|
createBatchCliProvider: () => createBatchCliProvider
|
|
2247
2250
|
});
|
|
2248
|
-
import { spawn } from "child_process";
|
|
2251
|
+
import { spawn, execSync as execSync2 } from "child_process";
|
|
2249
2252
|
import { writeFileSync as writeFileSync2, readFileSync as readFileSync2, unlinkSync as unlinkSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
2250
2253
|
import { join as join2 } from "path";
|
|
2251
2254
|
import { tmpdir as tmpdir2 } from "os";
|
|
2252
2255
|
function getBatchTempDir() {
|
|
2253
2256
|
if (!_batchTempDir) {
|
|
2254
|
-
_batchTempDir = join2(process.cwd(), "
|
|
2257
|
+
_batchTempDir = join2(process.cwd(), ".kordoc_ocr_tmp");
|
|
2255
2258
|
mkdirSync2(_batchTempDir, { recursive: true });
|
|
2259
|
+
if (process.platform === "win32") {
|
|
2260
|
+
try {
|
|
2261
|
+
execSync2(`attrib +h "${_batchTempDir}"`, { stdio: "ignore" });
|
|
2262
|
+
} catch {
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2256
2265
|
}
|
|
2257
2266
|
return _batchTempDir;
|
|
2258
2267
|
}
|
|
@@ -2301,7 +2310,8 @@ function spawnAsync(cmd, args, opts) {
|
|
|
2301
2310
|
const child = spawn(cmd, args, {
|
|
2302
2311
|
cwd: opts.cwd,
|
|
2303
2312
|
env: process.env,
|
|
2304
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
2313
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2314
|
+
shell: process.platform === "win32"
|
|
2305
2315
|
});
|
|
2306
2316
|
let stdout = "";
|
|
2307
2317
|
let stderr = "";
|
|
@@ -2316,7 +2326,11 @@ function spawnAsync(cmd, args, opts) {
|
|
|
2316
2326
|
});
|
|
2317
2327
|
const timer = setTimeout(() => {
|
|
2318
2328
|
killed = true;
|
|
2319
|
-
|
|
2329
|
+
if (process.platform === "win32") {
|
|
2330
|
+
child.kill();
|
|
2331
|
+
} else {
|
|
2332
|
+
child.kill("SIGTERM");
|
|
2333
|
+
}
|
|
2320
2334
|
}, opts.timeoutMs);
|
|
2321
2335
|
if (opts.stdin !== void 0) {
|
|
2322
2336
|
child.stdin.end(opts.stdin);
|
|
@@ -2338,7 +2352,7 @@ function spawnAsync(cmd, args, opts) {
|
|
|
2338
2352
|
});
|
|
2339
2353
|
}
|
|
2340
2354
|
async function callBatchCli(mode, imagePaths) {
|
|
2341
|
-
const fileRefs = imagePaths.map((p) => `@${p}`).join("\n");
|
|
2355
|
+
const fileRefs = imagePaths.map((p) => `@${p.replace(/\\/g, "/")}`).join("\n");
|
|
2342
2356
|
const prompt = `${BATCH_OCR_PROMPT}
|
|
2343
2357
|
|
|
2344
2358
|
${fileRefs}`;
|
|
@@ -2481,7 +2495,7 @@ var init_resolve = __esm({
|
|
|
2481
2495
|
// src/ocr/markdown-to-blocks.ts
|
|
2482
2496
|
function markdownToBlocks(markdown, pageNumber) {
|
|
2483
2497
|
const blocks = [];
|
|
2484
|
-
const lines = markdown.split(
|
|
2498
|
+
const lines = markdown.split(/\r?\n/);
|
|
2485
2499
|
let i = 0;
|
|
2486
2500
|
while (i < lines.length) {
|
|
2487
2501
|
const line = lines[i];
|
|
@@ -2820,7 +2834,7 @@ import JSZip2 from "jszip";
|
|
|
2820
2834
|
import { DOMParser } from "@xmldom/xmldom";
|
|
2821
2835
|
|
|
2822
2836
|
// src/utils.ts
|
|
2823
|
-
var VERSION = true ? "2.4.
|
|
2837
|
+
var VERSION = true ? "2.4.8" : "0.0.0-dev";
|
|
2824
2838
|
function toArrayBuffer(buf) {
|
|
2825
2839
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
2826
2840
|
return buf.buffer;
|
|
@@ -9955,7 +9969,7 @@ function getIndent(line) {
|
|
|
9955
9969
|
return Math.floor(spaces / 2);
|
|
9956
9970
|
}
|
|
9957
9971
|
function parseMarkdownToBlocks(md) {
|
|
9958
|
-
const lines = md.split(
|
|
9972
|
+
const lines = md.split(/\r?\n/);
|
|
9959
9973
|
const blocks = [];
|
|
9960
9974
|
let i = 0;
|
|
9961
9975
|
while (i < lines.length) {
|
|
@@ -10145,7 +10159,7 @@ function makeImageParagraph(ref, nextId, widthHwp = 28346, heightHwp = 19843, na
|
|
|
10145
10159
|
].join("\n");
|
|
10146
10160
|
}
|
|
10147
10161
|
function makeCodeParagraphs(code, nextId) {
|
|
10148
|
-
const lines = code.split(
|
|
10162
|
+
const lines = code.split(/\r?\n/);
|
|
10149
10163
|
return lines.map((line) => {
|
|
10150
10164
|
const id = nextId();
|
|
10151
10165
|
const safe = escapeXml(line || " ");
|