refactor: adopt shared chat plugin builder

This commit is contained in:
Peter Steinberger
2026-03-22 21:34:54 +00:00
parent 99462776d1
commit dcd5473283
6 changed files with 412 additions and 391 deletions

View File

@@ -188,7 +188,7 @@ export function buildChannelOutboundSessionRoute(params: {
}
/** Options for a channel plugin entry that should register a channel capability. */
type DefineChannelPluginEntryOptions<TPlugin extends ChannelPlugin = ChannelPlugin> = {
type DefineChannelPluginEntryOptions<TPlugin = ChannelPlugin> = {
id: string;
name: string;
description: string;
@@ -241,7 +241,7 @@ type CreatedChannelPluginBase<TResolvedAccount> = Pick<
* optionally exposes extra full-runtime registration such as tools or gateway
* handlers that only make sense outside setup-only registration modes.
*/
export function defineChannelPluginEntry<TPlugin extends ChannelPlugin>({
export function defineChannelPluginEntry<TPlugin>({
id,
name,
description,
@@ -257,7 +257,7 @@ export function defineChannelPluginEntry<TPlugin extends ChannelPlugin>({
configSchema,
register(api: OpenClawPluginApi) {
setRuntime?.(api.runtime);
api.registerChannel({ plugin });
api.registerChannel({ plugin: plugin as ChannelPlugin });
if (api.registrationMode !== "full") {
return;
}