Build
Tabs agents build
Agents can make tabs without a server for a space: a dashboard of its tasks, a tracker a team keeps, a small tool. Whichever way they make one, it's proposed first. The person who asked sees a card with its files, what it reads and a live Preview, and the tab is added only when they approve. They must be someone who may add tabs to the space. Nothing is kept before that.
Agents can also make the workspace's Home page. There are two ways to make either, and the agent picks one by size.
How they look
Agents are told to make their tabs look like the rest of the workspace: they link the design language the workspace serves beside every tab (tands-design/tabs-and-spaces.css), connect with connect({ applyTheme: true }), and build from its ts- parts and tokens rather than colours of their own. The starter on their computers does the same, with an <Icon> for the workspace's icons.
Small: written directly
For a page and a little script, the agent writes the files as text and calls tabs_and_spaces_make_tab with files ({ path: text }, with an index.html), a name, a description and the permissions it reads.
- Up to 40 files, 120,000 characters each and 300,000 in all.
- Text files only (HTML, CSS, JavaScript, JSON, SVG): no pictures or fonts.
- To change a tab, the agent reads its files with
tabs_and_spaces_read_tab_files, then callsmake_tabwith itsapp_id. Files it leaves out stay as they are.
Bigger: built on its computer
For anything bigger (several screens, a framework, pictures or fonts), the agent builds on its own computer and sends the result whole.
It starts from the starter. On our sandbox image, the guide and starter are in
/opt/tands/apps. Elsewhere, the agent installs them with the kit, into/workspace/.tands/apps.It builds. It edits the starter, or asks Claude Code to, where Claude Code is on.
It checks.
npm run build && npm run check.It sends the build folder.
tabs_and_spaces_tab_upload_linkwithfolder(like/workspace/apps/tracker/dist) gives it a command to run once, within 30 minutes:shcd '/workspace/apps/tracker/dist' && python3 -m zipfile -c /tmp/tands-tab-x7k2.zip . \ && curl -fsS -T /tmp/tands-tab-x7k2.zip 'https://…/api/agent-uploads/…'; rm -f /tmp/tands-tab-x7k2.zipThe API reads it as a bundle at once (the same limits as an upload: 10 MB, 300 files, 5 MB a file) and answers with an
uploadid. A file that isn't a bundle is refused with why, and the link can be used again.It proposes it.
tabs_and_spaces_make_tabwithupload(that id) instead offiles, plusname,descriptionandpermissions.
What happens to what it sent:
- An upload belongs to the agent that sent it and the person it was working for, and can be proposed for a day.
- A whole folder zipped (one folder at the top, holding the
index.html) is taken as that folder. - The SDK: its own copy of
tands-sdk.jsis replaced with the workspace's current one. - The manifest: its
tands.jsonis used, with thename,descriptionandpermissionsfrom the call. Without one, one is made. A new tab always gets a fresh app id. - A changed tab: with
app_idandupload, the upload is the whole tab, and every file it had is replaced. - Until it's decided, the proposed bundle is kept in the workspace's own storage. The preview serves its files, pictures included, with the same rules as a kept tab. Approving it keeps it as the space's own app, and the proposal's copy goes. Copies nobody decided on are cleared after two weeks.
The card lists the first 12 files, then how many more. The audit log records the app as uploaded by the agent, from: computer.
Home pages
With home: true, make_tab proposes the workspace's Home page instead of a tab: the first page everyone sees, outside any space. It's written or built the same way, from the same starter.
- Who. Only a workspace owner or admin can have one made. When someone else asks, the agent is told so, and can make it a tab instead.
- Where. It can be asked for in any space or direct message. The proposal is the workspace's app, not the space's own, so it may ask for any read.
- Its manifest. The agent's
tands.jsongets ahomepage (id: "home", the same page as its tab) if it has none. Every app offers a tab, so the page is one too, and spaces can add it. - The preview shows it as Home would:
tands.context.spaceis null, and reads look across the workspace. - Approved, the app is kept for the whole workspace and becomes its Home, as if the owner or admin had chosen it in Settings → General. The card links to Home. The audit log marks the upload
home: true. - Changing it.
read_tab_filesmarks ithome_page: true. A new version throughmake_tabwith itsapp_idchanges the page in place. Only owners and admins may.
A space's own tab can't become a Home page: its proposal is refused with why, and the agent makes a new one with home: true. A tands.json that offers a home page without home: true is refused too.
The starter
A React 19 and Vite 8 project, set up for a tab:
// vite.config.js
export default defineConfig({
base: "./", // every path relative: the tab is served under a ticket, not at /
plugins: [react()],
build: {
outDir: "dist",
assetsDir: "", // files beside index.html
assetsInlineLimit: 0, // pictures and fonts as files
rollupOptions: {
external: ["tands-sdk"], // never bundled: the workspace adds ./tands-sdk.js
output: { paths: { "tands-sdk": "./tands-sdk.js" } },
},
},
});// src/main.jsx
import { connect } from "tands-sdk";
const tands = await connect();
document.documentElement.dataset.theme = tands.theme; // "light" | "dark"
tands.onTheme((theme) => (document.documentElement.dataset.theme = theme));public/tands.jsonis the manifest: its name, thepermissionsit reads, and its data underdata.collections.src/style.csshas light and dark colours keyed ondata-theme.CLAUDE.mdtells Claude Code what a tab can't do, the SDK's calls, and which permissions need an owner or admin, so it follows the same rules as the agent.- On our image and with the kit, its packages are already installed, so it builds without the internet. Other npm packages need the computer's internet access.
npm run check refuses a dist/ that:
- loads anything from elsewhere (a
src,href, CSSurl()orimportof anhttp(s)://or//address); - has a path starting with
/in its HTML; - has no
index.htmlortands.json, or atands.jsonwithouttabs; - is over the limits.
The starter lives in the repository at deploy/openclaw/apps. The API serves the same files for the kit (GET /api/agent-kit/apps.tar.gz, generated into apps/api/src/agents/appKit.generated.ts by node scripts/app-kit.mjs).
The App builder
The App builder is an agent in the marketplace (by Tabs & Spaces). It asks what the tab (or the workspace's Home page) should show or do and what it reads, then builds it:
- small ones directly;
- bigger ones from the starter, with Claude Code where it's on;
- always built and checked before it's proposed;
- asking only for the reads the tab uses;
- calm in light and dark, and readable on a phone.
It keeps each tab's folder, so it can change the tab later. It never loads anything from the internet in a tab, never puts secrets in its files, and never builds something that imitates another product.
Its computer needs internet access to send what it builds. Someone who manages the space's tabs approves each one.
Refusals
| When | What the agent is told |
|---|---|
Both files and upload | Give one of them |
An upload that isn't this agent's, for this person, or is over a day old | There's no upload by that id: send the folder again |
No index.html (or tands.json) | It needs an index.html |
| Reads only an owner or admin may give, in a space's own tab | Which ones, and who may give them |
| A file type a bundle can't hold, or over the limits | Which file, and the limit |
| The person can't add tabs to the space | Only the people who manage its tabs can |
home: true for someone who isn't an owner or admin | Only owners and admins choose the Home; make it a tab |
home: true with a space's own tab's app_id | A Home page is the workspace's: make a new one |
| The computer is offline | Write it as text, or ask an owner to turn internet access on |
The upload link's own answers: 400 with NOT_A_ZIP or INVALID; 413 TOO_LARGE; 404 for a link that's used or expired.