@openclaw/signal 2026.7.2-beta.5 → 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/api.js +7 -7
- package/dist/{approval-handler.runtime-C-XYgcxE.js → approval-handler.runtime-Bi5yNhnj.js} +2 -2
- package/dist/{approval-reactions-DtL47gSK.js → approval-reactions-BulCzhdB.js} +15 -45
- package/dist/{channel-CBIljGCH.js → channel-CzDJMDtX.js} +50 -91
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-B8GXmuol.js → channel.runtime-D12iYzJB.js} +2 -2
- package/dist/{client-BazXTH7O.js → client-CvnR8_XA.js} +31 -34
- package/dist/{client-adapter-mXGeEHQJ.js → client-adapter-D9SNPaNx.js} +13 -6
- package/dist/{config-schema-DLvpQPN5.js → config-schema-CkMIK7zp.js} +4 -7
- package/dist/contract-api.js +1 -1
- package/dist/{doctor-contract-api-DbUCknbC.js → doctor-contract-api-Dnp5eQQJ.js} +46 -54
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{install-signal-cli-qJF7iC4h.js → install-signal-cli-Cpiyk0k1.js} +8 -5
- package/dist/{monitor-CHBkf7lk.js → monitor-DiN2hKnG.js} +177 -126
- package/dist/{probe-Br9abaGp.js → probe-C_THuQzn.js} +23 -7
- package/dist/question-reactions-ByjH5qST.js +80 -0
- package/dist/{reaction-runtime-api-BjeDyKcz.js → reaction-runtime-api-Cf6QHcE5.js} +8 -19
- package/dist/reaction-runtime-api.js +1 -1
- package/dist/runtime-api.js +7 -7
- package/dist/{send-B_Ks4MZr.js → send-BvGgByMd.js} +12 -3
- package/dist/{send.runtime-CbuXycZT.js → send.runtime-CtTBBrjL.js} +1 -1
- package/dist/{transport-detection-Da06-LOL.js → transport-detection-BItHawMq.js} +50 -145
- package/dist/{transport-detection.runtime-D_190UUL.js → transport-detection.runtime-DoiwPcrG.js} +1 -1
- package/dist/{transport-probes.runtime-CV6Qs0Og.js → transport-probes.runtime-BsJdp0oI.js} +1 -1
- package/openclaw.plugin.json +4 -1
- package/package.json +5 -5
- package/dist/approval-resolver-B3m0D2R0.js +0 -16
- package/dist/question-reactions-Ds48FtEu.js +0 -109
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { o as resolveSignalTarget } from "./runtime-JPrGlV7h.js";
|
|
3
|
+
import { l as resolveSignalApprovalConversationKey, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-BulCzhdB.js";
|
|
4
|
+
import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
5
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
|
+
//#region extensions/signal/src/question-reactions.ts
|
|
7
|
+
var question_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
maybeResolveSignalQuestionReaction: () => maybeResolveSignalQuestionReaction,
|
|
9
|
+
registerSignalQuestionReactionTargetForDeliveredPayload: () => registerSignalQuestionReactionTargetForDeliveredPayload
|
|
10
|
+
});
|
|
11
|
+
function buildKey(identity) {
|
|
12
|
+
const values = [
|
|
13
|
+
identity.accountId,
|
|
14
|
+
identity.conversationKey,
|
|
15
|
+
identity.messageId
|
|
16
|
+
].map((value) => value.trim());
|
|
17
|
+
return values.every(Boolean) ? values.join(":") : null;
|
|
18
|
+
}
|
|
19
|
+
const questionReactionTargets = createQuestionReactionTargetStore({
|
|
20
|
+
channel: "signal",
|
|
21
|
+
channelDisplayName: "Signal",
|
|
22
|
+
buildKey,
|
|
23
|
+
identityMatches: (stored, incoming) => Boolean(stored && incoming?.some((authorKey) => stored.includes(authorKey))),
|
|
24
|
+
registerChannelDelivery: questionGatewayRuntime.registerChannelDelivery,
|
|
25
|
+
resolveReaction: questionGatewayRuntime.resolveReaction
|
|
26
|
+
});
|
|
27
|
+
function resolveConversationKey(params) {
|
|
28
|
+
try {
|
|
29
|
+
return resolveSignalTarget({
|
|
30
|
+
cfg: params.cfg,
|
|
31
|
+
accountId: params.accountId,
|
|
32
|
+
input: params.to
|
|
33
|
+
})?.to ?? resolveSignalApprovalConversationKey(params.to);
|
|
34
|
+
} catch {
|
|
35
|
+
return resolveSignalApprovalConversationKey(params.to);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function registerSignalQuestionReactionTargetForDeliveredPayload(params) {
|
|
39
|
+
const binding = questionGatewayRuntime.readReactionBinding(params.payload);
|
|
40
|
+
if (params.target.channel !== "signal" || !binding) return false;
|
|
41
|
+
const conversationKey = resolveConversationKey({
|
|
42
|
+
cfg: params.cfg,
|
|
43
|
+
...params.target
|
|
44
|
+
});
|
|
45
|
+
const targetAuthorKeys = resolveSignalApprovalTargetAuthorKeys(params);
|
|
46
|
+
if (!conversationKey || targetAuthorKeys.length === 0) return false;
|
|
47
|
+
const accountId = normalizeAccountId(params.target.accountId ?? void 0);
|
|
48
|
+
let registered = false;
|
|
49
|
+
for (const result of params.results) {
|
|
50
|
+
const messageId = result.channel === "signal" ? result.messageId.trim() : "";
|
|
51
|
+
if (!messageId || messageId === "unknown") continue;
|
|
52
|
+
registered = questionReactionTargets.register(binding, {
|
|
53
|
+
accountId,
|
|
54
|
+
conversationKey,
|
|
55
|
+
messageId
|
|
56
|
+
}, targetAuthorKeys) || registered;
|
|
57
|
+
}
|
|
58
|
+
return registered;
|
|
59
|
+
}
|
|
60
|
+
async function maybeResolveSignalQuestionReaction(params) {
|
|
61
|
+
if (params.isRemove) return false;
|
|
62
|
+
const optionIndex = questionGatewayRuntime.resolveReactionIndex(params.reactionKey);
|
|
63
|
+
if (optionIndex === void 0) return false;
|
|
64
|
+
const authorKeys = resolveSignalApprovalTargetAuthorKeys(params);
|
|
65
|
+
return await questionReactionTargets.resolve({
|
|
66
|
+
identities: [{
|
|
67
|
+
accountId: params.accountId,
|
|
68
|
+
conversationKey: params.conversationKey,
|
|
69
|
+
messageId: params.messageId
|
|
70
|
+
}],
|
|
71
|
+
optionIndex,
|
|
72
|
+
cfg: params.cfg,
|
|
73
|
+
senderId: params.actorId,
|
|
74
|
+
gatewayUrl: params.gatewayUrl,
|
|
75
|
+
metadata: authorKeys,
|
|
76
|
+
logDebug: params.logDebug
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { question_reactions_exports as n, registerSignalQuestionReactionTargetForDeliveredPayload as r, maybeResolveSignalQuestionReaction as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as resolveSignalAccount } from "./accounts-DrStJjiK.js";
|
|
2
|
-
import { n as signalRpcRequest } from "./client-adapter-
|
|
2
|
+
import { n as signalRpcRequest } from "./client-adapter-D9SNPaNx.js";
|
|
3
3
|
import { t as resolveSignalRpcContext } from "./rpc-context-CZUoE0-A.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -37,16 +37,17 @@ async function sendReactionSignalCore(params) {
|
|
|
37
37
|
const { baseUrl, account } = resolveSignalRpcContext(params.opts, accountInfo);
|
|
38
38
|
const normalizedRecipient = normalizeSignalUuid(params.recipient);
|
|
39
39
|
const groupId = params.opts.groupId?.trim();
|
|
40
|
-
|
|
41
|
-
if (!
|
|
40
|
+
const operation = `Signal reaction${params.remove ? " removal" : ""}`;
|
|
41
|
+
if (!normalizedRecipient && !groupId) throw new Error(`Recipient or groupId is required for ${operation}`);
|
|
42
|
+
if (!Number.isFinite(params.targetTimestamp) || params.targetTimestamp <= 0) throw new Error(`Valid targetTimestamp is required for ${operation}`);
|
|
42
43
|
const normalizedEmoji = params.emoji?.trim();
|
|
43
|
-
if (!normalizedEmoji) throw new Error(
|
|
44
|
+
if (!normalizedEmoji) throw new Error(`Emoji is required for ${operation}`);
|
|
44
45
|
const targetAuthorParams = resolveTargetAuthorParams({
|
|
45
46
|
targetAuthor: params.opts.targetAuthor,
|
|
46
47
|
targetAuthorUuid: params.opts.targetAuthorUuid,
|
|
47
48
|
fallback: normalizedRecipient
|
|
48
49
|
});
|
|
49
|
-
if (groupId && !targetAuthorParams.targetAuthor) throw new Error(params.
|
|
50
|
+
if (groupId && !targetAuthorParams.targetAuthor) throw new Error(`targetAuthor is required for group reaction${params.remove ? " removal" : "s"}`);
|
|
50
51
|
const requestParams = {
|
|
51
52
|
emoji: normalizedEmoji,
|
|
52
53
|
targetTimestamp: params.targetTimestamp,
|
|
@@ -78,13 +79,7 @@ async function sendReactionSignal(recipient, targetTimestamp, emoji, opts) {
|
|
|
78
79
|
targetTimestamp,
|
|
79
80
|
emoji,
|
|
80
81
|
remove: false,
|
|
81
|
-
opts
|
|
82
|
-
errors: {
|
|
83
|
-
missingRecipient: "Recipient or groupId is required for Signal reaction",
|
|
84
|
-
invalidTargetTimestamp: "Valid targetTimestamp is required for Signal reaction",
|
|
85
|
-
missingEmoji: "Emoji is required for Signal reaction",
|
|
86
|
-
missingTargetAuthor: "targetAuthor is required for group reactions"
|
|
87
|
-
}
|
|
82
|
+
opts
|
|
88
83
|
});
|
|
89
84
|
}
|
|
90
85
|
/**
|
|
@@ -100,13 +95,7 @@ async function removeReactionSignal(recipient, targetTimestamp, emoji, opts) {
|
|
|
100
95
|
targetTimestamp,
|
|
101
96
|
emoji,
|
|
102
97
|
remove: true,
|
|
103
|
-
opts
|
|
104
|
-
errors: {
|
|
105
|
-
missingRecipient: "Recipient or groupId is required for Signal reaction removal",
|
|
106
|
-
invalidTargetTimestamp: "Valid targetTimestamp is required for Signal reaction removal",
|
|
107
|
-
missingEmoji: "Emoji is required for Signal reaction removal",
|
|
108
|
-
missingTargetAuthor: "targetAuthor is required for group reaction removal"
|
|
109
|
-
}
|
|
98
|
+
opts
|
|
110
99
|
});
|
|
111
100
|
}
|
|
112
101
|
//#endregion
|
|
@@ -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-Cf6QHcE5.js";
|
|
2
2
|
export { removeReactionSignal, sendReactionSignal };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DrStJjiK.js";
|
|
2
2
|
import { d as normalizeSignalMessagingTarget, u as looksLikeSignalTargetId } from "./identity-BQ4OzXXk.js";
|
|
3
3
|
import { n as setSignalRuntime } from "./runtime-JPrGlV7h.js";
|
|
4
|
-
import { a as signalMessageActions, o as resolveSignalReactionLevel } from "./transport-detection-
|
|
5
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
6
|
-
import { n as SignalConfigSchema } from "./config-schema-
|
|
7
|
-
import { i as installSignalCli } from "./install-signal-cli-
|
|
8
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
9
|
-
import { t as sendMessageSignal } from "./send-
|
|
10
|
-
import { t as probeSignal } from "./probe-
|
|
4
|
+
import { a as signalMessageActions, o as resolveSignalReactionLevel } from "./transport-detection-BItHawMq.js";
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-Cf6QHcE5.js";
|
|
6
|
+
import { n as SignalConfigSchema } from "./config-schema-CkMIK7zp.js";
|
|
7
|
+
import { i as installSignalCli } from "./install-signal-cli-Cpiyk0k1.js";
|
|
8
|
+
import { t as monitorSignalProvider } from "./monitor-DiN2hKnG.js";
|
|
9
|
+
import { t as sendMessageSignal } from "./send-BvGgByMd.js";
|
|
10
|
+
import { t as probeSignal } from "./probe-C_THuQzn.js";
|
|
11
11
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
12
12
|
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
13
13
|
import { buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary, collectStatusIssuesFromLastError, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as resolveSignalAccount } from "./accounts-DrStJjiK.js";
|
|
2
2
|
import { d as normalizeSignalMessagingTarget } from "./identity-BQ4OzXXk.js";
|
|
3
|
-
import { c as markdownToSignalText, n as registerSignalReplyContext } from "./transport-detection-
|
|
4
|
-
import { n as signalRpcRequest } from "./client-adapter-
|
|
3
|
+
import { c as markdownToSignalText, n as registerSignalReplyContext } from "./transport-detection-BItHawMq.js";
|
|
4
|
+
import { n as signalRpcRequest } from "./client-adapter-D9SNPaNx.js";
|
|
5
5
|
import { t as resolveSignalRpcContext } from "./rpc-context-CZUoE0-A.js";
|
|
6
|
-
import { c as registerSignalApprovalReactionTargetForOutboundMessage, n as appendSignalApprovalReactionHintForOutboundMessage } from "./approval-reactions-
|
|
6
|
+
import { c as registerSignalApprovalReactionTargetForOutboundMessage, n as appendSignalApprovalReactionHintForOutboundMessage } from "./approval-reactions-BulCzhdB.js";
|
|
7
7
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
9
9
|
import { kindFromMime, resolveOutboundAttachmentFromUrl } from "openclaw/plugin-sdk/media-runtime";
|
|
@@ -113,6 +113,15 @@ function resolveSignalQuoteParams(opts) {
|
|
|
113
113
|
}
|
|
114
114
|
function isSignalQuoteMetadataRejection(error) {
|
|
115
115
|
const normalized = normalizeLowercaseStringOrEmpty(error instanceof Error ? error.message : String(error));
|
|
116
|
+
const rpcCode = /^signal rpc (-?\d+):/u.exec(normalized)?.[1];
|
|
117
|
+
if (rpcCode !== void 0) {
|
|
118
|
+
if (rpcCode !== "-32602") return false;
|
|
119
|
+
} else {
|
|
120
|
+
const restStatusText = /^signal rest (\d{3}):/u.exec(normalized)?.[1];
|
|
121
|
+
if (!restStatusText) return false;
|
|
122
|
+
const restStatus = Number(restStatusText);
|
|
123
|
+
if (restStatus < 400 || restStatus >= 500 || restStatus === 408 || restStatus === 429) return false;
|
|
124
|
+
}
|
|
116
125
|
if (!normalized.includes("quote")) return false;
|
|
117
126
|
return normalized.includes("reject") || normalized.includes("invalid") || normalized.includes("unrecognized") || normalized.includes("unsupported") || normalized.includes("not found") || normalized.includes("no such") || normalized.includes("unknown");
|
|
118
127
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
1
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-BvGgByMd.js";
|
|
2
2
|
export { sendMessageSignal, sendTypingSignal };
|
|
@@ -2,7 +2,7 @@ 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-DrStJjiK.js";
|
|
3
3
|
import { d as normalizeSignalMessagingTarget } from "./identity-BQ4OzXXk.js";
|
|
4
4
|
import { i as signalApprovalAuth, r as getSignalApprovalApprovers, t as getOptionalSignalRuntime } from "./runtime-JPrGlV7h.js";
|
|
5
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-Cf6QHcE5.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { kindFromMime } from "openclaw/plugin-sdk/media-runtime";
|
|
8
8
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
@@ -10,9 +10,9 @@ import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
|
10
10
|
import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
|
|
11
11
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithAttributedRanges } from "openclaw/plugin-sdk/text-chunking";
|
|
13
|
-
import {
|
|
13
|
+
import { createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
14
14
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
15
|
-
import {
|
|
15
|
+
import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
16
16
|
import { buildApprovalReactionPendingContentForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
17
17
|
import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
|
|
18
18
|
import { createActionGate, jsonResult, readStringParam, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -20,28 +20,60 @@ import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtim
|
|
|
20
20
|
import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
21
21
|
import { isMessagePresentationInteractiveBlock, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
22
22
|
//#region extensions/signal/src/approval-native.ts
|
|
23
|
-
const DEFAULT_APPROVAL_FORWARDING_MODE = "session";
|
|
24
|
-
const { normalizeForwardTarget: normalizeSignalForwardTarget, normalizeTarget: normalizeSignalApprovalTarget, resolveSessionTarget: resolveSessionSignalOriginTarget, resolveTurnSourceTarget: resolveTurnSourceSignalOriginTarget } = createNativeApprovalMessagingTargetResolvers({
|
|
25
|
-
channel: "signal",
|
|
26
|
-
normalizeTo: normalizeSignalMessagingTarget
|
|
27
|
-
});
|
|
28
23
|
function isSignalApprovalTransportEnabled(params) {
|
|
29
24
|
return resolveSignalAccount({
|
|
30
25
|
cfg: params.cfg,
|
|
31
26
|
accountId: params.accountId
|
|
32
27
|
}).enabled;
|
|
33
28
|
}
|
|
34
|
-
const
|
|
29
|
+
const signalApproval = createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes({
|
|
35
30
|
channel: "signal",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
channelLabel: "Signal",
|
|
32
|
+
authorizeActorAction: (params) => signalApprovalAuth.authorizeActorAction(params),
|
|
33
|
+
routing: {
|
|
34
|
+
defaultForwardingMode: "session",
|
|
35
|
+
isTransportEnabled: isSignalApprovalTransportEnabled,
|
|
36
|
+
listAccountIds: listSignalAccountIds,
|
|
37
|
+
resolveDefaultAccountId: resolveDefaultSignalAccountId,
|
|
38
|
+
normalizeTo: normalizeSignalMessagingTarget,
|
|
39
|
+
resolveApprovers: getSignalApprovalApprovers,
|
|
40
|
+
suppressExplicitTargetFallback: false,
|
|
41
|
+
isOriginTargetAllowed: ({ cfg, accountId, target }) => !isSignalGroupTarget(target.to) || getSignalApprovalApprovers({
|
|
42
|
+
cfg,
|
|
43
|
+
accountId
|
|
44
|
+
}).length > 0
|
|
45
|
+
},
|
|
46
|
+
describeExecApprovalSetup: ({ accountId }) => {
|
|
47
|
+
return `Signal supports native exec approvals for this account when \`approvals.exec.enabled\` is true and the route allows Signal. Link Signal and keep the gateway running; configure \`${accountId && accountId !== "default" ? `channels.signal.accounts.${accountId}` : "channels.signal"}.allowFrom\` to restrict approvers.`;
|
|
48
|
+
},
|
|
49
|
+
render: {
|
|
50
|
+
exec: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
|
|
51
|
+
request,
|
|
52
|
+
nowMs
|
|
53
|
+
}).manualFallbackPayload },
|
|
54
|
+
plugin: { buildPendingPayload: ({ request, nowMs }) => buildApprovalReactionPendingContentForRequest({
|
|
55
|
+
request,
|
|
56
|
+
nowMs
|
|
57
|
+
}).manualFallbackPayload }
|
|
58
|
+
},
|
|
59
|
+
createNativeRuntime: (routing) => createLazyChannelApprovalNativeRuntimeAdapter({
|
|
60
|
+
eventKinds: ["exec", "plugin"],
|
|
61
|
+
isConfigured: ({ cfg, accountId, context }) => Boolean(context) && routing.isNativeApprovalHandlerConfigured({
|
|
62
|
+
cfg,
|
|
63
|
+
accountId
|
|
64
|
+
}),
|
|
65
|
+
shouldHandle: ({ cfg, accountId, context, approvalKind, request }) => Boolean(context) && routing.shouldHandleApprovalRequest({
|
|
66
|
+
cfg,
|
|
67
|
+
accountId,
|
|
68
|
+
approvalKind,
|
|
69
|
+
request
|
|
70
|
+
}),
|
|
71
|
+
load: async () => (await import("./approval-handler.runtime-Bi5yNhnj.js")).signalApprovalNativeRuntime
|
|
72
|
+
})
|
|
42
73
|
});
|
|
74
|
+
const signalApprovalRouting = signalApproval.routing;
|
|
43
75
|
function isSignalNativeApprovalHandlerConfigured(params) {
|
|
44
|
-
return
|
|
76
|
+
return signalApprovalRouting.isNativeApprovalHandlerConfigured(params);
|
|
45
77
|
}
|
|
46
78
|
function resolveSignalSessionTargetFromSessionKey(sessionKey) {
|
|
47
79
|
const rest = parseAgentSessionKey(sessionKey)?.rest ?? normalizeOptionalString(sessionKey);
|
|
@@ -62,137 +94,10 @@ function shouldSuppressLocalSignalExecApprovalPrompt(params) {
|
|
|
62
94
|
}
|
|
63
95
|
});
|
|
64
96
|
}
|
|
65
|
-
const resolveSignalOriginTargetBase = createChannelNativeOriginTargetResolver({
|
|
66
|
-
channel: "signal",
|
|
67
|
-
shouldHandleRequest: shouldHandleSignalApprovalRequest,
|
|
68
|
-
resolveTurnSourceTarget: resolveTurnSourceSignalOriginTarget,
|
|
69
|
-
resolveSessionTarget: resolveSessionSignalOriginTarget,
|
|
70
|
-
normalizeTarget: normalizeSignalApprovalTarget
|
|
71
|
-
});
|
|
72
97
|
function isSignalGroupTarget(to) {
|
|
73
98
|
return normalizeLowercaseStringOrEmpty(to).startsWith("group:");
|
|
74
99
|
}
|
|
75
|
-
|
|
76
|
-
const target = resolveSignalOriginTargetBase(params);
|
|
77
|
-
if (!target) return null;
|
|
78
|
-
if (isSignalGroupTarget(target.to) && getSignalApprovalApprovers({
|
|
79
|
-
cfg: params.cfg,
|
|
80
|
-
accountId: params.accountId
|
|
81
|
-
}).length === 0) return null;
|
|
82
|
-
return target;
|
|
83
|
-
}
|
|
84
|
-
const resolveSignalApproverDmTargets = createChannelApproverDmTargetResolver({
|
|
85
|
-
shouldHandleRequest: shouldHandleSignalApprovalRequest,
|
|
86
|
-
resolveApprovers: getSignalApprovalApprovers,
|
|
87
|
-
mapApprover: (approver, params) => {
|
|
88
|
-
const to = normalizeSignalMessagingTarget(approver);
|
|
89
|
-
if (!to) return null;
|
|
90
|
-
return {
|
|
91
|
-
to,
|
|
92
|
-
accountId: normalizeOptionalString(params.accountId)
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
const shouldSuppressSignalForwardingFallback = createNativeApprovalForwardingFallbackSuppressor({
|
|
97
|
-
channel: "signal",
|
|
98
|
-
normalizeForwardTarget: normalizeSignalForwardTarget,
|
|
99
|
-
resolveAccountId: ({ forwardingTarget, request }) => forwardingTarget.accountId ?? normalizeOptionalString(request.request.turnSourceAccountId),
|
|
100
|
-
resolveForwardingTargetForMatch: ({ forwardingTarget, accountId }) => ({
|
|
101
|
-
...forwardingTarget,
|
|
102
|
-
accountId
|
|
103
|
-
}),
|
|
104
|
-
isSessionRouteEligible: isSignalSessionApprovalEligible,
|
|
105
|
-
resolveOriginTarget: resolveSignalOriginTarget,
|
|
106
|
-
resolveApproverDmTargets: resolveSignalApproverDmTargets
|
|
107
|
-
});
|
|
108
|
-
function buildSignalExecPendingPayload(params) {
|
|
109
|
-
return buildApprovalReactionPendingContentForRequest(params).manualFallbackPayload;
|
|
110
|
-
}
|
|
111
|
-
function buildSignalPluginPendingPayload(params) {
|
|
112
|
-
return buildApprovalReactionPendingContentForRequest(params).manualFallbackPayload;
|
|
113
|
-
}
|
|
114
|
-
const signalApprovalCapability = createChannelApprovalCapability({
|
|
115
|
-
...signalApprovalAuth,
|
|
116
|
-
getActionAvailabilityState: ({ cfg, accountId, approvalKind }) => (approvalKind ? canApprovalPotentiallyRouteToSignal({
|
|
117
|
-
cfg,
|
|
118
|
-
accountId,
|
|
119
|
-
approvalKind
|
|
120
|
-
}) : canAnyApprovalPotentiallyRouteToSignal({
|
|
121
|
-
cfg,
|
|
122
|
-
accountId
|
|
123
|
-
})) ? { kind: "enabled" } : { kind: "disabled" },
|
|
124
|
-
getExecInitiatingSurfaceState: ({ cfg, accountId }) => canApprovalPotentiallyRouteToSignal({
|
|
125
|
-
cfg,
|
|
126
|
-
accountId,
|
|
127
|
-
approvalKind: "exec"
|
|
128
|
-
}) ? { kind: "enabled" } : { kind: "disabled" },
|
|
129
|
-
describeExecApprovalSetup: ({ accountId }) => {
|
|
130
|
-
return `Signal supports native exec approvals for this account when \`approvals.exec.enabled\` is true and the route allows Signal. Link Signal and keep the gateway running; configure \`${accountId && accountId !== "default" ? `channels.signal.accounts.${accountId}` : "channels.signal"}.allowFrom\` to restrict approvers.`;
|
|
131
|
-
},
|
|
132
|
-
delivery: {
|
|
133
|
-
hasConfiguredDmRoute: ({ cfg }) => listSignalAccountIds(cfg).some((accountId) => {
|
|
134
|
-
if (!canAnyApprovalPotentiallyRouteToSignal({
|
|
135
|
-
cfg,
|
|
136
|
-
accountId,
|
|
137
|
-
nativeSessionOnly: true
|
|
138
|
-
})) return false;
|
|
139
|
-
return getSignalApprovalApprovers({
|
|
140
|
-
cfg,
|
|
141
|
-
accountId
|
|
142
|
-
}).length > 0;
|
|
143
|
-
}),
|
|
144
|
-
shouldSuppressForwardingFallback: shouldSuppressSignalForwardingFallback
|
|
145
|
-
},
|
|
146
|
-
render: {
|
|
147
|
-
exec: { buildPendingPayload: ({ request, nowMs }) => buildSignalExecPendingPayload({
|
|
148
|
-
request,
|
|
149
|
-
nowMs
|
|
150
|
-
}) },
|
|
151
|
-
plugin: { buildPendingPayload: ({ request, nowMs }) => buildSignalPluginPendingPayload({
|
|
152
|
-
request,
|
|
153
|
-
nowMs
|
|
154
|
-
}) }
|
|
155
|
-
},
|
|
156
|
-
native: {
|
|
157
|
-
describeDeliveryCapabilities: ({ cfg, accountId, approvalKind, request }) => {
|
|
158
|
-
const originTarget = resolveSignalOriginTarget({
|
|
159
|
-
cfg,
|
|
160
|
-
accountId,
|
|
161
|
-
approvalKind,
|
|
162
|
-
request
|
|
163
|
-
});
|
|
164
|
-
const approverTargets = resolveSignalApproverDmTargets({
|
|
165
|
-
cfg,
|
|
166
|
-
accountId,
|
|
167
|
-
approvalKind,
|
|
168
|
-
request
|
|
169
|
-
});
|
|
170
|
-
return {
|
|
171
|
-
enabled: Boolean(originTarget) || approverTargets.length > 0,
|
|
172
|
-
preferredSurface: originTarget ? "origin" : "approver-dm",
|
|
173
|
-
supportsOriginSurface: Boolean(originTarget),
|
|
174
|
-
supportsApproverDmSurface: approverTargets.length > 0,
|
|
175
|
-
notifyOriginWhenDmOnly: true
|
|
176
|
-
};
|
|
177
|
-
},
|
|
178
|
-
resolveOriginTarget: resolveSignalOriginTarget,
|
|
179
|
-
resolveApproverDmTargets: resolveSignalApproverDmTargets
|
|
180
|
-
},
|
|
181
|
-
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
182
|
-
eventKinds: ["exec", "plugin"],
|
|
183
|
-
isConfigured: ({ cfg, accountId, context }) => Boolean(context) && isSignalNativeApprovalHandlerConfigured({
|
|
184
|
-
cfg,
|
|
185
|
-
accountId
|
|
186
|
-
}),
|
|
187
|
-
shouldHandle: ({ cfg, accountId, context, approvalKind, request }) => Boolean(context) && shouldHandleSignalApprovalRequest({
|
|
188
|
-
cfg,
|
|
189
|
-
accountId,
|
|
190
|
-
approvalKind,
|
|
191
|
-
request
|
|
192
|
-
}),
|
|
193
|
-
load: async () => (await import("./approval-handler.runtime-C-XYgcxE.js")).signalApprovalNativeRuntime
|
|
194
|
-
})
|
|
195
|
-
});
|
|
100
|
+
const signalApprovalCapability = signalApproval.capability;
|
|
196
101
|
//#endregion
|
|
197
102
|
//#region extensions/signal/src/format.ts
|
|
198
103
|
const SIGNAL_STYLE_MAP = {
|
|
@@ -633,7 +538,7 @@ const DEFAULT_PROBE_TIMEOUT_MS = 1e4;
|
|
|
633
538
|
async function detectSignalTransport(params) {
|
|
634
539
|
const url = normalizeSignalTransportUrl(params.url);
|
|
635
540
|
const timeoutMs = params.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
636
|
-
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-
|
|
541
|
+
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-BsJdp0oI.js");
|
|
637
542
|
const probeNative = params.probeNative ?? probes?.nativeCheck;
|
|
638
543
|
const probeContainer = params.probeContainer ?? probes?.containerCheck;
|
|
639
544
|
if (!probeNative || !probeContainer) throw new Error("Signal transport probes are unavailable");
|
package/dist/{transport-detection.runtime-D_190UUL.js → transport-detection.runtime-DoiwPcrG.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
1
|
+
import { t as detectSignalTransport } from "./transport-detection-BItHawMq.js";
|
|
2
2
|
export { detectSignalTransport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as containerCheck, t as signalCheck } from "./client-
|
|
1
|
+
import { i as containerCheck, t as signalCheck } from "./client-CvnR8_XA.js";
|
|
2
2
|
export { containerCheck, signalCheck as nativeCheck };
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "signal",
|
|
3
|
+
"doctorContract": {
|
|
4
|
+
"configRepair": true
|
|
5
|
+
},
|
|
3
6
|
"icon": "https://cdn.simpleicons.org/signal",
|
|
4
7
|
"activation": {
|
|
5
8
|
"onStartup": false
|
|
@@ -1011,7 +1014,7 @@
|
|
|
1011
1014
|
"additionalProperties": false
|
|
1012
1015
|
},
|
|
1013
1016
|
"label": "Signal",
|
|
1014
|
-
"description": "signal-cli linked device
|
|
1017
|
+
"description": "signal-cli linked device with additional setup for the local REST bridge.",
|
|
1015
1018
|
"uiHints": {
|
|
1016
1019
|
"": {
|
|
1017
1020
|
"label": "Signal",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/signal",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.2",
|
|
4
4
|
"description": "OpenClaw Signal channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"detailLabel": "Signal REST",
|
|
26
26
|
"docsPath": "/channels/signal",
|
|
27
27
|
"docsLabel": "signal",
|
|
28
|
-
"blurb": "signal-cli linked device
|
|
28
|
+
"blurb": "signal-cli linked device with additional setup for the local REST bridge.",
|
|
29
29
|
"systemImage": "antenna.radiowaves.left.and.right",
|
|
30
30
|
"markdownCapable": true,
|
|
31
31
|
"setup": {
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"allowInvalidConfigRecovery": true
|
|
94
94
|
},
|
|
95
95
|
"compat": {
|
|
96
|
-
"pluginApi": ">=2026.
|
|
96
|
+
"pluginApi": ">=2026.8.1-beta.2"
|
|
97
97
|
},
|
|
98
98
|
"build": {
|
|
99
|
-
"openclawVersion": "2026.
|
|
99
|
+
"openclawVersion": "2026.8.1-beta.2",
|
|
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.
|
|
121
|
+
"openclaw": ">=2026.8.1-beta.2"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"openclaw": {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
2
|
-
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
3
|
-
//#region extensions/signal/src/approval-resolver.ts
|
|
4
|
-
async function resolveSignalApproval(params) {
|
|
5
|
-
return await resolveApprovalOverGateway({
|
|
6
|
-
cfg: params.cfg,
|
|
7
|
-
approvalId: params.approvalId,
|
|
8
|
-
approvalKind: params.approvalKind,
|
|
9
|
-
decision: params.decision,
|
|
10
|
-
senderId: params.senderId,
|
|
11
|
-
gatewayUrl: params.gatewayUrl,
|
|
12
|
-
clientDisplayName: `Signal approval (${params.senderId?.trim() || "unknown"})`
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { isApprovalNotFoundError, resolveSignalApproval };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { o as resolveSignalTarget } from "./runtime-JPrGlV7h.js";
|
|
3
|
-
import { l as resolveSignalApprovalConversationKey, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-DtL47gSK.js";
|
|
4
|
-
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
5
|
-
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
|
-
//#region extensions/signal/src/question-reactions.ts
|
|
7
|
-
var question_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
maybeResolveSignalQuestionReaction: () => maybeResolveSignalQuestionReaction,
|
|
9
|
-
registerSignalQuestionReactionTargetForDeliveredPayload: () => registerSignalQuestionReactionTargetForDeliveredPayload
|
|
10
|
-
});
|
|
11
|
-
const TARGET_TTL_MS = 1440 * 60 * 1e3;
|
|
12
|
-
const targets = /* @__PURE__ */ new Map();
|
|
13
|
-
function storeTarget(key, binding, targetAuthorKeys) {
|
|
14
|
-
const existing = targets.get(key);
|
|
15
|
-
if (existing) clearTimeout(existing.cleanupTimer);
|
|
16
|
-
const target = {
|
|
17
|
-
...binding,
|
|
18
|
-
targetAuthorKeys,
|
|
19
|
-
terminal: false,
|
|
20
|
-
expiresAtMs: Date.now() + TARGET_TTL_MS,
|
|
21
|
-
cleanupTimer: setTimeout(() => {
|
|
22
|
-
if (targets.get(key) === target) targets.delete(key);
|
|
23
|
-
}, TARGET_TTL_MS)
|
|
24
|
-
};
|
|
25
|
-
target.cleanupTimer.unref?.();
|
|
26
|
-
targets.set(key, target);
|
|
27
|
-
questionGatewayRuntime.registerChannelDelivery({
|
|
28
|
-
questionId: binding.questionId,
|
|
29
|
-
deliveryId: `signal-reaction:${key}`,
|
|
30
|
-
finalize: () => {
|
|
31
|
-
target.terminal = true;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function buildKey(accountId, conversationKey, messageId) {
|
|
36
|
-
const values = [
|
|
37
|
-
accountId,
|
|
38
|
-
conversationKey,
|
|
39
|
-
messageId
|
|
40
|
-
].map((value) => value.trim());
|
|
41
|
-
return values.every(Boolean) ? values.join(":") : null;
|
|
42
|
-
}
|
|
43
|
-
function resolveConversationKey(params) {
|
|
44
|
-
try {
|
|
45
|
-
return resolveSignalTarget({
|
|
46
|
-
cfg: params.cfg,
|
|
47
|
-
accountId: params.accountId,
|
|
48
|
-
input: params.to
|
|
49
|
-
})?.to ?? resolveSignalApprovalConversationKey(params.to);
|
|
50
|
-
} catch {
|
|
51
|
-
return resolveSignalApprovalConversationKey(params.to);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function registerSignalQuestionReactionTargetForDeliveredPayload(params) {
|
|
55
|
-
const binding = questionGatewayRuntime.readReactionBinding(params.payload);
|
|
56
|
-
if (params.target.channel !== "signal" || !binding) return false;
|
|
57
|
-
const conversationKey = resolveConversationKey({
|
|
58
|
-
cfg: params.cfg,
|
|
59
|
-
...params.target
|
|
60
|
-
});
|
|
61
|
-
const targetAuthorKeys = resolveSignalApprovalTargetAuthorKeys(params);
|
|
62
|
-
if (!conversationKey || targetAuthorKeys.length === 0) return false;
|
|
63
|
-
const accountId = normalizeAccountId(params.target.accountId ?? void 0);
|
|
64
|
-
let registered = false;
|
|
65
|
-
for (const result of params.results) {
|
|
66
|
-
const messageId = result.channel === "signal" ? result.messageId.trim() : "";
|
|
67
|
-
const key = messageId && messageId !== "unknown" ? buildKey(accountId, conversationKey, messageId) : null;
|
|
68
|
-
if (!key) continue;
|
|
69
|
-
storeTarget(key, binding, targetAuthorKeys);
|
|
70
|
-
registered = true;
|
|
71
|
-
}
|
|
72
|
-
return registered;
|
|
73
|
-
}
|
|
74
|
-
async function maybeResolveSignalQuestionReaction(params) {
|
|
75
|
-
if (params.isRemove) return false;
|
|
76
|
-
const optionIndex = questionGatewayRuntime.resolveReactionIndex(params.reactionKey);
|
|
77
|
-
const key = buildKey(params.accountId, params.conversationKey, params.messageId);
|
|
78
|
-
if (optionIndex === void 0 || !key) return false;
|
|
79
|
-
const target = targets.get(key);
|
|
80
|
-
if (!target) return false;
|
|
81
|
-
if (!resolveSignalApprovalTargetAuthorKeys(params).some((authorKey) => target.targetAuthorKeys.includes(authorKey))) return false;
|
|
82
|
-
if (target.expiresAtMs <= Date.now() || target.terminal) {
|
|
83
|
-
target.terminal = true;
|
|
84
|
-
params.logDebug?.(`signal: stale question reaction ignored id=${target.questionId}`);
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
const optionValue = target.optionValues[optionIndex];
|
|
88
|
-
if (!optionValue) {
|
|
89
|
-
params.logDebug?.(`signal: out-of-range question reaction ignored id=${target.questionId}`);
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
const result = await questionGatewayRuntime.resolveReaction({
|
|
94
|
-
cfg: params.cfg,
|
|
95
|
-
questionId: target.questionId,
|
|
96
|
-
optionValue,
|
|
97
|
-
senderId: params.actorId,
|
|
98
|
-
gatewayUrl: params.gatewayUrl,
|
|
99
|
-
clientDisplayName: `Signal question (${params.actorId})`
|
|
100
|
-
});
|
|
101
|
-
target.terminal = result?.status === "answered" || result?.status === "already-terminal";
|
|
102
|
-
if (result?.status === "already-terminal") params.logDebug?.(`signal: stale question reaction ignored id=${target.questionId}`);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
params.logDebug?.(`signal: question reaction failed id=${target.questionId}: ${String(error)}`);
|
|
105
|
-
}
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
//#endregion
|
|
109
|
-
export { question_reactions_exports as n, registerSignalQuestionReactionTargetForDeliveredPayload as r, maybeResolveSignalQuestionReaction as t };
|