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
This commit is contained in:
committed by
Ayaan Zaidi
parent
ce60c6db1b
commit
0e3340d1fc
@@ -63,6 +63,11 @@ export type {
|
|||||||
ClawdbotPluginService,
|
ClawdbotPluginService,
|
||||||
ClawdbotPluginServiceContext,
|
ClawdbotPluginServiceContext,
|
||||||
} from "../plugins/types.js";
|
} from "../plugins/types.js";
|
||||||
|
export type {
|
||||||
|
GatewayRequestHandler,
|
||||||
|
GatewayRequestHandlerOptions,
|
||||||
|
RespondFn,
|
||||||
|
} from "../gateway/server-methods/types.js";
|
||||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||||
export { normalizePluginHttpPath } from "../plugins/http-path.js";
|
export { normalizePluginHttpPath } from "../plugins/http-path.js";
|
||||||
export { registerPluginHttpRoute } from "../plugins/http-registry.js";
|
export { registerPluginHttpRoute } from "../plugins/http-registry.js";
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { resolveMarkdownTableMode } from "../config/markdown-tables.js";
|
|||||||
import { resolveAgentRoute } from "../routing/resolve-route.js";
|
import { resolveAgentRoute } from "../routing/resolve-route.js";
|
||||||
import { resolveThreadSessionKeys } from "../routing/session-key.js";
|
import { resolveThreadSessionKeys } from "../routing/session-key.js";
|
||||||
import { resolveCommandAuthorizedFromAuthorizers } from "../channels/command-gating.js";
|
import { resolveCommandAuthorizedFromAuthorizers } from "../channels/command-gating.js";
|
||||||
|
import { getPluginCommandSpecs } from "../plugins/commands.js";
|
||||||
import type { ChannelGroupPolicy } from "../config/group-policy.js";
|
import type { ChannelGroupPolicy } from "../config/group-policy.js";
|
||||||
import type {
|
import type {
|
||||||
ReplyToMode,
|
ReplyToMode,
|
||||||
@@ -103,11 +104,16 @@ export const registerTelegramNativeCommands = ({
|
|||||||
runtime.error?.(danger(issue.message));
|
runtime.error?.(danger(issue.message));
|
||||||
}
|
}
|
||||||
const customCommands = customResolution.commands;
|
const customCommands = customResolution.commands;
|
||||||
|
const pluginCommandSpecs = getPluginCommandSpecs();
|
||||||
const allCommands: Array<{ command: string; description: string }> = [
|
const allCommands: Array<{ command: string; description: string }> = [
|
||||||
...nativeCommands.map((command) => ({
|
...nativeCommands.map((command) => ({
|
||||||
command: command.name,
|
command: command.name,
|
||||||
description: command.description,
|
description: command.description,
|
||||||
})),
|
})),
|
||||||
|
...pluginCommandSpecs.map((spec) => ({
|
||||||
|
command: spec.name,
|
||||||
|
description: spec.description,
|
||||||
|
})),
|
||||||
...customCommands,
|
...customCommands,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user