<!-- source-hash: 4129d05ad3798983504dba26d6153a8c -->
Maps RAG table IDs to their display icons, human-readable labels, and document type lookups for the OpenFrame chat source chip system. Server-safe with no client-only imports.

## Key Components

| Export | Type | Description |
|--------|------|-------------|
| `SOURCE_ICON_NAMES` | `Record<string, string>` | Maps `RagTableConfig.id` → icon name string (resolved to React components via `icon-registry.ts`) |
| `SOURCE_LABELS_BY_TABLE` | `Record<string, string>` | Maps `RagTableConfig.id` → human-readable display label used in chat source chips |
| `DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID` | `Record<string, string>` | Reverse maps LLM-emitted `documentType` strings → `RagTableConfig.id` |
| `getSourceIconName()` | Function | Safe lookup returning `undefined` for unknown table IDs |
| `getSourceLabel()` | Function | Lookup with fallback to raw table slug when no label is registered |
| `defaultTableIdForDocumentType()` | Function | Default resolver for `useEmbeddedChat` when no custom callback is provided; returns `null` for unknown types |

## Usage Example

```typescript
import {
  getSourceIconName,
  getSourceLabel,
  defaultTableIdForDocumentType,
} from '@/utils/source-icons'

// Resolve icon name for a known RAG table
const iconName = getSourceIconName('github-commits')
// → 'github'

// Get display label for a chip strip
const label = getSourceLabel('hubspot-tickets-anon')
// → 'Known Issues'

// Map a documentType emitted by the LLM to its table ID
const tableId = defaultTableIdForDocumentType('slack_message')
// → 'slack-messages'

// Graceful handling of unknown types
const unknown = defaultTableIdForDocumentType('custom_type')
// → null
```

## Supported Source Categories

| Category | Tables Covered |
|----------|---------------|
| **Docs** | `openframe-docs`, `data-room-docs` |
| **CMS / Programs** | Blog posts, releases, case studies, webinars, events, podcasts, interviews |
| **Financials** | KPIs, cap table, P&L, balance sheet, cash flow, investor updates |
| **ClickUp** | Roadmap, delivery, internal tasks |
| **GitHub** | Commits, PRs, PR reviews (public + internal variants) |
| **HubSpot** | Tickets (full, anon, self) |
| **Communications** | Slack messages |

> **Design note:** Icon names are intentionally decoupled from React components — the resolver (`icon-registry.ts`) stays client-only while this file remains server-safe, allowing hub-side RAG mappers and chat route handlers to call these utilities directly.