# `core/charts/repos.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/charts/repos.ts"><code>core/charts/repos.ts</code></a> · <code>npm run docs:gen</code></p>

The repositories a machine reads charts from (alta.repos/0.1, docs/standards/alta-index-0.1.md §7): their names, addresses and keys, kept in ~/.config/alta/repos.json by `alta repo add` and `alta repo remove`. Pure.

**Standards that cite this file**: [alta.index/0.1: the chart repository index](https://docs.altasystem.ai/reference/advanced/specs/alta-index-0.1)

## Exports

### `REPOS_SCHEMA` 
```ts
const REPOS_SCHEMA = "alta.repos/0.1"
```

### `RESERVED_REPO_NAMES` 
Names a remote repository may not take: the local folders `alta repo list` already shows.

```ts
const RESERVED_REPO_NAMES = ["modules", "agents", "engine", "local", "world-charts"]
```

### `RepoEntry` 
```ts
interface RepoEntry { name: string; url: string; added: string; key?: { alg: "ed25519"; public: string }; unsigned?: true }
```

### `Repos` 
```ts
interface Repos { schema: typeof REPOS_SCHEMA; repos: RepoEntry[] }
```

### `emptyRepos` 
```ts
const emptyRepos = (): Repos => …
```

### `DEFAULT_REPO` 
The official catalogue, known by default to a machine that has no repos.json yet: listed by `alta repo list`,
 removable like any other (the file written then no longer holds it). Nothing is fetched until the owner types
 `alta repo update`. TODO(owner): pin the index key (`key: { alg: "ed25519", public }`) once the official key exists
 (docs/oss/DECISIONS.md, D7); until then `alta repo update` refuses its index (no key to check it with).

```ts
const DEFAULT_REPO: RepoEntry
```

### `defaultRepos` 
```ts
const defaultRepos = (): Repos => …
```

### `repoNameProblem` 
Why a repository name cannot be used (undefined = it can).

```ts
function repoNameProblem(name: unknown): string | undefined
```

### `checkRepoUrl` 
Why an index address cannot be used (undefined = it can): https, no credentials; http only for 127.0.0.1 in tests.

```ts
function checkRepoUrl(url: unknown, rules: UrlRules = {}): string | undefined
```

### `checkRepos` 
Problems of a repos file (empty = valid).

```ts
function checkRepos(x: unknown, rules: UrlRules = {}): string[]
```

### `withRepo` 
The repos with one added (refused when the name is taken).

```ts
function withRepo(repos: Repos, entry: RepoEntry): Repos | string
```

### `withoutRepo` 
The repos without one.

```ts
function withoutRepo(repos: Repos, name: string): Repos | string
```
