@openclaw/voice-call 2026.6.9-beta.1 → 2026.6.10-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.
@@ -1,6 +1,6 @@
1
1
  import { fetchWithSsrFGuard } from "./runtime-api.js";
2
2
  import "./api.js";
3
- import { a as getHeader } from "./runtime-entry-BJNPmzDP.js";
3
+ import { a as getHeader } from "./runtime-entry-B8fUMehO.js";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
5
  import { isLoopbackHost } from "openclaw/plugin-sdk/gateway-runtime";
6
6
  import { isFutureDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
@@ -560,6 +560,61 @@ function verifyPlivoWebhook(ctx, authToken, options) {
560
560
  };
561
561
  }
562
562
  //#endregion
563
+ //#region extensions/voice-call/src/providers/shared/response-body.ts
564
+ const PROVIDER_JSON_RESPONSE_MAX_BYTES = 1 * 1024 * 1024;
565
+ const PROVIDER_ERROR_RESPONSE_MAX_BYTES = 8 * 1024;
566
+ const TRUNCATED_SUFFIX = "... [truncated]";
567
+ async function cancelProviderResponseBody(response) {
568
+ await response.body?.cancel().catch(() => void 0);
569
+ }
570
+ function appendTruncatedSuffix(text) {
571
+ return `${text.trimEnd()}${TRUNCATED_SUFFIX}`;
572
+ }
573
+ async function readProviderResponseTextWithLimit(params) {
574
+ if (!params.response.body) return "";
575
+ const reader = params.response.body.getReader();
576
+ const decoder = new TextDecoder();
577
+ let totalBytes = 0;
578
+ let text = "";
579
+ try {
580
+ while (true) {
581
+ const { done, value } = await reader.read();
582
+ if (done) return text + decoder.decode();
583
+ if (!value?.byteLength) continue;
584
+ const remainingBytes = params.maxBytes - totalBytes;
585
+ if (value.byteLength > remainingBytes) {
586
+ if (params.truncateOnLimit) {
587
+ const clipped = remainingBytes > 0 ? value.slice(0, remainingBytes) : void 0;
588
+ if (clipped) text += decoder.decode(clipped, { stream: true });
589
+ await reader.cancel().catch(() => void 0);
590
+ return appendTruncatedSuffix(text + decoder.decode());
591
+ }
592
+ await reader.cancel().catch(() => void 0);
593
+ throw new Error(`provider response body too large: ${totalBytes + value.byteLength} bytes (limit: ${params.maxBytes} bytes)`);
594
+ }
595
+ text += decoder.decode(value, { stream: true });
596
+ totalBytes += value.byteLength;
597
+ }
598
+ } finally {
599
+ try {
600
+ reader.releaseLock();
601
+ } catch {}
602
+ }
603
+ }
604
+ async function readProviderJsonResponseText(response) {
605
+ return await readProviderResponseTextWithLimit({
606
+ response,
607
+ maxBytes: PROVIDER_JSON_RESPONSE_MAX_BYTES
608
+ });
609
+ }
610
+ async function readProviderErrorResponseSnippet(response) {
611
+ return await readProviderResponseTextWithLimit({
612
+ response,
613
+ maxBytes: PROVIDER_ERROR_RESPONSE_MAX_BYTES,
614
+ truncateOnLimit: true
615
+ });
616
+ }
617
+ //#endregion
563
618
  //#region extensions/voice-call/src/providers/shared/guarded-json-api.ts
564
619
  /** Send a provider JSON request through the SSRF guard and parse bounded JSON responses. */
565
620
  async function guardedJsonApiRequest(params) {
@@ -575,11 +630,14 @@ async function guardedJsonApiRequest(params) {
575
630
  });
576
631
  try {
577
632
  if (!response.ok) {
578
- if (params.allowNotFound && response.status === 404) return;
579
- const errorText = await response.text();
633
+ if (params.allowNotFound && response.status === 404) {
634
+ await cancelProviderResponseBody(response);
635
+ return;
636
+ }
637
+ const errorText = await readProviderErrorResponseSnippet(response);
580
638
  throw new Error(`${params.errorPrefix}: ${response.status} ${errorText}`);
581
639
  }
582
- const text = await response.text();
640
+ const text = await readProviderJsonResponseText(response);
583
641
  if (!text) return;
584
642
  try {
585
643
  return JSON.parse(text);
@@ -591,4 +649,4 @@ async function guardedJsonApiRequest(params) {
591
649
  }
592
650
  }
593
651
  //#endregion
594
- export { verifyTwilioWebhook as a, verifyTelnyxWebhook as i, reconstructWebhookUrl as n, verifyPlivoWebhook as r, guardedJsonApiRequest as t };
652
+ export { reconstructWebhookUrl as a, verifyTwilioWebhook as c, readProviderJsonResponseText as i, cancelProviderResponseBody as n, verifyPlivoWebhook as o, readProviderErrorResponseSnippet as r, verifyTelnyxWebhook as s, guardedJsonApiRequest as t };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { definePluginEntry, sleep } from "./runtime-api.js";
2
2
  import "./api.js";
3
3
  import { i as resolveVoiceCallConfig, s as validateProviderConfig } from "./config-jaA6vOZ2.js";
4
- import { c as getTailscaleSelfInfo, l as setupTailscaleExposureRoute, o as resolveWebhookExposureStatus, p as resolveUserPath, s as cleanupTailscaleExposureRoute, t as createVoiceCallRuntime } from "./runtime-entry-BJNPmzDP.js";
4
+ import { c as getTailscaleSelfInfo, l as setupTailscaleExposureRoute, o as resolveWebhookExposureStatus, p as resolveUserPath, s as cleanupTailscaleExposureRoute, t as createVoiceCallRuntime } from "./runtime-entry-B8fUMehO.js";
5
5
  import { c as getCallHistoryFromStore, m as setVoiceCallStateRuntime } from "./store-8M2m4Isq.js";
6
6
  import { i as parseVoiceCallPluginConfig, r as normalizeVoiceCallLegacyConfigInput, t as formatVoiceCallLegacyConfigWarnings } from "./config-compat-BPPFhsJ7.js";
7
7
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -1,5 +1,5 @@
1
- import { a as getHeader, m as escapeXml } from "./runtime-entry-BJNPmzDP.js";
2
- import { n as reconstructWebhookUrl, r as verifyPlivoWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-CwIsZeyV.js";
1
+ import { a as getHeader, m as escapeXml } from "./runtime-entry-B8fUMehO.js";
2
+ import { a as reconstructWebhookUrl, o as verifyPlivoWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-DHj6sSuY.js";
3
3
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import crypto from "node:crypto";
5
5
  //#region extensions/voice-call/src/providers/plivo.ts
@@ -1,5 +1,5 @@
1
1
  import { o as resolveVoiceCallSessionKey } from "./config-jaA6vOZ2.js";
2
- import { f as resolveVoiceResponseModel } from "./runtime-entry-BJNPmzDP.js";
2
+ import { f as resolveVoiceResponseModel } from "./runtime-entry-B8fUMehO.js";
3
3
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import crypto from "node:crypto";
5
5
  import { applyModelOverrideToSessionEntry } from "openclaw/plugin-sdk/model-session-runtime";
@@ -2334,23 +2334,6 @@ Content-Length: ${Buffer.byteLength(body)}\r\n\r
2334
2334
  }
2335
2335
  this.clearAudio(streamSid);
2336
2336
  }
2337
- /**
2338
- * Get active session by call ID.
2339
- */
2340
- getSessionByCallId(callId) {
2341
- return [...this.sessions.values()].find((session) => session.callId === callId);
2342
- }
2343
- /**
2344
- * Close all sessions.
2345
- */
2346
- closeAll() {
2347
- for (const session of this.sessions.values()) {
2348
- this.clearTtsState(session.streamSid);
2349
- session.sttSession.close();
2350
- session.ws.close();
2351
- }
2352
- this.sessions.clear();
2353
- }
2354
2337
  getTtsQueue(streamSid) {
2355
2338
  const existing = this.ttsQueues.get(streamSid);
2356
2339
  if (existing) return existing;
@@ -2527,7 +2510,7 @@ function loadRealtimeTranscriptionRuntime() {
2527
2510
  return realtimeTranscriptionRuntimePromise;
2528
2511
  }
2529
2512
  function loadResponseGeneratorModule() {
2530
- responseGeneratorModulePromise ??= import("./response-generator-DRjFfMHx.js");
2513
+ responseGeneratorModulePromise ??= import("./response-generator-D5yL0gt3.js");
2531
2514
  return responseGeneratorModulePromise;
2532
2515
  }
2533
2516
  function sanitizeTranscriptForLog(value) {
@@ -3215,15 +3198,15 @@ let mockProviderPromise;
3215
3198
  let realtimeVoiceRuntimePromise;
3216
3199
  let realtimeHandlerPromise;
3217
3200
  function loadTelnyxProvider() {
3218
- telnyxProviderPromise ??= import("./telnyx-Bkl9KKSK.js");
3201
+ telnyxProviderPromise ??= import("./telnyx-COPVE0cj.js");
3219
3202
  return telnyxProviderPromise;
3220
3203
  }
3221
3204
  function loadTwilioProvider() {
3222
- twilioProviderPromise ??= import("./twilio-CDM_5OfE.js");
3205
+ twilioProviderPromise ??= import("./twilio-BD7lW2wp.js");
3223
3206
  return twilioProviderPromise;
3224
3207
  }
3225
3208
  function loadPlivoProvider() {
3226
- plivoProviderPromise ??= import("./plivo-BK14Vyzi.js");
3209
+ plivoProviderPromise ??= import("./plivo-14MWaE98.js");
3227
3210
  return plivoProviderPromise;
3228
3211
  }
3229
3212
  function loadMockProvider() {
@@ -1,2 +1,2 @@
1
- import { t as createVoiceCallRuntime } from "./runtime-entry-BJNPmzDP.js";
1
+ import { t as createVoiceCallRuntime } from "./runtime-entry-B8fUMehO.js";
2
2
  export { createVoiceCallRuntime };
@@ -1,4 +1,4 @@
1
- import { i as verifyTelnyxWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-CwIsZeyV.js";
1
+ import { s as verifyTelnyxWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-DHj6sSuY.js";
2
2
  import crypto from "node:crypto";
3
3
  //#region extensions/voice-call/src/providers/telnyx.ts
4
4
  function normalizeTelnyxDirection(direction) {
@@ -1,7 +1,7 @@
1
1
  import { fetchWithSsrFGuard } from "./runtime-api.js";
2
2
  import "./api.js";
3
- import { a as getHeader, d as chunkAudio, h as mapVoiceToPolly, i as normalizeProviderStatus, m as escapeXml, n as isProviderStatusTerminal, r as mapProviderStatusToEndReason } from "./runtime-entry-BJNPmzDP.js";
4
- import { a as verifyTwilioWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-CwIsZeyV.js";
3
+ import { a as getHeader, d as chunkAudio, h as mapVoiceToPolly, i as normalizeProviderStatus, m as escapeXml, n as isProviderStatusTerminal, r as mapProviderStatusToEndReason } from "./runtime-entry-B8fUMehO.js";
4
+ import { c as verifyTwilioWebhook, i as readProviderJsonResponseText, n as cancelProviderResponseBody, r as readProviderErrorResponseSnippet, t as guardedJsonApiRequest } from "./guarded-json-api-DHj6sSuY.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import crypto from "node:crypto";
7
7
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
@@ -57,11 +57,14 @@ async function twilioApiRequest(params) {
57
57
  });
58
58
  try {
59
59
  if (!response.ok) {
60
- if (params.allowNotFound && response.status === 404) return;
61
- const errorText = await response.text();
60
+ if (params.allowNotFound && response.status === 404) {
61
+ await cancelProviderResponseBody(response);
62
+ return;
63
+ }
64
+ const errorText = await readProviderErrorResponseSnippet(response);
62
65
  throw new TwilioApiError(response.status, errorText);
63
66
  }
64
- const text = await response.text();
67
+ const text = await readProviderJsonResponseText(response);
65
68
  if (!text) return;
66
69
  try {
67
70
  return JSON.parse(text);
@@ -202,9 +205,6 @@ var TwilioProvider = class TwilioProvider {
202
205
  setPublicUrl(url) {
203
206
  this.currentPublicUrl = url;
204
207
  }
205
- getPublicUrl() {
206
- return this.currentPublicUrl;
207
- }
208
208
  setTTSProvider(provider) {
209
209
  this.ttsProvider = provider;
210
210
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/voice-call",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.10-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/voice-call",
9
- "version": "2026.6.9-beta.1",
9
+ "version": "2026.6.10-beta.1",
10
10
  "dependencies": {
11
11
  "commander": "14.0.3",
12
12
  "typebox": "1.1.39",
@@ -14,7 +14,7 @@
14
14
  "zod": "4.4.3"
15
15
  },
16
16
  "peerDependencies": {
17
- "openclaw": ">=2026.6.9-beta.1"
17
+ "openclaw": ">=2026.6.10-beta.1"
18
18
  },
19
19
  "peerDependenciesMeta": {
20
20
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/voice-call",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.10-beta.1",
4
4
  "description": "OpenClaw voice-call plugin for Twilio, Telnyx, and Plivo phone calls.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "zod": "4.4.3"
15
15
  },
16
16
  "peerDependencies": {
17
- "openclaw": ">=2026.6.9-beta.1"
17
+ "openclaw": ">=2026.6.10-beta.1"
18
18
  },
19
19
  "peerDependenciesMeta": {
20
20
  "openclaw": {
@@ -31,10 +31,10 @@
31
31
  "minHostVersion": ">=2026.4.10"
32
32
  },
33
33
  "compat": {
34
- "pluginApi": ">=2026.6.9-beta.1"
34
+ "pluginApi": ">=2026.6.10-beta.1"
35
35
  },
36
36
  "build": {
37
- "openclawVersion": "2026.6.9-beta.1"
37
+ "openclawVersion": "2026.6.10-beta.1"
38
38
  },
39
39
  "release": {
40
40
  "publishToClawHub": true,