mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:41:25 +00:00
fix(security): centralize owner-only tool gating and scope maps
This commit is contained in:
@@ -5,6 +5,7 @@ export function createWhatsAppLoginTool(): ChannelAgentTool {
|
||||
return {
|
||||
label: "WhatsApp Login",
|
||||
name: "whatsapp_login",
|
||||
ownerOnly: true,
|
||||
description: "Generate a WhatsApp QR code for linking, or wait for the scan to complete.",
|
||||
// NOTE: Using Type.Unsafe for action enum instead of Type.Union([Type.Literal(...)]
|
||||
// because Claude API on Vertex AI rejects nested anyOf schemas as invalid JSON Schema.
|
||||
|
||||
@@ -12,7 +12,9 @@ export type ChannelId = ChatChannelId | (string & {});
|
||||
|
||||
export type ChannelOutboundTargetMode = "explicit" | "implicit" | "heartbeat";
|
||||
|
||||
export type ChannelAgentTool = AgentTool<TSchema, unknown>;
|
||||
export type ChannelAgentTool = AgentTool<TSchema, unknown> & {
|
||||
ownerOnly?: boolean;
|
||||
};
|
||||
|
||||
export type ChannelAgentToolFactory = (params: { cfg?: OpenClawConfig }) => ChannelAgentTool[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user