@clazic/kordoc 2.2.5 → 2.2.6

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/utils.ts
4
- var VERSION = true ? "2.2.5" : "0.0.0-dev";
4
+ var VERSION = true ? "2.2.6" : "0.0.0-dev";
5
5
  function toArrayBuffer(buf) {
6
6
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
7
7
  return buf.buffer;
@@ -90,4 +90,4 @@ export {
90
90
  sanitizeHref,
91
91
  classifyError
92
92
  };
93
- //# sourceMappingURL=chunk-LMJTT3ZJ.js.map
93
+ //# sourceMappingURL=chunk-BU42ZFTN.js.map
@@ -6,7 +6,7 @@ import {
6
6
  precheckZipSize,
7
7
  sanitizeHref,
8
8
  toArrayBuffer
9
- } from "./chunk-LMJTT3ZJ.js";
9
+ } from "./chunk-BU42ZFTN.js";
10
10
  import {
11
11
  parsePageRange
12
12
  } from "./chunk-MOL7MDBG.js";
@@ -5406,7 +5406,7 @@ async function parsePdfDocument(buffer, options) {
5406
5406
  const ocrMode = options?.ocrMode;
5407
5407
  if (!ocrProvider && ocrMode && ocrMode !== "off") {
5408
5408
  try {
5409
- const { resolveOcrProvider } = await import("./resolve-BVSC3NC2.js");
5409
+ const { resolveOcrProvider } = await import("./resolve-77C5OWLO.js");
5410
5410
  ocrProvider = await resolveOcrProvider(ocrMode, warnings);
5411
5411
  } catch (resolveErr) {
5412
5412
  if (ocrMode !== "auto") {
@@ -9614,4 +9614,4 @@ export {
9614
9614
  cfb/cfb.js:
9615
9615
  (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
9616
9616
  */
9617
- //# sourceMappingURL=chunk-3PTQ3RGF.js.map
9617
+ //# sourceMappingURL=chunk-KHUTUB7G.js.map
package/dist/cli.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  markdownToHwpx,
5
5
  markdownToXlsx,
6
6
  parse
7
- } from "./chunk-3PTQ3RGF.js";
7
+ } from "./chunk-KHUTUB7G.js";
8
8
  import {
9
9
  VERSION,
10
10
  toArrayBuffer
11
- } from "./chunk-LMJTT3ZJ.js";
11
+ } from "./chunk-BU42ZFTN.js";
12
12
  import "./chunk-MOL7MDBG.js";
13
13
  import "./chunk-ZWE3DS7E.js";
14
14
 
@@ -121,7 +121,7 @@ async function runParse(files, opts) {
121
121
  saveImages(absPath);
122
122
  }
123
123
  } catch (err) {
124
- const { sanitizeError } = await import("./utils-ZZOKWPQK.js");
124
+ const { sanitizeError } = await import("./utils-PGXOUDRW.js");
125
125
  process.stderr.write(`
126
126
  [kordoc] ERROR: ${fileName} \u2014 ${sanitizeError(err)}
127
127
  `);
@@ -205,7 +205,7 @@ program.command("convert <input>").description("\uB9C8\uD06C\uB2E4\uC6B4 \uD30C\
205
205
  `));
206
206
  }
207
207
  } catch (err) {
208
- const { sanitizeError } = await import("./utils-ZZOKWPQK.js");
208
+ const { sanitizeError } = await import("./utils-PGXOUDRW.js");
209
209
  process.stderr.write(` FAIL
210
210
  `);
211
211
  process.stderr.write(` \u2192 ${sanitizeError(err)}
@@ -214,7 +214,7 @@ program.command("convert <input>").description("\uB9C8\uD06C\uB2E4\uC6B4 \uD30C\
214
214
  }
215
215
  });
216
216
  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) => {
217
- const { watchDirectory } = await import("./watch-NUH25Y6O.js");
217
+ const { watchDirectory } = await import("./watch-VDBYOMEJ.js");
218
218
  await watchDirectory({
219
219
  dir,
220
220
  outDir: opts.outDir,
package/dist/index.cjs CHANGED
@@ -2059,6 +2059,8 @@ function callCodexCli(imagePath) {
2059
2059
  const outPath = (0, import_path.join)((0, import_os.tmpdir)(), `kordoc-codex-out-${Date.now()}.txt`);
2060
2060
  try {
2061
2061
  const args = ["exec", OCR_PROMPT, "--image", imagePath, "--output-last-message", outPath];
2062
+ const model = process.env.KORDOC_CODEX_MODEL;
2063
+ if (model) args.push("--model", model);
2062
2064
  const result = (0, import_child_process2.spawnSync)("codex", args, {
2063
2065
  encoding: "utf-8",
2064
2066
  timeout: 18e4,
@@ -2090,10 +2092,18 @@ function buildCliArgs(mode, imagePath) {
2090
2092
 
2091
2093
  \uC774\uBBF8\uC9C0: @${imagePath}`;
2092
2094
  switch (mode) {
2093
- case "gemini":
2094
- return ["--prompt", promptWithImage, "--yolo"];
2095
- case "claude":
2096
- return ["--print", promptWithImage];
2095
+ case "gemini": {
2096
+ const args = ["--prompt", promptWithImage, "--yolo"];
2097
+ const model = process.env.KORDOC_GEMINI_MODEL;
2098
+ if (model) args.push("--model", model);
2099
+ return args;
2100
+ }
2101
+ case "claude": {
2102
+ const args = ["--print", promptWithImage];
2103
+ const model = process.env.KORDOC_CLAUDE_MODEL;
2104
+ if (model) args.push("--model", model);
2105
+ return args;
2106
+ }
2097
2107
  default:
2098
2108
  throw new Error(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 CLI: ${mode}`);
2099
2109
  }
@@ -2456,7 +2466,7 @@ var import_jszip2 = __toESM(require("jszip"), 1);
2456
2466
  var import_xmldom = require("@xmldom/xmldom");
2457
2467
 
2458
2468
  // src/utils.ts
2459
- var VERSION = true ? "2.2.5" : "0.0.0-dev";
2469
+ var VERSION = true ? "2.2.6" : "0.0.0-dev";
2460
2470
  function toArrayBuffer(buf) {
2461
2471
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
2462
2472
  return buf.buffer;