@openclaw/vydra-provider 2026.9.1-beta.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,23 +17,11 @@ 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
- return normalizeVydraBaseUrl(normalizeOptionalString(asOptionalRecord(asOptionalRecord(asOptionalRecord(asOptionalRecord(cfg)?.models)?.providers)?.vydra)?.baseUrl));
21
+ const models = asOptionalRecord(asOptionalRecord(cfg)?.models);
22
+ const providers = asOptionalRecord(models?.providers);
23
+ const vydra = asOptionalRecord(providers?.vydra);
24
+ return normalizeVydraBaseUrl(normalizeOptionalString(vydra?.baseUrl));
41
25
  }
42
26
  async function resolveVydraRequestContext(params) {
43
27
  const auth = await resolveApiKeyForProvider({
@@ -89,15 +73,8 @@ function resolveVydraErrorMessage(payload) {
89
73
  }
90
74
  function extractVydraResultUrls(payload, kind) {
91
75
  const urls = /* @__PURE__ */ new Set();
92
- const preferredKeys = kind === "audio" ? ["audioUrl", "audioUrls"] : kind === "image" ? ["imageUrl", "imageUrls"] : ["videoUrl", "videoUrls"];
93
- const sharedKeys = [
94
- "resultUrl",
95
- "resultUrls",
96
- "outputUrl",
97
- "outputUrls",
98
- "url",
99
- "urls"
100
- ];
76
+ const urlKeys = kind === "audio" ? ["audioUrl", "audioUrls"] : kind === "image" ? ["imageUrl", "imageUrls"] : ["videoUrl", "videoUrls"];
77
+ urlKeys.push("resultUrl", "resultUrls", "outputUrl", "outputUrls", "url", "urls");
101
78
  const recurseKeys = [
102
79
  "output",
103
80
  "outputs",
@@ -115,7 +92,7 @@ function extractVydraResultUrls(payload, kind) {
115
92
  }
116
93
  const object = asOptionalRecord(value);
117
94
  if (!object) return;
118
- for (const key of [...preferredKeys, ...sharedKeys]) addUrlValue(object[key], urls);
95
+ for (const key of urlKeys) addUrlValue(object[key], urls);
119
96
  for (const key of recurseKeys) if (key in object) visit(object[key], depth + 1);
120
97
  };
121
98
  visit(payload);
@@ -296,4 +273,4 @@ async function runVydraGeneration(params) {
296
273
  }
297
274
  }
298
275
  //#endregion
299
- 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,16 +1,15 @@
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,
10
8
  name: "Rachel"
11
9
  }];
12
10
  function normalizeVydraSpeechConfig(rawConfig) {
13
- const raw = asOptionalRecord(asOptionalRecord(rawConfig.providers)?.vydra) ?? asOptionalRecord(rawConfig.vydra);
11
+ const providers = asOptionalRecord(rawConfig.providers);
12
+ const raw = asOptionalRecord(providers?.vydra) ?? asOptionalRecord(rawConfig.vydra);
14
13
  return {
15
14
  apiKey: normalizeResolvedSecretInputString({
16
15
  value: raw?.apiKey,
@@ -47,10 +46,13 @@ function buildVydraSpeechProvider() {
47
46
  listVoices: async () => VYDRA_SPEECH_VOICES.map((voice) => Object.assign({}, voice)),
48
47
  isConfigured: ({ providerConfig }) => Boolean(resolveSpeechProviderApiKey(readVydraSpeechConfig(providerConfig).apiKey, process.env.VYDRA_API_KEY)),
49
48
  synthesize: async (req) => {
49
+ const { downloadVydraAsset, extractVydraResultUrls } = await import("./shared.js");
50
50
  const config = readVydraSpeechConfig(req.providerConfig);
51
51
  const overrides = readVydraOverrides(req.providerOverrides);
52
52
  const apiKey = resolveSpeechProviderApiKey(config.apiKey, process.env.VYDRA_API_KEY);
53
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");
54
56
  const fetchFn = fetch;
55
57
  const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } = resolveProviderHttpRequestConfig({
56
58
  baseUrl: config.baseUrl,
@@ -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-beta.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-beta.1"
21
+ "pluginApi": ">=2026.9.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.9.1-beta.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-beta.1"
41
+ "openclaw": ">=2026.9.2"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "openclaw": {