<!-- source-hash: af20d3b479cf2b0ee00a77653fda6605 -->
Defines TypeScript interfaces and types for managing AI tool permissions and approval workflows in the Flamingo MSP platform.

## Key Components

- **ApprovalLevel**: Union type defining permission levels (`ALLOW`, `ASK_USER`, `ASK_TECHNICIAN`, `DENY`)
- **PermissionPolicy**: Interface for individual tool command permission policies with approval levels
- **PermissionCategory**: Interface for grouping related policies with expandable UI state
- **PolicyConfigurationPanelProps**: Props interface for the permission configuration UI component

## Usage Example

```typescript
import { ApprovalLevel, PermissionPolicy, PermissionCategory } from './permissions';

// Define a permission policy for a specific tool command
const sshPolicy: PermissionPolicy = {
  id: 'ssh-001',
  name: 'SSH Connection',
  naturalKey: 'ssh_connect',
  commandPattern: 'ssh *',
  toolName: 'terminal',
  approvalLevel: 'ASK_TECHNICIAN'
};

// Group policies into categories
const networkCategory: PermissionCategory = {
  id: 'network',
  name: 'Network Operations',
  icon: <NetworkIcon />,
  configurationsCount: 5,
  globalPermission: 'ASK_USER',
  isExpanded: false,
  policies: [sshPolicy]
};

// Handle permission level changes
const handlePermissionChange = (
  categoryId: string, 
  policyId: string, 
  level: ApprovalLevel
) => {
  console.log(`Updated ${policyId} to ${level}`);
};
```

This permission system enables granular control over AI tool capabilities, ensuring appropriate approval workflows for different security levels and operational contexts.