/**
 * Tool Policy System Types
 *
 * Hierarchical tool grouping and policy management for fine-grained
 * access control. Inspired by OpenClaw's permission model.
 *
 * Key concepts:
 * - ToolGroup: Hierarchical grouping (e.g., 'group:fs:write' is a subset of 'group:fs')
 * - PolicyProfile: Predefined permission sets (minimal, coding, messaging, full)
 * - PolicyDecision: The resolved action for a tool (allow, deny, confirm)
 */
/**
 * All tool groups for iteration
 */
export const ALL_TOOL_GROUPS = [
    'group:fs',
    'group:fs:read',
    'group:fs:write',
    'group:fs:delete',
    'group:runtime',
    'group:runtime:shell',
    'group:runtime:process',
    'group:web',
    'group:web:fetch',
    'group:web:search',
    'group:git',
    'group:git:read',
    'group:git:write',
    'group:docker',
    'group:kubernetes',
    'group:system',
    'group:system:info',
    'group:system:modify',
    'group:dangerous',
    'group:mcp',
    'group:plugin',
];
/**
 * Get parent group from hierarchical group name
 */
export function getParentGroup(group) {
    const parts = group.split(':');
    if (parts.length <= 2)
        return null;
    parts.pop();
    return parts.join(':');
}
/**
 * Check if group is a child of potential parent
 */
export function isChildGroup(child, parent) {
    if (child === parent)
        return true;
    return child.startsWith(parent + ':');
}
/**
 * Default policy configuration
 */
export const DEFAULT_POLICY_CONFIG = {
    version: 1,
    activeProfile: 'coding',
    globalRules: [],
    agentRules: {},
    providerRules: {},
    auditLog: false,
    defaultAction: 'confirm',
};
//# sourceMappingURL=types.js.map