mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 17:20:22 +00:00
refactor: register channel bootstrap capabilities
This commit is contained in:
@@ -14,6 +14,10 @@ import {
|
||||
} from "./accounts.js";
|
||||
import { getChatChannelMeta, type ChannelPlugin } from "./channel-api.js";
|
||||
import { IMessageChannelConfigSchema } from "./config-schema.js";
|
||||
import {
|
||||
resolveIMessageAttachmentRoots,
|
||||
resolveIMessageRemoteAttachmentRoots,
|
||||
} from "./media-contract.js";
|
||||
import { createIMessageSetupWizardProxy } from "./setup-core.js";
|
||||
|
||||
export const IMESSAGE_CHANNEL = "imessage" as const;
|
||||
@@ -65,8 +69,9 @@ export function createIMessagePluginBase(params: {
|
||||
| "config"
|
||||
| "security"
|
||||
| "setup"
|
||||
| "messaging"
|
||||
> {
|
||||
return createChannelPluginBase({
|
||||
const base = createChannelPluginBase({
|
||||
id: IMESSAGE_CHANNEL,
|
||||
meta: {
|
||||
...getChatChannelMeta(IMESSAGE_CHANNEL),
|
||||
@@ -91,7 +96,16 @@ export function createIMessagePluginBase(params: {
|
||||
},
|
||||
security: imessageSecurityAdapter,
|
||||
setup: params.setup,
|
||||
}) as Pick<
|
||||
});
|
||||
return {
|
||||
...base,
|
||||
messaging: {
|
||||
resolveInboundAttachmentRoots: (params) =>
|
||||
resolveIMessageAttachmentRoots({ accountId: params.accountId, cfg: params.cfg }),
|
||||
resolveRemoteInboundAttachmentRoots: (params) =>
|
||||
resolveIMessageRemoteAttachmentRoots({ accountId: params.accountId, cfg: params.cfg }),
|
||||
},
|
||||
} as Pick<
|
||||
ChannelPlugin<ResolvedIMessageAccount>,
|
||||
| "id"
|
||||
| "meta"
|
||||
@@ -102,5 +116,6 @@ export function createIMessagePluginBase(params: {
|
||||
| "config"
|
||||
| "security"
|
||||
| "setup"
|
||||
| "messaging"
|
||||
>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user