Type Definitions & Data Models
Relevant source files
The following files were used as context for generating this wiki page:
This page provides a comprehensive overview of the TypeScript type definitions and data models used within the Recoup Admin dashboard. These models facilitate data consistency across the platform's features, including Coding Agent monitoring, Sandbox environment tracking, and Content Agent analytics.
The dashboard relies on these strictly typed structures to handle API responses, manage component states, and render complex data tables and charts efficiently. By standardizing these models, the application ensures that data flowing from the backend APIs—referenced by paths like admins/coding-agent-slack-tags or admins/sandboxes-orgs—is correctly processed and displayed.
Sources: app/layout.tsx:18-21, components/CodingAgentSlackTags/CodingAgentSlackTagsPage.tsx:39, components/SandboxOrgs/SandboxOrgsPage.tsx:18
Core Administrative Types
The administrative functions of the dashboard often operate within specific time-bound contexts. The AdminPeriod type is a fundamental definition used across various hooks and components to filter data.
Admin Filtering
The platform supports several predefined time windows for data aggregation and visualization.
| Type Name | Definition | Description |
|---|---|---|
AdminPeriod | "all" | "24h" | "7d" | "30d" | "90d" | Defines the available time ranges for dashboard analytics. |
Sources: types/admin.ts:1-7
Coding Agent Models
The Coding Agent module monitors interactions between users and the Recoup Coding Agent via Slack. It tracks prompts, associated pull requests, and the status of those requests.
Slack Tagging & Pull Requests
The system tracks "tags" which represent specific instances where the agent was invoked.
The relationship between Slack interactions and GitHub activity is visualized by tracking the status of pull requests (e.g., "open", "closed", or "merged").
Sources: types/coding-agent.ts:1-25
API Response Structures
Data fetched for the Coding Agent follows a specific response schema.
| Field | Type | Description |
|---|---|---|
status | "success" | The status of the API request. |
total | number | Total number of tags in the period. |
total_pull_requests | number | Total count of PRs generated across all tags. |
tags_with_pull_requests | number | Count of tags that resulted in at least one PR. |
tags | SlackTag[] | Array of individual tag objects. |
Sources: types/coding-agent.ts:11-17
Sandbox & Organization Models
The Sandbox module tracks usage and activity within isolated environments, specifically focusing on organization repository commits.
Repository Activity
Activity is tracked at the repository and sub-module level, identifying which organizations are most active.
The OrgRepoRow structure allows the admin dashboard to sort repositories by activity levels, specifically the total_commits count.
Sources: types/sandbox.ts:25-31, components/SandboxOrgs/SandboxOrgsTable.tsx:21-25
Task Execution
The system also models background tasks, particularly "Pulse" email runs.
| Field | Type | Description |
|---|---|---|
taskIdentifier | string | Unique name of the task (e.g., send-pulse-task). |
status | string | Current state of the task execution. |
startedAt | string | ISO timestamp of start. |
duration | number | Time taken to complete. |
Sources: types/sandbox.ts:1-10, components/AccountDetail/AccountDetailPage.tsx:16
Content Agent & Analytics
Similar to the Coding Agent, the Content Agent tracks Slack-based interactions but focuses on video generation and content links.
Content Slack Tags
The ContentSlackTag model (aliased/extended from base Slack structures) includes video_links to track output generated by the agent.
The statistics for this module include total_videos and tags_with_videos, providing a conversion metric similar to the Coding Agent's PR conversion rate.
Sources: types/contentSlack.ts:1-20, components/ContentSlack/ContentSlackStats.tsx:8-15
Summary of Data Structures
The Recoup Admin project uses TypeScript interfaces to enforce a strict contract between the frontend UI and the backend API. These models are categorized into three main domains:
- Communication Tracking:
SlackTag,ContentSlackTag - Development Activity:
CodingPrStatus,OrgRepoRow - System Operations:
TaskRun,AdminPeriod
This structured approach allows for robust features like sortable tables, multi-line charts, and detailed account drill-downs while maintaining type safety across the application.
Sources: types/admin.ts, types/coding-agent.ts, types/sandbox.ts