Plugin SDK: require unified message discovery

This commit is contained in:
Gustavo Madeira Santana
2026-03-18 03:02:02 +00:00
parent 870f260772
commit 682f4d1ca3
31 changed files with 155 additions and 301 deletions

View File

@@ -12,10 +12,10 @@ import { handleMatrixAction } from "./tool-actions.js";
import type { CoreConfig } from "./types.js";
export const matrixMessageActions: ChannelMessageActionAdapter = {
listActions: ({ cfg }) => {
describeMessageTool: ({ cfg }) => {
const account = resolveMatrixAccount({ cfg: cfg as CoreConfig });
if (!account.enabled || !account.configured) {
return [];
return null;
}
const gate = createActionGate((cfg as CoreConfig).channels?.matrix?.actions);
const actions = new Set<ChannelMessageActionName>(["send", "poll"]);
@@ -39,7 +39,7 @@ export const matrixMessageActions: ChannelMessageActionAdapter = {
if (gate("channelInfo")) {
actions.add("channel-info");
}
return Array.from(actions);
return { actions: Array.from(actions) };
},
supportsAction: ({ action }) => action !== "poll",
extractToolSend: ({ args }): ChannelToolSend | null => {