/** * Tool Permission Manager * * Manages tool access permissions based on agent tier levels. * Tier 1: Full access (can delegate) * Tier 2: Read/analyze only (no write/edit/bash) * Tier 3: Read/analyze only (no write/edit/bash) * * Explicit tool_permissions on an agent override tier defaults. */ import type { AgentPersonaConfig } from './types.js'; /** * Resolved tool permissions for an agent */ export interface ToolPermissions { allowed: string[]; blocked: string[]; } /** * Tool Permission Manager */ export declare class ToolPermissionManager { /** * Default permissions per tier * Tier 1: All tools allowed (backward compatible) * Tier 2/3: Read-only tools (no destructive operations) */ private static readonly TIER_DEFAULTS; /** * Resolve final permissions for an agent. * Explicit tool_permissions override tier defaults. */ resolvePermissions(agent: AgentPersonaConfig): ToolPermissions; /** * Check if a specific tool is allowed for an agent. * Blocked list takes precedence over allowed list. * Supports wildcard matching (e.g., "mama_*" matches "mama_search"). */ isToolAllowed(agent: AgentPersonaConfig, toolName: string): boolean; /** * Build a markdown section describing tool permissions for the system prompt. */ buildPermissionPrompt(agent: AgentPersonaConfig): string; /** * Check if an agent can delegate tasks to other agents. * Only Tier 1 agents with can_delegate=true can delegate. */ canDelegate(agent: AgentPersonaConfig): boolean; /** * Check if an agent supports automatic task continuation. */ canAutoContinue(agent: AgentPersonaConfig): boolean; /** * Build delegation prompt for Tier 1 agents that can delegate. * Lists available agents they can delegate to. */ buildDelegationPrompt(agent: AgentPersonaConfig, allAgents: AgentPersonaConfig[]): string; /** * Build mention-based delegation prompt for agents. * Uses <@USER_ID> format so agents delegate via Discord @mentions. */ buildMentionDelegationPrompt(agent: AgentPersonaConfig, allAgents: AgentPersonaConfig[], botUserIdMap: Map): string; /** * Build report-back prompt for non-delegating agents (Tier 2/3). * Instructs them to @mention the coordinator when their task is complete, * so the coordinator can continue orchestrating the workflow. */ buildReportBackPrompt(agent: AgentPersonaConfig, allAgents: AgentPersonaConfig[], botUserIdMap: Map): string; /** * Check if a tool name matches any pattern in the list. * Supports exact match and wildcard suffix (e.g., "mama_*"). */ private matchesAny; } //# sourceMappingURL=tool-permission-manager.d.ts.map