@openclaw/imessage 2026.8.1-beta.3 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-D00Njxg2.js → accounts-CCirBEIm.js} +4 -5
- package/dist/{actions.runtime-B_xJiBXF.js → actions.runtime-CAl3WcqD.js} +2 -3
- package/dist/api.js +6 -5
- package/dist/{approval-handler.runtime-BKku8aUf.js → approval-handler.runtime-UBd1j2Sg.js} +7 -7
- package/dist/{approval-reactions-BME5eA6T.js → approval-reactions-LL5yn1Rc.js} +5 -9
- package/dist/{channel-BFQTpvrG.js → channel-DNI9DKGN.js} +17 -16
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BjkXwX9_.js → channel.runtime-HSkrmWfW.js} +58 -11
- package/dist/{config-schema-DV0KP5nC.js → config-schema-DuGbA8Kp.js} +8 -7
- package/dist/contract-api.js +1 -1
- package/dist/doctor-contract-api.js +8 -281
- package/dist/{group-policy-Ca3c5KES.js → group-policy-Dvc-BcWo.js} +12 -17
- package/dist/{media-contract-BEgdvYhW.js → media-contract-D-FhGE98.js} +1 -1
- package/dist/media-contract-api.js +1 -1
- package/dist/{message-tool-api-TZiNYA17.js → message-tool-api-CvIgJpOo.js} +3 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-Uv5RaRTk.js → monitor-BywJn1QW.js} +289 -28
- package/dist/{question-reactions-to0i8vxE.js → question-reactions-viP7ZcyG.js} +1 -1
- package/dist/{reaction-context-DaNrZqYo.js → reaction-context-BAYI7pz0.js} +2 -2
- package/dist/{remote-file-CDuk0joc.js → remote-file-6mCj2ZBy.js} +2 -2
- package/dist/runtime-Cza4CY5T.js +8 -0
- package/dist/runtime-api.js +10 -9
- package/dist/{sanitize-outbound-DaLmdkbf.js → sanitize-outbound-Du-r1lNQ.js} +344 -57
- package/dist/{send-Dake4Awx.js → send-mgWPKqSV.js} +132 -11
- package/dist/state-contract-4TK_cDDb.js +56 -0
- package/dist/state-migrations-SFdKp3GQ.js +277 -0
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/openclaw.plugin.json +0 -6
- package/package.json +5 -5
- package/dist/catchup-Dh-Rv4Ur.js +0 -294
- package/dist/monitor-reply-cache-BdeUQaHO.js +0 -353
- package/dist/persisted-echo-cache-DGxy-J4t.js +0 -143
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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
|
|
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,
|
|
2
|
-
import { n as
|
|
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-Du-r1lNQ.js";
|
|
2
|
+
import { i as runIMessageCliJsonCommand, n as authorizeIMessageResourceReference, t as withIMessageRemoteFile } from "./remote-file-6mCj2ZBy.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";
|
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-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-
|
|
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-CvIgJpOo.js";
|
|
3
|
+
import { p as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./sanitize-outbound-Du-r1lNQ.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-Dvc-BcWo.js";
|
|
5
|
+
import { n as createIMessagePluginBase, r as imessageSetupWizard, t as imessagePlugin } from "./channel-DNI9DKGN.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-
|
|
2
|
-
import {
|
|
3
|
-
import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-
|
|
4
|
-
import {
|
|
5
|
-
import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-
|
|
6
|
-
import {
|
|
1
|
+
import { o as resolveIMessageAccount } from "./accounts-CCirBEIm.js";
|
|
2
|
+
import { f as getCachedIMessagePrivateApiStatus, l as parseIMessageTarget } from "./message-tool-api-CvIgJpOo.js";
|
|
3
|
+
import { i as extractMarkdownFormatRuns } from "./sanitize-outbound-Du-r1lNQ.js";
|
|
4
|
+
import { c as normalizeIMessageMessagingTarget, l as getIMessageApprovalApprovers } from "./group-policy-Dvc-BcWo.js";
|
|
5
|
+
import { a as unregisterIMessageApprovalReactionTarget, c as buildIMessageApprovalConversationKeyForTarget, i as registerIMessageApprovalReactionTarget } from "./approval-reactions-LL5yn1Rc.js";
|
|
6
|
+
import { a as iMessageApprovalPollTargets, c as iMessageApprovalControlBindings, i as buildApprovalPollOptions, o as mapSentPollOptionsToDecisions, t as sendMessageIMessage } from "./send-mgWPKqSV.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-
|
|
16
|
+
const loadIMessageActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-CAl3WcqD.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,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-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as resolveIMessageReactionContext } from "./reaction-context-
|
|
2
|
+
import { l as parseIMessageTarget, s as normalizeIMessageHandle } from "./message-tool-api-CvIgJpOo.js";
|
|
3
|
+
import { l as getIMessageApprovalApprovers, u as imessageApprovalAuth } from "./group-policy-Dvc-BcWo.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";
|
|
@@ -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
|
-
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
import { v as resolveIMessageDirectChatService } from "./
|
|
4
|
-
import { n as
|
|
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-CvIgJpOo.js";
|
|
3
|
+
import { n as sanitizeIMessageFinalOutboundText, r as sanitizeOutboundText, v as resolveIMessageDirectChatService } from "./sanitize-outbound-Du-r1lNQ.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-Dvc-BcWo.js";
|
|
6
5
|
import { t as createIMessageConversationBindingManager } from "./conversation-bindings-GDQ_Laxj.js";
|
|
7
|
-
import { t as IMessageChannelConfigSchema } from "./config-schema-
|
|
8
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-
|
|
6
|
+
import { t as IMessageChannelConfigSchema } from "./config-schema-DuGbA8Kp.js";
|
|
7
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots } from "./media-contract-D-FhGE98.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-
|
|
89
|
+
load: async () => (await import("./approval-handler.runtime-UBd1j2Sg.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-
|
|
204
|
+
return await import("./channel.runtime-HSkrmWfW.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-
|
|
303
|
+
const loadIMessageChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-HSkrmWfW.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-
|
|
319
|
-
const loadIMessageQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-
|
|
319
|
+
const loadIMessageApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-LL5yn1Rc.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
|
|
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,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IMessageChannelConfigSchema } from "./config-schema-
|
|
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-
|
|
1
|
+
import { t as imessagePlugin } from "./channel-DNI9DKGN.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-
|
|
2
|
-
import {
|
|
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-Dvc-BcWo.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-
|
|
5
|
-
import { t as monitorIMessageProvider } from "./monitor-
|
|
4
|
+
import { t as sendMessageIMessage } from "./send-mgWPKqSV.js";
|
|
5
|
+
import { t as monitorIMessageProvider } from "./monitor-BywJn1QW.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
|
-
|
|
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
|
|
23
|
+
const formulae = await runPluginCommandWithTimeout({
|
|
17
24
|
argv: [
|
|
18
25
|
brewExe,
|
|
19
|
-
"
|
|
20
|
-
"
|
|
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,6 +81,10 @@ 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
90
|
timeoutMs: 5 * 6e4
|
|
@@ -129,11 +173,15 @@ const imessageSetupWizard = {
|
|
|
129
173
|
})) return;
|
|
130
174
|
try {
|
|
131
175
|
await options?.beforePersistentEffect?.();
|
|
132
|
-
const result = await installIMessageCli(runtime, {
|
|
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: (
|
|
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,
|
|
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
|
-
...
|
|
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) => {
|
package/dist/contract-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./media-contract-
|
|
1
|
+
import { n as resolveIMessageAttachmentRoots, r as resolveIMessageRemoteAttachmentRoots, t as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS } from "./media-contract-D-FhGE98.js";
|
|
2
2
|
import "./media-contract-api.js";
|
|
3
3
|
export { DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, resolveIMessageAttachmentRoots, resolveIMessageAttachmentRoots as resolveInboundAttachmentRoots, resolveIMessageRemoteAttachmentRoots, resolveIMessageRemoteAttachmentRoots as resolveRemoteInboundAttachmentRoots };
|