mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 11:10:20 +00:00
refactor: generate bundled channel seams
This commit is contained in:
4
src/plugin-sdk/anthropic-cli.ts
Normal file
4
src/plugin-sdk/anthropic-cli.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export {
|
||||
CLAUDE_CLI_BACKEND_ID,
|
||||
isClaudeCliProvider,
|
||||
} from "../../extensions/anthropic/cli-shared.js";
|
||||
@@ -200,6 +200,11 @@ type DefineChannelPluginEntryOptions<TPlugin = ChannelPlugin> = {
|
||||
registerFull?: (api: OpenClawPluginApi) => void;
|
||||
};
|
||||
|
||||
type DefinedChannelPluginEntry<TPlugin> = ReturnType<typeof definePluginEntry> & {
|
||||
channelPlugin: TPlugin;
|
||||
setChannelRuntime?: (runtime: PluginRuntime) => void;
|
||||
};
|
||||
|
||||
type CreateChannelPluginBaseOptions<TResolvedAccount> = {
|
||||
id: ChannelPlugin<TResolvedAccount>["id"];
|
||||
meta?: Partial<NonNullable<ChannelPlugin<TResolvedAccount>["meta"]>>;
|
||||
@@ -251,8 +256,8 @@ export function defineChannelPluginEntry<TPlugin>({
|
||||
configSchema = emptyPluginConfigSchema,
|
||||
setRuntime,
|
||||
registerFull,
|
||||
}: DefineChannelPluginEntryOptions<TPlugin>) {
|
||||
return definePluginEntry({
|
||||
}: DefineChannelPluginEntryOptions<TPlugin>): DefinedChannelPluginEntry<TPlugin> {
|
||||
const entry = definePluginEntry({
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
@@ -266,6 +271,11 @@ export function defineChannelPluginEntry<TPlugin>({
|
||||
registerFull?.(api);
|
||||
},
|
||||
});
|
||||
return {
|
||||
...entry,
|
||||
channelPlugin: plugin,
|
||||
...(setRuntime ? { setChannelRuntime: setRuntime } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user