npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@e-llm-studio/repo-data-cart

v1.0.17

Published

A React component library for managing codebase selections, repository carts, and multi-repo actions. Built with TypeScript, Tailwind CSS (v4), and a slot-based customization API inspired by MUI.

Readme

@e-llm-studio/repo-data-cart

A React component library for managing codebase selections, repository carts, and multi-repo actions. Built with TypeScript, Tailwind CSS (v4), and a slot-based customization API inspired by MUI.

Table of Contents


Installation

npm install @e-llm-studio/repo-data-cart
# or
yarn add @e-llm-studio/repo-data-cart
# or
pnpm add @e-llm-studio/repo-data-cart

Peer Dependencies

This library requires React 18.3+ as a peer dependency:

{
  "react": ">=18.3.1",
  "react-dom": ">=18.3.1"
}

Quick Start

1. Import the CSS

Import the library's stylesheet in your entry point:

import '@e-llm-studio/repo-data-cart/style.css';

2. Wrap with RepoDataProvider (for the automated flow)

Follow this setup only if you're using the automated flow — i.e., MultiRepoAction and RepoSelectorDetailPage sharing state. The RepoDataProvider must wrap both:

import { RepoDataProvider, MultiRepoAction } from '@e-llm-studio/repo-data-cart';
import '@e-llm-studio/repo-data-cart/style.css';

function App() {
  const [repoData, setRepoData] = useState([]);
  const [isSearching, setIsSearching] = useState(false);
  const [isPageOpen, setIsPageOpen] = useState(false);

  return (
    <RepoDataProvider
      repoData={repoData}
      setRepoData={setRepoData}
      isSearchingAcrossAllRepo={isSearching}
      setIsSearchingAcrossAllRepo={setIsSearching}
      isRepositorySelectorPageOpen={isPageOpen}
      setIsRepositorySelectorPageOpen={setIsPageOpen}
      refreshRepoData={false}
    >
      <MultiRepoAction />
    </RepoDataProvider>
  );
}

When do I need RepoDataProvider?

Use RepoDataProvider only when you want the automated, end-to-end flow — i.e., when both RepoSelectorDetailPage and MultiRepoAction need to share cart and repo selection state with each other. In that case, both components must be rendered as descendants of RepoDataProvider.

If you don't need that shared automated flow, you can use CodebaseCart and RepoSelectionDetails individually without wrapping them in RepoDataProvider. They accept their data directly via props and manage their own rendering.


Core Concepts

Slot Props

Many components accept a slotProps (or slot/slots) prop that lets you override individual internal elements without replacing the entire component. This is inspired by MUI's slotProps API.

How it works:

  • Each slot targets a specific internal element (e.g., root, icon, title).
  • You can pass className to merge with the component's default classes.
  • You can pass style, event handlers, or any valid HTML attribute.
  • Event handlers are composed with the internal handler — both fire.
<ActionCard
  icon={<SomeIcon />}
  title="My Action"
  description="Click to proceed"
  slotProps={{
    root: { className: 'my-custom-root', onClick: () => console.log('clicked') },
    icon: { className: 'my-icon-class' },
    title: { style: { color: 'red' } },
  }}
/>

Custom Components

For deeper customization, many components accept a customComponents prop. This lets you completely replace rendered sections with your own React nodes or render functions.

<CodebaseCart
  reposInCart={repos}
  customComponents={{
    emptyCartComponent: <MyCustomEmptyState />,
    renderRepoCard: (repo, index) => <MyRepoCard key={repo.task_id} repo={repo} />,
  }}
/>

CSS Scoping with rdc: Prefix

All Tailwind classes in this library are prefixed with rdc: to avoid style conflicts with your application. Just import the style.css file — no extra configuration needed.


Exports Overview

Components (Named Exports)

| Export | Description | | ------------------------ | -------------------------------------------------------- | | RepoDataProvider | Context provider for repo/cart state management | | MultiRepoAction | Floating badge + cart popup for multi-repo workflows | | CodebaseCart | Cart panel showing selected codebases with actions | | RepoSelectionDetails | Repo selection list with header, search, and radio cards | | RepoSelectorDetailPage | Full-page repo selector with data fetching |

Types (Named Exports)

These types are exported for use in slot overrides and custom component definitions.

| Export | Description | | ------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | RepoSelectionDetailsProps | Props for RepoSelectionDetails | | CodebaseCartProps | Props for CodebaseCart (also used in MultiRepoAction slot overrides) | | MultiRepoActionProps | Props for MultiRepoAction | | RepoSelectorDetailPageProps | Props for RepoSelectorDetailPage | | RepoSelectorHeaderProps | Props for the internal header (used in slot overrides) | | NoCodebaseFoundProps | Props for the internal empty-state component (used in slot overrides) | | RepoCardProps / RepoCardSlotProps | Props and slot types for the internal repo card (used in CodebaseCart slot overrides) | | GithubRepoRadioCardProps | Props for the internal radio card (used in RepoSelectionDetails slot overrides) | | ActionCardProps / ActionCardSlotProps | Props and slot types for the internal action card (used in CodebaseCart slot overrides) | | StandardContainerProps / StandardContainerSlotProps | Props and slot types for the internal container (used in CodebaseCart slot overrides) | | EmptyCartProps | Props for the internal empty cart component (used in CodebaseCart custom components) | | ChipProps | Props for the internal chip component (used in various slot overrides) | | TooltipProps / TooltipSlotProps | Props and slot types for the tooltip (used in various slot overrides) | | SlotProps | Generic utility type for slot prop definitions | | TCodebase | Data model for a codebase | | TCodebaseInCart | Data model for a codebase in the cart | | TCodebaseInCartStatus | Status display model | | TRepoSelectionConfiguration | Selection configuration per repo | | IRepoData | Repo data interface (branch + git_url) | | IRepoAddedToCart | Cart entry interface | | IExistingRepoData | Full existing repo data from API | | IGetExistingRepoResponse | API response wrapper | | AnalysisRecord | Analysis task record |


Components

RepoDataProvider

Import:

import { RepoDataProvider } from '@e-llm-studio/repo-data-cart';

A React context provider that manages all shared state for repo selection, cart management, and search functionality. Required when using the automated flow — any component that reads or writes the shared context state (i.e., MultiRepoAction and RepoSelectorDetailPage) must be a descendant of this provider.

For standalone, prop-driven components like CodebaseCart and RepoSelectionDetails, the provider is not required — pass data directly via their props instead.

Props (RepoDataProviderProps)

| Prop | Type | Required | Description | | --------------------------------- | ------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | children | React.ReactNode | No | Child components that consume the repo data context. | | repoData | TCodebase[] | Yes | The full list of available codebases/repos. | | setRepoData | Dispatch<SetStateAction<TCodebase[]>> | Yes | Setter to update the repo data list (typically from useState). | | isSearchingAcrossAllRepo | boolean | Yes | Whether "search across all repos" mode is active. | | setIsSearchingAcrossAllRepo | Dispatch<SetStateAction<boolean>> | Yes | Setter for the search-all mode flag. | | isRepositorySelectorPageOpen | boolean | Yes | Whether the repo selector detail page is open/visible. | | setIsRepositorySelectorPageOpen | Dispatch<SetStateAction<boolean>> | Yes | Setter to open/close the repo selector page. | | refreshRepoData | boolean | Yes | When toggled, triggers a re-fetch of repo data internally. | | onRepoAddedToCartChange | (reposAddedToCart: IRepoAddedToCart[]) => void | No | Callback fired whenever the cart contents change. Receives the current cart entries. | | showToast | (id: string, data: any) => void | No | Optional toast notification function. Called with event IDs like 'FETCH_REPO_FAILED', 'DESELECT_ATTEMPT_MANDATORY_SELECTED_REPO', etc. |

Usage

const [repoData, setRepoData] = useState<TCodebase[]>([]);
const [isSearching, setIsSearching] = useState(false);
const [isPageOpen, setIsPageOpen] = useState(false);

<RepoDataProvider
  repoData={repoData}
  setRepoData={setRepoData}
  isSearchingAcrossAllRepo={isSearching}
  setIsSearchingAcrossAllRepo={setIsSearching}
  isRepositorySelectorPageOpen={isPageOpen}
  setIsRepositorySelectorPageOpen={setIsPageOpen}
  refreshRepoData={false}
  onRepoAddedToCartChange={(cart) => console.log('Cart updated:', cart)}
  showToast={(id, data) => toast(id)}
>
  {/* All cart/selection components go here */}
</RepoDataProvider>;

MultiRepoAction

Import:

import { MultiRepoAction } from '@e-llm-studio/repo-data-cart';

A floating action button with a badge counter that, when clicked, reveals a CodebaseCart popup. This is the primary entry point for multi-repo selection workflows. It reads from and writes to the RepoDataProvider context.

Props (MultiRepoActionProps)

| Prop | Type | Required | Default | Description | | ------------------------ | -------------------- | -------- | ------- | ----------------------------------------------------------------------------------------------- | | defaultSelectedRepoIds | IRepoAddedToCart[] | No | [] | Initial set of repo IDs to pre-populate the cart with. Applied once when repo data first loads. | | slots | object | No | — | Slot overrides for internal elements (see below). |

slots Structure

| Slot | Type | Description | | ------------------------------ | ---------------------------- | -------------------------------------------------------------------------------- | | slots.root | SlotProps<'div'> | Overrides for the outermost wrapper div. | | slots.cartContainer.root | SlotProps<'div'> | Overrides for the cart popup container (positioned absolutely above the button). | | slots.cartContainer.cart | Partial<CodebaseCartProps> | Partial props forwarded to the inner CodebaseCart component. | | slots.badge.root | BadgeProps | Props forwarded to the Badge component wrapping the button. | | slots.badge.badgeButton.root | SlotProps<'button'> | Overrides for the clickable button element itself. | | slots.badge.badgeButton.icon | React.ReactNode | Custom icon to replace the default CodeXml icon. |

Internal Behavior

  • Clicking the badge button toggles the CodebaseCart popup visibility.
  • The badge displays the number of selected repos, or "All" when search-all mode is active.
  • Cart operations (add, remove, toggle selection, search-all) are wired to the RepoDataProvider context automatically.

Usage

<MultiRepoAction
  defaultSelectedRepoIds={[
    { id: 'repo-1', selected: true, defaultRepo: true },
    { id: 'repo-2', selected: true },
  ]}
  slots={{
    root: { className: 'my-custom-root' },
    badge: {
      root: { color: 'primary' },
      badgeButton: {
        root: { className: 'my-button-style' },
        icon: <MyCustomIcon />,
      },
    },
    cartContainer: {
      cart: {
        slot: {
          emptyCartContainer: {
            emptyCartProps: { title: 'Custom empty title' },
          },
        },
      },
    },
  }}
/>

CodebaseCart

Import:

import { CodebaseCart } from '@e-llm-studio/repo-data-cart';

A panel component that displays a list of codebases currently in the cart, with options to add, open, remove, and select individual repos. When the cart is empty, it shows an EmptyCart prompt. Below the list, it provides a "Search across all codebases" action.

Standalone use: CodebaseCart can be used on its own without RepoDataProvider — pass repo data and callbacks directly via props (as shown below).

Props (CodebaseCartProps)

| Prop | Type | Required | Default | Description | | -------------------------- | --------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- | | onCodebaseAdd | () => void | No | — | Callback when the "add codebase" button is clicked. | | reposInCart | TCodebaseInCart[] | No | [] | Array of codebases currently in the cart. Each entry extends TCodebase with checked, defaultRepo?, and alwaysSelected? fields. | | onOpenCodebaseFromCart | (repo: TCodebaseInCart) => void | No | — | Callback when a repo's "open" action is triggered. | | onRemoveCodebaseFromCart | (repo: TCodebaseInCart) => void | No | — | Callback when a repo's "remove" action is triggered. | | onSelectionChange | (repo: TCodebaseInCart) => void | No | — | Callback when a repo's checkbox selection is toggled. | | onSearchAll | () => void | No | — | Callback when the "search across all codebases" action is triggered. | | isSearchAllEnabled | boolean | No | — | When true, the search-all card gets a highlighted border and accent color. | | slot | object | No | — | Slot overrides (see below). | | customComponents | object | No | — | Custom component overrides (see below). |

slot Structure

| Slot | Type | Description | | ------------------------------------------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------ | | slot.root | SlotProps<'div'> | Overrides for the outermost wrapper (w-[500px] h-fit). | | slot.standardContainer.root | StandardContainerProps | Props forwarded to the StandardContainer wrapper (title area, header, etc.). | | slot.standardContainer.actionButton | SlotProps<'button'> | Overrides for the "+" add button. | | slot.standardContainer.icon | React.ReactNode | Custom icon for the add button. | | slot.standardContainer.iconTooltipProp | Partial<TooltipProps> | Tooltip props for the add button's tooltip. | | slot.standardContainer.extraActions | React.ReactNode | Extra action elements rendered next to the add button. | | slot.standardContainer.hideAddButton | boolean | When true, hides the add button entirely. | | slot.emptyCartContainer.root | SlotProps<'div'> | Overrides for the empty-cart container wrapper. | | slot.emptyCartContainer.emptyCartProps | EmptyCartProps | Props forwarded to the EmptyCart component. | | slot.emptyCartContainer.actionCardContainer.root | SlotProps<'div'> | Overrides for the action card container in the empty state. | | slot.emptyCartContainer.actionCardContainer.actionCard | ActionCardProps | Props forwarded to the "Select a codebase" ActionCard. | | slot.allRepoContainer.root | SlotProps<'div'> | Overrides for the scrollable repo list container (max-h-[350px] overflow-auto). | | slot.allRepoContainer.singleRepoContainer.root | SlotProps<'div'> | Overrides applied to each individual repo row wrapper. | | slot.allRepoContainer.singleRepoContainer.getRepoCardProps | (repo, defaultProps) => RepoCardProps | Function to customize RepoCard props per repo. Receives the repo data and default props. | | slot.divider.root | DividerProps | Props for the divider between the repo list and search-all card. | | slot.divider.textElement | SlotProps<'span'> | Overrides for the divider's text element. | | slot.divider.text | string | Text displayed in the divider. Default: "OR". | | slot.searchAllActionCard | ActionCardProps | Props forwarded to the "Search across all" ActionCard. | | slot.searchAllActionCardTooltipProp | Partial<TooltipProps> | Tooltip props for the search-all card. |

customComponents Structure

| Key | Type | Description | | ----------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | | customComponents.emptyCartComponent | React.ReactNode | Completely replaces the default empty cart view. | | customComponents.searchAllActionCardComponent | React.ReactNode | Completely replaces the "Search across all" action card. | | customComponents.renderRepoCard | (repo: TCodebaseInCart, index: number) => React.ReactNode | Render function to replace individual RepoCard components. |

Usage

<CodebaseCart
  reposInCart={[
    {
      task_id: 'repo-1',
      name: 'My Repo',
      github_url: 'https://github.com/org/repo',
      branch_name: 'main',
      /* ... other TCodebase fields ... */
      checked: true,
      defaultRepo: true,
    },
  ]}
  onCodebaseAdd={() => openSelector()}
  onRemoveCodebaseFromCart={(repo) => removeRepo(repo.task_id)}
  onSelectionChange={(repo) => toggleRepo(repo.task_id)}
  onSearchAll={() => toggleSearchAll()}
  isSearchAllEnabled={isSearching}
  slot={{
    standardContainer: {
      root: { className: 'custom-container' },
      extraActions: <MyButton />,
    },
  }}
  customComponents={{
    renderRepoCard: (repo, i) => <MyCustomCard key={repo.task_id} repo={repo} />,
  }}
/>

RepoSelectionDetails

Import:

import { RepoSelectionDetails } from '@e-llm-studio/repo-data-cart';

A layout component that renders a list of repos as radio-selectable cards in a 2-column grid. It shows a loading state while data loads, a list of GithubRepoRadioCard items when data is available, or a NoCodebaseFound state when the list is empty.

Standalone use: RepoSelectionDetails can be used on its own without RepoDataProvider — supply repoData, currentlySelectedRepos, and callbacks via props.

Props (RepoSelectionDetailsProps)

| Prop | Type | Required | Description | | ------------------------ | ------------- | ----------------- | ------------------------------------------------------- | | isRepoDataLoaded | boolean | Yes | When false, the loading component is shown. | | repoData | TCodebase[] | No (default []) | The array of codebases to display. | | currentlySelectedRepos | string[] | Yes | Array of task_id values for currently selected repos. | | slots | object | No | Slot overrides (see below). | | customComponents | object | No | Custom component overrides (see below). |

slots Structure

| Slot | Type | Description | | ----------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------- | | slots.root | SlotProps<'div'> | Overrides for the outermost wrapper div (full width, white bg, p-6). | | slots.repoSelectionHeaderProps | Partial<RepoSelectorHeaderProps> | Partial props forwarded to the RepoSelectorHeader. | | slots.dividerProps | DividerProps | Props for the divider below the header. | | slots.repoDataContainer | SlotProps<'div'> | Overrides for the 2-column grid container. | | slots.noCodebaseFoundProps | NoCodebaseFoundProps | Props forwarded to the NoCodebaseFound component. | | slots.getGithubRepoRadioCardProps | (repo: TCodebase, index: number) => Partial<GithubRepoRadioCardProps> | Function to customize each GithubRepoRadioCard. |

customComponents Structure

| Key | Type | Description | | ------------------------------------------- | -------------------------------------- | ---------------------------------------------------- | | customComponents.repoLoadingComponent | React.ReactNode | Replaces the default loading spinner. | | customComponents.renderRepoComponent | (repo: TCodebase) => React.ReactNode | Replaces the default GithubRepoRadioCard per repo. | | customComponents.noCodebaseFoundComponent | React.ReactNode | Replaces the "no codebase found" state. |


RepoSelectorDetailPage

Import:

import { RepoSelectorDetailPage } from '@e-llm-studio/repo-data-cart';

A full-page component that handles fetching repo data (via API or custom fetch function), manages selection state locally, and delegates rendering to RepoSelectionDetails. This is the highest-level page component for repo selection.

Props (RepoSelectorDetailPageProps)

| Prop | Type | Required | Description | | ------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | fetchRepoUrl | string | Yes | The URL to fetch repo data from when fetchRepos is not provided. | | fetchRepos | (ref: React.MutableRefObject<TRepoSelectionConfiguration>) => TCodebase[] \| Promise<TCodebase[]> | No | Custom function to fetch repos. When provided, fetchRepoUrl is ignored for data fetching. The ref argument is the repo selection configuration ref. | | getRepoSelectionConfiguration | (repo: IExistingRepoData[]) => TRepoSelectionConfiguration | No | Function to derive selection configuration (always-selected, default repos, pre-selected) from raw API data. | | slots | object | No | Slot overrides forwarded to RepoSelectionDetails (see below). | | customComponents | object | No | Custom component overrides forwarded to RepoSelectionDetails. |

slots Structure

| Slot | Type | Description | | ----------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | slots.root | SlotProps<'div'> | Overrides for the root wrapper. | | slots.repoSelectionHeaderProps | RepoSelectorHeaderProps | Props for the header. Note: onProceed, onExitRepoSelection, searchQuery, and onSearchQueryChange are managed internally and will override your values. | | slots.dividerProps | DividerProps | Props for the divider. | | slots.repoDataContainer | SlotProps<'div'> | Overrides for the repo grid container. | | slots.noCodebaseFoundProps | NoCodebaseFoundProps | Props for the empty state. | | slots.getGithubRepoRadioCardProps | (repo: TCodebase, index: number) => Partial<GithubRepoRadioCardProps> | Function to customize each radio card. Note: onSelect and onDescriptionClick are wired internally. |

customComponents Structure

Same as RepoSelectionDetails:

| Key | Type | Description | | ------------------------------------------- | -------------------------------------- | -------------------------- | | customComponents.repoLoadingComponent | React.ReactNode | Custom loading indicator. | | customComponents.renderRepoComponent | (repo: TCodebase) => React.ReactNode | Custom repo card renderer. | | customComponents.noCodebaseFoundComponent | React.ReactNode | Custom empty state. |

Internal Behavior

  • Automatically fetches repo data on mount and when refreshRepoData changes.
  • Filters repos by search query.
  • Applies selection configuration (alwaysSelected repos cannot be deselected).
  • On "Proceed" or "Exit", commits the current selection to the RepoDataProvider context.

Usage

<RepoSelectorDetailPage
  fetchRepoUrl="/api/v1/repos"
  fetchRepos={async (configRef) => {
    const data = await myApi.getRepos();
    return data.map(convertToCodebase);
  }}
  getRepoSelectionConfiguration={(repos) => {
    const config: TRepoSelectionConfiguration = {};
    repos.forEach((r) => {
      if (r.analysis_type === 'default') {
        config[r.id] = { id: r.id, alwaysSelected: true, defaultRepo: true };
      }
    });
    return config;
  }}
  slots={{
    root: { className: 'my-page-style' },
    repoSelectionHeaderProps: {
      title: 'Select Codebases',
      showFilter: false,
    },
    getGithubRepoRadioCardProps: (repo, index) => ({
      slot: {
        descriptionText: { style: { fontSize: '14px' } },
      },
    }),
  }}
/>

Exported Types

ChipProps

Import:

import type { ChipProps } from '@e-llm-studio/repo-data-cart';

A small inline chip/pill element used internally for tags and labels (e.g., GitHub URL, branch name). Exported as a type for use in slot overrides.

Props

Extends HTMLAttributes<HTMLParagraphElement>.

| Prop | Type | Required | Description | | ----------- | ----------------- | -------- | -------------------------------------------- | | children | React.ReactNode | Yes | Chip content. | | className | string | No | Additional CSS classes merged with defaults. |

All standard <p> HTML attributes are also accepted.

SlotProps Type

Import:

import type { SlotProps } from '@e-llm-studio/repo-data-cart';

A generic utility type used across all slot prop definitions. It extends the native element's props and adds an optional className.

type SlotProps<T extends React.ElementType> = {
  className?: string;
} & React.ComponentPropsWithoutRef<T>;

Usage example:

// This is how slot props are structured in the library:
type RepoCardSlotProps = {
  root?: SlotProps<'div'>; // div HTML props + className
  header?: SlotProps<'div'>;
  icon?: SlotProps<'span'>;
  // ...
};

Data Types

TCodebase

The primary data model representing a codebase/repository.

type TCodebase = {
  repo_name: string; // Repository name
  github_url: string; // Full GitHub URL
  branch_name: string; // Branch name
  languages_used: string[]; // List of programming languages
  task_id: string; // Unique task/analysis ID
  user_id: string; // Owner user ID
  assistant_id: string; // Associated assistant ID
  organization_name: string; // Organization name
  name: string; // Display name
  description: string; // Short description
  executive_summary: string; // Full executive summary text
  last_analyzed_date: string; // ISO date string of last analysis
  status: string; // Status string (e.g., "Completed")
  shared: boolean; // Whether the codebase is shared
};

TCodebaseInCart

Extends TCodebase with cart-specific selection state.

type TCodebaseInCart = TCodebase & {
  checked: boolean; // Whether this repo is currently selected in the cart
  defaultRepo?: boolean; // Whether this is a default/required repo
  alwaysSelected?: boolean; // Whether this repo cannot be deselected
};

IRepoAddedToCart

A lightweight cart entry used for tracking which repos are in the cart.

type IRepoAddedToCart = {
  id: string; // The task_id of the repo
  selected: boolean; // Whether the repo is currently selected
  defaultRepo?: boolean; // Whether this is a default repo
  alwaysSelected?: boolean; // Whether selection cannot be toggled off
};

IRepoData

Basic repo data (branch + URL).

interface IRepoData {
  branch: string;
  git_url: string;
}

TRepoSelectionConfiguration

A map of repo ID to selection configuration. Used to pre-configure which repos are always selected, default repos, or pre-selected.

type TRepoSelectionConfiguration = {
  [key: string]: {
    id: string;
    alwaysSelected?: boolean; // Cannot be deselected
    defaultRepo?: boolean; // Marked as default
    preselect?: boolean; // Pre-selected when page opens
  };
};

AnalysisRecord

Represents a single analysis task/record for a codebase.

interface AnalysisRecord {
  analysis_type: string;
  created_at: string;
  status: 'In Progress' | 'Failed' | 'Completed' | 'Sync Progress' | 'Rejected' | 'Pending';
  task_id: string;
  version: number;
  chat_embedding_model?: { model_name: string; model_type: string };
  semantic_version?: string;
  is_deleted: boolean;
  version_new?: string;
}

IExistingRepoData

Full repo data as returned from the API.

interface IExistingRepoData {
  id: string;
  created_at: string;
  repo_data: IRepoData[];
  language: string[];
  analysis_type: string;
  assistant_name: string;
  name: string;
  status: string;
  task_id: string;
  owner_id: string;
  user_id: string;
  uploaded_file_count: string;
  rejected_by_email: string;
  rejected_by_name: string;
  project_id: string;
  description: string;
  organization_name?: string;
  executive_summary: string;
  shared: boolean;
  validity: string;
  access_type: string;
  version_history: AnalysisRecord[];
  share_count: number;
  chat_embedding_model?: { model_name: string; model_type: string };
  datasource?: string;
  database_name?: string;
  dataset_id?: string;
  use_new_version?: boolean;
  dbConn?: {
    servername: string;
    databasename: string;
    username: string;
    password: string;
    schemaname: string;
  };
}

IGetExistingRepoResponse

API response wrapper.

interface IGetExistingRepoResponse {
  data: IExistingRepoData[];
}

TCodebaseInCartStatus

Status display model for a cart item.

type TCodebaseInCartStatus = {
  icon: React.ReactNode; // Status icon
  text: string; // Status text
};

License

MIT