@clazic/kordoc 2.4.7 → 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.
Files changed (30) hide show
  1. package/dist/{batch-provider-XI2EPODC.js → batch-provider-VX7CY6UH.js} +9 -4
  2. package/dist/batch-provider-VX7CY6UH.js.map +1 -0
  3. package/dist/{chunk-5DD75UUX.js → chunk-7ORDFSF4.js} +2 -2
  4. package/dist/{chunk-GITPGCCA.js → chunk-JO37HXVZ.js} +8 -8
  5. package/dist/{chunk-GITPGCCA.js.map → chunk-JO37HXVZ.js.map} +1 -1
  6. package/dist/{chunk-JOGAFNIL.js → chunk-YC2MEB7R.js} +6 -3
  7. package/dist/chunk-YC2MEB7R.js.map +1 -0
  8. package/dist/{chunk-4PP34NVQ.js → chunk-YW5G6BCJ.js} +2 -2
  9. package/dist/chunk-YW5G6BCJ.js.map +1 -0
  10. package/dist/cli.js +9 -8
  11. package/dist/cli.js.map +1 -1
  12. package/dist/index.cjs +17 -9
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +17 -9
  15. package/dist/index.js.map +1 -1
  16. package/dist/mcp.js +4 -4
  17. package/dist/{provider-7F7NEDTN.js → provider-PYZL2VNN.js} +2 -2
  18. package/dist/{resolve-SUU5Q6DJ.js → resolve-BGOGWG6E.js} +4 -4
  19. package/dist/{utils-7LOIY3O6.js → utils-HAVLKXCA.js} +2 -2
  20. package/dist/{watch-HUIKUPMG.js → watch-YQ3ZQM2I.js} +16 -9
  21. package/dist/watch-YQ3ZQM2I.js.map +1 -0
  22. package/package.json +2 -2
  23. package/dist/batch-provider-XI2EPODC.js.map +0 -1
  24. package/dist/chunk-4PP34NVQ.js.map +0 -1
  25. package/dist/chunk-JOGAFNIL.js.map +0 -1
  26. package/dist/watch-HUIKUPMG.js.map +0 -1
  27. /package/dist/{chunk-5DD75UUX.js.map → chunk-7ORDFSF4.js.map} +0 -0
  28. /package/dist/{provider-7F7NEDTN.js.map → provider-PYZL2VNN.js.map} +0 -0
  29. /package/dist/{resolve-SUU5Q6DJ.js.map → resolve-BGOGWG6E.js.map} +0 -0
  30. /package/dist/{utils-7LOIY3O6.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: @${imagePath}`;
2121
+ \uC774\uBBF8\uC9C0: @${normalizedPath}`;
2119
2122
  switch (mode) {
2120
2123
  case "gemini": {
2121
2124
  const args = ["--prompt", promptWithImage, "--yolo"];
@@ -2307,7 +2310,8 @@ function spawnAsync(cmd, args, opts) {
2307
2310
  const child = spawn(cmd, args, {
2308
2311
  cwd: opts.cwd,
2309
2312
  env: process.env,
2310
- stdio: ["pipe", "pipe", "pipe"]
2313
+ stdio: ["pipe", "pipe", "pipe"],
2314
+ shell: process.platform === "win32"
2311
2315
  });
2312
2316
  let stdout = "";
2313
2317
  let stderr = "";
@@ -2322,7 +2326,11 @@ function spawnAsync(cmd, args, opts) {
2322
2326
  });
2323
2327
  const timer = setTimeout(() => {
2324
2328
  killed = true;
2325
- child.kill("SIGTERM");
2329
+ if (process.platform === "win32") {
2330
+ child.kill();
2331
+ } else {
2332
+ child.kill("SIGTERM");
2333
+ }
2326
2334
  }, opts.timeoutMs);
2327
2335
  if (opts.stdin !== void 0) {
2328
2336
  child.stdin.end(opts.stdin);
@@ -2344,7 +2352,7 @@ function spawnAsync(cmd, args, opts) {
2344
2352
  });
2345
2353
  }
2346
2354
  async function callBatchCli(mode, imagePaths) {
2347
- const fileRefs = imagePaths.map((p) => `@${p}`).join("\n");
2355
+ const fileRefs = imagePaths.map((p) => `@${p.replace(/\\/g, "/")}`).join("\n");
2348
2356
  const prompt = `${BATCH_OCR_PROMPT}
2349
2357
 
2350
2358
  ${fileRefs}`;
@@ -2487,7 +2495,7 @@ var init_resolve = __esm({
2487
2495
  // src/ocr/markdown-to-blocks.ts
2488
2496
  function markdownToBlocks(markdown, pageNumber) {
2489
2497
  const blocks = [];
2490
- const lines = markdown.split("\n");
2498
+ const lines = markdown.split(/\r?\n/);
2491
2499
  let i = 0;
2492
2500
  while (i < lines.length) {
2493
2501
  const line = lines[i];
@@ -2826,7 +2834,7 @@ import JSZip2 from "jszip";
2826
2834
  import { DOMParser } from "@xmldom/xmldom";
2827
2835
 
2828
2836
  // src/utils.ts
2829
- var VERSION = true ? "2.4.7" : "0.0.0-dev";
2837
+ var VERSION = true ? "2.4.8" : "0.0.0-dev";
2830
2838
  function toArrayBuffer(buf) {
2831
2839
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
2832
2840
  return buf.buffer;
@@ -9961,7 +9969,7 @@ function getIndent(line) {
9961
9969
  return Math.floor(spaces / 2);
9962
9970
  }
9963
9971
  function parseMarkdownToBlocks(md) {
9964
- const lines = md.split("\n");
9972
+ const lines = md.split(/\r?\n/);
9965
9973
  const blocks = [];
9966
9974
  let i = 0;
9967
9975
  while (i < lines.length) {
@@ -10151,7 +10159,7 @@ function makeImageParagraph(ref, nextId, widthHwp = 28346, heightHwp = 19843, na
10151
10159
  ].join("\n");
10152
10160
  }
10153
10161
  function makeCodeParagraphs(code, nextId) {
10154
- const lines = code.split("\n");
10162
+ const lines = code.split(/\r?\n/);
10155
10163
  return lines.map((line) => {
10156
10164
  const id = nextId();
10157
10165
  const safe = escapeXml(line || " ");