<!-- source-hash: 24f09ae47345f49fc8da8100c8c8644b -->
Defines the `DataRoomDocCardItem` wire shape used to render data-room document cards within the chat interface.

## Key Components

### `DataRoomDocCardItem` (interface)

Covers both `data_room_documents` database rows and `openframe-docs` markdown rows. The card differentiates source type via `sourceRepo` and composes click destinations using the shared `resolveSourceRowCTA` helper.

| Field | Type | Description |
|-------|------|-------------|
| `id` | `string` | Doc UUID (`external_id` / `id` from `data_room_documents`) |
| `title` | `string` | Display name |
| `path` | `string \| null` | Path within the data room (e.g. `legal/fundraising/seed/...`) |
| `preview` | `string \| null` | Content snippet up to ~200 chars |
| `url` | `string \| null` | Resolved URL (typically `/data-room/<path>`) |
| `sourceRepo` | `string \| null` | `RagTableConfig.id` (e.g. `'openframe-docs'`, `'data-room-docs'`) — drives badge label via `SOURCE_LABELS_BY_TABLE` |
| `baseRoute` | `string` | Chat shell base route (e.g. `/data-room`, `/knowledge-base`) — threaded down to `resolveSourceRowCTA` |
| `chipBasePlatform` | `string` | Cross-platform target (e.g. `'flamingo'`) — composes an absolute cross-origin URL for new-tab navigation |

## Usage Example

```typescript
const doc: DataRoomDocCardItem = {
  id: "a1b2c3d4-...",
  title: "Vertex VII SAFE Agreement",
  path: "legal/fundraising/seed/executed/vertex-vii-3.5m-safe",
  preview: "This Simple Agreement for Future Equity...",
  url: "/data-room/legal/fundraising/seed/executed/vertex-vii-3.5m-safe",
  sourceRepo: "data-room-docs",
  baseRoute: "/data-room",
  chipBasePlatform: "flamingo",
};
```

> **Note:** When `chipBasePlatform` is set, `resolveSourceRowCTA` composes an absolute URL and the card renders a plain `<a>` tag (new tab). Without it, middleware may redirect `/knowledge-base/<path>` to `/` if the route is not in `allowedRoutes`.