@openclaw/gradium-speech 2026.7.1 → 2026.7.2-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.
- package/dist/shared.js +16 -2
- package/dist/tts.js +4 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
package/dist/shared.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region extensions/gradium/shared.ts
|
|
2
2
|
const DEFAULT_GRADIUM_BASE_URL = "https://api.gradium.ai";
|
|
3
|
+
const GRADIUM_API_HOSTNAME = "api.gradium.ai";
|
|
3
4
|
const DEFAULT_GRADIUM_VOICE_ID = "YTpq7expH9539ERJ";
|
|
4
5
|
const GRADIUM_VOICES = [
|
|
5
6
|
{
|
|
@@ -32,7 +33,20 @@ const GRADIUM_VOICES = [
|
|
|
32
33
|
}
|
|
33
34
|
];
|
|
34
35
|
function normalizeGradiumBaseUrl(baseUrl) {
|
|
35
|
-
|
|
36
|
+
const raw = baseUrl?.trim() || DEFAULT_GRADIUM_BASE_URL;
|
|
37
|
+
let url;
|
|
38
|
+
try {
|
|
39
|
+
url = new URL(raw);
|
|
40
|
+
} catch {
|
|
41
|
+
throw new Error("Gradium baseUrl must be a valid https URL");
|
|
42
|
+
}
|
|
43
|
+
url.username = "";
|
|
44
|
+
url.password = "";
|
|
45
|
+
url.search = "";
|
|
46
|
+
url.hash = "";
|
|
47
|
+
if (url.protocol !== "https:") throw new Error("Gradium baseUrl must use https");
|
|
48
|
+
if (url.hostname.toLowerCase() !== "api.gradium.ai") throw new Error("Gradium baseUrl must target api.gradium.ai");
|
|
49
|
+
return url.toString().replace(/\/+$/, "");
|
|
36
50
|
}
|
|
37
51
|
//#endregion
|
|
38
|
-
export { DEFAULT_GRADIUM_VOICE_ID, GRADIUM_VOICES, normalizeGradiumBaseUrl };
|
|
52
|
+
export { DEFAULT_GRADIUM_VOICE_ID, GRADIUM_API_HOSTNAME, GRADIUM_VOICES, normalizeGradiumBaseUrl };
|
package/dist/tts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeGradiumBaseUrl } from "./shared.js";
|
|
1
|
+
import { GRADIUM_API_HOSTNAME, normalizeGradiumBaseUrl } from "./shared.js";
|
|
2
2
|
import { assertOkOrThrowProviderError } from "openclaw/plugin-sdk/provider-http";
|
|
3
3
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
4
4
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -6,11 +6,8 @@ import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
|
6
6
|
const DEFAULT_TTS_MAX_BYTES = 16 * 1024 * 1024;
|
|
7
7
|
async function gradiumTTS(params) {
|
|
8
8
|
const { text, apiKey, baseUrl, voiceId, outputFormat, timeoutMs, maxBytes = DEFAULT_TTS_MAX_BYTES } = params;
|
|
9
|
-
const normalizedBaseUrl = normalizeGradiumBaseUrl(baseUrl);
|
|
10
|
-
const url = `${normalizedBaseUrl}/api/post/speech/tts`;
|
|
11
|
-
const hostname = new URL(normalizedBaseUrl).hostname;
|
|
12
9
|
const { response, release } = await fetchWithSsrFGuard({
|
|
13
|
-
url
|
|
10
|
+
url: `${normalizeGradiumBaseUrl(baseUrl)}/api/post/speech/tts`,
|
|
14
11
|
init: {
|
|
15
12
|
method: "POST",
|
|
16
13
|
headers: {
|
|
@@ -26,7 +23,8 @@ async function gradiumTTS(params) {
|
|
|
26
23
|
})
|
|
27
24
|
},
|
|
28
25
|
timeoutMs,
|
|
29
|
-
|
|
26
|
+
requireHttps: true,
|
|
27
|
+
policy: { hostnameAllowlist: [GRADIUM_API_HOSTNAME] },
|
|
30
28
|
auditContext: "gradium.tts"
|
|
31
29
|
});
|
|
32
30
|
try {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/gradium-speech",
|
|
3
|
-
"version": "2026.7.1",
|
|
3
|
+
"version": "2026.7.2-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/gradium-speech",
|
|
9
|
-
"version": "2026.7.1"
|
|
9
|
+
"version": "2026.7.2-beta.1"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/gradium-speech",
|
|
3
|
-
"version": "2026.7.1",
|
|
3
|
+
"version": "2026.7.2-beta.1",
|
|
4
4
|
"description": "OpenClaw Gradium speech plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.7.1"
|
|
21
|
+
"pluginApi": ">=2026.7.2-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.7.1",
|
|
24
|
+
"openclawVersion": "2026.7.2-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"README.md"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"openclaw": ">=2026.7.1"
|
|
42
|
+
"openclaw": ">=2026.7.2-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"openclaw": {
|