diff --git a/extensions/imessage/runtime-api.ts b/extensions/imessage/runtime-api.ts index 0f09e73e5ce..76fc2778237 100644 --- a/extensions/imessage/runtime-api.ts +++ b/extensions/imessage/runtime-api.ts @@ -4,7 +4,6 @@ export { DEFAULT_ACCOUNT_ID, getChatChannelMeta, type ChannelPlugin, - type OpenClawConfig, } from "openclaw/plugin-sdk/core"; export { buildChannelConfigSchema, IMessageConfigSchema } from "./config-api.js"; export { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status"; diff --git a/extensions/imessage/src/channel-api.ts b/extensions/imessage/src/channel-api.ts index e8c49159ca4..3640e26bb0e 100644 --- a/extensions/imessage/src/channel-api.ts +++ b/extensions/imessage/src/channel-api.ts @@ -1,19 +1,13 @@ import { formatTrimmedAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers"; -import type { ChannelStatusIssue } from "openclaw/plugin-sdk/channel-contract"; import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status"; import { DEFAULT_ACCOUNT_ID, getChatChannelMeta, type ChannelPlugin, - type OpenClawConfig, } from "openclaw/plugin-sdk/core"; import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime"; import { collectStatusIssuesFromLastError } from "openclaw/plugin-sdk/status-helpers"; -import { - resolveIMessageConfigAllowFrom, - resolveIMessageConfigDefaultTo, -} from "./config-accessors.js"; -import { looksLikeIMessageTargetId, normalizeIMessageMessagingTarget } from "./normalize.js"; +import { normalizeIMessageMessagingTarget } from "./normalize.js"; export { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking"; export { @@ -21,12 +15,9 @@ export { DEFAULT_ACCOUNT_ID, formatTrimmedAllowFromEntries, getChatChannelMeta, - looksLikeIMessageTargetId, normalizeIMessageMessagingTarget, PAIRING_APPROVED_MESSAGE, resolveChannelMediaMaxBytes, - resolveIMessageConfigAllowFrom, - resolveIMessageConfigDefaultTo, }; -export type { ChannelPlugin, ChannelStatusIssue, OpenClawConfig }; +export type { ChannelPlugin }; diff --git a/extensions/imessage/src/monitor/abort-handler.ts b/extensions/imessage/src/monitor/abort-handler.ts index bd5388260df..dff9f7716cd 100644 --- a/extensions/imessage/src/monitor/abort-handler.ts +++ b/extensions/imessage/src/monitor/abort-handler.ts @@ -1,4 +1,4 @@ -export type IMessageMonitorClient = { +type IMessageMonitorClient = { request: (method: string, params?: Record) => Promise; stop: () => Promise; }; diff --git a/extensions/imessage/src/monitor/echo-cache.ts b/extensions/imessage/src/monitor/echo-cache.ts index c5f27b1c632..3ba76dbc8ef 100644 --- a/extensions/imessage/src/monitor/echo-cache.ts +++ b/extensions/imessage/src/monitor/echo-cache.ts @@ -1,4 +1,4 @@ -export type SentMessageLookup = { +type SentMessageLookup = { text?: string; messageId?: string; }; diff --git a/extensions/imessage/src/monitor/inbound-processing.ts b/extensions/imessage/src/monitor/inbound-processing.ts index a9aae9e68b5..15f9afc3ced 100644 --- a/extensions/imessage/src/monitor/inbound-processing.ts +++ b/extensions/imessage/src/monitor/inbound-processing.ts @@ -111,7 +111,7 @@ function hasIMessageEchoMatch(params: { ); } -export type IMessageInboundDispatchDecision = { +type IMessageInboundDispatchDecision = { kind: "dispatch"; isGroup: boolean; chatId?: number; @@ -132,7 +132,7 @@ export type IMessageInboundDispatchDecision = { effectiveGroupAllowFrom: string[]; }; -export type IMessageInboundDecision = +type IMessageInboundDecision = | { kind: "drop"; reason: string } | { kind: "pairing"; senderId: string } | IMessageInboundDispatchDecision; @@ -653,7 +653,7 @@ export function buildIMessageInboundContext(params: { return { ctxPayload, fromLabel, chatTarget, imessageTo, inboundHistory }; } -export function buildIMessageEchoScope(params: { +function buildIMessageEchoScope(params: { accountId: string; isGroup: boolean; chatId?: number; diff --git a/extensions/imessage/src/monitor/loop-rate-limiter.ts b/extensions/imessage/src/monitor/loop-rate-limiter.ts index 56c234a1b14..cd7441ca65e 100644 --- a/extensions/imessage/src/monitor/loop-rate-limiter.ts +++ b/extensions/imessage/src/monitor/loop-rate-limiter.ts @@ -11,7 +11,7 @@ type ConversationWindow = { timestamps: number[]; }; -export type LoopRateLimiter = { +type LoopRateLimiter = { /** Returns true if this conversation has exceeded the rate limit. */ isRateLimited: (conversationKey: string) => boolean; /** Record an inbound message for a conversation. */ diff --git a/extensions/imessage/src/monitor/reflection-guard.ts b/extensions/imessage/src/monitor/reflection-guard.ts index 9ed38d2a175..706743be17d 100644 --- a/extensions/imessage/src/monitor/reflection-guard.ts +++ b/extensions/imessage/src/monitor/reflection-guard.ts @@ -22,7 +22,7 @@ const REFLECTION_PATTERNS: Array<{ re: RegExp; label: string }> = [ { re: FINAL_TAG_RE, label: "final-tag" }, ]; -export type ReflectionDetection = { +type ReflectionDetection = { isReflection: boolean; matchedLabels: string[]; }; diff --git a/extensions/imessage/src/monitor/self-chat-cache.ts b/extensions/imessage/src/monitor/self-chat-cache.ts index a2c4c31ccd9..1646e47fae1 100644 --- a/extensions/imessage/src/monitor/self-chat-cache.ts +++ b/extensions/imessage/src/monitor/self-chat-cache.ts @@ -8,7 +8,7 @@ type SelfChatCacheKeyParts = { chatId?: number; }; -export type SelfChatLookup = SelfChatCacheKeyParts & { +type SelfChatLookup = SelfChatCacheKeyParts & { text?: string; createdAt?: number; }; diff --git a/extensions/imessage/src/monitor/types.ts b/extensions/imessage/src/monitor/types.ts index cb29a224911..fba78808b73 100644 --- a/extensions/imessage/src/monitor/types.ts +++ b/extensions/imessage/src/monitor/types.ts @@ -1,7 +1,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; -export type IMessageAttachment = { +type IMessageAttachment = { original_path?: string | null; mime_type?: string | null; missing?: boolean | null; diff --git a/extensions/imessage/src/monitor/watch-error-log.ts b/extensions/imessage/src/monitor/watch-error-log.ts index fdb94610a99..ff8d2a81344 100644 --- a/extensions/imessage/src/monitor/watch-error-log.ts +++ b/extensions/imessage/src/monitor/watch-error-log.ts @@ -6,7 +6,7 @@ import { const MAX_WATCH_ERROR_MESSAGE_CHARS = 200; -export type SanitizedIMessageWatchErrorPayload = { +type SanitizedIMessageWatchErrorPayload = { code?: number; message?: string; }; diff --git a/extensions/imessage/src/normalize.ts b/extensions/imessage/src/normalize.ts index defd5ecd7c6..a8cc6e7a709 100644 --- a/extensions/imessage/src/normalize.ts +++ b/extensions/imessage/src/normalize.ts @@ -26,7 +26,7 @@ function looksLikeHandleOrPhoneTarget(params: { return (params.phonePattern ?? /^\+?\d{3,}$/).test(trimmed); } -export function normalizeIMessageHandle(raw: string): string { +function normalizeIMessageHandle(raw: string): string { const trimmed = raw.trim(); if (!trimmed) { return ""; diff --git a/extensions/imessage/src/runtime.ts b/extensions/imessage/src/runtime.ts index f455b33ad4a..21a55d89b43 100644 --- a/extensions/imessage/src/runtime.ts +++ b/extensions/imessage/src/runtime.ts @@ -1,9 +1,8 @@ import type { PluginRuntime } from "openclaw/plugin-sdk/core"; import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store"; -const { setRuntime: setIMessageRuntime, getRuntime: getIMessageRuntime } = - createPluginRuntimeStore({ - pluginId: "imessage", - errorMessage: "iMessage runtime not initialized", - }); -export { getIMessageRuntime, setIMessageRuntime }; +const { setRuntime: setIMessageRuntime } = createPluginRuntimeStore({ + pluginId: "imessage", + errorMessage: "iMessage runtime not initialized", +}); +export { setIMessageRuntime }; diff --git a/extensions/imessage/src/send.ts b/extensions/imessage/src/send.ts index 1cd146e4bb4..e73f4877310 100644 --- a/extensions/imessage/src/send.ts +++ b/extensions/imessage/src/send.ts @@ -9,7 +9,7 @@ import { resolveIMessageAccount, type ResolvedIMessageAccount } from "./accounts import { createIMessageRpcClient, type IMessageRpcClient } from "./client.js"; import { formatIMessageChatTarget, type IMessageService, parseIMessageTarget } from "./targets.js"; -export type IMessageSendOpts = { +type IMessageSendOpts = { cliPath?: string; dbPath?: string; service?: IMessageService; @@ -36,7 +36,7 @@ export type IMessageSendOpts = { createClient?: (params: { cliPath: string; dbPath?: string }) => Promise; }; -export type IMessageSendResult = { +type IMessageSendResult = { messageId: string; sentText: string; }; diff --git a/extensions/imessage/src/setup-core.ts b/extensions/imessage/src/setup-core.ts index 5e3cf98caf3..74032d75e98 100644 --- a/extensions/imessage/src/setup-core.ts +++ b/extensions/imessage/src/setup-core.ts @@ -67,7 +67,7 @@ function buildIMessageSetupPatch(input: { }; } -export async function promptIMessageAllowFrom(params: { +async function promptIMessageAllowFrom(params: { cfg: OpenClawConfig; prompter: WizardPrompter; accountId?: string; diff --git a/extensions/imessage/src/setup-surface.ts b/extensions/imessage/src/setup-surface.ts index 36f65c9a0c6..af31a010544 100644 --- a/extensions/imessage/src/setup-surface.ts +++ b/extensions/imessage/src/setup-surface.ts @@ -9,7 +9,6 @@ import { createIMessageCliPathTextInput, imessageCompletionNote, imessageDmPolicy, - imessageSetupAdapter, imessageSetupStatusBase, parseIMessageAllowFromEntries, } from "./setup-core.js"; @@ -43,4 +42,4 @@ export const imessageSetupWizard: ChannelSetupWizard = { disable: (cfg) => setSetupChannelEnabled(cfg, channel, false), }; -export { imessageSetupAdapter, parseIMessageAllowFromEntries }; +export { parseIMessageAllowFromEntries }; diff --git a/extensions/imessage/src/shared.ts b/extensions/imessage/src/shared.ts index 33669a8d8f3..adf45c13db6 100644 --- a/extensions/imessage/src/shared.ts +++ b/extensions/imessage/src/shared.ts @@ -20,7 +20,7 @@ import { } from "./media-contract.js"; import { createIMessageSetupWizardProxy } from "./setup-core.js"; -export const IMESSAGE_CHANNEL = "imessage" as const; +const IMESSAGE_CHANNEL = "imessage" as const; async function loadIMessageChannelRuntime() { return await import("./channel.runtime.js"); @@ -30,7 +30,7 @@ export const imessageSetupWizard = createIMessageSetupWizardProxy( async () => (await loadIMessageChannelRuntime()).imessageSetupWizard, ); -export const imessageConfigAdapter = createScopedChannelConfigAdapter({ +const imessageConfigAdapter = createScopedChannelConfigAdapter({ sectionKey: IMESSAGE_CHANNEL, listAccountIds: listIMessageAccountIds, resolveAccount: adaptScopedAccountAccessor(resolveIMessageAccount),