@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.
@@ -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 };
@@ -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, trimToUndefined } from "openclaw/plugin-sdk/speech-core";
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 raw = asOptionalRecord(asOptionalRecord(rawConfig.providers)?.inworld) ?? asOptionalRecord(rawConfig.inworld);
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(trimToUndefined(raw?.baseUrl)),
21
- voiceId: trimToUndefined(raw?.voiceId) ?? "Sarah",
22
- modelId: trimToUndefined(raw?.modelId) ?? "inworld-tts-1.5-max",
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: trimToUndefined(config.apiKey) ?? defaults.apiKey,
30
- baseUrl: normalizeInworldBaseUrl(trimToUndefined(config.baseUrl) ?? defaults.baseUrl),
31
- voiceId: trimToUndefined(config.voiceId) ?? defaults.voiceId,
32
- modelId: trimToUndefined(config.modelId) ?? defaults.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: trimToUndefined(overrides?.voiceId ?? overrides?.voice),
42
- modelId: trimToUndefined(overrides?.modelId ?? overrides?.model),
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
- ...trimToUndefined(talkProviderConfig.baseUrl) == null ? {} : { baseUrl: normalizeInworldBaseUrl(trimToUndefined(talkProviderConfig.baseUrl)) },
117
- ...trimToUndefined(talkProviderConfig.voiceId) == null ? {} : { voiceId: trimToUndefined(talkProviderConfig.voiceId) },
118
- ...trimToUndefined(talkProviderConfig.modelId) == null ? {} : { modelId: trimToUndefined(talkProviderConfig.modelId) },
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
- ...trimToUndefined(params.voiceId) == null ? {} : { voiceId: trimToUndefined(params.voiceId) },
124
- ...trimToUndefined(params.modelId) == null ? {} : { modelId: trimToUndefined(params.modelId) },
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 { MAX_AUDIO_BYTES, canonicalizeBase64 } from "openclaw/plugin-sdk/media-runtime";
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 * 1024;
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: `${baseUrl}/voices/v1/voices${params.language ? `?languages=${encodeURIComponent(params.language)}` : ""}`,
135
+ url,
133
136
  init: {
134
137
  method: "GET",
135
138
  headers: { Authorization: `Basic ${params.apiKey}` }
@@ -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": ["INWORLD_API_KEY"]
14
+ "envVars": [
15
+ "INWORLD_API_KEY"
16
+ ]
14
17
  }
15
18
  ]
16
19
  },
17
20
  "contracts": {
18
- "speechProviders": ["inworld"]
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.1-beta.1",
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.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": {