mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 19:01:47 +03:00
fix: add missing role-based type definitions for RBAC routing
This commit is contained in:
@@ -78,5 +78,6 @@ export type AgentBinding = {
|
||||
peer?: { kind: ChatType; id: string };
|
||||
guildId?: string;
|
||||
teamId?: string;
|
||||
roles?: string[];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -36,6 +36,8 @@ export type DiscordGuildChannelConfig = {
|
||||
enabled?: boolean;
|
||||
/** Optional allowlist for channel senders (ids or names). */
|
||||
users?: Array<string | number>;
|
||||
/** Optional allowlist for channel senders by role (ids or names). */
|
||||
roles?: Array<string | number>;
|
||||
/** Optional system prompt snippet for this channel. */
|
||||
systemPrompt?: string;
|
||||
/** If false, omit thread starter context for this channel (default: true). */
|
||||
@@ -53,6 +55,7 @@ export type DiscordGuildEntry = {
|
||||
/** Reaction notification mode (off|own|all|allowlist). Default: own. */
|
||||
reactionNotifications?: DiscordReactionNotificationMode;
|
||||
users?: Array<string | number>;
|
||||
roles?: Array<string | number>;
|
||||
channels?: Record<string, DiscordGuildChannelConfig>;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ export const BindingsSchema = z
|
||||
.optional(),
|
||||
guildId: z.string().optional(),
|
||||
teamId: z.string().optional(),
|
||||
roles: z.array(z.string()).optional(),
|
||||
})
|
||||
.strict(),
|
||||
})
|
||||
|
||||
@@ -235,6 +235,7 @@ export const DiscordGuildChannelSchema = z
|
||||
skills: z.array(z.string()).optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
users: z.array(z.union([z.string(), z.number()])).optional(),
|
||||
roles: z.array(z.union([z.string(), z.number()])).optional(),
|
||||
systemPrompt: z.string().optional(),
|
||||
includeThreadStarter: z.boolean().optional(),
|
||||
autoThread: z.boolean().optional(),
|
||||
@@ -249,6 +250,7 @@ export const DiscordGuildSchema = z
|
||||
toolsBySender: ToolPolicyBySenderSchema,
|
||||
reactionNotifications: z.enum(["off", "own", "all", "allowlist"]).optional(),
|
||||
users: z.array(z.union([z.string(), z.number()])).optional(),
|
||||
roles: z.array(z.union([z.string(), z.number()])).optional(),
|
||||
channels: z.record(z.string(), DiscordGuildChannelSchema.optional()).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
Reference in New Issue
Block a user