@openclaw/inworld-speech 2026.9.1 → 2026.9.3
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/capability-catalog.js +5 -0
- package/dist/speech-provider.js +16 -16
- package/dist/tts.js +7 -5
- package/openclaw.plugin.json +7 -2
- package/package.json +4 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { buildInworldSpeechProvider } from "./speech-provider.js";
|
|
2
|
+
//#region extensions/inworld/capability-catalog.ts
|
|
3
|
+
var capability_catalog_default = { speechProviders: [buildInworldSpeechProvider()] };
|
|
4
|
+
//#endregion
|
|
5
|
+
export { capability_catalog_default as default };
|
package/dist/speech-provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_INWORLD_MODEL_ID, INWORLD_TTS_MODELS, inworldTTS, listInworldVoices, normalizeInworldBaseUrl } from "./tts.js";
|
|
2
2
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
3
|
-
import { parseSpeechDirectiveNumberOverride, resolveSpeechProviderApiKey
|
|
4
|
-
import { asFiniteNumberInRange, asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { parseSpeechDirectiveNumberOverride, resolveSpeechProviderApiKey } from "openclaw/plugin-sdk/speech-provider";
|
|
4
|
+
import { asFiniteNumberInRange, asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/inworld/speech-provider.ts
|
|
6
6
|
function normalizeInworldTemperature(value) {
|
|
7
7
|
return asFiniteNumberInRange(value, {
|
|
@@ -18,19 +18,19 @@ function normalizeInworldProviderConfig(rawConfig) {
|
|
|
18
18
|
value: raw?.apiKey,
|
|
19
19
|
path: "tts.providers.inworld.apiKey"
|
|
20
20
|
}),
|
|
21
|
-
baseUrl: normalizeInworldBaseUrl(
|
|
22
|
-
voiceId:
|
|
23
|
-
modelId:
|
|
21
|
+
baseUrl: normalizeInworldBaseUrl(normalizeOptionalString(raw?.baseUrl)),
|
|
22
|
+
voiceId: normalizeOptionalString(raw?.voiceId) ?? "Sarah",
|
|
23
|
+
modelId: normalizeOptionalString(raw?.modelId) ?? "inworld-tts-1.5-max",
|
|
24
24
|
temperature: normalizeInworldTemperature(raw?.temperature)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function readInworldProviderConfig(config) {
|
|
28
28
|
const defaults = normalizeInworldProviderConfig({});
|
|
29
29
|
return {
|
|
30
|
-
apiKey:
|
|
31
|
-
baseUrl: normalizeInworldBaseUrl(
|
|
32
|
-
voiceId:
|
|
33
|
-
modelId:
|
|
30
|
+
apiKey: normalizeOptionalString(config.apiKey) ?? defaults.apiKey,
|
|
31
|
+
baseUrl: normalizeInworldBaseUrl(normalizeOptionalString(config.baseUrl) ?? defaults.baseUrl),
|
|
32
|
+
voiceId: normalizeOptionalString(config.voiceId) ?? defaults.voiceId,
|
|
33
|
+
modelId: normalizeOptionalString(config.modelId) ?? defaults.modelId,
|
|
34
34
|
temperature: normalizeInworldTemperature(config.temperature) ?? defaults.temperature
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -39,8 +39,8 @@ function resolveInworldApiKey(primary, fallback) {
|
|
|
39
39
|
}
|
|
40
40
|
function readInworldOverrides(overrides) {
|
|
41
41
|
return {
|
|
42
|
-
voiceId:
|
|
43
|
-
modelId:
|
|
42
|
+
voiceId: normalizeOptionalString(overrides?.voiceId ?? overrides?.voice),
|
|
43
|
+
modelId: normalizeOptionalString(overrides?.modelId ?? overrides?.model),
|
|
44
44
|
temperature: normalizeInworldTemperature(overrides?.temperature)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
@@ -114,15 +114,15 @@ function buildInworldSpeechProvider() {
|
|
|
114
114
|
return {
|
|
115
115
|
...base,
|
|
116
116
|
...resolvedApiKey === void 0 ? {} : { apiKey: resolvedApiKey },
|
|
117
|
-
...
|
|
118
|
-
...
|
|
119
|
-
...
|
|
117
|
+
...normalizeOptionalString(talkProviderConfig.baseUrl) == null ? {} : { baseUrl: normalizeInworldBaseUrl(normalizeOptionalString(talkProviderConfig.baseUrl)) },
|
|
118
|
+
...normalizeOptionalString(talkProviderConfig.voiceId) == null ? {} : { voiceId: normalizeOptionalString(talkProviderConfig.voiceId) },
|
|
119
|
+
...normalizeOptionalString(talkProviderConfig.modelId) == null ? {} : { modelId: normalizeOptionalString(talkProviderConfig.modelId) },
|
|
120
120
|
...normalizeInworldTemperature(talkProviderConfig.temperature) == null ? {} : { temperature: normalizeInworldTemperature(talkProviderConfig.temperature) }
|
|
121
121
|
};
|
|
122
122
|
},
|
|
123
123
|
resolveTalkOverrides: ({ params }) => ({
|
|
124
|
-
...
|
|
125
|
-
...
|
|
124
|
+
...normalizeOptionalString(params.voiceId) == null ? {} : { voiceId: normalizeOptionalString(params.voiceId) },
|
|
125
|
+
...normalizeOptionalString(params.modelId) == null ? {} : { modelId: normalizeOptionalString(params.modelId) },
|
|
126
126
|
...normalizeInworldTemperature(params.temperature) == null ? {} : { temperature: normalizeInworldTemperature(params.temperature) }
|
|
127
127
|
}),
|
|
128
128
|
listVoices: async (req) => {
|
package/dist/tts.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/speech-provider";
|
|
2
2
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
3
|
-
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
3
|
//#region extensions/inworld/tts.ts
|
|
6
4
|
const DEFAULT_INWORLD_BASE_URL = "https://api.inworld.ai";
|
|
7
5
|
const DEFAULT_INWORLD_VOICE_ID = "Sarah";
|
|
8
6
|
const DEFAULT_INWORLD_MODEL_ID = "inworld-tts-1.5-max";
|
|
9
|
-
const INWORLD_TTS_BODY_MAX_BYTES = MAX_AUDIO_BYTES * 2;
|
|
10
|
-
const INWORLD_VOICES_BODY_MAX_BYTES = MAX_AUDIO_BYTES;
|
|
11
7
|
const INWORLD_UPSTREAM_IDLE_TIMEOUT_MS = 3e4;
|
|
12
8
|
const INWORLD_ERROR_BODY_MAX_BYTES = 8192;
|
|
13
9
|
const INWORLD_ERROR_BODY_MAX_CHARS = 400;
|
|
@@ -62,6 +58,8 @@ function ssrfPolicyFromInworldBaseUrl(baseUrl) {
|
|
|
62
58
|
* carrying base64 audio in `result.audioContent`.
|
|
63
59
|
*/
|
|
64
60
|
async function inworldTTS(params) {
|
|
61
|
+
const { canonicalizeBase64, MAX_AUDIO_BYTES } = await import("openclaw/plugin-sdk/media-runtime");
|
|
62
|
+
const INWORLD_TTS_BODY_MAX_BYTES = MAX_AUDIO_BYTES * 2;
|
|
65
63
|
const baseUrl = normalizeInworldBaseUrl(params.baseUrl);
|
|
66
64
|
const url = `${baseUrl}/tts/v1/voice:stream`;
|
|
67
65
|
const requestBody = JSON.stringify({
|
|
@@ -74,6 +72,7 @@ async function inworldTTS(params) {
|
|
|
74
72
|
},
|
|
75
73
|
...params.temperature != null && { temperature: params.temperature }
|
|
76
74
|
});
|
|
75
|
+
const { fetchWithSsrFGuard } = await import("openclaw/plugin-sdk/ssrf-runtime");
|
|
77
76
|
const { response, release } = await fetchWithSsrFGuard({
|
|
78
77
|
url,
|
|
79
78
|
init: {
|
|
@@ -127,8 +126,11 @@ async function inworldTTS(params) {
|
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
async function listInworldVoices(params) {
|
|
129
|
+
const { MAX_AUDIO_BYTES } = await import("openclaw/plugin-sdk/media-runtime");
|
|
130
|
+
const INWORLD_VOICES_BODY_MAX_BYTES = MAX_AUDIO_BYTES;
|
|
130
131
|
const baseUrl = normalizeInworldBaseUrl(params.baseUrl);
|
|
131
132
|
const url = `${baseUrl}/voices/v1/voices${params.language ? `?languages=${encodeURIComponent(params.language)}` : ""}`;
|
|
133
|
+
const { fetchWithSsrFGuard } = await import("openclaw/plugin-sdk/ssrf-runtime");
|
|
132
134
|
const { response, release } = await fetchWithSsrFGuard({
|
|
133
135
|
url,
|
|
134
136
|
init: {
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "inworld",
|
|
3
|
+
"capabilityCatalogEntry": "./dist/capability-catalog.js",
|
|
3
4
|
"activation": {
|
|
4
5
|
"onStartup": false
|
|
5
6
|
},
|
|
@@ -10,12 +11,16 @@
|
|
|
10
11
|
"providers": [
|
|
11
12
|
{
|
|
12
13
|
"id": "inworld",
|
|
13
|
-
"envVars": [
|
|
14
|
+
"envVars": [
|
|
15
|
+
"INWORLD_API_KEY"
|
|
16
|
+
]
|
|
14
17
|
}
|
|
15
18
|
]
|
|
16
19
|
},
|
|
17
20
|
"contracts": {
|
|
18
|
-
"speechProviders": [
|
|
21
|
+
"speechProviders": [
|
|
22
|
+
"inworld"
|
|
23
|
+
]
|
|
19
24
|
},
|
|
20
25
|
"configSchema": {
|
|
21
26
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/inworld-speech",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.3",
|
|
4
4
|
"description": "OpenClaw Inworld 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.9.
|
|
21
|
+
"pluginApi": ">=2026.9.3"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.3",
|
|
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.
|
|
41
|
+
"openclaw": ">=2026.9.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|