@clazic/kordoc 2.2.5 → 2.2.7

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.js CHANGED
@@ -2051,8 +2051,10 @@ function callCli(mode, imagePath) {
2051
2051
  const args = buildCliArgs(mode, imagePath);
2052
2052
  const result = spawnSync(mode, args, {
2053
2053
  encoding: "utf-8",
2054
- timeout: 6e4,
2055
- maxBuffer: 10 * 1024 * 1024
2054
+ timeout: 18e4,
2055
+ maxBuffer: 10 * 1024 * 1024,
2056
+ // claude: /tmp에서 실행하여 프로젝트 CLAUDE.md의 규칙 간섭 방지
2057
+ ...mode === "claude" ? { cwd: tmpdir() } : {}
2056
2058
  });
2057
2059
  if (result.error) {
2058
2060
  throw new Error(`${mode} CLI \uC2E4\uD589 \uC2E4\uD328: ${result.error.message}`);
@@ -2067,6 +2069,8 @@ function callCodexCli(imagePath) {
2067
2069
  const outPath = join(tmpdir(), `kordoc-codex-out-${Date.now()}.txt`);
2068
2070
  try {
2069
2071
  const args = ["exec", OCR_PROMPT, "--image", imagePath, "--output-last-message", outPath];
2072
+ const model = process.env.KORDOC_CODEX_MODEL;
2073
+ if (model) args.push("--model", model);
2070
2074
  const result = spawnSync("codex", args, {
2071
2075
  encoding: "utf-8",
2072
2076
  timeout: 18e4,
@@ -2098,10 +2102,18 @@ function buildCliArgs(mode, imagePath) {
2098
2102
 
2099
2103
  \uC774\uBBF8\uC9C0: @${imagePath}`;
2100
2104
  switch (mode) {
2101
- case "gemini":
2102
- return ["--prompt", promptWithImage, "--yolo"];
2103
- case "claude":
2104
- return ["--print", promptWithImage];
2105
+ case "gemini": {
2106
+ const args = ["--prompt", promptWithImage, "--yolo"];
2107
+ const model = process.env.KORDOC_GEMINI_MODEL;
2108
+ if (model) args.push("--model", model);
2109
+ return args;
2110
+ }
2111
+ case "claude": {
2112
+ const args = ["--print", promptWithImage];
2113
+ const model = process.env.KORDOC_CLAUDE_MODEL;
2114
+ if (model) args.push("--model", model);
2115
+ return args;
2116
+ }
2105
2117
  default:
2106
2118
  throw new Error(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 CLI: ${mode}`);
2107
2119
  }
@@ -2436,7 +2448,7 @@ import JSZip2 from "jszip";
2436
2448
  import { DOMParser } from "@xmldom/xmldom";
2437
2449
 
2438
2450
  // src/utils.ts
2439
- var VERSION = true ? "2.2.5" : "0.0.0-dev";
2451
+ var VERSION = true ? "2.2.7" : "0.0.0-dev";
2440
2452
  function toArrayBuffer(buf) {
2441
2453
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
2442
2454
  return buf.buffer;