@openclaw/signal 2026.9.1-beta.1 → 2026.9.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.
- package/dist/api.js +7 -7
- package/dist/{approval-auth-BsYHLTHK.js → approval-auth-CkljhI65.js} +2 -1
- package/dist/{approval-handler.runtime-COrjDqm1.js → approval-handler.runtime-DvZd_IWj.js} +8 -4
- package/dist/{approval-reactions-D8x4WFYZ.js → approval-reactions-Cno-4mmH.js} +6 -5
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-DBwSJm7U.js → channel-sL5Cf1nT.js} +31 -29
- package/dist/{channel.runtime-DvhLiRgJ.js → channel.runtime-D2a4nSLo.js} +4 -3
- package/dist/{client-CvnR8_XA.js → client-BmpTN7R3.js} +21 -14
- package/dist/{client-adapter-D9SNPaNx.js → client-adapter-CDyW9LrQ.js} +1 -1
- package/dist/{config-schema-CkMIK7zp.js → config-schema-CHihQTOp.js} +10 -8
- package/dist/contract-api.js +1 -1
- package/dist/{doctor-contract-api-Dnp5eQQJ.js → doctor-contract-api-C18u1hW0.js} +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{install-signal-cli-Cpiyk0k1.js → install-signal-cli-7tEL37_j.js} +11 -7
- package/dist/{monitor-BIMAiZNm.js → monitor-BPOcRufA.js} +31 -15
- package/dist/{probe-C2Z15YNS.js → probe-Bjs1Yd79.js} +2 -2
- package/dist/{question-reactions-CkO8Q5i2.js → question-reactions-DJfSmeYo.js} +2 -2
- package/dist/{reaction-runtime-api-Ch0dk2sh.js → reaction-runtime-api-7FQFT_qb.js} +3 -2
- package/dist/reaction-runtime-api.js +1 -1
- package/dist/runtime-api.js +8 -8
- package/dist/{send-u8wH_fQM.js → send-DF4T9tXZ.js} +20 -16
- package/dist/{send.runtime-DolSm_sS.js → send.runtime-DHPi6R_z.js} +1 -1
- package/dist/{transport-detection-B9TcrBCr.js → transport-detection-CbPFIo0i.js} +21 -14
- package/dist/{transport-detection.runtime-kDheC5_M.js → transport-detection.runtime-B81flHI8.js} +1 -1
- package/dist/transport-probes.runtime-B7kr_6Zu.js +2 -0
- package/openclaw.plugin.json +0 -6
- package/package.json +4 -4
- package/dist/transport-probes.runtime-BsJdp0oI.js +0 -2
package/dist/api.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DO4HMqaK.js";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.js";
|
|
3
3
|
import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-YXPmgFMu.js";
|
|
4
|
-
import { c as resolveSignalReactionLevel, d as markdownToSignalTextChunks, s as signalMessageActions, t as detectSignalTransport, u as markdownToSignalText } from "./transport-detection-
|
|
5
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
6
|
-
import { a as normalizeSignalAccountInput, d as probeSignalTransport, f as writeSignalAccountTransport, l as signalSetupContract, n as createSignalPluginBase, p as resolveSignalOutboundTarget, r as signalSetupWizard, t as signalPlugin, u as prepareSignalManagedNativeTransport } from "./channel-
|
|
7
|
-
import { i as installSignalCli } from "./install-signal-cli-
|
|
8
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
9
|
-
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
10
|
-
import { t as probeSignal } from "./probe-
|
|
4
|
+
import { c as resolveSignalReactionLevel, d as markdownToSignalTextChunks, s as signalMessageActions, t as detectSignalTransport, u as markdownToSignalText } from "./transport-detection-CbPFIo0i.js";
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-7FQFT_qb.js";
|
|
6
|
+
import { a as normalizeSignalAccountInput, d as probeSignalTransport, f as writeSignalAccountTransport, l as signalSetupContract, n as createSignalPluginBase, p as resolveSignalOutboundTarget, r as signalSetupWizard, t as signalPlugin, u as prepareSignalManagedNativeTransport } from "./channel-sL5Cf1nT.js";
|
|
7
|
+
import { i as installSignalCli } from "./install-signal-cli-7tEL37_j.js";
|
|
8
|
+
import { t as monitorSignalProvider } from "./monitor-BPOcRufA.js";
|
|
9
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-DF4T9tXZ.js";
|
|
10
|
+
import { t as probeSignal } from "./probe-Bjs1Yd79.js";
|
|
11
11
|
//#region extensions/signal/src/channel.setup.ts
|
|
12
12
|
const signalSetupPlugin = { ...createSignalPluginBase({
|
|
13
13
|
setupWizard: signalSetupWizard,
|
|
@@ -8,7 +8,8 @@ import { normalizeE164 } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
8
8
|
function normalizeAliasKey(raw) {
|
|
9
9
|
const trimmed = raw.trim();
|
|
10
10
|
if (!trimmed) return;
|
|
11
|
-
|
|
11
|
+
const withoutSignal = /^signal:/i.test(trimmed) ? trimmed.slice(7).trim() : trimmed;
|
|
12
|
+
return normalizeLowercaseStringOrEmpty(withoutSignal) || void 0;
|
|
12
13
|
}
|
|
13
14
|
function resolveAliasMap(params) {
|
|
14
15
|
const account = resolveSignalAccount({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as resolveDefaultSignalAccountId } from "./accounts-DO4HMqaK.js";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget } from "./normalize-l_b99hap.js";
|
|
3
|
-
import { i as resolveSignalTarget } from "./approval-auth-
|
|
4
|
-
import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-
|
|
5
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
3
|
+
import { i as resolveSignalTarget } from "./approval-auth-CkljhI65.js";
|
|
4
|
+
import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-Cno-4mmH.js";
|
|
5
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-DF4T9tXZ.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -23,7 +23,11 @@ function buildPendingPayload(params) {
|
|
|
23
23
|
return buildApprovalReactionPendingContent(params);
|
|
24
24
|
}
|
|
25
25
|
const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
26
|
-
eventKinds: [
|
|
26
|
+
eventKinds: [
|
|
27
|
+
"exec",
|
|
28
|
+
"plugin",
|
|
29
|
+
"system-agent"
|
|
30
|
+
],
|
|
27
31
|
availability: {
|
|
28
32
|
isConfigured: ({ context }) => Boolean(context),
|
|
29
33
|
shouldHandle: ({ context }) => Boolean(context)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget } from "./normalize-l_b99hap.js";
|
|
3
|
-
import { i as resolveSignalTarget, n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-
|
|
3
|
+
import { i as resolveSignalTarget, n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-CkljhI65.js";
|
|
4
4
|
import { l as looksLikeUuid } from "./identity-YXPmgFMu.js";
|
|
5
|
-
import { i as getOptionalSignalRuntime } from "./transport-detection-
|
|
5
|
+
import { i as getOptionalSignalRuntime } from "./transport-detection-CbPFIo0i.js";
|
|
6
6
|
import { createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -127,14 +127,15 @@ var approval_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
|
127
127
|
});
|
|
128
128
|
const PERSISTENT_NAMESPACE = "signal.approval-reactions.v2";
|
|
129
129
|
const PERSISTENT_MAX_ENTRIES = 1e3;
|
|
130
|
-
const DEFAULT_REACTION_TARGET_TTL_MS =
|
|
130
|
+
const DEFAULT_REACTION_TARGET_TTL_MS = 864e5;
|
|
131
131
|
const loadResolveApprovalOverGateway = createLazyRuntimeSurface(() => import("openclaw/plugin-sdk/approval-gateway-runtime"), (runtime) => runtime.resolveApprovalOverGateway);
|
|
132
|
+
const reportPersistentApprovalReactionError = createPluginStateErrorReporter(getOptionalSignalRuntime, "signal", "approval-reaction-state", "Signal persistent approval reaction state failed");
|
|
132
133
|
const signalApprovalReactionTargets = createApprovalReactionTargetStore({
|
|
133
134
|
namespace: PERSISTENT_NAMESPACE,
|
|
134
135
|
maxEntries: PERSISTENT_MAX_ENTRIES,
|
|
135
136
|
defaultTtlMs: DEFAULT_REACTION_TARGET_TTL_MS,
|
|
136
137
|
openStore: (storeParams) => getOptionalSignalRuntime()?.state.openKeyedStore(storeParams),
|
|
137
|
-
logPersistentError:
|
|
138
|
+
logPersistentError: reportPersistentApprovalReactionError,
|
|
138
139
|
readPersistedTarget
|
|
139
140
|
});
|
|
140
141
|
function resolveSignalApprovalConversationKey(to) {
|
|
@@ -421,7 +422,7 @@ async function maybeResolveSignalApprovalReaction(params) {
|
|
|
421
422
|
return true;
|
|
422
423
|
}
|
|
423
424
|
params.logVerboseMessage?.(`signal: approval reaction failed id=${target.approvalId} sender=${actorId}: ${String(error)}`);
|
|
424
|
-
|
|
425
|
+
throw error;
|
|
425
426
|
}
|
|
426
427
|
}
|
|
427
428
|
function clearSignalApprovalReactionTargetsForTest() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SignalChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as SignalChannelConfigSchema } from "./config-schema-CHihQTOp.js";
|
|
2
2
|
export { SignalChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as signalPlugin } from "./channel-
|
|
1
|
+
import { t as signalPlugin } from "./channel-sL5Cf1nT.js";
|
|
2
2
|
export { signalPlugin };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { a as isSignalManagedNativeConnectionUrlForBind, i as assignSignalManagedNativePort, l as normalizeSignalTransportHost, o as isValidSignalManagedNativePort, r as allocateSignalManagedNativePort, s as resolveLocalSignalTransportPort, u as normalizeSignalTransportUrl } from "./transport-policy-DxvSMHp9.js";
|
|
2
2
|
import { a as resolveSignalAccountConfig, i as resolveSignalAccount, n as listSignalAccountIds, o as resolveSignalReplyToMode, r as resolveDefaultSignalAccountId, s as resolveSignalTransport } from "./accounts-DO4HMqaK.js";
|
|
3
3
|
import { n as normalizeSignalMessagingTarget, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.js";
|
|
4
|
-
import { i as resolveSignalTarget, r as listSignalAliasDirectoryEntries } from "./approval-auth-
|
|
4
|
+
import { i as resolveSignalTarget, r as listSignalAliasDirectoryEntries } from "./approval-auth-CkljhI65.js";
|
|
5
5
|
import { c as resolveSignalSender, l as looksLikeUuid, o as resolveSignalPeerId, s as resolveSignalRecipient } from "./identity-YXPmgFMu.js";
|
|
6
|
-
import { c as resolveSignalReactionLevel, d as markdownToSignalTextChunks, l as formatSignalMediaText, m as signalApprovalCapability, o as materializeSignalPresentationFallback, p as shouldSuppressLocalSignalExecApprovalPrompt, r as resolveSignalReplyContextWithPersistence, s as signalMessageActions, t as detectSignalTransport } from "./transport-detection-
|
|
7
|
-
import { i as migrateLegacySignalTransportConfig, n as normalizeCompatibilityConfig, r as clearLegacySignalTransportFieldsForAccount } from "./doctor-contract-api-
|
|
8
|
-
import { t as SignalChannelConfigSchema } from "./config-schema-
|
|
6
|
+
import { c as resolveSignalReactionLevel, d as markdownToSignalTextChunks, l as formatSignalMediaText, m as signalApprovalCapability, o as materializeSignalPresentationFallback, p as shouldSuppressLocalSignalExecApprovalPrompt, r as resolveSignalReplyContextWithPersistence, s as signalMessageActions, t as detectSignalTransport } from "./transport-detection-CbPFIo0i.js";
|
|
7
|
+
import { i as migrateLegacySignalTransportConfig, n as normalizeCompatibilityConfig, r as clearLegacySignalTransportFieldsForAccount } from "./doctor-contract-api-C18u1hW0.js";
|
|
8
|
+
import { t as SignalChannelConfigSchema } from "./config-schema-CHihQTOp.js";
|
|
9
|
+
import { describeAccountSnapshot, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
9
10
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
10
11
|
import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
11
12
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -15,7 +16,6 @@ import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
|
15
16
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
16
17
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
17
18
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
18
|
-
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
19
19
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
20
20
|
import { chunkText, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
21
21
|
import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -30,7 +30,6 @@ import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
|
30
30
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
31
31
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, createCliPathTextInput, createDelegatedSetupWizardProxy, createDelegatedTextInputShouldPrompt, createPatchedAccountSetupAdapter, createSetupInputPresenceValidator, createSetupTranslator, patchChannelConfigForAccount, promptParsedAllowFromForAccount, setAccountAllowFromForChannel, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
32
32
|
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
33
|
-
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
34
33
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
35
34
|
import { createRestrictSendersChannelSecurity } from "openclaw/plugin-sdk/channel-policy";
|
|
36
35
|
//#region extensions/signal/src/outbound-session.ts
|
|
@@ -209,13 +208,14 @@ function prepareSignalManagedNativeTransport(params) {
|
|
|
209
208
|
}
|
|
210
209
|
async function probeSignalTransport(params) {
|
|
211
210
|
const timeoutMs = params.timeoutMs ?? 1e4;
|
|
212
|
-
const
|
|
211
|
+
const transport = params.transport.kind === "managed-native" ? prepareSignalManagedNativeTransport({
|
|
213
212
|
cfg: params.cfg,
|
|
214
213
|
accountId: params.accountId,
|
|
215
214
|
overrides: managedTransportOptions(params.transport)
|
|
216
|
-
}) : params.transport
|
|
217
|
-
|
|
218
|
-
return (params.
|
|
215
|
+
}) : params.transport;
|
|
216
|
+
const resolved = resolveSignalTransport(transport);
|
|
217
|
+
if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-B7kr_6Zu.js")).containerCheck)(resolved.baseUrl, timeoutMs, params.account);
|
|
218
|
+
return (params.probeNative ?? (await import("./transport-probes.runtime-B7kr_6Zu.js")).nativeCheck)(resolved.baseUrl, timeoutMs);
|
|
219
219
|
}
|
|
220
220
|
function writeSignalAccountTransport(params) {
|
|
221
221
|
const transport = normalizeTransport(params.transport);
|
|
@@ -229,13 +229,14 @@ function writeSignalAccountTransport(params) {
|
|
|
229
229
|
accountId: params.accountId,
|
|
230
230
|
transport
|
|
231
231
|
});
|
|
232
|
+
const next = patchChannelConfigForAccount({
|
|
233
|
+
cfg: params.cfg,
|
|
234
|
+
channel: "signal",
|
|
235
|
+
accountId: params.accountId,
|
|
236
|
+
patch: { transport }
|
|
237
|
+
});
|
|
232
238
|
const canonical = clearLegacySignalTransportFieldsForAccount({
|
|
233
|
-
cfg:
|
|
234
|
-
cfg: params.cfg,
|
|
235
|
-
channel: "signal",
|
|
236
|
-
accountId: params.accountId,
|
|
237
|
-
patch: { transport }
|
|
238
|
-
}),
|
|
239
|
+
cfg: next,
|
|
239
240
|
accountId: params.accountId
|
|
240
241
|
});
|
|
241
242
|
if (transport.kind === "managed-native") resolveSignalAccount({
|
|
@@ -571,7 +572,7 @@ function createSignalSetupWizardProxy(loadWizard) {
|
|
|
571
572
|
const signalDoctor = {
|
|
572
573
|
normalizeCompatibilityConfig,
|
|
573
574
|
cleanStaleConfig: async ({ cfg }) => {
|
|
574
|
-
const { detectSignalTransport } = await import("./transport-detection.runtime-
|
|
575
|
+
const { detectSignalTransport } = await import("./transport-detection.runtime-B81flHI8.js");
|
|
575
576
|
return await migrateLegacySignalTransportConfig({
|
|
576
577
|
cfg,
|
|
577
578
|
detect: detectSignalTransport
|
|
@@ -582,7 +583,7 @@ const signalDoctor = {
|
|
|
582
583
|
//#region extensions/signal/src/shared.ts
|
|
583
584
|
const SIGNAL_CHANNEL = "signal";
|
|
584
585
|
async function loadSignalChannelRuntime() {
|
|
585
|
-
return await import("./channel.runtime-
|
|
586
|
+
return await import("./channel.runtime-D2a4nSLo.js");
|
|
586
587
|
}
|
|
587
588
|
const signalSetupWizard = createSignalSetupWizardProxy(async () => (await loadSignalChannelRuntime()).signalSetupWizard);
|
|
588
589
|
const signalConfigAdapter = {
|
|
@@ -667,17 +668,16 @@ function createSignalPluginBase(params) {
|
|
|
667
668
|
}
|
|
668
669
|
//#endregion
|
|
669
670
|
//#region extensions/signal/src/channel.ts
|
|
670
|
-
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
671
|
-
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
672
|
-
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
673
|
-
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
671
|
+
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-BPOcRufA.js").then((n) => n.n));
|
|
672
|
+
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-Bjs1Yd79.js").then((n) => n.n));
|
|
673
|
+
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-DHPi6R_z.js"));
|
|
674
|
+
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-Cno-4mmH.js").then((n) => n.n));
|
|
674
675
|
async function resolveSignalSendContext(params) {
|
|
675
676
|
return {
|
|
676
677
|
send: resolveOutboundSendDep(params.deps, "signal") ?? (await loadSignalSendRuntime()).sendMessageSignal,
|
|
677
678
|
maxBytes: resolveChannelMediaMaxBytes({
|
|
678
679
|
cfg: params.cfg,
|
|
679
|
-
resolveChannelLimitMb: (
|
|
680
|
-
accountId: params.accountId
|
|
680
|
+
resolveChannelLimitMb: () => resolveSignalAccount(params).config.mediaMaxMb
|
|
681
681
|
})
|
|
682
682
|
};
|
|
683
683
|
}
|
|
@@ -836,14 +836,15 @@ async function sendFormattedSignalText(ctx) {
|
|
|
836
836
|
accountId: ctx.accountId,
|
|
837
837
|
replyToId
|
|
838
838
|
});
|
|
839
|
-
const
|
|
839
|
+
const result = await send(to, chunk.text, {
|
|
840
840
|
cfg: ctx.cfg,
|
|
841
841
|
maxBytes,
|
|
842
842
|
accountId: ctx.accountId ?? void 0,
|
|
843
843
|
textMode: "plain",
|
|
844
844
|
textStyles: chunk.styles,
|
|
845
845
|
...replyOptions
|
|
846
|
-
})
|
|
846
|
+
});
|
|
847
|
+
const deliveryResult = attachChannelToResult("signal", attachSignalVisibleText(result, chunk.text));
|
|
847
848
|
results.push(deliveryResult);
|
|
848
849
|
await ctx.onDeliveryResult?.(deliveryResult);
|
|
849
850
|
}
|
|
@@ -876,7 +877,7 @@ async function sendFormattedSignalMedia(ctx) {
|
|
|
876
877
|
accountId: ctx.accountId,
|
|
877
878
|
replyToId: ctx.replyToId
|
|
878
879
|
});
|
|
879
|
-
|
|
880
|
+
const result = await send(to, formatted.text, {
|
|
880
881
|
cfg: ctx.cfg,
|
|
881
882
|
mediaUrl: ctx.mediaUrl,
|
|
882
883
|
...ctx.mediaAccess ? { mediaAccess: ctx.mediaAccess } : {},
|
|
@@ -887,7 +888,8 @@ async function sendFormattedSignalMedia(ctx) {
|
|
|
887
888
|
textMode: "plain",
|
|
888
889
|
textStyles: formatted.styles,
|
|
889
890
|
...replyOptions
|
|
890
|
-
})
|
|
891
|
+
});
|
|
892
|
+
return attachChannelToResult("signal", attachSignalVisibleText(result, formatted.text));
|
|
891
893
|
}
|
|
892
894
|
async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
893
895
|
const account = resolveSignalAccount({
|
|
@@ -897,7 +899,7 @@ async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
|
897
899
|
const targetAuthor = normalizeOptionalString(account.config.account);
|
|
898
900
|
const targetAuthorUuid = normalizeOptionalString(account.config.accountUuid);
|
|
899
901
|
if (!targetAuthor && !targetAuthorUuid) return;
|
|
900
|
-
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-
|
|
902
|
+
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-DJfSmeYo.js").then((n) => n.n);
|
|
901
903
|
registerSignalQuestionReactionTargetForDeliveredPayload({
|
|
902
904
|
cfg: params.cfg,
|
|
903
905
|
target: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds } from "./accounts-DO4HMqaK.js";
|
|
2
|
-
import { c as signalNumberTextInput, i as createSignalCliPathTextInput, o as signalCompletionNote, s as signalDmPolicy } from "./channel-
|
|
3
|
-
import { i as installSignalCli } from "./install-signal-cli-
|
|
2
|
+
import { c as signalNumberTextInput, i as createSignalCliPathTextInput, o as signalCompletionNote, s as signalDmPolicy } from "./channel-sL5Cf1nT.js";
|
|
3
|
+
import { i as installSignalCli } from "./install-signal-cli-7tEL37_j.js";
|
|
4
4
|
import { detectBinary } from "openclaw/plugin-sdk/setup-tools";
|
|
5
5
|
import { createDetectedBinaryStatus, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
6
6
|
//#region extensions/signal/src/setup-surface.ts
|
|
@@ -59,7 +59,8 @@ const signalSetupWizard = {
|
|
|
59
59
|
accountId
|
|
60
60
|
}).transport;
|
|
61
61
|
if (transport.kind !== "managed-native") return;
|
|
62
|
-
const
|
|
62
|
+
const currentCliPath = (typeof credentialValues.cliPath === "string" ? credentialValues.cliPath : void 0) ?? (transport.kind === "managed-native" ? transport.cliPath : void 0) ?? "signal-cli";
|
|
63
|
+
const cliDetected = await detectBinary(currentCliPath);
|
|
63
64
|
if (!await prompter.confirm({
|
|
64
65
|
message: cliDetected ? t("wizard.signal.reinstallPrompt") : t("wizard.signal.installPrompt"),
|
|
65
66
|
initialValue: !cliDetected
|
|
@@ -19,12 +19,12 @@ import { generateSecureUuid } from "openclaw/plugin-sdk/core";
|
|
|
19
19
|
*/
|
|
20
20
|
const DEFAULT_TIMEOUT_MS$1 = 1e4;
|
|
21
21
|
const DEFAULT_ATTACHMENT_RESPONSE_MAX_BYTES = 1048576;
|
|
22
|
-
const SIGNAL_REST_ERROR_RESPONSE_MAX_BYTES =
|
|
23
|
-
const SIGNAL_REST_SUCCESS_RESPONSE_MAX_BYTES =
|
|
24
|
-
const WS_MAX_PAYLOAD =
|
|
22
|
+
const SIGNAL_REST_ERROR_RESPONSE_MAX_BYTES = 16384;
|
|
23
|
+
const SIGNAL_REST_SUCCESS_RESPONSE_MAX_BYTES = 16777216;
|
|
24
|
+
const WS_MAX_PAYLOAD = 1048576;
|
|
25
25
|
const WS_HANDSHAKE_MS = 3e4;
|
|
26
26
|
const WS_SHUTDOWN_DRAIN_TIMEOUT_MS = 1500;
|
|
27
|
-
const DEFAULT_SIGNAL_CONTAINER_MAX_ATTACHMENT_BYTES =
|
|
27
|
+
const DEFAULT_SIGNAL_CONTAINER_MAX_ATTACHMENT_BYTES = 8388608;
|
|
28
28
|
const CONTAINER_TEXT_STYLE_MARKERS = {
|
|
29
29
|
BOLD: "**",
|
|
30
30
|
ITALIC: "*",
|
|
@@ -100,7 +100,7 @@ async function readSignalRestText(res, bodyIdleTimeoutMs, bodyTimeoutMs) {
|
|
|
100
100
|
onTimeout: signalRestRequestTimeoutError,
|
|
101
101
|
onOverflow: ({ maxBytes }) => /* @__PURE__ */ new Error(`Signal REST: text response exceeds ${maxBytes} bytes`)
|
|
102
102
|
});
|
|
103
|
-
return new TextDecoder().decode(bytes);
|
|
103
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
104
104
|
}
|
|
105
105
|
async function readSignalRestErrorText(res, bodyIdleTimeoutMs, bodyTimeoutMs) {
|
|
106
106
|
return (await readResponseTextPrefix(res, SIGNAL_REST_ERROR_RESPONSE_MAX_BYTES, {
|
|
@@ -632,6 +632,13 @@ async function containerRpcRequest(method, params, opts) {
|
|
|
632
632
|
}
|
|
633
633
|
//#endregion
|
|
634
634
|
//#region extensions/signal/src/client.ts
|
|
635
|
+
/** Thrown when the native SSE endpoint rejects the request with a non-2xx HTTP status. */
|
|
636
|
+
var SignalSseRejectionError = class extends Error {
|
|
637
|
+
constructor(status, statusText) {
|
|
638
|
+
super(`Signal SSE failed (${status} ${statusText})`);
|
|
639
|
+
this.status = status;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
635
642
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
636
643
|
const DEFAULT_SIGNAL_HTTP_RESPONSE_MAX_BYTES = 1048576;
|
|
637
644
|
const MAX_SIGNAL_SSE_BUFFER_BYTES = 1048576;
|
|
@@ -683,7 +690,7 @@ function normalizeSignalSseTimeoutMs(timeoutMs) {
|
|
|
683
690
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) return null;
|
|
684
691
|
return resolveTimerTimeoutMs(timeoutMs, DEFAULT_TIMEOUT_MS);
|
|
685
692
|
}
|
|
686
|
-
function
|
|
693
|
+
function requestSignalHttp(url, options) {
|
|
687
694
|
assertSignalHttpProtocol(url, "HTTP");
|
|
688
695
|
const timeoutMs = resolveTimerTimeoutMs(options.timeoutMs, DEFAULT_TIMEOUT_MS);
|
|
689
696
|
const client = url.protocol === "https:" ? https : http;
|
|
@@ -732,8 +739,7 @@ function requestSignalHttpText(url, options) {
|
|
|
732
739
|
res.on("end", () => {
|
|
733
740
|
resolveOnce({
|
|
734
741
|
status: res.statusCode ?? 0,
|
|
735
|
-
|
|
736
|
-
text: Buffer$1.concat(chunks).toString("utf8")
|
|
742
|
+
body: Buffer$1.concat(chunks)
|
|
737
743
|
});
|
|
738
744
|
});
|
|
739
745
|
});
|
|
@@ -753,7 +759,7 @@ async function signalRpcRequest(method, params, opts) {
|
|
|
753
759
|
params,
|
|
754
760
|
id
|
|
755
761
|
});
|
|
756
|
-
const res = await
|
|
762
|
+
const res = await requestSignalHttp(resolveSignalEndpointUrl(opts.baseUrl, "/api/v1/rpc"), {
|
|
757
763
|
method: "POST",
|
|
758
764
|
headers: {
|
|
759
765
|
"Content-Type": "application/json",
|
|
@@ -764,8 +770,9 @@ async function signalRpcRequest(method, params, opts) {
|
|
|
764
770
|
maxResponseBytes: opts.maxResponseBytes
|
|
765
771
|
});
|
|
766
772
|
if (res.status === 201) return;
|
|
767
|
-
|
|
768
|
-
|
|
773
|
+
const text = new TextDecoder("utf-8", { fatal: true }).decode(res.body);
|
|
774
|
+
if (!text) throw new Error(`Signal RPC empty response (status ${res.status})`);
|
|
775
|
+
const parsed = parseSignalRpcResponse(text, res.status);
|
|
769
776
|
if (parsed.error) {
|
|
770
777
|
const code = parsed.error.code ?? "unknown";
|
|
771
778
|
const msg = parsed.error.message ?? "Signal RPC error";
|
|
@@ -775,7 +782,7 @@ async function signalRpcRequest(method, params, opts) {
|
|
|
775
782
|
}
|
|
776
783
|
async function signalCheck(baseUrl, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
777
784
|
try {
|
|
778
|
-
const res = await
|
|
785
|
+
const res = await requestSignalHttp(resolveSignalEndpointUrl(baseUrl, "/api/v1/check"), {
|
|
779
786
|
method: "GET",
|
|
780
787
|
timeoutMs
|
|
781
788
|
});
|
|
@@ -830,7 +837,7 @@ function openSignalEventStream(url, abortSignal, timeoutMs = DEFAULT_TIMEOUT_MS)
|
|
|
830
837
|
const status = res.statusCode ?? 0;
|
|
831
838
|
if (status < 200 || status >= 300) {
|
|
832
839
|
res.resume();
|
|
833
|
-
rejectOnce(
|
|
840
|
+
rejectOnce(new SignalSseRejectionError(status, res.statusMessage || "error"));
|
|
834
841
|
return;
|
|
835
842
|
}
|
|
836
843
|
if (settled) {
|
|
@@ -927,4 +934,4 @@ async function streamSignalEvents(params) {
|
|
|
927
934
|
await flushEvent();
|
|
928
935
|
}
|
|
929
936
|
//#endregion
|
|
930
|
-
export {
|
|
937
|
+
export { containerCheck as a, streamSignalEvents as i, signalCheck as n, containerRpcRequest as o, signalRpcRequest as r, streamContainerEvents as s, SignalSseRejectionError as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as containerCheck, i as streamSignalEvents$1, n as signalCheck$1, o as containerRpcRequest, r as signalRpcRequest$1, s as streamContainerEvents } from "./client-BmpTN7R3.js";
|
|
2
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
//#region extensions/signal/src/client-adapter.ts
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
2
2
|
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, resolveAccountEntry } from "openclaw/plugin-sdk/account-resolution";
|
|
4
|
-
import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, ReplyToModeSchema, buildChannelConfigSchema, buildChannelReactionShape,
|
|
4
|
+
import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, ReplyToModeSchema, buildChannelAccountSchemaParts, buildChannelConfigSchema, buildChannelReactionShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region extensions/signal/src/config-ui-hints.ts
|
|
7
7
|
const signalChannelConfigUiHints = {
|
|
@@ -104,13 +104,13 @@ const SignalGroupEntrySchema = buildGroupEntrySchema({ ingest: z.boolean().optio
|
|
|
104
104
|
"systemPrompt"
|
|
105
105
|
] });
|
|
106
106
|
const SignalGroupsSchema = z.record(z.string(), SignalGroupEntrySchema.optional()).optional();
|
|
107
|
+
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
108
|
+
omit: ["mentionPatterns"],
|
|
109
|
+
streaming: ChannelDeliveryStreamingConfigSchema.optional(),
|
|
110
|
+
mediaMaxMb: z.number().int().positive().optional()
|
|
111
|
+
});
|
|
107
112
|
const SignalAccountSchemaBase = z.object({
|
|
108
|
-
...
|
|
109
|
-
useDefaults: true,
|
|
110
|
-
omit: ["mentionPatterns"],
|
|
111
|
-
streaming: ChannelDeliveryStreamingConfigSchema.optional(),
|
|
112
|
-
mediaMaxMb: z.number().int().positive().optional()
|
|
113
|
-
}),
|
|
113
|
+
...accountShape,
|
|
114
114
|
account: z.string().optional(),
|
|
115
115
|
accountUuid: z.string().optional(),
|
|
116
116
|
transport: SignalTransportSchema.optional(),
|
|
@@ -137,6 +137,7 @@ const SignalAccountSchemaBase = z.object({
|
|
|
137
137
|
actions: z.object({ reactions: z.boolean().optional() }).strict().optional()
|
|
138
138
|
}).strict();
|
|
139
139
|
const SignalConfigSchemaBase = SignalAccountSchemaBase.extend({
|
|
140
|
+
...rootPolicyShape,
|
|
140
141
|
accounts: z.record(z.string(), SignalAccountSchemaBase.optional()).optional(),
|
|
141
142
|
defaultAccount: z.string().optional()
|
|
142
143
|
});
|
|
@@ -197,7 +198,8 @@ function validateSignalContainerAccounts(value, ctx) {
|
|
|
197
198
|
if (!account || !channelEnabled || account.enabled === false) continue;
|
|
198
199
|
const isDefaultAccount = normalizeAccountId(accountId) === DEFAULT_ACCOUNT_ID;
|
|
199
200
|
if ((isDefaultAccount && value.transport ? value.transport : account.transport)?.kind !== "container" || isDefaultAccount && value.transport) continue;
|
|
200
|
-
|
|
201
|
+
const effectiveAccount = account.account === void 0 ? value.account : account.account;
|
|
202
|
+
if (!normalizeOptionalString(effectiveAccount)) ctx.addIssue({
|
|
201
203
|
code: z.ZodIssueCode.custom,
|
|
202
204
|
message: "channels.signal account container transport requires an account number on the account or channel",
|
|
203
205
|
path: [
|
package/dist/contract-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as normalizeSignalMessagingTarget, r as normalizeSignalReactionRecipient, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.js";
|
|
2
2
|
import { i as isSignalSenderAllowed } from "./identity-YXPmgFMu.js";
|
|
3
|
-
import { a as installSignalCliFromRelease, i as installSignalCli, n as downloadToFile, o as looksLikeArchive, r as extractSignalCliArchive, s as pickAsset, t as MAX_SIGNAL_CLI_EXTRACTED_BYTES } from "./install-signal-cli-
|
|
3
|
+
import { a as installSignalCliFromRelease, i as installSignalCli, n as downloadToFile, o as looksLikeArchive, r as extractSignalCliArchive, s as pickAsset, t as MAX_SIGNAL_CLI_EXTRACTED_BYTES } from "./install-signal-cli-7tEL37_j.js";
|
|
4
4
|
export { MAX_SIGNAL_CLI_EXTRACTED_BYTES, downloadToFile, extractSignalCliArchive, installSignalCli, installSignalCliFromRelease, isSignalSenderAllowed, looksLikeArchive, looksLikeSignalTargetId, normalizeSignalMessagingTarget, normalizeSignalReactionRecipient, pickAsset };
|
|
@@ -428,7 +428,7 @@ function migrateLegacySignalTransportConfigSync(cfg) {
|
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
430
|
//#endregion
|
|
431
|
-
//#region extensions/signal/doctor-
|
|
431
|
+
//#region extensions/signal/config-doctor-api.ts
|
|
432
432
|
const RETIRED_SIGNAL_ACCOUNT_TRANSPORT_FIELDS = [
|
|
433
433
|
"configPath",
|
|
434
434
|
"httpUrl",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-api-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-api-C18u1hW0.js";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
|
@@ -12,10 +12,10 @@ import { runPluginCommandWithTimeout } from "openclaw/plugin-sdk/run-command";
|
|
|
12
12
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
13
13
|
import { withTempDownloadPath } from "openclaw/plugin-sdk/temp-path";
|
|
14
14
|
//#region extensions/signal/src/install-signal-cli.ts
|
|
15
|
-
const MAX_SIGNAL_CLI_ARCHIVE_BYTES =
|
|
15
|
+
const MAX_SIGNAL_CLI_ARCHIVE_BYTES = 268435456;
|
|
16
16
|
/** @internal Exported for testing. */
|
|
17
|
-
const MAX_SIGNAL_CLI_EXTRACTED_BYTES =
|
|
18
|
-
const SIGNAL_CLI_DOWNLOAD_TIMEOUT_MS =
|
|
17
|
+
const MAX_SIGNAL_CLI_EXTRACTED_BYTES = 402653184;
|
|
18
|
+
const SIGNAL_CLI_DOWNLOAD_TIMEOUT_MS = 3e5;
|
|
19
19
|
const SIGNAL_CLI_RELEASE_INFO_TIMEOUT_MS = 3e4;
|
|
20
20
|
const CONTENT_LENGTH_RE = /^\d+$/;
|
|
21
21
|
/** @internal Exported for testing. */
|
|
@@ -57,7 +57,8 @@ function normalizeReleaseAsset(value) {
|
|
|
57
57
|
} : void 0;
|
|
58
58
|
}
|
|
59
59
|
function normalizeSignalCliRelease(value) {
|
|
60
|
-
const
|
|
60
|
+
const tagName = normalizeOptionalString(value.tag_name);
|
|
61
|
+
const version = normalizeOptionalString(tagName?.replace(/^v/, ""));
|
|
61
62
|
if (!version || !Array.isArray(value.assets)) return;
|
|
62
63
|
return {
|
|
63
64
|
version,
|
|
@@ -114,14 +115,17 @@ async function downloadToFile(url, dest, maxRedirects = 5, maxBytes = MAX_SIGNAL
|
|
|
114
115
|
}
|
|
115
116
|
let totalBytes = 0;
|
|
116
117
|
const body = response.body;
|
|
117
|
-
|
|
118
|
+
const readable = isNodeReadableStream(body) ? body : Readable.fromWeb(body);
|
|
119
|
+
const limiter = new Transform({ transform(chunk, _encoding, callback) {
|
|
118
120
|
totalBytes += chunkByteLength(chunk);
|
|
119
121
|
if (totalBytes > maxBytes) {
|
|
120
122
|
callback(/* @__PURE__ */ new Error(`signal-cli archive exceeded the ${maxBytes}-byte download cap.`));
|
|
121
123
|
return;
|
|
122
124
|
}
|
|
123
125
|
callback(null, chunk);
|
|
124
|
-
} })
|
|
126
|
+
} });
|
|
127
|
+
const out = createWriteStream(dest);
|
|
128
|
+
await pipeline(readable, limiter, out);
|
|
125
129
|
completed = true;
|
|
126
130
|
} finally {
|
|
127
131
|
await release();
|
|
@@ -178,7 +182,7 @@ async function installSignalCliViaBrew(runtime) {
|
|
|
178
182
|
"install",
|
|
179
183
|
"signal-cli"
|
|
180
184
|
],
|
|
181
|
-
timeoutMs:
|
|
185
|
+
timeoutMs: 9e5
|
|
182
186
|
});
|
|
183
187
|
if (result.code !== 0) return {
|
|
184
188
|
ok: false,
|
|
@@ -3,20 +3,21 @@ import { l as normalizeSignalTransportHost } from "./transport-policy-DxvSMHp9.j
|
|
|
3
3
|
import { i as resolveSignalAccount, o as resolveSignalReplyToMode } from "./accounts-DO4HMqaK.js";
|
|
4
4
|
import { n as normalizeSignalMessagingTarget } from "./normalize-l_b99hap.js";
|
|
5
5
|
import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-YXPmgFMu.js";
|
|
6
|
-
import { c as resolveSignalReactionLevel, f as isSignalNativeApprovalHandlerConfigured, i as getOptionalSignalRuntime, l as formatSignalMediaText, n as registerSignalReplyContext, o as materializeSignalPresentationFallback } from "./transport-detection-
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { c as resolveSignalReactionLevel, f as isSignalNativeApprovalHandlerConfigured, i as getOptionalSignalRuntime, l as formatSignalMediaText, n as registerSignalReplyContext, o as materializeSignalPresentationFallback } from "./transport-detection-CbPFIo0i.js";
|
|
7
|
+
import { t as SignalSseRejectionError } from "./client-BmpTN7R3.js";
|
|
8
|
+
import { n as signalRpcRequest, r as streamSignalEvents, t as signalCheck } from "./client-adapter-CDyW9LrQ.js";
|
|
9
|
+
import { n as sendReactionSignal } from "./reaction-runtime-api-7FQFT_qb.js";
|
|
10
|
+
import { i as maybeResolveSignalApprovalReaction, o as registerSignalApprovalReactionTargetForDeliveredPayload, s as resolveSignalApprovalConversationKey, t as addSignalApprovalReactionHintToStructuredPayload } from "./approval-reactions-Cno-4mmH.js";
|
|
11
|
+
import { r as registerSignalQuestionReactionTargetForDeliveredPayload, t as maybeResolveSignalQuestionReaction } from "./question-reactions-DJfSmeYo.js";
|
|
12
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-DF4T9tXZ.js";
|
|
12
13
|
import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
13
14
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
14
|
-
import { canonicalizeBase64, detectMime, estimateBase64DecodedBytes, kindFromMime, saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
|
|
15
15
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
16
16
|
import { asPositiveSafeInteger, isRecord, normalizeNullableString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
17
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
18
18
|
import { normalizeE164, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
19
19
|
import { buildChannelInboundEventContext, buildMentionRegexes, createChannelInboundDebouncer, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, hasVisibleInboundReplyDispatch, logInboundDrop, matchesMentionPatterns, readAgentRunTerminalOutcome, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent, shouldDebounceTextInbound, toHistoryMediaEntries, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
20
|
+
import { canonicalizeBase64, detectMime, estimateBase64DecodedBytes, kindFromMime, saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
|
|
20
21
|
import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
21
22
|
import { ensurePortAvailable, extractErrorCode, formatErrorMessage as formatErrorMessage$1, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
22
23
|
import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
@@ -45,7 +46,7 @@ import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-ru
|
|
|
45
46
|
import { listChatCommands, maybeResolveTextAlias, normalizeCommandBody } from "openclaw/plugin-sdk/command-auth-native";
|
|
46
47
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
47
48
|
import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
48
|
-
import { channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
49
|
+
import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
49
50
|
//#region extensions/signal/src/daemon.ts
|
|
50
51
|
const SIGNAL_DAEMON_STOP_KILL_TIMEOUT_MS = 1500;
|
|
51
52
|
function formatSignalDaemonExit(exit) {
|
|
@@ -1648,10 +1649,10 @@ async function startSignalIngressMonitor(params) {
|
|
|
1648
1649
|
createClaimError: (_kind, claim) => new SignalIngressPermanentError("unsupported-event", `Signal ingress row ${claim.id} has an invalid payload`)
|
|
1649
1650
|
},
|
|
1650
1651
|
deliver: ([event, parsedPayload], lifecycle) => parsedPayload ? params.dispatch(event, lifecycle, parsedPayload) : void 0,
|
|
1651
|
-
onDurableAdmission: async (_event, { facts }) => {
|
|
1652
|
+
onDurableAdmission: async (_event, { facts, isNew }) => {
|
|
1652
1653
|
const { numberAliasEventId } = facts;
|
|
1653
1654
|
if (!numberAliasEventId) return;
|
|
1654
|
-
if (!await ingressQueue.complete(numberAliasEventId)) await ingressQueue.complete(facts.eventId);
|
|
1655
|
+
if (!await ingressQueue.complete(numberAliasEventId) && isNew) await ingressQueue.complete(facts.eventId);
|
|
1655
1656
|
},
|
|
1656
1657
|
pollIntervalMs: SIGNAL_INGRESS_DRAIN_INTERVAL_MS,
|
|
1657
1658
|
retention: {
|
|
@@ -1684,6 +1685,14 @@ const DEFAULT_RECONNECT_POLICY = {
|
|
|
1684
1685
|
factor: 2,
|
|
1685
1686
|
jitter: .2
|
|
1686
1687
|
};
|
|
1688
|
+
function isPermanentSignalSseRejection(error) {
|
|
1689
|
+
if (!(error instanceof SignalSseRejectionError)) return false;
|
|
1690
|
+
return error.status >= 400 && error.status < 500 && ![
|
|
1691
|
+
408,
|
|
1692
|
+
425,
|
|
1693
|
+
429
|
|
1694
|
+
].includes(error.status);
|
|
1695
|
+
}
|
|
1687
1696
|
function publishSignalRecovering(statusSink, lastError) {
|
|
1688
1697
|
statusSink?.({
|
|
1689
1698
|
connected: false,
|
|
@@ -1731,6 +1740,12 @@ async function runSignalSseLoop({ baseUrl, account, abortSignal, runtime, onEven
|
|
|
1731
1740
|
} catch (err) {
|
|
1732
1741
|
if (abortSignal?.aborted) return;
|
|
1733
1742
|
runtime.error?.(`Signal stream error: ${String(err)}`);
|
|
1743
|
+
if (isPermanentSignalSseRejection(err)) {
|
|
1744
|
+
const lastError = `Signal daemon rejected the event stream: ${err.message}. Check the configured account and daemon URL, fix the daemon or proxy response, then restart the channel.`;
|
|
1745
|
+
runtime.log?.(`Signal reconnect stopped: ${lastError}`);
|
|
1746
|
+
statusSink?.(channelBlockedPatch(lastError, { connected: false }));
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1734
1749
|
publishSignalRecovering(statusSink, String(err));
|
|
1735
1750
|
reconnectAttempts += 1;
|
|
1736
1751
|
const delayMs = computeBackoff(reconnectPolicy, reconnectAttempts);
|
|
@@ -1816,7 +1831,7 @@ function buildSignalReactionSystemEventText(params) {
|
|
|
1816
1831
|
const withTarget = params.targetLabel ? `${base} from ${params.targetLabel}` : base;
|
|
1817
1832
|
return params.groupLabel ? `${withTarget} in ${params.groupLabel}` : withTarget;
|
|
1818
1833
|
}
|
|
1819
|
-
const SIGNAL_ATTACHMENT_RPC_RESPONSE_HEADROOM_BYTES =
|
|
1834
|
+
const SIGNAL_ATTACHMENT_RPC_RESPONSE_HEADROOM_BYTES = 65536;
|
|
1820
1835
|
const SIGNAL_BASE64_OVERHEAD_NUMERATOR = 4;
|
|
1821
1836
|
const SIGNAL_BASE64_OVERHEAD_DENOMINATOR = 3;
|
|
1822
1837
|
function deriveSignalAttachmentRpcMaxResponseBytes(maxBytes) {
|
|
@@ -1826,7 +1841,7 @@ function deriveSignalAttachmentRpcMaxResponseBytes(maxBytes) {
|
|
|
1826
1841
|
async function fetchAttachment(params) {
|
|
1827
1842
|
const { attachment } = params;
|
|
1828
1843
|
if (!attachment?.id) return null;
|
|
1829
|
-
if (typeof attachment.size === "number" && attachment.size > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes /
|
|
1844
|
+
if (typeof attachment.size === "number" && attachment.size > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / 1048576).toFixed(0)}MB limit`);
|
|
1830
1845
|
const rpcParams = { id: attachment.id };
|
|
1831
1846
|
if (params.account) rpcParams.account = params.account;
|
|
1832
1847
|
if (params.groupId) rpcParams.groupId = params.groupId;
|
|
@@ -1838,15 +1853,16 @@ async function fetchAttachment(params) {
|
|
|
1838
1853
|
transportKind: params.transportKind
|
|
1839
1854
|
});
|
|
1840
1855
|
if (!result?.data) return null;
|
|
1841
|
-
if (estimateBase64DecodedBytes(result.data) > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes /
|
|
1856
|
+
if (estimateBase64DecodedBytes(result.data) > params.maxBytes) throw new Error(`Signal attachment ${attachment.id} exceeds ${(params.maxBytes / 1048576).toFixed(0)}MB limit`);
|
|
1842
1857
|
const canonicalData = canonicalizeBase64(result.data);
|
|
1843
1858
|
if (!canonicalData) throw new Error(`Signal attachment ${attachment.id} returned malformed base64 data`);
|
|
1844
1859
|
const buffer = Buffer.from(canonicalData, "base64");
|
|
1845
1860
|
const originalFilename = normalizeOptionalString(attachment.filename ?? void 0);
|
|
1846
|
-
const
|
|
1861
|
+
const contentType = normalizeOptionalString(attachment.contentType ?? void 0) ?? await detectMime({
|
|
1847
1862
|
buffer,
|
|
1848
1863
|
filePath: originalFilename
|
|
1849
|
-
})
|
|
1864
|
+
});
|
|
1865
|
+
const saved = await saveMediaBuffer(buffer, contentType, "inbound", params.maxBytes, originalFilename);
|
|
1850
1866
|
return {
|
|
1851
1867
|
path: saved.path,
|
|
1852
1868
|
contentType: saved.contentType
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
3
|
-
import { n as signalRpcRequest, t as signalCheck } from "./client-adapter-
|
|
2
|
+
import { t as detectSignalTransport } from "./transport-detection-CbPFIo0i.js";
|
|
3
|
+
import { n as signalRpcRequest, t as signalCheck } from "./client-adapter-CDyW9LrQ.js";
|
|
4
4
|
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
//#region extensions/signal/src/probe.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { i as resolveSignalTarget } from "./approval-auth-
|
|
3
|
-
import { c as resolveSignalApprovalTargetAuthorKeys, s as resolveSignalApprovalConversationKey } from "./approval-reactions-
|
|
2
|
+
import { i as resolveSignalTarget } from "./approval-auth-CkljhI65.js";
|
|
3
|
+
import { c as resolveSignalApprovalTargetAuthorKeys, s as resolveSignalApprovalConversationKey } from "./approval-reactions-Cno-4mmH.js";
|
|
4
4
|
import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
//#region extensions/signal/src/question-reactions.ts
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { i as resolveSignalAccount } from "./accounts-DO4HMqaK.js";
|
|
2
2
|
import { r as normalizeSignalReactionRecipient } from "./normalize-l_b99hap.js";
|
|
3
|
-
import { n as signalRpcRequest } from "./client-adapter-
|
|
3
|
+
import { n as signalRpcRequest } from "./client-adapter-CDyW9LrQ.js";
|
|
4
4
|
import { t as resolveSignalRpcContext } from "./rpc-context-dXSy4NtF.js";
|
|
5
5
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
6
6
|
//#region extensions/signal/src/send-reactions.ts
|
|
7
7
|
async function sendReactionSignalCore(params) {
|
|
8
|
+
const cfg = requireRuntimeConfig(params.opts.cfg, "Signal reactions");
|
|
8
9
|
const accountInfo = resolveSignalAccount({
|
|
9
|
-
cfg
|
|
10
|
+
cfg,
|
|
10
11
|
accountId: params.opts.accountId
|
|
11
12
|
});
|
|
12
13
|
const { baseUrl, account } = resolveSignalRpcContext(params.opts, accountInfo);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
1
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-7FQFT_qb.js";
|
|
2
2
|
export { removeReactionSignal, sendReactionSignal };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DO4HMqaK.js";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget, t as looksLikeSignalTargetId } from "./normalize-l_b99hap.js";
|
|
3
|
-
import { a as setSignalRuntime, c as resolveSignalReactionLevel, s as signalMessageActions } from "./transport-detection-
|
|
4
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
5
|
-
import { n as SignalConfigSchema } from "./config-schema-
|
|
6
|
-
import { i as installSignalCli } from "./install-signal-cli-
|
|
7
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
8
|
-
import { t as sendMessageSignal } from "./send-
|
|
9
|
-
import { t as probeSignal } from "./probe-
|
|
3
|
+
import { a as setSignalRuntime, c as resolveSignalReactionLevel, s as signalMessageActions } from "./transport-detection-CbPFIo0i.js";
|
|
4
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-7FQFT_qb.js";
|
|
5
|
+
import { n as SignalConfigSchema } from "./config-schema-CHihQTOp.js";
|
|
6
|
+
import { i as installSignalCli } from "./install-signal-cli-7tEL37_j.js";
|
|
7
|
+
import { t as monitorSignalProvider } from "./monitor-BPOcRufA.js";
|
|
8
|
+
import { t as sendMessageSignal } from "./send-DF4T9tXZ.js";
|
|
9
|
+
import { t as probeSignal } from "./probe-Bjs1Yd79.js";
|
|
10
|
+
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
10
11
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
11
|
-
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
12
12
|
import { buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary, collectStatusIssuesFromLastError, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
13
13
|
import { normalizeE164 } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
14
14
|
import { DEFAULT_ACCOUNT_ID, applyAccountNameToChannelSection, deleteAccountFromConfigSection, emptyPluginConfigSchema, formatPairingApproveHint, getChatChannelMeta, migrateBaseNameToDefaultAccount, normalizeAccountId, setAccountEnabledInConfigSection } from "openclaw/plugin-sdk/core";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as resolveSignalAccount } from "./accounts-DO4HMqaK.js";
|
|
2
2
|
import { n as normalizeSignalMessagingTarget } from "./normalize-l_b99hap.js";
|
|
3
|
-
import { n as registerSignalReplyContext, u as markdownToSignalText } from "./transport-detection-
|
|
4
|
-
import { n as signalRpcRequest } from "./client-adapter-
|
|
3
|
+
import { n as registerSignalReplyContext, u as markdownToSignalText } from "./transport-detection-CbPFIo0i.js";
|
|
4
|
+
import { n as signalRpcRequest } from "./client-adapter-CDyW9LrQ.js";
|
|
5
5
|
import { t as resolveSignalRpcContext } from "./rpc-context-dXSy4NtF.js";
|
|
6
6
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
7
7
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
8
|
-
import { kindFromMime, resolveOutboundAttachmentFromUrl } from "openclaw/plugin-sdk/media-runtime";
|
|
9
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { kindFromMime, resolveOutboundAttachmentFromUrl } from "openclaw/plugin-sdk/media-runtime";
|
|
10
10
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
11
11
|
//#region extensions/signal/src/send.ts
|
|
12
12
|
function assertSignalRecipientDelivery(result, target) {
|
|
@@ -28,8 +28,9 @@ function assertSignalRecipientDelivery(result, target) {
|
|
|
28
28
|
}
|
|
29
29
|
async function resolveSignalRpcAccountInfo(opts) {
|
|
30
30
|
if (!opts.cfg) throw new Error("Signal RPC account resolution requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
31
|
+
const cfg = requireRuntimeConfig(opts.cfg, "Signal RPC account resolution");
|
|
31
32
|
return resolveSignalAccount({
|
|
32
|
-
cfg
|
|
33
|
+
cfg,
|
|
33
34
|
accountId: opts.accountId
|
|
34
35
|
});
|
|
35
36
|
}
|
|
@@ -111,7 +112,8 @@ function resolveSignalQuoteParams(opts) {
|
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
function isSignalQuoteMetadataRejection(error) {
|
|
114
|
-
const
|
|
115
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
116
|
+
const normalized = normalizeLowercaseStringOrEmpty(message);
|
|
115
117
|
const rpcCode = /^signal rpc (-?\d+):/u.exec(normalized)?.[1];
|
|
116
118
|
if (rpcCode !== void 0) {
|
|
117
119
|
if (rpcCode !== "-32602") return false;
|
|
@@ -142,7 +144,7 @@ async function sendMessageSignal(to, text, opts) {
|
|
|
142
144
|
if (typeof opts.maxBytes === "number") return opts.maxBytes;
|
|
143
145
|
if (typeof accountInfo.config.mediaMaxMb === "number") return accountInfo.config.mediaMaxMb * 1024 * 1024;
|
|
144
146
|
if (typeof cfg.agents?.defaults?.mediaMaxMb === "number") return cfg.agents.defaults.mediaMaxMb * 1024 * 1024;
|
|
145
|
-
return
|
|
147
|
+
return 8388608;
|
|
146
148
|
})();
|
|
147
149
|
let attachments;
|
|
148
150
|
if (opts.mediaUrl?.trim()) {
|
|
@@ -157,16 +159,18 @@ async function sendMessageSignal(to, text, opts) {
|
|
|
157
159
|
kind: kindFromMime(resolved.contentType ?? void 0) ?? "unknown"
|
|
158
160
|
};
|
|
159
161
|
}
|
|
160
|
-
if (message.trim())
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
if (message.trim()) {
|
|
163
|
+
if (textMode === "plain") textStyles = opts.textStyles ?? [];
|
|
164
|
+
else {
|
|
165
|
+
const tableMode = resolveMarkdownTableMode({
|
|
166
|
+
cfg,
|
|
167
|
+
channel: "signal",
|
|
168
|
+
accountId: accountInfo.accountId
|
|
169
|
+
});
|
|
170
|
+
const formatted = markdownToSignalText(message, { tableMode });
|
|
171
|
+
message = formatted.text;
|
|
172
|
+
textStyles = formatted.styles;
|
|
173
|
+
}
|
|
170
174
|
}
|
|
171
175
|
if (!message.trim() && (!attachments || attachments.length === 0)) throw new Error("Signal send requires text or media");
|
|
172
176
|
const params = { message };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
1
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-DF4T9tXZ.js";
|
|
2
2
|
export { sendMessageSignal, sendTypingSignal };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { u as normalizeSignalTransportUrl } from "./transport-policy-DxvSMHp9.js";
|
|
2
2
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DO4HMqaK.js";
|
|
3
3
|
import { n as normalizeSignalMessagingTarget, r as normalizeSignalReactionRecipient } from "./normalize-l_b99hap.js";
|
|
4
|
-
import { n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-
|
|
5
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
4
|
+
import { n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-CkljhI65.js";
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-7FQFT_qb.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
7
|
-
import { kindFromMime } from "openclaw/plugin-sdk/media-runtime";
|
|
8
7
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
9
8
|
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
10
9
|
import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
|
|
@@ -15,6 +14,7 @@ import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-s
|
|
|
15
14
|
import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
16
15
|
import { buildApprovalReactionPendingContentForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
17
16
|
import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
|
|
17
|
+
import { kindFromMime } from "openclaw/plugin-sdk/media-runtime";
|
|
18
18
|
import { createActionGate, jsonResult, readStringParam, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
19
19
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
20
20
|
import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
@@ -58,7 +58,11 @@ const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwa
|
|
|
58
58
|
}).manualFallbackPayload }
|
|
59
59
|
},
|
|
60
60
|
createNativeRuntime: (routing) => createLazyChannelApprovalNativeRuntimeAdapter({
|
|
61
|
-
eventKinds: [
|
|
61
|
+
eventKinds: [
|
|
62
|
+
"exec",
|
|
63
|
+
"plugin",
|
|
64
|
+
"system-agent"
|
|
65
|
+
],
|
|
62
66
|
isConfigured: ({ cfg, accountId, context }) => Boolean(context) && routing.isNativeApprovalHandlerConfigured({
|
|
63
67
|
cfg,
|
|
64
68
|
accountId
|
|
@@ -69,7 +73,7 @@ const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwa
|
|
|
69
73
|
approvalKind,
|
|
70
74
|
request
|
|
71
75
|
}),
|
|
72
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
76
|
+
load: async () => (await import("./approval-handler.runtime-DvZd_IWj.js")).signalApprovalNativeRuntime
|
|
73
77
|
})
|
|
74
78
|
});
|
|
75
79
|
const signalApprovalRouting = signalApproval.routing;
|
|
@@ -164,8 +168,9 @@ function markdownToSignalText(markdown, options = {}) {
|
|
|
164
168
|
return renderSignalText(markdownToSignalIR(markdown, options));
|
|
165
169
|
}
|
|
166
170
|
function markdownToSignalTextChunks(markdown, limit, options = {}) {
|
|
171
|
+
const ir = markdownToSignalIR(markdown, options);
|
|
167
172
|
return renderMarkdownIRChunksWithinLimit({
|
|
168
|
-
ir
|
|
173
|
+
ir,
|
|
169
174
|
limit,
|
|
170
175
|
assistantTranscriptRoleMessageBoundaries: true,
|
|
171
176
|
renderChunk: renderSignalText,
|
|
@@ -200,11 +205,12 @@ function formatSignalMediaText(media) {
|
|
|
200
205
|
* - "extensive": Agent can react liberally
|
|
201
206
|
*/
|
|
202
207
|
function resolveSignalReactionLevel(params) {
|
|
208
|
+
const account = resolveSignalAccount({
|
|
209
|
+
cfg: params.cfg,
|
|
210
|
+
accountId: params.accountId
|
|
211
|
+
});
|
|
203
212
|
return resolveReactionLevel({
|
|
204
|
-
value:
|
|
205
|
-
cfg: params.cfg,
|
|
206
|
-
accountId: params.accountId
|
|
207
|
-
}).config.reactionLevel,
|
|
213
|
+
value: account.config.reactionLevel,
|
|
208
214
|
defaultLevel: "minimal",
|
|
209
215
|
invalidFallback: "minimal"
|
|
210
216
|
});
|
|
@@ -317,10 +323,11 @@ function materializeSignalPresentationFallback(payload, presentationOverride) {
|
|
|
317
323
|
const presentation = presentationOverride ?? normalizeMessagePresentation(payload.presentation);
|
|
318
324
|
if (!presentation) return payload;
|
|
319
325
|
const currentText = payload.text?.trim() ?? "";
|
|
320
|
-
const
|
|
326
|
+
const fallbackPresentation = Boolean(getExecApprovalReplyMetadata(payload) && currentText) ? {
|
|
321
327
|
...presentation,
|
|
322
328
|
blocks: presentation.blocks.filter((block) => !isMessagePresentationInteractiveBlock(block))
|
|
323
|
-
} : presentation
|
|
329
|
+
} : presentation;
|
|
330
|
+
const presentationFallback = renderMessagePresentationFallbackText({ presentation: fallbackPresentation });
|
|
324
331
|
const text = currentText.includes(presentationFallback) ? currentText : [currentText, presentationFallback].filter(Boolean).join("\n\n");
|
|
325
332
|
const { presentation: _presentation, ...withoutPresentation } = payload;
|
|
326
333
|
return {
|
|
@@ -344,7 +351,7 @@ const { setRuntime: setSignalRuntime, tryGetRuntime: getOptionalSignalRuntime }
|
|
|
344
351
|
//#region extensions/signal/src/reply-authors.ts
|
|
345
352
|
const PERSISTENT_NAMESPACE = "signal.reply-authors.v1";
|
|
346
353
|
const PERSISTENT_MAX_ENTRIES = 5e3;
|
|
347
|
-
const DEFAULT_REPLY_AUTHOR_TTL_MS =
|
|
354
|
+
const DEFAULT_REPLY_AUTHOR_TTL_MS = 6048e5;
|
|
348
355
|
const { memoryReplyContexts } = signalReplyAuthorState;
|
|
349
356
|
function openSignalReplyAuthorStore() {
|
|
350
357
|
if (signalReplyAuthorState.persistentStoreDisabled) return;
|
|
@@ -515,7 +522,7 @@ const DEFAULT_PROBE_TIMEOUT_MS = 1e4;
|
|
|
515
522
|
async function detectSignalTransport(params) {
|
|
516
523
|
const url = normalizeSignalTransportUrl(params.url);
|
|
517
524
|
const timeoutMs = params.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
518
|
-
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-
|
|
525
|
+
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-B7kr_6Zu.js");
|
|
519
526
|
const probeNative = params.probeNative ?? probes?.nativeCheck;
|
|
520
527
|
const probeContainer = params.probeContainer ?? probes?.containerCheck;
|
|
521
528
|
if (!probeNative || !probeContainer) throw new Error("Signal transport probes are unavailable");
|
package/dist/{transport-detection.runtime-kDheC5_M.js → transport-detection.runtime-B81flHI8.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
1
|
+
import { t as detectSignalTransport } from "./transport-detection-CbPFIo0i.js";
|
|
2
2
|
export { detectSignalTransport };
|
package/openclaw.plugin.json
CHANGED
|
@@ -543,7 +543,6 @@
|
|
|
543
543
|
"type": "boolean"
|
|
544
544
|
},
|
|
545
545
|
"dmPolicy": {
|
|
546
|
-
"default": "pairing",
|
|
547
546
|
"type": "string",
|
|
548
547
|
"enum": [
|
|
549
548
|
"pairing",
|
|
@@ -582,7 +581,6 @@
|
|
|
582
581
|
}
|
|
583
582
|
},
|
|
584
583
|
"groupPolicy": {
|
|
585
|
-
"default": "allowlist",
|
|
586
584
|
"type": "string",
|
|
587
585
|
"enum": [
|
|
588
586
|
"open",
|
|
@@ -996,10 +994,6 @@
|
|
|
996
994
|
"additionalProperties": false
|
|
997
995
|
}
|
|
998
996
|
},
|
|
999
|
-
"required": [
|
|
1000
|
-
"dmPolicy",
|
|
1001
|
-
"groupPolicy"
|
|
1002
|
-
],
|
|
1003
997
|
"additionalProperties": false
|
|
1004
998
|
}
|
|
1005
999
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/signal",
|
|
3
|
-
"version": "2026.9.1
|
|
3
|
+
"version": "2026.9.1",
|
|
4
4
|
"description": "OpenClaw Signal channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"allowInvalidConfigRecovery": true
|
|
94
94
|
},
|
|
95
95
|
"compat": {
|
|
96
|
-
"pluginApi": ">=2026.9.1
|
|
96
|
+
"pluginApi": ">=2026.9.1"
|
|
97
97
|
},
|
|
98
98
|
"build": {
|
|
99
|
-
"openclawVersion": "2026.9.1
|
|
99
|
+
"openclawVersion": "2026.9.1",
|
|
100
100
|
"bundledDist": false
|
|
101
101
|
},
|
|
102
102
|
"release": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"README.md"
|
|
119
119
|
],
|
|
120
120
|
"peerDependencies": {
|
|
121
|
-
"openclaw": ">=2026.9.1
|
|
121
|
+
"openclaw": ">=2026.9.1"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"openclaw": {
|