@openclaw/imessage 2026.9.1 → 2026.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{actions.runtime-DCjNT81u.js → actions.runtime-CzvR20qT.js} +2 -2
  2. package/dist/api.js +3 -3
  3. package/dist/{approval-handler.runtime-BReeID1z.js → approval-handler.runtime-B6JGnxQf.js} +5 -5
  4. package/dist/{approval-reactions-DcLRPx7O.js → approval-reactions-BM_AwHPq.js} +46 -85
  5. package/dist/{channel-zDmMTHWD.js → channel-B6qtBfCj.js} +21 -14
  6. package/dist/channel-config-api.js +1 -1
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{channel.runtime-qQBHCle8.js → channel.runtime-C2lcFXWn.js} +4 -8
  9. package/dist/{config-schema-DuGbA8Kp.js → config-schema-CCbTcJEV.js} +10 -37
  10. package/dist/{group-policy-BWqG2esy.js → group-policy-Duro87b4.js} +2 -2
  11. package/dist/{monitor-AmSj6QIH.js → monitor-Dj3TAimI.js} +41 -43
  12. package/dist/{question-reactions-viP7ZcyG.js → question-reactions-9tBYB1_F.js} +4 -7
  13. package/dist/{reaction-context-BAYI7pz0.js → reaction-context-Br-vAJFp.js} +9 -3
  14. package/dist/{remote-file-COTN7196.js → remote-file-5n5LznCa.js} +3 -52
  15. package/dist/runtime-api.js +5 -5
  16. package/dist/{sanitize-outbound-CN3Hxbjy.js → sanitize-outbound-C6UF2cvr.js} +124 -51
  17. package/dist/{send-v0blZfaI.js → send-CIHiLtcY.js} +5 -4
  18. package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
  19. package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
  20. package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
  21. package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
  22. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  23. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  24. package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
  25. package/node_modules/typebox/build/system/memory/create.mjs +3 -4
  26. package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
  27. package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
  28. package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
  29. package/node_modules/typebox/build/system/memory/update.mjs +3 -2
  30. package/node_modules/typebox/package.json +1 -1
  31. package/openclaw.plugin.json +7 -2
  32. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
- import { _ as normalizeDirectChatIdentifier, f as resolveIMessageMessageId, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient } from "./sanitize-outbound-CN3Hxbjy.js";
2
- import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-COTN7196.js";
1
+ import { n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient, p as resolveIMessageMessageId, s as runIMessageCliJsonCommand, v as normalizeDirectChatIdentifier } from "./sanitize-outbound-C6UF2cvr.js";
2
+ import { n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-5n5LznCa.js";
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";
package/dist/api.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "./accounts-CCirBEIm.js";
2
2
  import { _ as IMESSAGE_ACTION_NAMES, a as isAllowedIMessageSender, c as parseIMessageAllowTarget, g as IMESSAGE_ACTIONS, l as parseIMessageTarget, n as formatIMessageChatTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle } from "./message-tool-api-CUoFESHj.js";
3
- import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-CN3Hxbjy.js";
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, v as imessageSetupContract } from "./group-policy-BWqG2esy.js";
5
- import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-zDmMTHWD.js";
3
+ import { m as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-C6UF2cvr.js";
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, v as imessageSetupContract } from "./group-policy-Duro87b4.js";
5
+ import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-B6qtBfCj.js";
6
6
  import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.js";
7
7
  import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.js";
8
8
  import { createAllowedChatSenderMatcher, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow, resolveServicePrefixedAllowTarget, resolveServicePrefixedChatTarget, resolveServicePrefixedOrChatAllowTarget, resolveServicePrefixedTarget } from "openclaw/plugin-sdk/channel-targets";
@@ -1,9 +1,9 @@
1
1
  import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.js";
2
2
  import { f as getCachedIMessagePrivateApiStatus, l as parseIMessageTarget } from "./message-tool-api-CUoFESHj.js";
3
- import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-CN3Hxbjy.js";
4
- import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-BWqG2esy.js";
5
- import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-DcLRPx7O.js";
6
- import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-v0blZfaI.js";
3
+ import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-C6UF2cvr.js";
4
+ import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-Duro87b4.js";
5
+ import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-BM_AwHPq.js";
6
+ import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-CIHiLtcY.js";
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-DCjNT81u.js"), "imessageActionsRuntime");
16
+ const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-CzvR20qT.js"), "imessageActionsRuntime");
17
17
  const DEFAULT_PROBE_TIMEOUT_MS = 5e3;
18
18
  const APPROVAL_POLL_ORDERING_DELAY_MS = 1100;
19
19
  function buildPendingPayload(params) {
@@ -1,19 +1,14 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
2
  import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-CUoFESHj.js";
3
- import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-BWqG2esy.js";
3
+ import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-Duro87b4.js";
4
4
  import { n as getOptionalIMessageRuntime } from "./runtime-Cza4CY5T.js";
5
- import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.js";
5
+ import { n as normalizeIMessageGuid, t as resolveIMessageReactionContext } from "./reaction-context-Br-vAJFp.js";
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";
9
- import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
10
- import { addApprovalReactionHintToText, approvalReactionDecisionSetsMatch, buildApprovalReactionDeliveredBindingMarker, buildApprovalReactionHint, createApprovalReactionTargetStore, listApprovalReactionBindings, normalizeApprovalReactionDecision, readApprovalReactionDecisionList, readApprovalReactionDeliveredBinding, readApprovalReactionPresentationBinding, resolveTypedApprovalReactionTarget } from "openclaw/plugin-sdk/approval-reaction-runtime";
9
+ import { addApprovalReactionHintToText, approvalReactionDecisionSetsMatch, buildApprovalReactionDeliveredBindingMarker, buildApprovalReactionHint, createApprovalReactionTargetStore, listApprovalReactionBindings, normalizeApprovalReactionDecision, readApprovalReactionDecisionList, readApprovalReactionDeliveredBinding, readApprovalReactionPresentationBinding, readApprovalReactionTargetRecord, resolveTypedApprovalReactionTarget, settleApprovalReaction } from "openclaw/plugin-sdk/approval-reaction-runtime";
11
10
  import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
12
11
  //#region extensions/imessage/src/approval-target-keys.ts
13
- /** Strip the `p:<n>/` part prefix Messages puts on some GUIDs so keys match. */
14
- function normalizeIMessageGuid(value) {
15
- return value.trim().replace(/^p:\d+\//iu, "");
16
- }
17
12
  function chatIdToKeyValue(chatId) {
18
13
  if (chatId == null || chatId === "") return null;
19
14
  if (typeof chatId === "number") return Number.isFinite(chatId) && chatId > 0 ? String(chatId) : null;
@@ -240,24 +235,13 @@ function reportApprovalBindingCorrelationMismatch(binding) {
240
235
  });
241
236
  } catch {}
242
237
  }
243
- function readPersistedTarget(value) {
244
- const target = value;
245
- if (!target || typeof target.approvalId !== "string" || target.approvalKind !== "exec" && target.approvalKind !== "plugin") return null;
246
- const allowedDecisions = readApprovalReactionDecisionList(target.allowedDecisions);
247
- if (!allowedDecisions) return null;
248
- return {
249
- approvalId: target.approvalId,
250
- approvalKind: target.approvalKind,
251
- allowedDecisions
252
- };
253
- }
254
238
  const imessageApprovalReactionTargets = createApprovalReactionTargetStore({
255
239
  namespace: PERSISTENT_NAMESPACE,
256
240
  maxEntries: PERSISTENT_MAX_ENTRIES,
257
241
  defaultTtlMs: DEFAULT_REACTION_TARGET_TTL_MS,
258
242
  openStore: (params) => getOptionalIMessageRuntime()?.state.openKeyedStore(params),
259
243
  logPersistentError: reportPersistentApprovalReactionError,
260
- readPersistedTarget
244
+ readPersistedTarget: readApprovalReactionTargetRecord
261
245
  });
262
246
  const IMESSAGE_APPROVAL_DELIVERY_BINDING_KEY = "imessageApprovalReactionBindingV1";
263
247
  function visibleApprovalBindingMatches(text, binding, options) {
@@ -456,50 +440,27 @@ async function handleIMessageApprovalReaction(params) {
456
440
  handled: false,
457
441
  stopPolling: false
458
442
  };
459
- let target = null;
443
+ let matchedTarget = null;
460
444
  let matchedMessageId = null;
461
445
  for (const candidate of event.messageIdCandidates) {
462
- target = await resolveIMessageApprovalReactionTargetWithPersistence({
446
+ matchedTarget = await resolveIMessageApprovalReactionTargetWithPersistence({
463
447
  accountId: params.accountId,
464
448
  conversation: event.conversation,
465
449
  messageId: candidate,
466
450
  reactionKey: event.reactionKey
467
451
  });
468
- if (target) {
452
+ if (matchedTarget) {
469
453
  matchedMessageId = candidate;
470
454
  break;
471
455
  }
472
456
  }
457
+ const target = matchedTarget;
473
458
  if (!target) return {
474
459
  handled: false,
475
460
  stopPolling: false
476
461
  };
477
- if (getIMessageApprovalApprovers({
478
- cfg: params.cfg,
479
- accountId: params.accountId
480
- }).length === 0) {
481
- params.logVerboseMessage?.(`imessage: approval reaction denied id=${target.approvalId}; reactions require explicit approvers`);
482
- return {
483
- handled: true,
484
- stopPolling: false
485
- };
486
- }
487
- if (!imessageApprovalAuth.authorizeActorAction({
488
- cfg: params.cfg,
489
- accountId: params.accountId,
490
- senderId: event.actorHandle,
491
- action: "approve",
492
- approvalKind: target.approvalKind
493
- }).authorized) {
494
- params.logVerboseMessage?.(`imessage: approval reaction denied id=${target.approvalId} sender=${event.actorHandle}`);
495
- return {
496
- handled: true,
497
- stopPolling: false
498
- };
499
- }
500
- const resolveApprovalOverGateway = await loadResolveApprovalOverGateway();
501
- try {
502
- const result = await resolveApprovalOverGateway({
462
+ const settlement = await settleApprovalReaction({
463
+ request: {
503
464
  cfg: params.cfg,
504
465
  approvalId: target.approvalId,
505
466
  approvalKind: target.approvalKind,
@@ -509,46 +470,46 @@ async function handleIMessageApprovalReaction(params) {
509
470
  senderId: event.actorHandle,
510
471
  gatewayUrl: params.gatewayUrl,
511
472
  ...params.gatewayRuntime ? { gatewayRuntime: params.gatewayRuntime } : {}
512
- });
513
- for (const candidate of event.messageIdCandidates) unregisterIMessageApprovalReactionTarget({
514
- accountId: params.accountId,
515
- conversation: event.conversation,
516
- messageId: candidate
517
- });
518
- const outcome = result.applied ? "resolved" : "already resolved";
519
- params.logVerboseMessage?.(`imessage: approval reaction ${outcome} id=${target.approvalId} sender=${event.actorHandle} ${formatCanonicalApprovalTerminalState(result.approval)} via messageId=${matchedMessageId ?? event.messageId}`);
520
- return {
521
- handled: true,
522
- stopPolling: true,
523
- stopPollingReason: "resolved"
524
- };
525
- } catch (error) {
526
- if (isApprovalNotFoundError(error)) {
473
+ },
474
+ approvers: getIMessageApprovalApprovers({
475
+ cfg: params.cfg,
476
+ accountId: params.accountId
477
+ }),
478
+ authorizeActorAction: (input) => imessageApprovalAuth.authorizeActorAction(input),
479
+ loadResolver: loadResolveApprovalOverGateway,
480
+ clearTarget: () => {
527
481
  for (const candidate of event.messageIdCandidates) unregisterIMessageApprovalReactionTarget({
528
482
  accountId: params.accountId,
529
483
  conversation: event.conversation,
530
484
  messageId: candidate
531
485
  });
532
- params.logVerboseMessage?.(`imessage: approval reaction ignored for expired approval id=${target.approvalId} sender=${event.actorHandle}`);
533
- return {
534
- handled: true,
535
- stopPolling: true,
536
- stopPollingReason: "not-found"
537
- };
538
- }
539
- try {
540
- getOptionalIMessageRuntime()?.logging.getChildLogger({
541
- plugin: "imessage",
542
- feature: "approval-reactions"
543
- }).warn("approval reaction failed", {
544
- approvalId: target.approvalId,
545
- senderId: event.actorHandle,
546
- error: String(error)
547
- });
548
- } catch {}
549
- params.logVerboseMessage?.(`imessage: approval reaction failed id=${target.approvalId} sender=${event.actorHandle}: ${String(error)}`);
550
- throw error;
551
- }
486
+ },
487
+ onResolved: (result) => {
488
+ const outcome = result.applied ? "resolved" : "already resolved";
489
+ params.logVerboseMessage?.(`imessage: approval reaction ${outcome} id=${target.approvalId} sender=${event.actorHandle} ${formatCanonicalApprovalTerminalState(result.approval)} via messageId=${matchedMessageId ?? event.messageId}`);
490
+ },
491
+ onError: (error) => {
492
+ try {
493
+ getOptionalIMessageRuntime()?.logging.getChildLogger({
494
+ plugin: "imessage",
495
+ feature: "approval-reactions"
496
+ }).warn("approval reaction failed", {
497
+ approvalId: target.approvalId,
498
+ senderId: event.actorHandle,
499
+ error: String(error)
500
+ });
501
+ } catch {}
502
+ },
503
+ logVerboseMessage: params.logVerboseMessage
504
+ });
505
+ return settlement === "denied" ? {
506
+ handled: true,
507
+ stopPolling: false
508
+ } : {
509
+ handled: true,
510
+ stopPolling: true,
511
+ stopPollingReason: settlement
512
+ };
552
513
  }
553
514
  async function maybeResolveIMessageApprovalReaction(params) {
554
515
  return (await handleIMessageApprovalReaction(params)).handled;
@@ -559,4 +520,4 @@ function clearIMessageApprovalReactionTargetsForTest() {
559
520
  loadResolveApprovalOverGateway.clear();
560
521
  }
561
522
  //#endregion
562
- export { unregisterIMessageApprovalReactionTarget as a, buildIMessageApprovalConversationKeyForTarget as c, normalizeConversationKey as d, normalizeIMessageGuid as f, registerIMessageApprovalReactionTarget as i, enumerateApprovalTargetKeys as l, handleIMessageApprovalReaction as n, listPendingIMessageApprovalReactionPollTargets as o, maybeResolveIMessageApprovalReaction as r, buildIMessageApprovalConversationKeyForInbound as s, approval_reactions_exports as t, enumerateConversationKeyForms as u };
523
+ export { unregisterIMessageApprovalReactionTarget as a, buildIMessageApprovalConversationKeyForTarget as c, normalizeConversationKey as d, registerIMessageApprovalReactionTarget as i, enumerateApprovalTargetKeys as l, handleIMessageApprovalReaction as n, listPendingIMessageApprovalReactionPollTargets as o, maybeResolveIMessageApprovalReaction as r, buildIMessageApprovalConversationKeyForInbound as s, approval_reactions_exports as t, enumerateConversationKeyForms as u };
@@ -1,15 +1,16 @@
1
1
  import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-CCirBEIm.js";
2
2
  import { l as parseIMessageTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle, u as isIMessagePhoneLikeHandle } from "./message-tool-api-CUoFESHj.js";
3
- import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, v as resolveIMessageDirectChatService } from "./sanitize-outbound-CN3Hxbjy.js";
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-BWqG2esy.js";
3
+ import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, y as resolveIMessageDirectChatService } from "./sanitize-outbound-C6UF2cvr.js";
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-Duro87b4.js";
5
5
  import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.js";
6
- import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.js";
6
+ import { t as IMessageChannelConfigSchema } from "./config-schema-CCbTcJEV.js";
7
7
  import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-pns3TSS5.js";
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";
11
11
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
12
12
  import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
13
+ import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
13
14
  import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
14
15
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
15
16
  import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
@@ -90,7 +91,7 @@ const imessageApproval = createApproverRestrictedNativeApprovalCapabilityFromFor
90
91
  approvalKind,
91
92
  request
92
93
  }),
93
- load: async () => (await import("./approval-handler.runtime-BReeID1z.js")).imessageApprovalNativeRuntime
94
+ load: async () => (await import("./approval-handler.runtime-B6JGnxQf.js")).imessageApprovalNativeRuntime
94
95
  })
95
96
  });
96
97
  const imessageApprovalRouting = imessageApproval.routing;
@@ -205,7 +206,7 @@ const imessageDoctor = {
205
206
  //#region extensions/imessage/src/shared.ts
206
207
  const IMESSAGE_CHANNEL = "imessage";
207
208
  async function loadIMessageChannelRuntime$1() {
208
- return await import("./channel.runtime-qQBHCle8.js");
209
+ return await import("./channel.runtime-C2lcFXWn.js");
209
210
  }
210
211
  const imessageSetupWizard = createIMessageSetupWizardProxy(async () => (await loadIMessageChannelRuntime$1()).imessageSetupWizard);
211
212
  const imessageConfigAdapter = createScopedChannelConfigAdapter({
@@ -267,7 +268,10 @@ function createIMessagePluginBase(params) {
267
268
  effects: true,
268
269
  groupManagement: true
269
270
  },
270
- reload: { configPrefixes: ["channels.imessage"] },
271
+ reload: {
272
+ configPrefixes: ["channels.imessage"],
273
+ noopPrefixes: ["messages.inbound"]
274
+ },
271
275
  configSchema: IMessageChannelConfigSchema,
272
276
  config: {
273
277
  ...imessageConfigAdapter,
@@ -304,7 +308,7 @@ async function probeIMessageStatusAccount(params) {
304
308
  }
305
309
  //#endregion
306
310
  //#region extensions/imessage/src/channel.ts
307
- const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-qQBHCle8.js"));
311
+ const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-C2lcFXWn.js"));
308
312
  function toIMessageMessageSendResult(result, kind, replyToId) {
309
313
  const receipt = result.receipt ?? createMessageReceiptFromOutboundResults({
310
314
  results: result.messageId ? [{
@@ -320,8 +324,8 @@ function toIMessageMessageSendResult(result, kind, replyToId) {
320
324
  ...result.meta && Object.keys(result.meta).length > 0 ? { meta: result.meta } : {}
321
325
  };
322
326
  }
323
- const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-DcLRPx7O.js").then((n) => n.t));
324
- const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-viP7ZcyG.js").then((n) => n.r));
327
+ const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-BM_AwHPq.js").then((n) => n.t));
328
+ const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-9tBYB1_F.js").then((n) => n.r));
325
329
  async function prepareForwardedIMessageApprovalPayload(params) {
326
330
  const prepared = (await loadIMessageApprovalReactionsModule()).addIMessageApprovalReactionHintToStructuredPayload(params);
327
331
  if (prepared) Object.assign(params.payload, prepared);
@@ -554,11 +558,14 @@ const imessagePlugin = createChatChannelPlugin({
554
558
  },
555
559
  pairing: { text: {
556
560
  idLabel: "imessageSenderId",
557
- message: "OpenClaw: your access has been approved.",
558
- notify: async ({ id, cfg }) => await (await loadIMessageChannelRuntime()).notifyIMessageApproval({
559
- id,
560
- cfg
561
- })
561
+ message: PAIRING_APPROVED_MESSAGE,
562
+ notify: async (params) => {
563
+ await (await loadIMessageChannelRuntime()).sendIMessageOutbound({
564
+ ...params,
565
+ to: params.id,
566
+ text: params.message
567
+ });
568
+ }
562
569
  } },
563
570
  security: imessageSecurityAdapter,
564
571
  outbound: {
@@ -1,2 +1,2 @@
1
- import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.js";
1
+ import { t as IMessageChannelConfigSchema } from "./config-schema-CCbTcJEV.js";
2
2
  export { IMessageChannelConfigSchema };
@@ -1,2 +1,2 @@
1
- import { t as imessagePlugin } from "./channel-zDmMTHWD.js";
1
+ import { t as imessagePlugin } from "./channel-B6qtBfCj.js";
2
2
  export { imessagePlugin };
@@ -1,8 +1,8 @@
1
1
  import { l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-CCirBEIm.js";
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-BWqG2esy.js";
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-Duro87b4.js";
3
3
  import { t as IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-send-deps-B-QEsLSM.js";
4
- import { t as sendMessageIMessage } from "./send-v0blZfaI.js";
5
- import { t as monitorIMessageProvider } from "./monitor-AmSj6QIH.js";
4
+ import { t as sendMessageIMessage } from "./send-CIHiLtcY.js";
5
+ import { t as monitorIMessageProvider } from "./monitor-Dj3TAimI.js";
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";
@@ -10,7 +10,6 @@ import fs from "node:fs/promises";
10
10
  import { createDetectedBinaryStatus, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
11
11
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
12
12
  import { detectBinary as detectBinary$1, resolveBrewExecutable } from "openclaw/plugin-sdk/setup-tools";
13
- import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
14
13
  import { runPluginCommandWithTimeout } from "openclaw/plugin-sdk/run-command";
15
14
  //#region extensions/imessage/src/install-imsg.ts
16
15
  const IMESSAGE_BREW_FORMULA = "steipete/tap/imsg";
@@ -226,9 +225,6 @@ async function sendIMessageOutbound(params) {
226
225
  meta
227
226
  } : result;
228
227
  }
229
- async function notifyIMessageApproval(params) {
230
- await sendMessageIMessage(params.id, PAIRING_APPROVED_MESSAGE, { config: params.cfg });
231
- }
232
228
  async function probeIMessageAccount(params) {
233
229
  return await probeIMessage(params?.timeoutMs, {
234
230
  cliPath: params?.cliPath,
@@ -280,4 +276,4 @@ async function startIMessageGatewayAccount(ctx) {
280
276
  });
281
277
  }
282
278
  //#endregion
283
- export { imessageSetupWizard, notifyIMessageApproval, probeIMessageAccount, sendIMessageOutbound, startIMessageGatewayAccount };
279
+ export { imessageSetupWizard, probeIMessageAccount, sendIMessageOutbound, startIMessageGatewayAccount };
@@ -1,5 +1,5 @@
1
1
  import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
2
- import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, buildChannelAccountSchemaParts, buildChannelConfigSchema, buildChannelReactionShape, buildGroupEntrySchema, isSafeScpRemoteHost, isValidInboundPathRootPattern, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
2
+ import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, buildChannelAccountSchemaParts, buildChannelConfigSchema, buildChannelReactionShape, buildGroupEntrySchema, isSafeScpRemoteHost, isValidInboundPathRootPattern, refineChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-schema";
3
3
  import { z } from "zod";
4
4
  //#region extensions/imessage/src/config-ui-hints.ts
5
5
  const iMessageChannelConfigUiHints = {
@@ -93,46 +93,19 @@ const IMessageConfigSchema = IMessageAccountSchemaBase.extend({
93
93
  accounts: z.record(z.string(), IMessageAccountSchemaBase.optional()).optional(),
94
94
  defaultAccount: z.string().optional()
95
95
  }).superRefine((value, ctx) => {
96
- requireOpenAllowFrom({
97
- policy: value.dmPolicy,
98
- allowFrom: value.allowFrom,
99
- ctx,
100
- path: ["allowFrom"],
101
- message: "channels.imessage.dmPolicy=\"open\" requires channels.imessage.allowFrom to include \"*\""
102
- });
103
- requireAllowlistAllowFrom({
104
- policy: value.dmPolicy,
105
- allowFrom: value.allowFrom,
106
- ctx,
107
- path: ["allowFrom"],
108
- message: "channels.imessage.dmPolicy=\"allowlist\" requires channels.imessage.allowFrom to contain at least one sender ID"
96
+ refineChannelDmPolicy({
97
+ channelId: "imessage",
98
+ value,
99
+ ctx
109
100
  });
110
101
  if (!value.accounts) return;
111
102
  for (const [accountId, account] of Object.entries(value.accounts)) {
112
103
  if (!account) continue;
113
- const effectivePolicy = account.dmPolicy ?? value.dmPolicy;
114
- const effectiveAllowFrom = account.allowFrom ?? value.allowFrom;
115
- requireOpenAllowFrom({
116
- policy: effectivePolicy,
117
- allowFrom: effectiveAllowFrom,
118
- ctx,
119
- path: [
120
- "accounts",
121
- accountId,
122
- "allowFrom"
123
- ],
124
- message: "channels.imessage.accounts.*.dmPolicy=\"open\" requires channels.imessage.accounts.*.allowFrom (or channels.imessage.allowFrom) to include \"*\""
125
- });
126
- requireAllowlistAllowFrom({
127
- policy: effectivePolicy,
128
- allowFrom: effectiveAllowFrom,
129
- ctx,
130
- path: [
131
- "accounts",
132
- accountId,
133
- "allowFrom"
134
- ],
135
- message: "channels.imessage.accounts.*.dmPolicy=\"allowlist\" requires channels.imessage.accounts.*.allowFrom (or channels.imessage.allowFrom) to contain at least one sender ID"
104
+ refineChannelDmPolicy({
105
+ channelId: "imessage",
106
+ value,
107
+ accountId,
108
+ ctx
136
109
  });
137
110
  }
138
111
  });
@@ -1,6 +1,6 @@
1
1
  import { a as resolveDefaultIMessageAccountId, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount, u as expandIMessageUserPath } from "./accounts-CCirBEIm.js";
2
2
  import { _ as IMESSAGE_ACTION_NAMES, d as normalizeBareIMessageChatIdentifier, f as getCachedIMessagePrivateApiStatus, g as IMESSAGE_ACTIONS, h as setCachedIMessagePrivateApiStatus, l as parseIMessageTarget, p as imessageRpcSupportsMethod, s as normalizeIMessageHandle$1, t as describeIMessageMessageTool, u as isIMessagePhoneLikeHandle } from "./message-tool-api-CUoFESHj.js";
3
- import { c as isIMessageCurrentMessageInChat, h as chatContextFromIMessageTarget, o as createIMessageRpcClient, s as findLatestIMessageEntryForChat, u as rememberIMessageReplyCache } from "./sanitize-outbound-CN3Hxbjy.js";
3
+ import { c as findLatestIMessageEntryForChat, d as rememberIMessageReplyCache, g as chatContextFromIMessageTarget, l as isIMessageCurrentMessageInChat, o as createIMessageRpcClient } from "./sanitize-outbound-C6UF2cvr.js";
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";
@@ -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-DCjNT81u.js"), "imessageActionsRuntime");
522
+ const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-CzvR20qT.js"), "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"]);