@openclaw/imessage 2026.8.1-beta.2 → 2026.8.1-beta.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.
@@ -1,10 +1,11 @@
1
- import { A as enumerateConversationKeyForms, D as buildIMessageApprovalConversationKeyForInbound, M as normalizeIMessageGuid, N as getIMessageApprovalApprovers, P as imessageApprovalAuth, _ as appendIMessageApprovalReactionHintForOutboundMessage, j as normalizeConversationKey, k as enumerateApprovalTargetKeys, w as registerIMessageApprovalReactionTargetForOutboundMessage, y as extractIMessageApprovalPromptBinding } from "./group-policy-DF9xSdik.js";
2
1
  import { d as resolveIMessageChatDbLookupPath, l as resolveIMessageRemoteHost, n as hasExclusiveIMessageLocalDatabase, o as resolveIMessageAccount } from "./accounts-D00Njxg2.js";
3
- import { l as parseIMessageTarget, n as formatIMessageChatTarget, s as normalizeIMessageHandle } from "./message-tool-api-CPDfJJoE.js";
4
- import { c as rememberIMessageReplyCache, h as chatContextFromIMessageTarget, p as getOptionalIMessageRuntime } from "./monitor-reply-cache-DKlYGd5x.js";
5
- import { a as IMessageRpcRequestError, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient, t as protectIMessageFencedRoleMarkers } from "./sanitize-outbound-CoTZLXMw.js";
6
- import { a as rememberPersistedIMessageEcho, r as forgetPersistedIMessageEchoKey } from "./persisted-echo-cache-BPWGUK-L.js";
7
- import { i as runIMessageCliJsonCommand, r as resolveAuthorizedIMessageReplyReference, t as withIMessageRemoteFile } from "./remote-file-DLwO9ved.js";
2
+ import { l as parseIMessageTarget, n as formatIMessageChatTarget, s as normalizeIMessageHandle } from "./message-tool-api-TZiNYA17.js";
3
+ import { c as rememberIMessageReplyCache, h as chatContextFromIMessageTarget, p as getOptionalIMessageRuntime, v as resolveIMessageDirectChatService } from "./monitor-reply-cache-BdeUQaHO.js";
4
+ import { a as IMessageRpcRequestError, n as sanitizeIMessageFinalOutboundText, o as createIMessageRpcClient, t as protectIMessageFencedRoleMarkers } from "./sanitize-outbound-DaLmdkbf.js";
5
+ import { _ as imessageApprovalAuth, g as getIMessageApprovalApprovers } from "./group-policy-Ca3c5KES.js";
6
+ import { a as rememberPersistedIMessageEcho, r as forgetPersistedIMessageEchoKey } from "./persisted-echo-cache-DGxy-J4t.js";
7
+ import { d as normalizeConversationKey, f as normalizeIMessageGuid, i as registerIMessageApprovalReactionTarget, l as enumerateApprovalTargetKeys, s as buildIMessageApprovalConversationKeyForInbound, u as enumerateConversationKeyForms } from "./approval-reactions-BME5eA6T.js";
8
+ import { i as runIMessageCliJsonCommand, r as resolveAuthorizedIMessageReplyReference, t as withIMessageRemoteFile } from "./remote-file-CDuk0joc.js";
8
9
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
9
10
  import { createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
10
11
  import { accessSync, constants } from "node:fs";
@@ -13,12 +14,12 @@ import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/s
13
14
  import { sleep } from "openclaw/plugin-sdk/runtime-env";
14
15
  import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
15
16
  import { PlatformMessageNotDispatchedError, isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
16
- import { createApprovalReactionTargetStore, listApprovalReactionBindings } from "openclaw/plugin-sdk/approval-reaction-runtime";
17
- import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
17
+ import { addApprovalReactionHintToText, createApprovalReactionTargetStore, listApprovalReactionBindings } from "openclaw/plugin-sdk/approval-reaction-runtime";
18
18
  import { extractOriginalFilename, kindFromMime, resolveOutboundAttachmentFromUrl } from "openclaw/plugin-sdk/media-runtime";
19
19
  import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery } from "openclaw/plugin-sdk/text-chunking";
20
20
  import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
21
21
  import { openNodeSqliteDatabase } from "openclaw/plugin-sdk/sqlite-runtime";
22
+ import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
22
23
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
23
24
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
24
25
  import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
@@ -598,7 +599,7 @@ async function resolveFallbackSentMessageGuid(params) {
598
599
  return null;
599
600
  }
600
601
  function shouldRecoverApprovalPromptGuid(params) {
601
- return !params.filePath && !params.replyToId && Boolean(params.message.trim()) && Boolean(extractIMessageApprovalPromptBinding(params.message));
602
+ return Boolean(params.approvalPrompt && !params.filePath && !params.replyToId);
602
603
  }
603
604
  function canCheckSentMessageAfterRpcTimeout(params) {
604
605
  return Boolean(params.resolveSentMessageGuidImpl) || canResolveLatestSentMessageGuidFromChatDb(params.dbPath);
@@ -686,11 +687,6 @@ function resultService(value) {
686
687
  const normalized = normalizeOptionalString(value)?.toLowerCase();
687
688
  return normalized === "imessage" || normalized === "sms" ? normalized : void 0;
688
689
  }
689
- function resultChatGuidService(value) {
690
- const chatGuid = normalizeOptionalString(value);
691
- if (/^imessage;/iu.test(chatGuid ?? "")) return "imessage";
692
- return /^sms;/iu.test(chatGuid ?? "") ? "sms" : void 0;
693
- }
694
690
  function resolvePendingPersistedEchoTtlMs(timeoutMs) {
695
691
  return Math.max(MIN_PENDING_PERSISTED_ECHO_TTL_MS, Math.max(0, timeoutMs) + PENDING_PERSISTED_ECHO_GRACE_MS);
696
692
  }
@@ -886,7 +882,10 @@ async function sendMessageIMessage(to, text, opts) {
886
882
  const pendingEchoTtlMs = resolvePendingPersistedEchoTtlMs(timeoutMs);
887
883
  const region = opts.region?.trim() || account.config.region?.trim() || "US";
888
884
  const maxBytes = typeof opts.maxBytes === "number" ? opts.maxBytes : typeof account.config.mediaMaxMb === "number" ? account.config.mediaMaxMb * 1024 * 1024 : 16 * 1024 * 1024;
889
- let message = text && opts.approvalKind ? appendIMessageApprovalReactionHintForOutboundMessage(text) : text;
885
+ let message = opts.approvalPrompt ? addApprovalReactionHintToText({
886
+ text,
887
+ allowedDecisions: opts.approvalPrompt.allowedDecisions
888
+ }) : text;
890
889
  const protectedRoles = protectIMessageFencedRoleMarkers(message);
891
890
  message = protectedRoles.text;
892
891
  let filePath;
@@ -1074,7 +1073,7 @@ async function sendMessageIMessage(to, text, opts) {
1074
1073
  effectiveReplyToId = void 0;
1075
1074
  } else if (filePath || !isIMessageRpcSendTimeout(error)) throw error;
1076
1075
  else if (!shouldRecoverApprovalPromptGuid({
1077
- message,
1076
+ approvalPrompt: opts.approvalPrompt,
1078
1077
  filePath,
1079
1078
  replyToId: resolvedReplyToId
1080
1079
  }) || !canCheckSentMessageAfterRpcTimeout({
@@ -1105,7 +1104,7 @@ async function sendMessageIMessage(to, text, opts) {
1105
1104
  resolveMessageGuidImpl: opts.resolveMessageGuidImpl
1106
1105
  });
1107
1106
  if (!approvalBindingMessageId && shouldRecoverApprovalPromptGuid({
1108
- message,
1107
+ approvalPrompt: opts.approvalPrompt,
1109
1108
  filePath,
1110
1109
  replyToId: effectiveReplyToId
1111
1110
  })) approvalBindingMessageId = await resolveFallbackSentMessageGuid({
@@ -1122,7 +1121,7 @@ async function sendMessageIMessage(to, text, opts) {
1122
1121
  messageId: resolvedId ?? void 0
1123
1122
  });
1124
1123
  const providerChatGuid = normalizeOptionalString(result.chat_guid) ?? normalizeOptionalString(result.chatGuid);
1125
- const confirmedService = resultService(result.service) ?? resultChatGuidService(providerChatGuid) ?? (service === "imessage" || service === "sms" ? service : void 0);
1124
+ const confirmedService = resolveIMessageDirectChatService(resultService(result.service) ?? service, providerChatGuid);
1126
1125
  if (resolvedId && isConcreteIMessageMessageId(resolvedId)) {
1127
1126
  const chatContext = chatContextFromIMessageTarget(target, confirmedService ?? service);
1128
1127
  rememberIMessageReplyCache({
@@ -1134,7 +1133,7 @@ async function sendMessageIMessage(to, text, opts) {
1134
1133
  isFromMe: true
1135
1134
  });
1136
1135
  }
1137
- if (message && approvalBindingMessageId && opts.approvalKind) {
1136
+ if (message && approvalBindingMessageId && opts.approvalPrompt) {
1138
1137
  const handleForKey = target.kind === "handle" ? normalizeIMessageHandle(target.to) : void 0;
1139
1138
  const conversation = {
1140
1139
  ...target.kind === "chat_guid" ? { chatGuid: target.chatGuid } : {},
@@ -1142,12 +1141,13 @@ async function sendMessageIMessage(to, text, opts) {
1142
1141
  ...target.kind === "chat_id" ? { chatId: target.chatId } : {},
1143
1142
  ...handleForKey ? { handle: handleForKey } : {}
1144
1143
  };
1145
- registerIMessageApprovalReactionTargetForOutboundMessage({
1144
+ registerIMessageApprovalReactionTarget({
1146
1145
  accountId: account.accountId,
1147
1146
  conversation,
1148
1147
  messageId: approvalBindingMessageId,
1149
- text: message,
1150
- approvalKind: opts.approvalKind
1148
+ approvalId: opts.approvalPrompt.approvalId,
1149
+ approvalKind: opts.approvalPrompt.approvalKind,
1150
+ allowedDecisions: opts.approvalPrompt.allowedDecisions
1151
1151
  });
1152
1152
  }
1153
1153
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/imessage",
3
- "version": "2026.8.1-beta.2",
3
+ "version": "2026.8.1-beta.3",
4
4
  "description": "OpenClaw iMessage channel plugin using imsg on a signed-in Mac",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.8.1-beta.2"
15
+ "openclaw": ">=2026.8.1-beta.3"
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.1-beta.2"
95
+ "pluginApi": ">=2026.8.1-beta.3"
96
96
  },
97
97
  "build": {
98
- "openclawVersion": "2026.8.1-beta.2",
98
+ "openclawVersion": "2026.8.1-beta.3",
99
99
  "bundledDist": false
100
100
  },
101
101
  "release": {