@openclaw/signal 2026.7.2-beta.4 → 2026.7.2-beta.5
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 +6 -6
- package/dist/{approval-handler.runtime-C2qf7D0D.js → approval-handler.runtime-C-XYgcxE.js} +4 -4
- package/dist/{approval-reactions-5uyOazxW.js → approval-reactions-DtL47gSK.js} +2 -2
- package/dist/{channel-DQ9i00A8.js → channel-CBIljGCH.js} +18 -37
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-DWQdFD2O.js → channel.runtime-B8GXmuol.js} +1 -1
- package/dist/{client-yjbwtufN.js → client-BazXTH7O.js} +5 -19
- package/dist/{client-adapter-Bm0ZRqJn.js → client-adapter-mXGeEHQJ.js} +1 -1
- package/dist/{monitor-C0aBYlJ0.js → monitor-CHBkf7lk.js} +9 -44
- package/dist/{probe-2yf2hpcc.js → probe-Br9abaGp.js} +37 -39
- package/dist/{question-reactions-DJ1xQzVF.js → question-reactions-Ds48FtEu.js} +1 -1
- package/dist/{reaction-runtime-api-Bka61qO9.js → reaction-runtime-api-BjeDyKcz.js} +1 -1
- package/dist/reaction-runtime-api.js +1 -1
- package/dist/runtime-api.js +5 -5
- package/dist/{send-BZAqAa8p.js → send-B_Ks4MZr.js} +21 -3
- package/dist/{send.runtime-CcA5Qei9.js → send.runtime-CbuXycZT.js} +1 -1
- package/dist/{transport-detection-CiZWiMYa.js → transport-detection-Da06-LOL.js} +12 -46
- package/dist/{transport-detection.runtime-BgjcIyww.js → transport-detection.runtime-D_190UUL.js} +1 -1
- package/dist/{transport-probes.runtime-CbnZn38-.js → transport-probes.runtime-CV6Qs0Og.js} +1 -1
- package/package.json +4 -5
- package/npm-shrinkwrap.json +0 -46
package/dist/api.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-DrStJjiK.js";
|
|
2
2
|
import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, d as normalizeSignalMessagingTarget, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine, u as looksLikeSignalTargetId } from "./identity-BQ4OzXXk.js";
|
|
3
|
-
import { a as signalMessageActions, c as markdownToSignalText, l as markdownToSignalTextChunks, o as resolveSignalReactionLevel, t as detectSignalTransport } from "./transport-detection-
|
|
4
|
-
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-
|
|
5
|
-
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-
|
|
3
|
+
import { a as signalMessageActions, c as markdownToSignalText, l as markdownToSignalTextChunks, o as resolveSignalReactionLevel, t as detectSignalTransport } from "./transport-detection-Da06-LOL.js";
|
|
4
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BjeDyKcz.js";
|
|
5
|
+
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-CBIljGCH.js";
|
|
6
6
|
import { i as installSignalCli, o as looksLikeArchive, r as extractSignalCliArchive, s as pickAsset } from "./install-signal-cli-qJF7iC4h.js";
|
|
7
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
8
|
-
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
9
|
-
import { t as probeSignal } from "./probe-
|
|
7
|
+
import { t as monitorSignalProvider } from "./monitor-CHBkf7lk.js";
|
|
8
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-B_Ks4MZr.js";
|
|
9
|
+
import { t as probeSignal } from "./probe-Br9abaGp.js";
|
|
10
10
|
//#region extensions/signal/src/channel.setup.ts
|
|
11
11
|
const signalSetupPlugin = { ...createSignalPluginBase({
|
|
12
12
|
setupWizard: signalSetupWizard,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as resolveDefaultSignalAccountId } from "./accounts-DrStJjiK.js";
|
|
2
2
|
import { d as normalizeSignalMessagingTarget } from "./identity-BQ4OzXXk.js";
|
|
3
3
|
import { o as resolveSignalTarget } from "./runtime-JPrGlV7h.js";
|
|
4
|
-
import { d as unregisterSignalApprovalReactionTarget, i as hasSignalApprovalReactionApprovers, l as resolveSignalApprovalConversationKey, o as registerSignalApprovalReactionTarget, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-
|
|
5
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
4
|
+
import { d as unregisterSignalApprovalReactionTarget, i as hasSignalApprovalReactionApprovers, l as resolveSignalApprovalConversationKey, o as registerSignalApprovalReactionTarget, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-DtL47gSK.js";
|
|
5
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-B_Ks4MZr.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";
|
|
@@ -109,7 +109,7 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
109
109
|
accountId: preparedTarget.accountId,
|
|
110
110
|
...preparedTarget.baseUrl ? { baseUrl: preparedTarget.baseUrl } : {},
|
|
111
111
|
...preparedTarget.account ? { account: preparedTarget.account } : {},
|
|
112
|
-
textMode: "
|
|
112
|
+
textMode: "markdown"
|
|
113
113
|
});
|
|
114
114
|
if (!result.messageId || result.messageId === "unknown") return null;
|
|
115
115
|
const conversationKey = resolveSignalApprovalConversationKey(preparedTarget.to);
|
|
@@ -131,7 +131,7 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
131
131
|
accountId: entry.accountId,
|
|
132
132
|
...entry.baseUrl ? { baseUrl: entry.baseUrl } : {},
|
|
133
133
|
...entry.account ? { account: entry.account } : {},
|
|
134
|
-
textMode: "
|
|
134
|
+
textMode: "markdown"
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
},
|
|
@@ -193,7 +193,7 @@ function addSignalApprovalReactionHintToText(params) {
|
|
|
193
193
|
return addApprovalReactionHintToText(params);
|
|
194
194
|
}
|
|
195
195
|
function resolveStandaloneApprovalPromptKind(text) {
|
|
196
|
-
const firstLine = text.split(/\r?\n/).map((line) => line.trim()).find(Boolean);
|
|
196
|
+
const firstLine = text.split(/\r?\n/).map((line) => line.replace(/\*\*/g, "").trim()).find(Boolean);
|
|
197
197
|
if (/^(?:🔒\s*)?Exec approval required$/.test(firstLine ?? "")) return "exec";
|
|
198
198
|
if (/^(?:(?:🛡️|🛡|🚨|ℹ️|ℹ)\s*)?Plugin approval required$/.test(firstLine ?? "")) return "plugin";
|
|
199
199
|
return null;
|
|
@@ -210,7 +210,7 @@ function normalizeApprovalDecision(value) {
|
|
|
210
210
|
const APPROVAL_ID_LINE_RE = /^\s*ID:\s*([A-Za-z0-9][A-Za-z0-9._:-]*)\s*$/i;
|
|
211
211
|
const APPROVE_REPLY_COMMAND_LINE_RE = /^\s*Reply with:\s*\/approve(?:@[^\s]+)?\s+([A-Za-z0-9][A-Za-z0-9._:-]*)\s+(.+)$/i;
|
|
212
212
|
function extractSignalApprovalPromptBinding(text) {
|
|
213
|
-
const lines = text.split(/\r?\n/);
|
|
213
|
+
const lines = text.split(/\r?\n/).map((line) => line.replace(/\*\*/g, ""));
|
|
214
214
|
const idHeaderMatch = lines.map((line) => line.match(APPROVAL_ID_LINE_RE)).find((match) => Boolean(match));
|
|
215
215
|
if (!idHeaderMatch) return null;
|
|
216
216
|
const approvalId = idHeaderMatch[1];
|
|
@@ -2,7 +2,7 @@ import { a as isSignalManagedNativeConnectionUrlForBind, i as assignSignalManage
|
|
|
2
2
|
import { a as resolveSignalAccountConfig, i as resolveSignalAccount, n as listSignalAccountIds, o as resolveSignalReplyToMode, r as resolveDefaultSignalAccountId, s as resolveSignalTransport } from "./accounts-DrStJjiK.js";
|
|
3
3
|
import { c as resolveSignalSender, d as normalizeSignalMessagingTarget, l as looksLikeUuid, o as resolveSignalPeerId, s as resolveSignalRecipient, u as looksLikeSignalTargetId } from "./identity-BQ4OzXXk.js";
|
|
4
4
|
import { a as listSignalAliasDirectoryEntries, o as resolveSignalTarget } from "./runtime-JPrGlV7h.js";
|
|
5
|
-
import { a as signalMessageActions, d as shouldSuppressLocalSignalExecApprovalPrompt, f as signalApprovalCapability, i as materializeSignalPresentationFallback, l as markdownToSignalTextChunks, o as resolveSignalReactionLevel, r as resolveSignalReplyContextWithPersistence, s as formatSignalMediaText, t as detectSignalTransport } from "./transport-detection-
|
|
5
|
+
import { a as signalMessageActions, d as shouldSuppressLocalSignalExecApprovalPrompt, f as signalApprovalCapability, i as materializeSignalPresentationFallback, l as markdownToSignalTextChunks, o as resolveSignalReactionLevel, r as resolveSignalReplyContextWithPersistence, s as formatSignalMediaText, t as detectSignalTransport } from "./transport-detection-Da06-LOL.js";
|
|
6
6
|
import { i as migrateLegacySignalTransportConfig, n as normalizeCompatibilityConfig, r as clearLegacySignalTransportFieldsForAccount } from "./doctor-contract-api-DbUCknbC.js";
|
|
7
7
|
import { t as SignalChannelConfigSchema } from "./config-schema-DLvpQPN5.js";
|
|
8
8
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
@@ -24,8 +24,10 @@ import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking"
|
|
|
24
24
|
import { normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/account-resolution";
|
|
25
25
|
import { normalizeE164 } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
26
26
|
import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
|
|
27
|
+
import { parseAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
28
|
+
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
27
29
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
28
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, createCliPathTextInput, createDelegatedSetupWizardProxy, createDelegatedTextInputShouldPrompt, createPatchedAccountSetupAdapter, createSetupInputPresenceValidator, createSetupTranslator,
|
|
30
|
+
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";
|
|
29
31
|
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
30
32
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
31
33
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -211,8 +213,8 @@ async function probeSignalTransport(params) {
|
|
|
211
213
|
accountId: params.accountId,
|
|
212
214
|
overrides: managedTransportOptions(params.transport)
|
|
213
215
|
}) : params.transport);
|
|
214
|
-
if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-
|
|
215
|
-
return (params.probeNative ?? (await import("./transport-probes.runtime-
|
|
216
|
+
if (resolved.kind === "container") return (params.probeContainer ?? (await import("./transport-probes.runtime-CV6Qs0Og.js")).containerCheck)(resolved.baseUrl, timeoutMs, params.account);
|
|
217
|
+
return (params.probeNative ?? (await import("./transport-probes.runtime-CV6Qs0Og.js")).nativeCheck)(resolved.baseUrl, timeoutMs);
|
|
216
218
|
}
|
|
217
219
|
function writeSignalAccountTransport(params) {
|
|
218
220
|
const transport = normalizeTransport(params.transport);
|
|
@@ -309,7 +311,7 @@ function isUuidLike(value) {
|
|
|
309
311
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
310
312
|
}
|
|
311
313
|
function parseSignalAllowFromEntries(raw) {
|
|
312
|
-
return
|
|
314
|
+
return parseAllowFromEntries(raw, (entry) => {
|
|
313
315
|
if (normalizeLowercaseStringOrEmpty(entry).startsWith("uuid:")) {
|
|
314
316
|
const id = entry.slice(5).trim();
|
|
315
317
|
if (!id) return { error: "Invalid uuid entry" };
|
|
@@ -400,37 +402,16 @@ async function promptSignalAllowFrom(params) {
|
|
|
400
402
|
})
|
|
401
403
|
});
|
|
402
404
|
}
|
|
403
|
-
const signalDmPolicy = {
|
|
405
|
+
const signalDmPolicy = createChannelDmPolicy({
|
|
404
406
|
label: "Signal",
|
|
405
407
|
channel,
|
|
406
|
-
|
|
407
|
-
allowFromKey: "channels.signal.allowFrom",
|
|
408
|
-
resolveConfigKeys: (cfg, accountId) => (accountId ?? resolveDefaultSignalAccountId(cfg)) !== DEFAULT_ACCOUNT_ID$2 ? {
|
|
409
|
-
policyKey: `channels.signal.accounts.${accountId ?? resolveDefaultSignalAccountId(cfg)}.dmPolicy`,
|
|
410
|
-
allowFromKey: `channels.signal.accounts.${accountId ?? resolveDefaultSignalAccountId(cfg)}.allowFrom`
|
|
411
|
-
} : {
|
|
412
|
-
policyKey: "channels.signal.dmPolicy",
|
|
413
|
-
allowFromKey: "channels.signal.allowFrom"
|
|
414
|
-
},
|
|
415
|
-
getCurrent: (cfg, accountId) => resolveSignalAccount({
|
|
408
|
+
resolveAccount: (cfg, accountId) => resolveSignalAccount({
|
|
416
409
|
cfg,
|
|
417
410
|
accountId: accountId ?? resolveDefaultSignalAccountId(cfg)
|
|
418
|
-
}).config.dmPolicy ?? "pairing",
|
|
419
|
-
setPolicy: (cfg, policy, accountId) => patchChannelConfigForAccount({
|
|
420
|
-
cfg,
|
|
421
|
-
channel,
|
|
422
|
-
accountId: accountId ?? resolveDefaultSignalAccountId(cfg),
|
|
423
|
-
patch: policy === "open" ? {
|
|
424
|
-
dmPolicy: "open",
|
|
425
|
-
allowFrom: mergeAllowFromEntries(resolveSignalAccount({
|
|
426
|
-
cfg,
|
|
427
|
-
accountId: accountId ?? resolveDefaultSignalAccountId(cfg)
|
|
428
|
-
}).config.allowFrom, ["*"])
|
|
429
|
-
} : { dmPolicy: policy },
|
|
430
|
-
setupSurface: signalSetupAdapter
|
|
431
411
|
}),
|
|
412
|
+
setupSurface: () => signalSetupAdapter,
|
|
432
413
|
promptAllowFrom: promptSignalAllowFrom
|
|
433
|
-
};
|
|
414
|
+
});
|
|
434
415
|
function resolveSignalCliPath(params) {
|
|
435
416
|
const transport = resolveSignalAccount({
|
|
436
417
|
cfg: params.cfg,
|
|
@@ -587,7 +568,7 @@ function createSignalSetupWizardProxy(loadWizard) {
|
|
|
587
568
|
const signalDoctor = {
|
|
588
569
|
normalizeCompatibilityConfig,
|
|
589
570
|
cleanStaleConfig: async ({ cfg }) => {
|
|
590
|
-
const { detectSignalTransport } = await import("./transport-detection.runtime-
|
|
571
|
+
const { detectSignalTransport } = await import("./transport-detection.runtime-D_190UUL.js");
|
|
591
572
|
return await migrateLegacySignalTransportConfig({
|
|
592
573
|
cfg,
|
|
593
574
|
detect: detectSignalTransport
|
|
@@ -598,7 +579,7 @@ const signalDoctor = {
|
|
|
598
579
|
//#region extensions/signal/src/shared.ts
|
|
599
580
|
const SIGNAL_CHANNEL = "signal";
|
|
600
581
|
async function loadSignalChannelRuntime() {
|
|
601
|
-
return await import("./channel.runtime-
|
|
582
|
+
return await import("./channel.runtime-B8GXmuol.js");
|
|
602
583
|
}
|
|
603
584
|
const signalSetupWizard = createSignalSetupWizardProxy(async () => (await loadSignalChannelRuntime()).signalSetupWizard);
|
|
604
585
|
const signalConfigAdapter = {
|
|
@@ -682,10 +663,10 @@ function createSignalPluginBase(params) {
|
|
|
682
663
|
}
|
|
683
664
|
//#endregion
|
|
684
665
|
//#region extensions/signal/src/channel.ts
|
|
685
|
-
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
686
|
-
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
687
|
-
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
688
|
-
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
666
|
+
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-CHBkf7lk.js").then((n) => n.n));
|
|
667
|
+
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-Br9abaGp.js").then((n) => n.n));
|
|
668
|
+
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-CbuXycZT.js"));
|
|
669
|
+
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-DtL47gSK.js").then((n) => n.r));
|
|
689
670
|
async function resolveSignalSendContext(params) {
|
|
690
671
|
return {
|
|
691
672
|
send: resolveOutboundSendDep(params.deps, "signal") ?? (await loadSignalSendRuntime()).sendMessageSignal,
|
|
@@ -917,7 +898,7 @@ async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
|
917
898
|
const targetAuthor = normalizeOptionalString(account.config.account);
|
|
918
899
|
const targetAuthorUuid = normalizeOptionalString(account.config.accountUuid);
|
|
919
900
|
if (!targetAuthor && !targetAuthorUuid) return;
|
|
920
|
-
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-
|
|
901
|
+
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-Ds48FtEu.js").then((n) => n.n);
|
|
921
902
|
registerSignalQuestionReactionTargetForDeliveredPayload({
|
|
922
903
|
cfg: params.cfg,
|
|
923
904
|
target: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as signalPlugin } from "./channel-
|
|
1
|
+
import { t as signalPlugin } from "./channel-CBIljGCH.js";
|
|
2
2
|
export { signalPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as resolveSignalAccount, n as listSignalAccountIds } from "./accounts-DrStJjiK.js";
|
|
2
|
-
import { c as signalNumberTextInput, i as createSignalCliPathTextInput, o as signalCompletionNote, s as signalDmPolicy } from "./channel-
|
|
2
|
+
import { c as signalNumberTextInput, i as createSignalCliPathTextInput, o as signalCompletionNote, s as signalDmPolicy } from "./channel-CBIljGCH.js";
|
|
3
3
|
import { i as installSignalCli } from "./install-signal-cli-qJF7iC4h.js";
|
|
4
4
|
import { detectBinary } from "openclaw/plugin-sdk/setup-tools";
|
|
5
5
|
import { createDetectedBinaryStatus, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { detectMime, parseMediaContentLength } from "openclaw/plugin-sdk/media-runtime";
|
|
2
2
|
import { parseStrictNonNegativeInteger, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
3
3
|
import nodePath from "node:path";
|
|
4
|
+
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
4
5
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
5
6
|
import { readResponseTextPrefix, readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
6
7
|
import { readRegularFile } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -9,7 +10,6 @@ import { Buffer as Buffer$1 } from "node:buffer";
|
|
|
9
10
|
import http from "node:http";
|
|
10
11
|
import https from "node:https";
|
|
11
12
|
import { generateSecureUuid } from "openclaw/plugin-sdk/core";
|
|
12
|
-
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
//#region extensions/signal/src/client-container.ts
|
|
14
14
|
/**
|
|
15
15
|
* Signal client for bbernhard/signal-cli-rest-api container.
|
|
@@ -313,7 +313,7 @@ async function streamContainerEvents(params) {
|
|
|
313
313
|
if (settled) return;
|
|
314
314
|
settled = true;
|
|
315
315
|
cleanup();
|
|
316
|
-
reject(
|
|
316
|
+
reject(toErrorObject(error, "Signal WebSocket receive handler failed"));
|
|
317
317
|
};
|
|
318
318
|
try {
|
|
319
319
|
ws = new WebSocket(wsUrl, {
|
|
@@ -322,7 +322,7 @@ async function streamContainerEvents(params) {
|
|
|
322
322
|
});
|
|
323
323
|
} catch (err) {
|
|
324
324
|
logError(`[signal-ws] failed to create WebSocket: ${err instanceof Error ? err.message : String(err)}`);
|
|
325
|
-
reject(
|
|
325
|
+
reject(toErrorObject(err, "Non-Error rejection"));
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
ws.on("open", () => {
|
|
@@ -634,13 +634,6 @@ async function containerRpcRequest(method, params, opts) {
|
|
|
634
634
|
default: throw new Error(`Unsupported container RPC method: ${method}`);
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
function toLintErrorObject$1(value, fallbackMessage) {
|
|
638
|
-
if (value instanceof Error) return value;
|
|
639
|
-
if (typeof value === "string") return new Error(value);
|
|
640
|
-
const error = new Error(fallbackMessage, { cause: value });
|
|
641
|
-
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
642
|
-
return error;
|
|
643
|
-
}
|
|
644
637
|
//#endregion
|
|
645
638
|
//#region extensions/signal/src/client.ts
|
|
646
639
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -712,7 +705,7 @@ function requestSignalHttpText(url, options) {
|
|
|
712
705
|
if (settled) return;
|
|
713
706
|
settled = true;
|
|
714
707
|
cleanup();
|
|
715
|
-
reject(
|
|
708
|
+
reject(toErrorObject(error, "Non-Error rejection"));
|
|
716
709
|
};
|
|
717
710
|
const resolveOnce = (response) => {
|
|
718
711
|
if (settled) return;
|
|
@@ -832,7 +825,7 @@ function openSignalEventStream(url, abortSignal, timeoutMs = DEFAULT_TIMEOUT_MS)
|
|
|
832
825
|
if (settled) return;
|
|
833
826
|
settled = true;
|
|
834
827
|
cleanup();
|
|
835
|
-
reject(
|
|
828
|
+
reject(toErrorObject(error, "Non-Error rejection"));
|
|
836
829
|
};
|
|
837
830
|
const request = client.request(url, {
|
|
838
831
|
method: "GET",
|
|
@@ -936,12 +929,5 @@ async function streamSignalEvents(params) {
|
|
|
936
929
|
}
|
|
937
930
|
await flushEvent();
|
|
938
931
|
}
|
|
939
|
-
function toLintErrorObject(value, fallbackMessage) {
|
|
940
|
-
if (value instanceof Error) return value;
|
|
941
|
-
if (typeof value === "string") return new Error(value);
|
|
942
|
-
const error = new Error(fallbackMessage, { cause: value });
|
|
943
|
-
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
944
|
-
return error;
|
|
945
|
-
}
|
|
946
932
|
//#endregion
|
|
947
933
|
export { containerRpcRequest as a, containerCheck as i, signalRpcRequest as n, streamContainerEvents as o, streamSignalEvents as r, signalCheck as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as containerRpcRequest, i as containerCheck, n as signalRpcRequest$1, o as streamContainerEvents, r as streamSignalEvents$1, t as signalCheck$1 } from "./client-
|
|
1
|
+
import { a as containerRpcRequest, i as containerCheck, n as signalRpcRequest$1, o as streamContainerEvents, r as streamSignalEvents$1, t as signalCheck$1 } from "./client-BazXTH7O.js";
|
|
2
2
|
//#region extensions/signal/src/client-adapter.ts
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
4
4
|
function formatErrorMessage(error) {
|
|
@@ -2,12 +2,12 @@ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
|
2
2
|
import { i as resolveSignalAccount, o as resolveSignalReplyToMode } from "./accounts-DrStJjiK.js";
|
|
3
3
|
import { a as normalizeSignalAllowRecipient, c as resolveSignalSender, d as normalizeSignalMessagingTarget, i as isSignalSenderAllowed, l as looksLikeUuid, n as formatSignalSenderDisplay, o as resolveSignalPeerId, r as formatSignalSenderId, s as resolveSignalRecipient, t as formatSignalPairingIdLine } from "./identity-BQ4OzXXk.js";
|
|
4
4
|
import { t as getOptionalSignalRuntime } from "./runtime-JPrGlV7h.js";
|
|
5
|
-
import { i as materializeSignalPresentationFallback, n as registerSignalReplyContext, o as resolveSignalReactionLevel, s as formatSignalMediaText, u as isSignalNativeApprovalHandlerConfigured } from "./transport-detection-
|
|
6
|
-
import { n as signalRpcRequest, r as streamSignalEvents, t as signalCheck } from "./client-adapter-
|
|
7
|
-
import { n as sendReactionSignal } from "./reaction-runtime-api-
|
|
8
|
-
import { a as maybeResolveSignalApprovalReaction, l as resolveSignalApprovalConversationKey, s as registerSignalApprovalReactionTargetForDeliveredPayload, t as addSignalApprovalReactionHintToStructuredPayload } from "./approval-reactions-
|
|
9
|
-
import { r as registerSignalQuestionReactionTargetForDeliveredPayload, t as maybeResolveSignalQuestionReaction } from "./question-reactions-
|
|
10
|
-
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
5
|
+
import { i as materializeSignalPresentationFallback, n as registerSignalReplyContext, o as resolveSignalReactionLevel, s as formatSignalMediaText, u as isSignalNativeApprovalHandlerConfigured } from "./transport-detection-Da06-LOL.js";
|
|
6
|
+
import { n as signalRpcRequest, r as streamSignalEvents, t as signalCheck } from "./client-adapter-mXGeEHQJ.js";
|
|
7
|
+
import { n as sendReactionSignal } from "./reaction-runtime-api-BjeDyKcz.js";
|
|
8
|
+
import { a as maybeResolveSignalApprovalReaction, l as resolveSignalApprovalConversationKey, s as registerSignalApprovalReactionTargetForDeliveredPayload, t as addSignalApprovalReactionHintToStructuredPayload } from "./approval-reactions-DtL47gSK.js";
|
|
9
|
+
import { r as registerSignalQuestionReactionTargetForDeliveredPayload, t as maybeResolveSignalQuestionReaction } from "./question-reactions-Ds48FtEu.js";
|
|
10
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-B_Ks4MZr.js";
|
|
11
11
|
import { bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createChannelMessageReplyPipeline, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
12
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
13
13
|
import { detectMime, estimateBase64DecodedBytes, kindFromMime, saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
|
|
@@ -17,8 +17,8 @@ import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plu
|
|
|
17
17
|
import { normalizeE164, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
18
18
|
import { buildChannelInboundEventContext, buildMentionRegexes, createChannelInboundDebouncer, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, hasVisibleInboundReplyDispatch, logInboundDrop, matchesMentionPatterns, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent, shouldDebounceTextInbound, toHistoryMediaEntries, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
19
19
|
import nodePath from "node:path";
|
|
20
|
-
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
21
20
|
import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
21
|
+
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
22
22
|
import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
23
23
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
24
24
|
import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
@@ -34,12 +34,12 @@ import { createInterface } from "node:readline";
|
|
|
34
34
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
35
35
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
36
36
|
import { DEFAULT_EMOJIS, DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, resolveAckReaction, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
37
|
+
import { createChannelIngressResolver, defineStableChannelIngressIdentity, fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
37
38
|
import { isControlCommandMessage } from "openclaw/plugin-sdk/command-detection";
|
|
38
39
|
import { createInternalHookEvent, fireAndForgetHook, toInternalMessageReceivedContext, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
|
|
39
40
|
import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
|
|
40
41
|
import { readSessionUpdatedAt, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
41
42
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
42
|
-
import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
43
43
|
import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
|
|
44
44
|
import { listChatCommands, maybeResolveTextAlias, normalizeCommandBody } from "openclaw/plugin-sdk/command-auth-native";
|
|
45
45
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
@@ -872,45 +872,10 @@ function createSignalEventHandler(deps) {
|
|
|
872
872
|
}
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
|
-
function buildFlushIngressLifecycle(entries) {
|
|
876
|
-
const lifecycles = entries.map((entry) => entry.turnAdoptionLifecycle).filter((lifecycle) => lifecycle !== void 0);
|
|
877
|
-
const [firstLifecycle] = lifecycles;
|
|
878
|
-
if (!firstLifecycle) return {
|
|
879
|
-
lifecycle: void 0,
|
|
880
|
-
settle: async () => {}
|
|
881
|
-
};
|
|
882
|
-
let handedOff = false;
|
|
883
|
-
const adoptAll = async () => {
|
|
884
|
-
for (const lifecycle of lifecycles) await lifecycle.onAdopted();
|
|
885
|
-
};
|
|
886
|
-
return {
|
|
887
|
-
lifecycle: {
|
|
888
|
-
abortSignal: lifecycles.length === 1 ? firstLifecycle.abortSignal : AbortSignal.any(lifecycles.map((lifecycle) => lifecycle.abortSignal)),
|
|
889
|
-
onAdopted: async () => {
|
|
890
|
-
handedOff = true;
|
|
891
|
-
await adoptAll();
|
|
892
|
-
},
|
|
893
|
-
onDeferred: () => {
|
|
894
|
-
handedOff = true;
|
|
895
|
-
for (const lifecycle of lifecycles) lifecycle.onDeferred();
|
|
896
|
-
},
|
|
897
|
-
onAdoptionFinalizing: () => {
|
|
898
|
-
for (const lifecycle of lifecycles) lifecycle.onAdoptionFinalizing();
|
|
899
|
-
},
|
|
900
|
-
onAbandoned: async () => {
|
|
901
|
-
handedOff = true;
|
|
902
|
-
await Promise.all(lifecycles.map((lifecycle) => Promise.resolve(lifecycle.onAbandoned())));
|
|
903
|
-
}
|
|
904
|
-
},
|
|
905
|
-
settle: async () => {
|
|
906
|
-
if (!handedOff) await adoptAll();
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
875
|
async function flushSignalInboundEntries(entries) {
|
|
911
876
|
const last = entries.at(-1);
|
|
912
877
|
if (!last) return;
|
|
913
|
-
const { lifecycle, settle } =
|
|
878
|
+
const { lifecycle, settle } = fanInChannelIngressLifecycles(entries.map((entry) => entry.turnAdoptionLifecycle));
|
|
914
879
|
if (entries.length === 1) {
|
|
915
880
|
await handleSignalInboundMessage(lifecycle ? {
|
|
916
881
|
...last,
|
|
@@ -1,6 +1,7 @@
|
|
|
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-Da06-LOL.js";
|
|
3
|
+
import { n as signalRpcRequest, t as signalCheck } from "./client-adapter-mXGeEHQJ.js";
|
|
4
|
+
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
6
|
//#region extensions/signal/src/probe.ts
|
|
6
7
|
var probe_exports = /* @__PURE__ */ __exportAll({ probeSignal: () => probeSignal });
|
|
@@ -13,46 +14,43 @@ function parseSignalVersion(value) {
|
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
16
|
async function probeSignal(baseUrl, timeoutMs, options = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
return await runChannelProbe(void 0, async () => {
|
|
18
|
+
const result = {
|
|
19
|
+
ok: false,
|
|
20
|
+
status: null,
|
|
21
|
+
error: null,
|
|
22
|
+
version: null
|
|
23
|
+
};
|
|
24
|
+
let transportKind;
|
|
25
|
+
try {
|
|
26
|
+
transportKind = await resolveProbeTransportKind(baseUrl, timeoutMs, options);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return {
|
|
29
|
+
...result,
|
|
30
|
+
error: formatErrorMessage(error)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const check = await signalCheck(baseUrl, timeoutMs, { transportKind });
|
|
34
|
+
if (!check.ok) return {
|
|
35
|
+
...result,
|
|
36
|
+
status: check.status ?? null,
|
|
37
|
+
error: check.error ?? "unreachable"
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
result.version = parseSignalVersion(await signalRpcRequest("version", void 0, {
|
|
41
|
+
baseUrl,
|
|
42
|
+
timeoutMs,
|
|
43
|
+
transportKind
|
|
44
|
+
}));
|
|
45
|
+
} catch (error) {
|
|
46
|
+
result.error = formatErrorMessage(error);
|
|
47
|
+
}
|
|
28
48
|
return {
|
|
29
49
|
...result,
|
|
30
|
-
|
|
31
|
-
|
|
50
|
+
ok: true,
|
|
51
|
+
status: check.status ?? null
|
|
32
52
|
};
|
|
33
|
-
}
|
|
34
|
-
const check = await signalCheck(baseUrl, timeoutMs, { transportKind });
|
|
35
|
-
if (!check.ok) return {
|
|
36
|
-
...result,
|
|
37
|
-
status: check.status ?? null,
|
|
38
|
-
error: check.error ?? "unreachable",
|
|
39
|
-
elapsedMs: Date.now() - started
|
|
40
|
-
};
|
|
41
|
-
try {
|
|
42
|
-
result.version = parseSignalVersion(await signalRpcRequest("version", void 0, {
|
|
43
|
-
baseUrl,
|
|
44
|
-
timeoutMs,
|
|
45
|
-
transportKind
|
|
46
|
-
}));
|
|
47
|
-
} catch (err) {
|
|
48
|
-
result.error = formatErrorMessage(err);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
...result,
|
|
52
|
-
ok: true,
|
|
53
|
-
status: check.status ?? null,
|
|
54
|
-
elapsedMs: Date.now() - started
|
|
55
|
-
};
|
|
53
|
+
});
|
|
56
54
|
}
|
|
57
55
|
async function resolveProbeTransportKind(baseUrl, timeoutMs, options) {
|
|
58
56
|
if (options.transportKind) return options.transportKind;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { o as resolveSignalTarget } from "./runtime-JPrGlV7h.js";
|
|
3
|
-
import { l as resolveSignalApprovalConversationKey, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-
|
|
3
|
+
import { l as resolveSignalApprovalConversationKey, u as resolveSignalApprovalTargetAuthorKeys } from "./approval-reactions-DtL47gSK.js";
|
|
4
4
|
import { 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,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-mXGeEHQJ.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";
|
|
@@ -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-BjeDyKcz.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-
|
|
4
|
+
import { a as signalMessageActions, o as resolveSignalReactionLevel } from "./transport-detection-Da06-LOL.js";
|
|
5
|
+
import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BjeDyKcz.js";
|
|
6
6
|
import { n as SignalConfigSchema } from "./config-schema-DLvpQPN5.js";
|
|
7
7
|
import { i as installSignalCli } from "./install-signal-cli-qJF7iC4h.js";
|
|
8
|
-
import { t as monitorSignalProvider } from "./monitor-
|
|
9
|
-
import { t as sendMessageSignal } from "./send-
|
|
10
|
-
import { t as probeSignal } from "./probe-
|
|
8
|
+
import { t as monitorSignalProvider } from "./monitor-CHBkf7lk.js";
|
|
9
|
+
import { t as sendMessageSignal } from "./send-B_Ks4MZr.js";
|
|
10
|
+
import { t as probeSignal } from "./probe-Br9abaGp.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,15 +1,32 @@
|
|
|
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-Da06-LOL.js";
|
|
4
|
+
import { n as signalRpcRequest } from "./client-adapter-mXGeEHQJ.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-DtL47gSK.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";
|
|
10
10
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
12
12
|
//#region extensions/signal/src/send.ts
|
|
13
|
+
function assertSignalRecipientDelivery(result, target) {
|
|
14
|
+
if (!Array.isArray(result?.results)) return;
|
|
15
|
+
const failures = [];
|
|
16
|
+
let hasSuccessfulRecipient = false;
|
|
17
|
+
for (const entry of result.results) {
|
|
18
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
19
|
+
const record = entry;
|
|
20
|
+
const type = normalizeOptionalString(record.type);
|
|
21
|
+
if (type && normalizeLowercaseStringOrEmpty(type) !== "success" || record.success === false) {
|
|
22
|
+
failures.push(type ?? normalizeOptionalString(record.error) ?? normalizeOptionalString(record.message) ?? "recipient delivery failed");
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (normalizeLowercaseStringOrEmpty(type) === "success" || record.success === true) hasSuccessfulRecipient = true;
|
|
26
|
+
}
|
|
27
|
+
if (failures.length === 0 || target.type === "group" && hasSuccessfulRecipient) return;
|
|
28
|
+
throw new Error(`Signal send failed for ${failures.length} recipient${failures.length === 1 ? "" : "s"}: ${[...new Set(failures)].join(", ")}`);
|
|
29
|
+
}
|
|
13
30
|
async function resolveSignalRpcAccountInfo(opts) {
|
|
14
31
|
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.");
|
|
15
32
|
return resolveSignalAccount({
|
|
@@ -184,6 +201,7 @@ async function sendMessageSignal(to, text, opts) {
|
|
|
184
201
|
nativeReplyStatus = "fallback";
|
|
185
202
|
}
|
|
186
203
|
else result = await signalRpcRequest("send", params, sendOpts);
|
|
204
|
+
assertSignalRecipientDelivery(result, target);
|
|
187
205
|
const timestamp = result?.timestamp;
|
|
188
206
|
const messageId = timestamp ? String(timestamp) : "unknown";
|
|
189
207
|
const replyAuthor = targetAuthor ?? targetAuthorUuid;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-
|
|
1
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-B_Ks4MZr.js";
|
|
2
2
|
export { sendMessageSignal, sendTypingSignal };
|
|
@@ -2,17 +2,17 @@ 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-BjeDyKcz.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";
|
|
9
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
|
-
import { markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithAttributedRanges } from "openclaw/plugin-sdk/text-chunking";
|
|
12
|
+
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithAttributedRanges } from "openclaw/plugin-sdk/text-chunking";
|
|
13
13
|
import { createChannelApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
14
14
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
15
|
-
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, createNativeApprovalChannelRouteGates, createNativeApprovalForwardingFallbackSuppressor, shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
15
|
+
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, createNativeApprovalChannelRouteGates, createNativeApprovalForwardingFallbackSuppressor, createNativeApprovalMessagingTargetResolvers, 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";
|
|
@@ -21,38 +21,16 @@ import { getExecApprovalReplyMetadata } from "openclaw/plugin-sdk/approval-reply
|
|
|
21
21
|
import { isMessagePresentationInteractiveBlock, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
22
22
|
//#region extensions/signal/src/approval-native.ts
|
|
23
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
|
+
});
|
|
24
28
|
function isSignalApprovalTransportEnabled(params) {
|
|
25
29
|
return resolveSignalAccount({
|
|
26
30
|
cfg: params.cfg,
|
|
27
31
|
accountId: params.accountId
|
|
28
32
|
}).enabled;
|
|
29
33
|
}
|
|
30
|
-
function normalizeSignalForwardTarget(target) {
|
|
31
|
-
if (normalizeLowercaseStringOrEmpty(target.channel) !== "signal") return null;
|
|
32
|
-
const to = normalizeSignalMessagingTarget(target.to);
|
|
33
|
-
if (!to) return null;
|
|
34
|
-
return {
|
|
35
|
-
to,
|
|
36
|
-
accountId: normalizeOptionalString(target.accountId),
|
|
37
|
-
threadId: target.threadId ?? null
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function resolveTurnSourceSignalOriginTarget(request) {
|
|
41
|
-
if (normalizeLowercaseStringOrEmpty(request.request.turnSourceChannel) !== "signal") return null;
|
|
42
|
-
const to = normalizeSignalMessagingTarget(request.request.turnSourceTo ?? "");
|
|
43
|
-
if (!to) return null;
|
|
44
|
-
return {
|
|
45
|
-
to,
|
|
46
|
-
accountId: normalizeOptionalString(request.request.turnSourceAccountId)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function resolveSessionSignalOriginTarget(sessionTarget) {
|
|
50
|
-
const to = normalizeSignalMessagingTarget(sessionTarget.to);
|
|
51
|
-
return to ? {
|
|
52
|
-
to,
|
|
53
|
-
accountId: normalizeOptionalString(sessionTarget.accountId)
|
|
54
|
-
} : null;
|
|
55
|
-
}
|
|
56
34
|
const { canApprovalPotentiallyRouteToChannel: canApprovalPotentiallyRouteToSignal, canAnyApprovalPotentiallyRouteToChannel: canAnyApprovalPotentiallyRouteToSignal, isNativeApprovalHandlerConfigured: isSignalNativeApprovalHandlerConfiguredBase, isSessionApprovalEligible: isSignalSessionApprovalEligible, shouldHandleApprovalRequest: shouldHandleSignalApprovalRequest } = createNativeApprovalChannelRouteGates({
|
|
57
35
|
channel: "signal",
|
|
58
36
|
defaultForwardingMode: DEFAULT_APPROVAL_FORWARDING_MODE,
|
|
@@ -89,13 +67,7 @@ const resolveSignalOriginTargetBase = createChannelNativeOriginTargetResolver({
|
|
|
89
67
|
shouldHandleRequest: shouldHandleSignalApprovalRequest,
|
|
90
68
|
resolveTurnSourceTarget: resolveTurnSourceSignalOriginTarget,
|
|
91
69
|
resolveSessionTarget: resolveSessionSignalOriginTarget,
|
|
92
|
-
normalizeTarget:
|
|
93
|
-
const to = normalizeSignalMessagingTarget(target.to);
|
|
94
|
-
return to ? {
|
|
95
|
-
...target,
|
|
96
|
-
to
|
|
97
|
-
} : null;
|
|
98
|
-
}
|
|
70
|
+
normalizeTarget: normalizeSignalApprovalTarget
|
|
99
71
|
});
|
|
100
72
|
function isSignalGroupTarget(to) {
|
|
101
73
|
return normalizeLowercaseStringOrEmpty(to).startsWith("group:");
|
|
@@ -218,7 +190,7 @@ const signalApprovalCapability = createChannelApprovalCapability({
|
|
|
218
190
|
approvalKind,
|
|
219
191
|
request
|
|
220
192
|
}),
|
|
221
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
193
|
+
load: async () => (await import("./approval-handler.runtime-C-XYgcxE.js")).signalApprovalNativeRuntime
|
|
222
194
|
})
|
|
223
195
|
});
|
|
224
196
|
//#endregion
|
|
@@ -231,16 +203,10 @@ const SIGNAL_STYLE_MAP = {
|
|
|
231
203
|
code_block: "MONOSPACE",
|
|
232
204
|
spoiler: "SPOILER"
|
|
233
205
|
};
|
|
234
|
-
const SIGNAL_FORMAT_PROFILE = {
|
|
206
|
+
const SIGNAL_FORMAT_PROFILE = FormatCapabilityProfile.define({
|
|
235
207
|
mechanism: "ranges",
|
|
236
208
|
constructs: {
|
|
237
|
-
bold: "native",
|
|
238
|
-
italic: "native",
|
|
239
209
|
underline: "strip",
|
|
240
|
-
strikethrough: "native",
|
|
241
|
-
spoiler: "native",
|
|
242
|
-
codeInline: "native",
|
|
243
|
-
codeBlock: "native",
|
|
244
210
|
codeLanguage: "fallback",
|
|
245
211
|
linkLabel: "fallback",
|
|
246
212
|
heading: "fallback",
|
|
@@ -256,7 +222,7 @@ const SIGNAL_FORMAT_PROFILE = {
|
|
|
256
222
|
limit: 4e3,
|
|
257
223
|
unit: "chars"
|
|
258
224
|
}
|
|
259
|
-
};
|
|
225
|
+
});
|
|
260
226
|
function stripEquivalentSignalLinks(ir) {
|
|
261
227
|
const normalize = (value) => normalizeLowercaseStringOrEmpty(value).replace(/^(?:https?:\/\/)?(?:www\.)?/, "").replace(/\/+$/, "");
|
|
262
228
|
return {
|
|
@@ -667,7 +633,7 @@ const DEFAULT_PROBE_TIMEOUT_MS = 1e4;
|
|
|
667
633
|
async function detectSignalTransport(params) {
|
|
668
634
|
const url = normalizeSignalTransportUrl(params.url);
|
|
669
635
|
const timeoutMs = params.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
670
|
-
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-
|
|
636
|
+
const probes = params.probeNative && params.probeContainer ? void 0 : await import("./transport-probes.runtime-CV6Qs0Og.js");
|
|
671
637
|
const probeNative = params.probeNative ?? probes?.nativeCheck;
|
|
672
638
|
const probeContainer = params.probeContainer ?? probes?.containerCheck;
|
|
673
639
|
if (!probeNative || !probeContainer) throw new Error("Signal transport probes are unavailable");
|
package/dist/{transport-detection.runtime-BgjcIyww.js → transport-detection.runtime-D_190UUL.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as detectSignalTransport } from "./transport-detection-
|
|
1
|
+
import { t as detectSignalTransport } from "./transport-detection-Da06-LOL.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-BazXTH7O.js";
|
|
2
2
|
export { containerCheck, signalCheck as nativeCheck };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/signal",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.5",
|
|
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.7.2-beta.
|
|
96
|
+
"pluginApi": ">=2026.7.2-beta.5"
|
|
97
97
|
},
|
|
98
98
|
"build": {
|
|
99
|
-
"openclawVersion": "2026.7.2-beta.
|
|
99
|
+
"openclawVersion": "2026.7.2-beta.5",
|
|
100
100
|
"bundledDist": false
|
|
101
101
|
},
|
|
102
102
|
"release": {
|
|
@@ -115,11 +115,10 @@
|
|
|
115
115
|
"files": [
|
|
116
116
|
"dist/**",
|
|
117
117
|
"openclaw.plugin.json",
|
|
118
|
-
"npm-shrinkwrap.json",
|
|
119
118
|
"README.md"
|
|
120
119
|
],
|
|
121
120
|
"peerDependencies": {
|
|
122
|
-
"openclaw": ">=2026.7.2-beta.
|
|
121
|
+
"openclaw": ">=2026.7.2-beta.5"
|
|
123
122
|
},
|
|
124
123
|
"peerDependenciesMeta": {
|
|
125
124
|
"openclaw": {
|
package/npm-shrinkwrap.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openclaw/signal",
|
|
3
|
-
"version": "2026.7.2-beta.4",
|
|
4
|
-
"lockfileVersion": 3,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"packages": {
|
|
7
|
-
"": {
|
|
8
|
-
"name": "@openclaw/signal",
|
|
9
|
-
"version": "2026.7.2-beta.4",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"ws": "8.21.1",
|
|
12
|
-
"zod": "4.4.3"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"node_modules/ws": {
|
|
16
|
-
"version": "8.21.1",
|
|
17
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz",
|
|
18
|
-
"integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==",
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": ">=10.0.0"
|
|
22
|
-
},
|
|
23
|
-
"peerDependencies": {
|
|
24
|
-
"bufferutil": "^4.0.1",
|
|
25
|
-
"utf-8-validate": ">=5.0.2"
|
|
26
|
-
},
|
|
27
|
-
"peerDependenciesMeta": {
|
|
28
|
-
"bufferutil": {
|
|
29
|
-
"optional": true
|
|
30
|
-
},
|
|
31
|
-
"utf-8-validate": {
|
|
32
|
-
"optional": true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"node_modules/zod": {
|
|
37
|
-
"version": "4.4.3",
|
|
38
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz",
|
|
39
|
-
"integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"funding": {
|
|
42
|
-
"url": "https://github.com/sponsors/colinhacks"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|