@openclaw/pixverse-provider 2026.5.27 → 2026.5.28-beta.1
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,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_PIXVERSE_REGION, PIXVERSE_BASE_URL_BY_REGION, PIXVERSE_PROVIDER_ID } from "./constants.js";
|
|
2
|
-
import { asFiniteNumber, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { asFiniteNumber, asSafeIntegerInRange, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
5
5
|
import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
|
|
@@ -12,6 +12,7 @@ const DEFAULT_TIMEOUT_MS = 3e5;
|
|
|
12
12
|
const POLL_INTERVAL_MS = 5e3;
|
|
13
13
|
const MAX_POLL_ATTEMPTS = 180;
|
|
14
14
|
const MAX_DURATION_SECONDS = 15;
|
|
15
|
+
const PIXVERSE_SEED_MAX = 2147483647;
|
|
15
16
|
const PIXVERSE_VIDEO_MODELS = ["v6", "c1"];
|
|
16
17
|
const PIXVERSE_TEXT_ASPECT_RATIOS = [
|
|
17
18
|
"16:9",
|
|
@@ -66,6 +67,19 @@ function appendOptionalNumber(body, key, value) {
|
|
|
66
67
|
const numberValue = asFiniteNumber(value);
|
|
67
68
|
if (numberValue != null) body[key] = numberValue;
|
|
68
69
|
}
|
|
70
|
+
function appendOptionalInt32Seed(body, value) {
|
|
71
|
+
const seed = asSafeIntegerInRange(value, {
|
|
72
|
+
min: 0,
|
|
73
|
+
max: PIXVERSE_SEED_MAX
|
|
74
|
+
});
|
|
75
|
+
if (seed !== void 0) body.seed = seed;
|
|
76
|
+
}
|
|
77
|
+
function readPixVerseSeed(value) {
|
|
78
|
+
return asSafeIntegerInRange(value, {
|
|
79
|
+
min: 0,
|
|
80
|
+
max: PIXVERSE_SEED_MAX
|
|
81
|
+
});
|
|
82
|
+
}
|
|
69
83
|
function appendOptionalString(body, key, value) {
|
|
70
84
|
const stringValue = normalizeOptionalString(value);
|
|
71
85
|
if (stringValue) body[key] = stringValue;
|
|
@@ -96,17 +110,17 @@ async function readPixVerseJson(response, label) {
|
|
|
96
110
|
return readPixVerseSuccess(payload, label);
|
|
97
111
|
}
|
|
98
112
|
function readPixVerseVideoId(payload) {
|
|
99
|
-
const videoId =
|
|
113
|
+
const videoId = asSafeIntegerInRange(payload.video_id, { min: 0 });
|
|
100
114
|
if (videoId == null) throw new Error("PixVerse video generation response missing video_id");
|
|
101
115
|
return videoId;
|
|
102
116
|
}
|
|
103
117
|
function readPixVerseImageId(payload) {
|
|
104
|
-
const imageId =
|
|
118
|
+
const imageId = asSafeIntegerInRange(payload.img_id, { min: 0 });
|
|
105
119
|
if (imageId == null) throw new Error("PixVerse image upload response missing img_id");
|
|
106
120
|
return imageId;
|
|
107
121
|
}
|
|
108
122
|
function readPixVerseStatus(payload) {
|
|
109
|
-
const status =
|
|
123
|
+
const status = asSafeIntegerInRange(payload.status, { min: 0 });
|
|
110
124
|
if (status == null) throw new Error("PixVerse video status response missing status");
|
|
111
125
|
return status;
|
|
112
126
|
}
|
|
@@ -141,7 +155,7 @@ function buildVideoBody(req, model, imageId) {
|
|
|
141
155
|
appendOptionalString(body, "negative_prompt", normalizeOptionalString(options.negative_prompt) ?? normalizeOptionalString(options.negativePrompt));
|
|
142
156
|
appendOptionalString(body, "camera_movement", normalizeOptionalString(options.camera_movement) ?? normalizeOptionalString(options.cameraMovement));
|
|
143
157
|
appendOptionalNumber(body, "template_id", asFiniteNumber(options.template_id) ?? asFiniteNumber(options.templateId));
|
|
144
|
-
|
|
158
|
+
appendOptionalInt32Seed(body, options.seed);
|
|
145
159
|
if (req.audio !== void 0) body.generate_audio_switch = req.audio;
|
|
146
160
|
return body;
|
|
147
161
|
}
|
|
@@ -331,7 +345,7 @@ function buildPixVerseVideoGenerationProvider() {
|
|
|
331
345
|
endpoint,
|
|
332
346
|
videoId,
|
|
333
347
|
status: readPixVerseStatus(completed),
|
|
334
|
-
seed:
|
|
348
|
+
seed: readPixVerseSeed(completed.seed),
|
|
335
349
|
size: asFiniteNumber(completed.size)
|
|
336
350
|
}
|
|
337
351
|
};
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/pixverse-provider",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.28-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/pixverse-provider",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.28-beta.1",
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"openclaw": ">=2026.5.
|
|
11
|
+
"openclaw": ">=2026.5.28-beta.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependenciesMeta": {
|
|
14
14
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/pixverse-provider",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.28-beta.1",
|
|
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.5.
|
|
11
|
+
"openclaw": ">=2026.5.28-beta.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependenciesMeta": {
|
|
14
14
|
"openclaw": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"install": {
|
|
23
23
|
"npmSpec": "@openclaw/pixverse-provider",
|
|
24
24
|
"defaultChoice": "npm",
|
|
25
|
-
"minHostVersion": ">=2026.5.
|
|
25
|
+
"minHostVersion": ">=2026.5.26"
|
|
26
26
|
},
|
|
27
27
|
"compat": {
|
|
28
|
-
"pluginApi": ">=2026.5.
|
|
28
|
+
"pluginApi": ">=2026.5.28-beta.1"
|
|
29
29
|
},
|
|
30
30
|
"build": {
|
|
31
|
-
"openclawVersion": "2026.5.
|
|
31
|
+
"openclawVersion": "2026.5.28-beta.1"
|
|
32
32
|
},
|
|
33
33
|
"release": {
|
|
34
34
|
"publishToClawHub": true,
|