mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-20 19:44:59 +00:00
Matrix: tighten verification trust and expose profile updates
This commit is contained in:
@@ -156,6 +156,14 @@ describe("message tool schema scoping", () => {
|
||||
actions: ["send", "poll", "poll-vote"],
|
||||
});
|
||||
|
||||
const matrixPlugin = createChannelPlugin({
|
||||
id: "matrix",
|
||||
label: "Matrix",
|
||||
docsPath: "/channels/matrix",
|
||||
blurb: "Matrix test plugin.",
|
||||
actions: ["send", "set-profile"],
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
setActivePluginRegistry(createTestRegistry([]));
|
||||
});
|
||||
@@ -191,6 +199,7 @@ describe("message tool schema scoping", () => {
|
||||
createTestRegistry([
|
||||
{ pluginId: "telegram", source: "test", plugin: telegramPlugin },
|
||||
{ pluginId: "discord", source: "test", plugin: discordPlugin },
|
||||
{ pluginId: "matrix", source: "test", plugin: matrixPlugin },
|
||||
]),
|
||||
);
|
||||
|
||||
@@ -235,6 +244,8 @@ describe("message tool schema scoping", () => {
|
||||
expect(properties.pollId).toBeDefined();
|
||||
expect(properties.pollOptionIndex).toBeDefined();
|
||||
expect(properties.pollOptionId).toBeDefined();
|
||||
expect(properties.avatarUrl).toBeDefined();
|
||||
expect(properties.displayName).toBeDefined();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -421,6 +421,33 @@ function buildPresenceSchema() {
|
||||
};
|
||||
}
|
||||
|
||||
function buildProfileSchema() {
|
||||
return {
|
||||
displayName: Type.Optional(
|
||||
Type.String({
|
||||
description: "Profile display name for self-profile update actions.",
|
||||
}),
|
||||
),
|
||||
display_name: Type.Optional(
|
||||
Type.String({
|
||||
description: "snake_case alias of displayName for self-profile update actions.",
|
||||
}),
|
||||
),
|
||||
avatarUrl: Type.Optional(
|
||||
Type.String({
|
||||
description:
|
||||
"Profile avatar URL for self-profile update actions. Matrix accepts mxc:// and http(s) URLs.",
|
||||
}),
|
||||
),
|
||||
avatar_url: Type.Optional(
|
||||
Type.String({
|
||||
description:
|
||||
"snake_case alias of avatarUrl for self-profile update actions. Matrix accepts mxc:// and http(s) URLs.",
|
||||
}),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
function buildChannelManagementSchema() {
|
||||
return {
|
||||
name: Type.Optional(Type.String()),
|
||||
@@ -459,6 +486,7 @@ function buildMessageToolSchemaProps(options: {
|
||||
...buildGatewaySchema(),
|
||||
...buildChannelManagementSchema(),
|
||||
...buildPresenceSchema(),
|
||||
...buildProfileSchema(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export const CHANNEL_MESSAGE_ACTION_NAMES = [
|
||||
"kick",
|
||||
"ban",
|
||||
"set-presence",
|
||||
"set-profile",
|
||||
"download-file",
|
||||
] as const;
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ export const MESSAGE_ACTION_TARGET_MODE: Record<ChannelMessageActionName, Messag
|
||||
kick: "none",
|
||||
ban: "none",
|
||||
"set-presence": "none",
|
||||
"set-profile": "none",
|
||||
"download-file": "none",
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user