@openclaw/voice-call 2026.7.2-beta.7 → 2026.8.1-beta.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/doctor-contract-api.js +10 -8
- package/dist/{guarded-json-api-DS9sZa3C.js → guarded-json-api-DEDwgf4J.js} +24 -46
- package/dist/index.js +308 -629
- package/dist/{mock-YsvBTX-7.js → mock-BCq0q36l.js} +2 -3
- package/dist/{plivo-vZ--Wqxv.js → plivo-DbI17uAc.js} +45 -8
- package/dist/{realtime-handler--i_OERv6.js → realtime-handler-uXR0QgVa.js} +364 -108
- package/dist/{response-generator-D-7ApVfT.js → response-generator-D-hkzo5Y.js} +13 -5
- package/dist/{runtime-entry-D0UJiLfi.js → runtime-entry-F13eJ4pp.js} +279 -172
- package/dist/runtime-entry.js +1 -1
- package/dist/setup-api.js +17 -24
- package/dist/{store-path-nYL-yM0S.js → store-path-51_oC_xn.js} +70 -13
- package/dist/{telnyx-Dx6cfLvV.js → telnyx-sIS_WgnY.js} +3 -2
- package/dist/{twilio-D_D8KysU.js → twilio-CbeVrVAl.js} +20 -26
- package/dist/{webhook-replay-aaP79dI8.js → webhook-replay-FQrEGVSM.js} +20 -6
- package/openclaw.plugin.json +49 -4
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as reserveWebhookReplay, t as createWebhookReplayCache } from "./webhook-replay-FQrEGVSM.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
//#region extensions/voice-call/src/providers/mock.ts
|
|
@@ -19,8 +19,7 @@ var MockProvider = class {
|
|
|
19
19
|
const key = `mock:${crypto.createHash("sha256").update(requestMaterial).digest("hex")}`;
|
|
20
20
|
return {
|
|
21
21
|
ok: true,
|
|
22
|
-
|
|
23
|
-
isReplay: markWebhookReplay(this.replayCache, key)
|
|
22
|
+
...reserveWebhookReplay(this.replayCache, key)
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
parseWebhookEvent(ctx, _options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as escapeXml, s as getHeader } from "./runtime-entry-
|
|
2
|
-
import { a as reconstructWebhookUrl, o as verifyPlivoWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-
|
|
1
|
+
import { _ as escapeXml, s as getHeader } from "./runtime-entry-F13eJ4pp.js";
|
|
2
|
+
import { a as reconstructWebhookUrl, o as verifyPlivoWebhook, t as guardedJsonApiRequest } from "./guarded-json-api-DEDwgf4J.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
|
|
@@ -11,6 +11,25 @@ function createPlivoRequestDedupeKey(ctx) {
|
|
|
11
11
|
return `plivo:fallback:${crypto.createHash("sha256").update(ctx.rawBody).digest("hex")}`;
|
|
12
12
|
}
|
|
13
13
|
var PlivoProvider = class PlivoProvider {
|
|
14
|
+
/**
|
|
15
|
+
* Release all process-local metadata owned by one Plivo call.
|
|
16
|
+
* Terminal webhooks can be replayed, so this must stay idempotent.
|
|
17
|
+
*/
|
|
18
|
+
releaseCallState(params) {
|
|
19
|
+
if (params.callId) {
|
|
20
|
+
this.callIdToWebhookUrl.delete(params.callId);
|
|
21
|
+
this.pendingSpeakByCallId.delete(params.callId);
|
|
22
|
+
this.pendingListenByCallId.delete(params.callId);
|
|
23
|
+
}
|
|
24
|
+
const callUuid = params.callUuid || (params.providerCallId ? this.requestUuidToCallUuid.get(params.providerCallId) ?? params.providerCallId : void 0);
|
|
25
|
+
if (params.providerCallId) {
|
|
26
|
+
this.requestUuidToCallUuid.delete(params.providerCallId);
|
|
27
|
+
this.callUuidToWebhookUrl.delete(params.providerCallId);
|
|
28
|
+
}
|
|
29
|
+
if (!callUuid) return;
|
|
30
|
+
this.callUuidToWebhookUrl.delete(callUuid);
|
|
31
|
+
for (const [requestUuid, mappedCallUuid] of this.requestUuidToCallUuid) if (mappedCallUuid === callUuid) this.requestUuidToCallUuid.delete(requestUuid);
|
|
32
|
+
}
|
|
14
33
|
constructor(config, options = {}) {
|
|
15
34
|
this.name = "plivo";
|
|
16
35
|
this.requestUuidToCallUuid = /* @__PURE__ */ new Map();
|
|
@@ -56,7 +75,8 @@ var PlivoProvider = class PlivoProvider {
|
|
|
56
75
|
ok: result.ok,
|
|
57
76
|
reason: result.reason,
|
|
58
77
|
isReplay: result.isReplay,
|
|
59
|
-
verifiedRequestKey: result.verifiedRequestKey
|
|
78
|
+
verifiedRequestKey: result.verifiedRequestKey,
|
|
79
|
+
releaseReplay: result.releaseReplay
|
|
60
80
|
};
|
|
61
81
|
}
|
|
62
82
|
parseWebhookEvent(ctx, options) {
|
|
@@ -157,11 +177,19 @@ var PlivoProvider = class PlivoProvider {
|
|
|
157
177
|
...baseEvent,
|
|
158
178
|
type: "call.answered"
|
|
159
179
|
};
|
|
160
|
-
if (callStatus === "completed" || callStatus === "busy" || callStatus === "no-answer" || callStatus === "failed")
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
180
|
+
if (callStatus === "completed" || callStatus === "busy" || callStatus === "no-answer" || callStatus === "failed") {
|
|
181
|
+
const event = {
|
|
182
|
+
...baseEvent,
|
|
183
|
+
type: "call.ended",
|
|
184
|
+
reason: callStatus === "completed" ? "completed" : callStatus === "busy" ? "busy" : callStatus === "no-answer" ? "no-answer" : "failed"
|
|
185
|
+
};
|
|
186
|
+
this.releaseCallState({
|
|
187
|
+
callId: baseEvent.callId || void 0,
|
|
188
|
+
providerCallId: callUuid || requestUuid || void 0,
|
|
189
|
+
callUuid: callUuid || void 0
|
|
190
|
+
});
|
|
191
|
+
return event;
|
|
192
|
+
}
|
|
165
193
|
if (params.get("Event") === "StartApp" && callUuid) return {
|
|
166
194
|
...baseEvent,
|
|
167
195
|
type: "call.answered"
|
|
@@ -206,6 +234,11 @@ var PlivoProvider = class PlivoProvider {
|
|
|
206
234
|
endpoint: `/Call/${callUuid}/`,
|
|
207
235
|
allowNotFound: true
|
|
208
236
|
});
|
|
237
|
+
this.releaseCallState({
|
|
238
|
+
callId: input.callId,
|
|
239
|
+
providerCallId: input.providerCallId,
|
|
240
|
+
callUuid
|
|
241
|
+
});
|
|
209
242
|
return;
|
|
210
243
|
}
|
|
211
244
|
await this.apiRequest({
|
|
@@ -218,6 +251,10 @@ var PlivoProvider = class PlivoProvider {
|
|
|
218
251
|
endpoint: `/Request/${input.providerCallId}/`,
|
|
219
252
|
allowNotFound: true
|
|
220
253
|
});
|
|
254
|
+
this.releaseCallState({
|
|
255
|
+
callId: input.callId,
|
|
256
|
+
providerCallId: input.providerCallId
|
|
257
|
+
});
|
|
221
258
|
}
|
|
222
259
|
resolveCallContext(params) {
|
|
223
260
|
const callUuid = this.requestUuidToCallUuid.get(params.providerCallId) ?? params.providerCallId;
|