@openclaw/signal 2026.6.11 → 2026.7.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,8 @@ function mergeSignalAccountConfig(cfg, accountId) {
8
8
  return resolveMergedAccountConfig({
9
9
  channelConfig: cfg.channels?.signal,
10
10
  accounts: cfg.channels?.signal?.accounts,
11
- accountId
11
+ accountId,
12
+ nestedObjectKeys: ["aliases"]
12
13
  });
13
14
  }
14
15
  function resolveSignalAccount(params) {
package/dist/api.js CHANGED
@@ -1,12 +1,12 @@
1
- import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-hOCHbEhX.js";
1
+ import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId, t as listEnabledSignalAccounts } from "./accounts-B7Rz3_xV.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-B6O4k8xg.js";
3
- import { i as markdownToSignalTextChunks, n as resolveSignalReactionLevel, r as markdownToSignalText, t as signalMessageActions } from "./message-actions-Bue0g2Kc.js";
4
- import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-C_PQ45D9.js";
5
- import { a as normalizeSignalAccountInput, l as signalSetupAdapter, n as createSignalPluginBase, r as signalSetupWizard, t as signalPlugin, u as resolveSignalOutboundTarget } from "./channel-LmY2UpOt.js";
6
- import { a as looksLikeArchive, n as extractSignalCliArchive, o as pickAsset, r as installSignalCli } from "./install-signal-cli-CXgTF3de.js";
7
- import { t as monitorSignalProvider } from "./monitor-CUhIKHJo.js";
8
- import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-CBlFUkY_.js";
9
- import { t as probeSignal } from "./probe-BQ_Izoya.js";
3
+ import { i as markdownToSignalTextChunks, n as resolveSignalReactionLevel, r as markdownToSignalText, t as signalMessageActions } from "./message-actions-Cs9XckSd.js";
4
+ import { n as sendReactionSignal, t as removeReactionSignal } from "./reaction-runtime-api-BkAxQPGs.js";
5
+ import { a as normalizeSignalAccountInput, l as signalSetupAdapter, n as createSignalPluginBase, r as signalSetupWizard, t as signalPlugin, u as resolveSignalOutboundTarget } from "./channel-BfWp-F-r.js";
6
+ import { a as looksLikeArchive, n as extractSignalCliArchive, o as pickAsset, r as installSignalCli } from "./install-signal-cli-TwhJ0DGy.js";
7
+ import { t as monitorSignalProvider } from "./monitor-C9SiyrFt.js";
8
+ import { n as sendReadReceiptSignal, r as sendTypingSignal, t as sendMessageSignal } from "./send-CLzc3RUg.js";
9
+ import { t as probeSignal } from "./probe-BL2BqTbG.js";
10
10
  //#region extensions/signal/src/channel.setup.ts
11
11
  const signalSetupPlugin = { ...createSignalPluginBase({
12
12
  setupWizard: signalSetupWizard,
@@ -0,0 +1,151 @@
1
+ import { i as resolveSignalAccount } from "./accounts-B7Rz3_xV.js";
2
+ import { d as normalizeSignalMessagingTarget, l as looksLikeUuid, u as looksLikeSignalTargetId } from "./identity-B6O4k8xg.js";
3
+ import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
5
+ import { normalizeE164 } from "openclaw/plugin-sdk/text-utility-runtime";
6
+ //#region extensions/signal/src/aliases.ts
7
+ function normalizeAliasKey(raw) {
8
+ const trimmed = raw.trim();
9
+ if (!trimmed) return;
10
+ return normalizeLowercaseStringOrEmpty(/^signal:/i.test(trimmed) ? trimmed.slice(7).trim() : trimmed) || void 0;
11
+ }
12
+ function resolveAliasMap(params) {
13
+ const account = resolveSignalAccount({
14
+ cfg: params.cfg,
15
+ accountId: params.accountId
16
+ });
17
+ const aliases = /* @__PURE__ */ new Map();
18
+ for (const [rawKey, rawValue] of Object.entries(account.config.aliases ?? {})) {
19
+ const key = normalizeAliasKey(rawKey);
20
+ if (!key) continue;
21
+ aliases.set(key, rawValue);
22
+ }
23
+ return aliases;
24
+ }
25
+ function resolveTargetKind(target) {
26
+ return normalizeLowercaseStringOrEmpty(target).startsWith("group:") ? "group" : "user";
27
+ }
28
+ function resolveRawSignalTarget(input) {
29
+ const normalized = normalizeSignalMessagingTarget(input);
30
+ if (!normalized || !looksLikeSignalTargetId(input, normalized)) return null;
31
+ return {
32
+ to: normalized,
33
+ kind: resolveTargetKind(normalized)
34
+ };
35
+ }
36
+ function resolveSignalAliasTargetFromMap(params) {
37
+ const initialAlias = normalizeAliasKey(params.input);
38
+ if (!initialAlias || !params.aliases.has(initialAlias)) return null;
39
+ const visited = /* @__PURE__ */ new Set();
40
+ let alias = initialAlias;
41
+ for (;;) {
42
+ if (visited.has(alias)) throw new Error(`Signal alias "${initialAlias}" resolves recursively through "${alias}".`);
43
+ visited.add(alias);
44
+ const rawValue = params.aliases.get(alias);
45
+ if (typeof rawValue !== "string" || !rawValue.trim()) throw new Error(`Signal alias "${alias}" must point to a non-empty Signal target.`);
46
+ const rawTarget = resolveRawSignalTarget(rawValue);
47
+ if (rawTarget) return {
48
+ ...rawTarget,
49
+ alias: initialAlias
50
+ };
51
+ const nextAlias = normalizeAliasKey(rawValue);
52
+ if (nextAlias && params.aliases.has(nextAlias)) {
53
+ alias = nextAlias;
54
+ continue;
55
+ }
56
+ throw new Error(`Signal alias "${initialAlias}" must point to an E.164 number, uuid:<id>, username:<name>, or group:<id>.`);
57
+ }
58
+ }
59
+ function resolveSignalAliasTarget(params) {
60
+ return resolveSignalAliasTargetFromMap({
61
+ aliases: resolveAliasMap(params),
62
+ input: params.input
63
+ });
64
+ }
65
+ function resolveSignalTarget(params) {
66
+ const rawTarget = resolveRawSignalTarget(params.input);
67
+ if (rawTarget) return {
68
+ ...rawTarget,
69
+ source: "raw"
70
+ };
71
+ const aliasTarget = resolveSignalAliasTarget(params);
72
+ if (aliasTarget) return {
73
+ ...aliasTarget,
74
+ source: "alias"
75
+ };
76
+ return null;
77
+ }
78
+ function listSignalAliasDirectoryEntries(params) {
79
+ const aliases = resolveAliasMap(params);
80
+ const query = normalizeLowercaseStringOrEmpty(params.query);
81
+ const limit = typeof params.limit === "number" && params.limit > 0 ? params.limit : void 0;
82
+ const exactAlias = params.query ? normalizeAliasKey(params.query) : void 0;
83
+ if (exactAlias && aliases.has(exactAlias)) {
84
+ const target = resolveSignalAliasTargetFromMap({
85
+ aliases,
86
+ input: exactAlias
87
+ });
88
+ if (target?.kind === params.kind) return [{
89
+ kind: params.kind,
90
+ id: target.to,
91
+ name: target.alias
92
+ }];
93
+ if (target) return [];
94
+ }
95
+ const entries = [];
96
+ for (const alias of aliases.keys()) {
97
+ let target;
98
+ try {
99
+ target = resolveSignalAliasTargetFromMap({
100
+ aliases,
101
+ input: alias
102
+ });
103
+ } catch {
104
+ continue;
105
+ }
106
+ if (!target) continue;
107
+ if (target.kind !== params.kind) continue;
108
+ if (query && !alias.includes(query) && !normalizeLowercaseStringOrEmpty(target.to).includes(query)) continue;
109
+ entries.push({
110
+ kind: params.kind,
111
+ id: target.to,
112
+ name: alias
113
+ });
114
+ if (typeof limit === "number" && entries.length >= limit) break;
115
+ }
116
+ return entries;
117
+ }
118
+ //#endregion
119
+ //#region extensions/signal/src/approval-auth.ts
120
+ function normalizeSignalApproverId(value) {
121
+ const normalized = normalizeSignalMessagingTarget(String(value));
122
+ if (!normalized || normalized.startsWith("group:") || normalized.startsWith("username:")) return;
123
+ if (looksLikeUuid(normalized)) return `uuid:${normalized}`;
124
+ const e164 = normalizeE164(normalized);
125
+ return e164.length > 1 ? e164 : void 0;
126
+ }
127
+ function getSignalApprovalApprovers(params) {
128
+ const account = resolveSignalAccount(params).config;
129
+ let defaultTo = account.defaultTo;
130
+ if (typeof account.defaultTo === "string") try {
131
+ defaultTo = resolveSignalTarget({
132
+ cfg: params.cfg,
133
+ accountId: params.accountId,
134
+ input: account.defaultTo
135
+ })?.to ?? account.defaultTo;
136
+ } catch {
137
+ defaultTo = account.defaultTo;
138
+ }
139
+ return resolveApprovalApprovers({
140
+ allowFrom: account.allowFrom,
141
+ defaultTo,
142
+ normalizeApprover: normalizeSignalApproverId
143
+ });
144
+ }
145
+ const signalApprovalAuth = createResolvedApproverActionAuthAdapter({
146
+ channelLabel: "Signal",
147
+ resolveApprovers: getSignalApprovalApprovers,
148
+ normalizeSenderId: (value) => normalizeSignalApproverId(value)
149
+ });
150
+ //#endregion
151
+ export { resolveSignalTarget as i, signalApprovalAuth as n, listSignalAliasDirectoryEntries as r, getSignalApprovalApprovers as t };
@@ -1,5 +1,8 @@
1
+ import { r as resolveDefaultSignalAccountId } from "./accounts-B7Rz3_xV.js";
1
2
  import { d as normalizeSignalMessagingTarget } from "./identity-B6O4k8xg.js";
2
- import { c as resolveSignalApprovalTargetAuthorKeys, i as hasSignalApprovalReactionApprovers, l as unregisterSignalApprovalReactionTarget, o as registerSignalApprovalReactionTarget, r as sendTypingSignal, s as resolveSignalApprovalConversationKey, t as sendMessageSignal } from "./send-CBlFUkY_.js";
3
+ import { i as resolveSignalTarget } from "./approval-auth-DPVK9A_l.js";
4
+ import { a as registerSignalApprovalReactionTarget, c as resolveSignalApprovalTargetAuthorKeys, l as unregisterSignalApprovalReactionTarget, r as hasSignalApprovalReactionApprovers, s as resolveSignalApprovalConversationKey } from "./approval-reactions-5x1kmQEq.js";
5
+ import { r as sendTypingSignal, t as sendMessageSignal } from "./send-CLzc3RUg.js";
3
6
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
4
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
8
  import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
@@ -48,8 +51,28 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
48
51
  })
49
52
  },
50
53
  transport: {
51
- prepareTarget: ({ plannedTarget, accountId, context }) => {
52
- const to = normalizeSignalMessagingTarget(plannedTarget.target.to);
54
+ prepareTarget: ({ cfg, plannedTarget, accountId, context }) => {
55
+ const plannedAccountId = plannedTarget.target.accountId;
56
+ const explicitAccountId = resolvePreparedApprovalAccountId({
57
+ plannedAccountId,
58
+ contextAccountId: accountId
59
+ });
60
+ const preparedAccountId = resolvePreparedApprovalAccountId({
61
+ plannedAccountId,
62
+ contextAccountId: accountId,
63
+ fallbackAccountId: cfg ? resolveDefaultSignalAccountId(cfg) : DEFAULT_ACCOUNT_ID
64
+ });
65
+ const rawTo = plannedTarget.target.to;
66
+ let to = normalizeSignalMessagingTarget(rawTo);
67
+ if (cfg) try {
68
+ to = resolveSignalTarget({
69
+ cfg,
70
+ accountId: explicitAccountId,
71
+ input: rawTo
72
+ })?.to ?? to;
73
+ } catch {
74
+ return null;
75
+ }
53
76
  if (!to) return null;
54
77
  const runtimeContext = readSignalApprovalRuntimeContext(context);
55
78
  const targetAuthorKeys = resolveSignalApprovalTargetAuthorKeys({
@@ -58,11 +81,7 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
58
81
  });
59
82
  const prepared = {
60
83
  to,
61
- accountId: resolvePreparedApprovalAccountId({
62
- plannedAccountId: plannedTarget.target.accountId,
63
- contextAccountId: accountId,
64
- fallbackAccountId: DEFAULT_ACCOUNT_ID
65
- }),
84
+ accountId: preparedAccountId,
66
85
  ...runtimeContext.baseUrl ? { baseUrl: runtimeContext.baseUrl } : {},
67
86
  ...runtimeContext.account ? { account: runtimeContext.account } : {},
68
87
  ...runtimeContext.accountUuid ? { accountUuid: runtimeContext.accountUuid } : {},
@@ -124,6 +143,7 @@ const signalApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
124
143
  conversationKey: entry.conversationKey,
125
144
  messageId: entry.messageId,
126
145
  approvalId: request.id,
146
+ approvalKind: view.approvalKind,
127
147
  allowedDecisions: pendingPayload.reactionPayload.allowedDecisions,
128
148
  targetAuthorKeys: entry.targetAuthorKeys,
129
149
  route: {