@openclaw/imessage 2026.11.1 → 2026.11.3
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/.setup/{accounts-BH0coL46.mjs → accounts-DacCvDBt.mjs} +6 -3
- package/dist/.setup/{actions-CI-2gslW.mjs → actions-FOjSVXxg.mjs} +63 -13
- package/dist/.setup/{actions.runtime-Cv8J2DCK.mjs → actions.runtime-Mh1ED1Pq.mjs} +9 -6
- package/dist/.setup/{api-LHNeKI7K.mjs → api-BpfhqSA4.mjs} +9 -9
- package/dist/.setup/{api-DomgyOq_.mjs → api-BvfhvRlZ.mjs} +9 -8
- package/dist/.setup/{approval-handler.runtime-J_1w5ZFh.mjs → approval-handler.runtime-Bes82dAn.mjs} +11 -10
- package/dist/.setup/{approval-reactions-U8Ku77_2.mjs → approval-reactions-g1TDaSN2.mjs} +12 -9
- package/dist/.setup/{channel-DLQr-Gbj.mjs → channel-BtDnHgzF.mjs} +34 -23
- package/dist/.setup/{channel.runtime-PU6bZMXQ.mjs → channel.runtime-BomnjKt2.mjs} +80 -57
- package/dist/.setup/{client-CKDbW7i2.mjs → client-DlNC08mM.mjs} +25 -12
- package/dist/.setup/{config-schema-DRkdRC21.mjs → config-schema-DXwa_3V5.mjs} +4 -2
- package/dist/.setup/{conversation-bindings-vZFn6sN2.mjs → conversation-bindings-DR-dbHjs.mjs} +2 -1
- package/dist/.setup/{media-contract-CoixpXRX.mjs → media-contract-BwWs5PM7.mjs} +3 -2
- package/dist/.setup/{message-tool-api-CxSY_rh7.mjs → message-tool-api-B5NfPnFL.mjs} +8 -5
- package/dist/.setup/{outbound-send-deps-_da8jqeo.mjs → outbound-send-deps-B-QEsLSM.mjs} +2 -1
- package/dist/.setup/{question-reactions-CggXC4jv.mjs → question-reactions-CgZKeyy3.mjs} +5 -4
- package/dist/.setup/{reaction-context-k7ftOZLV.mjs → reaction-context-7yLnHd5m.mjs} +3 -2
- package/dist/.setup/{remote-file-C3WVb0XZ.mjs → remote-file-D8UX85bK.mjs} +10 -6
- package/dist/.setup/{rolldown-runtime-782esTHO.mjs → rolldown-runtime-BBjsoOtd.mjs} +2 -1
- package/dist/.setup/{runtime-BRQCPuAD.mjs → runtime-Cza4CY5T.mjs} +2 -1
- package/dist/.setup/{sanitize-outbound-C02fJrn6.mjs → sanitize-outbound-BtEY324R.mjs} +4 -2
- package/dist/.setup/{send-COiAb1TU.mjs → send-D44ovNNq.mjs} +24 -14
- package/dist/.setup/{setup-core-BWnW0czE.mjs → setup-core-BHyLkAEJ.mjs} +4 -3
- package/dist/.setup/{setup-surface-aRZhAzzQ.mjs → setup-surface-DPqiLGy0.mjs} +6 -4
- package/dist/.setup/{targets-CIx4BKqL.mjs → targets-B4oU7n-v.mjs} +6 -3
- package/dist/api.js +9 -9
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/contract-api.js +2 -1
- package/dist/doctor-contract-api.js +13 -7
- package/dist/index.js +2 -1
- package/dist/media-contract-api.js +2 -1
- package/dist/message-tool-api.js +2 -1
- package/dist/runtime-api.js +2 -2
- package/dist/secret-contract-api.js +2 -1
- package/dist/session-binding-contract-api.js +2 -1
- package/dist/setup-entry.js +3 -2
- package/dist/src/chat-db.worker.js +3 -2
- package/package.json +4 -4
- package/dist/.source-module-urls/929c518fa2986b0f85f66bceefead22868db0ab452dee914dc6a2bb86b2e60ad.json +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { c as parseIMessageTarget, o as normalizeIMessageHandle, r as isAllowedIMessageReplyContextSender, s as parseIMessageAllowTarget, t as formatIMessageChatTarget } from "./targets-
|
|
2
|
-
import { d as resolveIMessageChatDbLookupPath, f as resolveIMessageHomeDir, l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-
|
|
3
|
-
import { r as imessageRpcSupportsMethod } from "./message-tool-api-
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as getIMessageRuntime } from "./runtime-
|
|
7
|
-
import { a as resolveIMessageGroupSystemPrompt, s as resolveIMessageInboundConversationId } from "./channel-
|
|
8
|
-
import { r as sanitizeOutboundText } from "./sanitize-outbound-
|
|
9
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-
|
|
10
|
-
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-
|
|
11
|
-
import { i as resolveIMessageStartupRowidWatermark } from "./remote-file-
|
|
12
|
-
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction } from "./approval-reactions-
|
|
13
|
-
import { n as hasPersistedIMessageEcho, r as normalizeIMessageEchoText, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-
|
|
14
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-
|
|
15
|
-
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-
|
|
16
|
-
import { imessageSetupWizard } from "./setup-surface-
|
|
1
|
+
import { c as parseIMessageTarget, o as normalizeIMessageHandle, r as isAllowedIMessageReplyContextSender, s as parseIMessageAllowTarget, t as formatIMessageChatTarget } from "./targets-B4oU7n-v.mjs";
|
|
2
|
+
import { d as resolveIMessageChatDbLookupPath, f as resolveIMessageHomeDir, l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-DacCvDBt.mjs";
|
|
3
|
+
import { r as imessageRpcSupportsMethod } from "./message-tool-api-B5NfPnFL.mjs";
|
|
4
|
+
import { C as resolveIMessageDirectChatService, c as rememberIMessageReplyCache, d as IMESSAGE_CATCHUP_CURSOR_NAMESPACE, g as resolveIMessageEchoMediaKey, h as resolveIMessageCatchupCursorKey, m as capFailureRetriesMap, n as createIMessageRpcClient, s as isKnownFromMeIMessageTarget } from "./client-DlNC08mM.mjs";
|
|
5
|
+
import { a as probeIMessage, c as normalizeIMessageMessageId, o as probeIMessagePrivateApi, s as normalizeIMessageGuid } from "./actions-FOjSVXxg.mjs";
|
|
6
|
+
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
7
|
+
import { a as resolveIMessageGroupSystemPrompt, s as resolveIMessageInboundConversationId } from "./channel-BtDnHgzF.mjs";
|
|
8
|
+
import { r as sanitizeOutboundText } from "./sanitize-outbound-BtEY324R.mjs";
|
|
9
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-BwWs5PM7.mjs";
|
|
10
|
+
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.mjs";
|
|
11
|
+
import { i as resolveIMessageStartupRowidWatermark } from "./remote-file-D8UX85bK.mjs";
|
|
12
|
+
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction } from "./approval-reactions-g1TDaSN2.mjs";
|
|
13
|
+
import { n as hasPersistedIMessageEcho, r as normalizeIMessageEchoText, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-D44ovNNq.mjs";
|
|
14
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-7yLnHd5m.mjs";
|
|
15
|
+
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-CgZKeyy3.mjs";
|
|
16
|
+
import { imessageSetupWizard } from "./setup-surface-DPqiLGy0.mjs";
|
|
17
17
|
import { asSafeIntegerInRange, hasNonEmptyString, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
18
18
|
import { normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
19
19
|
import { bindIngressLifecycleToReplyOptions, createAccountStatusSink, createChannelDeliveryAccumulator, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, resolveChannelStreamingBlockEnabled, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -62,7 +62,7 @@ import { readFileHandleBounded } from "openclaw/plugin-sdk/file-access-runtime";
|
|
|
62
62
|
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-store";
|
|
63
63
|
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
|
|
64
64
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
65
|
-
|
|
65
|
+
//#region extensions/imessage/src/approval-reaction-poller.ts
|
|
66
66
|
const RECENT_CHAT_LIMIT = 50;
|
|
67
67
|
const PER_CHAT_HISTORY_LIMIT$1 = 30;
|
|
68
68
|
function normalizeChatId(value) {
|
|
@@ -199,7 +199,8 @@ async function pollPendingIMessageApprovalReactions(params) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region extensions/imessage/src/chat.ts
|
|
203
204
|
async function runChatAction(method, to, opts, isTyping) {
|
|
204
205
|
const cfg = requireRuntimeConfig(opts.cfg, "iMessage chat action");
|
|
205
206
|
const account = opts.account ?? resolveIMessageAccount({
|
|
@@ -241,7 +242,8 @@ async function sendIMessageTyping(to, isTyping, opts) {
|
|
|
241
242
|
async function markIMessageChatRead(to, opts) {
|
|
242
243
|
await runChatAction("read", to, opts);
|
|
243
244
|
}
|
|
244
|
-
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region extensions/imessage/src/monitor/abort-handler.ts
|
|
245
247
|
function attachIMessageMonitorAbortHandler(params) {
|
|
246
248
|
const abort = params.abortSignal;
|
|
247
249
|
if (!abort) return () => {};
|
|
@@ -253,7 +255,8 @@ function attachIMessageMonitorAbortHandler(params) {
|
|
|
253
255
|
abort.addEventListener("abort", onAbort, { once: true });
|
|
254
256
|
return () => abort.removeEventListener("abort", onAbort);
|
|
255
257
|
}
|
|
256
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region extensions/imessage/src/monitor/catchup.ts
|
|
257
260
|
const DEFAULT_MAX_AGE_MINUTES = 120;
|
|
258
261
|
const MAX_MAX_AGE_MINUTES = 720;
|
|
259
262
|
const DEFAULT_PER_RUN_LIMIT = 50;
|
|
@@ -486,7 +489,8 @@ async function performIMessageCatchup(params) {
|
|
|
486
489
|
if (summary.replayed > 0 || summary.failed > 0 || summary.givenUp > 0) params.log?.(`imessage catchup: replayed=${summary.replayed} skippedFromMe=${summary.skippedFromMe} skippedGivenUp=${summary.skippedGivenUp} failed=${summary.failed} givenUp=${summary.givenUp} fetchedCount=${summary.fetchedCount}`);
|
|
487
490
|
return summary;
|
|
488
491
|
}
|
|
489
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region extensions/imessage/src/monitor/strip-imsg-length-prefixed-text.ts
|
|
490
494
|
const utf8Decoder = new TextDecoder();
|
|
491
495
|
function readVarint(buf, start) {
|
|
492
496
|
let offset = start;
|
|
@@ -521,7 +525,8 @@ function stripImessageLengthPrefixedUtf8Text(text) {
|
|
|
521
525
|
const inner = utf8Decoder.decode(stripped);
|
|
522
526
|
return inner.length > 0 ? inner : text;
|
|
523
527
|
}
|
|
524
|
-
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region extensions/imessage/src/monitor/parse-notification.ts
|
|
525
530
|
function isOptionalString(value) {
|
|
526
531
|
return value === void 0 || value === null || typeof value === "string";
|
|
527
532
|
}
|
|
@@ -554,7 +559,8 @@ function parseIMessageNotification(raw) {
|
|
|
554
559
|
reply_to_text: typeof message.reply_to_text === "string" ? stripImessageLengthPrefixedUtf8Text(message.reply_to_text) : message.reply_to_text
|
|
555
560
|
};
|
|
556
561
|
}
|
|
557
|
-
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region extensions/imessage/src/monitor/catchup-bridge.ts
|
|
558
564
|
const PER_CHAT_HISTORY_LIMIT = 500;
|
|
559
565
|
const CATCHUP_CHATS_LIST_LIMIT = 200;
|
|
560
566
|
const CATCHUP_RPC_TIMEOUT_MS = 3e4;
|
|
@@ -679,7 +685,8 @@ async function runIMessageCatchup(params) {
|
|
|
679
685
|
...params.now ? { now: params.now() } : {}
|
|
680
686
|
});
|
|
681
687
|
}
|
|
682
|
-
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region extensions/imessage/src/monitor/coalesce.ts
|
|
683
690
|
const MAX_COALESCED_TEXT_CHARS = 4e3;
|
|
684
691
|
const MAX_COALESCED_ATTACHMENTS = 20;
|
|
685
692
|
/**
|
|
@@ -740,7 +747,8 @@ function combineIMessagePayloads(payloads) {
|
|
|
740
747
|
reply_to_sender: reply.reply_to_sender ?? null
|
|
741
748
|
};
|
|
742
749
|
}
|
|
743
|
-
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region extensions/imessage/src/monitor/conversation-repair.ts
|
|
744
752
|
const DEFAULT_CHATS_LIMIT = 20;
|
|
745
753
|
const DEFAULT_PER_CHAT_HISTORY_LIMIT = 50;
|
|
746
754
|
const DEFAULT_RPC_TIMEOUT_MS = 5e3;
|
|
@@ -848,7 +856,8 @@ async function repairIMessageConversationAnchor(params) {
|
|
|
848
856
|
runtime?.log?.(`imessage: recovered anchorless message GUID=${guid} chat_id=${repaired.chat_id ?? "unknown"} is_group=${repaired.is_group}`);
|
|
849
857
|
return repaired;
|
|
850
858
|
}
|
|
851
|
-
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region extensions/imessage/src/monitor/deliver.ts
|
|
852
861
|
async function deliverIMessageReply(params) {
|
|
853
862
|
const { payload, target, runtime, maxBytes, textLimit, accountId, sentMessageCache } = params;
|
|
854
863
|
const scope = `${accountId ?? ""}:${target}`;
|
|
@@ -911,7 +920,8 @@ function createIMessageEchoCachingSend(params) {
|
|
|
911
920
|
return sent;
|
|
912
921
|
};
|
|
913
922
|
}
|
|
914
|
-
|
|
923
|
+
//#endregion
|
|
924
|
+
//#region extensions/imessage/src/monitor/dm-history.ts
|
|
915
925
|
const DM_HISTORY_RPC_TIMEOUT_MS = 1e4;
|
|
916
926
|
function resolveIMessageDmHistoryLimit(params) {
|
|
917
927
|
const senderCandidates = [
|
|
@@ -981,7 +991,8 @@ async function resolveIMessageDmHistoryContext(params) {
|
|
|
981
991
|
})).join("\n\n")
|
|
982
992
|
};
|
|
983
993
|
}
|
|
984
|
-
|
|
994
|
+
//#endregion
|
|
995
|
+
//#region extensions/imessage/src/monitor/drop-diagnostic-cache.ts
|
|
985
996
|
const THROTTLED_DROP_DIAGNOSTIC_CACHE_MAX_SIZE = 512;
|
|
986
997
|
function createIMessageThrottledDropDiagnosticCache() {
|
|
987
998
|
return createDedupeCache({
|
|
@@ -989,7 +1000,8 @@ function createIMessageThrottledDropDiagnosticCache() {
|
|
|
989
1000
|
ttlMs: 0
|
|
990
1001
|
});
|
|
991
1002
|
}
|
|
992
|
-
|
|
1003
|
+
//#endregion
|
|
1004
|
+
//#region extensions/imessage/src/monitor/echo-cache.ts
|
|
993
1005
|
const SENT_MESSAGE_TEXT_TTL_MS = 4e3;
|
|
994
1006
|
const SENT_MESSAGE_ID_TTL_MS = 6e4;
|
|
995
1007
|
function createSentMessageCache() {
|
|
@@ -1062,7 +1074,8 @@ function createSentMessageCache() {
|
|
|
1062
1074
|
has
|
|
1063
1075
|
};
|
|
1064
1076
|
}
|
|
1065
|
-
|
|
1077
|
+
//#endregion
|
|
1078
|
+
//#region extensions/imessage/src/monitor/group-allowlist-warnings.ts
|
|
1066
1079
|
const PER_CHAT_WARNING_CACHE_MAX_SIZE = 512;
|
|
1067
1080
|
const startupWarned = /* @__PURE__ */ new Set();
|
|
1068
1081
|
const perChatWarned = createDedupeCache({
|
|
@@ -1098,7 +1111,8 @@ function warnGroupAllowlistDropPerChatOnce(params) {
|
|
|
1098
1111
|
params.log(`imessage: dropping group message from chat_id=${chat} (account "${params.accountId}") — not in channels.imessage.groups allowlist. Add channels.imessage.groups["${chat}"] or channels.imessage.groups["*"] to allow it.`);
|
|
1099
1112
|
return true;
|
|
1100
1113
|
}
|
|
1101
|
-
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region extensions/imessage/src/monitor/inbound-dedupe.ts
|
|
1102
1116
|
const IMESSAGE_STALE_INBOUND_THRESHOLD_MS = 9e5;
|
|
1103
1117
|
const IMESSAGE_RECOVERY_MAX_AGE_MS = 72e5;
|
|
1104
1118
|
/**
|
|
@@ -1114,7 +1128,8 @@ function isStaleIMessageBacklog(message, nowMs, thresholdMs = IMESSAGE_STALE_INB
|
|
|
1114
1128
|
if (!Number.isFinite(sentMs)) return false;
|
|
1115
1129
|
return nowMs - sentMs > thresholdMs;
|
|
1116
1130
|
}
|
|
1117
|
-
|
|
1131
|
+
//#endregion
|
|
1132
|
+
//#region extensions/imessage/src/conversation-route.ts
|
|
1118
1133
|
async function resolveIMessageConversationRoute(params) {
|
|
1119
1134
|
const routeInput = {
|
|
1120
1135
|
channel: "imessage",
|
|
@@ -1173,7 +1188,8 @@ async function resolveIMessageConversationRoute(params) {
|
|
|
1173
1188
|
bindingResolution: runtimeRoute.bindingRecord ? null : bindingResolution
|
|
1174
1189
|
};
|
|
1175
1190
|
}
|
|
1176
|
-
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region src/channels/mention-gating.ts
|
|
1177
1193
|
function resolveBotThreadMentionPolicy(params) {
|
|
1178
1194
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
1179
1195
|
requireMention: params.requireMention,
|
|
@@ -1184,7 +1200,8 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
1184
1200
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
1185
1201
|
};
|
|
1186
1202
|
}
|
|
1187
|
-
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region extensions/imessage/src/monitor/mention-policy.ts
|
|
1188
1205
|
async function resolveIMessageInboundMentionPolicy(params) {
|
|
1189
1206
|
const groups = resolveChannelGroups(params.cfg, "imessage", params.accountId);
|
|
1190
1207
|
const { "*": defaults, ...scopes } = groups ?? {};
|
|
@@ -1216,7 +1233,8 @@ async function resolveIMessageInboundMentionPolicy(params) {
|
|
|
1216
1233
|
enforceMentionRequirement: isBotOwnedThread && requireMentionInBotThreads === true
|
|
1217
1234
|
};
|
|
1218
1235
|
}
|
|
1219
|
-
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region extensions/imessage/src/monitor/reflection-guard.ts
|
|
1220
1238
|
const REFLECTION_PATTERNS = [
|
|
1221
1239
|
{
|
|
1222
1240
|
re: /(?:#\+){2,}#?/,
|
|
@@ -1269,7 +1287,8 @@ function detectReflectedContent(text) {
|
|
|
1269
1287
|
matchedLabels
|
|
1270
1288
|
};
|
|
1271
1289
|
}
|
|
1272
|
-
|
|
1290
|
+
//#endregion
|
|
1291
|
+
//#region extensions/imessage/src/monitor/inbound-processing.ts
|
|
1273
1292
|
const normalizeNonEmpty = (value) => value.trim() || null;
|
|
1274
1293
|
const imessageConversationIdentityKinds = /* @__PURE__ */ new Set([
|
|
1275
1294
|
"plugin:imessage-chat-id",
|
|
@@ -1907,7 +1926,8 @@ async function buildIMessageInboundContext(params) {
|
|
|
1907
1926
|
inboundHistory
|
|
1908
1927
|
};
|
|
1909
1928
|
}
|
|
1910
|
-
|
|
1929
|
+
//#endregion
|
|
1930
|
+
//#region extensions/imessage/src/monitor/ingress.ts
|
|
1911
1931
|
const IMESSAGE_INGRESS_PAYLOAD_VERSION = 1;
|
|
1912
1932
|
const IMESSAGE_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
1913
1933
|
const IMessageIngressPayloadError = createChannelIngressError("IMessageIngressPayloadError");
|
|
@@ -2058,7 +2078,8 @@ function createIMessageDurableIngress(options) {
|
|
|
2058
2078
|
waitForIdle: monitor.waitForIdle
|
|
2059
2079
|
};
|
|
2060
2080
|
}
|
|
2061
|
-
|
|
2081
|
+
//#endregion
|
|
2082
|
+
//#region extensions/imessage/src/monitor/loop-rate-limiter.ts
|
|
2062
2083
|
/**
|
|
2063
2084
|
* Per-conversation rate limiter that detects rapid-fire identical echo
|
|
2064
2085
|
* patterns and suppresses them before they amplify into queue overflow.
|
|
@@ -2100,7 +2121,8 @@ function createLoopRateLimiter() {
|
|
|
2100
2121
|
}
|
|
2101
2122
|
};
|
|
2102
2123
|
}
|
|
2103
|
-
|
|
2124
|
+
//#endregion
|
|
2125
|
+
//#region extensions/imessage/src/monitor/media-staging.ts
|
|
2104
2126
|
function createTypeOnlyIMessageAttachment(attachment) {
|
|
2105
2127
|
const contentType = attachment.mime_type?.trim() || void 0;
|
|
2106
2128
|
return {
|
|
@@ -2195,7 +2217,8 @@ async function stageIMessageAttachments(attachments, params) {
|
|
|
2195
2217
|
unavailableCount
|
|
2196
2218
|
};
|
|
2197
2219
|
}
|
|
2198
|
-
|
|
2220
|
+
//#endregion
|
|
2221
|
+
//#region extensions/imessage/src/monitor/poll-comment.ts
|
|
2199
2222
|
const DEFAULT_COMMENT_WINDOW_MS = 15e3;
|
|
2200
2223
|
function createPollCommentFolder(options) {
|
|
2201
2224
|
const windowMs = options?.windowMs ?? DEFAULT_COMMENT_WINDOW_MS;
|
|
@@ -2223,7 +2246,8 @@ function createPollCommentFolder(options) {
|
|
|
2223
2246
|
}
|
|
2224
2247
|
};
|
|
2225
2248
|
}
|
|
2226
|
-
|
|
2249
|
+
//#endregion
|
|
2250
|
+
//#region extensions/imessage/src/monitor/poll-render.ts
|
|
2227
2251
|
function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
2228
2252
|
const options = poll.options ?? [];
|
|
2229
2253
|
if (poll.kind === "vote" || poll.vote && options.length === 0) {
|
|
@@ -2264,7 +2288,8 @@ function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
|
2264
2288
|
const selector = renderOptions?.preferOptionId ? "pollOptionId = the stable option id shown above" : "pollOptionIndex = the option number";
|
|
2265
2289
|
return `\u{1F4CA} Poll${question ? `: ${question}` : ""} — options: ${optionList}. Cast your vote on this poll with the poll-vote action (${selector}); do not answer in a text reply.`;
|
|
2266
2290
|
}
|
|
2267
|
-
|
|
2291
|
+
//#endregion
|
|
2292
|
+
//#region extensions/imessage/src/monitor/reaction-system-event.ts
|
|
2268
2293
|
function enqueueIMessageReactionSystemEvent(params) {
|
|
2269
2294
|
const { decision, runtime } = params;
|
|
2270
2295
|
const queued = enqueueRoutedSystemEvent(decision.text, decision.route, { contextKey: decision.contextKey });
|
|
@@ -2272,7 +2297,8 @@ function enqueueIMessageReactionSystemEvent(params) {
|
|
|
2272
2297
|
params.logVerbose?.("imessage: reaction event enqueued");
|
|
2273
2298
|
return queued;
|
|
2274
2299
|
}
|
|
2275
|
-
|
|
2300
|
+
//#endregion
|
|
2301
|
+
//#region extensions/imessage/src/monitor/recovery-cursor.ts
|
|
2276
2302
|
const RECOVERY_CURSOR_STORE_OPTIONS = {
|
|
2277
2303
|
namespace: "imessage.recovery-cursor",
|
|
2278
2304
|
maxEntries: 64
|
|
@@ -2402,7 +2428,8 @@ async function advanceIMessageRecoveryCursor(accountId, dbIdentity, rowid) {
|
|
|
2402
2428
|
});
|
|
2403
2429
|
} catch {}
|
|
2404
2430
|
}
|
|
2405
|
-
|
|
2431
|
+
//#endregion
|
|
2432
|
+
//#region extensions/imessage/src/monitor/self-chat-cache.ts
|
|
2406
2433
|
const SELF_CHAT_TTL_MS = 1e4;
|
|
2407
2434
|
const SELF_CHAT_CREATED_AT_TOLERANCE_MS = 1e3;
|
|
2408
2435
|
const MAX_SELF_CHAT_CACHE_ENTRIES = 512;
|
|
@@ -2481,7 +2508,8 @@ var DefaultSelfChatCache = class {
|
|
|
2481
2508
|
function createSelfChatCache() {
|
|
2482
2509
|
return new DefaultSelfChatCache();
|
|
2483
2510
|
}
|
|
2484
|
-
|
|
2511
|
+
//#endregion
|
|
2512
|
+
//#region extensions/imessage/src/monitor/watch-error-log.ts
|
|
2485
2513
|
const MAX_WATCH_ERROR_MESSAGE_CHARS = 200;
|
|
2486
2514
|
function sanitizeIMessageWatchErrorPayload(payload) {
|
|
2487
2515
|
if (!isRecord(payload)) return {};
|
|
@@ -2493,7 +2521,8 @@ function sanitizeIMessageWatchErrorPayload(payload) {
|
|
|
2493
2521
|
}
|
|
2494
2522
|
return safe;
|
|
2495
2523
|
}
|
|
2496
|
-
|
|
2524
|
+
//#endregion
|
|
2525
|
+
//#region extensions/imessage/src/monitor/monitor-provider.ts
|
|
2497
2526
|
const WATCH_SUBSCRIBE_MAX_ATTEMPTS = 3;
|
|
2498
2527
|
const WATCH_SUBSCRIBE_RETRY_DELAY_MS = 1e3;
|
|
2499
2528
|
const CHANNEL_APPROVAL_GATEWAY_RUNTIME_CONTEXT_CAPABILITY = "approval.gateway";
|
|
@@ -2695,12 +2724,7 @@ async function monitorIMessageProvider(opts) {
|
|
|
2695
2724
|
return;
|
|
2696
2725
|
}
|
|
2697
2726
|
const combined = entries.length === 1 ? expectDefined(entries[0], "single iMessage dispatch entry").message : combineIMessagePayloads(entries.map((entry) => entry.message));
|
|
2698
|
-
if (entries.length > 1 && shouldLogVerbose()) {
|
|
2699
|
-
const text = combined.text ?? "";
|
|
2700
|
-
const preview = sliceUtf16Safe(text, 0, 50);
|
|
2701
|
-
const ellipsis = text.length > 50 ? "..." : "";
|
|
2702
|
-
logVerbose(`[imessage] merged ${entries.length} debounced messages: "${preview}${ellipsis}"`);
|
|
2703
|
-
}
|
|
2727
|
+
if (entries.length > 1 && shouldLogVerbose()) logVerbose(`[imessage] merged ${entries.length} debounced messages chars=${combined.text?.length ?? 0}`);
|
|
2704
2728
|
await handleMessageNow(combined, admissionLifecycle);
|
|
2705
2729
|
await settle();
|
|
2706
2730
|
} catch (err) {
|
|
@@ -3018,10 +3042,7 @@ async function monitorIMessageProvider(opts) {
|
|
|
3018
3042
|
allowFrom,
|
|
3019
3043
|
normalizeEntry: normalizeIMessageHandle
|
|
3020
3044
|
});
|
|
3021
|
-
if (shouldLogVerbose()) {
|
|
3022
|
-
const preview = truncateUtf16Safe(ctxPayload.Body ?? "", 200).replace(/\n/g, "\\n");
|
|
3023
|
-
logVerbose(`imessage inbound: chatId=${chatId ?? "unknown"} from=${ctxPayload.From} len=${(ctxPayload.Body ?? "").length} preview="${preview}"`);
|
|
3024
|
-
}
|
|
3045
|
+
if (shouldLogVerbose()) logVerbose(`imessage inbound: chatId=${chatId ?? "unknown"} from=${ctxPayload.From} len=${(ctxPayload.Body ?? "").length}`);
|
|
3025
3046
|
const sendReadReceipts = imessageCfg.sendReadReceipts !== false;
|
|
3026
3047
|
const typingTarget = ctxPayload.To;
|
|
3027
3048
|
const readTarget = !decision.isGroup && decision.chatGuid ? `chat_guid:${decision.chatGuid}` : typingTarget;
|
|
@@ -3415,7 +3436,8 @@ async function monitorIMessageProvider(opts) {
|
|
|
3415
3436
|
await ingress.stop();
|
|
3416
3437
|
}
|
|
3417
3438
|
}
|
|
3418
|
-
|
|
3439
|
+
//#endregion
|
|
3440
|
+
//#region extensions/imessage/src/channel.runtime.ts
|
|
3419
3441
|
async function sendIMessageOutbound(params) {
|
|
3420
3442
|
const send = resolveOutboundSendDep(params.deps, "imessage", { legacyKeys: IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageIMessage;
|
|
3421
3443
|
const maxBytes = resolveChannelMediaMaxBytes({
|
|
@@ -3495,4 +3517,5 @@ async function startIMessageGatewayAccount(ctx) {
|
|
|
3495
3517
|
statusSink
|
|
3496
3518
|
});
|
|
3497
3519
|
}
|
|
3520
|
+
//#endregion
|
|
3498
3521
|
export { imessageSetupWizard, probeIMessageAccount, sendIMessageOutbound, startIMessageGatewayAccount };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as expandIMessageUserPath } from "./accounts-
|
|
2
|
-
import { i as invalidateCachedIMessagePrivateApiStatus } from "./message-tool-api-
|
|
3
|
-
import { t as getIMessageRuntime } from "./runtime-
|
|
1
|
+
import { u as expandIMessageUserPath } from "./accounts-DacCvDBt.mjs";
|
|
2
|
+
import { i as invalidateCachedIMessagePrivateApiStatus } from "./message-tool-api-B5NfPnFL.mjs";
|
|
3
|
+
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
4
4
|
import { asNullableRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -12,7 +12,7 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
12
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
import { captureChannelReadAuthority, captureEffectAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
14
14
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
15
|
-
|
|
15
|
+
//#region extensions/imessage/src/chat-context.ts
|
|
16
16
|
const EMAIL_HANDLE_PATTERN = /^[^\s@]+@[^\s@]+$/u;
|
|
17
17
|
function parseDirectChatIdentity(raw) {
|
|
18
18
|
const trimmed = raw.trim();
|
|
@@ -86,10 +86,12 @@ function resolveIMessageChatMatch(cached, current) {
|
|
|
86
86
|
if (comparisons.length === 0) return "unknown";
|
|
87
87
|
return comparisons.every(Boolean) ? "match" : "mismatch";
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region extensions/imessage/src/constants.ts
|
|
90
91
|
const DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS = 1e4;
|
|
91
92
|
const DEFAULT_IMESSAGE_SEND_TIMEOUT_MS = 18e4;
|
|
92
|
-
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region extensions/imessage/src/state-contract.ts
|
|
93
95
|
const IMESSAGE_REPLY_CACHE_NAMESPACE = "imessage.reply-cache";
|
|
94
96
|
const IMESSAGE_REPLY_CACHE_MAX_ENTRIES = 2e3;
|
|
95
97
|
const IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE = "imessage.reply-cache-counter";
|
|
@@ -142,7 +144,8 @@ function resolveIMessageEchoMediaKey(media) {
|
|
|
142
144
|
const normalizedContentType = contentType?.split(";", 1)[0]?.trim();
|
|
143
145
|
return normalizedContentType ? `mime:${normalizedContentType}` : void 0;
|
|
144
146
|
}
|
|
145
|
-
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region extensions/imessage/src/monitor-reply-cache.ts
|
|
146
149
|
/** Recency window for the "react to the latest message" fallback. */
|
|
147
150
|
const LATEST_FALLBACK_MS = 6e5;
|
|
148
151
|
let persistenceFailureLogged = false;
|
|
@@ -373,7 +376,8 @@ function isCurrentMessageInChat(params) {
|
|
|
373
376
|
accountId: params.accountId
|
|
374
377
|
}) === "match";
|
|
375
378
|
}
|
|
376
|
-
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region extensions/imessage/src/cli-output.ts
|
|
377
381
|
const IMESSAGE_CLI_STDOUT_MAX_BYTES = 8388608;
|
|
378
382
|
const IMESSAGE_CLI_STDERR_TAIL_BYTES = 65536;
|
|
379
383
|
function parseLastJsonObject(stdout) {
|
|
@@ -420,7 +424,8 @@ async function runIMessageCliJsonCommand(params) {
|
|
|
420
424
|
}
|
|
421
425
|
return parsed;
|
|
422
426
|
}
|
|
423
|
-
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region extensions/imessage/src/bridge-recovery.ts
|
|
424
429
|
const BRIDGE_RECOVERY_TIMEOUT_MS = 3e4;
|
|
425
430
|
const recoveries = /* @__PURE__ */ new Map();
|
|
426
431
|
/**
|
|
@@ -441,7 +446,8 @@ function recoverIMessageBridge(cliPath) {
|
|
|
441
446
|
recoveries.set(cliPath, recovery);
|
|
442
447
|
return recovery;
|
|
443
448
|
}
|
|
444
|
-
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region extensions/imessage/src/process-diagnostics.ts
|
|
445
451
|
function describeIMessageAutomationFailure(data, remoteHost) {
|
|
446
452
|
const failure = asOptionalRecord(data);
|
|
447
453
|
if (failure?.transport !== "applescript" || typeof failure.detail !== "string") return;
|
|
@@ -451,7 +457,13 @@ function describeIMessageAutomationFailure(data, remoteHost) {
|
|
|
451
457
|
const context = remoteHost ? "Check System Settings > Privacy & Security > Automation for the SSH/wrapper process on the Messages Mac, not this Gateway's local runtime or Terminal." : "Check System Settings > Privacy & Security > Automation for the Gateway/launcher on the Messages Mac. Local Gateway runtime: " + JSON.stringify(process.execPath) + ". An app update that switches Node to Bun or moves the Gateway to a new runtime path needs this grant once; review the process macOS identifies, not just Terminal or OpenClaw.app.";
|
|
452
458
|
return reason + " " + context + " Channel probes do not verify sending.";
|
|
453
459
|
}
|
|
454
|
-
|
|
460
|
+
function normalizeIMessageAutomationError(message) {
|
|
461
|
+
const code = /Messages automation failed with AppleScript error (-1712|-1743)(?![0-9])/i.exec(message)?.[1];
|
|
462
|
+
if (!code) return;
|
|
463
|
+
return (code === "-1712" ? "Messages took too long to respond, so OpenClaw couldn't confirm your iMessage was sent. Open Messages on your Mac and approve any permission prompt. If the app is frozen, quit and reopen it. " : "OpenClaw couldn't send your iMessage because it doesn't have permission to control Messages. ") + "On the Mac running Messages, open System Settings > Privacy & Security > Automation and allow Messages access for the process running OpenClaw. If this started after an OpenClaw update, you may need to allow access again. For an app-managed or remote Gateway, check the actual launcher or SSH/wrapper process on the Messages Mac. Check whether your message was delivered and review queued replies before retrying to avoid duplicates. Technical details: Messages automation failed with AppleScript error " + code + ".";
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region extensions/imessage/src/client.ts
|
|
455
467
|
const IMSG_APPLE_FRAMEWORK_STDERR_PATTERN = /^(?:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ imsg\[\d+:\d+\] )?Could not fetch group for change type \d+ with identifier [^:]+:ABGroup, making it a delete change type\.$/u;
|
|
456
468
|
var IMessageRpcRequestError = class extends Error {
|
|
457
469
|
constructor(message, code, data) {
|
|
@@ -748,4 +760,5 @@ async function createIMessageRpcClient(opts = {}) {
|
|
|
748
760
|
await client.start();
|
|
749
761
|
return client;
|
|
750
762
|
}
|
|
751
|
-
|
|
763
|
+
//#endregion
|
|
764
|
+
export { resolveIMessageDirectChatService as C, normalizeDirectChatIdentifier as S, resolveIMessageSentEchoEntryKey as _, findLatestIMessageEntryForChat as a, chatContextFromIMessageTarget as b, rememberIMessageReplyCache as c, IMESSAGE_CATCHUP_CURSOR_NAMESPACE as d, IMESSAGE_SENT_ECHOES_NAMESPACE as f, resolveIMessageEchoMediaKey as g, resolveIMessageCatchupCursorKey as h, runIMessageCliJsonCommand as i, resolveIMessageCachedResourceBinding as l, capFailureRetriesMap as m, createIMessageRpcClient as n, isIMessageCurrentMessageInChatAsync as o, IMESSAGE_SENT_ECHOES_TTL_MS as p, normalizeIMessageAutomationError as r, isKnownFromMeIMessageTarget as s, IMessageRpcRequestError as t, resolveIMessageMessageId as u, DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS as v, isIMessageEmailChatIdentifier as x, DEFAULT_IMESSAGE_SEND_TIMEOUT_MS as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
2
2
|
import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, buildChannelAccountSchemaParts, buildChannelConfigSchema, buildChannelReactionShape, buildGroupEntrySchema, isSafeScpRemoteHost, isValidInboundPathRootPattern, refineChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-schema";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
4
|
+
//#region extensions/imessage/src/config-ui-hints.ts
|
|
5
5
|
const iMessageChannelConfigUiHints = {
|
|
6
6
|
"": {
|
|
7
7
|
label: "iMessage",
|
|
@@ -35,7 +35,8 @@ const iMessageChannelConfigUiHints = {
|
|
|
35
35
|
help: "Preferred imsg RPC send transport for normal outbound replies. \"auto\" uses the IMCore bridge when available, \"bridge\" requires it, and \"applescript\" forces Messages automation."
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region extensions/imessage/src/config-schema.ts
|
|
39
40
|
const IMessageActionSchema = z.object({
|
|
40
41
|
reactions: z.boolean().optional(),
|
|
41
42
|
edit: z.boolean().optional(),
|
|
@@ -117,4 +118,5 @@ const IMessageConfigSchema = IMessageAccountSchemaBase.extend({
|
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
120
|
const IMessageChannelConfigSchema = buildChannelConfigSchema(IMessageConfigSchema, { uiHints: iMessageChannelConfigUiHints });
|
|
121
|
+
//#endregion
|
|
120
122
|
export { IMessageChannelConfigSchema as t };
|
package/dist/.setup/{conversation-bindings-vZFn6sN2.mjs → conversation-bindings-DR-dbHjs.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAccountScopedConversationBindingManager, createAccountScopedConversationBindingManagerV2, resetAccountScopedConversationBindingsForTests } from "openclaw/plugin-sdk/thread-bindings-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/imessage/src/conversation-bindings.ts
|
|
3
3
|
const IMESSAGE_CONVERSATION_BINDINGS_STATE_KEY = Symbol.for("openclaw.imessageConversationBindingsState");
|
|
4
4
|
function toSessionBindingTargetKind(raw) {
|
|
5
5
|
return raw === "subagent" ? "subagent" : "session";
|
|
@@ -32,4 +32,5 @@ function createIMessageConversationBindingManagerV2(params) {
|
|
|
32
32
|
const testing = { resetIMessageConversationBindingsForTests() {
|
|
33
33
|
resetAccountScopedConversationBindingsForTests({ stateKey: IMESSAGE_CONVERSATION_BINDINGS_STATE_KEY });
|
|
34
34
|
} };
|
|
35
|
+
//#endregion
|
|
35
36
|
export { createIMessageConversationBindingManagerV2 as n, testing as r, createIMessageConversationBindingManager as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as resolveIMessageAccount } from "./accounts-
|
|
1
|
+
import { o as resolveIMessageAccount } from "./accounts-DacCvDBt.mjs";
|
|
2
2
|
import { mergeInboundPathRoots } from "openclaw/plugin-sdk/channel-inbound";
|
|
3
|
-
|
|
3
|
+
//#region extensions/imessage/src/media-contract.ts
|
|
4
4
|
const DEFAULT_IMESSAGE_ATTACHMENT_ROOTS = ["/Users/*/Library/Messages/Attachments"];
|
|
5
5
|
function resolveIMessageAttachmentRoots(params) {
|
|
6
6
|
const account = resolveIMessageAccount(params);
|
|
@@ -10,4 +10,5 @@ function resolveIMessageRemoteAttachmentRoots(params) {
|
|
|
10
10
|
const account = resolveIMessageAccount(params);
|
|
11
11
|
return mergeInboundPathRoots(account.config.remoteAttachmentRoots, params.cfg.channels?.imessage?.remoteAttachmentRoots, account.config.attachmentRoots, params.cfg.channels?.imessage?.attachmentRoots, DEFAULT_IMESSAGE_ATTACHMENT_ROOTS);
|
|
12
12
|
}
|
|
13
|
+
//#endregion
|
|
13
14
|
export { resolveIMessageAttachmentRoots as n, resolveIMessageRemoteAttachmentRoots as r, DEFAULT_IMESSAGE_ATTACHMENT_ROOTS as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as inferIMessageTargetChatType } from "./targets-
|
|
2
|
-
import { c as getCachedIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-
|
|
1
|
+
import { n as inferIMessageTargetChatType } from "./targets-B4oU7n-v.mjs";
|
|
2
|
+
import { c as getCachedIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-DacCvDBt.mjs";
|
|
3
3
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
4
4
|
import { Type } from "typebox";
|
|
5
5
|
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
6
|
-
|
|
6
|
+
//#region extensions/imessage/src/actions-contract.ts
|
|
7
7
|
const IMESSAGE_ACTIONS = {
|
|
8
8
|
react: { gate: "reactions" },
|
|
9
9
|
edit: { gate: "edit" },
|
|
@@ -35,7 +35,8 @@ const IMESSAGE_ACTIONS = {
|
|
|
35
35
|
"poll-vote": { gate: "polls" }
|
|
36
36
|
};
|
|
37
37
|
const IMESSAGE_ACTION_NAMES = Object.keys(IMESSAGE_ACTIONS);
|
|
38
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region extensions/imessage/src/private-api-status.ts
|
|
39
40
|
const FOUNDATIONAL_RPC_METHODS = /* @__PURE__ */ new Set([
|
|
40
41
|
"chats.list",
|
|
41
42
|
"messages.history",
|
|
@@ -74,7 +75,8 @@ function setCachedIMessagePrivateApiStatus(cliPath, status, expiresAt = 0) {
|
|
|
74
75
|
expiresAt
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region extensions/imessage/src/message-tool-api.ts
|
|
78
80
|
function isGroupTarget(raw, chatType) {
|
|
79
81
|
if (chatType) return chatType !== "direct";
|
|
80
82
|
if (!raw) return false;
|
|
@@ -127,4 +129,5 @@ function describeIMessageMessageTool({ cfg, accountId, chatType, currentChannelI
|
|
|
127
129
|
} } : {}
|
|
128
130
|
};
|
|
129
131
|
}
|
|
132
|
+
//#endregion
|
|
130
133
|
export { setCachedIMessagePrivateApiStatus as a, invalidateCachedIMessagePrivateApiStatus as i, getCachedIMessagePrivateApiStatus as n, IMESSAGE_ACTIONS as o, imessageRpcSupportsMethod as r, IMESSAGE_ACTION_NAMES as s, describeIMessageMessageTool as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.mjs";
|
|
2
|
+
import { s as normalizeIMessageGuid } from "./actions-FOjSVXxg.mjs";
|
|
3
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-7yLnHd5m.mjs";
|
|
4
4
|
import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/imessage/src/question-reactions.ts
|
|
6
6
|
var question_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
hasIMessageQuestionReactionTarget: () => hasIMessageQuestionReactionTarget,
|
|
8
8
|
maybeResolveIMessageQuestionReaction: () => maybeResolveIMessageQuestionReaction,
|
|
@@ -64,4 +64,5 @@ async function maybeResolveIMessageQuestionReaction(params) {
|
|
|
64
64
|
logDebug: params.logDebug
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
+
//#endregion
|
|
67
68
|
export { maybeResolveIMessageQuestionReaction as n, question_reactions_exports as r, hasIMessageQuestionReactionTarget as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { s as normalizeIMessageGuid } from "./actions-FOjSVXxg.mjs";
|
|
2
|
+
//#region extensions/imessage/src/monitor/reaction-context.ts
|
|
3
3
|
const TAPBACK_TEXT_PATTERNS = [
|
|
4
4
|
{
|
|
5
5
|
prefix: "loved",
|
|
@@ -102,4 +102,5 @@ function resolveIMessageReactionContext(message, bodyText) {
|
|
|
102
102
|
}
|
|
103
103
|
return resolveTapbackTextContext(bodyText);
|
|
104
104
|
}
|
|
105
|
+
//#endregion
|
|
105
106
|
export { resolveIMessageReactionContext as t };
|