@openclaw/inworld-speech 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.
- package/dist/capability-catalog.js +5 -0
- package/dist/speech-provider.js +18 -17
- package/dist/tts.js +10 -7
- 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, {
|
|
@@ -11,25 +11,26 @@ function normalizeInworldTemperature(value) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function normalizeInworldProviderConfig(rawConfig) {
|
|
14
|
-
const
|
|
14
|
+
const providers = asOptionalRecord(rawConfig.providers);
|
|
15
|
+
const raw = asOptionalRecord(providers?.inworld) ?? asOptionalRecord(rawConfig.inworld);
|
|
15
16
|
return {
|
|
16
17
|
apiKey: normalizeResolvedSecretInputString({
|
|
17
18
|
value: raw?.apiKey,
|
|
18
19
|
path: "tts.providers.inworld.apiKey"
|
|
19
20
|
}),
|
|
20
|
-
baseUrl: normalizeInworldBaseUrl(
|
|
21
|
-
voiceId:
|
|
22
|
-
modelId:
|
|
21
|
+
baseUrl: normalizeInworldBaseUrl(normalizeOptionalString(raw?.baseUrl)),
|
|
22
|
+
voiceId: normalizeOptionalString(raw?.voiceId) ?? "Sarah",
|
|
23
|
+
modelId: normalizeOptionalString(raw?.modelId) ?? "inworld-tts-1.5-max",
|
|
23
24
|
temperature: normalizeInworldTemperature(raw?.temperature)
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
function readInworldProviderConfig(config) {
|
|
27
28
|
const defaults = normalizeInworldProviderConfig({});
|
|
28
29
|
return {
|
|
29
|
-
apiKey:
|
|
30
|
-
baseUrl: normalizeInworldBaseUrl(
|
|
31
|
-
voiceId:
|
|
32
|
-
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,
|
|
33
34
|
temperature: normalizeInworldTemperature(config.temperature) ?? defaults.temperature
|
|
34
35
|
};
|
|
35
36
|
}
|
|
@@ -38,8 +39,8 @@ function resolveInworldApiKey(primary, fallback) {
|
|
|
38
39
|
}
|
|
39
40
|
function readInworldOverrides(overrides) {
|
|
40
41
|
return {
|
|
41
|
-
voiceId:
|
|
42
|
-
modelId:
|
|
42
|
+
voiceId: normalizeOptionalString(overrides?.voiceId ?? overrides?.voice),
|
|
43
|
+
modelId: normalizeOptionalString(overrides?.modelId ?? overrides?.model),
|
|
43
44
|
temperature: normalizeInworldTemperature(overrides?.temperature)
|
|
44
45
|
};
|
|
45
46
|
}
|
|
@@ -113,15 +114,15 @@ function buildInworldSpeechProvider() {
|
|
|
113
114
|
return {
|
|
114
115
|
...base,
|
|
115
116
|
...resolvedApiKey === void 0 ? {} : { apiKey: resolvedApiKey },
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
...
|
|
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) },
|
|
119
120
|
...normalizeInworldTemperature(talkProviderConfig.temperature) == null ? {} : { temperature: normalizeInworldTemperature(talkProviderConfig.temperature) }
|
|
120
121
|
};
|
|
121
122
|
},
|
|
122
123
|
resolveTalkOverrides: ({ params }) => ({
|
|
123
|
-
...
|
|
124
|
-
...
|
|
124
|
+
...normalizeOptionalString(params.voiceId) == null ? {} : { voiceId: normalizeOptionalString(params.voiceId) },
|
|
125
|
+
...normalizeOptionalString(params.modelId) == null ? {} : { modelId: normalizeOptionalString(params.modelId) },
|
|
125
126
|
...normalizeInworldTemperature(params.temperature) == null ? {} : { temperature: normalizeInworldTemperature(params.temperature) }
|
|
126
127
|
}),
|
|
127
128
|
listVoices: async (req) => {
|
package/dist/tts.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
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
|
-
const INWORLD_ERROR_BODY_MAX_BYTES =
|
|
8
|
+
const INWORLD_ERROR_BODY_MAX_BYTES = 8192;
|
|
13
9
|
const INWORLD_ERROR_BODY_MAX_CHARS = 400;
|
|
14
10
|
const INWORLD_ERROR_BODY_READ_IDLE_TIMEOUT_MS = 1e4;
|
|
15
11
|
var InworldErrorBodyOverflow = class extends Error {};
|
|
@@ -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,9 +126,13 @@ 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);
|
|
132
|
+
const url = `${baseUrl}/voices/v1/voices${params.language ? `?languages=${encodeURIComponent(params.language)}` : ""}`;
|
|
133
|
+
const { fetchWithSsrFGuard } = await import("openclaw/plugin-sdk/ssrf-runtime");
|
|
131
134
|
const { response, release } = await fetchWithSsrFGuard({
|
|
132
|
-
url
|
|
135
|
+
url,
|
|
133
136
|
init: {
|
|
134
137
|
method: "GET",
|
|
135
138
|
headers: { Authorization: `Basic ${params.apiKey}` }
|
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.2",
|
|
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.2"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
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.
|
|
41
|
+
"openclaw": ">=2026.9.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|