@openclaw/sms 2026.7.2-beta.2 → 2026.7.2-beta.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/api.js +1 -7
- package/dist/channel-plugin-api.js +136 -102
- package/dist/runtime-BBlPgBIF.js +8 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region extensions/sms/src/runtime.ts
|
|
3
|
-
const { setRuntime: setSmsRuntime, getRuntime: getSmsRuntime } = createPluginRuntimeStore({
|
|
4
|
-
pluginId: "sms",
|
|
5
|
-
errorMessage: "SMS runtime not initialized - plugin not registered"
|
|
6
|
-
});
|
|
7
|
-
//#endregion
|
|
1
|
+
import { n as setSmsRuntime, t as getSmsRuntime } from "./runtime-BBlPgBIF.js";
|
|
8
2
|
export { getSmsRuntime, setSmsRuntime };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { t as getSmsRuntime } from "./runtime-BBlPgBIF.js";
|
|
1
2
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Cp0f-YPc.js";
|
|
2
3
|
import { DEFAULT_ACCOUNT_ID, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
4
|
import { createHybridChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
4
5
|
import { buildChannelOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
5
|
-
import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
|
+
import { bindIngressLifecycleToReplyOptions, createChannelIngressDrain, createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
7
|
import { createConditionalWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
7
8
|
import { createEmptyChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
8
9
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
10
|
import { chunkTextForOutbound, renderMarkdownIRChunksWithinLimit, sanitizeAssistantVisibleText, stripMarkdown } from "openclaw/plugin-sdk/text-chunking";
|
|
10
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, listCombinedAccountIds, resolveAccountEntry, resolveListedDefaultAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
11
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, hasConfiguredAccountValue, listCombinedAccountIds, resolveAccountEntry, resolveListedDefaultAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
11
12
|
import { parseStrictInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
12
13
|
import { buildSecretInputSchema, hasConfiguredSecretInput, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
13
14
|
import { AllowFromListSchema, DmPolicySchema, buildChannelConfigSchema, buildMultiAccountChannelSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
14
15
|
import { requireChannelOpenAllowFrom } from "openclaw/plugin-sdk/extension-shared";
|
|
15
16
|
import { z } from "zod";
|
|
16
17
|
import { createFixedWindowRateLimiter, readRequestBodyWithLimit, registerPluginHttpRoute, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
17
|
-
import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
18
18
|
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
19
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
20
20
|
import { createHmac } from "node:crypto";
|
|
@@ -22,7 +22,7 @@ import * as querystring from "node:querystring";
|
|
|
22
22
|
import { readResponseTextPrefix, readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
23
23
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
24
24
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
25
|
-
import {
|
|
25
|
+
import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
26
26
|
//#region extensions/sms/src/phone.ts
|
|
27
27
|
function normalizeSmsPhoneNumber(raw) {
|
|
28
28
|
const trimmed = raw.trim().replace(/^(?:sms|twilio-sms):/i, "");
|
|
@@ -58,7 +58,16 @@ function firstNonBlankEnv(...values) {
|
|
|
58
58
|
return values.find((value) => value?.trim());
|
|
59
59
|
}
|
|
60
60
|
function hasBaseAccount(channelCfg) {
|
|
61
|
-
return
|
|
61
|
+
return [
|
|
62
|
+
channelCfg?.accountSid,
|
|
63
|
+
channelCfg?.fromNumber,
|
|
64
|
+
channelCfg?.messagingServiceSid,
|
|
65
|
+
process.env.TWILIO_ACCOUNT_SID,
|
|
66
|
+
process.env.TWILIO_AUTH_TOKEN,
|
|
67
|
+
process.env.TWILIO_PHONE_NUMBER,
|
|
68
|
+
process.env.TWILIO_SMS_FROM,
|
|
69
|
+
process.env.TWILIO_MESSAGING_SERVICE_SID
|
|
70
|
+
].some((value) => hasConfiguredAccountValue(value)) || hasConfiguredSecretInput(channelCfg?.authToken);
|
|
62
71
|
}
|
|
63
72
|
function listSmsAccountIds(cfg) {
|
|
64
73
|
const channelCfg = getChannelConfig(cfg);
|
|
@@ -316,12 +325,15 @@ function parseTwilioInboundFrom(raw) {
|
|
|
316
325
|
if (!looksLikeSmsPhoneNumber(phoneNumber)) return null;
|
|
317
326
|
return phoneNumber;
|
|
318
327
|
}
|
|
328
|
+
function resolveTwilioInboundSender(form) {
|
|
329
|
+
return parseTwilioInboundFrom(firstTrimmedString(form.From)) ?? "";
|
|
330
|
+
}
|
|
319
331
|
function buildTwilioInboundMessage(form) {
|
|
320
|
-
const from =
|
|
332
|
+
const from = resolveTwilioInboundSender(form);
|
|
321
333
|
const to = firstTrimmedString(form.To);
|
|
322
334
|
const body = firstString(form.Body);
|
|
323
335
|
const accountSid = firstTrimmedString(form.AccountSid);
|
|
324
|
-
const messageSid =
|
|
336
|
+
const messageSid = resolveTwilioMessageSid(form);
|
|
325
337
|
if (!from || !to || !body || !messageSid) return null;
|
|
326
338
|
return {
|
|
327
339
|
accountSid,
|
|
@@ -331,6 +343,9 @@ function buildTwilioInboundMessage(form) {
|
|
|
331
343
|
messageSid
|
|
332
344
|
};
|
|
333
345
|
}
|
|
346
|
+
function resolveTwilioMessageSid(form) {
|
|
347
|
+
return firstTrimmedString(form.MessageSid) || firstTrimmedString(form.SmsSid) || firstTrimmedString(form.SmsMessageSid);
|
|
348
|
+
}
|
|
334
349
|
async function readTwilioWebhookForm(req) {
|
|
335
350
|
return parseTwilioFormBody(await readRequestBodyWithLimit(req, {
|
|
336
351
|
maxBytes: WEBHOOK_BODY_LIMIT_BYTES,
|
|
@@ -653,10 +668,11 @@ async function dispatchSmsInboundEvent(params) {
|
|
|
653
668
|
channel: CHANNEL_ID$2,
|
|
654
669
|
accountId: params.account.accountId,
|
|
655
670
|
raw: params.msg,
|
|
671
|
+
...params.turnAdoptionLifecycle ? { turnAdoptionLifecycle: params.turnAdoptionLifecycle } : {},
|
|
656
672
|
adapter: {
|
|
657
673
|
ingest: (msg) => ({
|
|
658
674
|
id: msg.messageSid,
|
|
659
|
-
timestamp:
|
|
675
|
+
timestamp: params.receivedAt,
|
|
660
676
|
rawText: msg.body,
|
|
661
677
|
textForAgent: msg.body,
|
|
662
678
|
textForCommands: msg.body,
|
|
@@ -694,17 +710,15 @@ async function dispatchSmsInboundEvent(params) {
|
|
|
694
710
|
To: params.msg.to
|
|
695
711
|
}
|
|
696
712
|
});
|
|
697
|
-
const storePath = params.channelRuntime.session.resolveStorePath(params.cfg.session?.store, { agentId: route.agentId });
|
|
698
713
|
return {
|
|
699
714
|
cfg: params.cfg,
|
|
700
715
|
channel: CHANNEL_ID$2,
|
|
701
716
|
accountId: params.account.accountId,
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
717
|
+
route: {
|
|
718
|
+
agentId: route.agentId,
|
|
719
|
+
sessionKey
|
|
720
|
+
},
|
|
705
721
|
ctxPayload,
|
|
706
|
-
recordInboundSession: params.channelRuntime.session.recordInboundSession,
|
|
707
|
-
dispatchReplyWithBufferedBlockDispatcher: params.channelRuntime.reply.dispatchReplyWithBufferedBlockDispatcher,
|
|
708
722
|
delivery: {
|
|
709
723
|
durable: () => ({ to: from }),
|
|
710
724
|
deliver: async (payload) => {
|
|
@@ -727,34 +741,75 @@ async function dispatchSmsInboundEvent(params) {
|
|
|
727
741
|
});
|
|
728
742
|
}
|
|
729
743
|
//#endregion
|
|
730
|
-
//#region extensions/sms/src/
|
|
731
|
-
const
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
744
|
+
//#region extensions/sms/src/ingress-spool.ts
|
|
745
|
+
const SMS_INGRESS_PAYLOAD_VERSION = 1;
|
|
746
|
+
const SMS_COMPLETED_TTL_MS = 1440 * 60 * 1e3;
|
|
747
|
+
const SMS_COMPLETED_MAX_ENTRIES = 2e4;
|
|
748
|
+
const SMS_FAILED_TTL_MS = 720 * 60 * 60 * 1e3;
|
|
749
|
+
const SMS_FAILED_MAX_ENTRIES = 1e3;
|
|
750
|
+
var SmsIngressPermanentError = class extends Error {};
|
|
751
|
+
function parseSmsIngressPayload(payload, account) {
|
|
752
|
+
if (payload.version !== SMS_INGRESS_PAYLOAD_VERSION) throw new SmsIngressPermanentError("SMS ingress payload version is invalid.");
|
|
753
|
+
const message = buildTwilioInboundMessage(payload.form);
|
|
754
|
+
if (!message) throw new SmsIngressPermanentError("SMS ingress payload is invalid.");
|
|
755
|
+
if (message.accountSid && message.accountSid !== account.accountSid) throw new SmsIngressPermanentError("SMS ingress payload has an invalid Twilio account.");
|
|
756
|
+
return message;
|
|
757
|
+
}
|
|
758
|
+
function createSmsIngressSpool(params) {
|
|
759
|
+
const queue = params.queue ?? getSmsRuntime().state.openChannelIngressQueue({ accountId: params.account.accountId });
|
|
760
|
+
const deliver = params.deliver ?? (async (message, lifecycle, receivedAt) => {
|
|
761
|
+
await dispatchSmsInboundEvent({
|
|
762
|
+
cfg: params.cfg,
|
|
763
|
+
account: params.account,
|
|
764
|
+
channelRuntime: params.channelRuntime,
|
|
765
|
+
msg: message,
|
|
766
|
+
receivedAt,
|
|
767
|
+
turnAdoptionLifecycle: lifecycle,
|
|
768
|
+
log: params.log
|
|
769
|
+
});
|
|
770
|
+
});
|
|
771
|
+
const drain = createChannelIngressDrain({
|
|
772
|
+
queue,
|
|
773
|
+
...params.abortSignal ? { abortSignal: params.abortSignal } : {},
|
|
774
|
+
...params.log?.warn ? { onLog: (message) => params.log?.warn?.(message) } : {},
|
|
775
|
+
resolveNonRetryableFailure: (error) => error instanceof SmsIngressPermanentError ? {
|
|
776
|
+
reason: "invalid-payload",
|
|
777
|
+
message: error.message
|
|
778
|
+
} : null,
|
|
779
|
+
dispatchClaimedEvent: async (event, lifecycle) => {
|
|
780
|
+
await deliver(parseSmsIngressPayload(event.payload, params.account), bindIngressLifecycleToReplyOptions(lifecycle).turnAdoptionLifecycle, event.receivedAt);
|
|
742
781
|
}
|
|
743
|
-
};
|
|
744
|
-
return {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
const
|
|
782
|
+
});
|
|
783
|
+
return {
|
|
784
|
+
enqueue: async (form) => {
|
|
785
|
+
const receivedAt = Date.now();
|
|
786
|
+
const eventId = resolveTwilioMessageSid(form);
|
|
787
|
+
if (!eventId) throw new Error("SMS webhook is missing MessageSid.");
|
|
788
|
+
const sender = resolveTwilioInboundSender(form);
|
|
789
|
+
await queue.prune({
|
|
790
|
+
completedTtlMs: SMS_COMPLETED_TTL_MS,
|
|
791
|
+
completedMaxEntries: SMS_COMPLETED_MAX_ENTRIES,
|
|
792
|
+
failedTtlMs: SMS_FAILED_TTL_MS,
|
|
793
|
+
failedMaxEntries: SMS_FAILED_MAX_ENTRIES
|
|
794
|
+
});
|
|
795
|
+
const result = await queue.enqueue(eventId, {
|
|
796
|
+
version: SMS_INGRESS_PAYLOAD_VERSION,
|
|
797
|
+
form
|
|
798
|
+
}, {
|
|
799
|
+
receivedAt,
|
|
800
|
+
laneKey: sender ? `sender:${sender}` : `event:${eventId}`
|
|
801
|
+
});
|
|
750
802
|
return {
|
|
751
|
-
kind:
|
|
752
|
-
|
|
803
|
+
kind: result.kind,
|
|
804
|
+
duplicate: result.duplicate
|
|
753
805
|
};
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
806
|
+
},
|
|
807
|
+
drainOnce: async () => {
|
|
808
|
+
await drain.drainOnce();
|
|
809
|
+
},
|
|
810
|
+
waitForIdle: drain.waitForIdle,
|
|
811
|
+
dispose: () => drain.dispose()
|
|
812
|
+
};
|
|
758
813
|
}
|
|
759
814
|
//#endregion
|
|
760
815
|
//#region extensions/sms/src/webhook.ts
|
|
@@ -770,15 +825,6 @@ const callbackDispatchRateLimiter = createFixedWindowRateLimiter({
|
|
|
770
825
|
windowMs: 6e4,
|
|
771
826
|
maxTrackedKeys: 5e3
|
|
772
827
|
});
|
|
773
|
-
const replayGuardsByAccount = /* @__PURE__ */ new Map();
|
|
774
|
-
function resolveSmsWebhookReplayGuard(account) {
|
|
775
|
-
const key = `${account.accountId}\0${account.accountSid}`;
|
|
776
|
-
const existing = replayGuardsByAccount.get(key);
|
|
777
|
-
if (existing) return existing;
|
|
778
|
-
const created = createSmsWebhookReplayGuard();
|
|
779
|
-
replayGuardsByAccount.set(key, created);
|
|
780
|
-
return created;
|
|
781
|
-
}
|
|
782
828
|
function headerValue(value) {
|
|
783
829
|
if (Array.isArray(value)) return value[0];
|
|
784
830
|
return value;
|
|
@@ -795,7 +841,6 @@ function rejectInvalidRequestRateLimit(params) {
|
|
|
795
841
|
return true;
|
|
796
842
|
}
|
|
797
843
|
function createSmsWebhookHandler(params) {
|
|
798
|
-
const webhookReplayGuard = resolveSmsWebhookReplayGuard(params.account);
|
|
799
844
|
return async (req, res) => {
|
|
800
845
|
if (req.method !== "POST") {
|
|
801
846
|
respondTwiml(res, 405, "Method not allowed");
|
|
@@ -842,26 +887,6 @@ function createSmsWebhookHandler(params) {
|
|
|
842
887
|
return true;
|
|
843
888
|
}
|
|
844
889
|
}
|
|
845
|
-
const msg = buildTwilioInboundMessage(form);
|
|
846
|
-
if (!msg) {
|
|
847
|
-
if (invalidRequestRateLimited) return rejectInvalidRequestRateLimit({
|
|
848
|
-
key,
|
|
849
|
-
log: params.log,
|
|
850
|
-
res
|
|
851
|
-
});
|
|
852
|
-
respondTwiml(res, 400, "Missing SMS payload");
|
|
853
|
-
return true;
|
|
854
|
-
}
|
|
855
|
-
if (msg.accountSid && msg.accountSid !== params.account.accountSid) {
|
|
856
|
-
if (invalidRequestRateLimited) return rejectInvalidRequestRateLimit({
|
|
857
|
-
key,
|
|
858
|
-
log: params.log,
|
|
859
|
-
res
|
|
860
|
-
});
|
|
861
|
-
params.log?.warn?.("SMS webhook rejected mismatched Twilio AccountSid");
|
|
862
|
-
respondTwiml(res, 403, "Invalid account");
|
|
863
|
-
return true;
|
|
864
|
-
}
|
|
865
890
|
if (invalidRequestRateLimited && params.account.dangerouslyDisableSignatureValidation) return rejectInvalidRequestRateLimit({
|
|
866
891
|
key,
|
|
867
892
|
log: params.log,
|
|
@@ -872,27 +897,14 @@ function createSmsWebhookHandler(params) {
|
|
|
872
897
|
respondTwiml(res, 429, "Rate limit exceeded");
|
|
873
898
|
return true;
|
|
874
899
|
}
|
|
875
|
-
const
|
|
876
|
-
if (
|
|
877
|
-
|
|
878
|
-
respondTwiml(res, 200);
|
|
879
|
-
return true;
|
|
880
|
-
}
|
|
881
|
-
if (replayDecision.kind === "saturated") {
|
|
882
|
-
const retryAfterSeconds = Math.max(1, Math.ceil(replayDecision.retryAfterMs / 1e3));
|
|
883
|
-
params.log?.warn?.("SMS webhook replay cache is full of unexpired message SIDs");
|
|
884
|
-
res.setHeader("Retry-After", String(retryAfterSeconds));
|
|
885
|
-
respondTwiml(res, 429, "Replay cache saturated");
|
|
900
|
+
const messageSid = resolveTwilioMessageSid(form);
|
|
901
|
+
if (!messageSid) {
|
|
902
|
+
respondTwiml(res, 400, "Missing MessageSid");
|
|
886
903
|
return true;
|
|
887
904
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
msg,
|
|
892
|
-
channelRuntime: params.channelRuntime,
|
|
893
|
-
log: params.log
|
|
894
|
-
})).catch((err) => {
|
|
895
|
-
params.log?.error?.(`SMS webhook dispatch failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
905
|
+
if ((await params.ingress.enqueue(form)).duplicate) params.log?.warn?.(`SMS webhook ignored replayed message ${messageSid}`);
|
|
906
|
+
runDetachedWebhookWork(() => params.ingress.drainOnce()).catch((err) => {
|
|
907
|
+
params.log?.error?.(`SMS ingress drain failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
896
908
|
});
|
|
897
909
|
respondTwiml(res, 200);
|
|
898
910
|
return true;
|
|
@@ -901,6 +913,7 @@ function createSmsWebhookHandler(params) {
|
|
|
901
913
|
//#endregion
|
|
902
914
|
//#region extensions/sms/src/gateway.ts
|
|
903
915
|
const CHANNEL_ID$1 = "sms";
|
|
916
|
+
const SMS_INGRESS_DRAIN_INTERVAL_MS = 500;
|
|
904
917
|
const activeRoutes = /* @__PURE__ */ new Map();
|
|
905
918
|
const activeRoutePaths = /* @__PURE__ */ new Map();
|
|
906
919
|
function routeKey(account) {
|
|
@@ -925,21 +938,42 @@ function registerSmsWebhookRoute(params) {
|
|
|
925
938
|
if (currentPathOwner && currentPathOwner !== params.account.accountId) throw new Error(`SMS webhook path ${webhookPath} is already registered by account ${currentPathOwner}; configure a distinct webhookPath for account ${params.account.accountId}.`);
|
|
926
939
|
activeRoutes.get(key)?.();
|
|
927
940
|
activeRoutePaths.delete(webhookPath);
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
log: (msg) => params.log?.info?.(msg),
|
|
934
|
-
handler: createSmsWebhookHandler(params)
|
|
935
|
-
});
|
|
936
|
-
activeRoutes.set(key, unregister);
|
|
937
|
-
activeRoutePaths.set(webhookPath, params.account.accountId);
|
|
938
|
-
return () => {
|
|
939
|
-
unregister();
|
|
940
|
-
activeRoutes.delete(key);
|
|
941
|
-
if (activeRoutePaths.get(webhookPath) === params.account.accountId) activeRoutePaths.delete(webhookPath);
|
|
941
|
+
const ingress = createSmsIngressSpool(params);
|
|
942
|
+
const requestDrain = () => {
|
|
943
|
+
ingress.drainOnce().catch((error) => {
|
|
944
|
+
params.log?.error?.(`SMS ingress drain failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
945
|
+
});
|
|
942
946
|
};
|
|
947
|
+
const drainTimer = setInterval(requestDrain, SMS_INGRESS_DRAIN_INTERVAL_MS);
|
|
948
|
+
drainTimer.unref?.();
|
|
949
|
+
try {
|
|
950
|
+
const unregisterRoute = registerPluginHttpRoute({
|
|
951
|
+
path: webhookPath,
|
|
952
|
+
auth: "plugin",
|
|
953
|
+
pluginId: CHANNEL_ID$1,
|
|
954
|
+
accountId: params.account.accountId,
|
|
955
|
+
log: (msg) => params.log?.info?.(msg),
|
|
956
|
+
handler: createSmsWebhookHandler({
|
|
957
|
+
...params,
|
|
958
|
+
ingress
|
|
959
|
+
})
|
|
960
|
+
});
|
|
961
|
+
const unregister = () => {
|
|
962
|
+
clearInterval(drainTimer);
|
|
963
|
+
ingress.dispose();
|
|
964
|
+
unregisterRoute();
|
|
965
|
+
activeRoutes.delete(key);
|
|
966
|
+
if (activeRoutePaths.get(webhookPath) === params.account.accountId) activeRoutePaths.delete(webhookPath);
|
|
967
|
+
};
|
|
968
|
+
activeRoutes.set(key, unregister);
|
|
969
|
+
activeRoutePaths.set(webhookPath, params.account.accountId);
|
|
970
|
+
requestDrain();
|
|
971
|
+
return unregister;
|
|
972
|
+
} catch (error) {
|
|
973
|
+
clearInterval(drainTimer);
|
|
974
|
+
ingress.dispose();
|
|
975
|
+
throw error;
|
|
976
|
+
}
|
|
943
977
|
}
|
|
944
978
|
async function startSmsGatewayAccount(params) {
|
|
945
979
|
if (!params.account.enabled) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
+
//#region extensions/sms/src/runtime.ts
|
|
3
|
+
const { setRuntime: setSmsRuntime, getRuntime: getSmsRuntime } = createPluginRuntimeStore({
|
|
4
|
+
pluginId: "sms",
|
|
5
|
+
errorMessage: "SMS runtime not initialized - plugin not registered"
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { setSmsRuntime as n, getSmsRuntime as t };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/sms",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/sms",
|
|
9
|
-
"version": "2026.7.2-beta.
|
|
9
|
+
"version": "2026.7.2-beta.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "4.4.3"
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/sms",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"description": "OpenClaw SMS channel plugin for Twilio text messages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"quickstartAllowFrom": true
|
|
27
27
|
},
|
|
28
28
|
"compat": {
|
|
29
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
29
|
+
"pluginApi": ">=2026.7.2-beta.3"
|
|
30
30
|
},
|
|
31
31
|
"build": {
|
|
32
|
-
"openclawVersion": "2026.7.2-beta.
|
|
32
|
+
"openclawVersion": "2026.7.2-beta.3",
|
|
33
33
|
"bundledDist": false
|
|
34
34
|
},
|
|
35
35
|
"install": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"README.md"
|
|
55
55
|
],
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"openclaw": ">=2026.7.2-beta.
|
|
57
|
+
"openclaw": ">=2026.7.2-beta.3"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"openclaw": {
|