From 0e3340d1fc90d5b99853d9dda6f6807843fbc6c3 Mon Sep 17 00:00:00 2001 From: Joshua Mitchell Date: Sun, 25 Jan 2026 15:09:01 -0600 Subject: [PATCH] feat(plugins): sync plugin commands to Telegram menu and export gateway types - Add plugin command specs to Telegram setMyCommands for autocomplete - Export GatewayRequestHandler types in plugin-sdk for plugin authors - Enables plugins to register gateway methods and appear in command menus --- src/plugin-sdk/index.ts | 5 +++++ src/telegram/bot-native-commands.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/plugin-sdk/index.ts b/src/plugin-sdk/index.ts index 60782ff6d..c0c201ff0 100644 --- a/src/plugin-sdk/index.ts +++ b/src/plugin-sdk/index.ts @@ -63,6 +63,11 @@ export type { ClawdbotPluginService, ClawdbotPluginServiceContext, } from "../plugins/types.js"; +export type { + GatewayRequestHandler, + GatewayRequestHandlerOptions, + RespondFn, +} from "../gateway/server-methods/types.js"; export type { PluginRuntime } from "../plugins/runtime/types.js"; export { normalizePluginHttpPath } from "../plugins/http-path.js"; export { registerPluginHttpRoute } from "../plugins/http-registry.js"; diff --git a/src/telegram/bot-native-commands.ts b/src/telegram/bot-native-commands.ts index 0f1cc1cb7..1751ebb09 100644 --- a/src/telegram/bot-native-commands.ts +++ b/src/telegram/bot-native-commands.ts @@ -20,6 +20,7 @@ import { resolveMarkdownTableMode } from "../config/markdown-tables.js"; import { resolveAgentRoute } from "../routing/resolve-route.js"; import { resolveThreadSessionKeys } from "../routing/session-key.js"; import { resolveCommandAuthorizedFromAuthorizers } from "../channels/command-gating.js"; +import { getPluginCommandSpecs } from "../plugins/commands.js"; import type { ChannelGroupPolicy } from "../config/group-policy.js"; import type { ReplyToMode, @@ -103,11 +104,16 @@ export const registerTelegramNativeCommands = ({ runtime.error?.(danger(issue.message)); } const customCommands = customResolution.commands; + const pluginCommandSpecs = getPluginCommandSpecs(); const allCommands: Array<{ command: string; description: string }> = [ ...nativeCommands.map((command) => ({ command: command.name, description: command.description, })), + ...pluginCommandSpecs.map((spec) => ({ + command: spec.name, + description: spec.description, + })), ...customCommands, ];