Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c53a89d
Add workspace key create and revoke, and exec envs without history
CarmenDou Dec 4, 2026
fedb496
Add the Amp orbs provider program and its setup flows
CarmenDou Dec 4, 2026
e1e777d
Show the role of Amp orbs sandboxes and keep ADEs off them
CarmenDou Dec 4, 2026
a4a37c3
Add the Amp orbs page, its commands and its state
CarmenDou Dec 4, 2026
e300f7a
Document Amp orbs, and renew the orbs key while the app runs
CarmenDou Dec 4, 2026
8b22913
Stop Amp orbs removal and repair from losing orbs, snapshots or keys
CarmenDou Dec 4, 2026
ffc7b46
Let a second Amp orbs removal finish, and run with instabox's own token
CarmenDou Dec 4, 2026
ce816cc
Keep the orbs key from installers, pin the instabox CLI, and count or…
CarmenDou Dec 4, 2026
6fe7579
Give each orb pause its own snapshot
CarmenDou Dec 4, 2026
c61c094
Link orbs to their thread with the orb ID Amp really sends
CarmenDou Dec 4, 2026
0e96c51
Point the Amp section of the ADE docs to Amp orbs
CarmenDou Dec 4, 2026
f5ddb96
Give each orb the size of the orb type its thread picked
CarmenDou Dec 4, 2026
a599ca0
Show how to start orb threads and pick sizes, with screenshots
CarmenDou Dec 4, 2026
d2f6636
Keep Amp orbs to their workspace and their own import builder
CarmenDou Dec 4, 2026
faf2994
Renew a due orbs key in its workspace also after a switch
CarmenDou Dec 5, 2026
fb37247
Keep one Amp orbs key when setups run at once
CarmenDou Dec 5, 2026
78c6089
Keep a removal safe from setups in other apps, and from the user's sn…
CarmenDou Dec 5, 2026
190b47f
Say who in a team workspace can read the Amp orbs credentials
CarmenDou Dec 5, 2026
353c2d2
Take a base snapshot only by its time, never one with a tag
CarmenDou Dec 5, 2026
ab7a3c9
Start dispatch again when a removal leaves it stopped
CarmenDou Dec 5, 2026
e3a7280
Revoke a losing setup's key also when no status comes
CarmenDou Dec 5, 2026
daa57bf
Show one line in the menu of the Amp orbs provider and of an orb
CarmenDou Dec 5, 2026
8e4ac36
Say to delete instabox in Amp before setting Amp orbs up again
CarmenDou Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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@<version> 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.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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**.
Expand Down
1 change: 1 addition & 0 deletions docs/ades.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
155 changes: 155 additions & 0 deletions docs/amp-orbs.md
Original file line number Diff line number Diff line change
@@ -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 <owner/repo>` 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.

<p>
<img src="images/amp-orbs-setup.png" alt="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" width="240">
<img src="images/amp-orbs-connected.png" alt="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" width="240">
</p>

## 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-<thread UUID>` | 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-<time>` | The orb image: Amp's official orb image, imported with `instabox snapshot import`. The `amp-orb-image.timer` imports it again each day. InstaADE keeps the newest one. |
| Import builder `amp-orb-builder-<provider ID>` | The sandbox that `instabox snapshot import` makes for an import and deletes once it is done. Its name holds the provider's ID: the program and removal delete a builder only with this name and the import's mark, never an import of yours. |
| Snapshots `amp-orb-snap-<project>-<time>-<tag>` | A project's saved orb, when Amp asks to save it on pause. The random tag gives each pause its own snapshot, also when two orbs of a project pause in the same second. The next orb of that project starts from the newest. A pause deletes only the older ones. |
| The instabox key `Amp orbs` | A workspace key with read, write and delete on sandboxes and snapshots. It is good for 365 days. Only the provider has it, in `/etc/amp-orbs/key`, which only root reads. systemd hands it to the provider's services. The installers that setup runs never get it. |
| Tools on the provider | The instabox CLI at the version InstaADE pins, installed only when its npm tarball has the hash InstaADE knows. Amp's CLI from npm, which checks it against the registry's hash. Amp's CLI is not pinned: Amp's server and CLI change together. |
| This computer | Nothing runs here. InstaADE only sets the provider up, shows its status and removes it. |

### What the dispatch program does

Amp runs `amp-orbs` with `ORB_OPERATION` set to one of:

- **spawn**: finds the orb sandbox of the thread, or creates it from the project's snapshot, else from the newest base snapshot. It resumes or starts a paused or stopped orb. When the orb does not have the size of its orb type, instabox restarts it at that size. Then it starts `amp orb bootstrap` on the orb.
- **pause**: saves a snapshot when Amp asks for one, then pauses the orb. instabox cannot save a paused sandbox, so a paused orb wakes first.
- **delete**: deletes the orb sandbox.

Each orb sandbox carries `instabox-role=amp-orb` and `amp-orb-id=<orb ID>` in its metadata. The program never touches a sandbox without both, also when its name matches.

### In InstaADE

- The list shows the provider and the orbs with their role: **Amp orbs provider · always on**, **Amp orb · working on a thread** or **Amp orb · paused by Amp**.
- **Open thread** opens the orb's thread at ampcode.com.
- Orbs have no ADE, power or delete in InstaADE. Amp manages them. **Look inside** opens a terminal on one.
- The tray menu leaves out the provider and the orbs.

<p>
<img src="images/amp-orbs-list.png" alt="The sandbox list in Amp mode: amp-orb-provider labeled Amp orbs provider, always on, with Status; and two orbs, one working on a thread and one paused by Amp, each with Open thread" width="240">
</p>

## Orb sizes

A thread can pick an orb type in Amp. The name of the type gives the size of its orb sandbox. To offer sizes:

1. In Amp's orb provider settings, open the **Edit** dialog of the `instabox` provider.
2. Under **Orb types**, add a name for each size from the table below, and select the default.
3. In a new thread, click **Orb**, pick `instabox` under **Self-Hosted**, then pick a type. From the CLI: `amp -ox "…" --orb-provider instabox --orb-size large`.

| Orb type | Orb sandbox |
| --- | --- |
| `small` | 2 vCPU / 4 GB |
| `medium` | 4 vCPU / 8 GB |
| `large` | 8 vCPU / 16 GB |
| `xlarge` or `xxlarge` | 16 vCPU / 32 GB |
| vCPUs x GB, such as `32x64` | That size |

- The names are those of Amp's own orb sizes. Case does not matter, and an `a1.` in front is fine.
- Your plan must allow the size. If it does not, the orb does not start, and the thread's setup log in Amp says why.
- A type with another name does not start an orb. The thread's setup log lists the names above.
- An orb starts at the size of its snapshot. When its type asks for another size, instabox restarts it at that size before Amp starts in it. The files stay. A new orb that cannot get its size is deleted.
- Amp does not let you rename a type once you save it. Deleting a type stops every thread on it.

An orb's details in InstaADE show the size it got:

<p>
<img src="images/amp-orbs-orb.png" alt="An orb's details: Amp manages this sandbox, Open thread in Amp, status Paused, auto sleep Amp decides, size 8 vCPU / 16 GB, and a terminal to look inside" width="240">
</p>

## Costs

Prices are from [instabox pricing](https://instabox.sh/pricing): $0.004 per vCPU-hour and $0.00225 per GiB-hour.

- The provider, 2 vCPU / 4 GB, runs all the time: about $12 a month.
- Each orb bills like any sandbox. A 4 vCPU / 8 GB orb costs $0.034 an hour while it runs, and an 8 vCPU / 16 GB orb $0.068.
- Snapshots use storage. InstaADE keeps one base snapshot, and one snapshot of each project.

## The instabox key

The key renews itself in its last 30 days. InstaADE reads the provider's status when it lists the provider, twice a day while it runs, and on the Amp orbs page. A read in the last 30 days makes a new key, installs it, and revokes the old one. **Repair** also makes a new key.

InstaADE finds the old keys by their name, `Amp orbs`, in the workspace's key list, not on the provider. So it revokes them also when the provider cannot answer. A new key replaces them only once it is installed. When an old key stays valid, InstaADE says so, and **Repair** tries again.

Two InstaADE apps can renew or repair at the same time, for example two admins of a team workspace. The provider installs one key at a time and keeps the newest one: the key that expires last. An app whose key is older revokes its own key. No app revokes a key newer than its own, so none revokes the key the provider uses.

If InstaADE does not run in those 30 days, the key expires and Amp cannot start orbs. Open the Amp orbs page and click **Repair**.

## In a team workspace

Every member of a team workspace can open a shell on each of its sandboxes, as on any sandbox there. The provider and the orbs are no exception. So every member can read:

- the provider's instabox key,
- the Amp sign-in of the person who connected the provider, and the provider's Amp token,
- the work of each thread on its orb.

Set up Amp orbs in a team workspace only if you trust its members with that.

A member who leaves the workspace keeps what they read. When someone leaves, click **Repair** on the Amp orbs page: InstaADE makes a new instabox key and revokes the old ones. InstaADE cannot replace the Amp sign-in or the Amp token for you.

## Remove it

1. Delete the threads of the orbs in Amp first. Amp then deletes their sandboxes.
2. On the Amp orbs page, click **Remove Amp orbs**, then **Confirm remove**.

InstaADE refuses while orb sandboxes are left. Amp deletes an orb only while the provider's service runs, so InstaADE first starts the service if it is stopped. Then it does these steps in order:

1. It stops the provider's service, so Amp can start no new orb, and marks the provider as being removed. While the mark lasts, a setup, **Repair** or key renewal in another InstaADE changes nothing on the provider. Then InstaADE reads the sandboxes from the API again. If Amp started an orb meanwhile, InstaADE starts the service again, clears the mark and refuses. If the service does not start, InstaADE says so: click **Remove Amp orbs** again to start it.
2. It deletes the provider's import builder, if one is left, and every orb snapshot of the workspace, with your sign-in. Orb snapshots are named `amp-orb-base-<time>` and `amp-orb-snap-<project>-<time>-<tag>`. A snapshot of yours whose name only starts alike, such as `amp-orb-base-backup` or `amp-orb-base-1800000000-0a1b2c3d`, stays. No orb starts from one either.
3. It revokes every `Amp orbs` key of the workspace. It lists them after step 1, so a key that another InstaADE made meanwhile goes too.
4. It deletes the provider sandbox.

Each step must succeed before the next one starts. If one fails, click **Remove Amp orbs** again: it finishes what is left, also after the keys are revoked. The mark of step 1 lasts 30 minutes, so **Repair** works again 30 minutes after a removal that did not finish. instabox stays in Amp as a provider until you remove it there. Delete it in Amp's orb settings before you set Amp orbs up again: Amp does not add a second provider named `instabox`.

## Limits

- One provider per workspace. To use another workspace, pick it in the list's footer and set it up there.
- The orb image is linux/amd64.
- An orb type sets only vCPUs and memory. It gives no GPU and no other image.
- The dispatch program gives up on spawn and delete after about 5 minutes, and on a pause with a snapshot after about 10 minutes. A slower wake, resize or save fails that operation in Amp.
- Amp's orb provider API can change. The program follows Amp's dispatch interface: `ORB_OPERATION`, `ORB_ID`, `ORB_TOKEN`, `ORB_SNAPSHOT_ID`, `ORB_IMAGE`, `ORB_TYPE` and `AMP_URL`.

## Troubleshooting

- **"Only an owner or admin of this workspace can set up Amp orbs"** (or **remove**): ask an owner or admin to do it.
- **The image failed**: click **Build again** on the setup step, or **Rebuild image** once connected. The log is `journalctl -u amp-orb-image` on the provider.
- **"Amp did not add the provider"** in the sign-in terminal, after Amp says `A provider named "instabox" already exists`: Amp still has `instabox` from an earlier setup, for example one you removed. Delete it in Amp's orb settings, then click **Open sign-in terminal** again. Its orb types go with it: add them to the new `instabox` again (see [Orb sizes](#orb-sizes)).
- **"Amp saved no new token for instabox"** in the sign-in terminal: Amp already has a provider named `instabox`, made elsewhere. Delete it in Amp's orb settings, then click **Open sign-in terminal** again.
- **"instabox does not know orb type …"** in the thread's setup log: the provider has an orb type with a name not in [Orb sizes](#orb-sizes). Amp cannot rename it, so add a type with a name from the table, and pick that one.
- **"Amp orbs are being removed from this workspace"** on setup or **Repair**: a removal runs, or one did not finish in the last 30 minutes. Click **Remove Amp orbs** to finish it, or click **Repair** once the 30 minutes are over.
- **Amp does not start orbs**: open the Amp orbs page. If a step is not ticked, click **Repair**. The provider's log is `journalctl -u amp-orb-provider`.
- **"A sandbox named amp-orb-provider is already in this workspace"**: InstaADE did not make that sandbox, so setup does not take it over. Rename or delete it, then set up again.
Binary file added docs/images/amp-orbs-connected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/amp-orbs-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/amp-orbs-orb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/amp-orbs-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src-tauri/assets/amp-orbs/amp-orb-image.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Import Amp's orb image as the base snapshot of new orbs
After=network-online.target instabox-data-init.service
Wants=network-online.target
RequiresMountsFor=/data

[Service]
Type=oneshot
User=__USER__
EnvironmentFile=/etc/amp-orbs/env
# The instabox key: only root reads the file, and systemd reads it before it drops to the user.
EnvironmentFile=/etc/amp-orbs/key
WorkingDirectory=__HOME__
ExecStart=/usr/local/bin/amp-orbs image build
TimeoutStartSec=2h
10 changes: 10 additions & 0 deletions src-tauri/assets/amp-orbs/amp-orb-image.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Update the Amp orb image every day

[Timer]
OnCalendar=daily
RandomizedDelaySec=1h
Persistent=true

[Install]
WantedBy=timers.target
19 changes: 19 additions & 0 deletions src-tauri/assets/amp-orbs/amp-orb-provider.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Description=Amp orbs provider for instabox
After=network-online.target instabox-data-init.service
Wants=network-online.target
RequiresMountsFor=/data
StartLimitIntervalSec=0

[Service]
User=__USER__
EnvironmentFile=/etc/amp-orbs/env
# The instabox key: only root reads the file, and systemd reads it before it drops to the user.
EnvironmentFile=/etc/amp-orbs/key
WorkingDirectory=__HOME__
ExecStart=/usr/local/bin/amp-orbs serve
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
Loading
Loading