---
title: The Studio
summary: Building widgets and extensions inside SpaceMIX with the assistant - the Studio's tabs, one per building session, its start screen, switching a session between a widget and an extension, and for extensions the chat beside a live preview, the in-browser build, Studio projects, variations, a linked folder, install and publish.
audience: both
since: protocol 1
---

# The Studio

The Studio is where widgets and extensions are made in the app, with the assistant. Each thing being built has its own **session**: a chat beside a live preview. Open one with:

| What | Where |
|---|---|
| A new extension | **Create extension** in **Extensions** (the page header and the **My extensions** section), "New extension" in the command palette, or **+** → **New extension** in the Studio. |
| A new widget | **Create widget** in **Widgets** or on a dashboard, "New widget" in the command palette, or **+** → **New widget** in the Studio. |
| An existing one | **Open in Studio** in **My extensions**, **Edit in Studio** in a widget's menu, or **Edit a widget…** / **Edit an extension…** in the Studio's **+**. |
| The Studio itself | **Studio** in the server menu at the top left (on a phone, your avatar at the top right; under **Current server**), or "Studio" in the command palette. Either goes back to the tab shown last, else the rightmost open tab; with no tab open it shows the [start screen](#the-start-screen). |

A widget takes the `server:widgets` permission (**Widgets**) and an extension `server:extensions` (**Extensions**), which a member gets through the **Members** group unless someone took them off. The Studio makes what the person holds: only widgets, only extensions, or both. With neither it is closed. Entries for what they can't make aren't offered, and a link to one shows **Building needs a permission**. See [Who may create extensions and widgets](../reference/permissions.md#who-may-create-extensions-and-widgets).

The rest of this page covers the Studio's tabs, its start screen, switching a session between the two kinds, and building an extension. Building a widget in its session is in [Building a widget](../widgets/building.md#open-a-widget-session).

## Tabs: one per session

The Studio takes the whole window: the sidebar is hidden while it is open. Across the top is a row of tabs, as in a browser, one per open session (`apps/desktop/src/shell/studio/Studio.tsx`). Each tab shows the widget's or extension's name and icon, a spinner while the assistant is working or the extension is building, a breathing accent dot (**Waiting for you**) when the next move is yours, and a red dot when it shows an error. Under the tabs is the active session, with the header and body of its kind:

| Kind | Header and body |
|---|---|
| Extension | The **Edit**, **Code**, **Database**, **Settings** and **Publish** tabs (see [Studio projects](#studio-projects)). |
| Widget | **Save**, **Discard**, **Add to dashboard**, **Versions** and the **…** menu with **Settings** (see [Building a widget](../widgets/building.md)). The preview of a saved widget's draft works on a copy of its [store](../widgets/data.md#saving-data), so trying a change never touches the team's data. |

| Control | What it does |
|---|---|
| A tab | Shows that session. |
| **×** on a tab, or a middle click | Closes the tab. Nothing is deleted: the chat, the widget and the extension project stay, and the session comes back as a tab when it is opened again. Closing the active tab shows its right neighbour, else its left; closing the last one shows the [start screen](#the-start-screen). |
| Dragging a tab | Moves it in the row. |
| **+** | **New widget** or **New extension**: a new session in a new tab. Below them, **Edit a widget…** and **Edit an extension…** each open a searchable list (`apps/desktop/src/shell/studio/StudioPicker.tsx`): those already open in a tab first, under **Open in a tab**, then the rest, the most recently edited first. With nothing to list it offers **New widget** or **New extension** instead. **Edit a widget…** lists this server's widgets (`WidgetPicker.tsx`), each with when it was last edited and a **Not saved** or **Unsaved changes** note; picking one opens it in a tab, in its own Studio chat if that still exists, as **Edit in Studio** in the gallery does, and a teammate's never-saved widget is [reviewed first](../widgets/building.md#save-discard-and-unsaved-widgets) there too. **Edit an extension…** lists your Studio projects on this server (`ExtensionPicker.tsx`), each with when it was last edited, its version or **Not built yet**, and **Newest edits on \<server\>** when another server has them; picking one opens it as **Open in Studio** in **My extensions** does (see [Studio projects](#studio-projects)), in a tab and in the project's own chat. Last in the menu, after a separator, is **Sound when waiting: on** / **off**. |
| Back (the arrow at the left) | Leaves the Studio: to **Widgets** when the active session builds a widget, to **My extensions** when it builds an extension. On the start screen the same arrow (**Leave Studio**) goes back where you came from, see [The start screen](#the-start-screen). |

A session in a tab that isn't showing keeps running: the assistant goes on replying and building there.

The open tabs are remembered on the device, for each server and each account signed in on it (in `localStorage`, `apps/desktop/src/lib/studioTabs.ts`). At most 12 are open at once (`MAX_STUDIO_TABS`); opening another closes the leftmost tab whose session isn't replying. A tab whose chat was deleted goes away.

Studio chats don't show in the chat list; you reach them through their tab, the start screen's **Recent sessions**, their widget or their extension.

### Waiting for you

When a session's assistant finishes its turn (a reply or an error), or asks a question (an approval, the switch question), the next move is yours. The Studio plays a soft two-tone sound and marks that session's tab with **Waiting for you**, unless you are looking right at it (its tab is showing and the window has focus); then it only plays the sound. The mark goes when you look at the session, send a message or answer the question, or close the tab. This works for hidden tabs too, and while you are elsewhere in the app. A turn after which the [prompt queue](#queued-prompts) sends the next prompt doesn't count.

**Sound when waiting** in the **+** menu turns the sound off or on, for this device (`localStorage`). The marks stay either way. The marks themselves are kept only in memory (`apps/desktop/src/lib/studioAttention.ts`).

### Queued prompts

While a session is working you can keep typing: the input says **Queue the next prompt…**, and what you send goes into a queue above it instead of interrupting. Each queued prompt is sent exactly as typed, one at a time, when the turn before it ends (`apps/desktop/src/lib/promptQueue.ts`, `apps/desktop/src/shell/studio/PromptQueue.tsx`). It keeps going in hidden tabs and after you leave the Studio.

| Control | What it does |
|---|---|
| A prompt's text | Edit it before it is sent. |
| Move up, Move down | Change the order. |
| Remove from queue | Takes that prompt out. |
| **Clear** | Empties the queue. |
| **Resume** | Shown while the queue is **Paused**: starts it again, sending the first prompt now if the session is idle. |

The queue waits while a question in the chat is unanswered. It pauses when a turn fails or a queued prompt couldn't start (no model connected, for example), so nothing piles onto an error. Queues are remembered on the device, for each server and account, like the tabs; a queue read back after a reload starts paused, so nothing is sent by surprise. Only Studio sessions queue; an ordinary chat doesn't.

### Which model a session uses

A Studio session's chat can run on a different model from ordinary chats, for example a stronger one for writing code. Set it in **Settings → Models** with **Studio model**, below the list of connected models: **Same as chats** (the default) or one of the connected models. The select is shown only when two or more models are connected, and the chosen model carries a **Studio** badge in the list. Changing it takes `server:settings` (see [Permissions](../reference/permissions.md#who-can-use-an-extension)).

A session's chat picks its model in this order (`apps/desktop/src/lib/models.ts`, `apps/desktop/src/lib/chats.ts`):

1. The model pinned to that chat with its model picker.
2. The Studio model (kv `shell/studioDefaultModel`, a connected model's id).
3. The chat default (kv `shell/defaultModel`), when the Studio model is unset or no longer connected.

In a Studio chat the model picker marks the model it falls back to with **· Studio default** instead of **· Default**. Removing the Studio model in **Settings → Models** clears the setting, so sessions go back to the chat default. Ordinary chats, `host.ai` and the [SpaceMIX API](../reference/api.md#assistant)'s assistant always use the chat default.

## The start screen

With no session showing, the Studio shows its start screen under the tab bar, at `#/@<server>/studio` (`STUDIO_VIEW` in `apps/desktop/src/lib/store.ts`, `apps/desktop/src/shell/studio/StudioStart.tsx`). It still has the whole window and the tabs that are open.

| Part | What it does |
|---|---|
| **Start** | Four cards, the same choices as the **+** menu (`apps/desktop/src/shell/studio/choices.tsx`): **New widget**, **New extension**, **Edit a widget…** and **Edit an extension…**. The two **Edit** cards open the same searchable lists as **+** does. |
| **Recent sessions** | Your 8 most recently updated Studio sessions, closed tabs included, newest first, each with its kind, **Open in a tab** when it is open, and how long ago it changed. Picking one opens it in a tab, with its chat. Not shown while there are none. |
| Back (the arrow at the left, **Leave Studio**) | Goes to the view the Studio was opened from in this window, or to Dashboards when the app was loaded straight into the Studio (`leaveStudio` in `apps/desktop/src/lib/studioTabs.ts`). |

## Switching between a widget and an extension

A widget is a small live view of data on a dashboard; an extension is an app with its own view, stored data, actions and tools. When the assistant sees that the other kind fits what you asked for better, it can offer to switch, at most once and early. The offer is a question in the chat, **Build a widget instead?** or **Build an extension instead?**, with the assistant's reason, what happens to what the session has made so far, and two buttons: **Keep building** and **Build a widget** (or **Build an extension**). You can also ask the assistant to switch.

On **Build a widget** or **Build an extension**, the same tab and the same conversation become a session of the other kind:

- A saved widget stays in **Widgets**, and an extension project stays in **My extensions**, but neither is tied to that chat any more. Open them again from there.
- A widget the session made and never saved is deleted, and the question says so by name. A never-saved widget the session took over from elsewhere (someone else's, or imported) is only untied.
- Unsaved changes to a saved widget stay as a draft, to finish from **Widgets**.

On **Keep building**, the session carries on with the same kind. Once answered, the question shrinks to one line, such as `Switched to building an extension`. For agents, the tool behind the question is `studio_switch` (see [For agents](../agents.md#switching-the-studio-session)).

## Building an extension

What an extension session works on is a **Studio project**: the Studio's copy of one extension's source files. It has nothing to do with the [Projects](../reference/projects.md) in the sidebar, which are a person's folders of chats and links.

Describe the extension you want. The assistant reads the API reference, writes the files and the Studio builds them, so the preview shows the real thing within seconds. What the assistant does in the Studio is described for agents in [For agents](../agents.md).

## How it builds

The Studio builds in the browser with `esbuild-wasm` and Tailwind's compiler (`apps/desktop/src/lib/extensionBuild.ts`) into the same `ExtensionPackage` the command-line build makes, `source` included (see [Package format](../reference/package-format.md)). Compared with the command-line build it is stricter:

- **Entry:** `index.tsx` or `index.ts`, default-exporting `{ manifest, View, actions?, mcp? }`.
- **Imports:** only your own files and the frame's modules (`HOST_MODULES`). Any other bare import is a build error.
- **Files:** `.ts`, `.tsx`, `.css`, `.json` and `.md` paths, relative and `/`-separated (`README.md` is the store page). At most 500 files and 8 MB of source. A file can be imported as text with `?raw`.
- **Size:** the built JS and CSS together may be at most 2 MB.
- **Manifest:** run through `defineExtension` again, so its checks apply even if your code skipped it. The name must be non-empty and the version semver (`1.0.0`, `1.0.0-beta.1`).
- **Warnings:** code that calls `getUserMedia` without the `camera` or `microphone` permission, or `getDisplayMedia` without `screen`, gets a warning, because the call will be refused.

## The preview

The preview is a real extension frame keyed `studio:<project>` (`apps/desktop/src/lib/extensionHost.ts`). It uses the extension's real data, and every permission whatever the manifest asks for (see [Studio previews](../reference/permissions.md#studio-previews)). For an extension that is already installed on the server, that means the preview opens only for someone who may use it; otherwise it says `<Name> isn't available to you.` A paid extension that is turned off on the server until it's paid for doesn't preview for anyone (`<Name> is turned off on this server until it's paid for.` to the people who may use it), and a paid extension's source opens in the Studio only for its publisher (see [Selling an extension](publishing.md#selling-an-extension)). Build errors and runtime errors go back to the assistant in the same turn, and **Ask to fix** sends them again. When the extension asks for the camera, microphone or screen, the switch for them is in the preview's bar.

## Studio projects

Studio projects belong to the person, not the team: they are rows of the per-user core tables `studio_projects` and `studio_files` on the server the Studio is open on (`apps/desktop/src/lib/extensionStudio.ts`). Every change that touches a file pushes the previous file set to the project's history, which keeps the last 10. There is no draft: every write is the project, and the preview follows the last successful build.

A Studio project lives on one server: **Open in Studio** in **My extensions** and **Edit an extension…** in the Studio's **+** open the project on the server you're on. To carry an extension to another server, use **Download package** and [Import from file](publishing.md#try-it-on-a-server).

An extension session's header has five tabs:

| Tab | What it shows |
|---|---|
| **Edit** | The chat beside the live preview. |
| **Code** | The project's source files, the entry first. |
| **Database** | The extension's collections and `host.storage` keys with their records: the extension's data on this server, which the preview shares with an installed copy. |
| **Settings** | The manifest's name, id, version, description and icon, edited in place; the permissions it asks for; **Extension files** (**Download package**, **History**, **Delete extension** or, never built, **Delete project**); and **Folder** (see [A folder on disk](#a-folder-on-disk)). |
| **Publish** | **Install on this server** / **Update on this server**, and publishing to SpaceMIX Hub, by exporting the package and uploading it at `{hub}/marketplace/sell/publish`. |

The controls, and who may use them, among those who have the Studio at all:

| Control | Where | Who | What it does |
|---|---|---|---|
| **History** | Settings | anyone | Restores an earlier file set; the current one takes its place in history. |
| **Download package** | Settings | anyone | Saves the last good build as a `.json` package, for [Import from file](publishing.md#try-it-on-a-server) on another server. |
| **Delete extension** | Settings | anyone | For a project that has been built. Opens the same dialog as the store's **Delete extension** (see [Deleting your own build](../reference/permissions.md#deleting-your-own-build)): delete your Studio projects for its id (sources and history; the chat stays), and, where it applies, uninstall your build from this server (`server:extensions`) and erase its data there (the server's owner only). A copy that is published stays where it is. |
| **Delete project** | Settings | anyone | For a project that was never built, in place of **Delete extension**: deletes its sources and history from the Studio. The chat stays. |
| **Install on this server** / **Update on this server** | Publish | `server:extensions` | Installs or updates the last good build as a local package, at once, for everyone with access to it. The owner can install any id. Anyone else gets a new id or their own earlier build, and the server's refusal shows beside the button (see [What a member may install](../reference/permissions.md#what-a-member-may-install)). |
| **Export package**, **Open the publish page** | Publish | anyone | Saves the last good build, and opens the Hub's publish page: upload the file at `{hub}/marketplace/sell/publish`, where `{hub}` is the Hub's address, signed in there with a SpaceMIX ID. That creates the registry listing, or a new version of it. A new version needs a higher `version` in the manifest. With the Hub off, only **Export package**. |

Installing and publishing are always the person's buttons. The assistant has no tool for them.

## Variations

A Studio project can have **variations**: other file sets to try an idea on, from the menu next to the project's name in the header. **New variation** starts one from the current files, and from then on the assistant, the preview and the other tabs work on it while main waits. On a variation the menu makes it main (main's files go into history) or discards it. Only main is installed and published; the **Publish** tab says so while a variation is open.

## A folder on disk

A project can follow a folder on the machine the server runs on, so a coding agent (Claude Code, Codex, Gemini CLI) or any editor works on the same files as the Studio. It's the server owner's control, in the Studio's **Settings** tab under **Folder**: give an absolute path (`~` works) and link it.

- A folder that already holds an extension (an `index.ts` or `index.tsx`) wins: its files replace the project's, and the ones that were there go into History. Otherwise the project's files are written into the folder, which is made if it doesn't exist; other files already there stay.
- From then on every write in the Studio goes to the folder too, and the server watches the folder (once a second) and pulls a change into the project, one History entry per change. Only the files `scripts/build-extensions.mjs` would keep as a package's source count: text files such as `.ts`, `.tsx`, `.css`, `.json` and `.md`, not `node_modules`, `dist` or anything starting with a dot.
- The folder is followed while the app is open anywhere, not only while the Studio is. **Pull now** reads it on demand, and the Studio pulls it when it opens on the project. **Unlink** stops the watch; the folder keeps its files.
- The files being edited are what's synced. While a variation is being edited, the folder follows the variation.
- Nothing is installed or published by a pull. Install on this server, Update on this server and Publish stay the person's buttons in the **Publish** tab, so a folder edited by an agent is reviewed in the preview first.

For an extension developed on another machine, [Import from file](publishing.md) brings its package into a project here the same way, as a one-off.

## Ids

A Studio project's id defaults to `<handle>.<name>`: the handle comes from the first name of the SpaceMIX ID account, or with no SpaceMIX ID session of the local account on this server, else its email, else `local`, lowercased with everything but letters and digits removed; the name is the project name as a slug of at most 24 characters. SpaceMIX Hub reserves the `ai.spacemix.`, `dev.operator.` and `core.` prefixes by default, so only the Hub's named publishers and admins can publish under them, new listings and new versions alike; `dev.operator.`, the ids from before the rename, is refused for everyone. See [Publishing](publishing.md).

A package brought into the Studio, with **Import from file** or with **Open in Studio** on an extension you have no Studio project for yet (from this server's installs or from SpaceMIX Hub), must have a manifest id that `defineExtension` accepts (`^[a-z0-9]+(\.[a-z0-9-]+)+$`, `EXTENSION_ID` in `apps/desktop/src/lib/extensionStudio.ts`). Otherwise nothing is imported and the error is `That package's extension id isn't valid: an id is lower-case letters, digits and dashes in dot-separated parts, like "acme.habits".`
