@openclaw/vydra-provider 2026.9.1 → 2026.9.2

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.
@@ -0,0 +1,5 @@
1
+ import { buildVydraSpeechProvider } from "./speech-provider.js";
2
+ //#region extensions/vydra/capability-catalog.ts
3
+ var capability_catalog_default = { speechProviders: [buildVydraSpeechProvider()] };
4
+ //#endregion
5
+ export { capability_catalog_default as default };
@@ -0,0 +1,24 @@
1
+ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ //#region extensions/vydra/defaults.ts
3
+ const DEFAULT_VYDRA_BASE_URL = "https://www.vydra.ai/api/v1";
4
+ const DEFAULT_VYDRA_IMAGE_MODEL = "grok-imagine";
5
+ const DEFAULT_VYDRA_VIDEO_MODEL = "veo3";
6
+ const DEFAULT_VYDRA_SPEECH_MODEL = "elevenlabs/tts";
7
+ const DEFAULT_VYDRA_VOICE_ID = "21m00Tcm4TlvDq8ikWAM";
8
+ function normalizeVydraBaseUrl(value) {
9
+ const fallback = DEFAULT_VYDRA_BASE_URL;
10
+ const trimmed = normalizeOptionalString(value);
11
+ if (!trimmed) return fallback;
12
+ try {
13
+ const url = new URL(trimmed);
14
+ if (url.hostname === "vydra.ai") url.hostname = "www.vydra.ai";
15
+ const pathname = url.pathname.replace(/\/+$/u, "");
16
+ if (!pathname) url.pathname = "/api/v1";
17
+ else url.pathname = pathname;
18
+ return url.toString().replace(/\/$/u, "");
19
+ } catch {
20
+ return fallback;
21
+ }
22
+ }
23
+ //#endregion
24
+ export { DEFAULT_VYDRA_BASE_URL, DEFAULT_VYDRA_IMAGE_MODEL, DEFAULT_VYDRA_SPEECH_MODEL, DEFAULT_VYDRA_VIDEO_MODEL, DEFAULT_VYDRA_VOICE_ID, normalizeVydraBaseUrl };
@@ -1,4 +1,5 @@
1
- import { DEFAULT_VYDRA_IMAGE_MODEL, runVydraGeneration } from "./shared.js";
1
+ import { DEFAULT_VYDRA_IMAGE_MODEL } from "./defaults.js";
2
+ import { runVydraGeneration } from "./shared.js";
2
3
  import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
3
4
  //#region extensions/vydra/image-generation-provider.ts
4
5
  function buildVydraImageGenerationProvider() {
package/dist/shared.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_VYDRA_BASE_URL, DEFAULT_VYDRA_IMAGE_MODEL, DEFAULT_VYDRA_VIDEO_MODEL, normalizeVydraBaseUrl } from "./defaults.js";
1
2
  import { resolveGeneratedMediaMaxBytes } from "openclaw/plugin-sdk/media-generation-runtime";
2
3
  import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
3
4
  import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
@@ -5,11 +6,6 @@ import { assertOkOrThrowHttpError, createProviderOperationDeadline, createProvid
5
6
  import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
6
7
  import { asOptionalRecord, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  //#region extensions/vydra/shared.ts
8
- const DEFAULT_VYDRA_BASE_URL = "https://www.vydra.ai/api/v1";
9
- const DEFAULT_VYDRA_IMAGE_MODEL = "grok-imagine";
10
- const DEFAULT_VYDRA_VIDEO_MODEL = "veo3";
11
- const DEFAULT_VYDRA_SPEECH_MODEL = "elevenlabs/tts";
12
- const DEFAULT_VYDRA_VOICE_ID = "21m00Tcm4TlvDq8ikWAM";
13
9
  const DEFAULT_HTTP_TIMEOUT_MS = 12e4;
14
10
  const POLL_INTERVAL_MS = 2500;
15
11
  const MAX_POLL_ATTEMPTS = 120;
@@ -21,21 +17,6 @@ function addUrlValue(value, urls) {
21
17
  }
22
18
  if (Array.isArray(value)) for (const entry of value) addUrlValue(entry, urls);
23
19
  }
24
- function normalizeVydraBaseUrl(value) {
25
- const fallback = DEFAULT_VYDRA_BASE_URL;
26
- const trimmed = normalizeOptionalString(value);
27
- if (!trimmed) return fallback;
28
- try {
29
- const url = new URL(trimmed);
30
- if (url.hostname === "vydra.ai") url.hostname = "www.vydra.ai";
31
- const pathname = url.pathname.replace(/\/+$/u, "");
32
- if (!pathname) url.pathname = "/api/v1";
33
- else url.pathname = pathname;
34
- return url.toString().replace(/\/$/u, "");
35
- } catch {
36
- return fallback;
37
- }
38
- }
39
20
  function resolveVydraBaseUrlFromConfig(cfg) {
40
21
  const models = asOptionalRecord(asOptionalRecord(cfg)?.models);
41
22
  const providers = asOptionalRecord(models?.providers);
@@ -92,15 +73,8 @@ function resolveVydraErrorMessage(payload) {
92
73
  }
93
74
  function extractVydraResultUrls(payload, kind) {
94
75
  const urls = /* @__PURE__ */ new Set();
95
- const preferredKeys = kind === "audio" ? ["audioUrl", "audioUrls"] : kind === "image" ? ["imageUrl", "imageUrls"] : ["videoUrl", "videoUrls"];
96
- const sharedKeys = [
97
- "resultUrl",
98
- "resultUrls",
99
- "outputUrl",
100
- "outputUrls",
101
- "url",
102
- "urls"
103
- ];
76
+ const urlKeys = kind === "audio" ? ["audioUrl", "audioUrls"] : kind === "image" ? ["imageUrl", "imageUrls"] : ["videoUrl", "videoUrls"];
77
+ urlKeys.push("resultUrl", "resultUrls", "outputUrl", "outputUrls", "url", "urls");
104
78
  const recurseKeys = [
105
79
  "output",
106
80
  "outputs",
@@ -118,7 +92,7 @@ function extractVydraResultUrls(payload, kind) {
118
92
  }
119
93
  const object = asOptionalRecord(value);
120
94
  if (!object) return;
121
- for (const key of [...preferredKeys, ...sharedKeys]) addUrlValue(object[key], urls);
95
+ for (const key of urlKeys) addUrlValue(object[key], urls);
122
96
  for (const key of recurseKeys) if (key in object) visit(object[key], depth + 1);
123
97
  };
124
98
  visit(payload);
@@ -299,4 +273,4 @@ async function runVydraGeneration(params) {
299
273
  }
300
274
  }
301
275
  //#endregion
302
- export { DEFAULT_VYDRA_BASE_URL, DEFAULT_VYDRA_IMAGE_MODEL, DEFAULT_VYDRA_SPEECH_MODEL, DEFAULT_VYDRA_VIDEO_MODEL, DEFAULT_VYDRA_VOICE_ID, downloadVydraAsset, extractVydraResultUrls, normalizeVydraBaseUrl, runVydraGeneration };
276
+ export { DEFAULT_VYDRA_IMAGE_MODEL, DEFAULT_VYDRA_VIDEO_MODEL, downloadVydraAsset, extractVydraResultUrls, runVydraGeneration };
@@ -1,9 +1,7 @@
1
- import { DEFAULT_VYDRA_BASE_URL, DEFAULT_VYDRA_SPEECH_MODEL, DEFAULT_VYDRA_VOICE_ID, downloadVydraAsset, extractVydraResultUrls, normalizeVydraBaseUrl } from "./shared.js";
2
- import { resolveGeneratedMediaMaxBytes } from "openclaw/plugin-sdk/media-generation-runtime";
3
- import { assertOkOrThrowHttpError, postJsonRequest, readProviderJsonResponse, resolveProviderHttpRequestConfig } from "openclaw/plugin-sdk/provider-http";
1
+ import { DEFAULT_VYDRA_BASE_URL, DEFAULT_VYDRA_SPEECH_MODEL, DEFAULT_VYDRA_VOICE_ID, normalizeVydraBaseUrl } from "./defaults.js";
4
2
  import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
3
  import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
6
- import { resolveSpeechProviderApiKey } from "openclaw/plugin-sdk/speech-core";
4
+ import { resolveSpeechProviderApiKey } from "openclaw/plugin-sdk/speech-provider";
7
5
  //#region extensions/vydra/speech-provider.ts
8
6
  const VYDRA_SPEECH_VOICES = [{
9
7
  id: DEFAULT_VYDRA_VOICE_ID,
@@ -48,10 +46,13 @@ function buildVydraSpeechProvider() {
48
46
  listVoices: async () => VYDRA_SPEECH_VOICES.map((voice) => Object.assign({}, voice)),
49
47
  isConfigured: ({ providerConfig }) => Boolean(resolveSpeechProviderApiKey(readVydraSpeechConfig(providerConfig).apiKey, process.env.VYDRA_API_KEY)),
50
48
  synthesize: async (req) => {
49
+ const { downloadVydraAsset, extractVydraResultUrls } = await import("./shared.js");
51
50
  const config = readVydraSpeechConfig(req.providerConfig);
52
51
  const overrides = readVydraOverrides(req.providerOverrides);
53
52
  const apiKey = resolveSpeechProviderApiKey(config.apiKey, process.env.VYDRA_API_KEY);
54
53
  if (!apiKey) throw new Error("Vydra API key missing");
54
+ const { resolveGeneratedMediaMaxBytes } = await import("openclaw/plugin-sdk/media-generation-runtime");
55
+ const { assertOkOrThrowHttpError, postJsonRequest, readProviderJsonResponse, resolveProviderHttpRequestConfig } = await import("openclaw/plugin-sdk/provider-http");
55
56
  const fetchFn = fetch;
56
57
  const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } = resolveProviderHttpRequestConfig({
57
58
  baseUrl: config.baseUrl,
@@ -79,8 +80,7 @@ function buildVydraSpeechProvider() {
79
80
  });
80
81
  try {
81
82
  await assertOkOrThrowHttpError(response, "Vydra speech synthesis failed");
82
- const payload = await readProviderJsonResponse(response, "Vydra speech synthesis");
83
- const audioUrl = extractVydraResultUrls(payload, "audio")[0];
83
+ const audioUrl = extractVydraResultUrls(await readProviderJsonResponse(response, "Vydra speech synthesis"), "audio")[0];
84
84
  if (!audioUrl) throw new Error("Vydra speech synthesis response missing audio URL");
85
85
  const audio = await downloadVydraAsset({
86
86
  url: audioUrl,
@@ -1,4 +1,5 @@
1
- import { DEFAULT_VYDRA_VIDEO_MODEL, runVydraGeneration } from "./shared.js";
1
+ import { DEFAULT_VYDRA_VIDEO_MODEL } from "./defaults.js";
2
+ import { runVydraGeneration } from "./shared.js";
2
3
  import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
3
4
  //#region extensions/vydra/video-generation-provider.ts
4
5
  const VYDRA_KLING_MODEL = "kling";
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "id": "vydra",
3
+ "capabilityCatalogEntry": "./dist/capability-catalog.js",
3
4
  "activation": {
4
5
  "onStartup": false
5
6
  },
6
7
  "enabledByDefault": true,
7
- "providers": ["vydra"],
8
+ "providers": [
9
+ "vydra"
10
+ ],
8
11
  "setup": {
9
12
  "providers": [
10
13
  {
11
14
  "id": "vydra",
12
- "envVars": ["VYDRA_API_KEY"]
15
+ "envVars": [
16
+ "VYDRA_API_KEY"
17
+ ]
13
18
  }
14
19
  ]
15
20
  },
@@ -22,7 +27,9 @@
22
27
  "groupId": "vydra",
23
28
  "groupLabel": "Vydra",
24
29
  "groupHint": "Image, video, and speech",
25
- "onboardingScopes": ["image-generation"],
30
+ "onboardingScopes": [
31
+ "image-generation"
32
+ ],
26
33
  "optionKey": "vydraApiKey",
27
34
  "cliFlag": "--vydra-api-key",
28
35
  "cliOption": "--vydra-api-key <key>",
@@ -30,9 +37,15 @@
30
37
  }
31
38
  ],
32
39
  "contracts": {
33
- "speechProviders": ["vydra"],
34
- "imageGenerationProviders": ["vydra"],
35
- "videoGenerationProviders": ["vydra"]
40
+ "speechProviders": [
41
+ "vydra"
42
+ ],
43
+ "imageGenerationProviders": [
44
+ "vydra"
45
+ ],
46
+ "videoGenerationProviders": [
47
+ "vydra"
48
+ ]
36
49
  },
37
50
  "configSchema": {
38
51
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/vydra-provider",
3
- "version": "2026.9.1",
3
+ "version": "2026.9.2",
4
4
  "description": "OpenClaw Vydra media provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.7.2"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.9.1"
21
+ "pluginApi": ">=2026.9.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.9.1",
24
+ "openclawVersion": "2026.9.2",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -38,7 +38,7 @@
38
38
  "README.md"
39
39
  ],
40
40
  "peerDependencies": {
41
- "openclaw": ">=2026.9.1"
41
+ "openclaw": ">=2026.9.2"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "openclaw": {