@openclaw/imessage 2026.10.10-beta.4 → 2026.10.10
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-DacCvDBt.mjs → accounts-BH0coL46.mjs} +3 -6
- package/dist/.setup/{actions-CZHoxlpi.mjs → actions-CW7XYYF4.mjs} +10 -14
- package/dist/.setup/{actions.runtime-B-OHCffC.mjs → actions.runtime-B2ZHQ3TJ.mjs} +6 -9
- package/dist/.setup/{api-dHebtZYA.mjs → api-6xi-NBrt.mjs} +8 -9
- package/dist/.setup/{api-BifRABgX.mjs → api-B0ih8Iof.mjs} +9 -9
- package/dist/.setup/{approval-handler.runtime-jO19jL0F.mjs → approval-handler.runtime-BKmqba3L.mjs} +10 -11
- package/dist/.setup/{approval-reactions-DFgEJMz2.mjs → approval-reactions-B9CJS0NT.mjs} +9 -12
- package/dist/.setup/{channel-D-E9DvQL.mjs → channel-6kcKpSRw.mjs} +23 -32
- package/dist/.setup/{channel.runtime-Cx_lRd-J.mjs → channel.runtime-BW4A0m4h.mjs} +50 -82
- package/dist/.setup/{client-BEZ_gLk-.mjs → client-C3e7ZLqA.mjs} +15 -18
- package/dist/.setup/{config-schema-DXwa_3V5.mjs → config-schema-DRkdRC21.mjs} +2 -4
- package/dist/.setup/{conversation-bindings-DR-dbHjs.mjs → conversation-bindings-vZFn6sN2.mjs} +1 -2
- package/dist/.setup/{media-contract-BwWs5PM7.mjs → media-contract-CoixpXRX.mjs} +2 -3
- package/dist/.setup/{message-tool-api-B5NfPnFL.mjs → message-tool-api-CxSY_rh7.mjs} +5 -8
- package/dist/.setup/{outbound-send-deps-B-QEsLSM.mjs → outbound-send-deps-_da8jqeo.mjs} +1 -2
- package/dist/.setup/{question-reactions-BUSvdHlF.mjs → question-reactions-DTj-VH3N.mjs} +4 -5
- package/dist/.setup/{reaction-context-DbYCapmR.mjs → reaction-context-Bw00FkmU.mjs} +2 -3
- package/dist/.setup/{remote-file-vdoCnZze.mjs → remote-file-CCgMYZ-u.mjs} +6 -10
- package/dist/.setup/{rolldown-runtime-BBjsoOtd.mjs → rolldown-runtime-782esTHO.mjs} +1 -2
- package/dist/.setup/{runtime-Cza4CY5T.mjs → runtime-BRQCPuAD.mjs} +1 -2
- package/dist/.setup/{sanitize-outbound-BtEY324R.mjs → sanitize-outbound-C02fJrn6.mjs} +2 -4
- package/dist/.setup/{send-Jaf5eIJS.mjs → send-D98hQFdv.mjs} +14 -19
- package/dist/.setup/{setup-core-BHyLkAEJ.mjs → setup-core-BWnW0czE.mjs} +3 -4
- package/dist/.setup/{setup-surface-DPqiLGy0.mjs → setup-surface-aRZhAzzQ.mjs} +4 -6
- package/dist/.setup/{targets-B4oU7n-v.mjs → targets-CIx4BKqL.mjs} +3 -6
- package/dist/.source-module-urls/929c518fa2986b0f85f66bceefead22868db0ab452dee914dc6a2bb86b2e60ad.json +1 -1
- package/dist/api.js +9 -9
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/doctor-contract-api.js +7 -13
- package/dist/index.js +1 -2
- package/dist/media-contract-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +2 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/src/chat-db.worker.js +2 -3
- package/package.json +4 -4
|
@@ -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 { S as resolveIMessageDirectChatService, h as resolveIMessageEchoMediaKey, m as resolveIMessageCatchupCursorKey, n as createIMessageRpcClient, o as isKnownFromMeIMessageTarget, p as capFailureRetriesMap, s as rememberIMessageReplyCache, u as IMESSAGE_CATCHUP_CURSOR_NAMESPACE } from "./client-
|
|
5
|
-
import { a as normalizeIMessageMessageId, i as normalizeIMessageGuid, n as probeIMessage, r as probeIMessagePrivateApi } from "./actions-
|
|
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-CIx4BKqL.mjs";
|
|
2
|
+
import { d as resolveIMessageChatDbLookupPath, f as resolveIMessageHomeDir, l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-BH0coL46.mjs";
|
|
3
|
+
import { r as imessageRpcSupportsMethod } from "./message-tool-api-CxSY_rh7.mjs";
|
|
4
|
+
import { S as resolveIMessageDirectChatService, h as resolveIMessageEchoMediaKey, m as resolveIMessageCatchupCursorKey, n as createIMessageRpcClient, o as isKnownFromMeIMessageTarget, p as capFailureRetriesMap, s as rememberIMessageReplyCache, u as IMESSAGE_CATCHUP_CURSOR_NAMESPACE } from "./client-C3e7ZLqA.mjs";
|
|
5
|
+
import { a as normalizeIMessageMessageId, i as normalizeIMessageGuid, n as probeIMessage, r as probeIMessagePrivateApi } from "./actions-CW7XYYF4.mjs";
|
|
6
|
+
import { t as getIMessageRuntime } from "./runtime-BRQCPuAD.mjs";
|
|
7
|
+
import { a as resolveIMessageGroupSystemPrompt, s as resolveIMessageInboundConversationId } from "./channel-6kcKpSRw.mjs";
|
|
8
|
+
import { r as sanitizeOutboundText } from "./sanitize-outbound-C02fJrn6.mjs";
|
|
9
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-CoixpXRX.mjs";
|
|
10
|
+
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-_da8jqeo.mjs";
|
|
11
|
+
import { i as resolveIMessageStartupRowidWatermark } from "./remote-file-CCgMYZ-u.mjs";
|
|
12
|
+
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction } from "./approval-reactions-B9CJS0NT.mjs";
|
|
13
|
+
import { n as hasPersistedIMessageEcho, r as normalizeIMessageEchoText, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-D98hQFdv.mjs";
|
|
14
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-Bw00FkmU.mjs";
|
|
15
|
+
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-DTj-VH3N.mjs";
|
|
16
|
+
import { imessageSetupWizard } from "./setup-surface-aRZhAzzQ.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
|
+
// 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,8 +199,7 @@ async function pollPendingIMessageApprovalReactions(params) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
|
|
203
|
-
//#region extensions/imessage/src/chat.ts
|
|
202
|
+
// extensions/imessage/src/chat.ts
|
|
204
203
|
async function runChatAction(method, to, opts, isTyping) {
|
|
205
204
|
const cfg = requireRuntimeConfig(opts.cfg, "iMessage chat action");
|
|
206
205
|
const account = opts.account ?? resolveIMessageAccount({
|
|
@@ -242,8 +241,7 @@ async function sendIMessageTyping(to, isTyping, opts) {
|
|
|
242
241
|
async function markIMessageChatRead(to, opts) {
|
|
243
242
|
await runChatAction("read", to, opts);
|
|
244
243
|
}
|
|
245
|
-
|
|
246
|
-
//#region extensions/imessage/src/monitor/abort-handler.ts
|
|
244
|
+
// extensions/imessage/src/monitor/abort-handler.ts
|
|
247
245
|
function attachIMessageMonitorAbortHandler(params) {
|
|
248
246
|
const abort = params.abortSignal;
|
|
249
247
|
if (!abort) return () => {};
|
|
@@ -255,8 +253,7 @@ function attachIMessageMonitorAbortHandler(params) {
|
|
|
255
253
|
abort.addEventListener("abort", onAbort, { once: true });
|
|
256
254
|
return () => abort.removeEventListener("abort", onAbort);
|
|
257
255
|
}
|
|
258
|
-
|
|
259
|
-
//#region extensions/imessage/src/monitor/catchup.ts
|
|
256
|
+
// extensions/imessage/src/monitor/catchup.ts
|
|
260
257
|
const DEFAULT_MAX_AGE_MINUTES = 120;
|
|
261
258
|
const MAX_MAX_AGE_MINUTES = 720;
|
|
262
259
|
const DEFAULT_PER_RUN_LIMIT = 50;
|
|
@@ -489,8 +486,7 @@ async function performIMessageCatchup(params) {
|
|
|
489
486
|
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}`);
|
|
490
487
|
return summary;
|
|
491
488
|
}
|
|
492
|
-
|
|
493
|
-
//#region extensions/imessage/src/monitor/strip-imsg-length-prefixed-text.ts
|
|
489
|
+
// extensions/imessage/src/monitor/strip-imsg-length-prefixed-text.ts
|
|
494
490
|
const utf8Decoder = new TextDecoder();
|
|
495
491
|
function readVarint(buf, start) {
|
|
496
492
|
let offset = start;
|
|
@@ -525,8 +521,7 @@ function stripImessageLengthPrefixedUtf8Text(text) {
|
|
|
525
521
|
const inner = utf8Decoder.decode(stripped);
|
|
526
522
|
return inner.length > 0 ? inner : text;
|
|
527
523
|
}
|
|
528
|
-
|
|
529
|
-
//#region extensions/imessage/src/monitor/parse-notification.ts
|
|
524
|
+
// extensions/imessage/src/monitor/parse-notification.ts
|
|
530
525
|
function isOptionalString(value) {
|
|
531
526
|
return value === void 0 || value === null || typeof value === "string";
|
|
532
527
|
}
|
|
@@ -559,8 +554,7 @@ function parseIMessageNotification(raw) {
|
|
|
559
554
|
reply_to_text: typeof message.reply_to_text === "string" ? stripImessageLengthPrefixedUtf8Text(message.reply_to_text) : message.reply_to_text
|
|
560
555
|
};
|
|
561
556
|
}
|
|
562
|
-
|
|
563
|
-
//#region extensions/imessage/src/monitor/catchup-bridge.ts
|
|
557
|
+
// extensions/imessage/src/monitor/catchup-bridge.ts
|
|
564
558
|
const PER_CHAT_HISTORY_LIMIT = 500;
|
|
565
559
|
const CATCHUP_CHATS_LIST_LIMIT = 200;
|
|
566
560
|
const CATCHUP_RPC_TIMEOUT_MS = 3e4;
|
|
@@ -685,8 +679,7 @@ async function runIMessageCatchup(params) {
|
|
|
685
679
|
...params.now ? { now: params.now() } : {}
|
|
686
680
|
});
|
|
687
681
|
}
|
|
688
|
-
|
|
689
|
-
//#region extensions/imessage/src/monitor/coalesce.ts
|
|
682
|
+
// extensions/imessage/src/monitor/coalesce.ts
|
|
690
683
|
const MAX_COALESCED_TEXT_CHARS = 4e3;
|
|
691
684
|
const MAX_COALESCED_ATTACHMENTS = 20;
|
|
692
685
|
/**
|
|
@@ -747,8 +740,7 @@ function combineIMessagePayloads(payloads) {
|
|
|
747
740
|
reply_to_sender: reply.reply_to_sender ?? null
|
|
748
741
|
};
|
|
749
742
|
}
|
|
750
|
-
|
|
751
|
-
//#region extensions/imessage/src/monitor/conversation-repair.ts
|
|
743
|
+
// extensions/imessage/src/monitor/conversation-repair.ts
|
|
752
744
|
const DEFAULT_CHATS_LIMIT = 20;
|
|
753
745
|
const DEFAULT_PER_CHAT_HISTORY_LIMIT = 50;
|
|
754
746
|
const DEFAULT_RPC_TIMEOUT_MS = 5e3;
|
|
@@ -856,8 +848,7 @@ async function repairIMessageConversationAnchor(params) {
|
|
|
856
848
|
runtime?.log?.(`imessage: recovered anchorless message GUID=${guid} chat_id=${repaired.chat_id ?? "unknown"} is_group=${repaired.is_group}`);
|
|
857
849
|
return repaired;
|
|
858
850
|
}
|
|
859
|
-
|
|
860
|
-
//#region extensions/imessage/src/monitor/deliver.ts
|
|
851
|
+
// extensions/imessage/src/monitor/deliver.ts
|
|
861
852
|
async function deliverIMessageReply(params) {
|
|
862
853
|
const { payload, target, runtime, maxBytes, textLimit, accountId, sentMessageCache } = params;
|
|
863
854
|
const scope = `${accountId ?? ""}:${target}`;
|
|
@@ -920,8 +911,7 @@ function createIMessageEchoCachingSend(params) {
|
|
|
920
911
|
return sent;
|
|
921
912
|
};
|
|
922
913
|
}
|
|
923
|
-
|
|
924
|
-
//#region extensions/imessage/src/monitor/dm-history.ts
|
|
914
|
+
// extensions/imessage/src/monitor/dm-history.ts
|
|
925
915
|
const DM_HISTORY_RPC_TIMEOUT_MS = 1e4;
|
|
926
916
|
function resolveIMessageDmHistoryLimit(params) {
|
|
927
917
|
const senderCandidates = [
|
|
@@ -991,8 +981,7 @@ async function resolveIMessageDmHistoryContext(params) {
|
|
|
991
981
|
})).join("\n\n")
|
|
992
982
|
};
|
|
993
983
|
}
|
|
994
|
-
|
|
995
|
-
//#region extensions/imessage/src/monitor/drop-diagnostic-cache.ts
|
|
984
|
+
// extensions/imessage/src/monitor/drop-diagnostic-cache.ts
|
|
996
985
|
const THROTTLED_DROP_DIAGNOSTIC_CACHE_MAX_SIZE = 512;
|
|
997
986
|
function createIMessageThrottledDropDiagnosticCache() {
|
|
998
987
|
return createDedupeCache({
|
|
@@ -1000,8 +989,7 @@ function createIMessageThrottledDropDiagnosticCache() {
|
|
|
1000
989
|
ttlMs: 0
|
|
1001
990
|
});
|
|
1002
991
|
}
|
|
1003
|
-
|
|
1004
|
-
//#region extensions/imessage/src/monitor/echo-cache.ts
|
|
992
|
+
// extensions/imessage/src/monitor/echo-cache.ts
|
|
1005
993
|
const SENT_MESSAGE_TEXT_TTL_MS = 4e3;
|
|
1006
994
|
const SENT_MESSAGE_ID_TTL_MS = 6e4;
|
|
1007
995
|
function createSentMessageCache() {
|
|
@@ -1074,8 +1062,7 @@ function createSentMessageCache() {
|
|
|
1074
1062
|
has
|
|
1075
1063
|
};
|
|
1076
1064
|
}
|
|
1077
|
-
|
|
1078
|
-
//#region extensions/imessage/src/monitor/group-allowlist-warnings.ts
|
|
1065
|
+
// extensions/imessage/src/monitor/group-allowlist-warnings.ts
|
|
1079
1066
|
const PER_CHAT_WARNING_CACHE_MAX_SIZE = 512;
|
|
1080
1067
|
const startupWarned = /* @__PURE__ */ new Set();
|
|
1081
1068
|
const perChatWarned = createDedupeCache({
|
|
@@ -1111,8 +1098,7 @@ function warnGroupAllowlistDropPerChatOnce(params) {
|
|
|
1111
1098
|
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.`);
|
|
1112
1099
|
return true;
|
|
1113
1100
|
}
|
|
1114
|
-
|
|
1115
|
-
//#region extensions/imessage/src/monitor/inbound-dedupe.ts
|
|
1101
|
+
// extensions/imessage/src/monitor/inbound-dedupe.ts
|
|
1116
1102
|
const IMESSAGE_STALE_INBOUND_THRESHOLD_MS = 9e5;
|
|
1117
1103
|
const IMESSAGE_RECOVERY_MAX_AGE_MS = 72e5;
|
|
1118
1104
|
/**
|
|
@@ -1128,8 +1114,7 @@ function isStaleIMessageBacklog(message, nowMs, thresholdMs = IMESSAGE_STALE_INB
|
|
|
1128
1114
|
if (!Number.isFinite(sentMs)) return false;
|
|
1129
1115
|
return nowMs - sentMs > thresholdMs;
|
|
1130
1116
|
}
|
|
1131
|
-
|
|
1132
|
-
//#region extensions/imessage/src/conversation-route.ts
|
|
1117
|
+
// extensions/imessage/src/conversation-route.ts
|
|
1133
1118
|
async function resolveIMessageConversationRoute(params) {
|
|
1134
1119
|
const routeInput = {
|
|
1135
1120
|
channel: "imessage",
|
|
@@ -1188,8 +1173,7 @@ async function resolveIMessageConversationRoute(params) {
|
|
|
1188
1173
|
bindingResolution: runtimeRoute.bindingRecord ? null : bindingResolution
|
|
1189
1174
|
};
|
|
1190
1175
|
}
|
|
1191
|
-
|
|
1192
|
-
//#region src/channels/mention-gating.ts
|
|
1176
|
+
// src/channels/mention-gating.ts
|
|
1193
1177
|
function resolveBotThreadMentionPolicy(params) {
|
|
1194
1178
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
1195
1179
|
requireMention: params.requireMention,
|
|
@@ -1200,8 +1184,7 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
1200
1184
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
1201
1185
|
};
|
|
1202
1186
|
}
|
|
1203
|
-
|
|
1204
|
-
//#region extensions/imessage/src/monitor/mention-policy.ts
|
|
1187
|
+
// extensions/imessage/src/monitor/mention-policy.ts
|
|
1205
1188
|
async function resolveIMessageInboundMentionPolicy(params) {
|
|
1206
1189
|
const groups = resolveChannelGroups(params.cfg, "imessage", params.accountId);
|
|
1207
1190
|
const { "*": defaults, ...scopes } = groups ?? {};
|
|
@@ -1233,8 +1216,7 @@ async function resolveIMessageInboundMentionPolicy(params) {
|
|
|
1233
1216
|
enforceMentionRequirement: isBotOwnedThread && requireMentionInBotThreads === true
|
|
1234
1217
|
};
|
|
1235
1218
|
}
|
|
1236
|
-
|
|
1237
|
-
//#region extensions/imessage/src/monitor/reflection-guard.ts
|
|
1219
|
+
// extensions/imessage/src/monitor/reflection-guard.ts
|
|
1238
1220
|
const REFLECTION_PATTERNS = [
|
|
1239
1221
|
{
|
|
1240
1222
|
re: /(?:#\+){2,}#?/,
|
|
@@ -1287,8 +1269,7 @@ function detectReflectedContent(text) {
|
|
|
1287
1269
|
matchedLabels
|
|
1288
1270
|
};
|
|
1289
1271
|
}
|
|
1290
|
-
|
|
1291
|
-
//#region extensions/imessage/src/monitor/inbound-processing.ts
|
|
1272
|
+
// extensions/imessage/src/monitor/inbound-processing.ts
|
|
1292
1273
|
const normalizeNonEmpty = (value) => value.trim() || null;
|
|
1293
1274
|
const imessageConversationIdentityKinds = /* @__PURE__ */ new Set([
|
|
1294
1275
|
"plugin:imessage-chat-id",
|
|
@@ -1453,10 +1434,9 @@ async function resolveIMessageInboundDecision(params) {
|
|
|
1453
1434
|
const inboundMessageId = inboundMessageIds[0];
|
|
1454
1435
|
const hasInboundGuid = Boolean(normalizeReplyField(params.message.guid));
|
|
1455
1436
|
const echoScope = [];
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
} else echoScope.push(`${params.accountId}:imessage:${sender}`);
|
|
1437
|
+
const chatIdScope = formatIMessageChatTarget(chatId);
|
|
1438
|
+
if (chatIdScope && (isGroup || isSelfChat)) echoScope.push(`${params.accountId}:${chatIdScope}`);
|
|
1439
|
+
if (!isGroup) echoScope.push(`${params.accountId}:imessage:${sender}`);
|
|
1460
1440
|
if (chatGuid) echoScope.push(`${params.accountId}:chat_guid:${chatGuid}`);
|
|
1461
1441
|
if (chatIdentifier) echoScope.push(`${params.accountId}:chat_identifier:${chatIdentifier}`);
|
|
1462
1442
|
if (params.message.is_from_me) {
|
|
@@ -1927,8 +1907,7 @@ async function buildIMessageInboundContext(params) {
|
|
|
1927
1907
|
inboundHistory
|
|
1928
1908
|
};
|
|
1929
1909
|
}
|
|
1930
|
-
|
|
1931
|
-
//#region extensions/imessage/src/monitor/ingress.ts
|
|
1910
|
+
// extensions/imessage/src/monitor/ingress.ts
|
|
1932
1911
|
const IMESSAGE_INGRESS_PAYLOAD_VERSION = 1;
|
|
1933
1912
|
const IMESSAGE_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
1934
1913
|
const IMessageIngressPayloadError = createChannelIngressError("IMessageIngressPayloadError");
|
|
@@ -2079,8 +2058,7 @@ function createIMessageDurableIngress(options) {
|
|
|
2079
2058
|
waitForIdle: monitor.waitForIdle
|
|
2080
2059
|
};
|
|
2081
2060
|
}
|
|
2082
|
-
|
|
2083
|
-
//#region extensions/imessage/src/monitor/loop-rate-limiter.ts
|
|
2061
|
+
// extensions/imessage/src/monitor/loop-rate-limiter.ts
|
|
2084
2062
|
/**
|
|
2085
2063
|
* Per-conversation rate limiter that detects rapid-fire identical echo
|
|
2086
2064
|
* patterns and suppresses them before they amplify into queue overflow.
|
|
@@ -2122,8 +2100,7 @@ function createLoopRateLimiter() {
|
|
|
2122
2100
|
}
|
|
2123
2101
|
};
|
|
2124
2102
|
}
|
|
2125
|
-
|
|
2126
|
-
//#region extensions/imessage/src/monitor/media-staging.ts
|
|
2103
|
+
// extensions/imessage/src/monitor/media-staging.ts
|
|
2127
2104
|
function createTypeOnlyIMessageAttachment(attachment) {
|
|
2128
2105
|
const contentType = attachment.mime_type?.trim() || void 0;
|
|
2129
2106
|
return {
|
|
@@ -2218,8 +2195,7 @@ async function stageIMessageAttachments(attachments, params) {
|
|
|
2218
2195
|
unavailableCount
|
|
2219
2196
|
};
|
|
2220
2197
|
}
|
|
2221
|
-
|
|
2222
|
-
//#region extensions/imessage/src/monitor/poll-comment.ts
|
|
2198
|
+
// extensions/imessage/src/monitor/poll-comment.ts
|
|
2223
2199
|
const DEFAULT_COMMENT_WINDOW_MS = 15e3;
|
|
2224
2200
|
function createPollCommentFolder(options) {
|
|
2225
2201
|
const windowMs = options?.windowMs ?? DEFAULT_COMMENT_WINDOW_MS;
|
|
@@ -2247,8 +2223,7 @@ function createPollCommentFolder(options) {
|
|
|
2247
2223
|
}
|
|
2248
2224
|
};
|
|
2249
2225
|
}
|
|
2250
|
-
|
|
2251
|
-
//#region extensions/imessage/src/monitor/poll-render.ts
|
|
2226
|
+
// extensions/imessage/src/monitor/poll-render.ts
|
|
2252
2227
|
function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
2253
2228
|
const options = poll.options ?? [];
|
|
2254
2229
|
if (poll.kind === "vote" || poll.vote && options.length === 0) {
|
|
@@ -2289,8 +2264,7 @@ function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
|
2289
2264
|
const selector = renderOptions?.preferOptionId ? "pollOptionId = the stable option id shown above" : "pollOptionIndex = the option number";
|
|
2290
2265
|
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.`;
|
|
2291
2266
|
}
|
|
2292
|
-
|
|
2293
|
-
//#region extensions/imessage/src/monitor/reaction-system-event.ts
|
|
2267
|
+
// extensions/imessage/src/monitor/reaction-system-event.ts
|
|
2294
2268
|
function enqueueIMessageReactionSystemEvent(params) {
|
|
2295
2269
|
const { decision, runtime } = params;
|
|
2296
2270
|
const queued = enqueueRoutedSystemEvent(decision.text, decision.route, { contextKey: decision.contextKey });
|
|
@@ -2298,8 +2272,7 @@ function enqueueIMessageReactionSystemEvent(params) {
|
|
|
2298
2272
|
params.logVerbose?.("imessage: reaction event enqueued");
|
|
2299
2273
|
return queued;
|
|
2300
2274
|
}
|
|
2301
|
-
|
|
2302
|
-
//#region extensions/imessage/src/monitor/recovery-cursor.ts
|
|
2275
|
+
// extensions/imessage/src/monitor/recovery-cursor.ts
|
|
2303
2276
|
const RECOVERY_CURSOR_STORE_OPTIONS = {
|
|
2304
2277
|
namespace: "imessage.recovery-cursor",
|
|
2305
2278
|
maxEntries: 64
|
|
@@ -2424,8 +2397,7 @@ async function advanceIMessageRecoveryCursor(accountId, dbIdentity, rowid) {
|
|
|
2424
2397
|
});
|
|
2425
2398
|
} catch {}
|
|
2426
2399
|
}
|
|
2427
|
-
|
|
2428
|
-
//#region extensions/imessage/src/monitor/self-chat-cache.ts
|
|
2400
|
+
// extensions/imessage/src/monitor/self-chat-cache.ts
|
|
2429
2401
|
const SELF_CHAT_TTL_MS = 1e4;
|
|
2430
2402
|
const SELF_CHAT_CREATED_AT_TOLERANCE_MS = 1e3;
|
|
2431
2403
|
const MAX_SELF_CHAT_CACHE_ENTRIES = 512;
|
|
@@ -2504,8 +2476,7 @@ var DefaultSelfChatCache = class {
|
|
|
2504
2476
|
function createSelfChatCache() {
|
|
2505
2477
|
return new DefaultSelfChatCache();
|
|
2506
2478
|
}
|
|
2507
|
-
|
|
2508
|
-
//#region extensions/imessage/src/monitor/watch-error-log.ts
|
|
2479
|
+
// extensions/imessage/src/monitor/watch-error-log.ts
|
|
2509
2480
|
const MAX_WATCH_ERROR_MESSAGE_CHARS = 200;
|
|
2510
2481
|
function sanitizeIMessageWatchErrorPayload(payload) {
|
|
2511
2482
|
if (!isRecord(payload)) return {};
|
|
@@ -2517,8 +2488,7 @@ function sanitizeIMessageWatchErrorPayload(payload) {
|
|
|
2517
2488
|
}
|
|
2518
2489
|
return safe;
|
|
2519
2490
|
}
|
|
2520
|
-
|
|
2521
|
-
//#region extensions/imessage/src/monitor/monitor-provider.ts
|
|
2491
|
+
// extensions/imessage/src/monitor/monitor-provider.ts
|
|
2522
2492
|
const WATCH_SUBSCRIBE_MAX_ATTEMPTS = 3;
|
|
2523
2493
|
const WATCH_SUBSCRIBE_RETRY_DELAY_MS = 1e3;
|
|
2524
2494
|
const CHANNEL_APPROVAL_GATEWAY_RUNTIME_CONTEXT_CAPABILITY = "approval.gateway";
|
|
@@ -3440,8 +3410,7 @@ async function monitorIMessageProvider(opts) {
|
|
|
3440
3410
|
await ingress.stop();
|
|
3441
3411
|
}
|
|
3442
3412
|
}
|
|
3443
|
-
|
|
3444
|
-
//#region extensions/imessage/src/channel.runtime.ts
|
|
3413
|
+
// extensions/imessage/src/channel.runtime.ts
|
|
3445
3414
|
async function sendIMessageOutbound(params) {
|
|
3446
3415
|
const send = resolveOutboundSendDep(params.deps, "imessage", { legacyKeys: IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageIMessage;
|
|
3447
3416
|
const maxBytes = resolveChannelMediaMaxBytes({
|
|
@@ -3521,5 +3490,4 @@ async function startIMessageGatewayAccount(ctx) {
|
|
|
3521
3490
|
statusSink
|
|
3522
3491
|
});
|
|
3523
3492
|
}
|
|
3524
|
-
//#endregion
|
|
3525
3493
|
export { imessageSetupWizard, probeIMessageAccount, sendIMessageOutbound, startIMessageGatewayAccount };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as expandIMessageUserPath } from "./accounts-
|
|
2
|
-
import { i as invalidateCachedIMessagePrivateApiStatus } from "./message-tool-api-
|
|
3
|
-
import { t as getIMessageRuntime } from "./runtime-
|
|
4
|
-
import { asNullableRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { u as expandIMessageUserPath } from "./accounts-BH0coL46.mjs";
|
|
2
|
+
import { i as invalidateCachedIMessagePrivateApiStatus } from "./message-tool-api-CxSY_rh7.mjs";
|
|
3
|
+
import { t as getIMessageRuntime } from "./runtime-BRQCPuAD.mjs";
|
|
4
|
+
import { asNullableRecord, 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";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
@@ -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
|
+
// 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,12 +86,10 @@ function resolveIMessageChatMatch(cached, current) {
|
|
|
86
86
|
if (comparisons.length === 0) return "unknown";
|
|
87
87
|
return comparisons.every(Boolean) ? "match" : "mismatch";
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
//#region extensions/imessage/src/constants.ts
|
|
89
|
+
// extensions/imessage/src/constants.ts
|
|
91
90
|
const DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS = 1e4;
|
|
92
91
|
const DEFAULT_IMESSAGE_SEND_TIMEOUT_MS = 18e4;
|
|
93
|
-
|
|
94
|
-
//#region extensions/imessage/src/state-contract.ts
|
|
92
|
+
// extensions/imessage/src/state-contract.ts
|
|
95
93
|
const IMESSAGE_REPLY_CACHE_NAMESPACE = "imessage.reply-cache";
|
|
96
94
|
const IMESSAGE_REPLY_CACHE_MAX_ENTRIES = 2e3;
|
|
97
95
|
const IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE = "imessage.reply-cache-counter";
|
|
@@ -144,8 +142,7 @@ function resolveIMessageEchoMediaKey(media) {
|
|
|
144
142
|
const normalizedContentType = contentType?.split(";", 1)[0]?.trim();
|
|
145
143
|
return normalizedContentType ? `mime:${normalizedContentType}` : void 0;
|
|
146
144
|
}
|
|
147
|
-
|
|
148
|
-
//#region extensions/imessage/src/monitor-reply-cache.ts
|
|
145
|
+
// extensions/imessage/src/monitor-reply-cache.ts
|
|
149
146
|
/** Recency window for the "react to the latest message" fallback. */
|
|
150
147
|
const LATEST_FALLBACK_MS = 6e5;
|
|
151
148
|
let persistenceFailureLogged = false;
|
|
@@ -376,8 +373,7 @@ function isCurrentMessageInChat(params) {
|
|
|
376
373
|
accountId: params.accountId
|
|
377
374
|
}) === "match";
|
|
378
375
|
}
|
|
379
|
-
|
|
380
|
-
//#region extensions/imessage/src/cli-output.ts
|
|
376
|
+
// extensions/imessage/src/cli-output.ts
|
|
381
377
|
const IMESSAGE_CLI_STDOUT_MAX_BYTES = 8388608;
|
|
382
378
|
const IMESSAGE_CLI_STDERR_TAIL_BYTES = 65536;
|
|
383
379
|
function parseLastJsonObject(stdout) {
|
|
@@ -424,8 +420,7 @@ async function runIMessageCliJsonCommand(params) {
|
|
|
424
420
|
}
|
|
425
421
|
return parsed;
|
|
426
422
|
}
|
|
427
|
-
|
|
428
|
-
//#region extensions/imessage/src/bridge-recovery.ts
|
|
423
|
+
// extensions/imessage/src/bridge-recovery.ts
|
|
429
424
|
const BRIDGE_RECOVERY_TIMEOUT_MS = 3e4;
|
|
430
425
|
const recoveries = /* @__PURE__ */ new Map();
|
|
431
426
|
/**
|
|
@@ -446,8 +441,7 @@ function recoverIMessageBridge(cliPath) {
|
|
|
446
441
|
recoveries.set(cliPath, recovery);
|
|
447
442
|
return recovery;
|
|
448
443
|
}
|
|
449
|
-
|
|
450
|
-
//#region extensions/imessage/src/client.ts
|
|
444
|
+
// extensions/imessage/src/client.ts
|
|
451
445
|
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;
|
|
452
446
|
var IMessageRpcRequestError = class extends Error {
|
|
453
447
|
constructor(message, code, data) {
|
|
@@ -458,6 +452,10 @@ var IMessageRpcRequestError = class extends Error {
|
|
|
458
452
|
}
|
|
459
453
|
};
|
|
460
454
|
function isIMessageBridgeStall(error) {
|
|
455
|
+
if (error instanceof IMessageRpcRequestError && isRecord(error.data)) {
|
|
456
|
+
const { transport, detail } = error.data;
|
|
457
|
+
if (transport === "bridge_v2" && typeof detail === "string" && detail.startsWith("The bridge response deadline expired.")) return true;
|
|
458
|
+
}
|
|
461
459
|
return error instanceof Error && error.message.includes("Timed out waiting for response");
|
|
462
460
|
}
|
|
463
461
|
const BRIDGE_STALL_GUIDANCE = "The imsg private API bridge stopped responding. Run `imsg launch` to re-inject the dylib, then `openclaw channels status --probe` to refresh capability detection.";
|
|
@@ -738,5 +736,4 @@ async function createIMessageRpcClient(opts = {}) {
|
|
|
738
736
|
await client.start();
|
|
739
737
|
return client;
|
|
740
738
|
}
|
|
741
|
-
//#endregion
|
|
742
739
|
export { resolveIMessageDirectChatService as S, DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS as _, isIMessageCurrentMessageInChatAsync as a, isIMessageEmailChatIdentifier as b, resolveIMessageCachedResourceBinding as c, IMESSAGE_SENT_ECHOES_NAMESPACE as d, IMESSAGE_SENT_ECHOES_TTL_MS as f, resolveIMessageSentEchoEntryKey as g, resolveIMessageEchoMediaKey as h, findLatestIMessageEntryForChat as i, resolveIMessageMessageId as l, resolveIMessageCatchupCursorKey as m, createIMessageRpcClient as n, isKnownFromMeIMessageTarget as o, capFailureRetriesMap as p, runIMessageCliJsonCommand as r, rememberIMessageReplyCache as s, IMessageRpcRequestError as t, IMESSAGE_CATCHUP_CURSOR_NAMESPACE as u, DEFAULT_IMESSAGE_SEND_TIMEOUT_MS as v, normalizeDirectChatIdentifier as x, chatContextFromIMessageTarget 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
|
+
// extensions/imessage/src/config-ui-hints.ts
|
|
5
5
|
const iMessageChannelConfigUiHints = {
|
|
6
6
|
"": {
|
|
7
7
|
label: "iMessage",
|
|
@@ -35,8 +35,7 @@ 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
|
-
|
|
39
|
-
//#region extensions/imessage/src/config-schema.ts
|
|
38
|
+
// extensions/imessage/src/config-schema.ts
|
|
40
39
|
const IMessageActionSchema = z.object({
|
|
41
40
|
reactions: z.boolean().optional(),
|
|
42
41
|
edit: z.boolean().optional(),
|
|
@@ -118,5 +117,4 @@ const IMessageConfigSchema = IMessageAccountSchemaBase.extend({
|
|
|
118
117
|
}
|
|
119
118
|
});
|
|
120
119
|
const IMessageChannelConfigSchema = buildChannelConfigSchema(IMessageConfigSchema, { uiHints: iMessageChannelConfigUiHints });
|
|
121
|
-
//#endregion
|
|
122
120
|
export { IMessageChannelConfigSchema as t };
|
package/dist/.setup/{conversation-bindings-DR-dbHjs.mjs → conversation-bindings-vZFn6sN2.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAccountScopedConversationBindingManager, createAccountScopedConversationBindingManagerV2, resetAccountScopedConversationBindingsForTests } from "openclaw/plugin-sdk/thread-bindings-runtime";
|
|
2
|
-
|
|
2
|
+
// 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,5 +32,4 @@ function createIMessageConversationBindingManagerV2(params) {
|
|
|
32
32
|
const testing = { resetIMessageConversationBindingsForTests() {
|
|
33
33
|
resetAccountScopedConversationBindingsForTests({ stateKey: IMESSAGE_CONVERSATION_BINDINGS_STATE_KEY });
|
|
34
34
|
} };
|
|
35
|
-
//#endregion
|
|
36
35
|
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-BH0coL46.mjs";
|
|
2
2
|
import { mergeInboundPathRoots } from "openclaw/plugin-sdk/channel-inbound";
|
|
3
|
-
|
|
3
|
+
// 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,5 +10,4 @@ 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
|
|
14
13
|
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-CIx4BKqL.mjs";
|
|
2
|
+
import { c as getCachedIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-BH0coL46.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
|
+
// extensions/imessage/src/actions-contract.ts
|
|
7
7
|
const IMESSAGE_ACTIONS = {
|
|
8
8
|
react: { gate: "reactions" },
|
|
9
9
|
edit: { gate: "edit" },
|
|
@@ -35,8 +35,7 @@ const IMESSAGE_ACTIONS = {
|
|
|
35
35
|
"poll-vote": { gate: "polls" }
|
|
36
36
|
};
|
|
37
37
|
const IMESSAGE_ACTION_NAMES = Object.keys(IMESSAGE_ACTIONS);
|
|
38
|
-
|
|
39
|
-
//#region extensions/imessage/src/private-api-status.ts
|
|
38
|
+
// extensions/imessage/src/private-api-status.ts
|
|
40
39
|
const FOUNDATIONAL_RPC_METHODS = /* @__PURE__ */ new Set([
|
|
41
40
|
"chats.list",
|
|
42
41
|
"messages.history",
|
|
@@ -75,8 +74,7 @@ function setCachedIMessagePrivateApiStatus(cliPath, status, expiresAt = 0) {
|
|
|
75
74
|
expiresAt
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
//#region extensions/imessage/src/message-tool-api.ts
|
|
77
|
+
// extensions/imessage/src/message-tool-api.ts
|
|
80
78
|
function isGroupTarget(raw, chatType) {
|
|
81
79
|
if (chatType) return chatType !== "direct";
|
|
82
80
|
if (!raw) return false;
|
|
@@ -129,5 +127,4 @@ function describeIMessageMessageTool({ cfg, accountId, chatType, currentChannelI
|
|
|
129
127
|
} } : {}
|
|
130
128
|
};
|
|
131
129
|
}
|
|
132
|
-
//#endregion
|
|
133
130
|
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 { i as normalizeIMessageGuid } from "./actions-
|
|
3
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-782esTHO.mjs";
|
|
2
|
+
import { i as normalizeIMessageGuid } from "./actions-CW7XYYF4.mjs";
|
|
3
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-Bw00FkmU.mjs";
|
|
4
4
|
import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/imessage/src/question-reactions.ts
|
|
6
6
|
var question_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
hasIMessageQuestionReactionTarget: () => hasIMessageQuestionReactionTarget,
|
|
8
8
|
maybeResolveIMessageQuestionReaction: () => maybeResolveIMessageQuestionReaction,
|
|
@@ -64,5 +64,4 @@ async function maybeResolveIMessageQuestionReaction(params) {
|
|
|
64
64
|
logDebug: params.logDebug
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { maybeResolveIMessageQuestionReaction as n, question_reactions_exports as r, hasIMessageQuestionReactionTarget as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as normalizeIMessageGuid } from "./actions-
|
|
2
|
-
|
|
1
|
+
import { i as normalizeIMessageGuid } from "./actions-CW7XYYF4.mjs";
|
|
2
|
+
// extensions/imessage/src/monitor/reaction-context.ts
|
|
3
3
|
const TAPBACK_TEXT_PATTERNS = [
|
|
4
4
|
{
|
|
5
5
|
prefix: "loved",
|
|
@@ -102,5 +102,4 @@ function resolveIMessageReactionContext(message, bodyText) {
|
|
|
102
102
|
}
|
|
103
103
|
return resolveTapbackTextContext(bodyText);
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { resolveIMessageReactionContext as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as resolveLocalIMessageChatDbPath } from "./accounts-
|
|
2
|
-
import { b as isIMessageEmailChatIdentifier, c as resolveIMessageCachedResourceBinding, l as resolveIMessageMessageId, y as chatContextFromIMessageTarget } from "./client-
|
|
1
|
+
import { p as resolveLocalIMessageChatDbPath } from "./accounts-BH0coL46.mjs";
|
|
2
|
+
import { b as isIMessageEmailChatIdentifier, c as resolveIMessageCachedResourceBinding, l as resolveIMessageMessageId, y as chatContextFromIMessageTarget } from "./client-C3e7ZLqA.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { normalizeScpRemoteHost } from "openclaw/plugin-sdk/host-runtime";
|
|
5
5
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -8,7 +8,7 @@ import { randomUUID } from "node:crypto";
|
|
|
8
8
|
import { resolveRuntimeWorkerUrl, runCommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
9
9
|
import { sanitizeTempFileName } from "openclaw/plugin-sdk/temp-path";
|
|
10
10
|
import { openSqliteWorkerStore } from "openclaw/plugin-sdk/sqlite-runtime";
|
|
11
|
-
|
|
11
|
+
// extensions/imessage/src/chat-db.ts
|
|
12
12
|
function openIMessageChatDbReader(databasePath) {
|
|
13
13
|
return openSqliteWorkerStore({
|
|
14
14
|
moduleUrl: resolveRuntimeWorkerUrl({
|
|
@@ -62,8 +62,7 @@ async function withIMessageReceiptGuidReader(databasePath, use) {
|
|
|
62
62
|
} catch {}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region extensions/imessage/src/message-resource-db.ts
|
|
65
|
+
// extensions/imessage/src/message-resource-db.ts
|
|
67
66
|
function normalizeIMessageMessageGuidForLookup(messageId) {
|
|
68
67
|
const trimmed = messageId.trim();
|
|
69
68
|
const slash = trimmed.lastIndexOf("/");
|
|
@@ -135,8 +134,7 @@ async function checkIMessageResourceBinding(params) {
|
|
|
135
134
|
} catch {}
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
|
-
|
|
139
|
-
//#region extensions/imessage/src/message-resource.ts
|
|
137
|
+
// extensions/imessage/src/message-resource.ts
|
|
140
138
|
const MAX_REPLY_TO_ID_LENGTH = 256;
|
|
141
139
|
function sanitizeReplyToId(rawReplyToId) {
|
|
142
140
|
const trimmed = rawReplyToId?.trim();
|
|
@@ -186,8 +184,7 @@ async function authorizeIMessageResourceReference(params) {
|
|
|
186
184
|
if (params.conversationReadOrigin === "direct-operator") return;
|
|
187
185
|
throw new Error("Delegated iMessage message references require a current same-account conversation binding when the Messages database is unavailable.");
|
|
188
186
|
}
|
|
189
|
-
|
|
190
|
-
//#region extensions/imessage/src/remote-file.ts
|
|
187
|
+
// extensions/imessage/src/remote-file.ts
|
|
191
188
|
const SSH_OPTIONS = [
|
|
192
189
|
"-o",
|
|
193
190
|
"BatchMode=yes",
|
|
@@ -283,5 +280,4 @@ rm -rf -- ${remoteDir}
|
|
|
283
280
|
}
|
|
284
281
|
}
|
|
285
282
|
}
|
|
286
|
-
//#endregion
|
|
287
283
|
export { withIMessageReceiptGuidReader as a, resolveIMessageStartupRowidWatermark as i, authorizeIMessageResourceReference as n, resolveAuthorizedIMessageReplyReference as r, withIMessageRemoteFile as t };
|