@openclaw/imessage 2026.8.1-beta.3 → 2026.8.2

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 (156) hide show
  1. package/dist/{accounts-D00Njxg2.js → accounts-CCirBEIm.js} +4 -5
  2. package/dist/{actions.runtime-B_xJiBXF.js → actions.runtime-UDLBuS_8.js} +5 -5
  3. package/dist/api.js +6 -5
  4. package/dist/{approval-handler.runtime-BKku8aUf.js → approval-handler.runtime-ZaQQ2c4l.js} +9 -8
  5. package/dist/{approval-reactions-BME5eA6T.js → approval-reactions-B2-_97DN.js} +7 -11
  6. package/dist/{channel-BFQTpvrG.js → channel-B0wzN0uJ.js} +18 -16
  7. package/dist/channel-config-api.js +1 -1
  8. package/dist/channel-plugin-api.js +1 -1
  9. package/dist/{channel.runtime-BjkXwX9_.js → channel.runtime-lJfW7FBd.js} +60 -13
  10. package/dist/{config-schema-DV0KP5nC.js → config-schema-DuGbA8Kp.js} +8 -7
  11. package/dist/contract-api.js +1 -1
  12. package/dist/doctor-contract-api.js +8 -281
  13. package/dist/{group-policy-Ca3c5KES.js → group-policy-fYokgrgz.js} +25 -23
  14. package/dist/media-contract-api.js +1 -1
  15. package/dist/{media-contract-BEgdvYhW.js → media-contract-pns3TSS5.js} +3 -2
  16. package/dist/{message-tool-api-TZiNYA17.js → message-tool-api-CLWaomvw.js} +9 -7
  17. package/dist/message-tool-api.js +1 -1
  18. package/dist/{monitor-Uv5RaRTk.js → monitor-CSTZ-GFU.js} +304 -40
  19. package/dist/{question-reactions-to0i8vxE.js → question-reactions-viP7ZcyG.js} +1 -1
  20. package/dist/{reaction-context-DaNrZqYo.js → reaction-context-BAYI7pz0.js} +2 -2
  21. package/dist/{remote-file-CDuk0joc.js → remote-file-CmdycSRk.js} +9 -8
  22. package/dist/runtime-Cza4CY5T.js +8 -0
  23. package/dist/runtime-api.js +10 -9
  24. package/dist/{sanitize-outbound-DaLmdkbf.js → sanitize-outbound-DKRlFQoD.js} +371 -80
  25. package/dist/{send-Dake4Awx.js → send-DxhFcMfW.js} +146 -24
  26. package/dist/state-contract-DvahEY4X.js +56 -0
  27. package/dist/state-migrations-BhY4RwjU.js +277 -0
  28. package/node_modules/typebox/build/format/date.d.mts +1 -1
  29. package/node_modules/typebox/build/format/date.mjs +1 -1
  30. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  31. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  32. package/node_modules/typebox/build/format/email.d.mts +1 -1
  33. package/node_modules/typebox/build/format/email.mjs +2 -2
  34. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  35. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  36. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  37. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  38. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  39. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  40. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  41. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  42. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  43. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  44. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  45. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  46. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  47. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  48. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  49. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  50. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  51. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  52. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  53. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  54. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  55. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  56. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  57. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  58. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  59. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  60. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  61. package/node_modules/typebox/build/format/iri.mjs +26 -8
  62. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  63. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  64. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  65. package/node_modules/typebox/build/format/regex.mjs +2 -6
  66. package/node_modules/typebox/build/format/time.d.mts +2 -2
  67. package/node_modules/typebox/build/format/time.mjs +19 -14
  68. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  69. package/node_modules/typebox/build/format/uri.mjs +3 -130
  70. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  71. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  72. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  73. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  74. package/node_modules/typebox/build/format/url.d.mts +3 -3
  75. package/node_modules/typebox/build/format/url.mjs +4 -5
  76. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  77. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  78. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  79. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  80. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  81. package/node_modules/typebox/build/guard/string.mjs +7 -7
  82. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  83. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  84. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  85. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  86. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  87. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  88. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  89. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  90. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  91. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  92. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  93. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  94. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  95. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  96. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  97. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  98. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  99. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  100. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  101. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  102. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  103. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  104. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  105. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  106. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  107. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  108. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  109. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  110. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  111. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  112. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  113. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  114. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  115. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  116. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  117. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  118. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  119. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  120. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  121. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  122. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  123. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  124. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  125. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  126. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  127. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  128. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  129. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  130. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  131. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  132. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  133. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  134. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  135. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  136. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  137. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  138. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  139. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  140. package/node_modules/typebox/package.json +27 -27
  141. package/node_modules/typebox/readme.md +79 -82
  142. package/openclaw.plugin.json +0 -6
  143. package/package.json +5 -5
  144. package/dist/catchup-Dh-Rv4Ur.js +0 -294
  145. package/dist/monitor-reply-cache-BdeUQaHO.js +0 -353
  146. package/dist/persisted-echo-cache-DGxy-J4t.js +0 -143
  147. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  148. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  149. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  150. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  151. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  152. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  153. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  154. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  155. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  156. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -1,9 +1,8 @@
1
- import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
1
+ import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
2
2
  import { accessSync, constants, readFileSync, realpathSync, statSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
5
- import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
6
- import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-resolution";
5
+ import { normalizeAccountId, resolveAccountEntry } from "openclaw/plugin-sdk/account-resolution";
7
6
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
8
7
  import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
8
  import os from "node:os";
@@ -35,7 +34,7 @@ function resolveIMessageHomeDir() {
35
34
  function expandIMessageUserPath(value) {
36
35
  if (!value.startsWith("~")) return value;
37
36
  const home = resolveIMessageHomeDir();
38
- return home ? value.replace(/^~(?=$|[\\/])/, home) : value;
37
+ return home ? value.replace(/^~(?=$|[\\/])/, () => home) : value;
39
38
  }
40
39
  function resolveIMessageExecutable(cliPath) {
41
40
  const expanded = expandIMessageUserPath(cliPath);
@@ -224,7 +223,7 @@ function mergeIMessageAccountConfig(cfg, accountId) {
224
223
  } : merged;
225
224
  }
226
225
  function resolveIMessageAccount(params) {
227
- const accountId = normalizeAccountId$1(params.accountId ?? resolveDefaultIMessageAccountId(params.cfg));
226
+ const accountId = normalizeAccountId(params.accountId ?? resolveDefaultIMessageAccountId(params.cfg));
228
227
  const baseEnabled = params.cfg.channels?.imessage?.enabled !== false;
229
228
  const merged = mergeIMessageAccountConfig(params.cfg, accountId);
230
229
  const accountEnabled = merged.enabled !== false;
@@ -1,6 +1,5 @@
1
- import { _ as normalizeDirectChatIdentifier, u as resolveIMessageMessageId } from "./monitor-reply-cache-BdeUQaHO.js";
2
- import { n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient } from "./sanitize-outbound-DaLmdkbf.js";
3
- import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-CDuk0joc.js";
1
+ import { _ as normalizeDirectChatIdentifier, f as resolveIMessageMessageId, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient } from "./sanitize-outbound-DKRlFQoD.js";
2
+ import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-CmdycSRk.js";
4
3
  import { basename, parse, win32 } from "node:path";
5
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
5
  import { asDateTimestampMs, parseStrictInteger, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
@@ -8,7 +7,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
8
7
  import { sanitizeUntrustedFileName } from "openclaw/plugin-sdk/security-runtime";
9
8
  import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
10
9
  //#region extensions/imessage/src/actions-chat-guid.ts
11
- const CHAT_LIST_CACHE_TTL_MS = 30 * 1e3;
10
+ const CHAT_LIST_CACHE_TTL_MS = 3e4;
12
11
  const chatListCache = /* @__PURE__ */ new Map();
13
12
  function asChatList(value) {
14
13
  if (!value || typeof value !== "object" || Array.isArray(value)) return [];
@@ -130,7 +129,8 @@ async function withTempFile(input, fn) {
130
129
  rootDir: resolvePreferredOpenClawTmpDir(),
131
130
  prefix: "openclaw-imessage-"
132
131
  }, async (workspace) => {
133
- const { name, ext: safeExtension } = parse(sanitizeUntrustedFileName(input.filename, "upload.bin"));
132
+ const safeFilename = sanitizeUntrustedFileName(input.filename, "upload.bin");
133
+ const { name, ext: safeExtension } = parse(safeFilename);
134
134
  const originalExtension = parse(win32.basename(basename(input.filename))).ext;
135
135
  const extension = truncateUtf16Safe(sanitizeUntrustedFileName(originalExtension, safeExtension), 16);
136
136
  const filename = `${truncateUtf16Safe(name, 80 - extension.length)}${extension}`;
package/dist/api.js CHANGED
@@ -1,10 +1,11 @@
1
- import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "./accounts-D00Njxg2.js";
2
- import { C as IMESSAGE_ACTION_NAMES, S as IMESSAGE_ACTIONS, a as isAllowedIMessageSender, c as parseIMessageAllowTarget, d as parseChatAllowTargetPrefixes, f as parseChatTargetPrefixesOrThrow, g as resolveServicePrefixedTarget, h as resolveServicePrefixedOrChatAllowTarget, l as parseIMessageTarget, m as resolveServicePrefixedChatTarget, n as formatIMessageChatTarget, o as looksLikeIMessageExplicitTargetId, p as resolveServicePrefixedAllowTarget, r as inferIMessageTargetChatType, s as normalizeIMessageHandle, u as createAllowedChatSenderMatcher } from "./message-tool-api-TZiNYA17.js";
3
- import { s as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-DaLmdkbf.js";
4
- import { T as imessageSetupContract, a as normalizeIMessageAcpConversationId, h as normalizeIMessageMessagingTarget, i as matchIMessageAcpConversation, m as looksLikeIMessageTargetId, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, r as resolveIMessageInboundConversationId, t as resolveIMessageGroupRequireMention, y as probeIMessage } from "./group-policy-Ca3c5KES.js";
5
- import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-BFQTpvrG.js";
1
+ import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, r as listEnabledIMessageAccounts } from "./accounts-CCirBEIm.js";
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-CLWaomvw.js";
3
+ import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-DKRlFQoD.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-fYokgrgz.js";
5
+ import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-B0wzN0uJ.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
+ import { createAllowedChatSenderMatcher, parseChatAllowTargetPrefixes, parseChatTargetPrefixesOrThrow, resolveServicePrefixedAllowTarget, resolveServicePrefixedChatTarget, resolveServicePrefixedOrChatAllowTarget, resolveServicePrefixedTarget } from "openclaw/plugin-sdk/channel-targets";
8
9
  //#region extensions/imessage/src/channel.setup.ts
9
10
  const imessageSetupPlugin = { ...createIMessagePluginBase({
10
11
  setupWizard: imessageSetupWizard,
@@ -1,9 +1,9 @@
1
- import { o as resolveIMessageAccount } from "./accounts-D00Njxg2.js";
2
- import { l as parseIMessageTarget, y as getCachedIMessagePrivateApiStatus } from "./message-tool-api-TZiNYA17.js";
3
- import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-DaLmdkbf.js";
4
- import { g as getIMessageApprovalApprovers, h as normalizeIMessageMessagingTarget } from "./group-policy-Ca3c5KES.js";
5
- import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-BME5eA6T.js";
6
- import { i as mapSentPollOptionsToDecisions, n as buildApprovalPollOptions, o as iMessageApprovalControlBindings, r as iMessageApprovalPollTargets, t as sendMessageIMessage } from "./send-Dake4Awx.js";
1
+ import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.js";
2
+ import { f as getCachedIMessagePrivateApiStatus, l as parseIMessageTarget } from "./message-tool-api-CLWaomvw.js";
3
+ import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-DKRlFQoD.js";
4
+ import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-fYokgrgz.js";
5
+ import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-B2-_97DN.js";
6
+ import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-DxhFcMfW.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-B_xJiBXF.js"), "imessageActionsRuntime");
16
+ const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-UDLBuS_8.js"), "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 status = getCachedIMessagePrivateApiStatus(account.config.cliPath?.trim() || "imsg");
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
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-TZiNYA17.js";
3
- import { p as getOptionalIMessageRuntime } from "./monitor-reply-cache-BdeUQaHO.js";
4
- import { _ as imessageApprovalAuth, g as getIMessageApprovalApprovers } from "./group-policy-Ca3c5KES.js";
5
- import { t as resolveIMessageReactionContext } from "./reaction-context-DaNrZqYo.js";
2
+ import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-CLWaomvw.js";
3
+ import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-fYokgrgz.js";
4
+ import { n as getOptionalIMessageRuntime } from "./runtime-Cza4CY5T.js";
5
+ import { t as resolveIMessageReactionContext } from "./reaction-context-BAYI7pz0.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";
@@ -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 = 1440 * 60 * 1e3;
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 = 1440 * 60 * 1e3;
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) {
@@ -547,11 +547,7 @@ async function handleIMessageApprovalReaction(params) {
547
547
  });
548
548
  } catch {}
549
549
  params.logVerboseMessage?.(`imessage: approval reaction failed id=${target.approvalId} sender=${event.actorHandle}: ${String(error)}`);
550
- return {
551
- handled: true,
552
- stopPolling: true,
553
- stopPollingReason: "resolver-error"
554
- };
550
+ throw error;
555
551
  }
556
552
  }
557
553
  async function maybeResolveIMessageApprovalReaction(params) {
@@ -1,12 +1,13 @@
1
- import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-D00Njxg2.js";
2
- import { _ as isIMessagePhoneLikeHandle, l as parseIMessageTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle } from "./message-tool-api-TZiNYA17.js";
3
- import { v as resolveIMessageDirectChatService } from "./monitor-reply-cache-BdeUQaHO.js";
4
- import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText } from "./sanitize-outbound-DaLmdkbf.js";
5
- import { S as createIMessageSetupWizardProxy, T as imessageSetupContract, _ as imessageApprovalAuth, a as normalizeIMessageAcpConversationId, d as formatTrimmedAllowFromEntries$1, f as getChatChannelMeta, g as getIMessageApprovalApprovers, h as normalizeIMessageMessagingTarget, i as matchIMessageAcpConversation, n as resolveIMessageGroupToolPolicy, o as resolveIMessageConversationIdFromTarget, s as DEFAULT_ACCOUNT_ID, t as resolveIMessageGroupRequireMention, u as collectStatusIssuesFromLastError, v as imessageMessageActions } from "./group-policy-Ca3c5KES.js";
1
+ import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-CCirBEIm.js";
2
+ import { l as parseIMessageTarget, o as looksLikeIMessageExplicitTargetId, r as inferIMessageTargetChatType, s as normalizeIMessageHandle, u as isIMessagePhoneLikeHandle } from "./message-tool-api-CLWaomvw.js";
3
+ import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, v as resolveIMessageDirectChatService } from "./sanitize-outbound-DKRlFQoD.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-fYokgrgz.js";
6
5
  import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.js";
7
- import { t as IMessageChannelConfigSchema } from "./config-schema-DV0KP5nC.js";
8
- import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-BEgdvYhW.js";
6
+ import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.js";
7
+ import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-pns3TSS5.js";
8
+ import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
9
9
  import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
10
+ import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, formatTrimmedAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
10
11
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
11
12
  import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
12
13
  import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
@@ -14,7 +15,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
14
15
  import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
15
16
  import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
16
17
  import { buildOutboundBaseSessionKey, normalizeAccountId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
17
- import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
18
+ import { collectStatusIssuesFromLastError, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
18
19
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
19
20
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
20
21
  import { createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes } from "openclaw/plugin-sdk/approval-delivery-runtime";
@@ -23,9 +24,8 @@ import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk
23
24
  import { addApprovalReactionHintToText } from "openclaw/plugin-sdk/approval-reaction-runtime";
24
25
  import { buildTypedExecApprovalPendingReplyPayload, buildTypedPluginApprovalPendingReplyPayload } from "openclaw/plugin-sdk/approval-reply-runtime";
25
26
  import { getExecApprovalReplyMetadata, resolveExecApprovalCommandDisplay, resolveExecApprovalRequestAllowedDecisions } from "openclaw/plugin-sdk/approval-runtime";
26
- import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, formatTrimmedAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
27
- import { createChannelPluginBase } from "openclaw/plugin-sdk/core";
28
27
  import { createRestrictSendersChannelSecurity } from "openclaw/plugin-sdk/channel-policy";
28
+ import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
29
29
  //#region extensions/imessage/src/approval-text.ts
30
30
  function replaceApprovalIdPlaceholder(text, approvalId) {
31
31
  const safeApprovalId = approvalId.replace(/\$/g, "$$$$");
@@ -86,7 +86,7 @@ const imessageApproval = createApproverRestrictedNativeApprovalCapabilityFromFor
86
86
  approvalKind,
87
87
  request
88
88
  }),
89
- load: async () => (await import("./approval-handler.runtime-BKku8aUf.js")).imessageApprovalNativeRuntime
89
+ load: async () => (await import("./approval-handler.runtime-ZaQQ2c4l.js")).imessageApprovalNativeRuntime
90
90
  })
91
91
  });
92
92
  const imessageApprovalRouting = imessageApproval.routing;
@@ -161,6 +161,7 @@ function buildIMessageExecPendingPayload(params) {
161
161
  cwd: params.request.request.cwd ?? void 0,
162
162
  host: params.request.request.host === "node" ? "node" : "gateway",
163
163
  nodeId: params.request.request.nodeId ?? void 0,
164
+ scope: params.request.request.scope ?? void 0,
164
165
  sessionKey: params.request.request.sessionKey ?? null,
165
166
  expiresAtMs: params.request.expiresAtMs,
166
167
  nowMs: params.nowMs
@@ -200,7 +201,7 @@ const imessageDoctor = {
200
201
  //#region extensions/imessage/src/shared.ts
201
202
  const IMESSAGE_CHANNEL = "imessage";
202
203
  async function loadIMessageChannelRuntime$1() {
203
- return await import("./channel.runtime-BjkXwX9_.js");
204
+ return await import("./channel.runtime-lJfW7FBd.js");
204
205
  }
205
206
  const imessageSetupWizard = createIMessageSetupWizardProxy(async () => (await loadIMessageChannelRuntime$1()).imessageSetupWizard);
206
207
  const imessageConfigAdapter = createScopedChannelConfigAdapter({
@@ -299,7 +300,7 @@ async function probeIMessageStatusAccount(params) {
299
300
  }
300
301
  //#endregion
301
302
  //#region extensions/imessage/src/channel.ts
302
- const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BjkXwX9_.js"));
303
+ const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-lJfW7FBd.js"));
303
304
  function toIMessageMessageSendResult(result, kind, replyToId) {
304
305
  const receipt = result.receipt ?? createMessageReceiptFromOutboundResults({
305
306
  results: result.messageId ? [{
@@ -315,8 +316,8 @@ function toIMessageMessageSendResult(result, kind, replyToId) {
315
316
  ...result.meta && Object.keys(result.meta).length > 0 ? { meta: result.meta } : {}
316
317
  };
317
318
  }
318
- const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-BME5eA6T.js").then((n) => n.t));
319
- const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-to0i8vxE.js").then((n) => n.r));
319
+ const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-B2-_97DN.js").then((n) => n.t));
320
+ const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-viP7ZcyG.js").then((n) => n.r));
320
321
  async function prepareForwardedIMessageApprovalPayload(params) {
321
322
  const prepared = (await loadIMessageApprovalReactionsModule()).addIMessageApprovalReactionHintToStructuredPayload(params);
322
323
  if (prepared) Object.assign(params.payload, prepared);
@@ -454,7 +455,7 @@ const imessagePlugin = createChatChannelPlugin({
454
455
  allowlist: buildDmGroupAccountAllowlistAdapter({
455
456
  channelId: "imessage",
456
457
  resolveAccount: resolveIMessageAccount,
457
- normalize: ({ values }) => formatTrimmedAllowFromEntries$1(values),
458
+ normalize: ({ values }) => formatTrimmedAllowFromEntries(values),
458
459
  resolveDmAllowFrom: (account) => account.config.allowFrom,
459
460
  resolveGroupAllowFrom: (account) => account.config.groupAllowFrom,
460
461
  resolveDmPolicy: (account) => account.config.dmPolicy,
@@ -464,6 +465,7 @@ const imessagePlugin = createChatChannelPlugin({
464
465
  resolveRequireMention: resolveIMessageGroupRequireMention,
465
466
  resolveToolPolicy: resolveIMessageGroupToolPolicy
466
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."] },
467
469
  doctor: imessageDoctor,
468
470
  conversationBindings: {
469
471
  supportsCurrentConversationBinding: true,
@@ -1,2 +1,2 @@
1
- import { t as IMessageChannelConfigSchema } from "./config-schema-DV0KP5nC.js";
1
+ import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.js";
2
2
  export { IMessageChannelConfigSchema };
@@ -1,2 +1,2 @@
1
- import { t as imessagePlugin } from "./channel-BFQTpvrG.js";
1
+ import { t as imessagePlugin } from "./channel-B0wzN0uJ.js";
2
2
  export { imessagePlugin };
@@ -1,26 +1,66 @@
1
- import { l as resolveIMessageRemoteHost, o as resolveIMessageAccount, r as listEnabledIMessageAccounts, s as resolveIMessageDuplicateSourceOwner } from "./accounts-D00Njxg2.js";
2
- import { C as imessageCompletionNote, D as isAutoManagedIMessageCliPath, E as imessageSetupStatusBase, O as normalizeIMessageCliPathForSetup, b as IMESSAGE_INSTALL_COMMAND, c as PAIRING_APPROVED_MESSAGE, p as resolveChannelMediaMaxBytes, w as imessageDmPolicy, x as createIMessageCliPathTextInput, y as probeIMessage } from "./group-policy-Ca3c5KES.js";
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-fYokgrgz.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-Dake4Awx.js";
5
- import { t as monitorIMessageProvider } from "./monitor-Uv5RaRTk.js";
4
+ import { t as sendMessageIMessage } from "./send-DxhFcMfW.js";
5
+ import { t as monitorIMessageProvider } from "./monitor-CSTZ-GFU.js";
6
6
  import { createAccountStatusSink, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
7
7
  import path from "node:path";
8
+ import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
8
9
  import fs from "node:fs/promises";
9
10
  import { createDetectedBinaryStatus, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
10
11
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
11
12
  import { detectBinary as detectBinary$1, resolveBrewExecutable } from "openclaw/plugin-sdk/setup-tools";
13
+ import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
12
14
  import { runPluginCommandWithTimeout } from "openclaw/plugin-sdk/run-command";
13
15
  //#region extensions/imessage/src/install-imsg.ts
14
- async function resolveBrewIMessageCliPath(brewExe) {
16
+ const IMESSAGE_BREW_FORMULA = "steipete/tap/imsg";
17
+ function isPathInside(parentPath, candidatePath) {
18
+ const relative = path.relative(parentPath, candidatePath);
19
+ return relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
20
+ }
21
+ async function resolveBrewManagedIMessageCliPath(brewExe, cliPath) {
15
22
  try {
16
- const result = await runPluginCommandWithTimeout({
23
+ const formulae = await runPluginCommandWithTimeout({
17
24
  argv: [
18
25
  brewExe,
19
- "--prefix",
20
- "imsg"
26
+ "list",
27
+ "--formula",
28
+ "--full-name"
21
29
  ],
22
30
  timeoutMs: 1e4
23
31
  });
32
+ const installed = formulae.stdout.split(/\r?\n/u).some((formula) => formula.trim() === IMESSAGE_BREW_FORMULA);
33
+ if (formulae.code !== 0 || !installed) return null;
34
+ let resolvedCliPath = cliPath;
35
+ if (!path.isAbsolute(resolvedCliPath)) {
36
+ const resolved = await runPluginCommandWithTimeout({
37
+ argv: [
38
+ "/usr/bin/env",
39
+ "which",
40
+ resolvedCliPath
41
+ ],
42
+ timeoutMs: 1e4
43
+ });
44
+ resolvedCliPath = resolved.code === 0 ? resolved.stdout.split(/\r?\n/u)[0]?.trim() ?? "" : "";
45
+ }
46
+ if (!resolvedCliPath) return null;
47
+ const cellar = await runPluginCommandWithTimeout({
48
+ argv: [brewExe, "--cellar"],
49
+ timeoutMs: 1e4
50
+ });
51
+ if (cellar.code !== 0 || !cellar.stdout.trim()) return null;
52
+ const [realCliPath, realFormulaPath] = await Promise.all([fs.realpath(resolvedCliPath), fs.realpath(path.join(cellar.stdout.trim(), "imsg"))]);
53
+ return isPathInside(realFormulaPath, realCliPath) ? resolvedCliPath : null;
54
+ } catch {
55
+ return null;
56
+ }
57
+ }
58
+ async function resolveBrewIMessageCliPath(brewExe) {
59
+ try {
60
+ const result = await runPluginCommandWithTimeout({
61
+ argv: [brewExe, "--prefix"],
62
+ timeoutMs: 1e4
63
+ });
24
64
  if (result.code !== 0 || !result.stdout.trim()) return null;
25
65
  const candidate = path.join(result.stdout.trim(), "bin", "imsg");
26
66
  await fs.access(candidate);
@@ -41,9 +81,13 @@ async function installIMessageCli(runtime, opts) {
41
81
  };
42
82
  runtime.log(`${opts?.upgrade ? "Updating" : "Installing"} imsg via Homebrew (${brewExe})...`);
43
83
  if (opts?.upgrade) {
84
+ if (!await resolveBrewManagedIMessageCliPath(brewExe, opts.cliPath ?? "imsg")) {
85
+ runtime.log("Keeping the detected imsg binary because Homebrew does not manage it.");
86
+ return { ok: true };
87
+ }
44
88
  const update = await runPluginCommandWithTimeout({
45
89
  argv: [brewExe, "update"],
46
- timeoutMs: 5 * 6e4
90
+ timeoutMs: 3e5
47
91
  });
48
92
  if (update.code !== 0) return {
49
93
  ok: false,
@@ -53,7 +97,7 @@ async function installIMessageCli(runtime, opts) {
53
97
  const command = opts?.upgrade ? ["upgrade", "imsg"] : ["install", "steipete/tap/imsg"];
54
98
  const result = await runPluginCommandWithTimeout({
55
99
  argv: [brewExe, ...command],
56
- timeoutMs: 15 * 6e4
100
+ timeoutMs: 9e5
57
101
  });
58
102
  if (result.code !== 0) return {
59
103
  ok: false,
@@ -129,11 +173,15 @@ const imessageSetupWizard = {
129
173
  })) return;
130
174
  try {
131
175
  await options?.beforePersistentEffect?.();
132
- const result = await installIMessageCli(runtime, { upgrade: cliDetected });
176
+ const result = await installIMessageCli(runtime, {
177
+ upgrade: cliDetected,
178
+ cliPath: normalizedCliPath
179
+ });
133
180
  if (result.ok && result.cliPath) {
134
181
  await prompter.note(`Installed imsg at ${result.cliPath}`, "iMessage");
135
182
  return { credentialValues: { cliPath: result.cliPath } };
136
183
  }
184
+ if (result.ok) await prompter.note(`Using existing imsg at ${normalizedCliPath}; Homebrew does not manage this binary.`, "iMessage");
137
185
  if (!result.ok) await prompter.note(result.error ?? "imsg install failed.", "iMessage");
138
186
  } catch (error) {
139
187
  await prompter.note(`imsg install failed: ${String(error)}`, "iMessage");
@@ -153,8 +201,7 @@ async function sendIMessageOutbound(params) {
153
201
  const send = resolveOutboundSendDep(params.deps, "imessage", { legacyKeys: IMESSAGE_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageIMessage;
154
202
  const maxBytes = resolveChannelMediaMaxBytes({
155
203
  cfg: params.cfg,
156
- resolveChannelLimitMb: ({ cfg, accountId }) => cfg.channels?.imessage?.accounts?.[accountId]?.mediaMaxMb ?? cfg.channels?.imessage?.mediaMaxMb,
157
- accountId: params.accountId
204
+ resolveChannelLimitMb: () => resolveIMessageAccount(params).config.mediaMaxMb
158
205
  });
159
206
  const result = await send(params.to, params.text, {
160
207
  config: params.cfg,
@@ -1,5 +1,5 @@
1
1
  import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
2
- import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, buildChannelConfigSchema, buildChannelReactionShape, buildCommonChannelAccountShape, buildGroupEntrySchema, isSafeScpRemoteHost, isValidInboundPathRootPattern, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
2
+ import { ChannelDeliveryStreamingConfigSchema, ChannelSendReadReceiptsSchema, ExecutableTokenSchema, buildChannelAccountSchemaParts, buildChannelConfigSchema, buildChannelReactionShape, buildGroupEntrySchema, isSafeScpRemoteHost, isValidInboundPathRootPattern, requireAllowlistAllowFrom, requireOpenAllowFrom } 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 = {
@@ -43,13 +43,13 @@ const IMessageActionSchema = z.object({
43
43
  sendAttachment: z.boolean().optional(),
44
44
  polls: z.boolean().optional()
45
45
  }).strict().optional();
46
+ const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
47
+ omit: ["mentionPatterns", "replyToMode"],
48
+ streaming: ChannelDeliveryStreamingConfigSchema.optional(),
49
+ mediaMaxMb: z.number().int().positive().optional()
50
+ });
46
51
  const IMessageAccountSchemaBase = z.object({
47
- ...buildCommonChannelAccountShape({
48
- useDefaults: true,
49
- omit: ["mentionPatterns", "replyToMode"],
50
- streaming: ChannelDeliveryStreamingConfigSchema.optional(),
51
- mediaMaxMb: z.number().int().positive().optional()
52
- }),
52
+ ...accountShape,
53
53
  cliPath: ExecutableTokenSchema.optional(),
54
54
  dbPath: z.string().optional(),
55
55
  remoteHost: z.string().refine(isSafeScpRemoteHost, "expected SSH host or user@host (no spaces/options)").optional(),
@@ -89,6 +89,7 @@ const IMessageAccountSchemaBase = z.object({
89
89
  ] }).optional()).optional()
90
90
  }).strict();
91
91
  const IMessageConfigSchema = IMessageAccountSchemaBase.extend({
92
+ ...rootPolicyShape,
92
93
  accounts: z.record(z.string(), IMessageAccountSchemaBase.optional()).optional(),
93
94
  defaultAccount: z.string().optional()
94
95
  }).superRefine((value, ctx) => {
@@ -1,3 +1,3 @@
1
- import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./media-contract-BEgdvYhW.js";
1
+ import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./media-contract-pns3TSS5.js";
2
2
  import "./media-contract-api.js";
3
3
  export { DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, resolveIMessageAttachmentRoots, resolveIMessageAttachmentRoots as resolveInboundAttachmentRoots, resolveIMessageRemoteAttachmentRoots, resolveIMessageRemoteAttachmentRoots as resolveRemoteInboundAttachmentRoots };