mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
fix(ci): handle missing native command capabilities
This commit is contained in:
@@ -9,6 +9,10 @@ import type { ChatCommandDefinition } from "./commands-registry.types.js";
|
||||
|
||||
type ChannelPlugin = ReturnType<typeof listChannelPlugins>[number];
|
||||
|
||||
function supportsNativeCommands(plugin: ChannelPlugin): boolean {
|
||||
return plugin.capabilities?.nativeCommands === true;
|
||||
}
|
||||
|
||||
function defineDockCommand(plugin: ChannelPlugin): ChatCommandDefinition {
|
||||
return defineChatCommand({
|
||||
key: `dock:${plugin.id}`,
|
||||
@@ -28,7 +32,7 @@ function buildChatCommands(): ChatCommandDefinition[] {
|
||||
const commands: ChatCommandDefinition[] = [
|
||||
...buildBuiltinChatCommands(),
|
||||
...listChannelPlugins()
|
||||
.filter((plugin) => plugin.capabilities.nativeCommands)
|
||||
.filter(supportsNativeCommands)
|
||||
.map((plugin) => defineDockCommand(plugin)),
|
||||
];
|
||||
|
||||
@@ -55,7 +59,7 @@ export function getNativeCommandSurfaces(): Set<string> {
|
||||
}
|
||||
cachedNativeCommandSurfaces = new Set(
|
||||
listChannelPlugins()
|
||||
.filter((plugin) => plugin.capabilities.nativeCommands)
|
||||
.filter(supportsNativeCommands)
|
||||
.map((plugin) => plugin.id),
|
||||
);
|
||||
cachedNativeRegistry = registry;
|
||||
|
||||
@@ -14,7 +14,7 @@ export function isNativeCommandSurface(surface?: string): boolean {
|
||||
if (!cachedNativeCommandSurfaces || cachedNativeCommandSurfacesVersion !== registryVersion) {
|
||||
cachedNativeCommandSurfaces = new Set(
|
||||
listChannelPlugins()
|
||||
.filter((plugin) => plugin.capabilities.nativeCommands)
|
||||
.filter((plugin) => plugin.capabilities?.nativeCommands === true)
|
||||
.map((plugin) => plugin.id),
|
||||
);
|
||||
cachedNativeCommandSurfacesVersion = registryVersion;
|
||||
|
||||
Reference in New Issue
Block a user