@openclaw/imessage 2026.10.10-beta.5 → 2026.11.1
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-762Azi-J.mjs → actions-CI-2gslW.mjs} +10 -14
- package/dist/.setup/{actions.runtime-DHiRiPHe.mjs → actions.runtime-Cv8J2DCK.mjs} +6 -9
- package/dist/.setup/{api-Deyo8NDs.mjs → api-DomgyOq_.mjs} +8 -9
- package/dist/.setup/{api-BFGXDHiC.mjs → api-LHNeKI7K.mjs} +9 -9
- package/dist/.setup/{approval-handler.runtime-fsSBf2jf.mjs → approval-handler.runtime-J_1w5ZFh.mjs} +10 -11
- package/dist/.setup/{approval-reactions-CoAkCiwf.mjs → approval-reactions-U8Ku77_2.mjs} +9 -12
- package/dist/.setup/{channel-C61YdcZR.mjs → channel-DLQr-Gbj.mjs} +23 -32
- package/dist/.setup/{channel.runtime-B5jle0g3.mjs → channel.runtime-PU6bZMXQ.mjs} +53 -79
- package/dist/.setup/{client-CcROCvRq.mjs → client-CKDbW7i2.mjs} +25 -20
- 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-BD06B1Lx.mjs → question-reactions-CggXC4jv.mjs} +4 -5
- package/dist/.setup/{reaction-context-Q26DYzQH.mjs → reaction-context-k7ftOZLV.mjs} +2 -3
- package/dist/.setup/{remote-file-B94a787O.mjs → remote-file-C3WVb0XZ.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-BvxKNWzF.mjs → send-COiAb1TU.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-CKDbW7i2.mjs";
|
|
5
|
+
import { a as normalizeIMessageMessageId, i as normalizeIMessageGuid, n as probeIMessage, r as probeIMessagePrivateApi } from "./actions-CI-2gslW.mjs";
|
|
6
|
+
import { t as getIMessageRuntime } from "./runtime-BRQCPuAD.mjs";
|
|
7
|
+
import { a as resolveIMessageGroupSystemPrompt, s as resolveIMessageInboundConversationId } from "./channel-DLQr-Gbj.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-C3WVb0XZ.mjs";
|
|
12
|
+
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction } from "./approval-reactions-U8Ku77_2.mjs";
|
|
13
|
+
import { n as hasPersistedIMessageEcho, r as normalizeIMessageEchoText, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-COiAb1TU.mjs";
|
|
14
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-k7ftOZLV.mjs";
|
|
15
|
+
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-CggXC4jv.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",
|
|
@@ -1926,8 +1907,7 @@ async function buildIMessageInboundContext(params) {
|
|
|
1926
1907
|
inboundHistory
|
|
1927
1908
|
};
|
|
1928
1909
|
}
|
|
1929
|
-
|
|
1930
|
-
//#region extensions/imessage/src/monitor/ingress.ts
|
|
1910
|
+
// extensions/imessage/src/monitor/ingress.ts
|
|
1931
1911
|
const IMESSAGE_INGRESS_PAYLOAD_VERSION = 1;
|
|
1932
1912
|
const IMESSAGE_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
1933
1913
|
const IMessageIngressPayloadError = createChannelIngressError("IMessageIngressPayloadError");
|
|
@@ -2078,8 +2058,7 @@ function createIMessageDurableIngress(options) {
|
|
|
2078
2058
|
waitForIdle: monitor.waitForIdle
|
|
2079
2059
|
};
|
|
2080
2060
|
}
|
|
2081
|
-
|
|
2082
|
-
//#region extensions/imessage/src/monitor/loop-rate-limiter.ts
|
|
2061
|
+
// extensions/imessage/src/monitor/loop-rate-limiter.ts
|
|
2083
2062
|
/**
|
|
2084
2063
|
* Per-conversation rate limiter that detects rapid-fire identical echo
|
|
2085
2064
|
* patterns and suppresses them before they amplify into queue overflow.
|
|
@@ -2121,8 +2100,7 @@ function createLoopRateLimiter() {
|
|
|
2121
2100
|
}
|
|
2122
2101
|
};
|
|
2123
2102
|
}
|
|
2124
|
-
|
|
2125
|
-
//#region extensions/imessage/src/monitor/media-staging.ts
|
|
2103
|
+
// extensions/imessage/src/monitor/media-staging.ts
|
|
2126
2104
|
function createTypeOnlyIMessageAttachment(attachment) {
|
|
2127
2105
|
const contentType = attachment.mime_type?.trim() || void 0;
|
|
2128
2106
|
return {
|
|
@@ -2217,8 +2195,7 @@ async function stageIMessageAttachments(attachments, params) {
|
|
|
2217
2195
|
unavailableCount
|
|
2218
2196
|
};
|
|
2219
2197
|
}
|
|
2220
|
-
|
|
2221
|
-
//#region extensions/imessage/src/monitor/poll-comment.ts
|
|
2198
|
+
// extensions/imessage/src/monitor/poll-comment.ts
|
|
2222
2199
|
const DEFAULT_COMMENT_WINDOW_MS = 15e3;
|
|
2223
2200
|
function createPollCommentFolder(options) {
|
|
2224
2201
|
const windowMs = options?.windowMs ?? DEFAULT_COMMENT_WINDOW_MS;
|
|
@@ -2246,8 +2223,7 @@ function createPollCommentFolder(options) {
|
|
|
2246
2223
|
}
|
|
2247
2224
|
};
|
|
2248
2225
|
}
|
|
2249
|
-
|
|
2250
|
-
//#region extensions/imessage/src/monitor/poll-render.ts
|
|
2226
|
+
// extensions/imessage/src/monitor/poll-render.ts
|
|
2251
2227
|
function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
2252
2228
|
const options = poll.options ?? [];
|
|
2253
2229
|
if (poll.kind === "vote" || poll.vote && options.length === 0) {
|
|
@@ -2288,8 +2264,7 @@ function renderIMessagePollBody(poll, sender, renderOptions) {
|
|
|
2288
2264
|
const selector = renderOptions?.preferOptionId ? "pollOptionId = the stable option id shown above" : "pollOptionIndex = the option number";
|
|
2289
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.`;
|
|
2290
2266
|
}
|
|
2291
|
-
|
|
2292
|
-
//#region extensions/imessage/src/monitor/reaction-system-event.ts
|
|
2267
|
+
// extensions/imessage/src/monitor/reaction-system-event.ts
|
|
2293
2268
|
function enqueueIMessageReactionSystemEvent(params) {
|
|
2294
2269
|
const { decision, runtime } = params;
|
|
2295
2270
|
const queued = enqueueRoutedSystemEvent(decision.text, decision.route, { contextKey: decision.contextKey });
|
|
@@ -2297,8 +2272,7 @@ function enqueueIMessageReactionSystemEvent(params) {
|
|
|
2297
2272
|
params.logVerbose?.("imessage: reaction event enqueued");
|
|
2298
2273
|
return queued;
|
|
2299
2274
|
}
|
|
2300
|
-
|
|
2301
|
-
//#region extensions/imessage/src/monitor/recovery-cursor.ts
|
|
2275
|
+
// extensions/imessage/src/monitor/recovery-cursor.ts
|
|
2302
2276
|
const RECOVERY_CURSOR_STORE_OPTIONS = {
|
|
2303
2277
|
namespace: "imessage.recovery-cursor",
|
|
2304
2278
|
maxEntries: 64
|
|
@@ -2337,6 +2311,9 @@ function resolveIMessageRecoveryCursorDbIdentity(params) {
|
|
|
2337
2311
|
return `local:cli:${cliPath}`;
|
|
2338
2312
|
}
|
|
2339
2313
|
function recoveryCursorStoreKey(accountId, dbIdentity) {
|
|
2314
|
+
return createHash("sha256").update(JSON.stringify([accountId, dbIdentity]), "utf8").digest("hex").slice(0, 32);
|
|
2315
|
+
}
|
|
2316
|
+
function legacyNulRecoveryCursorStoreKey(accountId, dbIdentity) {
|
|
2340
2317
|
return `${accountId}\u0000${dbIdentity}`;
|
|
2341
2318
|
}
|
|
2342
2319
|
function decideRecoveryCursorUpdate(current, update) {
|
|
@@ -2363,7 +2340,9 @@ async function readRecoveryCursor(accountId, dbIdentity) {
|
|
|
2363
2340
|
const key = recoveryCursorStoreKey(accountId, dbIdentity);
|
|
2364
2341
|
const value = await store.lookup(key);
|
|
2365
2342
|
if (value) return Number.isFinite(value.lastRowid) ? value.lastRowid : null;
|
|
2366
|
-
const
|
|
2343
|
+
const nulKey = legacyNulRecoveryCursorStoreKey(accountId, dbIdentity);
|
|
2344
|
+
const hasNulKey = (await store.entries()).some((entry) => entry.key === nulKey);
|
|
2345
|
+
const legacy = await store.consume(hasNulKey ? nulKey : accountId);
|
|
2367
2346
|
if (legacy && Number.isFinite(legacy.lastRowid)) {
|
|
2368
2347
|
await store.registerIfAbsent(key, { lastRowid: legacy.lastRowid });
|
|
2369
2348
|
const adopted = await store.lookup(key);
|
|
@@ -2423,8 +2402,7 @@ async function advanceIMessageRecoveryCursor(accountId, dbIdentity, rowid) {
|
|
|
2423
2402
|
});
|
|
2424
2403
|
} catch {}
|
|
2425
2404
|
}
|
|
2426
|
-
|
|
2427
|
-
//#region extensions/imessage/src/monitor/self-chat-cache.ts
|
|
2405
|
+
// extensions/imessage/src/monitor/self-chat-cache.ts
|
|
2428
2406
|
const SELF_CHAT_TTL_MS = 1e4;
|
|
2429
2407
|
const SELF_CHAT_CREATED_AT_TOLERANCE_MS = 1e3;
|
|
2430
2408
|
const MAX_SELF_CHAT_CACHE_ENTRIES = 512;
|
|
@@ -2503,8 +2481,7 @@ var DefaultSelfChatCache = class {
|
|
|
2503
2481
|
function createSelfChatCache() {
|
|
2504
2482
|
return new DefaultSelfChatCache();
|
|
2505
2483
|
}
|
|
2506
|
-
|
|
2507
|
-
//#region extensions/imessage/src/monitor/watch-error-log.ts
|
|
2484
|
+
// extensions/imessage/src/monitor/watch-error-log.ts
|
|
2508
2485
|
const MAX_WATCH_ERROR_MESSAGE_CHARS = 200;
|
|
2509
2486
|
function sanitizeIMessageWatchErrorPayload(payload) {
|
|
2510
2487
|
if (!isRecord(payload)) return {};
|
|
@@ -2516,8 +2493,7 @@ function sanitizeIMessageWatchErrorPayload(payload) {
|
|
|
2516
2493
|
}
|
|
2517
2494
|
return safe;
|
|
2518
2495
|
}
|
|
2519
|
-
|
|
2520
|
-
//#region extensions/imessage/src/monitor/monitor-provider.ts
|
|
2496
|
+
// extensions/imessage/src/monitor/monitor-provider.ts
|
|
2521
2497
|
const WATCH_SUBSCRIBE_MAX_ATTEMPTS = 3;
|
|
2522
2498
|
const WATCH_SUBSCRIBE_RETRY_DELAY_MS = 1e3;
|
|
2523
2499
|
const CHANNEL_APPROVAL_GATEWAY_RUNTIME_CONTEXT_CAPABILITY = "approval.gateway";
|
|
@@ -3439,8 +3415,7 @@ async function monitorIMessageProvider(opts) {
|
|
|
3439
3415
|
await ingress.stop();
|
|
3440
3416
|
}
|
|
3441
3417
|
}
|
|
3442
|
-
|
|
3443
|
-
//#region extensions/imessage/src/channel.runtime.ts
|
|
3418
|
+
// extensions/imessage/src/channel.runtime.ts
|
|
3444
3419
|
async function sendIMessageOutbound(params) {
|
|
3445
3420
|
const send = resolveOutboundSendDep(params.deps, "imessage", { legacyKeys: IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageIMessage;
|
|
3446
3421
|
const maxBytes = resolveChannelMediaMaxBytes({
|
|
@@ -3520,5 +3495,4 @@ async function startIMessageGatewayAccount(ctx) {
|
|
|
3520
3495
|
statusSink
|
|
3521
3496
|
});
|
|
3522
3497
|
}
|
|
3523
|
-
//#endregion
|
|
3524
3498
|
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, isRecord, 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, 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";
|
|
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,17 @@ function recoverIMessageBridge(cliPath) {
|
|
|
446
441
|
recoveries.set(cliPath, recovery);
|
|
447
442
|
return recovery;
|
|
448
443
|
}
|
|
449
|
-
|
|
450
|
-
|
|
444
|
+
// extensions/imessage/src/process-diagnostics.ts
|
|
445
|
+
function describeIMessageAutomationFailure(data, remoteHost) {
|
|
446
|
+
const failure = asOptionalRecord(data);
|
|
447
|
+
if (failure?.transport !== "applescript" || typeof failure.detail !== "string") return;
|
|
448
|
+
const code = /^Messages automation failed with AppleScript error (-1712|-1743)\.$/u.exec(failure.detail)?.[1];
|
|
449
|
+
if (!code) return;
|
|
450
|
+
const reason = code === "-1743" ? "Messages Automation was denied." : "Messages Automation timed out. A missing Automation grant is one possible cause.";
|
|
451
|
+
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
|
+
return reason + " " + context + " Channel probes do not verify sending.";
|
|
453
|
+
}
|
|
454
|
+
// extensions/imessage/src/client.ts
|
|
451
455
|
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
456
|
var IMessageRpcRequestError = class extends Error {
|
|
453
457
|
constructor(message, code, data) {
|
|
@@ -518,7 +522,8 @@ var IMessageRpcClient = class {
|
|
|
518
522
|
this.configuredCliPath = opts.cliPath?.trim() || "imsg";
|
|
519
523
|
this.cliPath = expandIMessageUserPath(this.configuredCliPath);
|
|
520
524
|
const dbPath = opts.dbPath?.trim();
|
|
521
|
-
this.
|
|
525
|
+
this.remoteHost = opts.remoteHost?.trim();
|
|
526
|
+
this.dbPath = dbPath ? this.remoteHost ? dbPath : resolveUserPath(dbPath) : void 0;
|
|
522
527
|
this.runtime = opts.runtime;
|
|
523
528
|
this.onNotification = opts.onNotification;
|
|
524
529
|
this.terminal = new Promise((resolve) => {
|
|
@@ -695,7 +700,8 @@ var IMessageRpcClient = class {
|
|
|
695
700
|
if (detailText) suffixes.push(detailText);
|
|
696
701
|
}
|
|
697
702
|
const msg = suffixes.length > 0 ? `${baseMessage}: ${suffixes.join(" ")}` : baseMessage;
|
|
698
|
-
|
|
703
|
+
const guidance = describeIMessageAutomationFailure(details, this.remoteHost);
|
|
704
|
+
pending.reject(new IMessageRpcRequestError(guidance ? `${msg} ${guidance}` : msg, typeof code === "number" ? code : void 0, details));
|
|
699
705
|
return;
|
|
700
706
|
}
|
|
701
707
|
pending.resolve(parsed.result);
|
|
@@ -742,5 +748,4 @@ async function createIMessageRpcClient(opts = {}) {
|
|
|
742
748
|
await client.start();
|
|
743
749
|
return client;
|
|
744
750
|
}
|
|
745
|
-
//#endregion
|
|
746
751
|
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-CI-2gslW.mjs";
|
|
3
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-k7ftOZLV.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-CI-2gslW.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 };
|