# Repo

> Repos: git repositories for the code your agents and apps write.

```python
repo = noclick.Repo.from_name("agent-tools", create_if_missing=True)
repo.commit({"src/index.ts": source}, message="Add the lookup route")
repo.commit({"index.html": {"url": "https://example.com/page.html"}}, message="Publish the page")
print(repo.read("src/index.ts").decode())
print(repo.clone_url())   # plain git over HTTPS, a short-lived token inside

site = noclick.Repo.create("site", from_url="https://github.com/acme/site").wait()   # a copy, history and all
```

A repo is plain git: clone it, push to it, copy one in from a public URL, or move it to GitHub whole.
A project (`noclick.Project`) deploys one to a URL.

## Repo

```typescript
class Repo
```

A git repository NoClick hosts. `Repo.fromName("agent-tools", { createIfMissing: true })` is
lazy; commit to it from code, or clone it and push with plain git.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `name` | `string` |  |
| `defaultBranch` | `string` | The branch a project deploys to production. |
| `sizeBytes` | `number | null` |  |
| `lastCommit` | `Commit | null` | The newest commit on the default branch (null in an empty repo). |
| `usedBy` | `UsedBy[]` | The apps that deploy it (`binding` is always null). |
| `userId` | `string | null` |  |
| `createdAt` | `Date | null` |  |
| `forkedFrom` | `{ address: string } | null` | Copied from someone's public work on NoClick: `{address}`, the address it was copied from; null for a repo of your own. |
| `public` | `PublicCode | null` | A space template's code, while it's public (`makePublic()`); null while it's private. An app's code is public as its app (`Project.public`). |

Types:

```typescript
/** An app that binds a database or a bucket, under its `binding` name. */
interface UsedBy {
  kind: string;
  id: string;
  name: string;
  binding: string | null;
}
```

### Repo.create

```typescript
static create(name: string, options: RepoImportOptions): Promise<RepoImport>
static create(
  name: string,
  options?: RepoCreateOptions & AllowExisting,
): Promise<Repo>
```

Create an empty repo (unique per user; a duplicate throws `Conflict` with `existingId`, or with
`allowExisting: true` returns the repo already there, commits and all).

With `fromUrl`, the repo is a copy of a public git repository, history and all, and this resolves
to the `RepoImport` doing the copy, whose `wait()` resolves to the repo once it's copied. Every
branch and tag is copied, the repo's default branch the source's own unless `defaultBranch` names
another of its branches; `ref` copies one branch, tag or commit (its full sha) instead, as the
repo's one branch. Submodules and LFS files aren't copied (their pointers are, as committed). The
copy takes up to 5 GiB of history and 15 minutes. That size is measured as git transfers the
history (compressed), which isn't the same figure as the repo's `sizeBytes` afterwards. The copy is
charged what it uses: its seconds of compute and the bytes it stores, at NoClick's vendors'
prices. An import always makes a new repo, so it takes no `allowExisting`.

    const copy = await Repo.create("blog", { fromUrl: "https://github.com/acme/blog" });
    const repo = await copy.wait(); // its error, if NoClick can't copy it (the repo is deleted)
    console.log(repo.defaultBranch, repo.lastCommit?.sha);

Parameters:

- `name` (`string`, required)
- `options.defaultBranch` (`string`): The branch a project deploys to production (`main` unless set). Copying, it's one of the source's branches
(the source's own default when omitted), or with `ref` the branch the copy lands on (the branch's own name,
else `main`).
- `options.fromUrl` (`string`, required): The https URL you'd `git clone`, with no login in it.
- `options.ref` (`string`): One branch, tag or commit (its full sha) to copy alone, with its history; every branch and tag when omitted.
- `options.allowExisting` (`boolean`): A taken name returns the object already there, as it is: nothing about it changes.
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: The new repo, loaded, with no commits yet; with `from_url`, a
`RepoImport`: the operation doing the copy, whose `wait()` gives
the repo once it's copied.

Types:

```typescript
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}
```

### Repo.fromName

```typescript
static fromName(
  name: string,
  options?: RepoCreateOptions & { createIfMissing?: boolean },
): Repo
```

A lazy reference to the repo called `name` for the current (or given) user. With
`createIfMissing` it's created, empty, on first use; an existing repo is used as it is.

Parameters:

- `name` (`string`, required)
- `options.createIfMissing` (`boolean`)
- `options.defaultBranch` (`string`): The branch a project deploys to production (`main` unless set).
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: A repo that loads, or is created, the first time it's used. Nothing is sent yet.

Types:

```typescript
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}
```

### Repo.fromId

```typescript
static fromId(repoId: string, options?: CallOptions): Repo
```

A lazy reference to a repo by id.

Parameters:

- `repoId` (`string`, required)
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.

Returns: A repo that loads the first time you read a field. Nothing is sent yet.

Types:

```typescript
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}
```

### Repo.get

```typescript
static get(repoId: string, options?: CallOptions): Promise<Repo>
```

Load a repo by id now; an unknown id raises `noclick.NotFound`.

Parameters:

- `repoId` (`string`, required)
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: The repo, loaded.

Types:

```typescript
/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}
```

### Repo.list

```typescript
static list(options?: ReadOptions & { limit?: number }): Promise<Repo[]>
```

The current user's repos (the account's own outside `asUser`, or those `userFilter` covers).

Parameters:

- `options.limit` (`number`): Return at most this many.
- `options.userFilter` (`UserFilter`): Which users the read covers (`user_id` query), instead of acting as one (`user`).
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: Every matching repo, newest first, fetched page by page.

Types:

```typescript
/**
 * Which users a read covers: `ALL_USERS`, `NO_USER`, a `User` or your id for one. Sent as the
 * `user_id` query parameter, never as the `NoClick-User` header, so it filters without acting as the user.
 */
type UserFilter = typeof ALL_USERS | typeof NO_USER | UserRef;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;
```

### Repo.listPage

```typescript
static listPage(options?: ReadOptions & PageOptions): Promise<Page<Repo>>
```

One page of repos; pass `nextCursor` back as `cursor`.

Parameters:

- `options.cursor` (`string | null`): The `next_cursor` of the page before; omit it for the first page.
- `options.limit` (`number`): Return at most this many.
- `options.userFilter` (`UserFilter`): Which users the read covers (`user_id` query), instead of acting as one (`user`).
- `options.user` (`UserOption`, default: the current user): `undefined` = the ambient user (`asUser`), `null` = the account itself.
- `options.client` (`NoClick`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: A page whose `data` holds the repos and whose `next_cursor` is `None` on the last page.

Types:

```typescript
/**
 * Which users a read covers: `ALL_USERS`, `NO_USER`, a `User` or your id for one. Sent as the
 * `user_id` query parameter, never as the `NoClick-User` header, so it filters without acting as the user.
 */
type UserFilter = typeof ALL_USERS | typeof NO_USER | UserRef;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;
```

### Repo.cloneUrl

```typescript
cloneUrl(options?: { write?: boolean; ttlS?: number }): Promise<string>
```

A git URL with a short-lived token inside, for `git clone`, `fetch` and, with `write`, `push`.
`ttlS` is 3,600 by default, at most 86,400; the token reaches this repo only. Treat it as a secret
until it expires. Clones and pushes cost nothing extra, within fair use. An agent's writing URL (asked
for through NoClick's MCP server, by the coordinator or by a platform agent) goes through NoClick, which
never lets it force-push or delete the default branch, and keeps the old head of any other branch its
push rewrites or deletes (`backups`).

Parameters:

- `options.write` (`boolean`, default `false`)
- `options.ttlS` (`number`)

Returns: An `https://` URL that plain git accepts as it is. Treat it as a secret until it expires.

### Repo.checkout

```typescript
checkout(options?: CheckoutOptions): RepoCheckout
```

This repo checked out in an agent's workspace, for `Agent` `repos`: cloned into
`/workspace/<path>` (the repo's name when omitted) on `branch` (the default branch when omitted);
`push` is the branches it may push to, exact or `prefix/*`, else it's read-only. The repo must be in
the agent's own scope, and the agent's commits name it as their author. Sends nothing.

    const site = Repo.fromName("booking");
    await Agent.create("site-builder", { instructions, repos: [site.checkout({ push: "agent/*" })] });

Parameters:

- `options.branch` (`string`): The branch it checks out (the repository's default when omitted).
- `options.path` (`string`): The folder under `/workspace` it's cloned into (the repository's name when omitted).
- `options.push` (`string | string[]`): Branches it may push to, exact or a prefix ending in `/*` (`"noclick/*"`); without it the checkout is read-only.

Returns: A `RepoCheckout` to list in an agent's `repos`.

### Repo.commit

```typescript
commit(
  files: Record<string, string | Uint8Array | FileSource | null>,
  options: RepoCommitOptions,
): Promise<Commit>
commit(
  folder: string,
  options: RepoCommitOptions & { exclude?: string[] },
): Promise<Commit | null>
```

Commit `files` in one commit: each path maps to its new content (text, or bytes for binary
files) or to `null` to delete it. At most 1,000 files and 50 MB in one commit.

A file NoClick can reach goes by reference instead (`FileSource`), and NoClick reads it byte for
byte, so it never passes through your code: `{ attachmentId }` (one of the account's files, or a
file this key uploaded to an agent or a channel before a message sends it), `{ url }` or
`{ bucketId, key }`. Those bytes count toward the 50 MB too. Files that change nothing (each
already holds what it's given) reject with `Conflict` (409), naming the commit that holds them.

    const [page] = await attachments({ query: "game.html" });
    await site.commit({ "index.html": { attachmentId: page.id! } }, { message: "Publish the game" });

Given a folder on disk instead (Node, Deno or Bun), the branch's tree is made to match it and
only what changed is sent: new and changed files written, files the folder no longer has
deleted. `.git` is skipped, and so is any path matching one of the `exclude` globs, which also
keeps the repo's own copies of those paths. Nothing changed resolves to null.

    const commit = await site.commit("./dist", { message: "Rebuild the site", exclude: ["*.map"] });

Parameters:

- `files` (`Record<string, string | Uint8Array | FileSource | null>`, required)
- `folder` (`string`, required)
- `options.message` (`string`, required)
- `options.branch` (`string`): The default branch when omitted; created from the default branch's head if it doesn't exist.
- `options.author` (`string`): `Name <email>`.
- `options.exclude` (`string[]`)

Returns: The new commit, with its `sha`; for a folder with nothing changed, `None`. Files
given that change nothing (each already holds what it's given) raise `noclick.Conflict`
(409), naming the commit that holds them.

Types:

```typescript
/**
 * A file NoClick reads for a commit, byte for byte, rather than one you send: one of the account's files
 * (`attachments()` lists them), the file at an https URL, or a bucket's file.
 */
type FileSource = { attachmentId: string } | { url: string } | { bucketId: string; key: string };
```

### Repo.read

```typescript
read(path: string, options?: { ref?: string }): Promise<Uint8Array>
```

One file's bytes at `ref` (a branch, tag or sha; the default branch's head when omitted). A link is
never followed: its path reads as the path it points to.

Parameters:

- `path` (`string`, required)
- `options.ref` (`string`)

Returns: The file's bytes exactly as committed; decode text yourself.

### Repo.files

```typescript
files(
  prefix?,
  options?: { ref?: string; recursive?: boolean },
): Promise<RepoFile[]>
```

What's in the directory `prefix` (the root when empty), directories first; `recursive` lists
every file below it instead, without the directories. A symbolic link is one entry of type
`link`, whatever it points to.

Parameters:

- `prefix` (`string`, default `""`)
- `options.ref` (`string`)
- `options.recursive` (`boolean`)

Returns: Its files and directories, directories first, each by path from the repo's root.

### Repo.branches

```typescript
branches(): Promise<Branch[]>
```

The repo's branches, the default one first.

Returns: Each branch with its `head` sha and when it last moved.

### Repo.backups

```typescript
backups(options?: { branch?: string; limit?: number }): Promise<RepoBackup[]>
```

The branches agents' pushes rewrote or deleted, as NoClick kept them first: newest first, `limit` of them
(50 by default), of `branch` alone when it's given; each is kept 30 days. Through NoClick an agent never
force-pushes or deletes the default branch at all.

    for (const backup of await repo.backups({ branch: "agent/new-form" })) console.log(backup.reason, backup.sha);

Parameters:

- `options.branch` (`string`)
- `options.limit` (`number`, default `50`): Return at most this many.

Returns: Up to `limit` backups (`None` for all of them), of `branch` alone when it's given.

### Repo.restoreBackup

```typescript
restoreBackup(backup: RepoBackup | string): Promise<Branch>
```

Make a backup's branch again at the commit it was kept at (`backup`: a `RepoBackup` or its id). When the
repo has a branch by that name again, the backup comes back as `<branch>-restored-<time>` instead; nothing
that's there moves. Resolves to the branch made.

Parameters:

- `backup` (`RepoBackup | string`, required)

Returns: The branch made, with its `head`.

### Repo.commits

```typescript
commits(options?: { branch?: string; limit?: number }): Promise<Commit[]>
```

The history of `branch` (the default branch when omitted), newest first: `limit` commits (20 by default).

Parameters:

- `options.branch` (`string`)
- `options.limit` (`number`, default `20`): Return at most this many.

Returns: Up to `limit` commits (20 by default; `None` for the whole history), fetched page by page.

### Repo.commitsPage

```typescript
commitsPage(options?: { branch?: string } & PageOptions): Promise<Page<Commit>>
```

One page of `commits`, newest first; pass `nextCursor` back as `cursor` (null on the last page).

Parameters:

- `options.branch` (`string`)
- `options.cursor` (`string | null`): The `next_cursor` of the page before; omit it for the first page.
- `options.limit` (`number`): Return at most this many.

Returns: A page whose `data` holds `Commit`s and whose `next_cursor` is `None` on the last page.

### Repo.diff

```typescript
diff(sha: string): Promise<CommitDiff>
```

What the commit `sha` (full or short) changed against its first parent, file by file; an unknown one throws `NotFound`.

Parameters:

- `sha` (`string`, required)

Returns: The commit with each file it changed, the file's status, the lines it added and deleted and
its patch in git's unified format.

### Repo.makePublic

```typescript
makePublic(
  options?: { dryRun?: boolean; transferCapUsd?: number },
): Promise<PublicCode>
```

Make a space template public (a repo holding a `space.json` at its default branch's head, as
`workspace.saveAsTemplate()` writes one): anyone can then clone it from its `originUrl` and add it from that
address. What's public is a copy of that commit's files, never earlier history or other branches; one file that
looks like a secret refuses it all, naming each (`InvalidRequest`, reason `secrets_found`), as does a space file
that doesn't read (reason `not_a_template`). Called again, it publishes the head as it is then. `dryRun` changes
nothing; `transferCapUsd` bounds what clones cost you a month ($5 unless set). Through MCP a first publish waits
for the account's owner; a key needs `projects:publish`, which `*` holds only when named. An app's repo goes
public as its app (`Project.makePublic`).

Parameters:

- `options.dryRun` (`boolean`)
- `options.transferCapUsd` (`number`)

Returns: Its `PublicCode`.

### Repo.makePrivate

```typescript
makePrivate(): Promise<PublicCode>
```

Nobody can clone the template from now on. Copies people already cloned or added stay theirs.

Returns: Its `PublicCode`, `public=False`, its `summary` saying so.

### Repo.export

```typescript
export(): Promise<Operation<ExportBundle>>
```

Package every branch and its history as a git bundle; `wait()` resolves to the `ExportBundle`.

Returns: An operation whose `.wait()` gives an `noclick.ExportBundle`: a zip at `url`
(a link that expires) holding the bundle, which `git clone` reads as it is.

### Repo.exportToGithub

```typescript
exportToGithub(
  options: {
    connection: string | Connection;
    owner: string;
    name?: string;
    private?: boolean;;
  },
): Promise<Operation<string | null>>
```

Copy the repo, every branch and tag with its history, into a new GitHub repository `owner/name`
(`name` defaults to this repo's), through `connection`: a GitHub connection (a `Connection` or its
name) of the repo's user, or of the account. `owner` is the connected account's own login or an
organization it may create repositories in; the NoClick repo stays as it was. A connection with
no GitHub account connected yet throws `NeedsConnection`, whose `connectUrl` connects it. The
operation fails with `Conflict` when GitHub already has `owner/name`, and `PermissionDenied` when
the connected account can't create repositories there. `wait()` resolves to the new repository's URL.

Parameters:

- `options.connection` (`string | Connection`, required)
- `options.owner` (`string`, required)
- `options.name` (`string`)
- `options.private` (`boolean`, default `true`)

Returns: An operation whose `.wait()` gives the new GitHub repository's URL.

### Repo.delete

```typescript
delete(): Promise<TrashItem>
```

Delete the repo and its history: it goes to the trash, restorable for 30 days. One an app
deploys from (`usedBy`) throws `Conflict`. Returns its `TrashItem`.

Returns: Its `TrashItem`: `restore()` puts it back, history and all.

### Repo.readText

```typescript
readText(path: string, options?: { ref?: string }): Promise<string>
```

One file as UTF-8 text.

Parameters:

- `path` (`string`, required)
- `options.ref` (`string`)

## Commit

```typescript
interface Commit
```

One commit: the `branch` it was made on, and `filesChanged`, how many files it added, changed or
deleted. A branch's history (`commits()`) names that branch and counts no files (`filesChanged` is
null); `diff()` counts them and names no branch.

| Attribute | Type | Description |
| --- | --- | --- |
| `sha` | `string` |  |
| `message` | `string` |  |
| `author` | `string | null` |  |
| `branch` | `string | null` |  |
| `createdAt` | `Date | null` |  |
| `filesChanged` | `number | null` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

## CommitDiff

```typescript
interface CommitDiff
```

What one commit changed against its first parent (`parents` is empty for the first commit).

| Attribute | Type | Description |
| --- | --- | --- |
| `commit` | `Commit` |  |
| `parents` | `string[]` |  |
| `additions` | `number` |  |
| `deletions` | `number` |  |
| `files` | `FileChange[]` |  |

## FileChange

```typescript
interface FileChange
```

One file a commit changed: `status` is `added`, `modified`, `deleted`, `renamed`, `copied` or
`type_changed`; `patch` is its unified diff in git's format, null (with the line counts) for a file
that isn't shown: one that isn't text, or is too large.

| Attribute | Type | Description |
| --- | --- | --- |
| `path` | `string` |  |
| `status` | `string` |  |
| `additions` | `number | null` |  |
| `deletions` | `number | null` |  |
| `size` | `number | null` |  |
| `patch` | `string | null` |  |
| `oldPath` | `string | null` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

## Branch

```typescript
interface Branch
```

A branch and the sha of its head commit.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |
| `head` | `string | null` |  |
| `updatedAt` | `Date | null` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

## RepoBackup

```typescript
interface RepoBackup
```

A branch's old head NoClick kept before an agent's push rewrote it (`reason` `"rewritten"`: a force-push)
or deleted it (`"deleted"`): the `branch`, the commit `sha` it was at, the platform agent whose push it was
(`agentId`, else null), and when it was kept. It's kept 30 days, until `expiresAt`, out of the branch list
and clones; `repo.restoreBackup` makes the branch again.

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `branch` | `string` |  |
| `sha` | `string` |  |
| `reason` | `string` |  |
| `agentId` | `string | null` |  |
| `createdAt` | `Date | null` |  |
| `expiresAt` | `Date | null` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

## RepoFile

```typescript
interface RepoFile
```

An entry in a repo's tree; `size` is in bytes, null for a directory, and
`sha` is git's blob id for a file's content (it changes whenever the content does).
A `link` is a symbolic link someone committed: listed as the entry it is, with no
size or sha, and never followed.

| Attribute | Type | Description |
| --- | --- | --- |
| `path` | `string` |  |
| `type` | `"file" | "dir" | "link"` |  |
| `size` | `number | null` |  |
| `sha` | `string | null` |  |
| `raw` | `JsonObject` | The response JSON exactly as the API sent it. |

Types:

```typescript
type JsonObject = { [key: string]: unknown };
```

## RepoCheckout

```typescript
class RepoCheckout
```

A git repository an agent works in, for `Agent` `repos`: a connection's repository
(`connection.checkout("acme/docs")`) or a NoClick repo of the agent's scope (`repo.checkout()`).
NoClick clones it into `/workspace/<path>` at a conversation's first turn, and the agent's
git reaches that repository only, through NoClick, with a key made for its sandbox; the
connection's own token never enters it. `push` lists the branches it may push to: exact names, or a
prefix ending in `/*` (`"noclick/*"` reaches `noclick/fix` and `noclick/a/b`), which NoClick's git
endpoint enforces; without it the checkout is read-only. Whatever `push` allows, the agent can't
force-push or delete the repository's default branch, and before its push rewrites or deletes any other
branch NoClick keeps the old head as a backup for 30 days (on a git host,
`refs/noclick/backups/<branch>/<time>` in the repository, which you push back to restore; on a NoClick repo,
`repo.backups()` and `repo.restoreBackup()`). A policy can't do this job:
a coding harness runs `git push` in its own shell, which is no tool call for a policy to judge.
`gh` only reads the repository there.

| Attribute | Type | Description |
| --- | --- | --- |
| `repository` | `string | null` | `owner/name` on the connection's service (null for a NoClick repo). |
| `connection` | `Connection | null` |  |
| `repo` | `Repo | null` |  |
| `branch` | `string | null` | The branch it checks out (the repository's default when None). |
| `path` | `string | null` | The folder under `/workspace` it's cloned into. |
| `push` | `string[] | null` | Branches it may push to, exact or `prefix/*` (None: read-only). |

## RepoImport

```typescript
class RepoImport extends Operation
```

A public git repository being copied, history and all, into a new repo: the operation
`Repo.create(name, { fromUrl })` returns. The repo is listed at once (`repo`) but takes no commits or
pushes until the copy succeeds. `wait()` resolves to the `Repo` then: its `defaultBranch` the source's
own (or the one you named) and its `lastCommit` that branch's head. A copy that can't finish (no
repository at the URL, one that asks for a sign-in, over 5 GiB of history as git transfers it, which
isn't the repo's `sizeBytes` afterwards, longer than 15 minutes) rejects from `wait()` saying why, and
the repo is deleted; so is one you `cancel()`. `progress` shows how far it got.

| Attribute | Type | Description |
| --- | --- | --- |
| `repoId` | `string | null` | The new repo's id. |
| `repo` | `Repo` | The new repo: it reads while the copy runs, and takes writes once `wait()` resolves. |
