@openclaw/signal 2026.9.1-beta.1 → 2026.9.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-auth-BsYHLTHK.js → approval-auth-pNCKKotV.js} +14 -2
- package/dist/{approval-handler.runtime-COrjDqm1.js → approval-handler.runtime-Dsg_GE8N.js} +8 -4
- package/dist/{approval-reactions-D8x4WFYZ.js → approval-reactions-D-nkbsvm.js} +7 -17
- package/dist/{channel-DBwSJm7U.js → channel-B-A_5_Vz.js} +35 -30
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-DvhLiRgJ.js → channel.runtime-LfE0qPMj.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-D7Slr0-A.js} +99 -69
- package/dist/{probe-C2Z15YNS.js → probe-CtO2EIfg.js} +2 -2
- package/dist/{question-reactions-CkO8Q5i2.js → question-reactions-CsVOpHg_.js} +3 -14
- 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-DuH2ntJt.js} +20 -16
- package/dist/{send.runtime-DolSm_sS.js → send.runtime-BLiqhyHW.js} +1 -1
- package/dist/{transport-detection-B9TcrBCr.js → transport-detection-BcDiypLn.js} +21 -14
- package/dist/{transport-detection.runtime-kDheC5_M.js → transport-detection.runtime-DYuvIa7s.js} +1 -1
- package/dist/transport-probes.runtime-B7kr_6Zu.js +2 -0
- package/openclaw.plugin.json +2 -7
- 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-BcDiypLn.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-B-A_5_Vz.js";
|
|
7
|
+
import { i as installSignalCli } from "./install-signal-cli-7tEL37_j.js";
|
|
8
|
+
import { t as monitorSignalProvider } from "./monitor-D7Slr0-A.js";
|
|
9
|
+
import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-DuH2ntJt.js";
|
|
10
|
+
import { t as probeSignal } from "./probe-CtO2EIfg.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({
|
|
@@ -76,6 +77,17 @@ function resolveSignalTarget(params) {
|
|
|
76
77
|
};
|
|
77
78
|
return null;
|
|
78
79
|
}
|
|
80
|
+
function resolveSignalDeliveredConversationKey(params) {
|
|
81
|
+
try {
|
|
82
|
+
return resolveSignalTarget({
|
|
83
|
+
cfg: params.cfg,
|
|
84
|
+
accountId: params.accountId,
|
|
85
|
+
input: params.to
|
|
86
|
+
})?.to ?? normalizeSignalMessagingTarget(params.to) ?? null;
|
|
87
|
+
} catch {
|
|
88
|
+
return normalizeSignalMessagingTarget(params.to) ?? null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
79
91
|
function listSignalAliasDirectoryEntries(params) {
|
|
80
92
|
const aliases = resolveAliasMap(params);
|
|
81
93
|
const query = normalizeLowercaseStringOrEmpty(params.query);
|
|
@@ -152,4 +164,4 @@ const signalApproval = createChannelApprovalAuth({
|
|
|
152
164
|
const getSignalApprovalApprovers = signalApproval.resolveApprovers;
|
|
153
165
|
const signalApprovalAuth = signalApproval.approvalAuth;
|
|
154
166
|
//#endregion
|
|
155
|
-
export { resolveSignalTarget as i, signalApprovalAuth as n, listSignalAliasDirectoryEntries as r, getSignalApprovalApprovers as t };
|
|
167
|
+
export { resolveSignalTarget as a, resolveSignalDeliveredConversationKey as i, signalApprovalAuth as n, listSignalAliasDirectoryEntries as r, getSignalApprovalApprovers as t };
|
|
@@ -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 {
|
|
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 { a as resolveSignalTarget } from "./approval-auth-pNCKKotV.js";
|
|
4
|
+
import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-D-nkbsvm.js";
|
|
5
|
+
import { r as sendTypingSignal, t as sendMessageSignal } from "./send-DuH2ntJt.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 {
|
|
3
|
+
import { a as resolveSignalTarget, i as resolveSignalDeliveredConversationKey, n as signalApprovalAuth, t as getSignalApprovalApprovers } from "./approval-auth-pNCKKotV.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-BcDiypLn.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,30 +127,20 @@ 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) {
|
|
141
142
|
return normalizeSignalMessagingTarget(to) ?? null;
|
|
142
143
|
}
|
|
143
|
-
function resolveSignalApprovalConversationKeyForDeliveredTarget(params) {
|
|
144
|
-
try {
|
|
145
|
-
return resolveSignalTarget({
|
|
146
|
-
cfg: params.cfg,
|
|
147
|
-
accountId: params.accountId,
|
|
148
|
-
input: params.to
|
|
149
|
-
})?.to ?? resolveSignalApprovalConversationKey(params.to);
|
|
150
|
-
} catch {
|
|
151
|
-
return resolveSignalApprovalConversationKey(params.to);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
144
|
function normalizeSignalApprovalTargetAuthorKey(value) {
|
|
155
145
|
const normalized = normalizeOptionalString(value);
|
|
156
146
|
if (!normalized) return null;
|
|
@@ -280,7 +270,7 @@ function registerSignalApprovalReactionTargetForDeliveredPayload(params) {
|
|
|
280
270
|
cfg: params.cfg,
|
|
281
271
|
accountId: params.target.accountId
|
|
282
272
|
})) return false;
|
|
283
|
-
const conversationKey =
|
|
273
|
+
const conversationKey = resolveSignalDeliveredConversationKey({
|
|
284
274
|
cfg: params.cfg,
|
|
285
275
|
accountId: params.target.accountId,
|
|
286
276
|
to: params.target.to
|
|
@@ -421,7 +411,7 @@ async function maybeResolveSignalApprovalReaction(params) {
|
|
|
421
411
|
return true;
|
|
422
412
|
}
|
|
423
413
|
params.logVerboseMessage?.(`signal: approval reaction failed id=${target.approvalId} sender=${actorId}: ${String(error)}`);
|
|
424
|
-
|
|
414
|
+
throw error;
|
|
425
415
|
}
|
|
426
416
|
}
|
|
427
417
|
function clearSignalApprovalReactionTargetsForTest() {
|
|
@@ -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 {
|
|
4
|
+
import { a as resolveSignalTarget, r as listSignalAliasDirectoryEntries } from "./approval-auth-pNCKKotV.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-BcDiypLn.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-DYuvIa7s.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-LfE0qPMj.js");
|
|
586
587
|
}
|
|
587
588
|
const signalSetupWizard = createSignalSetupWizardProxy(async () => (await loadSignalChannelRuntime()).signalSetupWizard);
|
|
588
589
|
const signalConfigAdapter = {
|
|
@@ -647,7 +648,10 @@ function createSignalPluginBase(params) {
|
|
|
647
648
|
minChars: 1500,
|
|
648
649
|
idleMs: 1e3
|
|
649
650
|
} },
|
|
650
|
-
reload: {
|
|
651
|
+
reload: {
|
|
652
|
+
configPrefixes: ["channels.signal"],
|
|
653
|
+
noopPrefixes: ["messages.inbound", "messages.ackReactionScope"]
|
|
654
|
+
},
|
|
651
655
|
configSchema: SignalChannelConfigSchema,
|
|
652
656
|
doctor: signalDoctor,
|
|
653
657
|
config: {
|
|
@@ -667,17 +671,16 @@ function createSignalPluginBase(params) {
|
|
|
667
671
|
}
|
|
668
672
|
//#endregion
|
|
669
673
|
//#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-
|
|
674
|
+
const loadSignalMonitorModule = createLazyRuntimeModule(() => import("./monitor-D7Slr0-A.js").then((n) => n.n));
|
|
675
|
+
const loadSignalProbeModule = createLazyRuntimeModule(() => import("./probe-CtO2EIfg.js").then((n) => n.n));
|
|
676
|
+
const loadSignalSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-BLiqhyHW.js"));
|
|
677
|
+
const loadSignalApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-D-nkbsvm.js").then((n) => n.n));
|
|
674
678
|
async function resolveSignalSendContext(params) {
|
|
675
679
|
return {
|
|
676
680
|
send: resolveOutboundSendDep(params.deps, "signal") ?? (await loadSignalSendRuntime()).sendMessageSignal,
|
|
677
681
|
maxBytes: resolveChannelMediaMaxBytes({
|
|
678
682
|
cfg: params.cfg,
|
|
679
|
-
resolveChannelLimitMb: (
|
|
680
|
-
accountId: params.accountId
|
|
683
|
+
resolveChannelLimitMb: () => resolveSignalAccount(params).config.mediaMaxMb
|
|
681
684
|
})
|
|
682
685
|
};
|
|
683
686
|
}
|
|
@@ -836,14 +839,15 @@ async function sendFormattedSignalText(ctx) {
|
|
|
836
839
|
accountId: ctx.accountId,
|
|
837
840
|
replyToId
|
|
838
841
|
});
|
|
839
|
-
const
|
|
842
|
+
const result = await send(to, chunk.text, {
|
|
840
843
|
cfg: ctx.cfg,
|
|
841
844
|
maxBytes,
|
|
842
845
|
accountId: ctx.accountId ?? void 0,
|
|
843
846
|
textMode: "plain",
|
|
844
847
|
textStyles: chunk.styles,
|
|
845
848
|
...replyOptions
|
|
846
|
-
})
|
|
849
|
+
});
|
|
850
|
+
const deliveryResult = attachChannelToResult("signal", attachSignalVisibleText(result, chunk.text));
|
|
847
851
|
results.push(deliveryResult);
|
|
848
852
|
await ctx.onDeliveryResult?.(deliveryResult);
|
|
849
853
|
}
|
|
@@ -876,7 +880,7 @@ async function sendFormattedSignalMedia(ctx) {
|
|
|
876
880
|
accountId: ctx.accountId,
|
|
877
881
|
replyToId: ctx.replyToId
|
|
878
882
|
});
|
|
879
|
-
|
|
883
|
+
const result = await send(to, formatted.text, {
|
|
880
884
|
cfg: ctx.cfg,
|
|
881
885
|
mediaUrl: ctx.mediaUrl,
|
|
882
886
|
...ctx.mediaAccess ? { mediaAccess: ctx.mediaAccess } : {},
|
|
@@ -887,7 +891,8 @@ async function sendFormattedSignalMedia(ctx) {
|
|
|
887
891
|
textMode: "plain",
|
|
888
892
|
textStyles: formatted.styles,
|
|
889
893
|
...replyOptions
|
|
890
|
-
})
|
|
894
|
+
});
|
|
895
|
+
return attachChannelToResult("signal", attachSignalVisibleText(result, formatted.text));
|
|
891
896
|
}
|
|
892
897
|
async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
893
898
|
const account = resolveSignalAccount({
|
|
@@ -897,7 +902,7 @@ async function registerDeliveredSignalApprovalPayloadForReactions(params) {
|
|
|
897
902
|
const targetAuthor = normalizeOptionalString(account.config.account);
|
|
898
903
|
const targetAuthorUuid = normalizeOptionalString(account.config.accountUuid);
|
|
899
904
|
if (!targetAuthor && !targetAuthorUuid) return;
|
|
900
|
-
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-
|
|
905
|
+
const { registerSignalQuestionReactionTargetForDeliveredPayload } = await import("./question-reactions-CsVOpHg_.js").then((n) => n.n);
|
|
901
906
|
registerSignalQuestionReactionTargetForDeliveredPayload({
|
|
902
907
|
cfg: params.cfg,
|
|
903
908
|
target: {
|
|
@@ -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-B-A_5_Vz.js";
|
|
2
2
|
export { signalPlugin };
|
|
@@ -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-B-A_5_Vz.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,
|