@openclaw/imessage 2026.9.8 → 2026.10.1-beta.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 (33) hide show
  1. package/dist/.setup/{accounts-nzcU0cq2.mjs → accounts-evTpvJMv.mjs} +6 -12
  2. package/dist/.setup/{group-policy-90pw4tyG.mjs → actions-DJqbUmbN.mjs} +103 -269
  3. package/dist/.setup/{actions.runtime-DdBN29zj.mjs → actions.runtime-DL5i-Y4J.mjs} +49 -84
  4. package/dist/.setup/{api-B9Qx21G-.mjs → api-SAVMfMoY.mjs} +5 -5
  5. package/dist/.setup/{api-D2S6FhGw.mjs → api-oq_MryN7.mjs} +6 -6
  6. package/dist/.setup/{approval-handler.runtime-DKSq0DWq.mjs → approval-handler.runtime-Bj2NGNXF.mjs} +26 -62
  7. package/dist/.setup/{approval-reactions-Bp33xc83.mjs → approval-reactions-L9Ul7PAu.mjs} +3 -2
  8. package/dist/.setup/{channel-9fyvuN_p.mjs → channel-CL73qdMG.mjs} +134 -60
  9. package/dist/.setup/{monitor-fv9nRuTH.mjs → channel.runtime-DY7JJ0_9.mjs} +202 -206
  10. package/dist/.setup/{sanitize-outbound-3MLljgtY.mjs → client-12apu4Ip.mjs} +26 -635
  11. package/dist/.setup/{config-schema-4Q3_EqYt.mjs → config-schema-DXwa_3V5.mjs} +1 -1
  12. package/dist/.setup/{media-contract-CagwSMvo.mjs → media-contract-DjQGZlfl.mjs} +1 -1
  13. package/dist/.setup/{message-tool-api-D032l82H.mjs → message-tool-api-CqfRxLlT.mjs} +2 -2
  14. package/dist/.setup/{question-reactions-Cy-dmU_j.mjs → question-reactions-DJV-TnA8.mjs} +2 -1
  15. package/dist/.setup/{reaction-context-Br-vAJFp.mjs → reaction-context-By7kUMBC.mjs} +2 -7
  16. package/dist/.setup/{remote-file-DRPCaVmg.mjs → remote-file-BU7pA-Zi.mjs} +7 -11
  17. package/dist/.setup/sanitize-outbound-C0x4BPky.mjs +564 -0
  18. package/dist/.setup/{send-Cu9nl757.mjs → send-pkYwL6Rt.mjs} +56 -103
  19. package/dist/.setup/{setup-core-8MDdYHj5.mjs → setup-core-DqOBe-n0.mjs} +1 -1
  20. package/dist/.setup/{setup-surface-tGXFDdWh.mjs → setup-surface-zKhIinwY.mjs} +2 -2
  21. package/dist/api.js +6 -6
  22. package/dist/channel-config-api.js +1 -1
  23. package/dist/channel-plugin-api.js +1 -1
  24. package/dist/contract-api.js +1 -1
  25. package/dist/doctor-contract-api.js +29 -21
  26. package/dist/media-contract-api.js +1 -1
  27. package/dist/message-tool-api.js +1 -1
  28. package/dist/runtime-api.js +2 -24
  29. package/dist/setup-entry.js +1 -1
  30. package/openclaw.plugin.json +1 -1
  31. package/package.json +4 -4
  32. package/dist/.setup/channel.runtime-n-MPKL8k.mjs +0 -92
  33. package/dist/.setup/state-migrations-B-Q7bO0Y.mjs +0 -47
@@ -1,11 +1,12 @@
1
1
  import { a as looksLikeIMessageExplicitTargetId, c as parseIMessageTarget, d as isIMessagePhoneLikeHandle, n as inferIMessageTargetChatType, o as normalizeIMessageHandle, u as normalizeIMessageMessagingTarget } from "./targets-BicBiYsM.mjs";
2
- import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-nzcU0cq2.mjs";
3
- import { D as resolveIMessageDirectChatService, n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText } from "./sanitize-outbound-3MLljgtY.mjs";
4
- import { a as matchIMessageAcpConversation, c as getIMessageApprovalApprovers, l as imessageApprovalAuth, o as normalizeIMessageAcpConversationId, r as resolveIMessageGroupToolPolicy, s as resolveIMessageConversationIdFromTarget, t as resolveIMessageGroupRequireMention, u as imessageMessageActions } from "./group-policy-90pw4tyG.mjs";
5
- import { i as createIMessageSetupWizardProxy, s as imessageSetupContract } from "./setup-core-8MDdYHj5.mjs";
2
+ import { a as resolveDefaultIMessageAccountId, i as listIMessageAccountIds, o as resolveIMessageAccount, t as collectIMessageDuplicateAccountSourceWarnings } from "./accounts-evTpvJMv.mjs";
3
+ import { C as resolveIMessageDirectChatService } from "./client-12apu4Ip.mjs";
4
+ import { t as imessageMessageActions } from "./actions-DJqbUmbN.mjs";
5
+ import { i as createIMessageSetupWizardProxy, s as imessageSetupContract } from "./setup-core-DqOBe-n0.mjs";
6
6
  import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.mjs";
7
- import { t as IMessageChannelConfigSchema } from "./config-schema-4Q3_EqYt.mjs";
8
- import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-CagwSMvo.mjs";
7
+ import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText } from "./sanitize-outbound-C0x4BPky.mjs";
8
+ import { t as IMessageChannelConfigSchema } from "./config-schema-DXwa_3V5.mjs";
9
+ import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-DjQGZlfl.mjs";
9
10
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
11
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
11
12
  import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
@@ -26,8 +27,35 @@ import { shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk
26
27
  import { addApprovalReactionHintToText } from "openclaw/plugin-sdk/approval-reaction-runtime";
27
28
  import { buildTypedExecApprovalPendingReplyPayload, buildTypedPluginApprovalPendingReplyPayload } from "openclaw/plugin-sdk/approval-reply-runtime";
28
29
  import { getExecApprovalReplyMetadata, resolveExecApprovalCommandDisplay, resolveExecApprovalRequestAllowedDecisions } from "openclaw/plugin-sdk/approval-runtime";
29
- import { createRestrictSendersChannelSecurity } from "openclaw/plugin-sdk/channel-policy";
30
+ import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
31
+ import { buildChannelGroupsScopeTree, createRestrictSendersChannelSecurity, resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
30
32
  import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
33
+ //#region extensions/imessage/src/approval-auth.ts
34
+ function normalizeIMessageApproverId(value) {
35
+ const raw = String(value).trim();
36
+ if (!raw) return;
37
+ const normalized = normalizeIMessageHandle(raw);
38
+ if (!normalized || normalized.startsWith("chat_id:") || normalized.startsWith("chat_guid:") || normalized.startsWith("chat_identifier:")) return;
39
+ return normalized;
40
+ }
41
+ function normalizeIMessageApproverEntry(value) {
42
+ return String(value).trim() === "*" ? "*" : normalizeIMessageApproverId(value);
43
+ }
44
+ const imessageApproval$1 = createChannelApprovalAuth({
45
+ channelLabel: "iMessage",
46
+ resolveInputs: ({ cfg, accountId }) => {
47
+ return { allowFrom: resolveIMessageAccount({
48
+ cfg,
49
+ accountId
50
+ }).config.allowFrom };
51
+ },
52
+ normalizeApprover: normalizeIMessageApproverEntry,
53
+ normalizeSenderId: normalizeIMessageApproverId,
54
+ isWildcardAuthorized: ({ purpose, approvers }) => purpose === "action" && approvers.includes("*")
55
+ });
56
+ const getIMessageApprovalApprovers = imessageApproval$1.resolveApprovers;
57
+ const imessageApprovalAuth = imessageApproval$1.approvalAuth;
58
+ //#endregion
31
59
  //#region extensions/imessage/src/approval-text.ts
32
60
  function replaceApprovalIdPlaceholder(text, approvalId) {
33
61
  return (text ?? "").replace(/\/approve\s+<id>/g, () => `/approve ${approvalId}`);
@@ -92,7 +120,7 @@ const imessageApproval = createApproverRestrictedNativeApprovalCapabilityFromFor
92
120
  approvalKind,
93
121
  request
94
122
  }),
95
- load: async () => (await import("./approval-handler.runtime-DKSq0DWq.mjs")).imessageApprovalNativeRuntime
123
+ load: async () => (await import("./approval-handler.runtime-Bj2NGNXF.mjs")).imessageApprovalNativeRuntime
96
124
  })
97
125
  });
98
126
  const imessageApprovalRouting = imessageApproval.routing;
@@ -192,15 +220,76 @@ function buildIMessagePluginPendingPayload(params) {
192
220
  }
193
221
  const imessageApprovalCapability = imessageApproval.capability;
194
222
  //#endregion
223
+ //#region extensions/imessage/src/conversation-id-core.ts
224
+ function normalizeIMessageAcpConversationId(conversationId) {
225
+ const trimmed = conversationId.trim();
226
+ if (!trimmed) return null;
227
+ try {
228
+ const parsed = parseIMessageTarget(trimmed);
229
+ if (parsed.kind === "handle") {
230
+ const handle = normalizeIMessageHandle(parsed.to);
231
+ return handle ? { conversationId: handle } : null;
232
+ }
233
+ if (parsed.kind === "chat_id") return { conversationId: String(parsed.chatId) };
234
+ if (parsed.kind === "chat_guid") return { conversationId: parsed.chatGuid };
235
+ return { conversationId: parsed.chatIdentifier };
236
+ } catch {
237
+ const handle = normalizeIMessageHandle(trimmed);
238
+ return handle ? { conversationId: handle } : null;
239
+ }
240
+ }
241
+ function matchIMessageAcpConversation(params) {
242
+ const binding = normalizeIMessageAcpConversationId(params.bindingConversationId);
243
+ const conversation = normalizeIMessageAcpConversationId(params.conversationId);
244
+ if (!binding || !conversation) return null;
245
+ if (binding.conversationId !== conversation.conversationId) return null;
246
+ return {
247
+ conversationId: conversation.conversationId,
248
+ matchPriority: 2
249
+ };
250
+ }
251
+ function resolveIMessageConversationIdFromTarget(target) {
252
+ return normalizeIMessageAcpConversationId(target)?.conversationId;
253
+ }
254
+ //#endregion
255
+ //#region extensions/imessage/src/conversation-id.ts
256
+ function resolveIMessageInboundConversationId(params) {
257
+ if (params.isGroup) return params.chatId != null && Number.isFinite(params.chatId) ? String(params.chatId) : void 0;
258
+ return normalizeIMessageHandle(params.sender) || void 0;
259
+ }
260
+ //#endregion
195
261
  //#region extensions/imessage/src/doctor.ts
196
262
  const imessageDoctor = {
197
263
  groupAllowFromFallbackToAllowFrom: false,
198
264
  collectPreviewWarnings: ({ cfg }) => collectIMessageDuplicateAccountSourceWarnings({ cfg })
199
265
  };
200
266
  //#endregion
267
+ //#region extensions/imessage/src/group-policy.ts
268
+ function resolveScopePath(params) {
269
+ return params.groupId ? [params.groupId] : [];
270
+ }
271
+ function resolveIMessageGroupRequireMention(params) {
272
+ return resolveScopeRequireMention({
273
+ tree: buildChannelGroupsScopeTree(params.cfg, "imessage", params.accountId),
274
+ path: resolveScopePath(params)
275
+ });
276
+ }
277
+ function resolveIMessageGroupToolPolicy(params) {
278
+ return resolveScopeToolsPolicy({
279
+ ...params,
280
+ tree: buildChannelGroupsScopeTree(params.cfg, "imessage", params.accountId),
281
+ path: resolveScopePath(params),
282
+ messageProvider: "imessage"
283
+ });
284
+ }
285
+ function resolveIMessageGroupSystemPrompt(params) {
286
+ const prompt = params.groupConfig?.systemPrompt ?? params.defaultConfig?.systemPrompt;
287
+ return typeof prompt === "string" ? prompt.trim() || void 0 : void 0;
288
+ }
289
+ //#endregion
201
290
  //#region extensions/imessage/src/shared.ts
202
291
  const IMESSAGE_CHANNEL = "imessage";
203
- const imessageSetupWizard = createIMessageSetupWizardProxy(async () => (await import("./setup-surface-tGXFDdWh.mjs")).imessageSetupWizard);
292
+ const imessageSetupWizard = createIMessageSetupWizardProxy(async () => (await import("./setup-surface-zKhIinwY.mjs")).imessageSetupWizard);
204
293
  const imessageConfigAdapter = createScopedChannelConfigAdapter({
205
294
  sectionKey: IMESSAGE_CHANNEL,
206
295
  listAccountIds: listIMessageAccountIds,
@@ -283,18 +372,8 @@ function createIMessagePluginBase(params) {
283
372
  };
284
373
  }
285
374
  //#endregion
286
- //#region extensions/imessage/src/status-core.ts
287
- async function probeIMessageStatusAccount(params) {
288
- return await params.probeIMessageAccount({
289
- timeoutMs: params.timeoutMs,
290
- cliPath: params.account.config.cliPath,
291
- dbPath: params.account.config.dbPath,
292
- ...params.account.config.remoteHost ? { remoteHost: params.account.config.remoteHost } : {}
293
- });
294
- }
295
- //#endregion
296
375
  //#region extensions/imessage/src/channel.ts
297
- const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-n-MPKL8k.mjs"));
376
+ const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DY7JJ0_9.mjs"));
298
377
  async function sendIMessageOutbound(ctx, kind, options = {}) {
299
378
  return await (await loadIMessageChannelRuntime()).sendIMessageOutbound({
300
379
  cfg: ctx.cfg,
@@ -330,30 +409,8 @@ function toIMessageMessageSendResult(result, kind, replyToId) {
330
409
  ...result.meta && Object.keys(result.meta).length > 0 ? { meta: result.meta } : {}
331
410
  };
332
411
  }
333
- const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-Bp33xc83.mjs").then((n) => n.t));
334
- const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-Cy-dmU_j.mjs").then((n) => n.r));
335
- async function prepareForwardedIMessageApprovalPayload(params) {
336
- const prepared = (await loadIMessageApprovalReactionsModule()).addIMessageApprovalReactionHintToStructuredPayload(params);
337
- if (prepared) Object.assign(params.payload, prepared);
338
- }
339
- async function registerDeliveredIMessageApprovalPayload(params) {
340
- const accountId = resolveIMessageAccount({
341
- cfg: params.cfg,
342
- accountId: params.target.accountId
343
- }).accountId;
344
- (await loadIMessageQuestionReactionsModule()).registerIMessageQuestionReactionTargetForDeliveredPayload({
345
- accountId,
346
- target: params.target,
347
- payload: params.payload,
348
- results: params.results
349
- });
350
- await (await loadIMessageApprovalReactionsModule()).registerIMessageApprovalReactionTargetForDeliveredPayload({
351
- accountId,
352
- target: params.target,
353
- payload: params.payload,
354
- results: params.results
355
- });
356
- }
412
+ const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-L9Ul7PAu.mjs").then((n) => n.t));
413
+ const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-DJV-TnA8.mjs").then((n) => n.r));
357
414
  const imessageMessageAdapter = defineChannelMessageAdapter({
358
415
  id: "imessage",
359
416
  durableFinal: { capabilities: {
@@ -501,10 +558,11 @@ const imessagePlugin = createChatChannelPlugin({
501
558
  cliPath: snapshot.cliPath ?? null,
502
559
  dbPath: snapshot.dbPath ?? null
503
560
  }),
504
- probeAccount: async ({ account, timeoutMs }) => await probeIMessageStatusAccount({
505
- account,
561
+ probeAccount: async ({ account, timeoutMs }) => await (await loadIMessageChannelRuntime()).probeIMessageAccount({
506
562
  timeoutMs,
507
- probeIMessageAccount: async (params) => await (await loadIMessageChannelRuntime()).probeIMessageAccount(params)
563
+ cliPath: account.config.cliPath,
564
+ dbPath: account.config.dbPath,
565
+ ...account.config.remoteHost ? { remoteHost: account.config.remoteHost } : {}
508
566
  }),
509
567
  resolveAccountSnapshot: ({ account, runtime }) => ({
510
568
  accountId: account.accountId,
@@ -518,17 +576,20 @@ const imessagePlugin = createChatChannelPlugin({
518
576
  }),
519
577
  resolveAccountState: ({ enabled }) => enabled ? "enabled" : "disabled"
520
578
  }),
521
- gateway: { startAccount: async (ctx) => {
522
- const conversationBindings = createIMessageConversationBindingManager({
523
- cfg: ctx.cfg,
524
- accountId: ctx.accountId
525
- });
526
- try {
527
- return await (await loadIMessageChannelRuntime()).startIMessageGatewayAccount(ctx);
528
- } finally {
529
- conversationBindings.stop();
579
+ gateway: {
580
+ apiVersion: 2,
581
+ startAccount: async (ctx) => {
582
+ const conversationBindings = createIMessageConversationBindingManager({
583
+ cfg: ctx.cfg,
584
+ accountId: ctx.accountId
585
+ });
586
+ try {
587
+ return await (await loadIMessageChannelRuntime()).startIMessageGatewayAccount(ctx);
588
+ } finally {
589
+ conversationBindings.stop();
590
+ }
530
591
  }
531
- } },
592
+ },
532
593
  message: imessageMessageAdapter,
533
594
  actions: imessageMessageActions,
534
595
  approvalCapability: imessageApprovalCapability
@@ -573,16 +634,29 @@ const imessagePlugin = createChatChannelPlugin({
573
634
  }),
574
635
  beforeDeliverPayload: async ({ payload, hint }) => {
575
636
  if (hint?.kind !== "approval-pending") return;
576
- await prepareForwardedIMessageApprovalPayload({
637
+ const prepared = (await loadIMessageApprovalReactionsModule()).addIMessageApprovalReactionHintToStructuredPayload({
577
638
  payload,
578
639
  approvalKind: hint.approvalKind
579
640
  });
641
+ if (prepared) Object.assign(payload, prepared);
580
642
  },
581
643
  renderPresentation: ({ payload, presentation }) => questionGatewayRuntime.prepareReactionPayloadForDelivery({
582
644
  payload,
583
645
  presentation
584
646
  }),
585
- afterDeliverPayload: async (params) => await registerDeliveredIMessageApprovalPayload(params),
647
+ afterDeliverPayload: async ({ cfg, target, payload, results }) => {
648
+ const delivery = {
649
+ accountId: resolveIMessageAccount({
650
+ cfg,
651
+ accountId: target.accountId
652
+ }).accountId,
653
+ target,
654
+ payload,
655
+ results
656
+ };
657
+ (await loadIMessageQuestionReactionsModule()).registerIMessageQuestionReactionTargetForDeliveredPayload(delivery);
658
+ await (await loadIMessageApprovalReactionsModule()).registerIMessageApprovalReactionTargetForDeliveredPayload(delivery);
659
+ },
586
660
  deliveryCapabilities: { durableFinal: {
587
661
  text: true,
588
662
  media: true,
@@ -604,4 +678,4 @@ const imessagePlugin = createChatChannelPlugin({
604
678
  }
605
679
  });
606
680
  //#endregion
607
- export { createIMessagePluginBase as n, imessageSetupWizard as r, imessagePlugin as t };
681
+ export { resolveIMessageGroupSystemPrompt as a, matchIMessageAcpConversation as c, getIMessageApprovalApprovers as d, imessageApprovalAuth as f, resolveIMessageGroupRequireMention as i, normalizeIMessageAcpConversationId as l, createIMessagePluginBase as n, resolveIMessageGroupToolPolicy as o, imessageSetupWizard as r, resolveIMessageInboundConversationId as s, imessagePlugin as t, resolveIMessageConversationIdFromTarget as u };