diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 61197e1..08f621e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -13,6 +13,7 @@ Read this before you change the code, open a pull request, build a preview or cu - `clipboard.rs`: copies a secret the user pastes once (Paradev's SSH address) and clears it a minute later, and copies Paseo's and Rex's host address, which holds no secret and stays. - `old_app.rs`: finds a copy of the app from before it was InstaADE, and moves it to the Trash (see [The old app](#the-old-app)). - `agents.rs`: signing Claude Code or Codex in on a sandbox. `github.rs`: signing GitHub's CLI in on a sandbox and setting up git there (see [GitHub sign-in](docs/ades.md#github-sign-in)). `repos.rs`: the GitHub repos `gh` lists on a sandbox, the repo names InstaADE takes, and the check of a repo's folder there (see [Bring your repo](docs/ades.md#bring-your-repo)). `settings.rs`: the app's saved settings, `settings.json`, which keep Later on that sign-in and Done on Orca's and Paseo's next steps (see [Next steps](docs/ades.md#next-steps)). `tray.rs`: the menu bar popover. `login.rs`: start at login. + - `orbs.rs`: Amp orbs, which make the workspace an orb provider for Amp (see [docs/amp-orbs.md](docs/amp-orbs.md)): the provider sandbox, its instabox key, its install script and its status. `assets/amp-orbs/` holds the dispatch program `amp-orbs` that runs on the provider and its systemd units. The tests in `orbs.rs` run the program with a fake `instabox`, `amp`, `sudo` and `systemctl`. `orbs::INSTABOX_CLI` pins the instabox CLI the provider installs. To bump it, set the version and its `npm view instabox@ dist.integrity`; Repair installs it. - `updater.rs`: checks for a new version of InstaADE and installs it when the user clicks Update in Settings (see [In-app updates](#in-app-updates)). - `src/` is the React UI. `api.ts` wraps the Rust commands and `types.ts` mirrors the Rust state. `mode.ts` keeps the ADE the user picked, and whether they saw the tip under the switcher. diff --git a/README.md b/README.md index 5348845..f52b668 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ You need macOS or Windows (x64), an [instabox](https://instabox.sh) account, and - Copy the SSH command or open it in a terminal - Sign in to Claude Code or Codex on the sandbox - Sign in to GitHub on the sandbox, so git can clone and push your private repos +- Run each [Amp](https://ampcode.com) thread on its own sandbox as an Amp orb, set up in one click on a paid plan. See [docs/amp-orbs.md](docs/amp-orbs.md). - Starts at login, and updates itself from **Update** in Settings ## Supported ADEs @@ -79,6 +80,7 @@ Every **Open in** wakes the sandbox first. - Installs Amp on the sandbox and opens it in your terminal over SSH. - First time: press `y` when Amp asks to log in, open the link it shows on your computer, sign in and check the code. - Closing the terminal ends Amp on the sandbox. Its threads stay at ampcode.com. + - To run Amp threads without your computer, set up [Amp orbs](docs/amp-orbs.md). - **[Rex](docs/ades.md#rex-macos)** · macOS 15 or later, Apple silicon - Installs Rex's server on the sandbox, adds it as an SSH host, copies its address and starts Rex. - First time: in Rex, open **Settings** → **Remote Hosts** → **Add Remote Host…**, paste the address as the URL and click **Add**. diff --git a/docs/ades.md b/docs/ades.md index cef092a..ff3fcbf 100644 --- a/docs/ades.md +++ b/docs/ades.md @@ -345,6 +345,7 @@ The first time, Amp is not signed in on the sandbox, and it asks `Would you like - Amp keeps its files in the home folder on the sandbox, `/data/home`, which a pause or a stop keeps: the CLI in `~/.amp`, its settings in `~/.config/amp` and its data in `~/.local/share/amp`. - Amp keeps each thread at ampcode.com. Closing the terminal ends `amp` on the sandbox, unlike Herdr. `amp threads continue` goes on with a thread. +- To run Amp threads without your computer, each on its own sandbox, set up [Amp orbs](amp-orbs.md). - Amp updates itself in the background, in `~/.amp/bin`, so the link follows. `amp update` updates it at once. InstaADE never updates Amp. On your computer, InstaADE needs only the OpenSSH client, as for Herdr. Settings shows its version next to Amp. Without it, nothing wakes or changes, and InstaADE asks you to install the OpenSSH client. diff --git a/docs/amp-orbs.md b/docs/amp-orbs.md new file mode 100644 index 0000000..b03c8a9 --- /dev/null +++ b/docs/amp-orbs.md @@ -0,0 +1,155 @@ +# Amp orbs on instabox + +An [Amp orb](https://ampcode.com) is a sandbox where an Amp thread runs without your computer. Amp starts it, pauses it and deletes it through an orb provider. InstaADE makes your instabox workspace an orb provider: each Amp thread then runs on its own instabox sandbox. + +InstaADE does this in one click. It needs no change to instabox or to Amp. + +## What you need + +- A paid instabox plan. The provider sandbox runs all the time, and the Free plan pauses every sandbox after 30 minutes. See [pricing](https://instabox.sh/pricing). +- An Amp account. +- To be an owner or admin of the workspace. Setup and removal manage an instabox key of the workspace, and only owners and admins can do that. + +## Set it up + +1. In Amp mode, click **Set up Amp orbs** on the offer above the list. You can also go to **Settings** → **Amp orbs** → **Set up**. +2. Read the steps and the costs, then click **Set up Amp orbs**. +3. InstaADE makes the provider sandbox and installs the provider on it. A terminal then opens on the provider. +4. In the terminal, open the link Amp shows, sign in, and check the code. The terminal adds instabox to Amp as your default orb provider. You copy no token. +5. Wait for the orb image. The first build takes about 5 minutes. The page ticks each step as it finishes. +6. Start a thread on an orb. instabox is already your default orb provider. + - On ampcode.com: in the new thread box, click **Orb** and pick `instabox` under **Self-Hosted**. + - From the CLI: `amp -ox "your first message" --orb-provider instabox`. Add `--project ` to work in a repository. + - To pick a size, add orb types first: see [Orb sizes](#orb-sizes). + +The page checks the provider every 10 seconds until it is connected and its image is built. **Repair** runs the install again, for example after an error. **Check again** reads the status now. + +

+ The Amp orbs setup page: Paid plan ticked, then Provider sandbox, Sign in to Amp, Add instabox to Amp, Build the orb image and Connect to Amp + The Amp orbs page once connected: the provider running at 2 vCPU / 4 GB, 1 orb running and 1 paused, the orb image updated today, the key renewing itself, and Open Amp, Rebuild image and Remove Amp orbs +

+ +## What runs where + +| Where | What | +| --- | --- | +| Provider sandbox `amp-orb-provider` | The smallest size of your plan, auto sleep off. It runs `amp orb provider` as the systemd service `amp-orb-provider`, with `/usr/local/bin/amp-orbs` as its dispatch program. It runs with the token that Amp made for the instabox provider at sign-in, kept in `/var/lib/amp-orbs/provider-token` (mode 0600). | +| One orb sandbox per thread `amp-` | The size of the [orb type](#orb-sizes) the thread picked. Without orb types: 4 vCPU / 8 GB, or the largest size of your plan below that, and an orb from a project's snapshot keeps that snapshot's size. Auto sleep is off: Amp pauses it. Amp runs on it as `user`. | +| Snapshots `amp-orb-base-