mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 12:11:20 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { mergeInboundPathRoots } from "openclaw/plugin-sdk/channel-inbound-roots";
|
|
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
|
import { resolveIMessageAccount } from "./accounts.js";
|
|
|
|
export const DEFAULT_IMESSAGE_ATTACHMENT_ROOTS = ["/Users/*/Library/Messages/Attachments"] as const;
|
|
|
|
export function resolveIMessageAttachmentRoots(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}): string[] {
|
|
const account = resolveIMessageAccount(params);
|
|
return mergeInboundPathRoots(
|
|
account.config.attachmentRoots,
|
|
params.cfg.channels?.imessage?.attachmentRoots,
|
|
DEFAULT_IMESSAGE_ATTACHMENT_ROOTS,
|
|
);
|
|
}
|
|
|
|
export function resolveIMessageRemoteAttachmentRoots(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}): string[] {
|
|
const account = resolveIMessageAccount(params);
|
|
return mergeInboundPathRoots(
|
|
account.config.remoteAttachmentRoots,
|
|
params.cfg.channels?.imessage?.remoteAttachmentRoots,
|
|
account.config.attachmentRoots,
|
|
params.cfg.channels?.imessage?.attachmentRoots,
|
|
DEFAULT_IMESSAGE_ATTACHMENT_ROOTS,
|
|
);
|
|
}
|