@openclaw/pixverse-provider 2026.9.6 → 2026.9.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/assets/icon.png CHANGED
Binary file
package/dist/constants.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
1
2
  //#region extensions/pixverse/constants.ts
2
3
  const PIXVERSE_PROVIDER_ID = "pixverse";
3
4
  const PIXVERSE_BASE_URL_BY_REGION = {
@@ -7,5 +8,17 @@ const PIXVERSE_BASE_URL_BY_REGION = {
7
8
  const DEFAULT_PIXVERSE_REGION = "international";
8
9
  const DEFAULT_PIXVERSE_MODEL_ID = "v6";
9
10
  const PIXVERSE_DEFAULT_VIDEO_MODEL_REF = `${PIXVERSE_PROVIDER_ID}/v6`;
11
+ function normalizePixVerseRegion(value) {
12
+ switch (normalizeOptionalLowercaseString(value)) {
13
+ case "cn":
14
+ case "china":
15
+ case "mainland":
16
+ case "pai": return "cn";
17
+ case "global":
18
+ case "intl":
19
+ case "international": return "international";
20
+ default: return;
21
+ }
22
+ }
10
23
  //#endregion
11
- export { DEFAULT_PIXVERSE_MODEL_ID, DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_DEFAULT_VIDEO_MODEL_REF, PIXVERSE_PROVIDER_ID };
24
+ export { DEFAULT_PIXVERSE_MODEL_ID, DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_DEFAULT_VIDEO_MODEL_REF, PIXVERSE_PROVIDER_ID, normalizePixVerseRegion };
package/dist/onboard.js CHANGED
@@ -1,20 +1,8 @@
1
- import { DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_DEFAULT_VIDEO_MODEL_REF, PIXVERSE_PROVIDER_ID } from "./constants.js";
2
- import { applyAuthProfileConfig, buildApiKeyCredential, captureProviderApiKey, normalizeOptionalSecretInput, persistProviderApiKey } from "openclaw/plugin-sdk/provider-auth-api-key";
1
+ import { DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_DEFAULT_VIDEO_MODEL_REF, PIXVERSE_PROVIDER_ID, normalizePixVerseRegion } from "./constants.js";
3
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { applyAuthProfileConfig, buildApiKeyCredential, captureProviderApiKey, normalizeOptionalSecretInput, persistProviderApiKey } from "openclaw/plugin-sdk/provider-auth-api-key";
4
4
  //#region extensions/pixverse/onboard.ts
5
5
  const PROFILE_ID = `${PIXVERSE_PROVIDER_ID}:default`;
6
- function normalizePixVerseRegion(value) {
7
- switch (normalizeOptionalString(value)?.toLowerCase()) {
8
- case "cn":
9
- case "china":
10
- case "mainland":
11
- case "pai": return "cn";
12
- case "global":
13
- case "intl":
14
- case "international": return "international";
15
- default: return;
16
- }
17
- }
18
6
  function pixVerseRegionNote(region) {
19
7
  return `PixVerse endpoint: ${region === "cn" ? "CN" : "International"} (${PIXVERSE_BASE_URL_BY_REGION[region]})`;
20
8
  }
@@ -1,4 +1,4 @@
1
- import { DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_PROVIDER_ID } from "./constants.js";
1
+ import { DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_PROVIDER_ID, normalizePixVerseRegion } from "./constants.js";
2
2
  import { asFiniteNumber, asSafeIntegerInRange, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
@@ -40,17 +40,9 @@ function resolvePixVerseBaseUrl(req) {
40
40
  }
41
41
  function resolvePixVerseApiRegion(value) {
42
42
  const region = normalizeOptionalString(value)?.toLowerCase();
43
- switch (region) {
44
- case "cn":
45
- case "china":
46
- case "mainland":
47
- case "pai": return "cn";
48
- case "global":
49
- case "intl":
50
- case "international":
51
- case void 0: return DEFAULT_PIXVERSE_REGION;
52
- default: throw new Error(`Unsupported PixVerse API region "${region}". Use "international" or "cn".`);
53
- }
43
+ const normalized = normalizePixVerseRegion(region);
44
+ if (normalized || region === void 0) return normalized ?? "international";
45
+ throw new Error(`Unsupported PixVerse API region "${region}". Use "international" or "cn".`);
54
46
  }
55
47
  function normalizePixVerseModel(model) {
56
48
  return (normalizeOptionalString(model)?.replace(/^pixverse\//iu, ""))?.toLowerCase() || "v6";
@@ -65,27 +57,12 @@ function resolvePixVerseDurationSeconds(value) {
65
57
  if (typeof value !== "number" || !Number.isFinite(value)) return 5;
66
58
  return Math.max(1, Math.min(MAX_DURATION_SECONDS, Math.round(value)));
67
59
  }
68
- function appendOptionalNumber(body, key, value) {
69
- const numberValue = asFiniteNumber(value);
70
- if (numberValue != null) body[key] = numberValue;
71
- }
72
- function appendOptionalInt32Seed(body, value) {
73
- const seed = asSafeIntegerInRange(value, {
74
- min: 0,
75
- max: PIXVERSE_SEED_MAX
76
- });
77
- if (seed !== void 0) body.seed = seed;
78
- }
79
60
  function readPixVerseSeed(value) {
80
61
  return asSafeIntegerInRange(value, {
81
62
  min: 0,
82
63
  max: PIXVERSE_SEED_MAX
83
64
  });
84
65
  }
85
- function appendOptionalString(body, key, value) {
86
- const stringValue = normalizeOptionalString(value);
87
- if (stringValue) body[key] = stringValue;
88
- }
89
66
  function buildPixVerseHeaders(headers, contentType) {
90
67
  const next = new Headers(headers);
91
68
  next.set("Ai-trace-id", randomUUID());
@@ -147,10 +124,14 @@ function buildVideoBody(req, model, imageId) {
147
124
  body.img_id = imageId;
148
125
  body.motion_mode = normalizeOptionalString(options.motion_mode) ?? normalizeOptionalString(options.motionMode) ?? "normal";
149
126
  } else body.aspect_ratio = normalizeOptionalString(req.aspectRatio) ?? "16:9";
150
- appendOptionalString(body, "negative_prompt", normalizeOptionalString(options.negative_prompt) ?? normalizeOptionalString(options.negativePrompt));
151
- appendOptionalString(body, "camera_movement", normalizeOptionalString(options.camera_movement) ?? normalizeOptionalString(options.cameraMovement));
152
- appendOptionalNumber(body, "template_id", asFiniteNumber(options.template_id) ?? asFiniteNumber(options.templateId));
153
- appendOptionalInt32Seed(body, options.seed);
127
+ const negativePrompt = normalizeOptionalString(options.negative_prompt) ?? normalizeOptionalString(options.negativePrompt);
128
+ if (negativePrompt) body.negative_prompt = negativePrompt;
129
+ const cameraMovement = normalizeOptionalString(options.camera_movement) ?? normalizeOptionalString(options.cameraMovement);
130
+ if (cameraMovement) body.camera_movement = cameraMovement;
131
+ const templateId = asFiniteNumber(options.template_id) ?? asFiniteNumber(options.templateId);
132
+ if (templateId != null) body.template_id = templateId;
133
+ const seed = readPixVerseSeed(options.seed);
134
+ if (seed !== void 0) body.seed = seed;
154
135
  if (req.audio !== void 0) body.generate_audio_switch = req.audio;
155
136
  return body;
156
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/pixverse-provider",
3
- "version": "2026.9.6",
3
+ "version": "2026.9.8",
4
4
  "description": "OpenClaw PixVerse video generation provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "peerDependencies": {
11
- "openclaw": ">=2026.9.6"
11
+ "openclaw": ">=2026.9.8"
12
12
  },
13
13
  "peerDependenciesMeta": {
14
14
  "openclaw": {
@@ -26,10 +26,10 @@
26
26
  "minHostVersion": ">=2026.5.26"
27
27
  },
28
28
  "compat": {
29
- "pluginApi": ">=2026.9.6"
29
+ "pluginApi": ">=2026.9.8"
30
30
  },
31
31
  "build": {
32
- "openclawVersion": "2026.9.6",
32
+ "openclawVersion": "2026.9.8",
33
33
  "bundledDist": false
34
34
  },
35
35
  "release": {