democut 1.0.63 → 1.0.65

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 (2) hide show
  1. package/dist/cli.js +25 -18
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -6916,7 +6916,7 @@ import { realpathSync } from "fs";
6916
6916
  import { fileURLToPath } from "url";
6917
6917
 
6918
6918
  // src/version.ts
6919
- var VERSION = "1.0.63";
6919
+ var VERSION = "1.0.65";
6920
6920
 
6921
6921
  // src/device-flow.ts
6922
6922
  var DeviceFlowError = class extends Error {
@@ -7306,13 +7306,14 @@ function parseDetail(status, body) {
7306
7306
  const loc = e.loc;
7307
7307
  return Array.isArray(loc) ? String(loc[loc.length - 1]) : "";
7308
7308
  }).filter(Boolean);
7309
- return new ApiError(
7310
- status,
7311
- "VALIDATION_ERROR",
7312
- lines.join("\n"),
7313
- true,
7314
- unknownFields.length ? { unknownFields } : {}
7315
- );
7309
+ const missingFields = detail.filter((e) => e.type === "missing").map((e) => {
7310
+ const loc = e.loc;
7311
+ return Array.isArray(loc) ? loc.filter((x) => x !== "body").join(".") : "";
7312
+ }).filter(Boolean);
7313
+ return new ApiError(status, "VALIDATION_ERROR", lines.join("\n"), true, {
7314
+ ...unknownFields.length ? { unknownFields } : {},
7315
+ ...missingFields.length ? { missingFields } : {}
7316
+ });
7316
7317
  }
7317
7318
  return new ApiError(status, `HTTP_${status}`, `\uC694\uCCAD\uC774 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4 (HTTP ${status}).`, null);
7318
7319
  }
@@ -12986,6 +12987,9 @@ function callableStructured(value) {
12986
12987
  }
12987
12988
  return value;
12988
12989
  }
12990
+ function asFields(v) {
12991
+ return Array.isArray(v) ? v.filter((x) => typeof x === "string" && x.length > 0) : [];
12992
+ }
12989
12993
  function usd(v) {
12990
12994
  return v < 0.01 ? `$${v.toFixed(4)}` : `$${v.toFixed(2)}`;
12991
12995
  }
@@ -13049,16 +13053,19 @@ function classifyApiError(e, ctx) {
13049
13053
  return { safety: "fixable", notCharged: true, lines };
13050
13054
  }
13051
13055
  if (e.status === 422) {
13052
- const unknown2 = e.extra.unknownFields;
13053
- if (Array.isArray(unknown2) && unknown2.length) {
13054
- return {
13055
- safety: "fixable",
13056
- notCharged: true,
13057
- lines: [
13058
- `\uC11C\uBC84\uAC00 \uC544\uC9C1 \uBAA8\uB974\uB294 \uC778\uC790\uC785\uB2C8\uB2E4: ${unknown2.join(", ")} \u2014 \uBC30\uD3EC\uAC00 \uACB9\uCE58\uB294 \uC911\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.`,
13059
- "\uADF8 \uC778\uC790\uB9CC \uBE7C\uACE0 \uB098\uBA38\uC9C0\uB294 \uADF8\uB300\uB85C \uB2E4\uC2DC \uBCF4\uB0B4\uC138\uC694. \uC544\uC9C1 \uACFC\uAE08\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."
13060
- ]
13061
- };
13056
+ const unknown2 = asFields(e.extra.unknownFields);
13057
+ const missing = asFields(e.extra.missingFields);
13058
+ if (unknown2.length || missing.length) {
13059
+ const lines = [];
13060
+ if (unknown2.length) {
13061
+ lines.push(`\uC11C\uBC84\uAC00 \uC544\uC9C1 \uBAA8\uB974\uB294 \uC778\uC790\uC785\uB2C8\uB2E4: ${unknown2.join(", ")} \u2014 \uBC30\uD3EC\uAC00 \uACB9\uCE58\uB294 \uC911\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);
13062
+ lines.push("\uADF8 \uC778\uC790\uB9CC \uBE7C\uACE0 \uB098\uBA38\uC9C0\uB294 \uADF8\uB300\uB85C \uB2E4\uC2DC \uBCF4\uB0B4\uC138\uC694.");
13063
+ }
13064
+ if (missing.length) {
13065
+ lines.push(`\uBE60\uC9C4 \uC778\uC790\uC785\uB2C8\uB2E4: ${missing.join(", ")} \u2014 \uADF8 \uAC12\uC744 \uC2E4\uC5B4 \uB2E4\uC2DC \uBCF4\uB0B4\uC138\uC694.`);
13066
+ }
13067
+ lines.push("\uC544\uC9C1 \uACFC\uAE08\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.");
13068
+ return { safety: "fixable", notCharged: true, lines };
13062
13069
  }
13063
13070
  return {
13064
13071
  safety: "fixable",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "democut",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "DemoCut 에이전트 CLI — device flow 로그인(RFC 8628) + 영상 생성",
5
5
  "license": "MIT",
6
6
  "author": "InfoGrab",