@openclaw/imessage 2026.8.1 → 2026.8.33
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/{actions.runtime-CAl3WcqD.js → .setup/actions.runtime-7i9cenww.mjs} +5 -4
- package/dist/.setup/api-BvCc-j9Y.mjs +13 -0
- package/dist/.setup/api-CA2sYw-U.mjs +9 -0
- package/dist/{approval-handler.runtime-UBd1j2Sg.js → .setup/approval-handler.runtime-CEJDc0nf.mjs} +9 -8
- package/dist/{approval-reactions-LL5yn1Rc.js → .setup/approval-reactions-DBDufqqo.mjs} +7 -7
- package/dist/{channel-DNI9DKGN.js → .setup/channel-B5sr6Nz8.mjs} +13 -12
- package/dist/{channel.runtime-HSkrmWfW.js → .setup/channel.runtime-BusYSoDo.mjs} +7 -7
- package/dist/{group-policy-Dvc-BcWo.js → .setup/group-policy-CVOrXCD2.mjs} +17 -10
- package/dist/{media-contract-D-FhGE98.js → .setup/media-contract-jvc40xda.mjs} +3 -2
- package/dist/{message-tool-api-CvIgJpOo.js → .setup/message-tool-api-DD3BOMxR.mjs} +7 -5
- package/dist/{monitor-BywJn1QW.js → .setup/monitor-NTVwTVyx.mjs} +26 -23
- package/dist/{question-reactions-viP7ZcyG.js → .setup/question-reactions-DWze6La6.mjs} +2 -2
- package/dist/{remote-file-6mCj2ZBy.js → .setup/remote-file-DSZLzYEw.mjs} +9 -8
- package/dist/{sanitize-outbound-Du-r1lNQ.js → .setup/sanitize-outbound-ZWjQvu-s.mjs} +31 -27
- package/dist/{send-mgWPKqSV.js → .setup/send-BZ6OgsJ-.mjs} +22 -21
- package/dist/{state-contract-4TK_cDDb.js → .setup/state-contract-DvahEY4X.mjs} +2 -2
- package/dist/{state-migrations-SFdKp3GQ.js → .setup/state-migrations-BVsOuPqy.mjs} +2 -2
- package/dist/api.js +8 -14
- 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 +1 -1
- package/dist/media-contract-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +6 -6
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -1
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/package.json +5 -5
- /package/dist/{accounts-CCirBEIm.js → .setup/accounts-CCirBEIm.mjs} +0 -0
- /package/dist/{config-schema-DuGbA8Kp.js → .setup/config-schema-DuGbA8Kp.mjs} +0 -0
- /package/dist/{conversation-bindings-GDQ_Laxj.js → .setup/conversation-bindings-GDQ_Laxj.mjs} +0 -0
- /package/dist/{outbound-send-deps-B-QEsLSM.js → .setup/outbound-send-deps-B-QEsLSM.mjs} +0 -0
- /package/dist/{reaction-context-BAYI7pz0.js → .setup/reaction-context-BAYI7pz0.mjs} +0 -0
- /package/dist/{rolldown-runtime-D7D4PA-g.js → .setup/rolldown-runtime-D7D4PA-g.mjs} +0 -0
- /package/dist/{runtime-Cza4CY5T.js → .setup/runtime-Cza4CY5T.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as normalizeDirectChatIdentifier, f as resolveIMessageMessageId, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient } from "./sanitize-outbound-
|
|
2
|
-
import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-
|
|
1
|
+
import { _ as normalizeDirectChatIdentifier, f as resolveIMessageMessageId, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
2
|
+
import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-DSZLzYEw.mjs";
|
|
3
3
|
import { basename, parse, win32 } from "node:path";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { asDateTimestampMs, parseStrictInteger, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -7,7 +7,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
7
7
|
import { sanitizeUntrustedFileName } from "openclaw/plugin-sdk/security-runtime";
|
|
8
8
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
9
9
|
//#region extensions/imessage/src/actions-chat-guid.ts
|
|
10
|
-
const CHAT_LIST_CACHE_TTL_MS =
|
|
10
|
+
const CHAT_LIST_CACHE_TTL_MS = 3e4;
|
|
11
11
|
const chatListCache = /* @__PURE__ */ new Map();
|
|
12
12
|
function asChatList(value) {
|
|
13
13
|
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
@@ -129,7 +129,8 @@ async function withTempFile(input, fn) {
|
|
|
129
129
|
rootDir: resolvePreferredOpenClawTmpDir(),
|
|
130
130
|
prefix: "openclaw-imessage-"
|
|
131
131
|
}, async (workspace) => {
|
|
132
|
-
const
|
|
132
|
+
const safeFilename = sanitizeUntrustedFileName(input.filename, "upload.bin");
|
|
133
|
+
const { name, ext: safeExtension } = parse(safeFilename);
|
|
133
134
|
const originalExtension = parse(win32.basename(basename(input.filename))).ext;
|
|
134
135
|
const extension = truncateUtf16Safe(sanitizeUntrustedFileName(originalExtension, safeExtension), 16);
|
|
135
136
|
const filename = `${truncateUtf16Safe(name, 80 - extension.length)}${extension}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { v as imessageSetupContract } from "./group-policy-CVOrXCD2.mjs";
|
|
4
|
+
import { n as createIMessagePluginBase, r as imessageSetupWizard } from "./channel-B5sr6Nz8.mjs";
|
|
5
|
+
import "./conversation-bindings-GDQ_Laxj.mjs";
|
|
6
|
+
import { createAllowedChatSenderMatcher as createAllowedChatSenderMatcher$1, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow as parseChatTargetPrefixesOrThrow$1, resolveServicePrefixedAllowTarget, resolveServicePrefixedChatTarget as resolveServicePrefixedChatTarget$1, resolveServicePrefixedOrChatAllowTarget as resolveServicePrefixedOrChatAllowTarget$1, resolveServicePrefixedTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
7
|
+
//#region extensions/imessage/src/channel.setup.ts
|
|
8
|
+
const imessageSetupPlugin = { ...createIMessagePluginBase({
|
|
9
|
+
setupWizard: imessageSetupWizard,
|
|
10
|
+
setupContract: imessageSetupContract
|
|
11
|
+
}) };
|
|
12
|
+
//#endregion
|
|
13
|
+
export { resolveServicePrefixedChatTarget$1 as a, imessageSetupPlugin as c, resolveServicePrefixedAllowTarget as i, parseChatAllowTargetPrefixes as n, resolveServicePrefixedOrChatAllowTarget$1 as o, parseChatTargetPrefixesOrThrow$1 as r, resolveServicePrefixedTarget as s, createAllowedChatSenderMatcher$1 as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { a as isAllowedIMessageSender, c as parseIMessageAllowTarget, g as IMESSAGE_ACTION_NAMES, h as IMESSAGE_ACTIONS, l as parseIMessageTarget, n as formatIMessageChatTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { a as normalizeIMessageAcpConversationId, c as normalizeIMessageMessagingTarget, f as probeIMessage, i as matchIMessageAcpConversation, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, r as resolveIMessageInboundConversationId, s as looksLikeIMessageTargetId, t as resolveIMessageGroupRequireMention } from "./group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { t as imessagePlugin } from "./channel-B5sr6Nz8.mjs";
|
|
6
|
+
import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.mjs";
|
|
7
|
+
import { a as resolveServicePrefixedChatTarget, c as imessageSetupPlugin, i as resolveServicePrefixedAllowTarget, n as parseChatAllowTargetPrefixes, o as resolveServicePrefixedOrChatAllowTarget, r as parseChatTargetPrefixesOrThrow, s as resolveServicePrefixedTarget, t as createAllowedChatSenderMatcher } from "./api-BvCc-j9Y.mjs";
|
|
8
|
+
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.mjs";
|
|
9
|
+
export { DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, IMESSAGE_ACTIONS, IMESSAGE_ACTION_NAMES, IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS, createAllowedChatSenderMatcher, createIMessageConversationBindingManager, formatIMessageChatTarget, imessagePlugin, imessageSetupPlugin, inferIMessageTargetChatType, isAllowedIMessageSender, listEnabledIMessageAccounts, listIMessageAccountIds, looksLikeIMessageExplicitTargetId, looksLikeIMessageTargetId, matchIMessageAcpConversation, normalizeIMessageAcpConversationId, normalizeIMessageHandle, normalizeIMessageMessagingTarget, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow, parseIMessageAllowTarget, parseIMessageTarget, probeIMessage, resolveDefaultIMessageAccountId, resolveIMessageAccount, resolveIMessageConversationIdFromTarget, resolveIMessageGroupRequireMention, resolveIMessageGroupToolPolicy, resolveIMessageInboundConversationId, resolveServicePrefixedAllowTarget, resolveServicePrefixedChatTarget, resolveServicePrefixedOrChatAllowTarget, resolveServicePrefixedTarget };
|
package/dist/{approval-handler.runtime-UBd1j2Sg.js → .setup/approval-handler.runtime-CEJDc0nf.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
2
|
-
import { f as getCachedIMessagePrivateApiStatus, l as parseIMessageTarget } from "./message-tool-api-
|
|
3
|
-
import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-
|
|
4
|
-
import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-
|
|
5
|
-
import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-
|
|
6
|
-
import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-
|
|
1
|
+
import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { f as getCachedIMessagePrivateApiStatus, l as parseIMessageTarget } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-DBDufqqo.mjs";
|
|
6
|
+
import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-BZ6OgsJ-.mjs";
|
|
7
7
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
8
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -13,7 +13,7 @@ import { buildChannelApprovalExpiredText, buildChannelApprovalResolvedText, crea
|
|
|
13
13
|
import { setTimeout } from "node:timers/promises";
|
|
14
14
|
//#region extensions/imessage/src/approval-handler.runtime.ts
|
|
15
15
|
const log = createSubsystemLogger("imessage/approvals");
|
|
16
|
-
const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-
|
|
16
|
+
const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-7i9cenww.mjs"), "imessageActionsRuntime");
|
|
17
17
|
const DEFAULT_PROBE_TIMEOUT_MS = 5e3;
|
|
18
18
|
const APPROVAL_POLL_ORDERING_DELAY_MS = 1100;
|
|
19
19
|
function buildPendingPayload(params) {
|
|
@@ -69,7 +69,8 @@ function canIMessageApprovalUsePoll(params) {
|
|
|
69
69
|
cfg: params.cfg,
|
|
70
70
|
accountId: account.accountId
|
|
71
71
|
}).length === 0) return false;
|
|
72
|
-
const
|
|
72
|
+
const cliPath = account.config.cliPath?.trim() || "imsg";
|
|
73
|
+
const status = getCachedIMessagePrivateApiStatus(cliPath);
|
|
73
74
|
return status?.available === true && status?.selectors?.pollPayloadMessage === true && status.cliCapabilities?.pollSendSupportsNoComment === true;
|
|
74
75
|
} catch {
|
|
75
76
|
return false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.
|
|
2
|
-
import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-
|
|
3
|
-
import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-
|
|
4
|
-
import { n as getOptionalIMessageRuntime } from "./runtime-Cza4CY5T.
|
|
5
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-CVOrXCD2.mjs";
|
|
4
|
+
import { n as getOptionalIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
5
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.mjs";
|
|
6
6
|
import { createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { asDateTimestampMs, isFutureDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -72,7 +72,7 @@ function buildIMessageApprovalConversationKeyForInbound(params) {
|
|
|
72
72
|
//#region extensions/imessage/src/approval-reaction-poll-targets.ts
|
|
73
73
|
const PERSISTENT_POLL_TARGET_NAMESPACE = "imessage.approval-reaction-poll-targets";
|
|
74
74
|
const PERSISTENT_MAX_ENTRIES$1 = 1e3;
|
|
75
|
-
const DEFAULT_REACTION_TARGET_TTL_MS$1 =
|
|
75
|
+
const DEFAULT_REACTION_TARGET_TTL_MS$1 = 864e5;
|
|
76
76
|
const pendingReactionPollTargets = /* @__PURE__ */ new Map();
|
|
77
77
|
function prunePendingReactionPollTargets(nowMs = Date.now()) {
|
|
78
78
|
for (const [key, target] of pendingReactionPollTargets.entries()) if (!isFutureDateTimestampMs(target.expiresAtMs, { nowMs })) pendingReactionPollTargets.delete(key);
|
|
@@ -226,7 +226,7 @@ var approval_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
|
226
226
|
});
|
|
227
227
|
const PERSISTENT_NAMESPACE = "imessage.approval-reactions";
|
|
228
228
|
const PERSISTENT_MAX_ENTRIES = 1e3;
|
|
229
|
-
const DEFAULT_REACTION_TARGET_TTL_MS =
|
|
229
|
+
const DEFAULT_REACTION_TARGET_TTL_MS = 864e5;
|
|
230
230
|
const loadResolveApprovalOverGateway = createLazyRuntimeSurface(() => import("openclaw/plugin-sdk/approval-gateway-runtime"), (runtime) => runtime.resolveApprovalOverGateway);
|
|
231
231
|
const reportPersistentApprovalReactionError = createPluginStateErrorReporter(getOptionalIMessageRuntime, "imessage", "approval-reaction-state", "iMessage persistent approval reaction state failed");
|
|
232
232
|
function reportApprovalBindingCorrelationMismatch(binding) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-CCirBEIm.
|
|
2
|
-
import { l as parseIMessageTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle, u as isIMessagePhoneLikeHandle } from "./message-tool-api-
|
|
3
|
-
import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, v as resolveIMessageDirectChatService } from "./sanitize-outbound-
|
|
4
|
-
import { a as normalizeIMessageAcpConversationId, c as normalizeIMessageMessagingTarget, d as imessageMessageActions, h as createIMessageSetupWizardProxy, i as matchIMessageAcpConversation, l as getIMessageApprovalApprovers, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, t as resolveIMessageGroupRequireMention, u as imessageApprovalAuth, v as imessageSetupContract } from "./group-policy-
|
|
5
|
-
import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.
|
|
6
|
-
import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.
|
|
7
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-
|
|
1
|
+
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { l as parseIMessageTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle, u as isIMessagePhoneLikeHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, v as resolveIMessageDirectChatService } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { a as normalizeIMessageAcpConversationId, c as normalizeIMessageMessagingTarget, d as imessageMessageActions, h as createIMessageSetupWizardProxy, i as matchIMessageAcpConversation, l as getIMessageApprovalApprovers, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, t as resolveIMessageGroupRequireMention, u as imessageApprovalAuth, v as imessageSetupContract } from "./group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.mjs";
|
|
6
|
+
import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.mjs";
|
|
7
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-jvc40xda.mjs";
|
|
8
8
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
9
9
|
import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
10
10
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, formatTrimmedAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -86,7 +86,7 @@ const imessageApproval = createApproverRestrictedNativeApprovalCapabilityFromFor
|
|
|
86
86
|
approvalKind,
|
|
87
87
|
request
|
|
88
88
|
}),
|
|
89
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
89
|
+
load: async () => (await import("./approval-handler.runtime-CEJDc0nf.mjs")).imessageApprovalNativeRuntime
|
|
90
90
|
})
|
|
91
91
|
});
|
|
92
92
|
const imessageApprovalRouting = imessageApproval.routing;
|
|
@@ -201,7 +201,7 @@ const imessageDoctor = {
|
|
|
201
201
|
//#region extensions/imessage/src/shared.ts
|
|
202
202
|
const IMESSAGE_CHANNEL = "imessage";
|
|
203
203
|
async function loadIMessageChannelRuntime$1() {
|
|
204
|
-
return await import("./channel.runtime-
|
|
204
|
+
return await import("./channel.runtime-BusYSoDo.mjs");
|
|
205
205
|
}
|
|
206
206
|
const imessageSetupWizard = createIMessageSetupWizardProxy(async () => (await loadIMessageChannelRuntime$1()).imessageSetupWizard);
|
|
207
207
|
const imessageConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -300,7 +300,7 @@ async function probeIMessageStatusAccount(params) {
|
|
|
300
300
|
}
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region extensions/imessage/src/channel.ts
|
|
303
|
-
const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
303
|
+
const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BusYSoDo.mjs"));
|
|
304
304
|
function toIMessageMessageSendResult(result, kind, replyToId) {
|
|
305
305
|
const receipt = result.receipt ?? createMessageReceiptFromOutboundResults({
|
|
306
306
|
results: result.messageId ? [{
|
|
@@ -316,8 +316,8 @@ function toIMessageMessageSendResult(result, kind, replyToId) {
|
|
|
316
316
|
...result.meta && Object.keys(result.meta).length > 0 ? { meta: result.meta } : {}
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
320
|
-
const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-
|
|
319
|
+
const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-DBDufqqo.mjs").then((n) => n.t));
|
|
320
|
+
const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-DWze6La6.mjs").then((n) => n.r));
|
|
321
321
|
async function prepareForwardedIMessageApprovalPayload(params) {
|
|
322
322
|
const prepared = (await loadIMessageApprovalReactionsModule()).addIMessageApprovalReactionHintToStructuredPayload(params);
|
|
323
323
|
if (prepared) Object.assign(params.payload, prepared);
|
|
@@ -465,6 +465,7 @@ const imessagePlugin = createChatChannelPlugin({
|
|
|
465
465
|
resolveRequireMention: resolveIMessageGroupRequireMention,
|
|
466
466
|
resolveToolPolicy: resolveIMessageGroupToolPolicy
|
|
467
467
|
},
|
|
468
|
+
agentPrompt: { messageToolHints: () => ["- iMessage current conversation: omit target, to, chatId, chatGuid, and chatIdentifier. OpenClaw resolves the trusted current chat server-side; never copy a redacted display value such as `***` into message actions."] },
|
|
468
469
|
doctor: imessageDoctor,
|
|
469
470
|
conversationBindings: {
|
|
470
471
|
supportsCurrentConversationBinding: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-CCirBEIm.
|
|
2
|
-
import { _ as imessageDmPolicy, b as isAutoManagedIMessageCliPath, f as probeIMessage, g as imessageCompletionNote, m as createIMessageCliPathTextInput, p as IMESSAGE_INSTALL_COMMAND, x as normalizeIMessageCliPathForSetup, y as imessageSetupStatusBase } from "./group-policy-
|
|
3
|
-
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.
|
|
4
|
-
import { t as sendMessageIMessage } from "./send-
|
|
5
|
-
import { t as monitorIMessageProvider } from "./monitor-
|
|
1
|
+
import { l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { _ as imessageDmPolicy, b as isAutoManagedIMessageCliPath, f as probeIMessage, g as imessageCompletionNote, m as createIMessageCliPathTextInput, p as IMESSAGE_INSTALL_COMMAND, x as normalizeIMessageCliPathForSetup, y as imessageSetupStatusBase } from "./group-policy-CVOrXCD2.mjs";
|
|
3
|
+
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.mjs";
|
|
4
|
+
import { t as sendMessageIMessage } from "./send-BZ6OgsJ-.mjs";
|
|
5
|
+
import { t as monitorIMessageProvider } from "./monitor-NTVwTVyx.mjs";
|
|
6
6
|
import { createAccountStatusSink, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -87,7 +87,7 @@ async function installIMessageCli(runtime, opts) {
|
|
|
87
87
|
}
|
|
88
88
|
const update = await runPluginCommandWithTimeout({
|
|
89
89
|
argv: [brewExe, "update"],
|
|
90
|
-
timeoutMs:
|
|
90
|
+
timeoutMs: 3e5
|
|
91
91
|
});
|
|
92
92
|
if (update.code !== 0) return {
|
|
93
93
|
ok: false,
|
|
@@ -97,7 +97,7 @@ async function installIMessageCli(runtime, opts) {
|
|
|
97
97
|
const command = opts?.upgrade ? ["upgrade", "imsg"] : ["install", "steipete/tap/imsg"];
|
|
98
98
|
const result = await runPluginCommandWithTimeout({
|
|
99
99
|
argv: [brewExe, ...command],
|
|
100
|
-
timeoutMs:
|
|
100
|
+
timeoutMs: 9e5
|
|
101
101
|
});
|
|
102
102
|
if (result.code !== 0) return {
|
|
103
103
|
ok: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveDefaultIMessageAccountId, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount, u as expandIMessageUserPath } from "./accounts-CCirBEIm.
|
|
2
|
-
import { d as normalizeBareIMessageChatIdentifier, f as getCachedIMessagePrivateApiStatus, g as IMESSAGE_ACTION_NAMES, h as IMESSAGE_ACTIONS, l as parseIMessageTarget, m as setCachedIMessagePrivateApiStatus, p as imessageRpcSupportsMethod, s as normalizeIMessageHandle$1, t as describeIMessageMessageTool, u as isIMessagePhoneLikeHandle } from "./message-tool-api-
|
|
3
|
-
import { c as isIMessageCurrentMessageInChat, h as chatContextFromIMessageTarget, o as createIMessageRpcClient, s as findLatestIMessageEntryForChat, u as rememberIMessageReplyCache } from "./sanitize-outbound-
|
|
1
|
+
import { a as resolveDefaultIMessageAccountId, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount, u as expandIMessageUserPath } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { d as normalizeBareIMessageChatIdentifier, f as getCachedIMessagePrivateApiStatus, g as IMESSAGE_ACTION_NAMES, h as IMESSAGE_ACTIONS, l as parseIMessageTarget, m as setCachedIMessagePrivateApiStatus, p as imessageRpcSupportsMethod, s as normalizeIMessageHandle$1, t as describeIMessageMessageTool, u as isIMessagePhoneLikeHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { c as isIMessageCurrentMessageInChat, h as chatContextFromIMessageTarget, o as createIMessageRpcClient, s as findLatestIMessageEntryForChat, u as rememberIMessageReplyCache } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
4
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
@@ -276,8 +276,8 @@ function createIMessageSetupWizardProxy(loadWizard) {
|
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region extensions/imessage/src/probe.ts
|
|
279
|
-
const RPC_SUPPORT_CACHE_TTL_MS =
|
|
280
|
-
const PRIVATE_API_NEGATIVE_TTL_MS =
|
|
279
|
+
const RPC_SUPPORT_CACHE_TTL_MS = 3e5;
|
|
280
|
+
const PRIVATE_API_NEGATIVE_TTL_MS = 1e4;
|
|
281
281
|
const rpcSupportCache = /* @__PURE__ */ new Map();
|
|
282
282
|
function cacheIMessagePrivateApiStatus(cliPath, status) {
|
|
283
283
|
if (status.available) {
|
|
@@ -519,7 +519,7 @@ async function probeIMessage(timeoutMs, opts = {}) {
|
|
|
519
519
|
}
|
|
520
520
|
//#endregion
|
|
521
521
|
//#region extensions/imessage/src/actions.ts
|
|
522
|
-
const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-
|
|
522
|
+
const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-7i9cenww.mjs"), "imessageActionsRuntime");
|
|
523
523
|
const log = createSubsystemLogger("channels/imessage");
|
|
524
524
|
const providerId = "imessage";
|
|
525
525
|
const SUPPORTED_ACTIONS = /* @__PURE__ */ new Set([...IMESSAGE_ACTION_NAMES, "upload-file"]);
|
|
@@ -533,10 +533,14 @@ const GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
533
533
|
function readMessageText(params) {
|
|
534
534
|
return readStringParam(params, "text") ?? readStringParam(params, "message");
|
|
535
535
|
}
|
|
536
|
+
function rejectRedactedIMessageTarget(value) {
|
|
537
|
+
if (value === "***") throw new Error("iMessage action target is a redacted display value. Omit the target to use the current conversation.");
|
|
538
|
+
return value;
|
|
539
|
+
}
|
|
536
540
|
function resolveIMessageDeliveryTarget(args) {
|
|
537
|
-
const chatGuid = readStringParam(args, "chatGuid");
|
|
541
|
+
const chatGuid = rejectRedactedIMessageTarget(readStringParam(args, "chatGuid"));
|
|
538
542
|
const chatId = readPositiveIntegerParam(args, "chatId");
|
|
539
|
-
const chatIdentifier = readStringParam(args, "chatIdentifier");
|
|
543
|
+
const chatIdentifier = rejectRedactedIMessageTarget(readStringParam(args, "chatIdentifier"));
|
|
540
544
|
const targets = [
|
|
541
545
|
chatGuid ? `chat_guid:${chatGuid}` : void 0,
|
|
542
546
|
chatId !== void 0 ? `chat_id:${chatId}` : void 0,
|
|
@@ -547,6 +551,7 @@ function resolveIMessageDeliveryTarget(args) {
|
|
|
547
551
|
}
|
|
548
552
|
function resolveIMessageActionTarget(params) {
|
|
549
553
|
const rawTarget = resolveIMessageDeliveryTarget(params.actionParams) ?? readStringParam(params.actionParams, "to") ?? readStringParam(params.actionParams, "target") ?? (params.currentChannelId?.trim() || void 0);
|
|
554
|
+
rejectRedactedIMessageTarget(rawTarget);
|
|
550
555
|
return rawTarget ? parseIMessageTarget(rawTarget) : null;
|
|
551
556
|
}
|
|
552
557
|
const IMESSAGE_DELIVERY_TARGET_ALIASES = [
|
|
@@ -1099,9 +1104,11 @@ const imessageMessageActions = {
|
|
|
1099
1104
|
await assertPrivateApiEnabled();
|
|
1100
1105
|
if (privateApiStatus?.selectors?.pollPayloadMessage !== true) await probePrivateApiStatus(true);
|
|
1101
1106
|
if (privateApiStatus?.selectors?.pollPayloadMessage !== true) throw new Error("iMessage poll requires an imsg bridge that advertises the pollPayloadMessage selector. Update imsg, run imsg launch to re-inject the bridge, then run openclaw channels status --probe to refresh capability detection.");
|
|
1107
|
+
const question = readStringParam(params, "pollQuestion", { required: true });
|
|
1108
|
+
const rawChoices = readStringArrayParam(params, "pollOption", { required: true });
|
|
1102
1109
|
const poll = normalizePollInput({
|
|
1103
|
-
question
|
|
1104
|
-
options:
|
|
1110
|
+
question,
|
|
1111
|
+
options: rawChoices
|
|
1105
1112
|
}, { maxOptions: 12 });
|
|
1106
1113
|
const resolvedChatGuid = await chatGuid();
|
|
1107
1114
|
const result = await runtime.sendPoll({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
1
|
+
import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.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);
|
|
7
|
+
return mergeInboundPathRoots(account.config.attachmentRoots, params.cfg.channels?.imessage?.attachmentRoots, DEFAULT_IMESSAGE_ATTACHMENT_ROOTS);
|
|
7
8
|
}
|
|
8
9
|
function resolveIMessageRemoteAttachmentRoots(params) {
|
|
9
10
|
const account = resolveIMessageAccount(params);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getCachedIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
1
|
+
import { c as getCachedIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-CCirBEIm.mjs";
|
|
2
2
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -208,9 +208,10 @@ function parseIMessageAllowTarget(raw) {
|
|
|
208
208
|
kind: "handle",
|
|
209
209
|
handle: ""
|
|
210
210
|
};
|
|
211
|
+
const lower = normalizeLowercaseStringOrEmpty(trimmed);
|
|
211
212
|
const servicePrefixed = resolveServicePrefixedOrChatAllowTarget({
|
|
212
213
|
trimmed,
|
|
213
|
-
lower
|
|
214
|
+
lower,
|
|
214
215
|
servicePrefixes: SERVICE_PREFIXES,
|
|
215
216
|
parseAllowTarget: parseIMessageAllowTarget,
|
|
216
217
|
chatIdPrefixes: CHAT_ID_PREFIXES,
|
|
@@ -263,11 +264,12 @@ const PRIVATE_API_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
263
264
|
"poll",
|
|
264
265
|
"poll-vote"
|
|
265
266
|
]);
|
|
266
|
-
function isGroupTarget(raw) {
|
|
267
|
+
function isGroupTarget(raw, chatType) {
|
|
268
|
+
if (chatType) return chatType !== "direct";
|
|
267
269
|
if (!raw) return false;
|
|
268
270
|
return inferIMessageTargetChatType(raw) === "group";
|
|
269
271
|
}
|
|
270
|
-
function describeIMessageMessageTool({ cfg, accountId, currentChannelId }) {
|
|
272
|
+
function describeIMessageMessageTool({ cfg, accountId, chatType, currentChannelId }) {
|
|
271
273
|
const account = resolveIMessageAccount({
|
|
272
274
|
cfg,
|
|
273
275
|
accountId
|
|
@@ -292,7 +294,7 @@ function describeIMessageMessageTool({ cfg, accountId, currentChannelId }) {
|
|
|
292
294
|
if (action === "poll-vote" && privateApiStatus && !imessageRpcSupportsMethod(privateApiStatus, "poll.vote")) continue;
|
|
293
295
|
actions.add(action);
|
|
294
296
|
}
|
|
295
|
-
if (!isGroupTarget(currentChannelId)) {
|
|
297
|
+
if (!isGroupTarget(currentChannelId, chatType)) {
|
|
296
298
|
for (const action of IMESSAGE_ACTION_NAMES) if ("groupOnly" in IMESSAGE_ACTIONS[action] && IMESSAGE_ACTIONS[action].groupOnly) actions.delete(action);
|
|
297
299
|
}
|
|
298
300
|
if (actions.delete("sendAttachment")) actions.add("upload-file");
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { d as resolveIMessageChatDbLookupPath, f as resolveIMessageHomeDir, l as resolveIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
2
|
-
import { c as parseIMessageAllowTarget, f as getCachedIMessagePrivateApiStatus, i as isAllowedIMessageReplyContextSender, l as parseIMessageTarget, n as formatIMessageChatTarget, p as imessageRpcSupportsMethod, s as normalizeIMessageHandle } from "./message-tool-api-
|
|
3
|
-
import { l as isKnownFromMeIMessageMessageId, o as createIMessageRpcClient, r as sanitizeOutboundText, u as rememberIMessageReplyCache, v as resolveIMessageDirectChatService } from "./sanitize-outbound-
|
|
4
|
-
import { f as probeIMessage, r as resolveIMessageInboundConversationId } from "./group-policy-
|
|
5
|
-
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.
|
|
6
|
-
import { d as resolveIMessageEchoMediaKey, l as capFailureRetriesMap, t as IMESSAGE_CATCHUP_CURSOR_NAMESPACE, u as resolveIMessageCatchupCursorKey } from "./state-contract-
|
|
7
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-
|
|
8
|
-
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction, s as buildIMessageApprovalConversationKeyForInbound } from "./approval-reactions-
|
|
9
|
-
import { c as iMessageApprovalControlBindings, n as hasPersistedIMessageEcho, r as stripLeadingEchoTextCorruptionMarkers, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-
|
|
10
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.
|
|
11
|
-
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-
|
|
1
|
+
import { d as resolveIMessageChatDbLookupPath, f as resolveIMessageHomeDir, l as resolveIMessageRemoteHost, o as resolveIMessageAccount } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { c as parseIMessageAllowTarget, f as getCachedIMessagePrivateApiStatus, i as isAllowedIMessageReplyContextSender, l as parseIMessageTarget, n as formatIMessageChatTarget, p as imessageRpcSupportsMethod, s as normalizeIMessageHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { l as isKnownFromMeIMessageMessageId, o as createIMessageRpcClient, r as sanitizeOutboundText, u as rememberIMessageReplyCache, v as resolveIMessageDirectChatService } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { f as probeIMessage, r as resolveIMessageInboundConversationId } from "./group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
6
|
+
import { d as resolveIMessageEchoMediaKey, l as capFailureRetriesMap, t as IMESSAGE_CATCHUP_CURSOR_NAMESPACE, u as resolveIMessageCatchupCursorKey } from "./state-contract-DvahEY4X.mjs";
|
|
7
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-jvc40xda.mjs";
|
|
8
|
+
import { i as registerIMessageApprovalReactionTarget, n as handleIMessageApprovalReaction, o as listPendingIMessageApprovalReactionPollTargets, r as maybeResolveIMessageApprovalReaction, s as buildIMessageApprovalConversationKeyForInbound } from "./approval-reactions-DBDufqqo.mjs";
|
|
9
|
+
import { c as iMessageApprovalControlBindings, n as hasPersistedIMessageEcho, r as stripLeadingEchoTextCorruptionMarkers, s as maybeResolveIMessageApprovalPollVote, t as sendMessageIMessage } from "./send-BZ6OgsJ-.mjs";
|
|
10
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.mjs";
|
|
11
|
+
import { n as maybeResolveIMessageQuestionReaction, t as hasIMessageQuestionReactionTarget } from "./question-reactions-DWze6La6.mjs";
|
|
12
12
|
import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
13
13
|
import { chunkMarkdownTextWithMode as chunkTextWithMode, resolveChunkMode, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
|
|
14
14
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -777,7 +777,7 @@ function combineIMessagePayloads(payloads) {
|
|
|
777
777
|
const first = expectDefined(payloads[0], "first iMessage payload to coalesce");
|
|
778
778
|
if (payloads.length === 1) return first;
|
|
779
779
|
const last = expectDefined(payloads.at(-1), "last iMessage payload to coalesce");
|
|
780
|
-
const boundedPayloads = payloads.length > MAX_COALESCED_ENTRIES ? [...payloads.slice(0,
|
|
780
|
+
const boundedPayloads = payloads.length > MAX_COALESCED_ENTRIES ? [...payloads.slice(0, 9), last] : payloads;
|
|
781
781
|
const seenTexts = /* @__PURE__ */ new Set();
|
|
782
782
|
const textParts = [];
|
|
783
783
|
for (const payload of boundedPayloads) {
|
|
@@ -960,7 +960,8 @@ async function deliverIMessageReply(params) {
|
|
|
960
960
|
accountId
|
|
961
961
|
});
|
|
962
962
|
const chunkMode = resolveChunkMode(cfg, "imessage", accountId);
|
|
963
|
-
const
|
|
963
|
+
const rawText = sanitizeOutboundText(payload.text ?? "");
|
|
964
|
+
const reply = resolveSendableOutboundReplyParts(payload, { text: convertMarkdownTables$1(rawText, tableMode) });
|
|
964
965
|
const accepted = [];
|
|
965
966
|
const sendAccepted = async (text, mediaUrl) => {
|
|
966
967
|
const sent = await sendMessageIMessage(target, text, {
|
|
@@ -1022,7 +1023,8 @@ async function deliverIMessageReply(params) {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
function createIMessageEchoCachingSend(params) {
|
|
1024
1025
|
return async (target, text, opts) => {
|
|
1025
|
-
const
|
|
1026
|
+
const sanitizedText = sanitizeOutboundText(text);
|
|
1027
|
+
const sent = await sendMessageIMessage(target, sanitizedText, opts);
|
|
1026
1028
|
const scope = `${params.accountId ?? opts.accountId ?? ""}:${target}`;
|
|
1027
1029
|
const echoText = sent.echoText ?? (sent.sentText || void 0);
|
|
1028
1030
|
params.sentMessageCache?.remember(scope, {
|
|
@@ -1237,8 +1239,8 @@ function warnGroupAllowlistDropPerChatOnce(params) {
|
|
|
1237
1239
|
}
|
|
1238
1240
|
//#endregion
|
|
1239
1241
|
//#region extensions/imessage/src/monitor/inbound-dedupe.ts
|
|
1240
|
-
const IMESSAGE_STALE_INBOUND_THRESHOLD_MS =
|
|
1241
|
-
const IMESSAGE_RECOVERY_MAX_AGE_MS =
|
|
1242
|
+
const IMESSAGE_STALE_INBOUND_THRESHOLD_MS = 9e5;
|
|
1243
|
+
const IMESSAGE_RECOVERY_MAX_AGE_MS = 72e5;
|
|
1242
1244
|
/**
|
|
1243
1245
|
* Age fence: true when the message's own send date is materially older than
|
|
1244
1246
|
* now, i.e. stale backlog rather than a live message. Fails open (returns
|
|
@@ -1982,6 +1984,7 @@ async function buildIMessageInboundContext(params) {
|
|
|
1982
1984
|
const directService = resolveIMessageDirectChatService(params.accountService, decision.chatGuid) ?? "auto";
|
|
1983
1985
|
const imessageTo = decision.isGroup ? chatTarget || `imessage:${decision.sender}` : `${directService}:${decision.sender}`;
|
|
1984
1986
|
const imessageFrom = decision.isGroup ? `imessage:group:${chatId ?? "unknown"}` : imessageTo;
|
|
1987
|
+
const replyTarget = decision.isGroup ? imessageTo : chatId != null ? `chat_id:${chatId}` : decision.chatGuid ? `chat_guid:${decision.chatGuid}` : imessageTo;
|
|
1985
1988
|
const inboundHistory = !decision.isGroup && params.dmHistory?.inboundHistory ? params.dmHistory.inboundHistory : decision.isGroup && decision.historyKey && params.historyLimit > 0 ? createChannelHistoryWindow({ historyMap: params.groupHistories }).buildInboundHistory({
|
|
1986
1989
|
historyKey: decision.historyKey,
|
|
1987
1990
|
limit: params.historyLimit
|
|
@@ -2027,7 +2030,7 @@ async function buildIMessageInboundContext(params) {
|
|
|
2027
2030
|
accountId: decision.route.accountId,
|
|
2028
2031
|
routeSessionKey: decision.route.sessionKey
|
|
2029
2032
|
},
|
|
2030
|
-
reply: { to:
|
|
2033
|
+
reply: { to: replyTarget },
|
|
2031
2034
|
message: {
|
|
2032
2035
|
body: combinedBody,
|
|
2033
2036
|
bodyForAgent: decision.agentBodyText ?? decision.bodyText,
|
|
@@ -2185,7 +2188,7 @@ function createIMessageDurableIngress(options) {
|
|
|
2185
2188
|
},
|
|
2186
2189
|
pollIntervalMs: IMESSAGE_INGRESS_DRAIN_INTERVAL_MS,
|
|
2187
2190
|
retention: {
|
|
2188
|
-
completedTtlMs:
|
|
2191
|
+
completedTtlMs: 144e5,
|
|
2189
2192
|
completedMaxEntries: 1e4,
|
|
2190
2193
|
failedMaxEntries: 1e3
|
|
2191
2194
|
},
|
|
@@ -2312,18 +2315,18 @@ async function readPinnedAttachmentBytes(handle, maxBytes) {
|
|
|
2312
2315
|
let totalBytes = 0;
|
|
2313
2316
|
while (totalBytes <= maxBytes) {
|
|
2314
2317
|
const remaining = maxBytes + 1 - totalBytes;
|
|
2315
|
-
const chunk = Buffer.allocUnsafe(Math.min(
|
|
2318
|
+
const chunk = Buffer.allocUnsafe(Math.min(65536, remaining));
|
|
2316
2319
|
const { bytesRead } = await handle.read(chunk, 0, chunk.length, null);
|
|
2317
2320
|
if (bytesRead === 0) return Buffer.concat(chunks, totalBytes);
|
|
2318
2321
|
chunks.push(chunk.subarray(0, bytesRead));
|
|
2319
2322
|
totalBytes += bytesRead;
|
|
2320
2323
|
}
|
|
2321
|
-
throw new Error(`attachment exceeds ${Math.round(maxBytes /
|
|
2324
|
+
throw new Error(`attachment exceeds ${Math.round(maxBytes / 1048576)}MB limit`);
|
|
2322
2325
|
}
|
|
2323
2326
|
async function readAttachmentBuffer(params) {
|
|
2324
2327
|
const opened = await (params.deps.openLocalFileSafely ?? openLocalFileSafely)({ filePath: params.attachmentPath });
|
|
2325
2328
|
try {
|
|
2326
|
-
if (opened.stat.size > params.maxBytes) throw new Error(`attachment exceeds ${Math.round(params.maxBytes /
|
|
2329
|
+
if (opened.stat.size > params.maxBytes) throw new Error(`attachment exceeds ${Math.round(params.maxBytes / 1048576)}MB limit`);
|
|
2327
2330
|
await assertAllowedCanonicalAttachmentPath({
|
|
2328
2331
|
canonicalPath: opened.realPath,
|
|
2329
2332
|
allowedRoots: params.allowedRoots
|
|
@@ -2703,7 +2706,7 @@ function sanitizeIMessageWatchErrorPayload(payload) {
|
|
|
2703
2706
|
if (typeof payload.code === "number" && Number.isFinite(payload.code)) safe.code = payload.code;
|
|
2704
2707
|
if (typeof payload.message === "string") {
|
|
2705
2708
|
const sanitizedMessage = sanitizeTerminalText(payload.message);
|
|
2706
|
-
if (sanitizedMessage) safe.message = sanitizedMessage.length > MAX_WATCH_ERROR_MESSAGE_CHARS ? `${truncateUtf16Safe(sanitizedMessage,
|
|
2709
|
+
if (sanitizedMessage) safe.message = sanitizedMessage.length > MAX_WATCH_ERROR_MESSAGE_CHARS ? `${truncateUtf16Safe(sanitizedMessage, 199)}…` : sanitizedMessage;
|
|
2707
2710
|
}
|
|
2708
2711
|
return safe;
|
|
2709
2712
|
}
|
|
@@ -2715,7 +2718,7 @@ const CHANNEL_APPROVAL_GATEWAY_RUNTIME_CONTEXT_CAPABILITY = "approval.gateway";
|
|
|
2715
2718
|
const APPROVAL_REACTION_POLL_INTERVAL_MS = 2e3;
|
|
2716
2719
|
const APPROVAL_REACTION_DISCOVERY_INTERVAL_MS = 6e4;
|
|
2717
2720
|
const IMESSAGE_TYPING_KEEPALIVE_INTERVAL_MS = 8e3;
|
|
2718
|
-
const IMESSAGE_TYPING_KEEPALIVE_MAX_DURATION_MS =
|
|
2721
|
+
const IMESSAGE_TYPING_KEEPALIVE_MAX_DURATION_MS = 6e5;
|
|
2719
2722
|
function resolveConfiguredIMessageTypingMode(cfg, agentId) {
|
|
2720
2723
|
return resolveAgentConfig(cfg, agentId)?.typingMode ?? cfg.agents?.defaults?.typingMode;
|
|
2721
2724
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.
|
|
2
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.mjs";
|
|
3
3
|
import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
4
4
|
//#region extensions/imessage/src/question-reactions.ts
|
|
5
5
|
var question_reactions_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as resolveLocalIMessageChatDbPath, u as expandIMessageUserPath } from "./accounts-CCirBEIm.
|
|
2
|
-
import { d as resolveIMessageCachedResourceBinding, f as resolveIMessageMessageId, g as isIMessageEmailChatIdentifier, h as chatContextFromIMessageTarget } from "./sanitize-outbound-
|
|
1
|
+
import { p as resolveLocalIMessageChatDbPath, u as expandIMessageUserPath } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { d as resolveIMessageCachedResourceBinding, f as resolveIMessageMessageId, g as isIMessageEmailChatIdentifier, h as chatContextFromIMessageTarget } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { normalizeScpRemoteHost } from "openclaw/plugin-sdk/host-runtime";
|
|
5
5
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -9,8 +9,8 @@ import { runCommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
|
9
9
|
import { openNodeSqliteDatabase } from "openclaw/plugin-sdk/sqlite-runtime";
|
|
10
10
|
import { sanitizeTempFileName } from "openclaw/plugin-sdk/temp-path";
|
|
11
11
|
//#region extensions/imessage/src/cli-output.ts
|
|
12
|
-
const IMESSAGE_CLI_STDOUT_MAX_BYTES =
|
|
13
|
-
const IMESSAGE_CLI_STDERR_TAIL_BYTES =
|
|
12
|
+
const IMESSAGE_CLI_STDOUT_MAX_BYTES = 8388608;
|
|
13
|
+
const IMESSAGE_CLI_STDERR_TAIL_BYTES = 65536;
|
|
14
14
|
function parseLastJsonObject(stdout) {
|
|
15
15
|
const last = stdout.split(/\r?\n/u).findLast((line) => line.trim().length > 0)?.trim();
|
|
16
16
|
if (!last) return null;
|
|
@@ -23,12 +23,13 @@ function parseLastJsonObject(stdout) {
|
|
|
23
23
|
}
|
|
24
24
|
async function runIMessageCliJsonCommand(params) {
|
|
25
25
|
const dbPath = params.dbPath?.trim();
|
|
26
|
-
const
|
|
26
|
+
const argv = [
|
|
27
27
|
expandIMessageUserPath(params.cliPath),
|
|
28
28
|
...params.args,
|
|
29
29
|
...dbPath ? ["--db", dbPath] : [],
|
|
30
30
|
"--json"
|
|
31
|
-
]
|
|
31
|
+
];
|
|
32
|
+
const result = await runCommandWithTimeout(argv, {
|
|
32
33
|
killProcessTree: true,
|
|
33
34
|
maxOutputBytes: {
|
|
34
35
|
stdout: IMESSAGE_CLI_STDOUT_MAX_BYTES,
|
|
@@ -213,8 +214,8 @@ async function runChecked(run, label, argv, options) {
|
|
|
213
214
|
const result = await run(argv, {
|
|
214
215
|
killProcessTree: true,
|
|
215
216
|
maxOutputBytes: {
|
|
216
|
-
stdout:
|
|
217
|
-
stderr:
|
|
217
|
+
stdout: 4096,
|
|
218
|
+
stderr: 65536
|
|
218
219
|
},
|
|
219
220
|
outputCapture: {
|
|
220
221
|
stdout: "head",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as expandIMessageUserPath } from "./accounts-CCirBEIm.
|
|
2
|
-
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.
|
|
3
|
-
import { a as IMESSAGE_REPLY_CACHE_NAMESPACE, f as resolveIMessageReplyCacheEntryKey, i as IMESSAGE_REPLY_CACHE_MAX_ENTRIES, n as IMESSAGE_REPLY_CACHE_COUNTER_KEY, o as IMESSAGE_REPLY_CACHE_TTL_MS, r as IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE } from "./state-contract-
|
|
1
|
+
import { u as expandIMessageUserPath } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { t as getIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
3
|
+
import { a as IMESSAGE_REPLY_CACHE_NAMESPACE, f as resolveIMessageReplyCacheEntryKey, i as IMESSAGE_REPLY_CACHE_MAX_ENTRIES, n as IMESSAGE_REPLY_CACHE_COUNTER_KEY, o as IMESSAGE_REPLY_CACHE_TTL_MS, r as IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE } from "./state-contract-DvahEY4X.mjs";
|
|
4
4
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -98,7 +98,7 @@ const DEFAULT_IMESSAGE_SEND_TIMEOUT_MS = 18e4;
|
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region extensions/imessage/src/monitor-reply-cache.ts
|
|
100
100
|
/** Recency window for the "react to the latest message" fallback. */
|
|
101
|
-
const LATEST_FALLBACK_MS =
|
|
101
|
+
const LATEST_FALLBACK_MS = 6e5;
|
|
102
102
|
let persistenceFailureLogged = false;
|
|
103
103
|
function reportPersistenceFailure(scope, err) {
|
|
104
104
|
if (persistenceFailureLogged) return;
|
|
@@ -666,39 +666,43 @@ function codeDelimiter(content) {
|
|
|
666
666
|
const longestRun = Math.max(0, ...[...content.matchAll(/`+/gu)].map((match) => match[0].length));
|
|
667
667
|
return "`".repeat(longestRun + 1);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
const ordered = edits.toSorted((left, right) => left.start - right.start);
|
|
669
|
+
function restoreCodeMarkers(text, ranges, codeRanges) {
|
|
671
670
|
let rendered = "";
|
|
672
671
|
let cursor = 0;
|
|
673
|
-
|
|
674
|
-
rendered += text.slice(cursor, edit.start) + edit.text;
|
|
675
|
-
cursor = edit.end;
|
|
676
|
-
}
|
|
677
|
-
rendered += text.slice(cursor);
|
|
678
|
-
return {
|
|
679
|
-
text: rendered,
|
|
680
|
-
mapOffset: (offset) => offset + ordered.reduce((delta, edit) => delta + (edit.end <= offset ? edit.text.length - edit.end + edit.start : 0), 0)
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
function restoreCodeMarkers(text, ranges, codeRanges) {
|
|
684
|
-
const edited = applyTextEdits(text, codeRanges.map((range) => {
|
|
672
|
+
const edits = codeRanges.map((range) => {
|
|
685
673
|
const end = range.start + range.length;
|
|
686
674
|
const content = text.slice(range.start, end);
|
|
687
675
|
const marker = codeDelimiter(content);
|
|
688
676
|
const padding = content.startsWith("`") || content.endsWith("`") ? " " : "";
|
|
677
|
+
rendered += text.slice(cursor, range.start) + `${marker}${padding}${content}${padding}${marker}`;
|
|
678
|
+
cursor = end;
|
|
689
679
|
return {
|
|
690
|
-
start: range.start,
|
|
691
680
|
end,
|
|
692
|
-
|
|
681
|
+
shift: rendered.length - end
|
|
693
682
|
};
|
|
694
|
-
})
|
|
683
|
+
});
|
|
684
|
+
rendered += text.slice(cursor);
|
|
685
|
+
const mapOffset = (offset) => {
|
|
686
|
+
let low = 0;
|
|
687
|
+
let high = edits.length;
|
|
688
|
+
while (low < high) {
|
|
689
|
+
const middle = low + Math.floor((high - low) / 2);
|
|
690
|
+
const edit = edits[middle];
|
|
691
|
+
if (edit && edit.end <= offset) low = middle + 1;
|
|
692
|
+
else high = middle;
|
|
693
|
+
}
|
|
694
|
+
return offset + (edits[low - 1]?.shift ?? 0);
|
|
695
|
+
};
|
|
695
696
|
return {
|
|
696
|
-
text:
|
|
697
|
-
ranges: ranges.map((range) =>
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
697
|
+
text: rendered,
|
|
698
|
+
ranges: ranges.map((range) => {
|
|
699
|
+
const start = mapOffset(range.start);
|
|
700
|
+
return {
|
|
701
|
+
...range,
|
|
702
|
+
start,
|
|
703
|
+
length: mapOffset(range.start + range.length) - start
|
|
704
|
+
};
|
|
705
|
+
})
|
|
702
706
|
};
|
|
703
707
|
}
|
|
704
708
|
function extractMarkdownFormatRuns(input) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as resolveIMessageChatDbLookupPath, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
2
|
-
import { l as parseIMessageTarget, n as formatIMessageChatTarget, s as normalizeIMessageHandle } from "./message-tool-api-
|
|
3
|
-
import { a as IMessageRpcRequestError, h as chatContextFromIMessageTarget, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient, t as protectIMessageFencedRoleMarkers, u as rememberIMessageReplyCache, v as resolveIMessageDirectChatService } from "./sanitize-outbound-
|
|
4
|
-
import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-
|
|
5
|
-
import { n as getOptionalIMessageRuntime, t as getIMessageRuntime } from "./runtime-Cza4CY5T.
|
|
6
|
-
import { c as IMESSAGE_SENT_ECHOES_TTL_MS, d as resolveIMessageEchoMediaKey, p as resolveIMessageSentEchoEntryKey, s as IMESSAGE_SENT_ECHOES_NAMESPACE } from "./state-contract-
|
|
7
|
-
import { d as normalizeConversationKey, f as normalizeIMessageGuid, i as registerIMessageApprovalReactionTarget, l as enumerateApprovalTargetKeys, s as buildIMessageApprovalConversationKeyForInbound, u as enumerateConversationKeyForms } from "./approval-reactions-
|
|
8
|
-
import { i as runIMessageCliJsonCommand, r as resolveAuthorizedIMessageReplyReference, t as withIMessageRemoteFile } from "./remote-file-
|
|
1
|
+
import { d as resolveIMessageChatDbLookupPath, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { l as parseIMessageTarget, n as formatIMessageChatTarget, s as normalizeIMessageHandle } from "./message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { a as IMessageRpcRequestError, h as chatContextFromIMessageTarget, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient, t as protectIMessageFencedRoleMarkers, u as rememberIMessageReplyCache, v as resolveIMessageDirectChatService } from "./sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { n as getOptionalIMessageRuntime, t as getIMessageRuntime } from "./runtime-Cza4CY5T.mjs";
|
|
6
|
+
import { c as IMESSAGE_SENT_ECHOES_TTL_MS, d as resolveIMessageEchoMediaKey, p as resolveIMessageSentEchoEntryKey, s as IMESSAGE_SENT_ECHOES_NAMESPACE } from "./state-contract-DvahEY4X.mjs";
|
|
7
|
+
import { d as normalizeConversationKey, f as normalizeIMessageGuid, i as registerIMessageApprovalReactionTarget, l as enumerateApprovalTargetKeys, s as buildIMessageApprovalConversationKeyForInbound, u as enumerateConversationKeyForms } from "./approval-reactions-DBDufqqo.mjs";
|
|
8
|
+
import { i as runIMessageCliJsonCommand, r as resolveAuthorizedIMessageReplyReference, t as withIMessageRemoteFile } from "./remote-file-DSZLzYEw.mjs";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
|
|
11
11
|
import { accessSync, constants } from "node:fs";
|
|
@@ -94,14 +94,14 @@ const iMessageApprovalControlBindings = {
|
|
|
94
94
|
const TARGET_NAMESPACE = "imessage.approval-polls";
|
|
95
95
|
const TOMBSTONE_NAMESPACE = "imessage.approval-poll-tombstones";
|
|
96
96
|
const MAX_ENTRIES = 1e3;
|
|
97
|
-
const DEFAULT_TARGET_TTL_MS =
|
|
97
|
+
const DEFAULT_TARGET_TTL_MS = 864e5;
|
|
98
98
|
/**
|
|
99
99
|
* Messages has no close-poll API, so a resolved approval's balloon stays
|
|
100
100
|
* tappable forever. Tombstones outlive the binding so late taps are swallowed
|
|
101
101
|
* instead of reaching the agent as "Poll vote: ..." prose. Persisted, because a
|
|
102
102
|
* gateway restart must not turn old polls back into chat noise.
|
|
103
103
|
*/
|
|
104
|
-
const TOMBSTONE_TTL_MS =
|
|
104
|
+
const TOMBSTONE_TTL_MS = 2592e6;
|
|
105
105
|
const APPROVAL_DECISIONS = /* @__PURE__ */ new Set([
|
|
106
106
|
"allow-once",
|
|
107
107
|
"allow-always",
|
|
@@ -843,16 +843,17 @@ async function trySendAttachmentForTarget(params) {
|
|
|
843
843
|
if (params.target.kind === "handle" && !params.audioAsVoice && params.sendTransport !== "bridge" && (params.service === "sms" || params.service === "imessage")) return null;
|
|
844
844
|
if (params.remoteHost && params.sendTransport === "applescript") return null;
|
|
845
845
|
let attachmentChatTarget = null;
|
|
846
|
-
if (params.remoteHost)
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
846
|
+
if (params.remoteHost) {
|
|
847
|
+
if (params.target.kind === "chat_guid") attachmentChatTarget = params.target.chatGuid;
|
|
848
|
+
else if (params.target.kind === "chat_identifier") attachmentChatTarget = params.target.chatIdentifier;
|
|
849
|
+
else if (params.target.kind === "handle") {
|
|
850
|
+
const normalizedHandle = normalizeIMessageHandle(params.target.to);
|
|
851
|
+
if (normalizedHandle) {
|
|
852
|
+
const service = params.target.service !== "auto" ? params.target.service : params.service;
|
|
853
|
+
attachmentChatTarget = `${service === "sms" ? "SMS" : service === "imessage" ? "iMessage" : "any"};-;${normalizedHandle}`;
|
|
854
|
+
}
|
|
855
|
+
} else attachmentChatTarget = formatIMessageChatTarget(params.target.chatId);
|
|
856
|
+
} else try {
|
|
856
857
|
attachmentChatTarget = await resolveAttachmentChatTarget({
|
|
857
858
|
target: params.target,
|
|
858
859
|
service: params.service,
|
|
@@ -1002,7 +1003,7 @@ async function sendMessageIMessage(to, text, opts) {
|
|
|
1002
1003
|
const timeoutMs = opts.timeoutMs ?? Math.max(account.config.probeTimeoutMs ?? 0, 18e4);
|
|
1003
1004
|
const pendingEchoTtlMs = resolvePendingPersistedEchoTtlMs(timeoutMs);
|
|
1004
1005
|
const region = opts.region?.trim() || account.config.region?.trim() || "US";
|
|
1005
|
-
const maxBytes = typeof opts.maxBytes === "number" ? opts.maxBytes : typeof account.config.mediaMaxMb === "number" ? account.config.mediaMaxMb * 1024 * 1024 :
|
|
1006
|
+
const maxBytes = typeof opts.maxBytes === "number" ? opts.maxBytes : typeof account.config.mediaMaxMb === "number" ? account.config.mediaMaxMb * 1024 * 1024 : 16777216;
|
|
1006
1007
|
let message = opts.approvalPrompt ? addApprovalReactionHintToText({
|
|
1007
1008
|
text,
|
|
1008
1009
|
allowedDecisions: opts.approvalPrompt.allowedDecisions
|
|
@@ -4,7 +4,7 @@ const IMESSAGE_REPLY_CACHE_NAMESPACE = "imessage.reply-cache";
|
|
|
4
4
|
const IMESSAGE_REPLY_CACHE_MAX_ENTRIES = 2e3;
|
|
5
5
|
const IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE = "imessage.reply-cache-counter";
|
|
6
6
|
const IMESSAGE_REPLY_CACHE_COUNTER_KEY = "short-id-counter";
|
|
7
|
-
const IMESSAGE_REPLY_CACHE_TTL_MS =
|
|
7
|
+
const IMESSAGE_REPLY_CACHE_TTL_MS = 216e5;
|
|
8
8
|
function resolveIMessageReplyCacheEntryKey(messageId) {
|
|
9
9
|
return createHash("sha256").update(messageId, "utf8").digest("hex").slice(0, 32);
|
|
10
10
|
}
|
|
@@ -34,7 +34,7 @@ function capFailureRetriesMap(map, maxSize = MAX_FAILURE_RETRY_MAP_SIZE, maxByte
|
|
|
34
34
|
}
|
|
35
35
|
return capped;
|
|
36
36
|
}
|
|
37
|
-
const IMESSAGE_SENT_ECHOES_TTL_MS =
|
|
37
|
+
const IMESSAGE_SENT_ECHOES_TTL_MS = 432e5;
|
|
38
38
|
const IMESSAGE_SENT_ECHOES_NAMESPACE = "imessage.sent-echoes";
|
|
39
39
|
function resolveIMessageSentEchoEntryKey(entry) {
|
|
40
40
|
return createHash("sha256").update(JSON.stringify([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount } from "./accounts-CCirBEIm.
|
|
2
|
-
import { a as IMESSAGE_REPLY_CACHE_NAMESPACE, c as IMESSAGE_SENT_ECHOES_TTL_MS, f as resolveIMessageReplyCacheEntryKey, i as IMESSAGE_REPLY_CACHE_MAX_ENTRIES, l as capFailureRetriesMap, n as IMESSAGE_REPLY_CACHE_COUNTER_KEY, o as IMESSAGE_REPLY_CACHE_TTL_MS, p as resolveIMessageSentEchoEntryKey, r as IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE, s as IMESSAGE_SENT_ECHOES_NAMESPACE, t as IMESSAGE_CATCHUP_CURSOR_NAMESPACE, u as resolveIMessageCatchupCursorKey } from "./state-contract-
|
|
1
|
+
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount } from "./accounts-CCirBEIm.mjs";
|
|
2
|
+
import { a as IMESSAGE_REPLY_CACHE_NAMESPACE, c as IMESSAGE_SENT_ECHOES_TTL_MS, f as resolveIMessageReplyCacheEntryKey, i as IMESSAGE_REPLY_CACHE_MAX_ENTRIES, l as capFailureRetriesMap, n as IMESSAGE_REPLY_CACHE_COUNTER_KEY, o as IMESSAGE_REPLY_CACHE_TTL_MS, p as resolveIMessageSentEchoEntryKey, r as IMESSAGE_REPLY_CACHE_COUNTER_NAMESPACE, s as IMESSAGE_SENT_ECHOES_NAMESPACE, t as IMESSAGE_CATCHUP_CURSOR_NAMESPACE, u as resolveIMessageCatchupCursorKey } from "./state-contract-DvahEY4X.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { asFiniteNumber, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/api.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "
|
|
2
|
-
import { a as isAllowedIMessageSender, c as parseIMessageAllowTarget, g as IMESSAGE_ACTION_NAMES, h as IMESSAGE_ACTIONS, l as parseIMessageTarget, n as formatIMessageChatTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle } from "
|
|
3
|
-
import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "
|
|
4
|
-
import { a as normalizeIMessageAcpConversationId, c as normalizeIMessageMessagingTarget, f as probeIMessage, i as matchIMessageAcpConversation, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, r as resolveIMessageInboundConversationId, s as looksLikeIMessageTargetId, t as resolveIMessageGroupRequireMention
|
|
5
|
-
import {
|
|
6
|
-
import { t as createIMessageConversationBindingManager } from "
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
//#region extensions/imessage/src/channel.setup.ts
|
|
10
|
-
const imessageSetupPlugin = { ...createIMessagePluginBase({
|
|
11
|
-
setupWizard: imessageSetupWizard,
|
|
12
|
-
setupContract: imessageSetupContract
|
|
13
|
-
}) };
|
|
14
|
-
//#endregion
|
|
1
|
+
import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "./.setup/accounts-CCirBEIm.mjs";
|
|
2
|
+
import { a as isAllowedIMessageSender, c as parseIMessageAllowTarget, g as IMESSAGE_ACTION_NAMES, h as IMESSAGE_ACTIONS, l as parseIMessageTarget, n as formatIMessageChatTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle } from "./.setup/message-tool-api-DD3BOMxR.mjs";
|
|
3
|
+
import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./.setup/sanitize-outbound-ZWjQvu-s.mjs";
|
|
4
|
+
import { a as normalizeIMessageAcpConversationId, c as normalizeIMessageMessagingTarget, f as probeIMessage, i as matchIMessageAcpConversation, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, r as resolveIMessageInboundConversationId, s as looksLikeIMessageTargetId, t as resolveIMessageGroupRequireMention } from "./.setup/group-policy-CVOrXCD2.mjs";
|
|
5
|
+
import { t as imessagePlugin } from "./.setup/channel-B5sr6Nz8.mjs";
|
|
6
|
+
import { t as createIMessageConversationBindingManager } from "./.setup/conversation-bindings-GDQ_Laxj.mjs";
|
|
7
|
+
import { a as resolveServicePrefixedChatTarget, c as imessageSetupPlugin, i as resolveServicePrefixedAllowTarget, n as parseChatAllowTargetPrefixes, o as resolveServicePrefixedOrChatAllowTarget, r as parseChatTargetPrefixesOrThrow, s as resolveServicePrefixedTarget, t as createAllowedChatSenderMatcher } from "./.setup/api-BvCc-j9Y.mjs";
|
|
8
|
+
import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./.setup/outbound-send-deps-B-QEsLSM.mjs";
|
|
15
9
|
export { DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, IMESSAGE_ACTIONS, IMESSAGE_ACTION_NAMES, IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS, createAllowedChatSenderMatcher, createIMessageConversationBindingManager, formatIMessageChatTarget, imessagePlugin, imessageSetupPlugin, inferIMessageTargetChatType, isAllowedIMessageSender, listEnabledIMessageAccounts, listIMessageAccountIds, looksLikeIMessageExplicitTargetId, looksLikeIMessageTargetId, matchIMessageAcpConversation, normalizeIMessageAcpConversationId, normalizeIMessageHandle, normalizeIMessageMessagingTarget, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow, parseIMessageAllowTarget, parseIMessageTarget, probeIMessage, resolveDefaultIMessageAccountId, resolveIMessageAccount, resolveIMessageConversationIdFromTarget, resolveIMessageGroupRequireMention, resolveIMessageGroupToolPolicy, resolveIMessageInboundConversationId, resolveServicePrefixedAllowTarget, resolveServicePrefixedChatTarget, resolveServicePrefixedOrChatAllowTarget, resolveServicePrefixedTarget };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IMessageChannelConfigSchema } from "
|
|
1
|
+
import { t as IMessageChannelConfigSchema } from "./.setup/config-schema-DuGbA8Kp.mjs";
|
|
2
2
|
export { IMessageChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as imessagePlugin } from "
|
|
1
|
+
import { t as imessagePlugin } from "./.setup/channel-B5sr6Nz8.mjs";
|
|
2
2
|
export { imessagePlugin };
|
package/dist/contract-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "
|
|
1
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./.setup/media-contract-jvc40xda.mjs";
|
|
2
2
|
import "./media-contract-api.js";
|
|
3
3
|
export { DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, resolveIMessageAttachmentRoots, resolveIMessageAttachmentRoots as resolveInboundAttachmentRoots, resolveIMessageRemoteAttachmentRoots, resolveIMessageRemoteAttachmentRoots as resolveRemoteInboundAttachmentRoots };
|
|
@@ -76,7 +76,7 @@ const stateMigrations = [definePluginDoctorMigrationFromPlans({
|
|
|
76
76
|
id: "imessage-legacy-state",
|
|
77
77
|
label: "iMessage legacy state",
|
|
78
78
|
resolvePlans: async (params) => {
|
|
79
|
-
const { detectIMessageLegacyStateMigrations } = await import("
|
|
79
|
+
const { detectIMessageLegacyStateMigrations } = await import("./.setup/state-migrations-BVsOuPqy.mjs");
|
|
80
80
|
return detectIMessageLegacyStateMigrations(params);
|
|
81
81
|
}
|
|
82
82
|
})];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "
|
|
1
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./.setup/media-contract-jvc40xda.mjs";
|
|
2
2
|
export { DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, resolveIMessageAttachmentRoots, resolveIMessageAttachmentRoots as resolveInboundAttachmentRoots, resolveIMessageRemoteAttachmentRoots, resolveIMessageRemoteAttachmentRoots as resolveRemoteInboundAttachmentRoots };
|
package/dist/message-tool-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as describeIMessageMessageTool } from "
|
|
1
|
+
import { t as describeIMessageMessageTool } from "./.setup/message-tool-api-DD3BOMxR.mjs";
|
|
2
2
|
export { describeIMessageMessageTool as describeMessageTool };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as resolveIMessageAccount } from "
|
|
2
|
-
import { c as normalizeIMessageMessagingTarget, d as imessageMessageActions, f as probeIMessage, n as resolveIMessageGroupToolPolicy, s as looksLikeIMessageTargetId, t as resolveIMessageGroupRequireMention } from "
|
|
3
|
-
import { r as setIMessageRuntime } from "
|
|
4
|
-
import { n as IMessageConfigSchema } from "
|
|
5
|
-
import { t as sendMessageIMessage } from "
|
|
6
|
-
import { t as monitorIMessageProvider } from "
|
|
1
|
+
import { o as resolveIMessageAccount } from "./.setup/accounts-CCirBEIm.mjs";
|
|
2
|
+
import { c as normalizeIMessageMessagingTarget, d as imessageMessageActions, f as probeIMessage, n as resolveIMessageGroupToolPolicy, s as looksLikeIMessageTargetId, t as resolveIMessageGroupRequireMention } from "./.setup/group-policy-CVOrXCD2.mjs";
|
|
3
|
+
import { r as setIMessageRuntime } from "./.setup/runtime-Cza4CY5T.mjs";
|
|
4
|
+
import { n as IMessageConfigSchema } from "./.setup/config-schema-DuGbA8Kp.mjs";
|
|
5
|
+
import { t as sendMessageIMessage } from "./.setup/send-BZ6OgsJ-.mjs";
|
|
6
|
+
import { t as monitorIMessageProvider } from "./.setup/monitor-NTVwTVyx.mjs";
|
|
7
7
|
import { formatTrimmedAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
8
8
|
import { buildComputedAccountStatusSnapshot, collectStatusIssuesFromLastError } from "openclaw/plugin-sdk/status-helpers";
|
|
9
9
|
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as testing, t as createIMessageConversationBindingManager } from "
|
|
1
|
+
import { n as testing, t as createIMessageConversationBindingManager } from "./.setup/conversation-bindings-GDQ_Laxj.mjs";
|
|
2
2
|
export { createIMessageConversationBindingManager, testing as imessageConversationBindingTesting };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region extensions/imessage/setup-entry.ts
|
|
3
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
5
|
importMetaUrl: import.meta.url,
|
|
5
6
|
plugin: {
|
|
6
|
-
specifier: "
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-CA2sYw-U.mjs", import.meta.url).href),
|
|
7
8
|
exportName: "imessageSetupPlugin"
|
|
8
9
|
}
|
|
9
10
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]
|
|
1
|
+
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an Email
|
|
4
4
|
* @specification https://datatracker.ietf.org/doc/html/rfc5322
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as FormatBidi from './format/bidi.mjs';
|
|
2
2
|
import * as LabelUnicode from './label/unicode.mjs';
|
|
3
3
|
import * as LabelPuny from './label/puny.mjs';
|
|
4
|
+
// ------------------------------------------------------------------
|
|
5
|
+
// IsLabel
|
|
6
|
+
// ------------------------------------------------------------------
|
|
4
7
|
function IsValidLabelLength(value) {
|
|
5
8
|
return value.length > 0 && value.length <= 63;
|
|
6
9
|
}
|
|
@@ -8,9 +11,24 @@ function IsLabel(value) {
|
|
|
8
11
|
return IsValidLabelLength(value) && (LabelPuny.IsPunyLabel(value) ||
|
|
9
12
|
LabelUnicode.IsUnicodeLabel(value));
|
|
10
13
|
}
|
|
14
|
+
// ------------------------------------------------------------------
|
|
15
|
+
// NormalizeHostname
|
|
16
|
+
//
|
|
17
|
+
// Normalizes a hostname for label validation. Normalizes for NFC
|
|
18
|
+
// such that equivalent codepoint sequences can be uniformly
|
|
19
|
+
// compared. It also removes codepoints that IDNA mapping ignores,
|
|
20
|
+
// and converts full stop variants to ASCII '.' so the hostname can
|
|
21
|
+
// be split into labels.
|
|
22
|
+
// ------------------------------------------------------------------
|
|
11
23
|
function NormalizeHostname(value) {
|
|
12
|
-
return value
|
|
24
|
+
return value
|
|
25
|
+
.normalize('NFC')
|
|
26
|
+
.replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu, '') // RE_IGNORED_MAPPING
|
|
27
|
+
.replace(/[\u002E\u3002\uFF0E\uFF61]/g, '.'); // RE_FULL_STOP_MAPPING
|
|
13
28
|
}
|
|
29
|
+
// ------------------------------------------------------------------
|
|
30
|
+
// IsIdnHostname
|
|
31
|
+
// ------------------------------------------------------------------
|
|
14
32
|
export function IsIdnHostname(value) {
|
|
15
33
|
if (value.length === 0 || value.includes(' '))
|
|
16
34
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/imessage",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.33",
|
|
4
4
|
"description": "OpenClaw iMessage channel plugin using imsg on a signed-in Mac",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"typebox": "1.3.
|
|
11
|
+
"typebox": "1.3.17",
|
|
12
12
|
"zod": "4.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.8.
|
|
15
|
+
"openclaw": ">=2026.8.33"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"allowInvalidConfigRecovery": true
|
|
93
93
|
},
|
|
94
94
|
"compat": {
|
|
95
|
-
"pluginApi": ">=2026.8.
|
|
95
|
+
"pluginApi": ">=2026.8.33"
|
|
96
96
|
},
|
|
97
97
|
"build": {
|
|
98
|
-
"openclawVersion": "2026.8.
|
|
98
|
+
"openclawVersion": "2026.8.33",
|
|
99
99
|
"bundledDist": false
|
|
100
100
|
},
|
|
101
101
|
"release": {
|
|
File without changes
|
|
File without changes
|
/package/dist/{conversation-bindings-GDQ_Laxj.js → .setup/conversation-bindings-GDQ_Laxj.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|